diff --git a/composer.json b/composer.json index 8e6678ac737b4c93ca7c2177cee889f83275f00b..704651a91b452514d702a00b74a55b48769b82e2 100644 --- a/composer.json +++ b/composer.json @@ -184,7 +184,7 @@ "drupal/webform": "5.0-rc12", "drupal/webform_views": "5.0-alpha2", "drush-ops/behat-drush-endpoint": "^0.0.5", - "drush/drush": "^8.2.3", + "drush/drush": "^9", "enyo/dropzone": "^5.1", "gdsmith/jquery.easing": "1.4.1", "oomphinc/composer-installers-extender": "^1.1", diff --git a/composer.lock b/composer.lock index e9fa257a0d76cc1535a9ba80b3a6a35c4334cf97..c322193564414e708a51720ee4b66c197c58b0fd 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_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", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b4f6e778c963af4d637b16d02fcdea64", + "content-hash": "aa81270e2e85d443efc37b11ffb23074", "packages": [ { "name": "alchemy/zippy", @@ -168,14 +168,57 @@ "description": "Backports unserialize options introduced in PHP 7.0 to older PHP versions.", "time": "2017-02-03T09:55:47+00:00" }, + { + "name": "chi-teck/drupal-code-generator", + "version": "1.30.3", + "source": { + "type": "git", + "url": "https://github.com/Chi-teck/drupal-code-generator.git", + "reference": "1da9f06843b6bf2b0e7d28fea4b6c1d79aead197" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/1da9f06843b6bf2b0e7d28fea4b6c1d79aead197", + "reference": "1da9f06843b6bf2b0e7d28fea4b6c1d79aead197", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.5.9", + "symfony/console": "^3.4 || ^4.0", + "symfony/filesystem": "^2.7 || ^3.4 || ^4.0", + "twig/twig": "^1.38.2 || ^2.10" + }, + "bin": [ + "bin/dcg" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "files": [ + "src/bootstrap.php" + ], + "psr-4": { + "DrupalCodeGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Drupal code generator", + "time": "2019-06-29T10:29:45+00:00" + }, { "name": "ckeditor/indentblock", "version": "4.8.0", "dist": { "type": "zip", - "url": "https://download.ckeditor.com/indentblock/releases/indentblock_4.8.0.zip", - "reference": null, - "shasum": null + "url": "https://download.ckeditor.com/indentblock/releases/indentblock_4.8.0.zip" }, "require": { "composer/installers": "~1.0" @@ -532,25 +575,590 @@ }, "phpunit4": { "require-dev": { - "phpunit/phpunit": "^4.8.36" + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2019-03-08T16:55:03+00:00" + }, + { + "name": "consolidation/config", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2019-03-03T19:37:04+00:00" + }, + { + "name": "consolidation/filter-via-dot-access-data", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/filter-via-dot-access-data.git", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/filter-via-dot-access-data/zipball/a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Filter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.", + "time": "2019-01-18T06:05:07+00:00" + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "99ec998ffb697e0eada5aacf81feebfb13023605" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/99ec998ffb697e0eada5aacf81feebfb13023605", + "reference": "99ec998ffb697e0eada5aacf81feebfb13023605", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5.7.27", + "squizlabs/php_codesniffer": "^2.7", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony3": { + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "config": { + "platform": { + "php": "5.6.32" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2019-05-30T23:16:01+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.4.9", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.10.2", + "consolidation/config": "^1.2", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.4", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2019-03-19T18:07:19+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "consolidation/site-alias", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-alias.git", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-alias/zipball/8cfd3b6ab6d541086fc970bf850864293b284e6f", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4", + "symfony/yaml": "~2.3|^3" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" }, "remove": [ "php-coveralls/php-coveralls" ], "config": { "platform": { - "php": "5.4.8" + "php": "5.6.33" } } } }, "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Consolidation\\AnnotatedCommand\\": "src" + "Consolidation\\SiteAlias\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -558,100 +1166,71 @@ "MIT" ], "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" } ], - "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2019-03-08T16:55:03+00:00" + "description": "Manage alias records for local and remote sites.", + "time": "2019-03-12T17:31:48+00:00" }, { - "name": "consolidation/output-formatters", - "version": "3.5.0", + "name": "consolidation/site-process", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/consolidation/output-formatters.git", - "reference": "99ec998ffb697e0eada5aacf81feebfb13023605" + "url": "https://github.com/consolidation/site-process.git", + "reference": "e25265f4a48c13284ebb6f9e0906ecd415d451df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/99ec998ffb697e0eada5aacf81feebfb13023605", - "reference": "99ec998ffb697e0eada5aacf81feebfb13023605", + "url": "https://api.github.com/repos/consolidation/site-process/zipball/e25265f4a48c13284ebb6f9e0906ecd415d451df", + "reference": "e25265f4a48c13284ebb6f9e0906ecd415d451df", "shasum": "" }, "require": { - "dflydev/dot-access-data": "^1.1.0", - "php": ">=5.4.0", - "symfony/console": "^2.8|^3|^4", - "symfony/finder": "^2.5|^3|^4" + "consolidation/config": "^1.2.1", + "consolidation/site-alias": "^3", + "php": ">=5.6.0", + "symfony/process": "^3.4" }, "require-dev": { + "consolidation/robo": "^1.3", "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", "php-coveralls/php-coveralls": "^1", - "phpunit/phpunit": "^5.7.27", - "squizlabs/php_codesniffer": "^2.7", - "symfony/var-dumper": "^2.8|^3|^4", - "victorjonsson/markdowndocs": "^1.3" - }, - "suggest": { - "symfony/var-dumper": "For using the var_dump formatter" + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8" }, "type": "library", "extra": { "scenarios": { - "symfony4": { - "require": { - "symfony/console": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^6" - }, - "config": { - "platform": { - "php": "7.1.3" - } - } - }, - "symfony3": { - "require": { - "symfony/console": "^3.4", - "symfony/finder": "^3.4", - "symfony/var-dumper": "^3.4" - }, - "config": { - "platform": { - "php": "5.6.32" - } - } - }, - "symfony2": { - "require": { - "symfony/console": "^2.8" - }, + "phpunit5": { "require-dev": { - "phpunit/phpunit": "^4.8.36" + "phpunit/phpunit": "^5.7.27" }, "remove": [ "php-coveralls/php-coveralls" ], "config": { "platform": { - "php": "5.4.8" + "php": "5.6.33" } - }, - "scenario-options": { - "create-lockfile": "false" } } }, "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "0.x-dev" } }, "autoload": { "psr-4": { - "Consolidation\\OutputFormatters\\": "src" + "Consolidation\\SiteProcess\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -659,13 +1238,48 @@ "MIT" ], "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" } ], - "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2019-05-30T23:16:01+00:00" + "description": "A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.", + "time": "2019-06-04T22:23:52+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" }, { "name": "cweagans/composer-patches", @@ -726,9 +1340,7 @@ "version": "4.2.0", "dist": { "type": "zip", - "url": "https://github.com/desandro/masonry/archive/v4.2.0.zip", - "reference": null, - "shasum": null + "url": "https://github.com/desandro/masonry/archive/v4.2.0.zip" }, "type": "drupal-library" }, @@ -5333,8 +5945,7 @@ "homepage": "https://www.drupal.org/project/migrate_devel", "support": { "source": "http://cgit.drupalcode.org/migrate_devel" - }, - "time": "2017-06-25T23:46:13+00:00" + } }, { "name": "drupal/migrate_plus", @@ -7643,65 +8254,109 @@ }, { "name": "drush/drush", - "version": "8.2.3", + "version": "9.7.1", "source": { "type": "git", "url": "https://github.com/drush-ops/drush.git", - "reference": "bf2b2471b9410e0ff4adc23aee020ee1aff28610" + "reference": "6f9a8d235daec06fd6f47b2d84da675750566479" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drush-ops/drush/zipball/bf2b2471b9410e0ff4adc23aee020ee1aff28610", - "reference": "bf2b2471b9410e0ff4adc23aee020ee1aff28610", + "url": "https://api.github.com/repos/drush-ops/drush/zipball/6f9a8d235daec06fd6f47b2d84da675750566479", + "reference": "6f9a8d235daec06fd6f47b2d84da675750566479", "shasum": "" }, "require": { - "consolidation/annotated-command": "^2.12.0", - "consolidation/output-formatters": "~3", - "pear/console_table": "~1.3.1", - "php": ">=5.4.5", + "chi-teck/drupal-code-generator": "^1.28.1", + "composer/semver": "^1.4", + "consolidation/annotated-command": "^2.12", + "consolidation/config": "^1.2", + "consolidation/filter-via-dot-access-data": "^1", + "consolidation/output-formatters": "^3.3.1", + "consolidation/robo": "^1.4.6", + "consolidation/site-alias": "^3.0.0@stable", + "consolidation/site-process": "^2.0.3", + "ext-dom": "*", + "grasmash/yaml-expander": "^1.1.1", + "league/container": "~2", + "php": ">=5.6.0", "psr/log": "~1.0", "psy/psysh": "~0.6", - "symfony/console": "~2.7|^3", - "symfony/event-dispatcher": "~2.7|^3", - "symfony/finder": "~2.7|^3", - "symfony/var-dumper": "~2.7|^3", - "symfony/yaml": "~2.3|^3", - "webflo/drupal-finder": "^1.1.0", - "webmozart/path-util": "~2" + "symfony/console": "^3.4", + "symfony/event-dispatcher": "^3.4", + "symfony/finder": "^3.4 || ^4.0", + "symfony/process": "^3.4", + "symfony/var-dumper": "^3.4 || ^4.0", + "symfony/yaml": "^3.4", + "webflo/drupal-finder": "^1.1", + "webmozart/path-util": "^2.1.0" }, "require-dev": { - "phpunit/phpunit": "4.*", - "symfony/console": "~2.7", - "symfony/event-dispatcher": "~2.7", - "symfony/finder": "~2.7", - "symfony/process": "2.7.*", - "symfony/var-dumper": "~2.7", - "symfony/yaml": "~2.3" - }, - "suggest": { - "drush/config-extra": "Provides configuration workflow commands, such as config-merge.", - "ext-pcntl": "*" + "composer/installers": "^1.2", + "cweagans/composer-patches": "~1.0", + "drupal/alinks": "1.0.0", + "drupal/devel": "^2", + "drupal/empty_theme": "1.0", + "g1a/composer-test-scenarios": "^3", + "lox/xhprof": "dev-master", + "phpunit/phpunit": "^4.8.36 || ^6.1", + "squizlabs/php_codesniffer": "^2.7 || ^3", + "vlucas/phpdotenv": "^2.4", + "webflo/drupal-core-require-dev": "8.7.x-dev", + "webflo/drupal-core-strict": "8.7.x-dev" }, "bin": [ - "drush", - "drush.launcher", - "drush.php", - "drush.complete.sh" + "drush" ], "type": "library", "extra": { + "installer-paths": { + "sut/core": [ + "type:drupal-core" + ], + "sut/libraries/{$name}": [ + "type:drupal-library" + ], + "sut/modules/unish/{$name}": [ + "drupal/devel" + ], + "sut/themes/unish/{$name}": [ + "drupal/empty_theme" + ], + "sut/modules/contrib/{$name}": [ + "type:drupal-module" + ], + "sut/profiles/contrib/{$name}": [ + "type:drupal-profile" + ], + "sut/themes/contrib/{$name}": [ + "type:drupal-theme" + ], + "sut/drush/contrib/{$name}": [ + "type:drupal-drush" + ] + }, + "scenarios": { + "php5": { + "config": { + "platform": { + "php": "5.6.38" + } + }, + "require-dev": { + "webflo/drupal-core-strict": "8.6.x-dev", + "webflo/drupal-core-require-dev": "8.6.x-dev" + } + } + }, "branch-alias": { - "dev-master": "8.0.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { - "psr-0": { - "Drush": "lib/", - "Consolidation": "lib/" - }, "psr-4": { - "Drush\\": "src/" + "Drush\\": "src/", + "Drush\\Internal\\": "src/internal-forks" } }, "notification-url": "https://packagist.org/downloads/", @@ -7717,14 +8372,6 @@ "name": "Owen Barton", "email": "drupal@owenbarton.com" }, - { - "name": "Mark Sonnabaum", - "email": "marksonnabaum@gmail.com" - }, - { - "name": "Antoine Beaupré", - "email": "anarcat@koumbit.org" - }, { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" @@ -7752,7 +8399,7 @@ ], "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", "homepage": "http://www.drush.org", - "time": "2019-04-03T04:20:26+00:00" + "time": "2019-06-30T19:46:39+00:00" }, { "name": "easyrdf/easyrdf", @@ -8035,6 +8682,101 @@ ], "time": "2018-06-21T15:58:36+00:00" }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, { "name": "guzzlehttp/guzzle", "version": "6.3.3", @@ -8400,6 +9142,71 @@ "description": "Highlight PHP code in terminal", "time": "2018-09-29T18:48:56+00:00" }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, { "name": "masterminds/html5", "version": "2.6.0", diff --git a/vendor/bin/dcg b/vendor/bin/dcg new file mode 120000 index 0000000000000000000000000000000000000000..3a138a5dd7bf97a8189b546ddd807f14b0b0993d --- /dev/null +++ b/vendor/bin/dcg @@ -0,0 +1 @@ +../chi-teck/drupal-code-generator/bin/dcg \ No newline at end of file diff --git a/vendor/bin/drush.complete.sh b/vendor/bin/drush.complete.sh deleted file mode 120000 index aee5344482c8e106905c6b623d303a1e4dd80354..0000000000000000000000000000000000000000 --- a/vendor/bin/drush.complete.sh +++ /dev/null @@ -1 +0,0 @@ -../drush/drush/drush.complete.sh \ No newline at end of file diff --git a/vendor/bin/drush.launcher b/vendor/bin/drush.launcher deleted file mode 120000 index c819c06feb4c7b57ccbfee60d5df9b19957889f4..0000000000000000000000000000000000000000 --- a/vendor/bin/drush.launcher +++ /dev/null @@ -1 +0,0 @@ -../drush/drush/drush.launcher \ No newline at end of file diff --git a/vendor/bin/drush.php b/vendor/bin/drush.php deleted file mode 120000 index 20292bbae5771d2bf6e45fe2f262a944ea4f4a52..0000000000000000000000000000000000000000 --- a/vendor/bin/drush.php +++ /dev/null @@ -1 +0,0 @@ -../drush/drush/drush.php \ No newline at end of file diff --git a/vendor/bin/release b/vendor/bin/release new file mode 120000 index 0000000000000000000000000000000000000000..05cea9b9a0656f96fc42da5eefc52970a94e4dc9 --- /dev/null +++ b/vendor/bin/release @@ -0,0 +1 @@ +../consolidation/self-update/scripts/release \ No newline at end of file diff --git a/vendor/bin/robo b/vendor/bin/robo new file mode 120000 index 0000000000000000000000000000000000000000..701d42dd9a952b4f292afdc4dd139bc5693c37c4 --- /dev/null +++ b/vendor/bin/robo @@ -0,0 +1 @@ +../consolidation/robo/robo \ No newline at end of file diff --git a/vendor/chi-teck/drupal-code-generator/LICENSE.txt b/vendor/chi-teck/drupal-code-generator/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..94fb84639c4b6ff359e47a124d8fb4a3aba7a386 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/vendor/chi-teck/drupal-code-generator/README.md b/vendor/chi-teck/drupal-code-generator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c2a140b222ea02941968024b033ec8768be44d94 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/README.md @@ -0,0 +1,46 @@ +# Drupal Code Generator + +[](https://travis-ci.org/Chi-teck/drupal-code-generator) + +A command line code generator for Drupal. + +## Installation + +1. Download the latest [stable release](https://github.com/Chi-teck/drupal-code-generator/releases/latest) of the code generator. +2. Make the file executable. +3. Move it to a directory that is part of your `PATH`. + +```shell +release_url=https://api.github.com/repos/chi-teck/drupal-code-generator/releases/latest +wget $(wget -qO- $release_url | awk -F'"' '/browser_download_url/ { print $4 }') +chmod +x dcg.phar +sudo mv dcg.phar /usr/local/bin/dcg +dcg --version +``` +Installation using Composer is also supported. + +## Upgrade +Simply repeat installation commands. + +## Usage +```shell +# Display main menu. +dcg + +# Display Drupal 8 submenu. +dcg d8 + +# Call generator directly. +dcg d8:plugin:field:widget + +# Generate code non-interactively. +dcg twig-extension -a '{"name": "Example", "machine_name": "example", "class": "ExampleTwigExtension"}' +``` +## Extending +All custom generators should be placed to _$HOME/.dcg/Command_ directory. The following command will help you to get started with creating own generators. +```bash +# Create custom DCG command. +dcg dcg-command -d $HOME/.dcg/Command +``` +## License +GNU General Public License, version 2 or later. diff --git a/vendor/chi-teck/drupal-code-generator/bin/dcg b/vendor/chi-teck/drupal-code-generator/bin/dcg new file mode 100755 index 0000000000000000000000000000000000000000..272d182fa41e4681125bde4580859a44bade29bd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/bin/dcg @@ -0,0 +1,35 @@ +#!/usr/bin/env php +<?php + +use DrupalCodeGenerator\ApplicationFactory; +use DrupalCodeGenerator\Command\Navigation; +use DrupalCodeGenerator\GeneratorDiscovery; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Filesystem\Filesystem; + +// The autoloader may have a different location if DCG is installed as a local +// Composer package. +$autoloader = file_exists(__DIR__ . '/../vendor/autoload.php') + ? require __DIR__ . '/../vendor/autoload.php' + : require __DIR__ . '/../../../autoload.php'; + +// Create an application. +$application = ApplicationFactory::create(); + +// Discover generators. +$discovery = new GeneratorDiscovery(new Filesystem()); +$commands_directories[] = ApplicationFactory::getRoot() . '/src/Command'; +$home = Utils::getHomeDirectory(); +if (file_exists($home . '/.dcg/Command')) { + $commands_directories[] = $home . '/.dcg/Command'; + $autoloader->addPsr4('DrupalCodeGenerator\\', $home . '/.dcg'); +} +$generators = $discovery->getGenerators($commands_directories); +$application->addCommands($generators); + +// Add the navigation command. +$application->add(new Navigation($generators)); +$application->setDefaultCommand('navigation'); + +// Run. +$application->run(); diff --git a/vendor/chi-teck/drupal-code-generator/composer.json b/vendor/chi-teck/drupal-code-generator/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..07a1cc5e8c20b4aa05147eb10bcd958463542e37 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/composer.json @@ -0,0 +1,26 @@ +{ + "name": "chi-teck/drupal-code-generator", + "description": "Drupal code generator", + "require": { + "php": ">=5.5.9", + "ext-json": "*", + "symfony/console": "^3.4 || ^4.0", + "symfony/filesystem": "^2.7 || ^3.4 || ^4.0", + "twig/twig": "^1.38.2 || ^2.10" + }, + "bin": [ + "bin/dcg" + ], + "autoload": { + "files": ["src/bootstrap.php"], + "psr-4": { + "DrupalCodeGenerator\\": "src" + } + }, + "license": "GPL-2.0-or-later", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/resources/service-definitions.json b/vendor/chi-teck/drupal-code-generator/resources/service-definitions.json new file mode 100644 index 0000000000000000000000000000000000000000..587ee39b9b88234bae21d4719203cddce13559ac --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/resources/service-definitions.json @@ -0,0 +1 @@ +{"access_arguments_resolver_factory":{"type":"Drupal\\Core\\Access\\AccessArgumentsResolverFactoryInterface","name":"arguments_resolver_factory","description":"The access arguments resolver."},"access_check.book.removable":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_book_removable","description":"The access_check.book.removable service."},"access_check.contact_personal":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_contact_personal","description":"The access_check.contact_personal service."},"access_check.cron":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_cron","description":"The access_check.cron service."},"access_check.csrf":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_csrf","description":"The access_check.csrf service."},"access_check.custom":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_custom","description":"The access_check.custom service."},"access_check.db_update":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_db_update","description":"The access_check.db_update service."},"access_check.default":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_default","description":"The access_check.default service."},"access_check.entity":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_entity","description":"The access_check.entity service."},"access_check.entity.layout":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_entity_layout","description":"The access_check.entity.layout service."},"access_check.entity.layout_builder_access":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_entity_layout_builder_access","description":"The access_check.entity.layout_builder_access service."},"access_check.entity_create":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_entity_create","description":"The access_check.entity_create service."},"access_check.entity_create_any":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_entity_create_any","description":"The access_check.entity_create_any service."},"access_check.entity_delete_multiple":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_entity_delete_multiple","description":"The access_check.entity_delete_multiple service."},"access_check.field_ui.form_mode":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_field_ui_form_mode","description":"The access_check.field_ui.form_mode service."},"access_check.field_ui.view_mode":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_field_ui_view_mode","description":"The access_check.field_ui.view_mode service."},"access_check.header.csrf":{"type":"Drupal\\Core\\Access\\AccessCheckInterface","name":"access_check_header_csrf","description":"The access_check.header.csrf service."},"access_check.jsonapi.relationship_field_access":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_jsonapi_relationship_field_access","description":"The access_check.jsonapi.relationship_field_access service."},"access_check.latest_revision":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_latest_revision","description":"The access_check.latest_revision service."},"access_check.media.revision":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_media_revision","description":"The access_check.media.revision service."},"access_check.node.add":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_node_add","description":"The access_check.node.add service."},"access_check.node.preview":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_node_preview","description":"The access_check.node.preview service."},"access_check.node.revision":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_node_revision","description":"The access_check.node.revision service."},"access_check.permission":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_permission","description":"The access_check.permission service."},"access_check.quickedit.entity_field":{"type":"Drupal\\quickedit\\Access\\QuickEditEntityFieldAccessCheckInterface","name":"access_checker","description":"An object that checks if a user has access to edit a given field."},"access_check.settings_tray.block.has_overrides":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_settings_tray_block_has_overrides","description":"The access_check.settings_tray.block.has_overrides service."},"access_check.settings_tray.block.settings_tray_form":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_settings_tray_block_settings_tray_form","description":"The access_check.settings_tray.block.settings_tray_form service."},"access_check.theme":{"type":"Drupal\\Core\\Theme\\ThemeAccessCheck","name":"theme_access","description":"The access checker for themes."},"access_check.update.manager_access":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_update_manager_access","description":"The access_check.update.manager_access service."},"access_check.user.login_status":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_user_login_status","description":"The access_check.user.login_status service."},"access_check.user.register":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_user_register","description":"The access_check.user.register service."},"access_check.user.role":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"access_check_user_role","description":"The access_check.user.role service."},"access_manager":{"type":"Drupal\\Core\\Access\\AccessManagerInterface","name":"access_manager","description":"The access manager."},"account_switcher":{"type":"Drupal\\Core\\Session\\AccountSwitcherInterface","name":"account_switcher","description":"The account switching service."},"aggregator.items.importer":{"type":"Drupal\\aggregator\\ItemsImporterInterface","name":"aggregator_items_importer","description":"The aggregator.items.importer service."},"ajax_response.attachments_processor":{"type":"Drupal\\Core\\Render\\AttachmentsResponseProcessorInterface","name":"ajax_response_attachments_processor","description":"The AJAX response attachments processor service."},"ajax_response.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"ajax_response_subscriber","description":"The ajax_response.subscriber service."},"anonymous_user_response_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"anonymous_user_response_subscriber","description":"The anonymous_user_response_subscriber service."},"asset.css.collection_grouper":{"type":"Drupal\\Core\\Asset\\AssetCollectionGrouperInterface","name":"grouper","description":"The grouper for CSS assets."},"asset.css.collection_optimizer":{"type":"Drupal\\Core\\Asset\\AssetCollectionOptimizerInterface","name":"css_collection_optimizer","description":"The CSS asset collection optimizer service."},"asset.css.collection_renderer":{"type":"Drupal\\Core\\Asset\\AssetCollectionRendererInterface","name":"css_collection_renderer","description":"The CSS asset collection renderer."},"asset.css.dumper":{"type":"Drupal\\Core\\Asset\\AssetDumperInterface","name":"dumper","description":"The dumper for optimized CSS assets."},"asset.css.optimizer":{"type":"Drupal\\Core\\Asset\\AssetOptimizerInterface","name":"optimizer","description":"The optimizer for a single CSS asset."},"asset.js.collection_grouper":{"type":"Drupal\\Core\\Asset\\AssetCollectionGrouperInterface","name":"grouper","description":"The grouper for JS assets."},"asset.js.collection_optimizer":{"type":"Drupal\\Core\\Asset\\AssetCollectionOptimizerInterface","name":"asset_js_collection_optimizer","description":"The asset.js.collection_optimizer service."},"asset.js.collection_renderer":{"type":"Drupal\\Core\\Asset\\AssetCollectionRendererInterface","name":"js_collection_renderer","description":"The JS asset collection renderer."},"asset.js.dumper":{"type":"Drupal\\Core\\Asset\\AssetDumperInterface","name":"dumper","description":"The dumper for optimized JS assets."},"asset.js.optimizer":{"type":"Drupal\\Core\\Asset\\AssetOptimizerInterface","name":"optimizer","description":"The optimizer for a single JS asset."},"asset.resolver":{"type":"Drupal\\Core\\Asset\\AssetResolverInterface","name":"asset_resolver","description":"An asset resolver."},"authentication":{"type":"Drupal\\Core\\Authentication\\AuthenticationProviderInterface","name":"authentication_provider","description":"An authentication provider."},"authentication_collector":{"type":"Drupal\\Core\\Authentication\\AuthenticationCollectorInterface","name":"auth_collector","description":"The authentication provider collector."},"authentication_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"authentication_subscriber","description":"The authentication_subscriber service."},"automated_cron.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"automated_cron_subscriber","description":"The automated_cron.subscriber service."},"ban.ip_manager":{"type":"Drupal\\ban\\BanIpManagerInterface","name":"manager","description":"The ban IP manager."},"ban.middleware":{"type":"Symfony\\Component\\HttpKernel\\HttpKernelInterface","name":"http_kernel","description":"The decorated kernel."},"bare_html_page_renderer":{"type":"Drupal\\Core\\Render\\BareHtmlPageRendererInterface","name":"bare_html_page_renderer","description":"The bare HTML page renderer."},"basic_auth.authentication.basic_auth":{"type":"Drupal\\Core\\Authentication\\AuthenticationProviderInterface","name":"basic_auth_authentication_basic_auth","description":"The basic_auth.authentication.basic_auth service."},"batch.storage":{"type":"Drupal\\Core\\Batch\\BatchStorageInterface","name":"batch_storage","description":"The batch storage."},"big_pipe":{"type":"Drupal\\big_pipe\\Render\\BigPipe","name":"big_pipe","description":"The BigPipe service."},"block.page_display_variant_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"block_page_display_variant_subscriber","description":"The block.page_display_variant_subscriber service."},"block.repository":{"type":"Drupal\\block\\BlockRepositoryInterface","name":"block_repository","description":"The block.repository service."},"block_content.uuid_lookup":{"type":"Drupal\\Core\\DestructableInterface","name":"block_content_uuid_lookup","description":"The block_content.uuid_lookup service."},"book.breadcrumb":{"type":"Drupal\\Core\\Breadcrumb\\BreadcrumbBuilderInterface","name":"book_breadcrumb","description":"The book.breadcrumb service."},"book.manager":{"type":"Drupal\\book\\BookManagerInterface","name":"book_manager","description":"The book manager."},"book.outline":{"type":"Drupal\\book\\BookOutline","name":"book_outline","description":"The book.outline service."},"book.outline_storage":{"type":"Drupal\\book\\BookOutlineStorageInterface","name":"book_outline_storage","description":"The book outline storage."},"book.uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"book_uninstall_validator","description":"The book.uninstall_validator service."},"breadcrumb":{"type":"Drupal\\Core\\Breadcrumb\\ChainBreadcrumbBuilderInterface","name":"breadcrumb","description":"The breadcrumb service."},"breakpoint.manager":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"breakpoint_manager","description":"The breakpoint.manager service."},"cache.backend.apcu":{"type":"Drupal\\Core\\Cache\\CacheFactoryInterface","name":"cache_backend_apcu","description":"The cache.backend.apcu service."},"cache.backend.chainedfast":{"type":"Drupal\\Core\\Cache\\CacheFactoryInterface","name":"cache_backend_chainedfast","description":"The cache.backend.chainedfast service."},"cache.backend.database":{"type":"Drupal\\Core\\Cache\\CacheFactoryInterface","name":"cache_backend_database","description":"The cache.backend.database service."},"cache.backend.memory":{"type":"Drupal\\Core\\Cache\\CacheFactoryInterface","name":"cache_backend_memory","description":"The cache.backend.memory service."},"cache.backend.null":{"type":"Drupal\\Core\\Cache\\CacheFactoryInterface","name":"cache_backend_null","description":"The cache.backend.null service."},"cache.backend.php":{"type":"Drupal\\Core\\Cache\\CacheFactoryInterface","name":"cache_backend_php","description":"The cache.backend.php service."},"cache.bootstrap":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache","description":"The cache backend."},"cache.config":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache","description":"A cache backend used to store configuration."},"cache.data":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache","description":"The cache backend."},"cache.default":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache","description":"The cache."},"cache.discovery":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache_backend","description":"Cache backend instance to use."},"cache.discovery_migration":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache_backend","description":"The cache backend."},"cache.dynamic_page_cache":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache_dynamic_page_cache","description":"The cache.dynamic_page_cache service."},"cache.entity":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache_entity","description":"The cache.entity service."},"cache.jsonapi_resource_types":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"static_cache","description":"The static cache backend."},"cache.menu":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache","description":"The cache backend."},"cache.migrate":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache_migrate","description":"The cache.migrate service."},"cache.page":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache","description":"The cache bin."},"cache.render":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache_render","description":"The cache.render service."},"cache.rest":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache_rest","description":"The cache.rest service."},"cache.static":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"static","description":"The cache backend interface to use for the static cache."},"cache.toolbar":{"type":"Drupal\\Core\\Cache\\CacheBackendInterface","name":"cache_toolbar","description":"The cache.toolbar service."},"cache_context.cookies":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_cookies","description":"The cache_context.cookies service."},"cache_context.headers":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_headers","description":"The cache_context.headers service."},"cache_context.ip":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_ip","description":"The cache_context.ip service."},"cache_context.languages":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_languages","description":"The cache_context.languages service."},"cache_context.layout_builder_is_active":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_layout_builder_is_active","description":"The cache_context.layout_builder_is_active service."},"cache_context.request_format":{"type":"Drupal\\Core\\Cache\\Context\\RequestFormatCacheContext","name":"cache_context_request_format","description":"The cache_context.request_format service."},"cache_context.route":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_route","description":"The cache_context.route service."},"cache_context.route.book_navigation":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_route_book_navigation","description":"The cache_context.route.book_navigation service."},"cache_context.route.menu_active_trails":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_route_menu_active_trails","description":"The cache_context.route.menu_active_trails service."},"cache_context.route.name":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_route_name","description":"The cache_context.route.name service."},"cache_context.route.name.is_layout_builder_ui":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_route_name_is_layout_builder_ui","description":"The cache_context.route.name.is_layout_builder_ui service."},"cache_context.session":{"type":"Drupal\\Core\\Cache\\Context\\SessionCacheContext","name":"cache_context_session","description":"The cache_context.session service."},"cache_context.session.exists":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_session_exists","description":"The cache_context.session.exists service."},"cache_context.test_discovery":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_test_discovery","description":"The cache_context.test_discovery service."},"cache_context.theme":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_theme","description":"The cache_context.theme service."},"cache_context.timezone":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_timezone","description":"The cache_context.timezone service."},"cache_context.url":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_url","description":"The cache_context.url service."},"cache_context.url.path":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_url_path","description":"The cache_context.url.path service."},"cache_context.url.path.is_front":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_url_path_is_front","description":"The cache_context.url.path.is_front service."},"cache_context.url.path.parent":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_url_path_parent","description":"The cache_context.url.path.parent service."},"cache_context.url.query_args":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_url_query_args","description":"The cache_context.url.query_args service."},"cache_context.url.query_args.pagers":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_url_query_args_pagers","description":"The cache_context.url.query_args.pagers service."},"cache_context.url.site":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_url_site","description":"The cache_context.url.site service."},"cache_context.user":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_user","description":"The cache_context.user service."},"cache_context.user.is_super_user":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_user_is_super_user","description":"The cache_context.user.is_super_user service."},"cache_context.user.node_grants":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_user_node_grants","description":"The cache_context.user.node_grants service."},"cache_context.user.permissions":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextInterface","name":"cache_context_user_permissions","description":"The cache_context.user.permissions service."},"cache_context.user.roles":{"type":"Drupal\\Core\\Cache\\Context\\CalculatedCacheContextInterface","name":"cache_context_user_roles","description":"The cache_context.user.roles service."},"cache_contexts_manager":{"type":"Drupal\\Core\\Cache\\Context\\CacheContextsManager","name":"cache_contexts_manager","description":"The cache contexts manager service."},"cache_factory":{"type":"Drupal\\Core\\Cache\\CacheFactoryInterface","name":"cache_factory","description":"The cache factory."},"cache_router_rebuild_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"cache_router_rebuild_subscriber","description":"The cache_router_rebuild_subscriber service."},"cache_tags.invalidator":{"type":"Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface","name":"cache_tags_invalidator","description":"The cache tags invalidator."},"cache_tags.invalidator.checksum":{"type":"Drupal\\Core\\Cache\\CacheTagsChecksumInterface","name":"checksum_provider","description":"The cache tags checksum provider."},"class_resolver":{"type":"Drupal\\Core\\DependencyInjection\\ClassResolverInterface","name":"class_resolver","description":"The class resolver."},"client_error_response_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"client_error_response_subscriber","description":"The client_error_response_subscriber service."},"color.config_cache_invalidator":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"color_config_cache_invalidator","description":"The color.config_cache_invalidator service."},"comment.breadcrumb":{"type":"Drupal\\Core\\Breadcrumb\\BreadcrumbBuilderInterface","name":"comment_breadcrumb","description":"The comment.breadcrumb service."},"comment.lazy_builders":{"type":"Drupal\\comment\\CommentLazyBuilders","name":"comment_lazy_builders","description":"The comment.lazy_builders service."},"comment.link_builder":{"type":"Drupal\\comment\\CommentLinkBuilderInterface","name":"comment_link_builder","description":"The comment.link_builder service."},"comment.manager":{"type":"Drupal\\comment\\CommentManagerInterface","name":"comment_manager","description":"The comment manager service."},"comment.statistics":{"type":"Drupal\\comment\\CommentStatisticsInterface","name":"comment_statistics","description":"The comment.statistics service."},"config.config_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"config_config_subscriber","description":"The config.config_subscriber service."},"config.factory":{"type":"Drupal\\Core\\Config\\ConfigFactoryInterface","name":"config_factory","description":"The config factory."},"config.importer_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"config_importer_subscriber","description":"The config.importer_subscriber service."},"config.installer":{"type":"Drupal\\Core\\Config\\ConfigInstallerInterface","name":"config_installer","description":"(optional) The config installer to install configuration. This optional"},"config.manager":{"type":"Drupal\\Core\\Config\\ConfigManagerInterface","name":"config_manager","description":"The configuration manager."},"config.storage":{"type":"Drupal\\Core\\Config\\StorageInterface","name":"storage","description":"The active configuration storage."},"config.storage.export":{"type":"Drupal\\Core\\Config\\StorageInterface","name":"config_storage_export","description":"The config.storage.export service."},"config.storage.schema":{"type":"Drupal\\Core\\Config\\StorageInterface","name":"schemaStorage","description":"The storage object to use for reading schema data"},"config.storage.snapshot":{"type":"Drupal\\Core\\Config\\StorageInterface","name":"config_storage_snapshot","description":"The config.storage.snapshot service."},"config.storage.staging":{"type":"Drupal\\Core\\Config\\StorageInterface","name":"config_storage_staging","description":"The config.storage.staging service."},"config.typed":{"type":"Drupal\\Core\\Config\\TypedConfigManagerInterface","name":"typed_config","description":"The typed configuration manager."},"config_import_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"config_import_subscriber","description":"The config_import_subscriber service."},"config_translation.access.form":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"config_translation_access_form","description":"The config_translation.access.form service."},"config_translation.access.overview":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"config_translation_access_overview","description":"The config_translation.access.overview service."},"config_translation.route_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"config_translation_route_subscriber","description":"The config_translation.route_subscriber service."},"contact.mail_handler":{"type":"Drupal\\contact\\MailHandlerInterface","name":"contact_mail_handler","description":"The contact.mail_handler service."},"container.namespaces":{"type":"Traversable","name":"namespaces","description":"An object that implements \\Traversable which contains the root paths"},"content_moderation.config_import_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"content_moderation_config_import_subscriber","description":"The content_moderation.config_import_subscriber service."},"content_moderation.moderation_information":{"type":"Drupal\\content_moderation\\ModerationInformationInterface","name":"moderation_info","description":"The moderation information service."},"content_moderation.route_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"content_moderation_route_subscriber","description":"The content_moderation.route_subscriber service."},"content_moderation.state_transition_validation":{"type":"Drupal\\content_moderation\\StateTransitionValidationInterface","name":"content_moderation_state_transition_validation","description":"The content_moderation.state_transition_validation service."},"content_translation.delete_access":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"content_translation_delete_access","description":"The content_translation.delete_access service."},"content_translation.manage_access":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"content_translation_manage_access","description":"The content_translation.manage_access service."},"content_translation.manager":{"type":"Drupal\\content_translation\\ContentTranslationManagerInterface","name":"content_translation_manager","description":"The content translation manager."},"content_translation.overview_access":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"content_translation_overview_access","description":"The content_translation.overview_access service."},"content_translation.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"content_translation_subscriber","description":"The content_translation.subscriber service."},"content_translation.synchronizer":{"type":"Drupal\\content_translation\\FieldTranslationSynchronizerInterface","name":"content_translation_synchronizer","description":"The content_translation.synchronizer service."},"content_translation.updates_manager":{"type":"Drupal\\content_translation\\ContentTranslationUpdatesManager","name":"content_translation_updates_manager","description":"The content_translation.updates_manager service."},"content_type_header_matcher":{"type":"Drupal\\Core\\Routing\\FilterInterface","name":"content_type_header_matcher","description":"The content_type_header_matcher service."},"content_uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"content_uninstall_validator","description":"The content_uninstall_validator service."},"context.handler":{"type":"Drupal\\Core\\Plugin\\Context\\ContextHandlerInterface","name":"context_handler","description":"The plugin context handler."},"context.repository":{"type":"Drupal\\Core\\Plugin\\Context\\ContextRepositoryInterface","name":"context_repository","description":"The context repository service."},"controller.entity_form":{"type":"Drupal\\Core\\Entity\\HtmlEntityFormController","name":"controller_entity_form","description":"The controller.entity_form service."},"controller.form":{"type":"Drupal\\Core\\Controller\\HtmlFormController","name":"controller_form","description":"The controller.form service."},"controller_resolver":{"type":"Drupal\\Core\\Controller\\ControllerResolverInterface","name":"controller_resolver","description":"The controller resolver."},"country_manager":{"type":"Drupal\\Core\\Locale\\CountryManagerInterface","name":"country_manager","description":"The country_manager service."},"cron":{"type":"Drupal\\Core\\CronInterface","name":"cron","description":"The cron service."},"csrf_token":{"type":"Drupal\\Core\\Access\\CsrfTokenGenerator","name":"csrf_token","description":"The CSRF token generator."},"current_route_match":{"type":"Drupal\\Core\\Routing\\RouteMatchInterface","name":"route_match","description":"The current route match."},"current_user":{"type":"Drupal\\Core\\Session\\AccountInterface","name":"current_user","description":"The current user."},"database":{"type":"Drupal\\Core\\Database\\Connection","name":"connection","description":"The database connection."},"database.replica":{"type":"Drupal\\Core\\Database\\Connection","name":"database_replica","description":"(Optional) the replica database connection."},"database.replica_kill_switch":{"type":"Drupal\\Core\\Database\\ReplicaKillSwitch","name":"replica_kill_switch","description":"The replica kill switch."},"date.formatter":{"type":"Drupal\\Core\\Datetime\\DateFormatterInterface","name":"date_formatter","description":"The date formatter."},"datetime.time":{"type":"Drupal\\Component\\Datetime\\TimeInterface","name":"time","description":"The time service."},"diff.formatter":{"type":"Drupal\\Core\\Diff\\DiffFormatter","name":"diff_formatter","description":"The diff.formatter service."},"drupal.proxy_original_service.bare_html_page_renderer":{"type":"Drupal\\Core\\Render\\BareHtmlPageRendererInterface","name":"drupal_proxy_original_service_bare_html_page_renderer","description":"The drupal.proxy_original_service.bare_html_page_renderer service."},"drupal.proxy_original_service.batch.storage":{"type":"Drupal\\Core\\Batch\\BatchStorageInterface","name":"drupal_proxy_original_service_batch_storage","description":"The drupal.proxy_original_service.batch.storage service."},"drupal.proxy_original_service.book.uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"drupal_proxy_original_service_book_uninstall_validator","description":"The drupal.proxy_original_service.book.uninstall_validator service."},"drupal.proxy_original_service.config.installer":{"type":"Drupal\\Core\\Config\\ConfigInstallerInterface","name":"drupal_proxy_original_service_config_installer","description":"The drupal.proxy_original_service.config.installer service."},"drupal.proxy_original_service.content_uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"drupal_proxy_original_service_content_uninstall_validator","description":"The drupal.proxy_original_service.content_uninstall_validator service."},"drupal.proxy_original_service.cron":{"type":"Drupal\\Core\\CronInterface","name":"drupal_proxy_original_service_cron","description":"The drupal.proxy_original_service.cron service."},"drupal.proxy_original_service.dynamic_page_cache_response_policy":{"type":"Drupal\\Core\\PageCache\\ChainResponsePolicyInterface","name":"drupal_proxy_original_service_dynamic_page_cache_response_policy","description":"The drupal.proxy_original_service.dynamic_page_cache_response_policy service."},"drupal.proxy_original_service.field.uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"drupal_proxy_original_service_field_uninstall_validator","description":"The drupal.proxy_original_service.field.uninstall_validator service."},"drupal.proxy_original_service.file.mime_type.guesser":{"type":"Symfony\\Component\\HttpFoundation\\File\\MimeType\\MimeTypeGuesserInterface","name":"drupal_proxy_original_service_file_mime_type_guesser","description":"The drupal.proxy_original_service.file.mime_type.guesser service."},"drupal.proxy_original_service.file.mime_type.guesser.extension":{"type":"Symfony\\Component\\HttpFoundation\\File\\MimeType\\MimeTypeGuesserInterface","name":"drupal_proxy_original_service_file_mime_type_guesser_extension","description":"The drupal.proxy_original_service.file.mime_type.guesser.extension service."},"drupal.proxy_original_service.filter.uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"drupal_proxy_original_service_filter_uninstall_validator","description":"The drupal.proxy_original_service.filter.uninstall_validator service."},"drupal.proxy_original_service.forum.uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"drupal_proxy_original_service_forum_uninstall_validator","description":"The drupal.proxy_original_service.forum.uninstall_validator service."},"drupal.proxy_original_service.language_converter":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"drupal_proxy_original_service_language_converter","description":"The drupal.proxy_original_service.language_converter service."},"drupal.proxy_original_service.lock":{"type":"Drupal\\Core\\Lock\\LockBackendInterface","name":"drupal_proxy_original_service_lock","description":"The drupal.proxy_original_service.lock service."},"drupal.proxy_original_service.lock.persistent":{"type":"Drupal\\Core\\Lock\\LockBackendInterface","name":"drupal_proxy_original_service_lock_persistent","description":"The drupal.proxy_original_service.lock.persistent service."},"drupal.proxy_original_service.node_preview":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"drupal_proxy_original_service_node_preview","description":"The drupal.proxy_original_service.node_preview service."},"drupal.proxy_original_service.page_cache_response_policy":{"type":"Drupal\\Core\\PageCache\\ChainResponsePolicyInterface","name":"drupal_proxy_original_service_page_cache_response_policy","description":"The drupal.proxy_original_service.page_cache_response_policy service."},"drupal.proxy_original_service.paramconverter.menu_link":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"drupal_proxy_original_service_paramconverter_menu_link","description":"The drupal.proxy_original_service.paramconverter.menu_link service."},"drupal.proxy_original_service.plugin.cache_clearer":{"type":"Drupal\\Core\\Plugin\\CachedDiscoveryClearerInterface","name":"drupal_proxy_original_service_plugin_cache_clearer","description":"The drupal.proxy_original_service.plugin.cache_clearer service."},"drupal.proxy_original_service.required_module_uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"drupal_proxy_original_service_required_module_uninstall_validator","description":"The drupal.proxy_original_service.required_module_uninstall_validator service."},"drupal.proxy_original_service.router.builder":{"type":"Drupal\\Core\\Routing\\RouteBuilderInterface","name":"drupal_proxy_original_service_router_builder","description":"The drupal.proxy_original_service.router.builder service."},"drupal.proxy_original_service.router.dumper":{"type":"Drupal\\Core\\Routing\\MatcherDumperInterface","name":"drupal_proxy_original_service_router_dumper","description":"The drupal.proxy_original_service.router.dumper service."},"dynamic_page_cache_request_policy":{"type":"Drupal\\Core\\PageCache\\RequestPolicyInterface","name":"request_policy","description":"A policy rule determining the cacheability of a request."},"dynamic_page_cache_response_policy":{"type":"Drupal\\Core\\PageCache\\ResponsePolicyInterface","name":"response_policy","description":"A policy rule determining the cacheability of the response."},"dynamic_page_cache_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"dynamic_page_cache_subscriber","description":"The dynamic_page_cache_subscriber service."},"early_rendering_controller_wrapper_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"early_rendering_controller_wrapper_subscriber","description":"The early_rendering_controller_wrapper_subscriber service."},"element.editor":{"type":"Drupal\\editor\\Element","name":"element_editor","description":"The element.editor service."},"email.validator":{"type":"Drupal\\Component\\Utility\\EmailValidatorInterface","name":"email_validator","description":"The email.validator service."},"entity.autocomplete_matcher":{"type":"Drupal\\Core\\Entity\\EntityAutocompleteMatcher","name":"entity_autocomplete_matcher","description":"The entity.autocomplete_matcher service."},"entity.bundle_config_import_validator":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"entity_bundle_config_import_validator","description":"The entity.bundle_config_import_validator service."},"entity.definition_update_manager":{"type":"Drupal\\Core\\Entity\\EntityDefinitionUpdateManagerInterface","name":"update_manager","description":"The entity definition update manager."},"entity.form_builder":{"type":"Drupal\\Core\\Entity\\EntityFormBuilderInterface","name":"entity_form_builder","description":"The entity form builder service."},"entity.last_installed_schema.repository":{"type":"Drupal\\Core\\Entity\\EntityLastInstalledSchemaRepositoryInterface","name":"entity_last_installed_schema_repository","description":"The entity last installed schema repository."},"entity.manager":{"type":"Drupal\\Core\\Entity\\EntityManagerInterface","name":"entity_manager","description":"The entity.manager service."},"entity.memory_cache":{"type":"Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface","name":"entity_memory_cache","description":"The entity.memory_cache service."},"entity.query":{"type":"Symfony\\Component\\DependencyInjection\\ContainerAwareInterface","name":"entity_query","description":"The entity.query service."},"entity.query.config":{"type":"Drupal\\Core\\Entity\\Query\\QueryFactoryInterface","name":"entity_query_config","description":"The entity.query.config service."},"entity.query.keyvalue":{"type":"Drupal\\Core\\Entity\\Query\\QueryFactoryInterface","name":"entity_query_keyvalue","description":"The entity.query.keyvalue service."},"entity.query.null":{"type":"Drupal\\Core\\Entity\\Query\\QueryFactoryInterface","name":"entity_query_null","description":"The entity.query.null service."},"entity.query.sql":{"type":"Drupal\\Core\\Entity\\Query\\QueryFactoryInterface","name":"entity_query_sql","description":"The entity.query.sql service."},"entity.repository":{"type":"Drupal\\Core\\Entity\\EntityRepositoryInterface","name":"entity_repository","description":"The entity repository."},"entity_bundle.listener":{"type":"Drupal\\Core\\Entity\\EntityBundleListenerInterface","name":"entity_bundle_listener","description":"The entity_bundle.listener service."},"entity_display.repository":{"type":"Drupal\\Core\\Entity\\EntityDisplayRepositoryInterface","name":"entity_display_repository","description":"The entity display repository."},"entity_field.deleted_fields_repository":{"type":"Drupal\\Core\\Field\\DeletedFieldsRepositoryInterface","name":"deleted_fields_repository","description":"The deleted fields repository."},"entity_field.manager":{"type":"Drupal\\Core\\Entity\\EntityFieldManagerInterface","name":"entity_field_manager","description":"The entity field manager."},"entity_route_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"entity_route_subscriber","description":"The entity_route_subscriber service."},"entity_type.bundle.info":{"type":"Drupal\\Core\\Entity\\EntityTypeBundleInfoInterface","name":"entity_type_bundle_info","description":"The entity type bundle info."},"entity_type.listener":{"type":"Drupal\\Core\\Entity\\EntityTypeListenerInterface","name":"entity_type_listener","description":"The entity type listener interface."},"entity_type.manager":{"type":"Drupal\\Core\\Entity\\EntityTypeManagerInterface","name":"entity_type_manager","description":"The entity type manager."},"entity_type.repository":{"type":"Drupal\\Core\\Entity\\EntityTypeRepositoryInterface","name":"entity_type_repository","description":"The entity_type.repository service."},"event_dispatcher":{"type":"Symfony\\Component\\EventDispatcher\\EventDispatcherInterface","name":"event_dispatcher","description":"The event dispatcher."},"exception.custom_page_html":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"exception_custom_page_html","description":"The exception.custom_page_html service."},"exception.default_html":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"exception_default_html","description":"The exception.default_html service."},"exception.default_json":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"exception_default_json","description":"The exception.default_json service."},"exception.enforced_form_response":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"exception_enforced_form_response","description":"The exception.enforced_form_response service."},"exception.fast_404_html":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"exception_fast_404_html","description":"The exception.fast_404_html service."},"exception.final":{"type":"stdClass","name":"exception_final","description":"The exception.final service."},"exception.logger":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"exception_logger","description":"The exception.logger service."},"exception.needs_installer":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"exception_needs_installer","description":"The exception.needs_installer service."},"exception.test_site":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"exception_test_site","description":"The exception.test_site service."},"extension.list.module":{"type":"Drupal\\Core\\Extension\\ModuleExtensionList","name":"extension_list_module","description":"The module extension list."},"extension.list.profile":{"type":"Drupal\\Core\\Extension\\ExtensionList","name":"profile_list","description":"The site profile listing."},"extension.list.theme":{"type":"Drupal\\Core\\Extension\\ThemeExtensionList","name":"theme_list","description":"A extension discovery instance."},"extension.list.theme_engine":{"type":"Drupal\\Core\\Extension\\ThemeEngineExtensionList","name":"engine_list","description":"The theme engine extension listing."},"feed.bridge.reader":{"type":"Zend\\Feed\\Reader\\ExtensionManagerInterface","name":"feed_bridge_reader","description":"The feed.bridge.reader service."},"feed.bridge.writer":{"type":"Zend\\Feed\\Reader\\ExtensionManagerInterface","name":"feed_bridge_writer","description":"The feed.bridge.writer service."},"feed.reader.atomentry":{"type":"Zend\\Feed\\Reader\\Extension\\Atom\\Entry","name":"feed_reader_atomentry","description":"The feed.reader.atomentry service."},"feed.reader.atomfeed":{"type":"Zend\\Feed\\Reader\\Extension\\Atom\\Feed","name":"feed_reader_atomfeed","description":"The feed.reader.atomfeed service."},"feed.reader.contententry":{"type":"Zend\\Feed\\Reader\\Extension\\Content\\Entry","name":"feed_reader_contententry","description":"The feed.reader.contententry service."},"feed.reader.dublincoreentry":{"type":"Zend\\Feed\\Reader\\Extension\\DublinCore\\Entry","name":"feed_reader_dublincoreentry","description":"The feed.reader.dublincoreentry service."},"feed.reader.dublincorefeed":{"type":"Zend\\Feed\\Reader\\Extension\\DublinCore\\Feed","name":"feed_reader_dublincorefeed","description":"The feed.reader.dublincorefeed service."},"feed.reader.podcastentry":{"type":"Zend\\Feed\\Reader\\Extension\\Podcast\\Entry","name":"feed_reader_podcastentry","description":"The feed.reader.podcastentry service."},"feed.reader.podcastfeed":{"type":"Zend\\Feed\\Reader\\Extension\\Podcast\\Feed","name":"feed_reader_podcastfeed","description":"The feed.reader.podcastfeed service."},"feed.reader.slashentry":{"type":"Zend\\Feed\\Reader\\Extension\\Slash\\Entry","name":"feed_reader_slashentry","description":"The feed.reader.slashentry service."},"feed.reader.threadentry":{"type":"Zend\\Feed\\Reader\\Extension\\Thread\\Entry","name":"feed_reader_threadentry","description":"The feed.reader.threadentry service."},"feed.reader.wellformedwebentry":{"type":"Zend\\Feed\\Reader\\Extension\\WellFormedWeb\\Entry","name":"feed_reader_wellformedwebentry","description":"The feed.reader.wellformedwebentry service."},"feed.writer.atomrendererfeed":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_atomrendererfeed","description":"The feed.writer.atomrendererfeed service."},"feed.writer.contentrendererentry":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_contentrendererentry","description":"The feed.writer.contentrendererentry service."},"feed.writer.dublincorerendererentry":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_dublincorerendererentry","description":"The feed.writer.dublincorerendererentry service."},"feed.writer.dublincorerendererfeed":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_dublincorerendererfeed","description":"The feed.writer.dublincorerendererfeed service."},"feed.writer.itunesentry":{"type":"Zend\\Feed\\Writer\\Extension\\ITunes\\Entry","name":"feed_writer_itunesentry","description":"The feed.writer.itunesentry service."},"feed.writer.itunesfeed":{"type":"Zend\\Feed\\Writer\\Extension\\ITunes\\Feed","name":"feed_writer_itunesfeed","description":"The feed.writer.itunesfeed service."},"feed.writer.itunesrendererentry":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_itunesrendererentry","description":"The feed.writer.itunesrendererentry service."},"feed.writer.itunesrendererfeed":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_itunesrendererfeed","description":"The feed.writer.itunesrendererfeed service."},"feed.writer.slashrendererentry":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_slashrendererentry","description":"The feed.writer.slashrendererentry service."},"feed.writer.threadingrendererentry":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_threadingrendererentry","description":"The feed.writer.threadingrendererentry service."},"feed.writer.wellformedwebrendererentry":{"type":"Zend\\Feed\\Writer\\Extension\\RendererInterface","name":"feed_writer_wellformedwebrendererentry","description":"The feed.writer.wellformedwebrendererentry service."},"field.uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"field_uninstall_validator","description":"The field.uninstall_validator service."},"field_definition.listener":{"type":"Drupal\\Core\\Field\\FieldDefinitionListenerInterface","name":"field_definition_listener","description":"The field_definition.listener service."},"field_storage_definition.listener":{"type":"Drupal\\Core\\Field\\FieldStorageDefinitionListenerInterface","name":"field_storage_definition_listener","description":"The field storage definition listener service."},"field_ui.route_enhancer":{"type":"Drupal\\Core\\Routing\\EnhancerInterface","name":"field_ui_route_enhancer","description":"The field_ui.route_enhancer service."},"field_ui.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"field_ui_subscriber","description":"The field_ui.subscriber service."},"file.mime_type.guesser":{"type":"Symfony\\Component\\HttpFoundation\\File\\MimeType\\MimeTypeGuesserInterface","name":"file_mime_type_guesser","description":"The file.mime_type.guesser service."},"file.mime_type.guesser.extension":{"type":"Symfony\\Component\\HttpFoundation\\File\\MimeType\\MimeTypeGuesserInterface","name":"file_mime_type_guesser_extension","description":"The file.mime_type.guesser.extension service."},"file.usage":{"type":"Drupal\\file\\FileUsage\\FileUsageInterface","name":"file_usage","description":"The file.usage service."},"file_system":{"type":"Drupal\\Core\\File\\FileSystemInterface","name":"file_system","description":"The file system service."},"filter.uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"filter_uninstall_validator","description":"The filter.uninstall_validator service."},"finish_response_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"finish_response_subscriber","description":"The finish_response_subscriber service."},"flood":{"type":"Drupal\\Core\\Flood\\FloodInterface","name":"flood","description":"The flood service."},"form_ajax_response_builder":{"type":"Drupal\\Core\\Form\\FormAjaxResponseBuilderInterface","name":"form_ajax_response_builder","description":"The form AJAX response builder."},"form_ajax_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"form_ajax_subscriber","description":"The form_ajax_subscriber service."},"form_builder":{"type":"Drupal\\Core\\Form\\FormBuilderInterface","name":"form_builder","description":"The form builder."},"form_error_handler":{"type":"Drupal\\Core\\Form\\FormErrorHandlerInterface","name":"form_error_handler","description":"The form error handler."},"form_submitter":{"type":"Drupal\\Core\\Form\\FormSubmitterInterface","name":"form_submitter","description":"The form submission processor."},"form_validator":{"type":"Drupal\\Core\\Form\\FormValidatorInterface","name":"form_validator","description":"The form validator."},"forum.breadcrumb.listing":{"type":"Drupal\\Core\\Breadcrumb\\BreadcrumbBuilderInterface","name":"forum_breadcrumb_listing","description":"The forum.breadcrumb.listing service."},"forum.breadcrumb.node":{"type":"Drupal\\Core\\Breadcrumb\\BreadcrumbBuilderInterface","name":"forum_breadcrumb_node","description":"The forum.breadcrumb.node service."},"forum.uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"forum_uninstall_validator","description":"The forum.uninstall_validator service."},"forum_manager":{"type":"Drupal\\forum\\ForumManagerInterface","name":"forum_manager","description":"The forum manager service."},"hal.link_manager":{"type":"Drupal\\hal\\LinkManager\\LinkManagerInterface","name":"hal_link_manager","description":"The hal.link_manager service."},"hal.link_manager.relation":{"type":"Drupal\\hal\\LinkManager\\RelationLinkManagerInterface","name":"relation_link_manager","description":"Manager for handling bundle URIs."},"hal.link_manager.type":{"type":"Drupal\\hal\\LinkManager\\TypeLinkManagerInterface","name":"type_link_manager","description":"Manager for handling bundle URIs."},"html_response.attachments_processor":{"type":"Drupal\\Core\\Render\\AttachmentsResponseProcessorInterface","name":"html_response_attachments_processor","description":"The HTML response attachments processor service."},"html_response.big_pipe_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"html_response_big_pipe_subscriber","description":"The html_response.big_pipe_subscriber service."},"html_response.placeholder_strategy_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"html_response_placeholder_strategy_subscriber","description":"The html_response.placeholder_strategy_subscriber service."},"html_response.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"html_response_subscriber","description":"The html_response.subscriber service."},"http_client":{"type":"GuzzleHttp\\ClientInterface","name":"http_client","description":"The HTTP client."},"http_client_factory":{"type":"Drupal\\Core\\Http\\ClientFactory","name":"http_client_factory","description":"The http_client_factory service."},"http_kernel":{"type":"Symfony\\Component\\HttpKernel\\HttpKernelInterface","name":"http_kernel","description":"The HTTP kernel."},"http_kernel.basic":{"type":"Symfony\\Component\\HttpKernel\\HttpKernelInterface","name":"http_kernel","description":"The decorated kernel."},"http_kernel.controller.argument_resolver":{"type":"Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolverInterface","name":"argument_resolver","description":"The argument resolver."},"http_middleware.kernel_pre_handle":{"type":"Symfony\\Component\\HttpKernel\\HttpKernelInterface","name":"http_kernel","description":"The decorated kernel."},"http_middleware.negotiation":{"type":"Symfony\\Component\\HttpKernel\\HttpKernelInterface","name":"http_middleware_negotiation","description":"The http_middleware.negotiation service."},"http_middleware.page_cache":{"type":"Symfony\\Component\\HttpKernel\\HttpKernelInterface","name":"http_kernel","description":"The decorated kernel."},"http_middleware.reverse_proxy":{"type":"Symfony\\Component\\HttpKernel\\HttpKernelInterface","name":"app","description":"The wrapper HTTP kernel"},"http_middleware.session":{"type":"Symfony\\Component\\HttpKernel\\HttpKernelInterface","name":"http_kernel","description":"The wrapped HTTP kernel."},"image.factory":{"type":"Drupal\\Core\\Image\\ImageFactory","name":"image_factory","description":"The image.factory service."},"image.toolkit.manager":{"type":"Drupal\\Core\\ImageToolkit\\ImageToolkitManager","name":"toolkit_manager","description":"The image toolkit manager."},"image.toolkit.operation.manager":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"image_toolkit_operation_manager","description":"The image.toolkit.operation.manager service."},"info_parser":{"type":"Drupal\\Core\\Extension\\InfoParserInterface","name":"info_parser","description":"The info parser."},"inline_block.usage":{"type":"Drupal\\layout_builder\\InlineBlockUsageInterface","name":"usage","description":"The inline block usage service."},"jsonapi.custom_query_parameter_names_validator.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"jsonapi_custom_query_parameter_names_validator_subscriber","description":"The jsonapi.custom_query_parameter_names_validator.subscriber service."},"jsonapi.entity_resource":{"type":"Drupal\\jsonapi\\Controller\\EntityResource","name":"jsonapi_entity_resource","description":"The jsonapi.entity_resource service."},"jsonapi.exception_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"jsonapi_exception_subscriber","description":"The jsonapi.exception_subscriber service."},"jsonapi.field_resolver":{"type":"Drupal\\jsonapi\\Context\\FieldResolver","name":"field_resolver","description":"The JSON:API field resolver."},"jsonapi.file_upload":{"type":"Drupal\\jsonapi\\Controller\\FileUpload","name":"jsonapi_file_upload","description":"The jsonapi.file_upload service."},"jsonapi.include_resolver":{"type":"Drupal\\jsonapi\\IncludeResolver","name":"include_resolver","description":"The include resolver."},"jsonapi.resource_response.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"jsonapi_resource_response_subscriber","description":"The jsonapi.resource_response.subscriber service."},"jsonapi.resource_response_validator.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"jsonapi_resource_response_validator_subscriber","description":"The jsonapi.resource_response_validator.subscriber service."},"jsonapi.resource_type.repository":{"type":"Drupal\\jsonapi\\ResourceType\\ResourceTypeRepositoryInterface","name":"resource_type_repository","description":"The JSON:API resource type repository."},"jsonapi.route_enhancer":{"type":"Drupal\\Core\\Routing\\EnhancerInterface","name":"jsonapi_route_enhancer","description":"The jsonapi.route_enhancer service."},"jsonapi.route_filter.format_setter":{"type":"Symfony\\Cmf\\Component\\Routing\\NestedMatcher\\RouteFilterInterface","name":"jsonapi_route_filter_format_setter","description":"The jsonapi.route_filter.format_setter service."},"jsonapi.serializer":{"type":"Symfony\\Component\\Serializer\\SerializerInterface","name":"serializer","description":"The serializer."},"kernel":{"type":"Drupal\\Core\\DrupalKernelInterface","name":"drupal_kernel","description":"The main Drupal kernel."},"kernel_destruct_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"kernel_destruct_subscriber","description":"The kernel_destruct_subscriber service."},"keyvalue":{"type":"Drupal\\Core\\KeyValueStore\\KeyValueFactoryInterface","name":"key_value_factory","description":"The key value factory."},"keyvalue.database":{"type":"Drupal\\Core\\KeyValueStore\\KeyValueFactoryInterface","name":"keyvalue_database","description":"The keyvalue.database service."},"keyvalue.expirable":{"type":"Drupal\\Core\\KeyValueStore\\KeyValueExpirableFactoryInterface","name":"storage_factory","description":"The key\/value store factory."},"keyvalue.expirable.database":{"type":"Drupal\\Core\\KeyValueStore\\KeyValueExpirableFactoryInterface","name":"keyvalue_expirable_database","description":"The keyvalue.expirable.database service."},"language.config_factory_override":{"type":"Drupal\\language\\Config\\LanguageConfigFactoryOverrideInterface","name":"config_override","description":"The language configuration override service."},"language.config_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"language_config_subscriber","description":"The language.config_subscriber service."},"language.current_language_context":{"type":"Drupal\\Core\\Plugin\\Context\\ContextProviderInterface","name":"language_current_language_context","description":"The language.current_language_context service."},"language.default":{"type":"Drupal\\Core\\Language\\LanguageDefault","name":"default_language","description":"The default language."},"language_converter":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"language_converter","description":"The language_converter service."},"language_manager":{"type":"Drupal\\Core\\Language\\LanguageManagerInterface","name":"language_manager","description":"The language manager."},"language_negotiator":{"type":"Drupal\\language\\LanguageNegotiatorInterface","name":"language_negotiator","description":"The language negotiator."},"layout.icon_builder":{"type":"Drupal\\Core\\Layout\\Icon\\IconBuilderInterface","name":"layout_icon_builder","description":"The layout.icon_builder service."},"layout_builder.get_block_dependency_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"layout_builder_get_block_dependency_subscriber","description":"The layout_builder.get_block_dependency_subscriber service."},"layout_builder.param_converter":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"layout_builder_param_converter","description":"The layout_builder.param_converter service."},"layout_builder.render_block_component_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"layout_builder_render_block_component_subscriber","description":"The layout_builder.render_block_component_subscriber service."},"layout_builder.routes":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"layout_builder_routes","description":"The layout_builder.routes service."},"layout_builder.sample_entity_generator":{"type":"Drupal\\layout_builder\\Entity\\SampleEntityGeneratorInterface","name":"layout_builder_sample_entity_generator","description":"The layout_builder.sample_entity_generator service."},"layout_builder.tempstore_repository":{"type":"Drupal\\layout_builder\\LayoutTempstoreRepositoryInterface","name":"layout_tempstore_repository","description":"The layout tempstore repository."},"library.dependency_resolver":{"type":"Drupal\\Core\\Asset\\LibraryDependencyResolverInterface","name":"library_dependency_resolver","description":"The library dependency resolver."},"library.discovery":{"type":"Drupal\\Core\\Asset\\LibraryDiscoveryInterface","name":"library_discovery","description":"The library discovery service."},"library.discovery.collector":{"type":"Drupal\\Core\\Cache\\CacheCollectorInterface","name":"library_discovery_collector","description":"The library discovery cache collector."},"library.discovery.parser":{"type":"Drupal\\Core\\Asset\\LibraryDiscoveryParser","name":"discovery_parser","description":"The library discovery parser."},"link_generator":{"type":"Drupal\\Core\\Utility\\LinkGeneratorInterface","name":"link_generator","description":"The link_generator service."},"locale.config_manager":{"type":"Drupal\\locale\\LocaleConfigManager","name":"locale_config_manager","description":"The typed configuration manager."},"locale.config_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"locale_config_subscriber","description":"The locale.config_subscriber service."},"locale.locale_translation_cache_tag":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"locale_locale_translation_cache_tag","description":"The locale.locale_translation_cache_tag service."},"locale.plural.formula":{"type":"Drupal\\locale\\PluralFormulaInterface","name":"locale_plural_formula","description":"The locale.plural.formula service."},"locale.project":{"type":"Drupal\\locale\\LocaleProjectStorageInterface","name":"locale_project","description":"The locale.project service."},"locale.storage":{"type":"Drupal\\locale\\StringStorageInterface","name":"locale_storage","description":"The locale storage to use for reading string translations."},"lock":{"type":"Drupal\\Core\\Lock\\LockBackendInterface","name":"lock","description":"The lock backend."},"lock.persistent":{"type":"Drupal\\Core\\Lock\\LockBackendInterface","name":"lock_persistent","description":"The lock.persistent service."},"logger.channel.aggregator":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"A logger instance."},"logger.channel.contact":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"A logger instance."},"logger.channel.cron":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"A logger instance."},"logger.channel.default":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"A logger instance."},"logger.channel.file":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"The file logger channel."},"logger.channel.form":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"A logger instance."},"logger.channel.image":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"A logger instance."},"logger.channel.jsonapi":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"The JSON:API logger channel."},"logger.channel.layout_builder":{"type":"Drupal\\Core\\Logger\\LoggerChannelInterface","name":"logger_channel_layout_builder","description":"The logger.channel.layout_builder service."},"logger.channel.migrate_drupal":{"type":"Drupal\\Core\\Logger\\LoggerChannelInterface","name":"logger","description":"The logger channel service."},"logger.channel.php":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"The logger service."},"logger.channel.rest":{"type":"Psr\\Log\\LoggerInterface","name":"logger","description":"A logger instance."},"logger.dblog":{"type":"Psr\\Log\\LoggerInterface","name":"logger_dblog","description":"The logger.dblog service."},"logger.factory":{"type":"Drupal\\Core\\Logger\\LoggerChannelFactoryInterface","name":"logger","description":"The logger channel factory."},"logger.log_message_parser":{"type":"Drupal\\Core\\Logger\\LogMessageParserInterface","name":"parser","description":"The parser to use when extracting message variables."},"logger.syslog":{"type":"Psr\\Log\\LoggerInterface","name":"logger_syslog","description":"The logger.syslog service."},"main_content_renderer.ajax":{"type":"Drupal\\Core\\Render\\MainContent\\MainContentRendererInterface","name":"ajax_renderer","description":"The ajax renderer."},"main_content_renderer.dialog":{"type":"Drupal\\Core\\Render\\MainContent\\MainContentRendererInterface","name":"main_content_renderer_dialog","description":"The main_content_renderer.dialog service."},"main_content_renderer.html":{"type":"Drupal\\Core\\Render\\MainContent\\MainContentRendererInterface","name":"main_content_renderer_html","description":"The main_content_renderer.html service."},"main_content_renderer.modal":{"type":"Drupal\\Core\\Render\\MainContent\\MainContentRendererInterface","name":"main_content_renderer_modal","description":"The main_content_renderer.modal service."},"main_content_renderer.off_canvas":{"type":"Drupal\\Core\\Render\\MainContent\\MainContentRendererInterface","name":"main_content_renderer_off_canvas","description":"The main_content_renderer.off_canvas service."},"main_content_renderer.off_canvas_top":{"type":"Drupal\\Core\\Render\\MainContent\\MainContentRendererInterface","name":"main_content_renderer_off_canvas_top","description":"The main_content_renderer.off_canvas_top service."},"main_content_view_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"main_content_view_subscriber","description":"The main_content_view_subscriber service."},"maintenance_mode":{"type":"Drupal\\Core\\Site\\MaintenanceModeInterface","name":"maintenance_mode","description":"The maintenance mode."},"maintenance_mode_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"maintenance_mode_subscriber","description":"The maintenance_mode_subscriber service."},"media.config_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"media_config_subscriber","description":"The media.config_subscriber service."},"media.oembed.iframe_url_helper":{"type":"Drupal\\media\\IFrameUrlHelper","name":"media_oembed_iframe_url_helper","description":"The media.oembed.iframe_url_helper service."},"media.oembed.provider_repository":{"type":"Drupal\\media\\OEmbed\\ProviderRepositoryInterface","name":"providers","description":"The oEmbed provider repository service."},"media.oembed.resource_fetcher":{"type":"Drupal\\media\\OEmbed\\ResourceFetcherInterface","name":"resource_fetcher","description":"The OEmbed resource fetcher service."},"media.oembed.url_resolver":{"type":"Drupal\\media\\OEmbed\\UrlResolverInterface","name":"media_oembed_url_resolver","description":"The media.oembed.url_resolver service."},"media_library.opener.field_widget":{"type":"Drupal\\media_library\\MediaLibraryOpenerInterface","name":"media_library_opener_field_widget","description":"The media_library.opener.field_widget service."},"media_library.opener_resolver":{"type":"Drupal\\media_library\\OpenerResolverInterface","name":"media_library_opener_resolver","description":"The media_library.opener_resolver service."},"media_library.route_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"media_library_route_subscriber","description":"The media_library.route_subscriber service."},"media_library.ui_builder":{"type":"Drupal\\media_library\\MediaLibraryUiBuilder","name":"media_library_ui_builder","description":"The media_library.ui_builder service."},"menu.active_trail":{"type":"Drupal\\Core\\Menu\\MenuActiveTrailInterface","name":"menu_active_trail","description":"The active menu trail service."},"menu.default_tree_manipulators":{"type":"Drupal\\Core\\Menu\\DefaultMenuLinkTreeManipulators","name":"menu_default_tree_manipulators","description":"The menu.default_tree_manipulators service."},"menu.link_tree":{"type":"Drupal\\Core\\Menu\\MenuLinkTreeInterface","name":"menu_link_tree","description":"The menu link tree service."},"menu.parent_form_selector":{"type":"Drupal\\Core\\Menu\\MenuParentFormSelectorInterface","name":"menu_parent_form_selector","description":"The menu.parent_form_selector service."},"menu.rebuild_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"menu_rebuild_subscriber","description":"The menu.rebuild_subscriber service."},"menu_link.static.overrides":{"type":"Drupal\\Core\\Menu\\StaticMenuLinkOverridesInterface","name":"overrides","description":"The service providing overrides for static links."},"messenger":{"type":"Drupal\\Core\\Messenger\\MessengerInterface","name":"messenger","description":"The messenger."},"method_filter":{"type":"Drupal\\Core\\Routing\\FilterInterface","name":"method_filter","description":"The method_filter service."},"migrate.plugin_event_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"migrate_plugin_event_subscriber","description":"The migrate.plugin_event_subscriber service."},"migrate_drupal.field_discovery":{"type":"Drupal\\migrate_drupal\\FieldDiscoveryInterface","name":"migrate_drupal_field_discovery","description":"The migrate_drupal.field_discovery service."},"module_handler":{"type":"Drupal\\Core\\Extension\\ModuleHandlerInterface","name":"module_handler","description":"The module handler."},"node.admin_path.route_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"node_admin_path_route_subscriber","description":"The node.admin_path.route_subscriber service."},"node.grant_storage":{"type":"Drupal\\node\\NodeGrantDatabaseStorageInterface","name":"node_grant_storage","description":"The node.grant_storage service."},"node.node_route_context":{"type":"Drupal\\Core\\Plugin\\Context\\ContextProviderInterface","name":"node_node_route_context","description":"The node.node_route_context service."},"node.node_translation_exception":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"node_node_translation_exception","description":"The node.node_translation_exception service."},"node.node_translation_migrate":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"node_node_translation_migrate","description":"The node.node_translation_migrate service."},"node.route_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"node_route_subscriber","description":"The node.route_subscriber service."},"node_preview":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"node_preview","description":"The node_preview service."},"options_request_listener":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"options_request_listener","description":"The options_request_listener service."},"page_cache_kill_switch":{"type":"Drupal\\Core\\PageCache\\ResponsePolicy\\KillSwitch","name":"killSwitch","description":"The kill switch."},"page_cache_request_policy":{"type":"Drupal\\Core\\PageCache\\RequestPolicyInterface","name":"request_policy","description":"A policy rule determining the cacheability of a request."},"page_cache_response_policy":{"type":"Drupal\\Core\\PageCache\\ResponsePolicyInterface","name":"response_policy","description":"A policy rule determining the cacheability of a response."},"paramconverter.configentity_admin":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"paramconverter_configentity_admin","description":"The paramconverter.configentity_admin service."},"paramconverter.entity_revision":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"paramconverter_entity_revision","description":"The paramconverter.entity_revision service."},"paramconverter.jsonapi.resource_type":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"paramconverter_jsonapi_resource_type","description":"The paramconverter.jsonapi.resource_type service."},"paramconverter.menu_link":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"paramconverter_menu_link","description":"The paramconverter.menu_link service."},"paramconverter.views_ui":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterInterface","name":"paramconverter_views_ui","description":"The paramconverter.views_ui service."},"paramconverter_manager":{"type":"Drupal\\Core\\ParamConverter\\ParamConverterManagerInterface","name":"param_converter_manager","description":"The parameter converter manager that will be responsible for upcasting"},"paramconverter_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"paramconverter_subscriber","description":"The paramconverter_subscriber service."},"password":{"type":"Drupal\\Core\\Password\\PasswordInterface","name":"password_checker","description":"The password service."},"path.alias_manager":{"type":"Drupal\\Core\\Path\\AliasManagerInterface","name":"alias_manager","description":"The alias manager."},"path.alias_storage":{"type":"Drupal\\Core\\Path\\AliasStorageInterface","name":"alias_storage","description":"The alias storage service."},"path.alias_whitelist":{"type":"Drupal\\Core\\Path\\AliasWhitelistInterface","name":"whitelist","description":"The whitelist implementation to use."},"path.current":{"type":"Drupal\\Core\\Path\\CurrentPathStack","name":"current_path","description":"The current path."},"path.matcher":{"type":"Drupal\\Core\\Path\\PathMatcherInterface","name":"path_matcher","description":"The path matcher."},"path.validator":{"type":"Drupal\\Core\\Path\\PathValidatorInterface","name":"path_validator","description":"The path.validator service."},"path_processor.files":{"type":"Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface","name":"path_processor_files","description":"The path_processor.files service."},"path_processor.image_styles":{"type":"Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface","name":"path_processor_image_styles","description":"The path_processor.image_styles service."},"path_processor_alias":{"type":"Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface","name":"path_processor_alias","description":"The path_processor_alias service."},"path_processor_decode":{"type":"Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface","name":"path_processor_decode","description":"The path_processor_decode service."},"path_processor_front":{"type":"Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface","name":"path_processor_front","description":"The path_processor_front service."},"path_processor_manager":{"type":"Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface","name":"path_processor","description":"The path processor."},"path_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"path_subscriber","description":"The path_subscriber service."},"pgsql.entity.query.sql":{"type":"Drupal\\Core\\Entity\\Query\\QueryFactoryInterface","name":"pgsql_entity_query_sql","description":"The pgsql.entity.query.sql service."},"placeholder_strategy":{"type":"Drupal\\Core\\Render\\Placeholder\\PlaceholderStrategyInterface","name":"placeholder_strategy","description":"The placeholder strategy to use."},"placeholder_strategy.big_pipe":{"type":"Drupal\\Core\\Render\\Placeholder\\PlaceholderStrategyInterface","name":"placeholder_strategy_big_pipe","description":"The placeholder_strategy.big_pipe service."},"placeholder_strategy.single_flush":{"type":"Drupal\\Core\\Render\\Placeholder\\PlaceholderStrategyInterface","name":"placeholder_strategy_single_flush","description":"The placeholder_strategy.single_flush service."},"plugin.cache_clearer":{"type":"Drupal\\Core\\Plugin\\CachedDiscoveryClearerInterface","name":"plugin_cache_clearer","description":"The plugin.cache_clearer service."},"plugin.manager.action":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_action","description":"The plugin.manager.action service."},"plugin.manager.aggregator.fetcher":{"type":"Drupal\\aggregator\\Plugin\\AggregatorPluginManager","name":"fetcher_manager","description":"The aggregator fetcher plugin manager."},"plugin.manager.aggregator.parser":{"type":"Drupal\\aggregator\\Plugin\\AggregatorPluginManager","name":"parser_manager","description":"The aggregator parser plugin manager."},"plugin.manager.aggregator.processor":{"type":"Drupal\\aggregator\\Plugin\\AggregatorPluginManager","name":"processor_manager","description":"The aggregator processor plugin manager."},"plugin.manager.archiver":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_archiver","description":"The plugin.manager.archiver service."},"plugin.manager.block":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_block","description":"The plugin.manager.block service."},"plugin.manager.ckeditor.plugin":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_ckeditor_plugin","description":"The plugin.manager.ckeditor.plugin service."},"plugin.manager.condition":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_condition","description":"The plugin.manager.condition service."},"plugin.manager.config_translation.mapper":{"type":"Drupal\\config_translation\\ConfigMapperManagerInterface","name":"config_mapper_manager","description":"The mapper plugin discovery service."},"plugin.manager.core.layout":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_core_layout","description":"The plugin.manager.core.layout service."},"plugin.manager.display_variant":{"type":"Drupal\\Component\\Plugin\\PluginManagerInterface","name":"display_variant_manager","description":"The display variant manager."},"plugin.manager.editor":{"type":"Drupal\\Component\\Plugin\\PluginManagerInterface","name":"plugin_manager","description":"The Text Editor plugin manager service."},"plugin.manager.element_info":{"type":"Drupal\\Core\\Render\\ElementInfoManagerInterface","name":"element_info","description":"The element info manager."},"plugin.manager.entity_reference_selection":{"type":"Drupal\\Core\\Entity\\EntityReferenceSelection\\SelectionPluginManagerInterface","name":"selection_manager","description":"The entity reference selection handler plugin manager."},"plugin.manager.field.field_type":{"type":"Drupal\\Core\\Field\\FieldTypePluginManagerInterface","name":"field_type_manager","description":"The 'field type' plugin manager."},"plugin.manager.field.formatter":{"type":"Drupal\\Core\\Field\\FormatterPluginManager","name":"formatter_manager","description":"The manager for formatter plugins."},"plugin.manager.field.widget":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_field_widget","description":"The plugin.manager.field.widget service."},"plugin.manager.filter":{"type":"Drupal\\Component\\Plugin\\PluginManagerInterface","name":"filter_manager","description":"The filter plugin manager."},"plugin.manager.help_section":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_help_section","description":"The plugin.manager.help_section service."},"plugin.manager.help_topic":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_help_topic","description":"The plugin.manager.help_topic service."},"plugin.manager.image.effect":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_image_effect","description":"The plugin.manager.image.effect service."},"plugin.manager.language_negotiation_method":{"type":"Drupal\\Component\\Plugin\\PluginManagerInterface","name":"negotiator_manager","description":"The language negotiation methods plugin manager"},"plugin.manager.layout_builder.section_storage":{"type":"Drupal\\layout_builder\\SectionStorage\\SectionStorageManagerInterface","name":"section_storage_manager","description":"The section storage manager."},"plugin.manager.link_relation_type":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_link_relation_type","description":"The plugin.manager.link_relation_type service."},"plugin.manager.mail":{"type":"Drupal\\Core\\Mail\\MailManagerInterface","name":"mail_manager","description":"Mail manager service."},"plugin.manager.media.source":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_media_source","description":"The plugin.manager.media.source service."},"plugin.manager.menu.contextual_link":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_menu_contextual_link","description":"The plugin.manager.menu.contextual_link service."},"plugin.manager.menu.link":{"type":"Drupal\\Core\\Menu\\MenuLinkManagerInterface","name":"menu_link_manager","description":"The menu link plugin manager."},"plugin.manager.menu.local_action":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_menu_local_action","description":"The plugin.manager.menu.local_action service."},"plugin.manager.menu.local_task":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_menu_local_task","description":"The plugin.manager.menu.local_task service."},"plugin.manager.migrate.cckfield":{"type":"Drupal\\migrate_drupal\\Plugin\\MigrateFieldPluginManagerInterface","name":"plugin_manager_migrate_cckfield","description":"The plugin.manager.migrate.cckfield service."},"plugin.manager.migrate.destination":{"type":"Drupal\\migrate\\Plugin\\MigratePluginManagerInterface","name":"plugin_manager_migrate_destination","description":"The plugin.manager.migrate.destination service."},"plugin.manager.migrate.field":{"type":"Drupal\\migrate_drupal\\Plugin\\MigrateFieldPluginManagerInterface","name":"field_plugin_manager","description":"The field plugin manager."},"plugin.manager.migrate.id_map":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_migrate_id_map","description":"The plugin.manager.migrate.id_map service."},"plugin.manager.migrate.process":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_migrate_process","description":"The plugin.manager.migrate.process service."},"plugin.manager.migrate.source":{"type":"Drupal\\migrate\\Plugin\\MigrateSourcePluginManager","name":"source_manager","description":"The Migrate source plugin manager service."},"plugin.manager.migration":{"type":"Drupal\\migrate\\Plugin\\MigrationPluginManagerInterface","name":"migration_plugin_manager","description":"The migration plugin manager."},"plugin.manager.queue_worker":{"type":"Drupal\\Core\\Queue\\QueueWorkerManagerInterface","name":"queue_manager","description":"The queue plugin manager."},"plugin.manager.quickedit.editor":{"type":"Drupal\\Component\\Plugin\\PluginManagerInterface","name":"editor_manager","description":"The manager for editor plugins."},"plugin.manager.rest":{"type":"Drupal\\rest\\Plugin\\Type\\ResourcePluginManager","name":"manager","description":"The resource plugin manager."},"plugin.manager.search":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_search","description":"The plugin.manager.search service."},"plugin.manager.tour.tip":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_tour_tip","description":"The plugin.manager.tour.tip service."},"plugin.manager.views.access":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_access","description":"The plugin.manager.views.access service."},"plugin.manager.views.area":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_area","description":"The plugin.manager.views.area service."},"plugin.manager.views.argument":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_argument","description":"The plugin.manager.views.argument service."},"plugin.manager.views.argument_default":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_argument_default","description":"The plugin.manager.views.argument_default service."},"plugin.manager.views.argument_validator":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_argument_validator","description":"The plugin.manager.views.argument_validator service."},"plugin.manager.views.cache":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_cache","description":"The plugin.manager.views.cache service."},"plugin.manager.views.display":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_display","description":"The plugin.manager.views.display service."},"plugin.manager.views.display_extender":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_display_extender","description":"The plugin.manager.views.display_extender service."},"plugin.manager.views.exposed_form":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_exposed_form","description":"The plugin.manager.views.exposed_form service."},"plugin.manager.views.field":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_field","description":"The plugin.manager.views.field service."},"plugin.manager.views.filter":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_filter","description":"The plugin.manager.views.filter service."},"plugin.manager.views.join":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_join","description":"The plugin.manager.views.join service."},"plugin.manager.views.pager":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_pager","description":"The plugin.manager.views.pager service."},"plugin.manager.views.query":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_query","description":"The plugin.manager.views.query service."},"plugin.manager.views.relationship":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_relationship","description":"The plugin.manager.views.relationship service."},"plugin.manager.views.row":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_row","description":"The plugin.manager.views.row service."},"plugin.manager.views.sort":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_sort","description":"The plugin.manager.views.sort service."},"plugin.manager.views.style":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_style","description":"The plugin.manager.views.style service."},"plugin.manager.views.wizard":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_views_wizard","description":"The plugin.manager.views.wizard service."},"plugin.manager.workflows.type":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"plugin_manager_workflows_type","description":"The plugin.manager.workflows.type service."},"plugin_form.factory":{"type":"Drupal\\Core\\Plugin\\PluginFormFactoryInterface","name":"plugin_form_factory","description":"The plugin_form.factory service."},"private_key":{"type":"Drupal\\Core\\PrivateKey","name":"private_key","description":"The private key service."},"psr7.http_foundation_factory":{"type":"Symfony\\Bridge\\PsrHttpMessage\\HttpFoundationFactoryInterface","name":"http_foundation_factory","description":"The httpFoundation factory."},"psr7.http_message_factory":{"type":"Symfony\\Bridge\\PsrHttpMessage\\HttpMessageFactoryInterface","name":"http_message_factory","description":"The PSR-7 converter."},"psr_response_view_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"psr_response_view_subscriber","description":"The psr_response_view_subscriber service."},"queue":{"type":"Drupal\\Core\\Queue\\QueueFactory","name":"queue_factory","description":"The queue factory"},"queue.database":{"type":"Drupal\\Core\\Queue\\QueueDatabaseFactory","name":"queue_database","description":"The queue.database service."},"quickedit.editor.selector":{"type":"Drupal\\quickedit\\EditorSelectorInterface","name":"editor_selector","description":"An object that determines which editor to attach to a given field."},"quickedit.metadata.generator":{"type":"Drupal\\quickedit\\MetadataGeneratorInterface","name":"quickedit_metadata_generator","description":"The quickedit.metadata.generator service."},"redirect.destination":{"type":"Drupal\\Core\\Routing\\RedirectDestinationInterface","name":"redirect_destination","description":"The redirect destination service."},"redirect_leading_slashes_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"redirect_leading_slashes_subscriber","description":"The redirect_leading_slashes_subscriber service."},"redirect_response_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"redirect_response_subscriber","description":"The redirect_response_subscriber service."},"render_cache":{"type":"Drupal\\Core\\Render\\RenderCacheInterface","name":"render_cache","description":"The render cache service."},"render_placeholder_generator":{"type":"Drupal\\Core\\Render\\PlaceholderGeneratorInterface","name":"placeholder_generator","description":"The placeholder generator."},"renderer":{"type":"Drupal\\Core\\Render\\RendererInterface","name":"renderer","description":"The renderer."},"renderer_non_html":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"renderer_non_html","description":"The renderer_non_html service."},"request_close_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"request_close_subscriber","description":"The request_close_subscriber service."},"request_format_route_filter":{"type":"Drupal\\Core\\Routing\\FilterInterface","name":"request_format_route_filter","description":"The request_format_route_filter service."},"request_stack":{"type":"Symfony\\Component\\HttpFoundation\\RequestStack","name":"request_stack","description":"The request stack."},"required_module_uninstall_validator":{"type":"Drupal\\Core\\Extension\\ModuleUninstallValidatorInterface","name":"required_module_uninstall_validator","description":"The required_module_uninstall_validator service."},"resolver_manager.entity":{"type":"Drupal\\Core\\Entity\\EntityResolverManager","name":"entity_resolver_manager","description":"The entity resolver manager."},"response_filter.active_link":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"response_filter_active_link","description":"The response_filter.active_link service."},"response_filter.rss.relative_url":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"response_filter_rss_relative_url","description":"The response_filter.rss.relative_url service."},"response_generator_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"response_generator_subscriber","description":"The response_generator_subscriber service."},"rest.config_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"rest_config_subscriber","description":"The rest.config_subscriber service."},"rest.link_manager":{"type":"Drupal\\hal\\LinkManager\\TypeLinkManagerInterface","name":"rest_link_manager","description":"The rest.link_manager service."},"rest.link_manager.relation":{"type":"Drupal\\hal\\LinkManager\\ConfigurableLinkManagerInterface","name":"rest_link_manager_relation","description":"The rest.link_manager.relation service."},"rest.link_manager.type":{"type":"Drupal\\hal\\LinkManager\\ConfigurableLinkManagerInterface","name":"rest_link_manager_type","description":"The rest.link_manager.type service."},"rest.path_processor_entity_resource_bc":{"type":"Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface","name":"rest_path_processor_entity_resource_bc","description":"The rest.path_processor_entity_resource_bc service."},"rest.resource.entity.post_route.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"rest_resource_entity_post_route_subscriber","description":"The rest.resource.entity.post_route.subscriber service."},"rest.resource_response.subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"rest_resource_response_subscriber","description":"The rest.resource_response.subscriber service."},"rest.resource_routes":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"rest_resource_routes","description":"The rest.resource_routes service."},"rest.route_processor_get_bc":{"type":"Drupal\\Core\\RouteProcessor\\OutboundRouteProcessorInterface","name":"rest_route_processor_get_bc","description":"The rest.route_processor_get_bc service."},"route_access_response_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"route_access_response_subscriber","description":"The route_access_response_subscriber service."},"route_enhancer.entity":{"type":"Drupal\\Core\\Routing\\EnhancerInterface","name":"route_enhancer_entity","description":"The route_enhancer.entity service."},"route_enhancer.entity_revision":{"type":"Drupal\\Core\\Routing\\EnhancerInterface","name":"route_enhancer_entity_revision","description":"The route_enhancer.entity_revision service."},"route_enhancer.form":{"type":"Drupal\\Core\\Routing\\EnhancerInterface","name":"route_enhancer_form","description":"The route_enhancer.form service."},"route_enhancer.param_conversion":{"type":"Drupal\\Core\\Routing\\EnhancerInterface","name":"route_enhancer_param_conversion","description":"The route_enhancer.param_conversion service."},"route_http_method_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"route_http_method_subscriber","description":"The route_http_method_subscriber service."},"route_processor_csrf":{"type":"Drupal\\Core\\RouteProcessor\\OutboundRouteProcessorInterface","name":"route_processor_csrf","description":"The route_processor_csrf service."},"route_processor_current":{"type":"Drupal\\Core\\RouteProcessor\\OutboundRouteProcessorInterface","name":"route_processor_current","description":"The route_processor_current service."},"route_processor_manager":{"type":"Drupal\\Core\\RouteProcessor\\OutboundRouteProcessorInterface","name":"route_processor_manager","description":"The route_processor_manager service."},"route_special_attributes_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"route_special_attributes_subscriber","description":"The route_special_attributes_subscriber service."},"route_subscriber.entity":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"route_subscriber_entity","description":"The route_subscriber.entity service."},"route_subscriber.module":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"route_subscriber_module","description":"The route_subscriber.module service."},"route_subscriber.no_big_pipe":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"route_subscriber_no_big_pipe","description":"The route_subscriber.no_big_pipe service."},"router":{"type":"Drupal\\Core\\Routing\\AccessAwareRouterInterface","name":"access_aware_router","description":"The access aware router."},"router.admin_context":{"type":"Drupal\\Core\\Routing\\AdminContext","name":"admin_context","description":"The route admin context to determine whether the route is an admin one."},"router.builder":{"type":"Drupal\\Core\\Routing\\RouteBuilderInterface","name":"router_builder","description":"The router builder service."},"router.dumper":{"type":"Drupal\\Core\\Routing\\MatcherDumperInterface","name":"dumper","description":"The matcher dumper used to store the route information."},"router.dynamic":{"type":"Symfony\\Component\\Routing\\RouterInterface","name":"router_dynamic","description":"The router.dynamic service."},"router.matcher.final_matcher":{"type":"Symfony\\Cmf\\Component\\Routing\\NestedMatcher\\FinalMatcherInterface","name":"router_matcher_final_matcher","description":"The router.matcher.final_matcher service."},"router.no_access_checks":{"type":"Symfony\\Component\\Routing\\Matcher\\UrlMatcherInterface","name":"access_unaware_router","description":"A router implementation which does not check access."},"router.path_roots_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"router_path_roots_subscriber","description":"The router.path_roots_subscriber service."},"router.request_context":{"type":"Drupal\\Core\\Routing\\RequestContext","name":"request_context","description":"The request context."},"router.route_preloader":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"router_route_preloader","description":"The router.route_preloader service."},"router.route_provider":{"type":"Drupal\\Core\\Routing\\RouteProviderInterface","name":"route_provider","description":"The route provider."},"router.route_provider.lazy_builder":{"type":"Drupal\\Core\\Routing\\PreloadableRouteProviderInterface","name":"router_route_provider_lazy_builder","description":"The router.route_provider.lazy_builder service."},"router_listener":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"router_listener","description":"The router_listener service."},"search.search_page_repository":{"type":"Drupal\\search\\SearchPageRepositoryInterface","name":"search_search_page_repository","description":"The search.search_page_repository service."},"serialization.bc_config_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"serialization_bc_config_subscriber","description":"The serialization.bc_config_subscriber service."},"serialization.entity_resolver.target_id":{"type":"Drupal\\serialization\\EntityResolver\\EntityResolverInterface","name":"serialization_entity_resolver_target_id","description":"The serialization.entity_resolver.target_id service."},"serialization.exception.default":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"serialization_exception_default","description":"The serialization.exception.default service."},"serialization.json":{"type":"Drupal\\Component\\Serialization\\SerializationInterface","name":"serialization_json","description":"The serialization.json service."},"serialization.phpserialize":{"type":"Drupal\\Component\\Serialization\\SerializationInterface","name":"serializer","description":"The serialization class to use."},"serialization.user_route_alter_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"serialization_user_route_alter_subscriber","description":"The serialization.user_route_alter_subscriber service."},"serialization.yaml":{"type":"Drupal\\Component\\Serialization\\SerializationInterface","name":"serialization_yaml","description":"The serialization.yaml service."},"serializer":{"type":"Symfony\\Component\\Serializer\\SerializerInterface","name":"serializer","description":"The serializer."},"serializer.entity_resolver":{"type":"Drupal\\serialization\\EntityResolver\\ChainEntityResolverInterface","name":"serializer_entity_resolver","description":"The serializer.entity_resolver service."},"serializer.entity_resolver.uuid":{"type":"Drupal\\serialization\\EntityResolver\\EntityResolverInterface","name":"serializer_entity_resolver_uuid","description":"The serializer.entity_resolver.uuid service."},"serializer.normalizer.htt_exception.jsonapi":{"type":"Symfony\\Component\\Serializer\\SerializerAwareInterface","name":"serializer_normalizer_htt_exception_jsonapi","description":"The serializer.normalizer.htt_exception.jsonapi service."},"service_container":{"type":"Symfony\\Component\\DependencyInjection\\ContainerInterface","name":"container","description":"The container."},"session":{"type":"Symfony\\Component\\HttpFoundation\\Session\\SessionInterface","name":"session","description":"The session."},"session_configuration":{"type":"Drupal\\Core\\Session\\SessionConfigurationInterface","name":"session_configuration","description":"The session configuration."},"session_handler.storage":{"type":"SessionHandlerInterface","name":"wrapped_session_handler","description":"The underlying session handler."},"session_handler.write_safe":{"type":"Drupal\\Core\\Session\\WriteSafeSessionHandlerInterface","name":"write_safe_handler","description":"The write-safe session handler."},"session_manager.metadata_bag":{"type":"Drupal\\Core\\Session\\MetadataBag","name":"session_metadata","description":"The session metadata bag."},"settings":{"type":"Drupal\\Core\\Site\\Settings","name":"settings","description":"The site settings."},"state":{"type":"Drupal\\Core\\State\\StateInterface","name":"state","description":"The state service."},"statistics.storage.node":{"type":"Drupal\\statistics\\StatisticsStorageInterface","name":"statistics_storage_node","description":"The statistics.storage.node service."},"stream_wrapper.public":{"type":"Drupal\\Core\\StreamWrapper\\PhpStreamWrapperInterface","name":"stream_wrapper_public","description":"The stream_wrapper.public service."},"stream_wrapper.temporary":{"type":"Drupal\\Core\\StreamWrapper\\PhpStreamWrapperInterface","name":"stream_wrapper_temporary","description":"The stream_wrapper.temporary service."},"stream_wrapper.translations":{"type":"Drupal\\Core\\StreamWrapper\\PhpStreamWrapperInterface","name":"stream_wrapper_translations","description":"The stream_wrapper.translations service."},"stream_wrapper_manager":{"type":"Drupal\\Core\\StreamWrapper\\StreamWrapperManagerInterface","name":"stream_wrapper_manager","description":"The stream wrapper manager."},"string_translation":{"type":"Drupal\\Core\\StringTranslation\\TranslationInterface","name":"string_translation","description":"The string translation service."},"string_translator.custom_strings":{"type":"Drupal\\Core\\StringTranslation\\Translator\\TranslatorInterface","name":"string_translator_custom_strings","description":"The string_translator.custom_strings service."},"string_translator.locale.lookup":{"type":"Drupal\\Core\\StringTranslation\\Translator\\TranslatorInterface","name":"string_translator_locale_lookup","description":"The string_translator.locale.lookup service."},"system.admin_path.route_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"system_admin_path_route_subscriber","description":"The system.admin_path.route_subscriber service."},"system.breadcrumb.default":{"type":"Drupal\\Core\\Breadcrumb\\BreadcrumbBuilderInterface","name":"system_breadcrumb_default","description":"The system.breadcrumb.default service."},"system.config_cache_tag":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"system_config_cache_tag","description":"The system.config_cache_tag service."},"system.config_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"system_config_subscriber","description":"The system.config_subscriber service."},"system.manager":{"type":"Drupal\\system\\SystemManager","name":"system_manager","description":"The system.manager service."},"taxonomy_term.breadcrumb":{"type":"Drupal\\Core\\Breadcrumb\\BreadcrumbBuilderInterface","name":"taxonomy_term_breadcrumb","description":"The taxonomy_term.breadcrumb service."},"tempstore.private":{"type":"Drupal\\Core\\TempStore\\PrivateTempStoreFactory","name":"temp_store_factory","description":"The tempstore service."},"tempstore.shared":{"type":"Drupal\\Core\\TempStore\\SharedTempStoreFactory","name":"temp_store_factory","description":"The shared tempstore factory."},"test_discovery":{"type":"Drupal\\simpletest\\TestDiscovery","name":"test_discovery","description":"The test discovery service."},"theme.initialization":{"type":"Drupal\\Core\\Theme\\ThemeInitializationInterface","name":"theme_initialization","description":"The theme initialization."},"theme.manager":{"type":"Drupal\\Core\\Theme\\ThemeManagerInterface","name":"theme_manager","description":"The theme manager."},"theme.negotiator":{"type":"Drupal\\Core\\Theme\\ThemeNegotiatorInterface","name":"theme_negotiator","description":"The theme negotiator."},"theme.negotiator.admin_theme":{"type":"Drupal\\Core\\Theme\\ThemeNegotiatorInterface","name":"theme_negotiator_admin_theme","description":"The theme.negotiator.admin_theme service."},"theme.negotiator.ajax_base_page":{"type":"Drupal\\Core\\Theme\\ThemeNegotiatorInterface","name":"theme_negotiator_ajax_base_page","description":"The theme.negotiator.ajax_base_page service."},"theme.negotiator.block.admin_demo":{"type":"Drupal\\Core\\Theme\\ThemeNegotiatorInterface","name":"theme_negotiator_block_admin_demo","description":"The theme.negotiator.block.admin_demo service."},"theme.negotiator.default":{"type":"Drupal\\Core\\Theme\\ThemeNegotiatorInterface","name":"theme_negotiator_default","description":"The theme.negotiator.default service."},"theme.negotiator.system.batch":{"type":"Drupal\\Core\\Theme\\ThemeNegotiatorInterface","name":"theme_negotiator_system_batch","description":"The theme.negotiator.system.batch service."},"theme.negotiator.system.db_update":{"type":"Drupal\\Core\\Theme\\ThemeNegotiatorInterface","name":"theme_negotiator_system_db_update","description":"The theme.negotiator.system.db_update service."},"theme.registry":{"type":"Drupal\\Core\\Theme\\Registry","name":"theme_registry","description":"The theme registry."},"theme_handler":{"type":"Drupal\\Core\\Extension\\ThemeHandlerInterface","name":"theme_handler","description":"The theme handler."},"theme_installer":{"type":"Drupal\\Core\\Extension\\ThemeInstallerInterface","name":"theme_installer","description":"The theme_installer service."},"title_resolver":{"type":"Drupal\\Core\\Controller\\TitleResolverInterface","name":"title_resolver","description":"The title resolver."},"token":{"type":"Drupal\\Core\\Utility\\Token","name":"token","description":"The token service."},"toolbar.page_cache_request_policy.allow_toolbar_path":{"type":"Drupal\\Core\\PageCache\\RequestPolicyInterface","name":"toolbar_page_cache_request_policy_allow_toolbar_path","description":"The toolbar.page_cache_request_policy.allow_toolbar_path service."},"transliteration":{"type":"Drupal\\Component\\Transliteration\\TransliterationInterface","name":"transliteration","description":"The transliteration service."},"twig.extension":{"type":"Twig\\Extension\\ExtensionInterface","name":"twig_extension","description":"The twig.extension service."},"twig.extension.debug":{"type":"Twig\\Extension\\ExtensionInterface","name":"twig_extension_debug","description":"The twig.extension.debug service."},"twig.loader.filesystem":{"type":"Twig\\Loader\\SourceContextLoaderInterface","name":"twig_loader_filesystem","description":"The twig.loader.filesystem service."},"twig.loader.string":{"type":"Twig\\Loader\\LoaderInterface","name":"twig_loader_string","description":"The twig.loader.string service."},"twig.loader.theme_registry":{"type":"Twig\\Loader\\SourceContextLoaderInterface","name":"twig_loader_theme_registry","description":"The twig.loader.theme_registry service."},"typed_data_manager":{"type":"Drupal\\Core\\TypedData\\TypedDataManagerInterface","name":"typed_data_manager","description":"The typed data manager."},"unrouted_url_assembler":{"type":"Drupal\\Core\\Utility\\UnroutedUrlAssemblerInterface","name":"url_assembler","description":"The unrouted URL assembler service."},"update.fetcher":{"type":"Drupal\\update\\UpdateFetcherInterface","name":"update_fetcher","description":"The update fetcher service"},"update.manager":{"type":"Drupal\\update\\UpdateManagerInterface","name":"update_manager","description":"The update.manager service."},"update.post_update_registry":{"type":"Drupal\\Core\\Update\\UpdateRegistry","name":"update_post_update_registry","description":"The update.post_update_registry service."},"update.post_update_registry_factory":{"type":"Symfony\\Component\\DependencyInjection\\ContainerAwareInterface","name":"update_post_update_registry_factory","description":"The update.post_update_registry_factory service."},"update.processor":{"type":"Drupal\\update\\UpdateProcessorInterface","name":"update_processor","description":"The Update Processor service."},"url_generator":{"type":"Drupal\\Core\\Routing\\UrlGeneratorInterface","name":"url_generator","description":"The URL generator."},"user.auth":{"type":"Drupal\\user\\UserAuthInterface","name":"user_auth","description":"The user authentication service."},"user.authentication.cookie":{"type":"Drupal\\Core\\Authentication\\AuthenticationProviderInterface","name":"user_authentication_cookie","description":"The user.authentication.cookie service."},"user.current_user_context":{"type":"Drupal\\Core\\Plugin\\Context\\ContextProviderInterface","name":"user_current_user_context","description":"The user.current_user_context service."},"user.data":{"type":"Drupal\\user\\UserDataInterface","name":"user_data","description":"The user data service."},"user.permissions":{"type":"Drupal\\user\\PermissionHandlerInterface","name":"user_permissions","description":"The user.permissions service."},"user.private_tempstore":{"type":"Drupal\\user\\PrivateTempStoreFactory","name":"user_private_tempstore","description":"The user.private_tempstore service."},"user.shared_tempstore":{"type":"Drupal\\user\\SharedTempStoreFactory","name":"user_shared_tempstore","description":"The user.shared_tempstore service."},"user.toolbar_link_builder":{"type":"Drupal\\user\\ToolbarLinkBuilder","name":"user_toolbar_link_builder","description":"The user.toolbar_link_builder service."},"user_access_denied_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"user_access_denied_subscriber","description":"The user_access_denied_subscriber service."},"user_last_access_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"user_last_access_subscriber","description":"The user_last_access_subscriber service."},"user_maintenance_mode_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"user_maintenance_mode_subscriber","description":"The user_maintenance_mode_subscriber service."},"user_permissions_hash_generator":{"type":"Drupal\\Core\\Session\\PermissionsHashGeneratorInterface","name":"permissions_hash_generator","description":"The permissions hash generator."},"uuid":{"type":"Drupal\\Component\\Uuid\\UuidInterface","name":"uuid","description":"The uuid service."},"validation.constraint":{"type":"Drupal\\Core\\Cache\\CacheableDependencyInterface","name":"validation_constraint","description":"The validation.constraint service."},"views.analyzer":{"type":"Drupal\\views\\Analyzer","name":"views_analyzer","description":"The views.analyzer service."},"views.date_sql":{"type":"Drupal\\views\\Plugin\\views\\query\\DateSqlInterface","name":"views_date_sql","description":"The views.date_sql service."},"views.entity_schema_subscriber":{"type":"Drupal\\Core\\Entity\\EntityTypeListenerInterface","name":"views_entity_schema_subscriber","description":"The views.entity_schema_subscriber service."},"views.executable":{"type":"Drupal\\views\\ViewExecutableFactory","name":"views_executable_factory","description":"The views executable factory."},"views.exposed_form_cache":{"type":"Drupal\\views\\ExposedFormCache","name":"views_exposed_form_cache","description":"The views.exposed_form_cache service."},"views.route_subscriber":{"type":"Symfony\\Component\\EventDispatcher\\EventSubscriberInterface","name":"views_route_subscriber","description":"The views.route_subscriber service."},"views.views_data":{"type":"Drupal\\views\\ViewsData","name":"views_data","description":"The views data cache."},"views.views_data_helper":{"type":"Drupal\\views\\ViewsDataHelper","name":"views_views_data_helper","description":"The views.views_data_helper service."},"workflows.access_check.delete_state":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"workflows_access_check_delete_state","description":"The workflows.access_check.delete_state service."},"workflows.access_check.extended_permissions":{"type":"Drupal\\Core\\Routing\\Access\\AccessInterface","name":"workflows_access_check_extended_permissions","description":"The workflows.access_check.extended_permissions service."}} \ No newline at end of file diff --git a/vendor/chi-teck/drupal-code-generator/src/ApplicationFactory.php b/vendor/chi-teck/drupal-code-generator/src/ApplicationFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..40c3f3f79f324e590adb5a346077e0ee63286fb9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/ApplicationFactory.php @@ -0,0 +1,61 @@ +<?php + +namespace DrupalCodeGenerator; + +use DrupalCodeGenerator\Helper\Dumper; +use DrupalCodeGenerator\Helper\InputHandler; +use DrupalCodeGenerator\Helper\OutputHandler; +use DrupalCodeGenerator\Helper\Renderer; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Helper\HelperSet; +use Symfony\Component\Console\Helper\QuestionHelper; +use Symfony\Component\Filesystem\Filesystem; + +/** + * DCG application factory. + */ +class ApplicationFactory { + + /** + * Determines path to DCG root directory. + * + * @return string + * Path to DCG root directory. + */ + public static function getRoot() { + return dirname(__DIR__); + } + + /** + * Creates an application. + * + * @return \Symfony\Component\Console\Application + * The initialized console application. + */ + public static function create() { + // This gets substituted with git version when DCG is packaged to PHAR file. + $version = '@git-version@'; + // Fallback for composer installation. + if (!is_numeric($version[0])) { + $version = 'UNKNOWN'; + } + $application = new Application('Drupal Code Generator', $version); + + $helper_set = new HelperSet([ + new QuestionHelper(), + new Dumper(new Filesystem()), + // We cannot reference the TwigEnvironment class with use statement + // because of a PHP bug. + // @see https://bugs.php.net/bug.php?id=66773 + // @codingStandardsIgnoreStart + new Renderer(new \DrupalCodeGenerator\Twig\TwigEnvironment(new \Twig_Loader_Filesystem())), + // @codingStandardsIgnoreEnd + new InputHandler(), + new OutputHandler(), + ]); + $application->setHelperSet($helper_set); + + return $application; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Asset.php b/vendor/chi-teck/drupal-code-generator/src/Asset.php new file mode 100644 index 0000000000000000000000000000000000000000..2aef27ae2a447f9f743000c5826250e6d97988b8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Asset.php @@ -0,0 +1,320 @@ +<?php + +namespace DrupalCodeGenerator; + +use DrupalCodeGenerator\Helper\Renderer; + +/** + * Simple data structure to represent an asset being generated. + */ +class Asset { + + /** + * Asset path. + * + * @var string + */ + protected $path; + + /** + * Asset content. + * + * @var string + */ + protected $content; + + /** + * Twig template to render header. + * + * @var string + */ + protected $headerTemplate; + + /** + * Twig template to render main content. + * + * @var string + */ + protected $template; + + /** + * Template variables. + * + * @var array + */ + protected $vars = []; + + /** + * Action. + * + * This defines an action to take if specified file already exists. + * + * @var string + */ + protected $action = 'replace'; + + /** + * Header size. + * + * @var int + */ + protected $headerSize = 0; + + /** + * Asset mode. + * + * @var int + */ + protected $mode; + + /** + * Asset type (file or directory). + * + * @var string + */ + protected $type = 'file'; + + /** + * Getter for asset path. + * + * @return string + * Asset path. + */ + public function getPath() { + return Utils::tokenReplace($this->path, $this->getVars()); + } + + /** + * Getter for asset content. + * + * @return string + * Asset content. + */ + public function getContent() { + return $this->content; + } + + /** + * Getter for header template. + * + * @return string + * Asset header template. + */ + public function getHeaderTemplate() { + return $this->headerTemplate; + } + + /** + * Getter for template. + * + * @return string + * Asset template. + */ + public function getTemplate() { + return $this->template; + } + + /** + * Getter for asset vars. + * + * @return array + * Asset template variables. + */ + public function getVars() { + return $this->vars; + } + + /** + * Getter for asset action. + * + * @return string + * Asset action. + */ + public function getAction() { + return $this->action; + } + + /** + * Getter for asset header size. + * + * @return string + * Asset header size. + */ + public function getHeaderSize() { + return $this->headerSize; + } + + /** + * Getter for asset mode. + * + * @return string + * Asset file mode. + */ + public function getMode() { + return $this->mode ?: ($this->isDirectory() ? 0755 : 0644); + } + + /** + * Getter for asset type. + * + * @return string + * Asset type. + */ + public function getType() { + return $this->type; + } + + /** + * Setter for asset path. + * + * @param string $path + * Asset path. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function path($path) { + $this->path = $path; + return $this; + } + + /** + * Setter for asset content. + * + * @param string $content + * Asset content. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function content($content) { + $this->content = $content; + return $this; + } + + /** + * Setter for asset header template. + * + * @param string $header_template + * Asset template. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function headerTemplate($header_template) { + $this->headerTemplate = $header_template; + return $this; + } + + /** + * Setter for asset template. + * + * @param string $template + * Asset template. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function template($template) { + $this->template = $template; + return $this; + } + + /** + * Setter for asset vars. + * + * @param array $vars + * Asset template variables. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function vars(array $vars) { + $this->vars = $vars; + return $this; + } + + /** + * Setter for asset action. + * + * @param string $action + * Asset action. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function action($action) { + $this->action = $action; + return $this; + } + + /** + * Setter for asset header size. + * + * @param int $header_size + * Asset header size. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function headerSize($header_size) { + $this->headerSize = $header_size; + return $this; + } + + /** + * Setter for asset mode. + * + * @param string $mode + * Asset mode. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function mode($mode) { + $this->mode = $mode; + return $this; + } + + /** + * Setter for asset type. + * + * @param string $type + * Asset type. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + public function type($type) { + $this->type = $type; + return $this; + } + + /** + * Determines if the asset is a directory. + * + * @return bool + * True if the asset is a directory, false otherwise. + */ + public function isDirectory() { + return $this->getType() == 'directory'; + } + + /** + * Renders the asset template. + * + * @param \DrupalCodeGenerator\Helper\Renderer $renderer + * Renderer helper. + */ + public function render(Renderer $renderer) { + if (!$this->isDirectory() && is_null($this->getContent())) { + $content = ''; + if ($header_template = $this->getHeaderTemplate()) { + $content .= $renderer->render($header_template, $this->getVars()) . "\n"; + } + $content .= $renderer->render($this->getTemplate(), $this->getVars()); + $this->content($content); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Box/PhpCompactor.php b/vendor/chi-teck/drupal-code-generator/src/Box/PhpCompactor.php new file mode 100644 index 0000000000000000000000000000000000000000..b65e88458ccd6d41e453ea7722bea44156141912 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Box/PhpCompactor.php @@ -0,0 +1,30 @@ +<?php + +namespace DrupalCodeGenerator\Box; + +use Herrera\Box\Compactor\Compactor; + +/** + * A PHP source code compactor. + */ +class PhpCompactor extends Compactor { + + /** + * {@inheritdoc} + */ + protected $extensions = ['php']; + + /** + * {@inheritdoc} + */ + public function compact($contents) { + // php_strip_whitespace() takes file name as argument so we have to save the + // contents to a temporary file. + $temp_file = tempnam(sys_get_temp_dir(), 'dcg-'); + file_put_contents($temp_file, $contents); + $contents = php_strip_whitespace($temp_file); + unlink($temp_file); + return $contents; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/BaseGenerator.php b/vendor/chi-teck/drupal-code-generator/src/Command/BaseGenerator.php new file mode 100644 index 0000000000000000000000000000000000000000..34ba34408a9011b73da2c30536a291fff781852c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/BaseGenerator.php @@ -0,0 +1,465 @@ +<?php + +namespace DrupalCodeGenerator\Command; + +use DrupalCodeGenerator\ApplicationFactory; +use DrupalCodeGenerator\Asset; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Base class for all generators. + */ +abstract class BaseGenerator extends Command implements GeneratorInterface { + + /** + * The command name. + * + * @var string + */ + protected $name; + + /** + * The command description. + * + * @var string + */ + protected $description; + + /** + * The command alias. + * + * @var string + */ + protected $alias; + + /** + * Command label. + * + * @var string + */ + protected $label; + + /** + * A path where templates are stored. + * + * @var string + */ + protected $templatePath; + + /** + * The working directory. + * + * @var string + */ + protected $directory; + + /** + * The destination. + * + * @var mixed + */ + protected $destination = 'modules/%'; + + /** + * Files to create. + * + * The key of the each item in the array is the path to the file and + * the value is the generated content of it. + * + * @var array + * + * @deprecated Use self::$assets. + */ + protected $files = []; + + /** + * Assets to create. + * + * @var \DrupalCodeGenerator\Asset[] + */ + protected $assets = []; + + /** + * Twig template variables. + * + * @var array + */ + protected $vars = []; + + /** + * {@inheritdoc} + */ + protected function configure() { + $this + ->setName($this->name) + ->setDescription($this->description) + ->addOption( + 'directory', + '-d', + InputOption::VALUE_OPTIONAL, + 'Working directory' + ) + ->addOption( + 'answers', + '-a', + InputOption::VALUE_OPTIONAL, + 'Default JSON formatted answers' + ); + + if ($this->alias) { + $this->setAliases([$this->alias]); + } + + if (!$this->templatePath) { + $this->templatePath = ApplicationFactory::getRoot() . '/templates'; + } + } + + /** + * {@inheritdoc} + */ + protected function initialize(InputInterface $input, OutputInterface $output) { + $this->getHelperSet()->setCommand($this); + $this->getHelper('dcg_renderer')->addPath($this->templatePath); + + $directory = $input->getOption('directory') ?: getcwd(); + // No need to look up for extension root when generating an extension. + $extension_destinations = ['modules', 'profiles', 'themes']; + $is_extension = in_array($this->destination, $extension_destinations); + $this->directory = $is_extension + ? $directory : (Utils::getExtensionRoot($directory) ?: $directory); + + // Display welcome message. + $header = sprintf( + "\n Welcome to %s generator!", + $this->getName() + ); + $output->writeln($header); + $header_length = strlen(trim(strip_tags($header))); + $output->writeln('<fg=cyan;options=bold>–' . str_repeat('–', $header_length) . '–</>'); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) { + + // Render all assets. + $renderer = $this->getHelper('dcg_renderer'); + foreach ($this->getAssets() as $asset) { + // Supply the asset with all collected variables if it has no local ones. + if (!$asset->getVars()) { + $asset->vars($this->vars); + } + $asset->render($renderer); + } + + $dumped_files = $this->getHelper('dcg_dumper')->dump($input, $output); + $this->getHelper('dcg_output_handler')->printSummary($output, $dumped_files); + return 0; + } + + /** + * {@inheritdoc} + */ + public function getLabel() { + return $this->label; + } + + /** + * Returns list of rendered files. + * + * @return array + * An associative array where each key is path to a file and value is + * rendered content. + * + * @deprecated. + */ + public function getFiles() { + return $this->files; + } + + /** + * {@inheritdoc} + */ + public function getAssets() { + if ($this->files) { + // Convert files into assets for legacy commands. + $assets = []; + foreach ($this->getFiles() as $path => $file) { + $asset = new Asset(); + $asset->path($path); + if (!is_array($file)) { + $file = ['content' => $file]; + } + if (isset($file['content'])) { + $asset->content($file['content']); + } + else { + $asset->type('directory'); + } + if (isset($file['action'])) { + $asset->action($file['action']); + } + if (isset($file['header_size'])) { + $asset->headerSize($file['header_size']); + } + if (isset($file['mode'])) { + $asset->mode($file['mode']); + } + $assets[] = $asset; + } + return array_merge($assets, $this->assets); + } + + return $this->assets; + } + + /** + * {@inheritdoc} + */ + public function setDirectory($directory) { + $this->directory = $directory; + } + + /** + * {@inheritdoc} + */ + public function getDirectory() { + return $this->directory; + } + + /** + * {@inheritdoc} + */ + public function setDestination($destination) { + $this->destination = $destination; + } + + /** + * {@inheritdoc} + */ + public function getDestination() { + return $this->destination; + } + + /** + * Renders a template. + * + * @param string $template + * Twig template. + * @param array $vars + * Template variables. + * + * @return string + * A string representing the rendered output. + */ + protected function render($template, array $vars) { + return $this->getHelper('dcg_renderer')->render($template, $vars); + } + + /** + * Asks the user for template variables. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * Input instance. + * @param \Symfony\Component\Console\Output\OutputInterface $output + * Output instance. + * @param array $questions + * List of questions that the user should answer. + * @param array $vars + * Array of predefined template variables. + * + * @return array + * Template variables. + * + * @see \DrupalCodeGenerator\InputHandler::collectVars() + */ + protected function &collectVars(InputInterface $input, OutputInterface $output, array $questions, array $vars = []) { + $this->vars += $this->getHelper('dcg_input_handler')->collectVars($input, $output, $questions, $vars); + return $this->vars; + } + + /** + * Asks the user a single question and returns the answer. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * Input instance. + * @param \Symfony\Component\Console\Output\OutputInterface $output + * Output instance. + * @param \Symfony\Component\Console\Question\Question $question + * A question to ask. + * @param array $vars + * Array of predefined template variables. + * + * @return string + * The answer. + * + * @see \DrupalCodeGenerator\InputHandler::collectVars() + */ + protected function ask(InputInterface $input, OutputInterface $output, Question $question, array $vars = []) { + $key = mt_rand(); + $answers = $this->getHelper('dcg_input_handler')->collectVars($input, $output, [$key => $question], $vars); + return $answers[$key]; + } + + /** + * Creates an asset. + * + * @param string $type + * Asset type. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + protected function addAsset($type) { + $asset = (new Asset())->type($type); + $this->assets[] = $asset; + return $asset; + } + + /** + * Creates file asset. + * + * @param string $path + * (Optional) File path. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + protected function addFile($path = NULL) { + return $this->addAsset('file')->path($path); + } + + /** + * Creates directory asset. + * + * @param string $path + * (Optional) Directory path. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + protected function addDirectory($path = NULL) { + return $this->addAsset('directory')->path($path); + } + + /** + * Creates service file asset. + * + * @param string $path + * (Optional) File path. + * + * @return \DrupalCodeGenerator\Asset + * The asset. + */ + protected function addServicesFile($path = NULL) { + return $this->addFile() + ->path($path ?: '{machine_name}.services.yml') + ->action('append') + ->headerSize(1); + } + + /** + * Creates file asset. + * + * @param string $path + * Path to the file. + * @param string $template + * Twig template to render. + * @param array $vars + * Twig variables. + * + * @deprecated Use self::addFile() or self::addDirectory(). + */ + protected function setFile($path = NULL, $template = NULL, array $vars = []) { + $this->addFile() + ->path($path) + ->template($template) + ->vars($vars); + } + + /** + * Creates service file asset. + * + * @param string $path + * Path to the file. + * @param string $template + * Twig template to render. + * @param array $vars + * Twig variables. + * + * @deprecated Use self::addServiceFile(). + */ + protected function setServicesFile($path, $template, array $vars) { + $this->addServicesFile() + ->path($path) + ->template($template) + ->vars($vars); + } + + /** + * Collects services. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * Input instance. + * @param \Symfony\Component\Console\Output\OutputInterface $output + * Output instance. + * + * @return array + * List of collected services. + */ + protected function collectServices(InputInterface $input, OutputInterface $output) { + + $service_definitions = self::getServiceDefinitions(); + $service_ids = array_keys($service_definitions); + + $services = []; + while (TRUE) { + $question = new Question('Type the service name or use arrows up/down. Press enter to continue'); + $question->setValidator([Utils::class, 'validateServiceName']); + $question->setAutocompleterValues($service_ids); + $service = $this->ask($input, $output, $question); + if (!$service) { + break; + } + $services[] = $service; + } + + $this->vars['services'] = []; + foreach (array_unique($services) as $service_id) { + if (isset($service_definitions[$service_id])) { + $definition = $service_definitions[$service_id]; + } + else { + // Build the definition if the service is unknown. + $definition = [ + 'type' => 'Drupal\example\ExampleInterface', + 'name' => str_replace('.', '_', $service_id), + 'description' => "The $service_id service.", + ]; + } + $type_parts = explode('\\', $definition['type']); + $definition['short_type'] = end($type_parts); + $this->vars['services'][$service_id] = $definition; + } + return $this->vars['services']; + } + + /** + * Gets service definitions. + * + * @return array + * List of service definitions keyed by service ID. + */ + protected static function getServiceDefinitions() { + $data_encoded = file_get_contents(ApplicationFactory::getRoot() . '/resources/service-definitions.json'); + return json_decode($data_encoded, TRUE); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Access.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Access.php new file mode 100644 index 0000000000000000000000000000000000000000..7ab809b30384a55c64407aae256a5e5537058676 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Access.php @@ -0,0 +1,15 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7\CToolsPlugin; + +/** + * Implements d7:ctools-plugin:access command. + */ +class Access extends BasePlugin { + + protected $name = 'd7:ctools-plugin:access'; + protected $description = 'Generates CTools access plugin'; + protected $template = 'd7/ctools-plugin/access.twig'; + protected $subDirectory = 'plugins/access'; + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/BasePlugin.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/BasePlugin.php new file mode 100644 index 0000000000000000000000000000000000000000..c250d9b61ca7df8669d8792b5f98ad558f40fd9d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/BasePlugin.php @@ -0,0 +1,49 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7\CToolsPlugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Base class for d7:ctools-plugin commands. + */ +abstract class BasePlugin extends BaseGenerator { + + protected $template; + protected $subDirectory; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['plugin_name'] = new Question('Plugin name', 'Example'); + $questions['plugin_name']->setValidator([Utils::class, 'validateRequired']); + + $default_machine_name = function ($vars) { + return Utils::human2machine($vars['plugin_name']); + }; + $questions['plugin_machine_name'] = new Question('Plugin machine name', $default_machine_name); + $questions['plugin_machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $questions['description'] = new Question('Plugin description', 'Plugin description.'); + $questions['category'] = new Question('Category', 'Custom'); + + $questions['context'] = new ChoiceQuestion( + 'Required context', + ['-', 'Node', 'User', 'Term'] + ); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path($this->subDirectory . '/{plugin_machine_name}.inc') + ->template($this->template); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/ContentType.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/ContentType.php new file mode 100644 index 0000000000000000000000000000000000000000..65e31bcedfa01e93140674f028afba119945d96d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/ContentType.php @@ -0,0 +1,15 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7\CToolsPlugin; + +/** + * Implements d7:ctools-plugin:content-type command. + */ +class ContentType extends BasePlugin { + + protected $name = 'd7:ctools-plugin:content-type'; + protected $description = 'Generates CTools content type plugin'; + protected $template = 'd7/ctools-plugin/content-type.twig'; + protected $subDirectory = 'plugins/content_types'; + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Relationship.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Relationship.php new file mode 100644 index 0000000000000000000000000000000000000000..bbb8bfffaffc21b9615539cd2580dfbd409068ac --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Relationship.php @@ -0,0 +1,15 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7\CToolsPlugin; + +/** + * Implements d7:ctools-plugin:relationship command. + */ +class Relationship extends BasePlugin { + + protected $name = 'd7:ctools-plugin:relationship'; + protected $description = 'Generates CTools relationship plugin'; + protected $template = 'd7/ctools-plugin/relationship.twig'; + protected $subDirectory = 'plugins/relationships'; + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Hook.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Hook.php new file mode 100644 index 0000000000000000000000000000000000000000..2739fc32d08c7be8a2fdde23359cbc33bf1bc8e1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Hook.php @@ -0,0 +1,86 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:hook command. + */ +class Hook extends BaseGenerator { + + protected $name = 'd7:hook'; + protected $description = 'Generates a hook'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['hook_name'] = new Question('Hook name'); + $questions['hook_name']->setValidator(function ($value) { + if (!in_array($value, $this->getSupportedHooks())) { + throw new \UnexpectedValueException('The value is not correct class name.'); + } + return $value; + }); + $questions['hook_name']->setAutocompleterValues($this->getSupportedHooks()); + + $vars = $this->collectVars($input, $output, $questions); + + // Most Drupal hooks are situated in a module file but some are not. + $special_hooks = [ + 'install' => [ + 'install', + 'uninstall', + 'enable', + 'disable', + 'schema', + 'schema_alter', + 'field_schema', + 'requirements', + 'update_N', + 'update_last_removed', + ], + // See system_hook_info(). + 'tokens.inc' => [ + 'token_info', + 'token_info_alter', + 'tokens', + 'tokens_alter', + ], + ]; + + $file_type = 'module'; + foreach ($special_hooks as $group => $hooks) { + if (in_array($vars['hook_name'], $hooks)) { + $file_type = $group; + break; + } + } + + $this->addFile() + ->path("{machine_name}.$file_type") + ->headerTemplate("d7/file-docs/$file_type.twig") + ->template('d7/hook/' . $vars['hook_name'] . '.twig') + ->action('append') + ->headerSize(7); + } + + /** + * Gets list of supported hooks. + * + * @return array + * List of supported hooks. + */ + protected function getSupportedHooks() { + return array_map(function ($file) { + return pathinfo($file, PATHINFO_FILENAME); + }, array_diff(scandir($this->templatePath . '/d7/hook'), ['.', '..'])); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/InstallFile.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/InstallFile.php new file mode 100644 index 0000000000000000000000000000000000000000..74e85da69a4ece1a9d524f24fdcf5fc08133909d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/InstallFile.php @@ -0,0 +1,28 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d7:install-file command. + */ +class InstallFile extends BaseGenerator { + + protected $name = 'd7:install-file'; + protected $description = 'Generates Drupal 7 install file'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $this->collectVars($input, $output, Utils::defaultQuestions()); + $this->addFile() + ->path('{machine_name}.install') + ->template('d7/install.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Javascript.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Javascript.php new file mode 100644 index 0000000000000000000000000000000000000000..b79c395c4711d69eb28211ec0b24d94bd5b881be --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Javascript.php @@ -0,0 +1,28 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d7:javascript command. + */ +class Javascript extends BaseGenerator { + + protected $name = 'd7:javascript'; + protected $description = 'Generates Drupal 7 JavaScript file'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $vars = $this->collectVars($input, $output, Utils::defaultQuestions()); + $this->addFile() + ->path(str_replace('_', '-', $vars['machine_name']) . '.js') + ->template('d7/javascript.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Module.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Module.php new file mode 100644 index 0000000000000000000000000000000000000000..a333616e07edc61d49a2b5279a0a100107ff2c05 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Module.php @@ -0,0 +1,55 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:module command. + */ +class Module extends BaseGenerator { + + protected $name = 'd7:module'; + protected $description = 'Generates Drupal 7 module'; + protected $destination = 'modules'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['description'] = new Question('Module description', 'Module description.'); + $questions['package'] = new Question('Package', 'Custom'); + + $vars = $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}/{machine_name}.info') + ->template('d7/module-info.twig'); + + $this->addFile() + ->path('{machine_name}/{machine_name}.module') + ->template('d7/module.twig'); + + $this->addFile() + ->path('{machine_name}/{machine_name}.install') + ->template('d7/install.twig'); + + $this->addFile() + ->path('{machine_name}/{machine_name}.admin.inc') + ->template('d7/admin.inc.twig'); + + $this->addFile() + ->path('{machine_name}/{machine_name}.pages.inc') + ->template('d7/pages.inc.twig'); + + $this->addFile() + ->path('{machine_name}/' . str_replace('_', '-', $vars['machine_name']) . '.js') + ->template('d7/javascript.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleFile.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleFile.php new file mode 100644 index 0000000000000000000000000000000000000000..0cc24d56de7b4f873914c12379f44560d7acfd94 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleFile.php @@ -0,0 +1,28 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d7:module-file command. + */ +class ModuleFile extends BaseGenerator { + + protected $name = 'd7:module-file'; + protected $description = 'Generates Drupal 7 module file'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $this->collectVars($input, $output, Utils::defaultQuestions()); + $this->addFile() + ->path('{machine_name}.module') + ->template('d7/module.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleInfo.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleInfo.php new file mode 100644 index 0000000000000000000000000000000000000000..f792c8364df898dee9a5bad42003c0934e64d94b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleInfo.php @@ -0,0 +1,33 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:module-info command. + */ +class ModuleInfo extends BaseGenerator { + + protected $name = 'd7:module-info'; + protected $description = 'Generates Drupal 7 info file for a module'; + protected $label = 'Info (module)'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['description'] = new Question('Module description', 'Module description.'); + $questions['package'] = new Question('Package', 'Custom'); + $this->collectVars($input, $output, $questions); + $this->addFile() + ->path('{machine_name}.info') + ->template('d7/module-info.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Settings.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Settings.php new file mode 100644 index 0000000000000000000000000000000000000000..f88eef362c01274b105d6e8effefc0ec5a122979 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Settings.php @@ -0,0 +1,39 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:settings.php command. + */ +class Settings extends BaseGenerator { + + protected $name = 'd7:settings.php'; + protected $description = 'Generates Drupal 7 settings.php file'; + protected $destination = 'sites/default'; + protected $label = 'settings.php'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['db_driver'] = new Question('Database driver', 'mysql'); + $questions['db_driver']->setAutocompleterValues(['mysql', 'pgsql', 'sqlite']); + $questions['db_name'] = new Question('Database name', 'drupal'); + $questions['db_user'] = new Question('Database user', 'root'); + $questions['db_password'] = new Question('Database password', '123'); + + $vars = &$this->collectVars($input, $output, $questions); + // @see: drupal_get_hash_salt() + $vars['hash_salt'] = hash('sha256', serialize($vars)); + + $this->addFile() + ->path('settings.php') + ->template('d7/settings.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/TemplatePhp.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/TemplatePhp.php new file mode 100644 index 0000000000000000000000000000000000000000..653fd3fda62dc69188f1b51903cd566c1a89c371 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/TemplatePhp.php @@ -0,0 +1,37 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:template.php command. + */ +class TemplatePhp extends BaseGenerator { + + protected $name = 'd7:template.php'; + protected $description = 'Generates Drupal 7 template.php file'; + protected $alias = 'template.php'; + protected $label = 'template.php'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['name'] = new Question('Theme name'); + $questions['name']->setValidator([Utils::class, 'validateRequired']); + $questions['machine_name'] = new Question('Theme machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('template.php') + ->template('d7/template.php.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Test.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Test.php new file mode 100644 index 0000000000000000000000000000000000000000..c32fef73ec0801a1f6f43ae680020a4fc8a2343f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Test.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:test command. + */ +class Test extends BaseGenerator { + + protected $name = 'd7:test'; + protected $description = 'Generates Drupal 7 test case'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']) . 'TestCase'; + }; + $questions['class'] = new Question('Class', $default_class); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.test') + ->template('d7/test.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Theme.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Theme.php new file mode 100644 index 0000000000000000000000000000000000000000..2da0901672f0bbe0aab74bac28e889031bc9eb84 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Theme.php @@ -0,0 +1,57 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:theme command. + */ +class Theme extends BaseGenerator { + + protected $name = 'd7:theme'; + protected $description = 'Generates Drupal 7 theme'; + protected $destination = 'themes'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['name'] = new Question('Theme name'); + $questions['name']->setValidator([Utils::class, 'validateRequired']); + $questions['machine_name'] = new Question('Theme machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + $questions['description'] = new Question('Theme description', 'A simple Drupal 7 theme.'); + $questions['base_theme'] = new Question('Base theme'); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['asset_name'] = str_replace('_', '-', $vars['machine_name']); + + $this->addFile() + ->path('{machine_name}/{machine_name}.info') + ->template('d7/theme-info.twig'); + + $this->addFile() + ->path('{machine_name}/template.php') + ->template('d7/template.php.twig'); + + $this->addFile() + ->path('{machine_name}/js/{asset_name}.js') + ->template('d7/javascript.twig'); + + $this->addFile() + ->path('{machine_name}/css/{asset_name}.css') + ->template('d7/theme-css.twig'); + + $this->addDirectory() + ->path('{machine_name}/templates'); + + $this->addDirectory() + ->path('{machine_name}/images'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ThemeInfo.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ThemeInfo.php new file mode 100644 index 0000000000000000000000000000000000000000..164530d026a761548307731cb82254d52be05858 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ThemeInfo.php @@ -0,0 +1,38 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:theme-info command. + */ +class ThemeInfo extends BaseGenerator { + + protected $name = 'd7:theme-info'; + protected $description = 'Generates info file for a Drupal 7 theme'; + protected $label = 'Info (theme)'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['name'] = new Question('Theme name'); + $questions['name']->setValidator([Utils::class, 'validateRequired']); + $questions['machine_name'] = new Question('Theme machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + $questions['description'] = new Question('Theme description', 'A simple Drupal 7 theme.'); + $questions['base_theme'] = new Question('Base theme'); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.info') + ->template('d7/theme-info.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ViewsPlugin/ArgumentDefault.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ViewsPlugin/ArgumentDefault.php new file mode 100644 index 0000000000000000000000000000000000000000..00048f62d9553440b0e2a81ff73a0700503a8b20 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ViewsPlugin/ArgumentDefault.php @@ -0,0 +1,49 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_7\ViewsPlugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d7:views-plugin:argument-default command. + */ +class ArgumentDefault extends BaseGenerator { + + protected $name = 'd7:views-plugin:argument-default'; + protected $description = 'Generates Drupal 7 argument default views plugin'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['plugin_name'] = new Question('Plugin name', 'Example'); + $default_machine_name = function ($vars) { + return Utils::human2machine($vars['plugin_name']); + }; + $questions['plugin_machine_name'] = new Question('Plugin machine name', $default_machine_name); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.module') + ->template('d7/views-plugin/argument-default.module.twig') + ->action('append') + ->headerSize(7); + + $this->addFile() + ->path('views/{machine_name}.views.inc') + ->template('d7/views-plugin/argument-default-views.inc.twig') + ->action('append') + ->headerSize(7); + + $this->addFile() + ->path('views/views_plugin_argument_{plugin_machine_name}.inc') + ->template('d7/views-plugin/argument-default.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Composer.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Composer.php new file mode 100644 index 0000000000000000000000000000000000000000..128aedd5f9f11c9e81df36b36540d606b7a2b1d6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Composer.php @@ -0,0 +1,47 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:composer command. + */ +class Composer extends BaseGenerator { + + protected $name = 'd8:composer'; + protected $description = 'Generates a composer.json file'; + protected $alias = 'composer.json'; + protected $label = 'composer.json'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Project machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + $questions['description'] = new Question('Description'); + $questions['type'] = new Question('Type', 'drupal-module'); + $questions['type']->setValidator([Utils::class, 'validateRequired']); + $questions['type']->setAutocompleterValues([ + 'drupal-module', + 'drupal-theme', + 'drupal-library', + 'drupal-profile', + 'drupal-drush', + ]); + $questions['drupal_org'] = new ConfirmationQuestion('Is this project hosted on drupal.org?', FALSE); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('composer.json') + ->template('d8/composer.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Controller.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Controller.php new file mode 100644 index 0000000000000000000000000000000000000000..cd32616153970c9e7c9459469d930f6dfdcc81da --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Controller.php @@ -0,0 +1,58 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:controller command. + */ +class Controller extends BaseGenerator { + + protected $name = 'd8:controller'; + protected $description = 'Generates a controller'; + protected $alias = 'controller'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']) . 'Controller'; + }; + $questions['class'] = new Question('Class', $default_class); + + $vars = $this->collectVars($input, $output, $questions); + + $di_question = new ConfirmationQuestion('Would you like to inject dependencies?', FALSE); + if ($this->ask($input, $output, $di_question)) { + $this->collectServices($input, $output); + } + + $route_question = new ConfirmationQuestion('Would you like to create a route for this controller?'); + if ($this->ask($input, $output, $route_question)) { + $route_path = '/' . str_replace('_', '-', $vars['machine_name']) . '/example'; + $route_questions['route_name'] = new Question('Route name', '{machine_name}.example'); + $route_questions['route_path'] = new Question('Route path', $route_path); + $route_questions['route_title'] = new Question('Route title', 'Example'); + $route_questions['route_permission'] = new Question('Route permission', 'access content'); + $this->collectVars($input, $output, $route_questions, $vars); + $this->addFile() + ->path('{machine_name}.routing.yml') + ->template('d8/controller-route.twig') + ->action('append'); + } + + $this->addFile() + ->path('src/Controller/{class}.php') + ->template('d8/controller.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Field.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Field.php new file mode 100644 index 0000000000000000000000000000000000000000..2c732a96a5d9e535b7f0efb80351406706d2fbf0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Field.php @@ -0,0 +1,320 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:field command. + */ +class Field extends BaseGenerator { + + protected $name = 'd8:field'; + protected $description = 'Generates a field'; + protected $alias = 'field'; + + /** + * Field sub-types. + * + * @var array + */ + protected $subTypes = [ + 'boolean' => [ + 'label' => 'Boolean', + 'list' => FALSE, + 'random' => FALSE, + 'inline' => FALSE, + 'link' => FALSE, + 'data_type' => 'boolean', + ], + 'string' => [ + 'label' => 'Text', + 'list' => TRUE, + 'random' => TRUE, + 'inline' => TRUE, + 'link' => FALSE, + 'data_type' => 'string', + ], + 'text' => [ + 'label' => 'Text (long)', + 'list' => FALSE, + 'random' => TRUE, + 'inline' => FALSE, + 'link' => FALSE, + 'data_type' => 'string', + ], + 'integer' => [ + 'label' => 'Integer', + 'list' => TRUE, + 'random' => FALSE, + 'inline' => TRUE, + 'link' => FALSE, + 'data_type' => 'integer', + ], + 'float' => [ + 'label' => 'Float', + 'list' => TRUE, + 'random' => FALSE, + 'inline' => TRUE, + 'link' => FALSE, + 'data_type' => 'float', + ], + 'numeric' => [ + 'label' => 'Numeric', + 'list' => TRUE, + 'random' => FALSE, + 'inline' => TRUE, + 'link' => FALSE, + 'data_type' => 'float', + ], + 'email' => [ + 'label' => 'Email', + 'list' => TRUE, + 'random' => TRUE, + 'inline' => TRUE, + 'link' => TRUE, + 'data_type' => 'email', + ], + 'telephone' => [ + 'label' => 'Telephone', + 'list' => TRUE, + 'random' => FALSE, + 'inline' => TRUE, + 'link' => TRUE, + 'data_type' => 'string', + ], + 'uri' => [ + 'label' => 'Url', + 'list' => TRUE, + 'random' => TRUE, + 'inline' => TRUE, + 'link' => TRUE, + 'data_type' => 'uri', + ], + 'datetime' => [ + 'label' => 'Date', + 'list' => TRUE, + 'random' => FALSE, + 'inline' => FALSE, + 'link' => FALSE, + 'data_type' => 'datetime_iso8601', + ], + ]; + + /** + * Date types. + * + * @var array + */ + protected $dateTypes = [ + 'date' => 'Date only', + 'datetime' => 'Date and time', + ]; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions = Utils::defaultQuestions(); + + $questions['field_label'] = new Question('Field label', 'Example'); + $questions['field_label']->setValidator([Utils::class, 'validateRequired']); + + $default_field_id = function (array $vars) { + return $vars['machine_name'] . '_' . Utils::human2machine($vars['field_label']); + }; + $questions['field_id'] = new Question('Field ID', $default_field_id); + $questions['field_id']->setValidator([Utils::class, 'validateMachineName']); + + $questions['subfield_count'] = new Question('How many sub-fields would you like to create?', 3); + + $subfield_count_validator = function ($value) { + if (!is_numeric($value) || intval($value) != $value || $value <= 0) { + throw new \UnexpectedValueException('The value should be greater than zero.'); + } + return $value; + }; + $questions['subfield_count']->setValidator($subfield_count_validator); + + $vars = &$this->collectVars($input, $output, $questions); + + $type_choices = array_column($this->subTypes, 'label'); + $type_choices = Utils::prepareChoices($type_choices); + + // Indicates that at least one of sub-fields needs Random component. + $vars['random'] = FALSE; + + // Indicates that all sub-fields can be rendered inline. + $vars['inline'] = TRUE; + + // Indicates that at least one of sub-files has limited allowed values. + $vars['list'] = FALSE; + + // Indicates that at least one of sub-fields is required. + $vars['required'] = FALSE; + + // Indicates that at least one of sub-fields is of email type. + $vars['email'] = FALSE; + + // Indicates that at least one of sub-fields can be rendered as a link. + $vars['link'] = FALSE; + + // Indicates that at least one of sub-fields is of datetime type. + $vars['datetime'] = FALSE; + + for ($i = 1; $i <= $vars['subfield_count']; $i++) { + if (!$input->getOption('answers')) { + $output->writeln('<fg=green>–––––––––––––––––––––––––––––––––––––––––––––––––––</>'); + } + $subfield_questions = []; + $subfield_questions['name_' . $i] = new Question("Label for sub-field #$i", "Value $i"); + $default_machine_name = function (array $vars) use ($i) { + return Utils::human2machine($vars['name_' . $i]); + }; + $subfield_questions['machine_name_' . $i] = new Question("Machine name for sub-field #$i", $default_machine_name); + $subfield_questions['type_' . $i] = new ChoiceQuestion("Type of sub-field #$i", $type_choices, 'Text'); + $this->collectVars($input, $output, $subfield_questions); + + $vars['type_class'] = Utils::camelize($vars['field_label']) . 'Item'; + $vars['widget_class'] = Utils::camelize($vars['field_label']) . 'Widget'; + $vars['formatter_class'] = Utils::camelize($vars['field_label']) . 'DefaultFormatter'; + + // Reset previous questions since we already collected their answers. + $subfield_questions = []; + + // Determine the type ID by its label. + foreach ($this->subTypes as $type => $definition) { + if ($vars['type_' . $i] == $definition['label']) { + break; + } + } + + if ($type == 'datetime') { + $subfield_questions['date_type_' . $i] = new ChoiceQuestion( + "Date type for sub-field #$i", + Utils::prepareChoices($this->dateTypes), + 'Date only' + ); + } + + if ($definition['list']) { + $subfield_questions['list_' . $i] = new ConfirmationQuestion("Limit allowed values for sub-field #$i?", FALSE); + } + $subfield_questions['required_' . $i] = new ConfirmationQuestion("Make sub-field #$i required?", FALSE); + $this->collectVars($input, $output, $subfield_questions); + + $machine_name = $vars['machine_name_' . $i]; + + // Group sub-field vars. + $vars['subfields'][$i] = [ + 'name' => $vars['name_' . $i], + 'machine_name' => $machine_name, + 'type' => $type, + 'data_type' => $definition['data_type'], + 'list' => !empty($vars['list_' . $i]), + 'allowed_values_method' => 'allowed' . Utils::camelize($vars['name_' . $i], TRUE) . 'Values', + 'required' => $vars['required_' . $i], + 'link' => $definition['link'], + ]; + if (isset($vars['date_type_' . $i])) { + $date_type = array_search($vars['date_type_' . $i], $this->dateTypes); + $vars['subfields'][$i]['date_type'] = $date_type; + // Back to date type ID. + $vars['subfields'][$i]['date_storage_format'] = $date_type == 'date' ? 'Y-m-d' : 'Y-m-d\TH:i:s'; + } + unset($vars['name_' . $i], $vars['machine_name_' . $i], $vars['type_' . $i], $vars['list_' . $i], $vars['required_' . $i], $vars['date_type_' . $i]); + + if ($definition['random']) { + $vars['random'] = TRUE; + } + + if (!$definition['inline']) { + $vars['inline'] = FALSE; + } + + if ($vars['subfields'][$i]['list']) { + $vars['list'] = TRUE; + } + + if ($vars['subfields'][$i]['required']) { + $vars['required'] = TRUE; + } + + if ($type == 'email') { + $vars['email'] = TRUE; + } + + if ($definition['link']) { + $vars['link'] = TRUE; + } + + if ($type == 'datetime') { + $vars['datetime'] = TRUE; + } + + } + + if (!$input->getOption('answers')) { + $output->writeln('<fg=green>–––––––––––––––––––––––––––––––––––––––––––––––––––</>'); + } + + $questions = []; + $questions['storage_settings'] = new ConfirmationQuestion('Would you like to create field storage settings form?', FALSE); + $questions['instance_settings'] = new ConfirmationQuestion('Would you like to create field instance settings form?', FALSE); + $questions['widget_settings'] = new ConfirmationQuestion('Would you like to create field widget settings form?', FALSE); + $questions['formatter_settings'] = new ConfirmationQuestion('Would you like to create field formatter settings form?', FALSE); + $questions['table_formatter'] = new ConfirmationQuestion('Would you like to create table formatter?', FALSE); + $questions['key_value_formatter'] = new ConfirmationQuestion('Would you like to create key-value formatter?', FALSE); + + $vars += $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/Field/FieldType/{type_class}.php') + ->template('d8/_field/type.twig'); + + $this->addFile() + ->path('src/Plugin/Field/FieldWidget/{widget_class}.php') + ->template('d8/_field/widget.twig'); + + $this->addFile() + ->path('src/Plugin/Field/FieldFormatter/{formatter_class}.php') + ->template('d8/_field/default-formatter.twig'); + + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/_field/schema.twig') + ->action('append'); + + $this->addFile() + ->path('{machine_name}.libraries.yml') + ->template('d8/_field/libraries.twig') + ->action('append'); + + $this->addFile() + ->path('css/' . str_replace('_', '-', $vars['field_id']) . '-widget.css') + ->template('d8/_field/widget-css.twig'); + + if ($vars['table_formatter']) { + $vars['table_formatter_class'] = Utils::camelize($vars['field_label']) . 'TableFormatter'; + $this->addFile() + ->path('src/Plugin/Field/FieldFormatter/{table_formatter_class}.php') + ->template('d8/_field/table-formatter.twig'); + } + + if ($vars['key_value_formatter']) { + $vars['key_value_formatter_class'] = Utils::camelize($vars['field_label']) . 'KeyValueFormatter'; + $this->addFile() + ->path('src/Plugin/Field/FieldFormatter/{key_value_formatter_class}.php') + ->template('d8/_field/key-value-formatter.twig'); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Config.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..266f1f7786b47f98ffaed171619ac8ea9b8de836 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Config.php @@ -0,0 +1,65 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Form; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:form:config command. + */ +class Config extends BaseGenerator { + + use RouteInteractionTrait; + + protected $name = 'd8:form:config'; + protected $description = 'Generates a configuration form'; + protected $alias = 'config-form'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions = Utils::moduleQuestions(); + $questions['class'] = new Question('Class', 'SettingsForm'); + + $this->collectVars($input, $output, $questions); + + $this->defaultPathPrefix = '/admin/config/system'; + $this->defaultPermission = 'administer site configuration'; + $this->routeInteraction($input, $output); + + $vars = &$this->vars; + + if ($vars['route']) { + $link_question = new ConfirmationQuestion('Would you like to create a menu link for this route?', TRUE); + $vars['link'] = $this->ask($input, $output, $link_question); + if ($vars['link']) { + + $link_questions['link_title'] = new Question('Link title', $vars['route_title']); + $link_questions['link_description'] = new Question('Link description'); + // Try to guess parent menu item using route path. + if (preg_match('#^/admin/config/([^/]+)/[^/]+$#', $vars['route_path'], $matches)) { + $link_questions['link_parent'] = new Question('Parent menu item', 'system.admin_config_' . $matches[1]); + } + + $this->collectVars($input, $output, $link_questions); + $this->addFile() + ->path('{machine_name}.links.menu.yml') + ->template('d8/form/links.menu.twig') + ->action('append'); + } + } + + $this->addFile() + ->path('src/Form/{class}.php') + ->template('d8/form/config.twig'); + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Confirm.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Confirm.php new file mode 100644 index 0000000000000000000000000000000000000000..03d59da038d6c9f3c94c7360db4a0ac8612f55a9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Confirm.php @@ -0,0 +1,39 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Form; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:form:confirm command. + */ +class Confirm extends BaseGenerator { + + use RouteInteractionTrait; + + protected $name = 'd8:form:confirm'; + protected $description = 'Generates a confirmation form'; + protected $alias = 'confirm-form'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions = Utils::moduleQuestions(); + $questions['class'] = new Question('Class', 'ExampleConfirmForm'); + $this->collectVars($input, $output, $questions); + + $this->defaultPermission = 'administer site configuration'; + $this->routeInteraction($input, $output); + + $this->addFile() + ->path('src/Form/{class}.php') + ->template('d8/form/confirm.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/RouteInteractionTrait.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/RouteInteractionTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..0b15164dd080dc47a61c16f3e7693ad562008e53 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/RouteInteractionTrait.php @@ -0,0 +1,61 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Form; + +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Trait RouteTrait. + */ +trait RouteInteractionTrait { + + /** + * Default path prefix. + * + * @var string + */ + protected $defaultPathPrefix; + + /** + * Default permission. + * + * @var string + */ + protected $defaultPermission; + + /** + * Interacts with the user and builds route variables. + */ + protected function routeInteraction(InputInterface $input, OutputInterface $output) { + + $vars = &$this->vars; + + $route_question = new ConfirmationQuestion('Would you like to create a route for this form?'); + $vars['route'] = $this->ask($input, $output, $route_question); + + $raw_form_id = preg_replace('/_form/', '', Utils::camel2machine($vars['class'])); + $vars['form_id'] = $vars['machine_name'] . '_' . $raw_form_id; + + if ($vars['route']) { + $this->defaultPathPrefix = $this->defaultPathPrefix ?: '/' . $vars['machine_name']; + $default_route_path = str_replace('_', '-', $this->defaultPathPrefix . '/' . $raw_form_id); + $route_questions['route_name'] = new Question('Route name', '{machine_name}.' . $raw_form_id); + $route_questions['route_path'] = new Question('Route path', $default_route_path); + $route_questions['route_title'] = new Question('Route title', Utils::machine2human($raw_form_id)); + $route_questions['route_permission'] = new Question('Route permission', $this->defaultPermission); + + $this->collectVars($input, $output, $route_questions, $vars); + + $this->addFile() + ->path('{machine_name}.routing.yml') + ->template('d8/form/routing.twig') + ->action('append'); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Simple.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Simple.php new file mode 100644 index 0000000000000000000000000000000000000000..c01f140adc872f1d72ac3ceaf22226f19b1d8832 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Simple.php @@ -0,0 +1,39 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Form; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:form:simple command. + */ +class Simple extends BaseGenerator { + + use RouteInteractionTrait; + + protected $name = 'd8:form:simple'; + protected $description = 'Generates simple form'; + protected $alias = 'form-simple'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions = Utils::moduleQuestions(); + $questions['class'] = new Question('Class', 'ExampleForm'); + $this->collectVars($input, $output, $questions); + + $this->defaultPermission = 'access content'; + $this->routeInteraction($input, $output); + + $this->addFile() + ->path('src/Form/{class}.php') + ->template('d8/form/simple.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Hook.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Hook.php new file mode 100644 index 0000000000000000000000000000000000000000..64dc1a66729965a8772b8a6d95f4f6cb58b37c59 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Hook.php @@ -0,0 +1,124 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:hook command. + */ +class Hook extends BaseGenerator { + + protected $name = 'd8:hook'; + protected $description = 'Generates a hook'; + protected $alias = 'hook'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['hook_name'] = new Question('Hook name'); + $questions['hook_name']->setValidator(function ($value) { + if (!in_array($value, $this->supportedHooks())) { + throw new \UnexpectedValueException('The value is not correct class name.'); + } + return $value; + }); + $questions['hook_name']->setAutocompleterValues($this->supportedHooks()); + + $vars = $this->collectVars($input, $output, $questions); + + // Most Drupal hooks are situated in a module file but some are not. + $special_hooks = [ + 'install' => [ + 'install', + 'uninstall', + 'schema', + 'requirements', + 'update_N', + 'update_last_removed', + ], + // See views_hook_info(). + 'views.inc' => [ + 'views_data', + 'views_data_alter', + 'views_analyze', + 'views_invalidate_cache', + 'field_views_data', + 'field_views_data_alter', + // See \Drupal\views\views::$plugins. + 'views_plugins_access_alter', + 'views_plugins_area_alter', + 'views_plugins_argument_alter', + 'views_plugins_argument_default_alter', + 'views_plugins_argument_validator_alter', + 'views_plugins_cache_alter', + 'views_plugins_display_extender_alter', + 'views_plugins_display_alter', + 'views_plugins_exposed_form_alter', + 'views_plugins_field_alter', + 'views_plugins_filter_alter', + 'views_plugins_join_alter', + 'views_plugins_pager_alter', + 'views_plugins_query_alter', + 'views_plugins_relationship_alter', + 'views_plugins_row_alter', + 'views_plugins_sort_alter', + 'views_plugins_style_alter', + 'views_plugins_wizard_alter', + ], + 'views_execution.inc' => [ + 'views_query_substitutions', + 'views_form_substitutions', + 'views_pre_view', + 'views_pre_build', + 'views_post_build', + 'views_pre_execute', + 'views_post_execute', + 'views_pre_render', + 'views_post_render', + 'views_query_alter', + ], + // See system_hook_info(). + 'tokens.inc' => [ + 'token_info', + 'token_info_alter', + 'tokens', + 'tokens_alter', + ], + 'post_update.php' => [ + 'post_update_N', + ], + ]; + + $file_type = 'module'; + foreach ($special_hooks as $group => $hooks) { + if (in_array($vars['hook_name'], $hooks)) { + $file_type = $group; + break; + } + } + + $this->addFile() + ->path('{machine_name}.' . $file_type) + ->headerTemplate("d8/file-docs/$file_type.twig") + ->template('d8/hook/' . $vars['hook_name'] . '.twig') + ->action('append') + ->headerSize(7); + } + + /** + * Returns list of supported hooks. + */ + protected function supportedHooks() { + return array_map(function ($file) { + return pathinfo($file, PATHINFO_FILENAME); + }, array_diff(scandir($this->templatePath . '/d8/hook'), ['.', '..'])); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/InstallFile.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/InstallFile.php new file mode 100644 index 0000000000000000000000000000000000000000..273cfd901fc85bf99798b4428b27caa8afd44111 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/InstallFile.php @@ -0,0 +1,29 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:install-file command. + */ +class InstallFile extends BaseGenerator { + + protected $name = 'd8:install-file'; + protected $description = 'Generates an install file'; + protected $alias = 'install-file'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $this->collectVars($input, $output, Utils::defaultQuestions()); + $this->addFile() + ->path('{machine_name}.install') + ->template('d8/install.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Javascript.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Javascript.php new file mode 100644 index 0000000000000000000000000000000000000000..f19317c3d9bbfa9544a7ebb0188d031896148439 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Javascript.php @@ -0,0 +1,29 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:javascript command. + */ +class Javascript extends BaseGenerator { + + protected $name = 'd8:javascript'; + protected $description = 'Generates Drupal 8 JavaScript file'; + protected $alias = 'javascript'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $vars = $this->collectVars($input, $output, Utils::defaultQuestions()); + $this->addFile() + ->path('js/' . str_replace('_', '-', $vars['machine_name']) . '.js') + ->template('d8/javascript.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Layout.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Layout.php new file mode 100644 index 0000000000000000000000000000000000000000..6b2744ba26267732fc662f8d806bc4032cfdec31 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Layout.php @@ -0,0 +1,70 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:layout command. + */ +class Layout extends BaseGenerator { + + protected $name = 'd8:layout'; + protected $description = 'Generates a layout'; + protected $alias = 'layout'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions['machine_name'] = new Question('Extension machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $questions['layout_name'] = new Question('Layout name', 'Example'); + $questions['layout_machine_name'] = new Question('Layout machine name', function ($vars) { + return Utils::human2machine($vars['layout_name']); + }); + $questions['category'] = new Question('Category', 'My layouts'); + + $questions['js'] = new ConfirmationQuestion('Would you like to create JavaScript file for this layout?', FALSE); + $questions['css'] = new ConfirmationQuestion('Would you like to create CSS file for this layout?', FALSE); + + $vars = &$this->collectVars($input, $output, $questions); + $this->addFile() + ->path('{machine_name}.layouts.yml') + ->template('d8/_layout/layouts.twig') + ->action('append'); + + if ($vars['js'] || $vars['css']) { + $this->addFile() + ->path('{machine_name}.libraries.yml') + ->template('d8/_layout/libraries.twig') + ->action('append'); + } + + $vars['layout_asset_name'] = str_replace('_', '-', $vars['layout_machine_name']); + + $this->addFile() + ->path('layouts/{layout_machine_name}/{layout_asset_name}.html.twig') + ->template('d8/_layout/template.twig'); + + if ($vars['js']) { + $this->addFile() + ->path('layouts/{layout_machine_name}/{layout_asset_name}.js') + ->template('d8/_layout/javascript.twig'); + } + if ($vars['css']) { + $this->addFile() + ->path('layouts/{layout_machine_name}/{layout_asset_name}.css') + ->template('d8/_layout/styles.twig'); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ConfigurationEntity.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ConfigurationEntity.php new file mode 100644 index 0000000000000000000000000000000000000000..d8c967fd83435444ef833b93e656fe04ee8da123 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ConfigurationEntity.php @@ -0,0 +1,65 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Module; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:module:configuration-entity command. + */ +class ConfigurationEntity extends BaseGenerator { + + protected $name = 'd8:module:configuration-entity'; + protected $description = 'Generates configuration entity module'; + protected $alias = 'configuration-entity'; + protected $destination = 'modules'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['package'] = new Question('Package', 'Custom'); + $questions['dependencies'] = new Question('Dependencies (comma separated)'); + $questions['entity_type_label'] = new Question('Entity type label', '{name}'); + $questions['entity_type_id'] = new Question( + 'Entity type ID', + function ($vars) { + return Utils::human2machine($vars['entity_type_label']); + } + ); + + $vars = &$this->collectVars($input, $output, $questions); + if ($vars['dependencies']) { + $vars['dependencies'] = array_map('trim', explode(',', strtolower($vars['dependencies']))); + } + $vars['class_prefix'] = Utils::camelize($vars['entity_type_id']); + + $templates = [ + 'model.info.yml.twig', + 'src/ExampleListBuilder.php.twig', + 'src/Form/ExampleForm.php.twig', + 'src/ExampleInterface.php.twig', + 'src/Entity/Example.php.twig', + 'model.routing.yml.twig', + 'model.links.action.yml.twig', + 'model.links.menu.yml.twig', + 'model.permissions.yml.twig', + 'config/schema/model.schema.yml.twig', + ]; + + $templates_path = 'd8/module/configuration-entity/'; + $path_placeholders = ['model', 'Example', '.twig']; + $path_replacements = [$vars['machine_name'], $vars['class_prefix'], '']; + foreach ($templates as $template) { + $this->addFile() + ->path('{machine_name}/' . str_replace($path_placeholders, $path_replacements, $template)) + ->template($templates_path . $template); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ContentEntity.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ContentEntity.php new file mode 100644 index 0000000000000000000000000000000000000000..162c6192bcebcfdc5cad8198b3a8cc277e4c30c7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ContentEntity.php @@ -0,0 +1,151 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Module; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:module:content-entity command. + */ +class ContentEntity extends BaseGenerator { + + protected $name = 'd8:module:content-entity'; + protected $description = 'Generates content entity module'; + protected $alias = 'content-entity'; + protected $destination = 'modules'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + + $questions['package'] = new Question('Package', 'Custom'); + $questions['dependencies'] = new Question('Dependencies (comma separated)'); + $questions['entity_type_label'] = new Question('Entity type label', '{name}'); + + $questions['entity_type_id'] = new Question( + 'Entity type ID', + function ($vars) { + return Utils::human2machine($vars['entity_type_label']); + } + ); + $questions['entity_base_path'] = new Question( + 'Entity base path', + function ($vars) { + return '/admin/content/' . str_replace('_', '-', $vars['entity_type_id']); + } + ); + + $questions['fieldable'] = new ConfirmationQuestion('Make the entity type fieldable?', TRUE); + $questions['revisionable'] = new ConfirmationQuestion('Make the entity type revisionable?', FALSE); + $questions['translatable'] = new ConfirmationQuestion('Make the entity type translatable?', FALSE); + $questions['bundle'] = new ConfirmationQuestion('The entity type has bundle?', FALSE); + $questions['template'] = new ConfirmationQuestion('Create entity template?', TRUE); + $questions['access_controller'] = new ConfirmationQuestion('Create CRUD permissions?', FALSE); + $questions['title_base_field'] = new ConfirmationQuestion('Add "title" base field?', TRUE); + $questions['status_base_field'] = new ConfirmationQuestion('Add "status" base field?', TRUE); + $questions['created_base_field'] = new ConfirmationQuestion('Add "created" base field?', TRUE); + $questions['changed_base_field'] = new ConfirmationQuestion('Add "changed" base field?', TRUE); + $questions['author_base_field'] = new ConfirmationQuestion('Add "author" base field?', TRUE); + $questions['description_base_field'] = new ConfirmationQuestion('Add "description" base field?', TRUE); + $questions['rest_configuration'] = new ConfirmationQuestion('Create REST configuration for the entity?', FALSE); + + $vars = &$this->collectVars($input, $output, $questions); + + if ($vars['dependencies']) { + $vars['dependencies'] = array_map('trim', explode(',', strtolower($vars['dependencies']))); + } + else { + $vars['dependencies'] = []; + } + // 'text_long' field item plugin is provided by Text module. + if ($vars['description_base_field']) { + $vars['dependencies'][] = 'drupal:text'; + } + + if ($vars['entity_base_path'][0] != '/') { + $vars['entity_base_path'] = '/' . $vars['entity_base_path']; + } + + if (($vars['fieldable_no_bundle'] = $vars['fieldable'] && !$vars['bundle'])) { + $vars['configure'] = 'entity.' . $vars['entity_type_id'] . '.settings'; + } + elseif ($vars['bundle']) { + $vars['configure'] = 'entity.' . $vars['entity_type_id'] . '_type.collection'; + } + + $vars['class_prefix'] = Utils::camelize($vars['entity_type_id']); + + $templates = [ + 'model.info.yml.twig', + 'model.links.action.yml.twig', + 'model.links.menu.yml.twig', + 'model.links.task.yml.twig', + 'model.permissions.yml.twig', + 'src/Entity/Example.php.twig', + 'src/ExampleInterface.php.twig', + 'src/ExampleListBuilder.php.twig', + 'src/Form/ExampleForm.php.twig', + ]; + + if ($vars['fieldable_no_bundle']) { + $templates[] = 'model.routing.yml.twig'; + $templates[] = 'src/Form/ExampleSettingsForm.php.twig'; + } + + if ($vars['template']) { + $templates[] = 'templates/model-example.html.twig.twig'; + $templates[] = 'model.module.twig'; + } + else { + $templates[] = 'src/ExampleViewBuilder.php.twig'; + } + + if ($vars['access_controller']) { + $templates[] = 'src/ExampleAccessControlHandler.php.twig'; + } + + if ($vars['rest_configuration']) { + $templates[] = 'config/optional/rest.resource.entity.example.yml.twig'; + } + + if ($vars['bundle']) { + $templates[] = 'config/schema/model.entity_type.schema.yml.twig'; + $templates[] = 'src/ExampleTypeListBuilder.php.twig'; + $templates[] = 'src/Entity/ExampleType.php.twig'; + $templates[] = 'src/Form/ExampleTypeForm.php.twig'; + } + + $templates_path = 'd8/module/content-entity/'; + + $vars['template_name'] = str_replace('_', '-', $vars['entity_type_id']) . '.html.twig'; + + $path_placeholders = [ + 'model-example.html.twig', + 'model', + 'Example', + 'rest.resource.entity.example', + ]; + $path_replacements = [ + $vars['template_name'], + $vars['machine_name'], + $vars['class_prefix'], + 'rest.resource.entity.' . $vars['entity_type_id'], + 'views.view.' . $vars['entity_type_id'], + ]; + + foreach ($templates as $template) { + $path = $vars['machine_name'] . '/' . str_replace($path_placeholders, $path_replacements, $template); + $this->addFile() + ->path(preg_replace('#\.twig$#', '', $path)) + ->template($templates_path . $template); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/Standard.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/Standard.php new file mode 100644 index 0000000000000000000000000000000000000000..aa54df47c6c8f6d7d1f5007b43179a122d30217c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/Standard.php @@ -0,0 +1,160 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Module; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:module:standard command. + */ +class Standard extends BaseGenerator { + + protected $name = 'd8:module:standard'; + protected $description = 'Generates standard Drupal 8 module'; + protected $alias = 'module'; + protected $destination = 'modules'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['description'] = new Question('Module description', 'The description.'); + $questions['package'] = new Question('Package', 'Custom'); + $questions['dependencies'] = new Question('Dependencies (comma separated)'); + + $vars = &$this->collectVars($input, $output, $questions); + + if ($vars['dependencies']) { + $vars['dependencies'] = array_map('trim', explode(',', strtolower($vars['dependencies']))); + } + + $prefix = $vars['machine_name'] . '/' . $vars['machine_name']; + + $this->addFile() + ->path($prefix . '.info.yml') + ->template('d8/yml/module-info.twig'); + + $this->addFile() + ->path($prefix . '.module') + ->template('d8/module.twig'); + + $class_prefix = Utils::camelize($vars['machine_name']); + + // Additional files. + $option_questions['install_file'] = new ConfirmationQuestion('Would you like to create install file?', TRUE); + $option_questions['libraries.yml'] = new ConfirmationQuestion('Would you like to create libraries.yml file?', TRUE); + $option_questions['permissions.yml'] = new ConfirmationQuestion('Would you like to create permissions.yml file?', TRUE); + $option_questions['event_subscriber'] = new ConfirmationQuestion('Would you like to create event subscriber?', TRUE); + $option_questions['block_plugin'] = new ConfirmationQuestion('Would you like to create block plugin?', TRUE); + $option_questions['controller'] = new ConfirmationQuestion('Would you like to create a controller?', TRUE); + $option_questions['settings_form'] = new ConfirmationQuestion('Would you like to create settings form?', TRUE); + + $options = $this->collectVars($input, $output, $option_questions); + + if ($options['install_file']) { + $this->addFile() + ->path($prefix . '.install') + ->template('d8/install.twig'); + } + + if ($options['libraries.yml']) { + $this->addFile() + ->path($prefix . '.libraries.yml') + ->template('d8/yml/module-libraries.twig'); + } + + if ($options['permissions.yml']) { + $this->addFile() + ->path($prefix . '.permissions.yml') + ->template('d8/yml/permissions.twig'); + } + + if ($options['event_subscriber']) { + $subscriber_class = $class_prefix . 'Subscriber'; + + $this->addFile() + ->path("{machine_name}/src/EventSubscriber/$subscriber_class.php") + ->template('d8/service/event-subscriber.twig') + ->vars($vars + ['class' => $subscriber_class]); + + $this->addFile() + ->path($prefix . '.services.yml') + ->template('d8/service/event-subscriber.services.twig') + ->vars($vars + ['class' => $subscriber_class]); + } + + if ($options['block_plugin']) { + $block_vars['plugin_label'] = 'Example'; + $block_vars['plugin_id'] = $vars['machine_name'] . '_' . Utils::human2machine($block_vars['plugin_label']); + $block_vars['category'] = $vars['name']; + $block_vars['class'] = 'ExampleBlock'; + + $this->addFile() + ->path('{machine_name}/src/Plugin/Block/' . $block_vars['class'] . '.php') + ->template('d8/plugin/block.twig') + ->vars($block_vars + $vars); + } + + if ($options['controller']) { + $controller_class = $class_prefix . 'Controller'; + + $controller_vars = [ + 'class' => $controller_class, + 'services' => [], + ]; + + $this->addFile() + ->path("{machine_name}/src/Controller/$controller_class.php") + ->template('d8/controller.twig') + ->vars($controller_vars + $vars); + + $routing_vars = [ + 'route_name' => $vars['machine_name'] . '.example', + 'route_path' => '/' . str_replace('_', '-', $vars['machine_name']) . '/example', + 'route_title' => 'Example', + 'route_permission' => 'access content', + 'class' => $controller_class, + ]; + + $this->addFile() + ->path($prefix . '.routing.yml') + ->template('d8/controller-route.twig') + ->vars($routing_vars + $vars) + ->action('append'); + } + + if ($options['settings_form']) { + $form_class = 'SettingsForm'; + + $form_vars = [ + 'form_id' => $vars['machine_name'] . '_settings', + 'class' => $form_class, + ]; + $this->addFile() + ->path('{machine_name}/src/Form/SettingsForm.php') + ->template('d8/form/config.twig') + ->vars($form_vars + $vars); + + $routing_vars = [ + 'route_name' => $vars['machine_name'] . '.settings_form', + 'route_path' => '/admin/config/system/' . str_replace('_', '-', $vars['machine_name']), + 'route_title' => $vars['name'] . ' settings', + 'route_permission' => 'administer ' . $vars['machine_name'] . ' configuration', + 'class' => $form_class, + ]; + $this->addFile() + ->path($prefix . '.routing.yml') + ->template('d8/form/routing.twig') + ->vars($routing_vars + $vars) + ->action('append'); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ModuleFile.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ModuleFile.php new file mode 100644 index 0000000000000000000000000000000000000000..388f6cfeaeff02b6e2a058b02d4086d3f7dd5d21 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ModuleFile.php @@ -0,0 +1,29 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:module-file command. + */ +class ModuleFile extends BaseGenerator { + + protected $name = 'd8:module-file'; + protected $description = 'Generates a module file'; + protected $alias = 'module-file'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $this->collectVars($input, $output, Utils::defaultQuestions()); + $this->addFile() + ->path('{machine_name}.module') + ->template('d8/module.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Action.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Action.php new file mode 100644 index 0000000000000000000000000000000000000000..803cb5bda28090e835151e2a93eb2763b0c54261 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Action.php @@ -0,0 +1,47 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:action command. + */ +class Action extends BaseGenerator { + + protected $name = 'd8:plugin:action'; + protected $description = 'Generates action plugin'; + protected $alias = 'action'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + + // Plugin label should declare an action. + $questions['plugin_label'] = new Question('Action label', 'Update node title'); + $questions['category'] = new Question('Action category', 'Custom'); + $questions['configurable'] = new ConfirmationQuestion('Make the action configurable?', FALSE); + + $vars = $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/Action/{class}.php') + ->template('d8/plugin/action.twig'); + + if ($vars['configurable']) { + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/action-schema.twig') + ->action('append'); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Block.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Block.php new file mode 100644 index 0000000000000000000000000000000000000000..2ad341b08bdf50d81debdf257dbde116ab7e56d5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Block.php @@ -0,0 +1,55 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:block command. + */ +class Block extends BaseGenerator { + + protected $name = 'd8:plugin:block'; + protected $description = 'Generates block plugin'; + protected $alias = 'block'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions = Utils::moduleQuestions(); + $questions += Utils::pluginQuestions('Block'); + $questions['plugin_label'] = new Question('Block admin label', 'Example'); + $questions['plugin_label']->setValidator([Utils::class, 'validateRequired']); + $questions['category'] = new Question('Block category', 'Custom'); + $questions['configurable'] = new ConfirmationQuestion('Make the block configurable?', FALSE); + + $this->collectVars($input, $output, $questions); + + $di_question = new ConfirmationQuestion('Would you like to inject dependencies?', FALSE); + if ($this->ask($input, $output, $di_question)) { + $this->collectServices($input, $output); + } + + $access_question = new ConfirmationQuestion('Create access callback?', FALSE); + $vars = $this->collectVars($input, $output, ['access' => $access_question]); + + $this->addFile() + ->path('src/Plugin/Block/{class}.php') + ->template('d8/plugin/block.twig'); + + if ($vars['configurable']) { + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/block-schema.twig') + ->action('append'); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/CKEditor.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/CKEditor.php new file mode 100644 index 0000000000000000000000000000000000000000..51d5c0b9072ba7026ecdc861c4a48436b4bd14b0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/CKEditor.php @@ -0,0 +1,52 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:plugin:ckeditor command. + */ +class CKEditor extends BaseGenerator { + + protected $name = 'd8:plugin:ckeditor'; + protected $description = 'Generates CKEditor plugin'; + protected $alias = 'ckeditor'; + protected $label = 'CKEditor'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + + $vars = &$this->collectVars($input, $output, $questions); + + $unprefixed_plugin_id = preg_replace('/^' . $vars['machine_name'] . '_/', '', $vars['plugin_id']); + + // Convert plugin ID to hyphen case. + $vars['short_plugin_id'] = str_replace('_', '-', $unprefixed_plugin_id); + $vars['command_name'] = Utils::camelize($unprefixed_plugin_id, FALSE); + + $this->addFile() + ->path('src/Plugin/CKEditorPlugin/{class}.php') + ->template('d8/plugin/_ckeditor/ckeditor.twig'); + + $this->addFile() + ->path('js/plugins/{short_plugin_id}/plugin.js') + ->template('d8/plugin/_ckeditor/plugin.twig'); + + $this->addFile() + ->path('js/plugins/{short_plugin_id}/dialogs/{short_plugin_id}.js') + ->template('d8/plugin/_ckeditor/dialog.twig'); + + $this->addFile() + ->path('js/plugins/{short_plugin_id}/icons/{short_plugin_id}.png') + ->content(file_get_contents($this->templatePath . '/d8/plugin/_ckeditor/icon.png')) + ->action('replace'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Condition.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Condition.php new file mode 100644 index 0000000000000000000000000000000000000000..2a351442f99f38fa40f127ff87483ba1ff06db82 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Condition.php @@ -0,0 +1,37 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:plugin:condition command. + */ +class Condition extends BaseGenerator { + + protected $name = 'd8:plugin:condition'; + protected $description = 'Generates condition plugin'; + protected $alias = 'condition'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/Condition/{class}.php') + ->template('d8/plugin/condition.twig'); + + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/condition-schema.twig') + ->action('append'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Constraint.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Constraint.php new file mode 100644 index 0000000000000000000000000000000000000000..9728f6017273e9945e4973956a10b1a1345a2fe4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Constraint.php @@ -0,0 +1,67 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:constraint command. + */ +class Constraint extends BaseGenerator { + + protected $name = 'd8:plugin:constraint'; + protected $description = 'Generates constraint plugin'; + protected $alias = 'constraint'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + + $default_plugin_id = function (array $vars) { + // Unlike other plugin types. Constraint IDs use camel case. + return Utils::camelize($vars['machine_name'] . $vars['plugin_label']); + }; + $questions['plugin_id'] = new Question('Constraint ID', $default_plugin_id); + $plugin_id_validator = function ($value) { + if (!preg_match('/^[a-z][a-z0-9_]*[a-z0-9]$/i', $value)) { + throw new \UnexpectedValueException('The value is not correct machine name.'); + } + return $value; + }; + $questions['plugin_id']->setValidator($plugin_id_validator); + + $default_class = function ($vars) { + $unprefixed_plugin_id = preg_replace('/^' . Utils::camelize($vars['machine_name']) . '/', '', $vars['plugin_id']); + return Utils::camelize($unprefixed_plugin_id) . 'Constraint'; + }; + $questions['class'] = new Question('Plugin class', $default_class); + + $input_types = [ + 'entity' => 'Entity', + 'item_list' => 'Item list', + 'item' => 'Item', + 'raw_value' => 'Raw value', + ]; + $type_choices = Utils::prepareChoices($input_types); + $questions['input_type'] = new ChoiceQuestion('Type of data to validate', $type_choices, 'Item list'); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['input_type'] = array_search($vars['input_type'], $input_types); + + $this->addFile() + ->path('src/Plugin/Validation/Constraint/{class}.php') + ->template('d8/plugin/constraint.twig'); + + $this->addFile() + ->path('src/Plugin/Validation/Constraint/{class}Validator.php') + ->template('d8/plugin/constraint-validator.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/EntityReferenceSelection.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/EntityReferenceSelection.php new file mode 100644 index 0000000000000000000000000000000000000000..16011c038306a33502c05b441c91b4f55ad0f0f9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/EntityReferenceSelection.php @@ -0,0 +1,73 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:entity-reference-selection command. + */ +class EntityReferenceSelection extends BaseGenerator { + + protected $name = 'd8:plugin:entity-reference-selection'; + protected $description = 'Generates entity reference selection plugin'; + protected $alias = 'entity-reference-selection'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $base_classes = [ + 'comment' => 'Drupal\comment\Plugin\EntityReferenceSelection\CommentSelection', + 'file' => 'Drupal\file\Plugin\EntityReferenceSelection\FileSelection', + 'node' => 'Drupal\node\Plugin\EntityReferenceSelection\NodeSelection', + 'taxonomy_term' => 'Drupal\taxonomy\Plugin\EntityReferenceSelection\TermSelection', + 'user' => 'Drupal\user\Plugin\EntityReferenceSelection\UserSelection', + ]; + + $questions = Utils::moduleQuestions(); + + $questions['entity_type'] = new Question('Entity type that can be referenced by this plugin', 'node'); + $questions['entity_type']->setValidator([Utils::class, 'validateMachineName']); + $questions['entity_type']->setAutocompleterValues(array_keys($base_classes)); + + $questions['plugin_label'] = new Question('Plugin label', 'Advanced {entity_type} selection'); + $questions['plugin_label']->setValidator([Utils::class, 'validateRequired']); + + $questions['plugin_id'] = new Question('Plugin ID', [Utils::class, 'defaultPluginId']); + $questions['plugin_id']->setValidator([Utils::class, 'validateMachineName']); + + $default_class = function ($vars) { + return Utils::camelize($vars['entity_type']) . 'Selection'; + }; + $questions['class'] = new Question('Plugin class', $default_class); + + $questions['configurable'] = new ConfirmationQuestion('Provide additional plugin configuration?', FALSE); + $vars = &$this->collectVars($input, $output, $questions); + + if (isset($base_classes[$vars['entity_type']])) { + $vars['base_class_full'] = $base_classes[$vars['entity_type']]; + } + else { + $vars['base_class_full'] = 'Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection'; + } + + $vars['base_class'] = explode('EntityReferenceSelection\\', $vars['base_class_full'])[1]; + + $this->addFile() + ->path('src/Plugin/EntityReferenceSelection/{class}.php') + ->template('d8/plugin/entity-reference-selection.twig'); + + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/entity-reference-selection-schema.twig') + ->action('append'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Formatter.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Formatter.php new file mode 100644 index 0000000000000000000000000000000000000000..57c0e39da5c7b90224eb538feb1660e8403d86b8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Formatter.php @@ -0,0 +1,43 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Field; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; + +/** + * Implements d8:plugin:field:formatter command. + */ +class Formatter extends BaseGenerator { + + protected $name = 'd8:plugin:field:formatter'; + protected $description = 'Generates field formatter plugin'; + protected $alias = 'field-formatter'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + $questions += Utils::pluginQuestions('Formatter'); + $questions['configurable'] = new ConfirmationQuestion('Make the formatter configurable?', FALSE); + + $vars = $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/Field/FieldFormatter/{class}.php') + ->template('d8/plugin/field/formatter.twig'); + + if ($vars['configurable']) { + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/field/formatter-schema.twig') + ->action('append'); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Type.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Type.php new file mode 100644 index 0000000000000000000000000000000000000000..17b25ade616d9d297dbd7b6b5518f871dacb80d9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Type.php @@ -0,0 +1,42 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Field; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; + +/** + * Implements d8:plugin:field:type command. + */ +class Type extends BaseGenerator { + + protected $name = 'd8:plugin:field:type'; + protected $description = 'Generates field type plugin'; + protected $alias = 'field-type'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + $questions += Utils::pluginQuestions('Item'); + + $questions['configurable_storage'] = new ConfirmationQuestion('Make the field storage configurable?', FALSE); + $questions['configurable_instance'] = new ConfirmationQuestion('Make the field instance configurable?', FALSE); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/Field/FieldType/{class}.php') + ->template('d8/plugin/field/type.twig'); + + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/field/type-schema.twig') + ->action('append'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Widget.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Widget.php new file mode 100644 index 0000000000000000000000000000000000000000..c4102474fccb67c2755addadbd499bbd216bdfcf --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Widget.php @@ -0,0 +1,43 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Field; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; + +/** + * Implements d8:plugin:field:widget command. + */ +class Widget extends BaseGenerator { + + protected $name = 'd8:plugin:field:widget'; + protected $description = 'Generates field widget plugin'; + protected $alias = 'field-widget'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + $questions += Utils::pluginQuestions('Widget'); + + $questions['configurable'] = new ConfirmationQuestion('Make the widget configurable?', FALSE); + + $vars = $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/Field/FieldWidget/{class}.php') + ->template('d8/plugin/field/widget.twig'); + + if ($vars['configurable']) { + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/field/widget-schema.twig') + ->action('append'); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Filter.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Filter.php new file mode 100644 index 0000000000000000000000000000000000000000..5365050d3b27b823d003f3a9f7ce06798f725878 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Filter.php @@ -0,0 +1,48 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; + +/** + * Implements d8:plugin:filter command. + */ +class Filter extends BaseGenerator { + + protected $name = 'd8:plugin:filter'; + protected $description = 'Generates filter plugin'; + protected $alias = 'filter'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + + $filter_types = [ + 'TYPE_HTML_RESTRICTOR' => 'HTML restrictor', + 'TYPE_MARKUP_LANGUAGE' => 'Markup language', + 'TYPE_TRANSFORM_IRREVERSIBLE' => 'Irreversible transformation', + 'TYPE_TRANSFORM_REVERSIBLE' => 'Reversible transformation', + ]; + $choices = Utils::prepareChoices($filter_types); + $questions['filter_type'] = new ChoiceQuestion('Filter type', $choices); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['filter_type'] = array_search($vars['filter_type'], $filter_types); + + $this->addFile() + ->path('src/Plugin/Filter/{class}.php') + ->template('d8/plugin/filter.twig'); + + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/filter-schema.twig') + ->action('append'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/MenuLink.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/MenuLink.php new file mode 100644 index 0000000000000000000000000000000000000000..42bb250ead889455e59992f0d334a773d41bcab6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/MenuLink.php @@ -0,0 +1,38 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:menu-link command. + */ +class MenuLink extends BaseGenerator { + + protected $name = 'd8:plugin:menu-link'; + protected $description = 'Generates menu-link plugin'; + protected $alias = 'menu-link'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']) . 'MenuLink'; + }; + $questions['class'] = new Question('Class', $default_class); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/Menu/{class}.php') + ->template('d8/plugin/menu-link.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Destination.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Destination.php new file mode 100644 index 0000000000000000000000000000000000000000..566b815572e465598f6b879f8e691ac002393bbd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Destination.php @@ -0,0 +1,37 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Migrate; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:migrate:destination command. + */ +class Destination extends BaseGenerator { + + protected $name = 'd8:plugin:migrate:destination'; + protected $description = 'Generates migrate destination plugin'; + protected $alias = 'migrate-destination'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + + $questions['plugin_id'] = new Question('Plugin ID', '{machine_name}_example'); + $questions['plugin_id']->setValidator([Utils::class, 'validateMachineName']); + $questions['class'] = Utils::pluginClassQuestion(); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/migrate/destination/{class}.php') + ->template('d8/plugin/migrate/destination.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Process.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Process.php new file mode 100644 index 0000000000000000000000000000000000000000..7b0aec9ab7bd3ca772a0e13e7fd28169f02cd40e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Process.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Migrate; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:migrate:process command. + */ +class Process extends BaseGenerator { + + protected $name = 'd8:plugin:migrate:process'; + protected $description = 'Generates migrate process plugin'; + protected $alias = 'migrate-process'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + $questions['plugin_id'] = new Question('Plugin ID', '{machine_name}_example'); + $questions['plugin_id']->setValidator([Utils::class, 'validateMachineName']); + $questions['class'] = Utils::pluginClassQuestion(); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/migrate/process/{class}.php') + ->template('d8/plugin/migrate/process.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Source.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Source.php new file mode 100644 index 0000000000000000000000000000000000000000..830e849f4ea8665fb98972ef9294dc5ea261dff5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Source.php @@ -0,0 +1,47 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Migrate; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:migrate:source command. + */ +class Source extends BaseGenerator { + + protected $name = 'd8:plugin:migrate:source'; + protected $description = 'Generates migrate source plugin'; + protected $alias = 'migrate-source'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + $questions['plugin_id'] = new Question('Plugin ID', '{machine_name}_example'); + $questions['plugin_id']->setValidator([Utils::class, 'validateMachineName']); + $questions['class'] = Utils::pluginClassQuestion(); + + $source_types = [ + 'sql' => 'SQL', + 'other' => 'Other', + ]; + $choices = Utils::prepareChoices($source_types); + $questions['source_type'] = new ChoiceQuestion('Source type', $choices); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['source_type'] = array_search($vars['source_type'], $source_types); + + $vars['base_class'] = $vars['source_type'] == 'sql' ? 'SqlBase' : 'SourcePluginBase'; + + $this->addFile() + ->path('src/Plugin/migrate/source/{class}.php') + ->template('d8/plugin/migrate/source.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/QueueWorker.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/QueueWorker.php new file mode 100644 index 0000000000000000000000000000000000000000..b10c49806ab631088a10bb315cf06b8d5799766c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/QueueWorker.php @@ -0,0 +1,38 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin:queue-worker command. + */ +class QueueWorker extends BaseGenerator { + + protected $name = 'd8:plugin:queue-worker'; + protected $description = 'Generates queue worker plugin'; + protected $alias = 'queue-worker'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']); + }; + $questions['class'] = new Question('Class', $default_class); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/QueueWorker/{class}.php') + ->template('d8/plugin/queue-worker.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/RestResource.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/RestResource.php new file mode 100644 index 0000000000000000000000000000000000000000..0b0fee6d505d51bec7403acc0dad450f2cbbb01e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/RestResource.php @@ -0,0 +1,34 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:plugin:rest-resource command. + */ +class RestResource extends BaseGenerator { + + protected $name = 'd8:plugin:rest-resource'; + protected $description = 'Generates rest resource plugin'; + protected $alias = 'rest-resource'; + protected $label = 'REST resource'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + $questions += Utils::pluginQuestions('Resource'); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/rest/resource/{class}.php') + ->template('d8/plugin/rest-resource.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/ArgumentDefault.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/ArgumentDefault.php new file mode 100644 index 0000000000000000000000000000000000000000..6200ff55c77460cac0c822343277b275cf224544 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/ArgumentDefault.php @@ -0,0 +1,45 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Views; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; + +/** + * Implements d8:plugin:views:argument-default command. + */ +class ArgumentDefault extends BaseGenerator { + + protected $name = 'd8:plugin:views:argument-default'; + protected $description = 'Generates views default argument plugin'; + protected $alias = 'views-argument-default'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + $questions['configurable'] = new ConfirmationQuestion('Make the plugin configurable?', FALSE); + $vars = $this->collectVars($input, $output, $questions); + + $di_question = new ConfirmationQuestion('Would you like to inject dependencies?', FALSE); + if ($this->ask($input, $output, $di_question)) { + $this->collectServices($input, $output); + } + + $this->addFile() + ->path('src/Plugin/views/argument_default/{class}.php') + ->template('d8/plugin/views/argument-default.twig'); + + if ($vars['configurable']) { + $this->addFile() + ->path('config/schema/{machine_name}.views.schema.yml') + ->template('d8/plugin/views/argument-default-schema.twig') + ->action('append'); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Field.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Field.php new file mode 100644 index 0000000000000000000000000000000000000000..2c5763c4ac27911707e4328551cbb48600d5ee08 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Field.php @@ -0,0 +1,46 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Views; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; + +/** + * Implements d8:plugin:views:field command. + */ +class Field extends BaseGenerator { + + protected $name = 'd8:plugin:views:field'; + protected $description = 'Generates views field plugin'; + protected $alias = 'views-field'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + $questions['configurable'] = new ConfirmationQuestion('Make the plugin configurable?', FALSE); + $vars = $this->collectVars($input, $output, $questions); + + $di_question = new ConfirmationQuestion('Would you like to inject dependencies?', FALSE); + if ($this->ask($input, $output, $di_question)) { + $this->collectServices($input, $output); + } + + $this->addFile() + ->path('src/Plugin/views/field/{class}.php') + ->template('d8/plugin/views/field.twig'); + + if ($vars['configurable']) { + $this->addFile() + ->path('config/schema/{machine_name}.views.schema.yml') + ->template('d8/plugin/views/field-schema.twig') + ->action('append'); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Style.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Style.php new file mode 100644 index 0000000000000000000000000000000000000000..5ae8efc5544eb4ee53047259d7ea2a50f7a99a83 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Style.php @@ -0,0 +1,53 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Views; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; + +/** + * Implements d8:plugin:views:style command. + */ +class Style extends BaseGenerator { + + protected $name = 'd8:plugin:views:style'; + protected $description = 'Generates views style plugin'; + protected $alias = 'views-style'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions() + Utils::pluginQuestions(); + $questions['configurable'] = new ConfirmationQuestion('Make the plugin configurable?', TRUE); + + $vars = $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Plugin/views/style/{class}.php') + ->template('d8/plugin/views/style-plugin.twig'); + + $this->addFile() + ->path('templates/views-style-' . str_replace('_', '-', $vars['plugin_id']) . '.html.twig') + ->template('d8/plugin/views/style-template.twig'); + + $this->addFile() + ->path('{machine_name}.module') + ->headerTemplate('d8/file-docs/module.twig') + ->template('d8/plugin/views/style-preprocess.twig') + ->action('append') + ->headerSize(7); + + if ($vars['configurable']) { + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/views/style-schema.twig') + ->action('append'); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/PluginManager.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/PluginManager.php new file mode 100644 index 0000000000000000000000000000000000000000..c80bb0b36525335cb5bc76808affca2e6999e08b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/PluginManager.php @@ -0,0 +1,111 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:plugin-manager command. + */ +class PluginManager extends BaseGenerator { + + protected $name = 'd8:plugin-manager'; + protected $description = 'Generates plugin manager'; + protected $alias = 'plugin-manager'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $default_plugin_type = function ($vars) { + return $vars['machine_name']; + }; + $questions['plugin_type'] = new Question('Plugin type', $default_plugin_type); + + // Utils::validateMachineName does not allow dots. But they can appear in + // plugin types (field.widget, views.argument, etc). + $questions['plugin_type']->setValidator(function ($value) { + if (!preg_match('/^[a-z][a-z0-9_\.]*[a-z0-9]$/', $value)) { + throw new \UnexpectedValueException('The value is not correct machine name.'); + } + return $value; + }); + + $discovery_types = [ + 'annotation' => 'Annotation', + 'yaml' => 'YAML', + 'hook' => 'Hook', + ]; + $choices = Utils::prepareChoices($discovery_types); + $questions['discovery'] = new ChoiceQuestion('Discovery type', $choices, 'Annotation'); + + $vars = &$this->collectVars($input, $output, $questions); + + $vars['class_prefix'] = Utils::camelize($vars['plugin_type']); + $vars['discovery'] = array_search($vars['discovery'], $discovery_types); + + $common_files = [ + 'model.services.yml', + 'src/ExampleInterface.php', + 'src/ExamplePluginManager.php', + ]; + + $files = []; + switch ($vars['discovery']) { + case 'annotation': + $files = [ + 'src/Annotation/Example.php', + 'src/ExamplePluginBase.php', + 'src/Plugin/Example/Foo.php', + ]; + break; + + case 'yaml': + $files = [ + 'model.examples.yml', + 'src/ExampleDefault.php', + ]; + break; + + case 'hook': + $files = [ + 'model.module', + 'src/ExampleDefault.php', + ]; + break; + } + + $files = array_merge($common_files, $files); + + $templates_path = 'd8/plugin-manager/' . $vars['discovery'] . '/'; + + $path_placeholders = ['model', 'Example', 'examples']; + $path_replacements = [ + $vars['machine_name'], + $vars['class_prefix'], + Utils::pluralize($vars['plugin_type']), + ]; + + foreach ($files as $file) { + $asset = $this->addFile() + ->path(str_replace($path_placeholders, $path_replacements, $file)) + ->template($templates_path . $file . '.twig'); + if ($file === 'model.services.yml') { + $asset->action('append')->headerSize(1); + } + elseif ($file == 'model.module') { + $asset + ->action('append') + ->headerTemplate('d8/file-docs/module.twig') + ->headerSize(7); + } + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Project.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Project.php new file mode 100644 index 0000000000000000000000000000000000000000..21c59a7f43fcb11539f5f205c2a6e62003d34574 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Project.php @@ -0,0 +1,389 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:composer command. + * + * Inspired by drupal-composer/drupal-project. + */ +class Project extends BaseGenerator { + + protected $name = 'd8:project'; + protected $description = 'Generates a composer project'; + protected $alias = 'project'; + + const DRUPAL_DEFAULT_VERSION = '~8.7.0'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $name_validator = function ($value) { + if (!preg_match('#[^/]+/[^/]+$#i', $value)) { + throw new \UnexpectedValueException('The value is not correct project name.'); + } + return $value; + }; + $questions['name'] = new Question('Project name (vendor/name)', FALSE); + $questions['name']->setValidator($name_validator); + + $questions['description'] = new Question('Description'); + + $questions['license'] = new Question('License', 'GPL-2.0-or-later'); + // @see https://getcomposer.org/doc/04-schema.md#license + $licenses = [ + 'Apache-2.0', + 'BSD-2-Clause', + 'BSD-3-Clause', + 'BSD-4-Clause', + 'GPL-2.0-only', + 'GPL-2.0-or-later', + 'GPL-3.0-only', + 'GPL-3.0-or-later', + 'LGPL-2.1-onl', + 'LGPL-2.1-or-later', + 'LGPL-3.0-only', + 'LGPL-3.0-or-later', + 'MIT', + 'proprietary', + ]; + $questions['license']->setAutocompleterValues($licenses); + + // Suggest most typical document roots. + $document_roots = [ + 'docroot', + 'web', + 'www', + 'public_html', + 'public', + 'htdocs', + 'httpdocs', + 'html', + ]; + $questions['document_root'] = new Question('Document root directory, type single dot to use Composer root', 'docroot'); + $questions['document_root']->setNormalizer(function ($value) { + return $value == '.' ? '' : $value; + }); + $questions['document_root']->setAutocompleterValues($document_roots); + + $questions['php'] = new Question('PHP version', '>=' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION); + $questions['drupal'] = new Question('Drupal version', self::DRUPAL_DEFAULT_VERSION); + $questions['drupal_core_strict'] = new ConfirmationQuestion('Would you like to get the same versions of Drupal core\'s dependencies as in Drupal core\'s composer.lock file?', FALSE); + + $this->collectVars($input, $output, $questions); + + $sections = ['require', 'require-dev']; + + $questions['drush'] = new ConfirmationQuestion('Would you like to install Drush?', TRUE); + $vars = $this->collectVars($input, $output, $questions); + if ($vars['drush']) { + $questions['drush_installation'] = new Question('Drush installation (require|require-dev)', 'require'); + $questions['drush_installation']->setValidator(Utils::getOptionsValidator($sections)); + $questions['drush_installation']->setAutocompleterValues($sections); + $this->collectVars($input, $output, $questions); + } + + $questions['drupal_console'] = new ConfirmationQuestion('Would you like to install Drupal Console?', !$vars['drush']); + $vars = $this->collectVars($input, $output, $questions); + if ($vars['drupal_console']) { + $questions['drupal_console_installation'] = new Question('Drupal Console installation (require|require-dev)', 'require-dev'); + $questions['drupal_console_installation']->setValidator(Utils::getOptionsValidator($sections)); + $questions['drupal_console_installation']->setAutocompleterValues($sections); + $this->collectVars($input, $output, $questions); + } + + $questions['composer_patches'] = new ConfirmationQuestion('Would you like to install Composer patches plugin?', TRUE); + $questions['composer_merge'] = new ConfirmationQuestion('Would you like to install Composer merge plugin?', FALSE); + $questions['behat'] = new ConfirmationQuestion('Would you like to create Behat tests?', FALSE); + $questions['env'] = new ConfirmationQuestion('Would you like to load environment variables from .env files?', FALSE); + $questions['asset_packagist'] = new ConfirmationQuestion('Would you like to add asset-packagist repository?', FALSE); + + $vars = &$this->collectVars($input, $output, $questions); + + $vars['document_root_path'] = $vars['document_root'] ? + $vars['document_root'] . '/' : $vars['document_root']; + + $this->addFile('composer.json') + ->content(self::buildComposerJson($vars)); + + $this->addFile('.gitignore') + ->template('d8/_project/gitignore.twig'); + + $this->addFile('phpcs.xml') + ->template('d8/_project/phpcs.xml.twig'); + + $this->addFile('scripts/composer/create_required_files.php') + ->template('d8/_project/scripts/composer/create_required_files.php.twig'); + + if ($vars['behat']) { + $this->addFile('tests/behat/behat.yml') + ->template('d8/_project/tests/behat/behat.yml.twig'); + + $this->addFile('tests/behat/local.behat.yml') + ->template('d8/_project/tests/behat/local.behat.yml.twig'); + + $this->addFile('tests/behat/bootstrap/BaseContext.php') + ->template('d8/_project/tests/behat/bootstrap/BaseContext.php.twig'); + + $this->addFile('tests/behat/bootstrap/ExampleContext.php') + ->template('d8/_project/tests/behat/bootstrap/ExampleContext.php.twig'); + + $this->addFile('tests/behat/features/example/user_forms.feature') + ->template('d8/_project/tests/behat/features/example/user_forms.feature.twig'); + } + + if ($vars['env']) { + $this->addFile('.env.example') + ->template('d8/_project/env.example.twig'); + $this->addFile('load.environment.php') + ->template('d8/_project/load.environment.php.twig'); + } + + if ($vars['document_root']) { + $this->addDirectory('config/sync'); + } + + if ($vars['drush']) { + $this->addFile('drush/drush.yml') + ->template('d8/_project/drush/drush.yml.twig'); + $this->addFile('drush/Commands/PolicyCommands.php') + ->template('d8/_project/drush/Commands/PolicyCommands.php.twig'); + $this->addFile('drush/sites/self.site.yml') + ->template('d8/_project/drush/sites/self.site.yml.twig'); + $this->addFile('scripts/sync-site.sh') + ->template('d8/_project/scripts/sync-site.sh.twig') + ->mode(0544); + } + + $this->addFile('patches/.keep')->content(''); + $this->addDirectory($vars['document_root_path'] . 'modules/contrib'); + $this->addDirectory($vars['document_root_path'] . 'modules/custom'); + $this->addDirectory($vars['document_root_path'] . 'modules/custom'); + $this->addDirectory($vars['document_root_path'] . 'libraries'); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) { + $result = parent::execute($input, $output); + if ($result === 0) { + $output->writeln(' <info>Next steps:</info>'); + $output->writeln(' <info>–––––––––––</info>'); + $output->writeln(' <info>1. Review generated files</info>'); + $output->writeln(' <info>2. Run <comment>composer install</comment> command</info>'); + $output->writeln(' <info>3. Install Drupal</info>'); + $output->writeln(''); + } + return $result; + } + + /** + * Builds composer.json file. + * + * @param array $vars + * Collected variables. + * + * @return string + * Encoded JSON content. + */ + protected static function buildComposerJson(array $vars) { + + $document_root_path = $vars['document_root_path']; + + $composer_json = []; + + $composer_json['name'] = $vars['name']; + $composer_json['description'] = $vars['description']; + $composer_json['type'] = 'project'; + $composer_json['license'] = $vars['license']; + + $composer_json['repositories'][] = [ + 'type' => 'composer', + 'url' => 'https://packages.drupal.org/8', + ]; + if ($vars['asset_packagist']) { + $composer_json['repositories'][] = [ + 'type' => 'composer', + 'url' => 'https://asset-packagist.org', + ]; + } + + $require = []; + $require_dev = []; + + self::addPackage($require, 'drupal/core'); + $require['drupal/core'] = $vars['drupal']; + self::addPackage($require, 'composer/installers'); + self::addPackage($require, 'drupal-composer/drupal-scaffold'); + self::addPackage($require, 'zaporylie/composer-drupal-optimizations'); + $require_dev['webflo/drupal-core-require-dev'] = $vars['drupal']; + + if ($vars['asset_packagist']) { + self::addPackage($require, 'oomphinc/composer-installers-extender'); + } + + if ($vars['drupal_core_strict']) { + $require['webflo/drupal-core-strict'] = $vars['drupal']; + } + + if ($vars['drush']) { + $vars['drush_installation'] == 'require' + ? self::addPackage($require, 'drush/drush') + : self::addPackage($require_dev, 'drush/drush'); + } + + if ($vars['drupal_console']) { + $vars['drupal_console_installation'] == 'require' + ? self::addPackage($require, 'drupal/console') + : self::addPackage($require_dev, 'drupal/console'); + } + + if ($vars['composer_patches']) { + self::addPackage($require, 'cweagans/composer-patches'); + } + + if ($vars['composer_merge']) { + self::addPackage($require, 'wikimedia/composer-merge-plugin'); + } + + if ($vars['behat']) { + // Behat and Mink drivers are Drupal core dev dependencies. + self::addPackage($require_dev, 'drupal/drupal-extension'); + } + + if ($vars['env']) { + self::addPackage($require, 'symfony/dotenv'); + } + + $composer_json['require'] = [ + 'php' => $vars['php'], + 'ext-curl' => '*', + 'ext-gd' => '*', + 'ext-json' => '*', + ]; + ksort($require); + $composer_json['require'] += $require; + + ksort($require_dev); + $composer_json['require-dev'] = $require_dev; + + // PHPUnit is core dev dependency. + $composer_json['scripts']['phpunit'] = 'phpunit --colors=always --configuration ' . $document_root_path . 'core ' . $document_root_path . 'modules/custom'; + if ($vars['behat']) { + $composer_json['scripts']['behat'] = 'behat --colors --config=tests/behat/local.behat.yml'; + } + $composer_json['scripts']['phpcs'] = 'phpcs --standard=phpcs.xml'; + $composer_json['scripts']['post-install-cmd'][] = '@php ./scripts/composer/create_required_files.php'; + $composer_json['scripts']['post-update-cmd'][] = '@php ./scripts/composer/create_required_files.php'; + + $composer_json['minimum-stability'] = 'dev'; + $composer_json['prefer-stable'] = TRUE; + + $composer_json['config'] = [ + 'sort-packages' => TRUE, + 'bin-dir' => 'bin', + ]; + + if ($vars['env']) { + $composer_json['autoload']['files'][] = 'load.environment.php'; + } + + if ($vars['composer_patches']) { + $composer_json['extra']['composer-exit-on-patch-failure'] = TRUE; + } + + if ($vars['asset_packagist']) { + $composer_json['extra']['installer-types'] = [ + 'bower-asset', + 'npm-asset', + ]; + } + $composer_json['extra']['installer-paths'] = [ + $document_root_path . 'core' => ['type:drupal-core'], + $document_root_path . 'libraries/{$name}' => ['type:drupal-library'], + $document_root_path . 'modules/contrib/{$name}' => ['type:drupal-module'], + $document_root_path . 'themes/{$name}' => ['type:drupal-theme'], + 'drush/{$name}' => ['type:drupal-drush'], + ]; + if ($vars['asset_packagist']) { + $composer_json['extra']['installer-paths'][$document_root_path . 'libraries/{$name}'][] = 'type:bower-asset'; + $composer_json['extra']['installer-paths'][$document_root_path . 'libraries/{$name}'][] = 'type:npm-asset'; + } + + $composer_json['extra']['drupal-scaffold']['excludes'] = [ + '.csslintrc', + '.editorconfig', + '.eslintignore', + '.eslintrc.json', + '.gitattributes', + '.ht.router.php', + '.htaccess', + 'robots.txt', + 'update.php', + 'web.config', + ]; + // Initial files are created but never updated. + $composer_json['extra']['drupal-scaffold']['initial'] = [ + '.htaccess' => '.htaccess', + 'robots.txt' => 'robots.txt', + ]; + + // Move these files to Composer root. + if ($vars['document_root']) { + $composer_json['extra']['drupal-scaffold']['initial']['.editorconfig'] = '../.editorconfig'; + $composer_json['extra']['drupal-scaffold']['initial']['.gitattributes'] = '../.gitattributes'; + } + ksort($composer_json['extra']['drupal-scaffold']['initial']); + + if ($vars['composer_merge']) { + $composer_json['extra']['merge-plugin'] = [ + 'include' => [ + $document_root_path . 'modules/custom/*/composer.json', + ], + 'recurse' => TRUE, + ]; + } + + return json_encode($composer_json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + } + + /** + * Requires a given package. + * + * @param array $section + * Section for the package (require|require-dev) + * @param string $package + * A package to be added. + * + * @todo Find a way to track versions automatically. + */ + protected static function addPackage(array &$section, $package) { + $versions = [ + 'composer/installers' => '^1.4', + 'cweagans/composer-patches' => '^1.6', + 'drupal-composer/drupal-scaffold' => '^2.5', + 'drupal/console' => '^1.0', + 'drupal/core' => self::DRUPAL_DEFAULT_VERSION, + 'drupal/drupal-extension' => '^3.4', + 'drush/drush' => '^9.6', + 'oomphinc/composer-installers-extender' => '^1.1', + 'symfony/dotenv' => '^3.4', + 'webflo/drupal-core-require-dev' => self::DRUPAL_DEFAULT_VERSION, + 'webflo/drupal-core-strict' => self::DRUPAL_DEFAULT_VERSION, + 'wikimedia/composer-merge-plugin' => '^1.4', + 'zaporylie/composer-drupal-optimizations' => '^1.1', + ]; + $section[$package] = $versions[$package]; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/RenderElement.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/RenderElement.php new file mode 100644 index 0000000000000000000000000000000000000000..8f9a20cd9f4303b8cdbf5fae276337b8973f1056 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/RenderElement.php @@ -0,0 +1,32 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:render-element command. + */ +class RenderElement extends BaseGenerator { + + protected $name = 'd8:render-element'; + protected $description = 'Generates Drupal 8 render element'; + protected $alias = 'render-element'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Module machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + $this->collectVars($input, $output, $questions); + $this->addFile() + ->path('src/Element/Entity.php') + ->template('d8/render-element.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/AccessChecker.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/AccessChecker.php new file mode 100644 index 0000000000000000000000000000000000000000..1f5d98a3cae7df7b7d9950f2cf62e04289bca80e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/AccessChecker.php @@ -0,0 +1,47 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:access-checker command. + */ +class AccessChecker extends BaseGenerator { + + protected $name = 'd8:service:access-checker'; + protected $description = 'Generates an access checker service'; + protected $alias = 'access-checker'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['applies_to'] = new Question('Applies to', '_foo'); + $questions['applies_to']->setValidator(function ($value) { + if (!preg_match('/^_[a-z0-9_]*[a-z0-9]$/', $value)) { + throw new \UnexpectedValueException('The value is not correct name for "applies_to" property.'); + } + return $value; + }); + $default_class = function ($vars) { + return Utils::camelize($vars['applies_to']) . 'AccessChecker'; + }; + $questions['class'] = new Question('Class', $default_class); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Access/{class}.php') + ->template('d8/service/access-checker.twig'); + + $this->addServicesFile() + ->template('d8/service/access-checker.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/BreadcrumbBuilder.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/BreadcrumbBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..4145b25fc9df7d4896b3345e2ab52b132b5532f7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/BreadcrumbBuilder.php @@ -0,0 +1,41 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:breadcrumb-builder command. + */ +class BreadcrumbBuilder extends BaseGenerator { + + protected $name = 'd8:service:breadcrumb-builder'; + protected $description = 'Generates a breadcrumb builder service'; + protected $alias = 'breadcrumb-builder'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']) . 'BreadcrumbBuilder'; + }; + $questions['class'] = new Question('Class', $default_class); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/{class}.php') + ->template('d8/service/breadcrumb-builder.twig'); + + $this->addServicesFile() + ->path('{machine_name}.services.yml') + ->template('d8/service/breadcrumb-builder.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/CacheContext.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/CacheContext.php new file mode 100644 index 0000000000000000000000000000000000000000..52b3a1d3b10f28662155bb678b5e1067d93fa787 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/CacheContext.php @@ -0,0 +1,58 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:cache-context command. + */ +class CacheContext extends BaseGenerator { + + protected $name = 'd8:service:cache-context'; + protected $description = 'Generates a cache context service'; + protected $alias = 'cache-context'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['context_id'] = new Question('Context ID', 'example'); + $default_class = function ($vars) { + return Utils::camelize($vars['context_id']) . 'CacheContext'; + }; + $questions['class'] = new Question('Class', $default_class); + $base_class_choices = [ + '-', + 'RequestStackCacheContextBase', + 'UserCacheContextBase', + ]; + $questions['base_class'] = new ChoiceQuestion('Base class', $base_class_choices); + $questions['calculated'] = new ConfirmationQuestion('Make the context calculated?', FALSE); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['context_label'] = Utils::machine2human($vars['context_id']); + + $vars['interface'] = $vars['calculated'] ? + 'CalculatedCacheContextInterface' : 'CacheContextInterface'; + + if ($vars['base_class'] == '-') { + $vars['base_class'] = FALSE; + } + + $this->addFile() + ->path('src/Cache/Context/{class}.php') + ->template('d8/service/cache-context.twig'); + + $this->addServicesFile() + ->template('d8/service/cache-context.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Custom.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Custom.php new file mode 100644 index 0000000000000000000000000000000000000000..77697bf1121f9a750dc95c99d28ca027ee73f59d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Custom.php @@ -0,0 +1,52 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:custom command. + */ +class Custom extends BaseGenerator { + + protected $name = 'd8:service:custom'; + protected $description = 'Generates a custom Drupal service'; + protected $alias = 'custom-service'; + protected $label = 'Custom service'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['service_name'] = new Question('Service name', '{machine_name}.example'); + $questions['service_name']->setValidator([Utils::class, 'validateServiceName']); + + $default_class = function ($vars) { + $service = preg_replace('/^' . $vars['machine_name'] . '/', '', $vars['service_name']); + return Utils::camelize($service); + }; + $questions['class'] = new Question('Class', $default_class); + $questions['class']->setValidator([Utils::class, 'validateClassName']); + + $this->collectVars($input, $output, $questions); + + $di_question = new ConfirmationQuestion('Would you like to inject dependencies?'); + if ($this->ask($input, $output, $di_question)) { + $this->collectServices($input, $output); + } + + $this->addFile() + ->path('src/{class}.php') + ->template('d8/service/custom.twig'); + + $this->addServicesFile() + ->template('d8/service/custom.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/EventSubscriber.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/EventSubscriber.php new file mode 100644 index 0000000000000000000000000000000000000000..a83ed8016aab670c6c0fab9cd751a368135ad86d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/EventSubscriber.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:service:event-subscriber command. + */ +class EventSubscriber extends BaseGenerator { + + protected $name = 'd8:service:event-subscriber'; + protected $description = 'Generates an event subscriber'; + protected $alias = 'event-subscriber'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['class'] = Utils::camelize($vars['machine_name']) . 'Subscriber'; + + $this->addFile() + ->path('src/EventSubscriber/{class}.php') + ->template('d8/service/event-subscriber.twig'); + + $this->addServicesFile() + ->template('d8/service/event-subscriber.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Logger.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Logger.php new file mode 100644 index 0000000000000000000000000000000000000000..cdc4ff0b5bb6a379f37a2ab65652bc87df8135db --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Logger.php @@ -0,0 +1,37 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:logger command. + */ +class Logger extends BaseGenerator { + + protected $name = 'd8:service:logger'; + protected $description = 'Generates a logger service'; + protected $alias = 'logger'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['class'] = new Question('Class', 'FileLog'); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Logger/{class}.php') + ->template('d8/service/logger.twig'); + + $this->addServicesFile() + ->template('d8/service/logger.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Middleware.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Middleware.php new file mode 100644 index 0000000000000000000000000000000000000000..c51aac4cd314cabfadc46477eee1cefc08788081 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Middleware.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:service:middleware command. + */ +class Middleware extends BaseGenerator { + + protected $name = 'd8:service:middleware'; + protected $description = 'Generates a middleware'; + protected $alias = 'middleware'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $vars = &$this->collectVars($input, $output, $questions); + $vars['class'] = Utils::camelize($vars['machine_name']) . 'Middleware'; + + $this->addFile() + ->path('src/{class}.php') + ->template('d8/service/middleware.twig'); + + $this->addServicesFile() + ->path('{machine_name}.services.yml') + ->template('d8/service/middleware.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ParamConverter.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ParamConverter.php new file mode 100644 index 0000000000000000000000000000000000000000..5fb58934ccc92c67ebfe4c651bf38f07ffc2a3b3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ParamConverter.php @@ -0,0 +1,43 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:param-converter command. + */ +class ParamConverter extends BaseGenerator { + + protected $name = 'd8:service:param-converter'; + protected $description = 'Generates a param converter service'; + protected $alias = 'param-converter'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['parameter_type'] = new Question('Parameter type', 'example'); + $default_class = function ($vars) { + return Utils::camelize($vars['parameter_type']) . 'ParamConverter'; + }; + $questions['class'] = new Question('Class', $default_class); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['controller_class'] = Utils::camelize($vars['machine_name']) . 'Controller'; + + $this->addFile() + ->path('src/{class}.php') + ->template('d8/service/param-converter.twig'); + + $this->addServicesFile() + ->path('{machine_name}.services.yml') + ->template('d8/service/param-converter.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/PathProcessor.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/PathProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..0ff571951aac14db46419ede25d3a036954dc1e4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/PathProcessor.php @@ -0,0 +1,40 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:path-processor command. + */ +class PathProcessor extends BaseGenerator { + + protected $name = 'd8:service:path-processor'; + protected $description = 'Generates a path processor service'; + protected $alias = 'path-processor'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $default_class = function ($vars) { + return 'PathProcessor' . Utils::camelize($vars['machine_name']); + }; + $questions['class'] = new Question('Class', $default_class); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/PathProcessor/{class}.php') + ->template('d8/service/path-processor.twig'); + + $this->addServicesFile() + ->template('d8/service/path-processor.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RequestPolicy.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RequestPolicy.php new file mode 100644 index 0000000000000000000000000000000000000000..5f399c9349e45dcde45e85e314acba7169f7fcc9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RequestPolicy.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:request-policy command. + */ +class RequestPolicy extends BaseGenerator { + + protected $name = 'd8:service:request-policy'; + protected $description = 'Generates a request policy service'; + protected $alias = 'request-policy'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['class'] = new Question('Class', 'Example'); + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/PageCache/{class}.php') + ->template('d8/service/request-policy.twig'); + + $this->addServicesFile() + ->template('d8/service/request-policy.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ResponsePolicy.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ResponsePolicy.php new file mode 100644 index 0000000000000000000000000000000000000000..d5bb2a728c85f0bbb41294f4557cb5bbaa8c4c41 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ResponsePolicy.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:response-policy command. + */ +class ResponsePolicy extends BaseGenerator { + + protected $name = 'd8:service:response-policy'; + protected $description = 'Generates a response policy service'; + protected $alias = 'response-policy'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['class'] = new Question('Class', 'Example'); + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/PageCache/{class}.php') + ->template('d8/service/response-policy.twig'); + + $this->addServicesFile() + ->template('d8/service/response-policy.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RouteSubscriber.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RouteSubscriber.php new file mode 100644 index 0000000000000000000000000000000000000000..8382b555ecb803549b9a06dcd1d3bbc5f1cc7358 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RouteSubscriber.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:service:route-subscriber command. + */ +class RouteSubscriber extends BaseGenerator { + + protected $name = 'd8:service:route-subscriber'; + protected $description = 'Generates a route subscriber'; + protected $alias = 'route-subscriber'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['class'] = Utils::camelize($vars['machine_name']) . 'RouteSubscriber'; + + $this->addFile() + ->path('src/EventSubscriber/{class}.php') + ->template('d8/service/route-subscriber.twig'); + + $this->addServicesFile() + ->template('d8/service/route-subscriber.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ThemeNegotiator.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ThemeNegotiator.php new file mode 100644 index 0000000000000000000000000000000000000000..5640506d4e88ec1d610c04a576e7a8276195ee31 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ThemeNegotiator.php @@ -0,0 +1,40 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:theme-negotiator command. + */ +class ThemeNegotiator extends BaseGenerator { + + protected $name = 'd8:service:theme-negotiator'; + protected $description = 'Generates a theme negotiator'; + protected $alias = 'theme-negotiator'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']) . 'Negotiator'; + }; + $questions['class'] = new Question('Class', $default_class); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Theme/{class}.php') + ->template('d8/service/theme-negotiator.twig'); + + $this->addServicesFile() + ->template('d8/service/theme-negotiator.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/TwigExtension.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/TwigExtension.php new file mode 100644 index 0000000000000000000000000000000000000000..aef5a503719daed60c3353f66221c8d2ab7ccb22 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/TwigExtension.php @@ -0,0 +1,45 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:twig-extension command. + */ +class TwigExtension extends BaseGenerator { + + protected $name = 'd8:service:twig-extension'; + protected $description = 'Generates Twig extension service'; + protected $alias = 'twig-extension'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::moduleQuestions(); + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']) . 'TwigExtension'; + }; + $questions['class'] = new Question('Class', $default_class); + $this->collectVars($input, $output, $questions); + + $di_question = new ConfirmationQuestion('Would you like to inject dependencies?'); + if ($this->ask($input, $output, $di_question)) { + $this->collectServices($input, $output); + } + + $this->addFile() + ->path('src/{class}.php') + ->template('d8/service/twig-extension.twig'); + + $this->addServicesFile() + ->template('d8/service/twig-extension.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/UninstallValidator.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/UninstallValidator.php new file mode 100644 index 0000000000000000000000000000000000000000..59bc4534ce3e24a55d67c8158a72fe2873984691 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/UninstallValidator.php @@ -0,0 +1,39 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Service; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:service:uninstall-validator command. + */ +class UninstallValidator extends BaseGenerator { + + protected $name = 'd8:service:uninstall-validator'; + protected $description = 'Generates a uninstall validator service'; + protected $alias = 'uninstall-validator'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']) . 'UninstallValidator'; + }; + $questions['class'] = new Question('Class', $default_class); + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/{class}.php') + ->template('d8/service/uninstall-validator.twig'); + + $this->addServicesFile() + ->template('d8/service/uninstall-validator.services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ServiceProvider.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ServiceProvider.php new file mode 100644 index 0000000000000000000000000000000000000000..47749cdc339f8534015ec234508cfe1e6fde5e9e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ServiceProvider.php @@ -0,0 +1,30 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:service-provider command. + */ +class ServiceProvider extends BaseGenerator { + + protected $name = 'd8:service-provider'; + protected $description = 'Generates a service provider'; + protected $alias = 'service-provider'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $vars = &$this->collectVars($input, $output, Utils::defaultQuestions()); + $vars['class'] = Utils::camelize($vars['machine_name']) . 'ServiceProvider'; + $this->addFile() + ->path('src/{class}.php') + ->template('d8/service-provider.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/SettingsLocal.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/SettingsLocal.php new file mode 100644 index 0000000000000000000000000000000000000000..240fef5ffafbcb292cadafbef1fd183eda5cbf1c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/SettingsLocal.php @@ -0,0 +1,48 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:settings-local command. + */ +class SettingsLocal extends BaseGenerator { + + protected $name = 'd8:settings-local'; + protected $description = 'Generates Drupal 8 settings.local.php file'; + protected $alias = 'settings.local.php'; + protected $destination = 'sites/default'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['db_override'] = new ConfirmationQuestion('Override database configuration?', FALSE); + + $vars = $this->collectVars($input, $output, $questions); + if ($vars['db_override']) { + $questions = [ + 'database' => new Question('Database name', 'drupal_local'), + 'username' => new Question('Database username', 'root'), + 'password' => new Question('Database password'), + 'host' => new Question('Database host', 'localhost'), + 'driver' => new Question('Database type', 'mysql'), + ]; + array_walk($questions, function (Question $question) { + $question->setValidator([Utils::class, 'validateRequired']); + }); + $this->collectVars($input, $output, $questions); + } + + $this->addFile() + ->path('settings.local.php') + ->template('d8/settings.local.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Template.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Template.php new file mode 100644 index 0000000000000000000000000000000000000000..e2c33277a214c3bdf91bf0128b79a7f91cd3b336 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Template.php @@ -0,0 +1,45 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:template command. + */ +class Template extends BaseGenerator { + + protected $name = 'd8:template'; + protected $description = 'Generates a template'; + protected $alias = 'template'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['template_name'] = new Question('Template name', 'example'); + $questions['create_theme'] = new ConfirmationQuestion('Create theme hook?', TRUE); + $questions['create_preprocess'] = new ConfirmationQuestion('Create preprocess hook?', TRUE); + + $vars = $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('templates/{template_name}.html.twig') + ->template('d8/template-template.twig'); + + if ($vars['create_theme'] || $vars['create_preprocess']) { + $this->addFile() + ->path('{machine_name}.module') + ->template('d8/template-module.twig') + ->action('append') + ->headerSize(7); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Browser.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Browser.php new file mode 100644 index 0000000000000000000000000000000000000000..886bf41c7544482925c4acc53884749ec6711ac4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Browser.php @@ -0,0 +1,35 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Test; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:test:browser command. + */ +class Browser extends BaseGenerator { + + protected $name = 'd8:test:browser'; + protected $description = 'Generates a browser based test'; + protected $alias = 'browser-test'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['class'] = new Question('Class', 'ExampleTest'); + $questions['class']->setValidator([Utils::class, 'validateClassName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('tests/src/Functional/{class}.php') + ->template('d8/test/browser.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Kernel.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Kernel.php new file mode 100644 index 0000000000000000000000000000000000000000..dbad8abc64b8ab10d9d76b81667c6b6915993f13 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Kernel.php @@ -0,0 +1,35 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Test; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:test:kernel command. + */ +class Kernel extends BaseGenerator { + + protected $name = 'd8:test:kernel'; + protected $description = 'Generates a kernel based test'; + protected $alias = 'kernel-test'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['class'] = new Question('Class', 'ExampleTest'); + $questions['class']->setValidator([Utils::class, 'validateClassName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('tests/src/Kernel/{class}.php') + ->template('d8/test/kernel.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Nightwatch.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Nightwatch.php new file mode 100644 index 0000000000000000000000000000000000000000..e390943c8681a3968d683a718d21b7cb8a0adb88 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Nightwatch.php @@ -0,0 +1,35 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Test; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:test:nightwatch command. + */ +class Nightwatch extends BaseGenerator { + + protected $name = 'd8:test:nightwatch'; + protected $description = 'Generates a nightwatch test'; + protected $alias = 'nightwatch-test'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['test_name'] = new Question('Test name', 'example'); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['test_name'] = Utils::camelize($vars['test_name'], FALSE); + + $this->addFile() + ->path('tests/src/Nightwatch/{test_name}Test.js') + ->template('d8/test/nightwatch.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Unit.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Unit.php new file mode 100644 index 0000000000000000000000000000000000000000..17a9280a8a12cf252169237457343abe6783b647 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Unit.php @@ -0,0 +1,35 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Test; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:test:unit command. + */ +class Unit extends BaseGenerator { + + protected $name = 'd8:test:unit'; + protected $description = 'Generates a unit test'; + protected $alias = 'unit-test'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['class'] = new Question('Class', 'ExampleTest'); + $questions['class']->setValidator([Utils::class, 'validateClassName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('tests/src/Unit/{class}.php') + ->template('d8/test/unit.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Web.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Web.php new file mode 100644 index 0000000000000000000000000000000000000000..39c867b4b66bf9cfbd22326122f50ce981db1c60 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Web.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Test; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:test:web command. + */ +class Web extends BaseGenerator { + + protected $name = 'd8:test:web'; + protected $description = 'Generates a web based test'; + protected $alias = 'web-test'; + protected $label = 'Web (simpletest)'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['class'] = new Question('Class', 'ExampleTest'); + $questions['class']->setValidator([Utils::class, 'validateClassName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('src/Tests/{class}.php') + ->template('d8/test/web.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/WebDriver.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/WebDriver.php new file mode 100644 index 0000000000000000000000000000000000000000..17f164ce489b34abd118d27c377ea76371dd98ff --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/WebDriver.php @@ -0,0 +1,36 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Test; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:test:webdriver command. + */ +class WebDriver extends BaseGenerator { + + protected $name = 'd8:test:webdriver'; + protected $description = 'Generates a test that supports JavaScript'; + protected $alias = 'webdriver-test'; + protected $label = 'WebDriver'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['class'] = new Question('Class', 'ExampleTest'); + $questions['class']->setValidator([Utils::class, 'validateClassName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('tests/src/FunctionalJavascript/{class}.php') + ->template('d8/test/webdriver.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Theme.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Theme.php new file mode 100644 index 0000000000000000000000000000000000000000..638cf646d0a1bd15ea7d3ea7ef15a129e136f047 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Theme.php @@ -0,0 +1,138 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:theme command. + * + * @TODO: Create a SUT test for this. + */ +class Theme extends BaseGenerator { + + protected $name = 'd8:theme'; + protected $description = 'Generates Drupal 8 theme'; + protected $alias = 'theme'; + protected $destination = 'themes'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['name'] = new Question('Theme name'); + $questions['machine_name'] = new Question('Theme machine name'); + $questions['base_theme'] = new Question('Base theme', 'classy'); + $questions['description'] = new Question('Description', 'A flexible theme with a responsive, mobile-first layout.'); + $questions['package'] = new Question('Package', 'Custom'); + $questions['sass'] = new ConfirmationQuestion('Would you like to use SASS to compile style sheets?', FALSE); + $questions['breakpoints'] = new ConfirmationQuestion('Would you like to create breakpoints?', FALSE); + $questions['theme_settings'] = new ConfirmationQuestion('Would you like to create theme settings form?', FALSE); + + $vars = $this->collectVars($input, $output, $questions); + $vars['base_theme'] = Utils::human2machine($vars['base_theme']); + + $prefix = $vars['machine_name'] . '/' . $vars['machine_name']; + + $this->addFile() + ->path($prefix . '.info.yml') + ->template('d8/yml/theme-info.twig'); + + $this->addFile() + ->path($prefix . '.libraries.yml') + ->template('d8/yml/theme-libraries.twig'); + + $this->addFile() + ->path($prefix . '.theme') + ->template('d8/theme.twig'); + + $this->addFile() + ->path('{machine_name}/js/' . str_replace('_', '-', $vars['machine_name']) . '.js') + ->template('d8/javascript.twig'); + + if ($vars['breakpoints']) { + $this->addFile() + ->path($prefix . '.breakpoints.yml') + ->template('d8/yml/breakpoints.twig'); + } + + if ($vars['theme_settings']) { + $this->addFile() + ->path('{machine_name}/theme-settings.php') + ->template('d8/theme-settings-form.twig'); + + $this->addFile() + ->path('{machine_name}/config/install/{machine_name}.settings.yml') + ->template('d8/theme-settings-config.twig'); + + $this->addFile() + ->path('{machine_name}/config/schema/{machine_name}.schema.yml') + ->template('d8/theme-settings-schema.twig'); + } + + $this->addFile() + ->path('{machine_name}/logo.svg') + ->template('d8/theme-logo.twig'); + + // Templates directory structure. + $this->addDirectory() + ->path('{machine_name}/templates/page'); + + $this->addDirectory() + ->path('{machine_name}/templates/node'); + + $this->addDirectory() + ->path('{machine_name}/templates/field'); + + $this->addDirectory() + ->path('{machine_name}/templates/view'); + + $this->addDirectory() + ->path('{machine_name}/templates/block'); + + $this->addDirectory() + ->path('{machine_name}/templates/menu'); + + $this->addDirectory() + ->path('{machine_name}/images'); + + $this->addFile() + ->path('{machine_name}/package.json') + ->template('d8/theme-package.json.twig'); + + // Style sheets directory structure. + $this->addDirectory() + ->path('{machine_name}/css'); + + $style_sheets = [ + 'base/elements', + 'components/block', + 'components/breadcrumb', + 'components/field', + 'components/form', + 'components/header', + 'components/menu', + 'components/messages', + 'components/node', + 'components/sidebar', + 'components/table', + 'components/tabs', + 'components/buttons', + 'layouts/layout', + 'theme/print', + ]; + + foreach ($style_sheets as $file) { + $this->addFile() + ->path('{machine_name}/' . ($vars['sass'] ? "scss/$file.scss" : "css/$file.css")) + ->content(''); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeFile.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeFile.php new file mode 100644 index 0000000000000000000000000000000000000000..c99f3626cfa4622cae9d9fa27ea002b21b9b0442 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeFile.php @@ -0,0 +1,37 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:theme-file command. + */ +class ThemeFile extends BaseGenerator { + + protected $name = 'd8:theme-file'; + protected $description = 'Generates a theme file'; + protected $alias = 'theme-file'; + protected $destination = 'themes/%'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['name'] = new Question('Theme name'); + $questions['name']->setValidator([Utils::class, 'validateRequired']); + $questions['machine_name'] = new Question('Theme machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.theme') + ->template('d8/theme.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeSettings.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeSettings.php new file mode 100644 index 0000000000000000000000000000000000000000..f62413c966d89afa2f4fa45b19b58e63b099629c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeSettings.php @@ -0,0 +1,44 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:theme-settings command. + */ +class ThemeSettings extends BaseGenerator { + + protected $name = 'd8:theme-settings'; + protected $description = 'Generates Drupal 8 theme-settings.php file'; + protected $alias = 'theme-settings'; + protected $destination = 'themes/%'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['name'] = new Question('Theme name'); + $questions['name']->setValidator([Utils::class, 'validateRequired']); + $questions['machine_name'] = new Question('Theme machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('theme-settings.php') + ->template('d8/theme-settings-form.twig'); + + $this->addFile() + ->path('config/install/{machine_name}.settings.yml') + ->template('d8/theme-settings-config.twig'); + + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/theme-settings-schema.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Breakpoints.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Breakpoints.php new file mode 100644 index 0000000000000000000000000000000000000000..4103fe75809c027fc687a88ad95f9f05b9548cbb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Breakpoints.php @@ -0,0 +1,35 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:breakpoints command. + */ +class Breakpoints extends BaseGenerator { + + protected $name = 'd8:yml:breakpoints'; + protected $description = 'Generates a breakpoints yml file'; + protected $alias = 'breakpoints'; + protected $destination = 'themes/%'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Theme machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.breakpoints.yml') + ->template('d8/yml/breakpoints.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Action.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Action.php new file mode 100644 index 0000000000000000000000000000000000000000..4915e5655a4dcda0f6a4ce678b4ab468d6793e1c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Action.php @@ -0,0 +1,34 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml\Links; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:links:action command. + */ +class Action extends BaseGenerator { + + protected $name = 'd8:yml:links:action'; + protected $description = 'Generates a links.action yml file'; + protected $alias = 'action-links'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Module machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.links.action.yml') + ->template('d8/yml/links.action.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Contextual.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Contextual.php new file mode 100644 index 0000000000000000000000000000000000000000..1aca0accc8827eb962eaa7427f6704d43eca89fc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Contextual.php @@ -0,0 +1,34 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml\Links; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:links:contextual command. + */ +class Contextual extends BaseGenerator { + + protected $name = 'd8:yml:links:contextual'; + protected $description = 'Generates links.contextual yml file'; + protected $alias = 'contextual-links'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Module machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.links.contextual.yml') + ->template('d8/yml/links.contextual.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Menu.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Menu.php new file mode 100644 index 0000000000000000000000000000000000000000..e8251a19e868032975dab607d979af888528f96f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Menu.php @@ -0,0 +1,34 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml\Links; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:links:menu command. + */ +class Menu extends BaseGenerator { + + protected $name = 'd8:yml:links:menu'; + protected $description = 'Generates a links.menu yml file'; + protected $alias = 'menu-links'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Module machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.links.menu.yml') + ->template('d8/yml/links.menu.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Task.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Task.php new file mode 100644 index 0000000000000000000000000000000000000000..26dbdb2e8ee2aa85f3cc7827eed2eafba2f15cc2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Task.php @@ -0,0 +1,34 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml\Links; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:links:task command. + */ +class Task extends BaseGenerator { + + protected $name = 'd8:yml:links:task'; + protected $description = 'Generates a links.task yml file'; + protected $alias = 'task-links'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Module machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.links.task.yml') + ->template('d8/yml/links.task.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleInfo.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleInfo.php new file mode 100644 index 0000000000000000000000000000000000000000..00784d8f20901cfc92ec246932fc02d28271c323 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleInfo.php @@ -0,0 +1,40 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:module-info command. + */ +class ModuleInfo extends BaseGenerator { + + protected $name = 'd8:yml:module-info'; + protected $description = 'Generates a module info yml file'; + protected $alias = 'module-info'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + $questions['description'] = new Question('Description', 'Module description.'); + $questions['package'] = new Question('Package', 'Custom'); + $questions['configure'] = new Question('Configuration page (route name)'); + $questions['dependencies'] = new Question('Dependencies (comma separated)'); + + $vars = &$this->collectVars($input, $output, $questions); + if ($vars['dependencies']) { + $vars['dependencies'] = array_map('trim', explode(',', strtolower($vars['dependencies']))); + } + + $this->addFile() + ->path('{machine_name}.info.yml') + ->template('d8/yml/module-info.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleLibraries.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleLibraries.php new file mode 100644 index 0000000000000000000000000000000000000000..d17509756f47f1e4a7f41a73702f3bd501e80124 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleLibraries.php @@ -0,0 +1,35 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:module-libraries command. + */ +class ModuleLibraries extends BaseGenerator { + + protected $name = 'd8:yml:module-libraries'; + protected $description = 'Generates module libraries yml file'; + protected $alias = 'module-libraries'; + protected $label = 'Libraries (module)'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Module machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.libraries.yml') + ->template('d8/yml/module-libraries.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Permissions.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Permissions.php new file mode 100644 index 0000000000000000000000000000000000000000..a86565807a7eb438fc42806e18294020c48087d3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Permissions.php @@ -0,0 +1,34 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:permissions command. + */ +class Permissions extends BaseGenerator { + + protected $name = 'd8:yml:permissions'; + protected $description = 'Generates a permissions yml file'; + protected $alias = 'permissions'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Module machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.permissions.yml') + ->template('d8/yml/permissions.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Routing.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Routing.php new file mode 100644 index 0000000000000000000000000000000000000000..f0b2d25b1db7d69315ddcd0c265f35980c16c8b5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Routing.php @@ -0,0 +1,33 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:yml:routing command. + */ +class Routing extends BaseGenerator { + + protected $name = 'd8:yml:routing'; + protected $description = 'Generates a routing yml file'; + protected $alias = 'routing'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['class'] = Utils::camelize($vars['machine_name']) . 'Controller'; + + $this->addFile() + ->path('{machine_name}.routing.yml') + ->template('d8/yml/routing.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Services.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Services.php new file mode 100644 index 0000000000000000000000000000000000000000..a0e526131abdcc5301d8f5b5d2ef758fba255f35 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Services.php @@ -0,0 +1,33 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Implements d8:yml:services command. + */ +class Services extends BaseGenerator { + + protected $name = 'd8:yml:services'; + protected $description = 'Generates a services yml file'; + protected $alias = 'services'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions = Utils::defaultQuestions(); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['class'] = Utils::camelize($vars['machine_name']); + + $this->addFile() + ->path('{machine_name}.services.yml') + ->template('d8/yml/services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeInfo.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeInfo.php new file mode 100644 index 0000000000000000000000000000000000000000..f026c821308b205a4f91cae0e2093b9cc58a18c2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeInfo.php @@ -0,0 +1,45 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:theme-info command. + */ +class ThemeInfo extends BaseGenerator { + + protected $name = 'd8:yml:theme-info'; + protected $description = 'Generates a theme info yml file'; + protected $alias = 'theme-info'; + protected $destination = 'themes/%'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['name'] = new Question('Theme name'); + $questions['name']->setValidator([Utils::class, 'validateRequired']); + + $questions['machine_name'] = new Question('Theme machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $questions['base_theme'] = new Question('Base theme', 'classy'); + $questions['base_theme']->setValidator([Utils::class, 'validateMachineName']); + + $questions['description'] = new Question('Description', 'A flexible theme with a responsive, mobile-first layout.'); + + $questions['package'] = new Question('Package', 'Custom'); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.info.yml') + ->template('d8/yml/theme-info.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeLibraries.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeLibraries.php new file mode 100644 index 0000000000000000000000000000000000000000..f77c1488b7598a0bb42c81b5bff81a98189bc0fb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeLibraries.php @@ -0,0 +1,35 @@ +<?php + +namespace DrupalCodeGenerator\Command\Drupal_8\Yml; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements d8:yml:theme-libraries command. + */ +class ThemeLibraries extends BaseGenerator { + + protected $name = 'd8:yml:theme-libraries'; + protected $description = 'Generates theme libraries yml file'; + protected $alias = 'theme-libraries'; + protected $label = 'Libraries (theme)'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['machine_name'] = new Question('Theme machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{machine_name}.libraries.yml') + ->template('d8/yml/theme-libraries.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/GeneratorInterface.php b/vendor/chi-teck/drupal-code-generator/src/Command/GeneratorInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..381201565535ef667623c66f6a654c340a2d3dae --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/GeneratorInterface.php @@ -0,0 +1,71 @@ +<?php + +namespace DrupalCodeGenerator\Command; + +/** + * Defines generator interface. + */ +interface GeneratorInterface { + + /** + * Returns command label. + * + * @return string|null + * A label suitable for navigation command. + */ + public function getLabel(); + + /** + * Returns list of assets to dump. + * + * @return \DrupalCodeGenerator\Asset[] + * An array of assets. + */ + public function getAssets(); + + /** + * Sets working directory. + * + * @param string|null $directory + * The working directory. + */ + public function setDirectory($directory); + + /** + * Returns current working directory. + * + * @return string|null + * The directory. + */ + public function getDirectory(); + + /** + * Sets destination. + * + * @param mixed $destination + * The destination. + */ + public function setDestination($destination); + + /** + * Returns destination. + * + * @return mixed + * The recommended destination for dumped files. + * This value can be handy to determine the nature of the generated code + * (module, theme, etc). The DCG itself does not make use of it when saving + * files because of lack of Drupal context however all its generators have + * this property configured. + * The destination format is as follows: + * - modules (new module) + * - modules/% (existing module) + * - themes (new theme) + * - themes/% (existing theme) + * - profiles (new profile) + * - sites/default + * Note that the paths without leading slash are related to Drupal root + * directory. + */ + public function getDestination(); + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Navigation.php b/vendor/chi-teck/drupal-code-generator/src/Command/Navigation.php new file mode 100644 index 0000000000000000000000000000000000000000..cdd0ddbf3d2de5b2ae67c7843c00052a117d3bbe --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Navigation.php @@ -0,0 +1,292 @@ +<?php + +namespace DrupalCodeGenerator\Command; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Formatter\OutputFormatterStyle; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; + +/** + * Implements generate command. + */ +class Navigation extends Command { + + /** + * Menu tree. + * + * @var array + */ + protected $menuTree; + + /** + * Name of the generator to execute. + * + * @var string + */ + protected $generatorName; + + /** + * Command labels. + * + * @var array + */ + protected $labels = [ + 'd7' => 'Drupal 7', + 'd8' => 'Drupal 8', + ]; + + /** + * Aliases for some sub-menus. + * + * @var array + */ + protected $defaultAliases = [ + 'service' => 'd8:service', + 'plugin' => 'd8:plugin', + 'theme' => 'd8:theme', + 'module' => 'd8:module', + 'form' => 'd8:form', + 'test' => 'd8:test', + 'yml' => 'd8:yml', + 'links' => 'd8:yml:links', + ]; + + /** + * Constructs menu command. + * + * @param \DrupalCodeGenerator\Command\GeneratorInterface[] $commands + * List of registered commands. + */ + public function __construct(array $commands) { + parent::__construct(); + + // Initialize the menu structure. + $this->menuTree = []; + $aliases = array_keys($this->defaultAliases); + + // Build aliases for the navigation based on command namespaces. + foreach ($commands as $command) { + $command_name = $command->getName(); + $sub_names = explode(':', $command_name); + + $this->arraySetNestedValue($this->menuTree, $sub_names, TRUE); + + // The last sub-name is actual command name so it cannot be used as an + // alias for navigation command. + $last_sub_name = array_pop($sub_names); + + // Collect command labels. + if ($label = $command->getLabel()) { + $this->labels[$last_sub_name] = $label; + } + + // We cannot use $application->getNamespaces() here because the + // application is not available at this point. + $alias = ''; + foreach ($sub_names as $sub_name) { + $alias = $alias ? $alias . ':' . $sub_name : $sub_name; + $aliases[] = $alias; + } + } + + $this->setAliases(array_unique($aliases)); + $this->recursiveKsort($this->menuTree); + } + + /** + * {@inheritdoc} + */ + public function getUsages() { + return ['<generator>']; + } + + /** + * {@inheritdoc} + */ + protected function configure() { + $this + ->setName('navigation') + ->setDescription('Provides an interactive menu to select generator') + ->setHelp('Run `dcg list` to check out all available generators.') + ->setHidden(TRUE) + ->addOption( + 'directory', + '-d', + InputOption::VALUE_OPTIONAL, + 'Working directory' + ) + ->addOption( + 'answers', + '-a', + InputOption::VALUE_OPTIONAL, + 'Default JSON formatted answers' + ); + } + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $style = new OutputFormatterStyle('black', 'cyan', []); + $output->getFormatter()->setStyle('title', $style); + + $command_name = $input->getFirstArgument(); + + // Before version 3.3.6 of Symfony console getFistArgument returned default + // command name. + $command_name = $command_name == 'navigation' ? NULL : $command_name; + + if (isset($this->defaultAliases[$command_name])) { + $command_name = $this->defaultAliases[$command_name]; + } + + $menu_trail = $command_name ? explode(':', $command_name) : []; + + $this->generatorName = $this->selectGenerator($input, $output, $menu_trail); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) { + + if (!$this->generatorName) { + return 0; + } + + // Run the generator. + return $this->getApplication() + ->find($this->generatorName) + ->run($input, $output); + } + + /** + * Returns a generator selected by the user from a multilevel console menu. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * Input instance. + * @param \Symfony\Component\Console\Output\OutputInterface $output + * Output instance. + * @param array $menu_trail + * Menu trail. + * + * @return string|null + * Generator name or null if user decided to exit the navigation. + */ + protected function selectGenerator(InputInterface $input, OutputInterface $output, array $menu_trail) { + + // Narrow down menu tree. + $active_menu_tree = $this->menuTree; + foreach ($menu_trail as $active_menu_item) { + $active_menu_tree = $active_menu_tree[$active_menu_item]; + } + + // The $active_menu_tree can be either an array of menu items or TRUE if the + // user reached the final menu point. + if ($active_menu_tree === TRUE) { + return implode(':', $menu_trail); + } + + $sub_menu_labels = $command_labels = []; + foreach ($active_menu_tree as $menu_item => $subtree) { + if (is_array($subtree)) { + $sub_menu_labels[$menu_item] = $this->createMenuItemLabel($menu_item, TRUE); + } + else { + $command_labels[$menu_item] = $this->createMenuItemLabel($menu_item, FALSE); + } + } + asort($sub_menu_labels); + asort($command_labels); + + // Generally the choices array consists of the following parts: + // - Reference to the parent menu level. + // - Sorted list of nested menu levels. + // - Sorted list of commands. + $choices = ['..' => '..'] + $sub_menu_labels + $command_labels; + $question = new ChoiceQuestion('<title> Select generator: </title>', array_values($choices)); + $question->setPrompt(count($choices) <= 10 ? ' ➤➤➤ ' : ' ➤➤➤➤ '); + + $answer_label = $this->getHelper('question')->ask($input, $output, $question); + $answer = array_search($answer_label, $choices); + + if ($answer == '..') { + // Exit the application if the user selected zero on the top menu level. + if (count($menu_trail) == 0) { + return NULL; + } + // Decrease menu level. + array_pop($menu_trail); + } + else { + // Increase menu level. + $menu_trail[] = $answer; + } + + return $this->selectGenerator($input, $output, $menu_trail); + } + + /** + * Creates a human readable label for a given menu item. + * + * @param string $menu_item + * Machine name of the menu item. + * @param bool $comment + * A boolean indicating that the label should be wrapped with comment tag. + * + * @return string + * The menu label. + */ + protected function createMenuItemLabel($menu_item, $comment) { + $label = isset($this->labels[$menu_item]) ? + $this->labels[$menu_item] : str_replace(['-', '_'], ' ', ucfirst($menu_item)); + return $comment ? "<comment>$label</comment>" : $label; + } + + /** + * Sort multi-dimensional array by keys. + * + * @param array $array + * An array being sorted. + * + * @return array + * Sorted array. + */ + protected function recursiveKsort(array &$array) { + foreach ($array as &$value) { + if (is_array($value)) { + $this->recursiveKsort($value); + } + } + return ksort($array); + } + + /** + * Sets a value in a nested array with variable depth. + * + * @param array $array + * A reference to the array to modify. + * @param array $parents + * An array of parent keys, starting with the outermost key. + * @param mixed $value + * The value to set. + * + * @see https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_array_set_nested_value/7 + */ + protected function arraySetNestedValue(array &$array, array $parents, $value) { + $ref = &$array; + foreach ($parents as $parent) { + if (isset($ref) && !is_array($ref)) { + $ref = []; + } + $ref = &$ref[$parent]; + } + if (!isset($ref)) { + $ref = $value; + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Other/ApacheVirtualHost.php b/vendor/chi-teck/drupal-code-generator/src/Command/Other/ApacheVirtualHost.php new file mode 100644 index 0000000000000000000000000000000000000000..e4f4d82cd1e8bfff28db1c089fe55bca96115ae1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Other/ApacheVirtualHost.php @@ -0,0 +1,37 @@ +<?php + +namespace DrupalCodeGenerator\Command\Other; + +use DrupalCodeGenerator\Command\BaseGenerator; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements other:apache-virtual-host command. + */ +class ApacheVirtualHost extends BaseGenerator { + + protected $name = 'other:apache-virtual-host'; + protected $description = 'Generates an Apache site configuration file'; + protected $alias = 'apache-virtual-host'; + protected $destination = '/etc/apache2/sites-available'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions = [ + 'hostname' => new Question('Host name', 'example.com'), + 'docroot' => new Question('Document root', '/var/www/{hostname}/public'), + ]; + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{hostname}.conf') + ->template('other/apache-virtual-host.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Other/DcgCommand.php b/vendor/chi-teck/drupal-code-generator/src/Command/Other/DcgCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..f06f8c7e8d0ba77dc96237c4431c60926777e4de --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Other/DcgCommand.php @@ -0,0 +1,65 @@ +<?php + +namespace DrupalCodeGenerator\Command\Other; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements other:dcg-command command. + */ +class DcgCommand extends BaseGenerator { + + protected $name = 'other:dcg-command'; + protected $description = 'Generates DCG command'; + protected $alias = 'dcg-command'; + protected $label = 'DCG command'; + + /** + * {@inheritdoc} + */ + protected function configure() { + $this->destination = Utils::getHomeDirectory() . '/.dcg/Command'; + parent::configure(); + } + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions = [ + 'name' => new Question('Command name', 'custom:example'), + 'description' => new Question('Command description', 'Some description'), + 'alias' => new Question('Command alias', 'example'), + ]; + + $vars = &$this->collectVars($input, $output, $questions); + + $sub_names = explode(':', $vars['name']); + $last_sub_name = array_pop($sub_names); + $vars['class'] = Utils::camelize($last_sub_name); + $vars['namespace'] = 'DrupalCodeGenerator\Command'; + $vars['template_name'] = $last_sub_name . '.twig'; + + $vars['path'] = ''; + $file_path = ''; + if ($sub_names) { + $vars['namespace'] .= '\\' . implode('\\', $sub_names); + $file_path = implode(DIRECTORY_SEPARATOR, $sub_names); + $vars['path'] = '/' . $file_path; + } + + $this->addFile() + ->path($file_path . '/{class}.php') + ->template('other/dcg-command.twig'); + + $this->addFile() + ->path($file_path . '/{template_name}') + ->template('other/dcg-command-template.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Other/DrupalConsoleCommand.php b/vendor/chi-teck/drupal-code-generator/src/Command/Other/DrupalConsoleCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..8c107c2064ec4fb3b469a148de8aaebd8664bb9c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Other/DrupalConsoleCommand.php @@ -0,0 +1,46 @@ +<?php + +namespace DrupalCodeGenerator\Command\Other; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements other:drupal-console-command command. + */ +class DrupalConsoleCommand extends BaseGenerator { + + protected $name = 'other:drupal-console-command'; + protected $description = 'Generates Drupal Console command'; + protected $alias = 'drupal-console-command'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $questions = Utils::moduleQuestions() + [ + 'command_name' => new Question('Command name', '{machine_name}:example'), + 'description' => new Question('Command description', 'Command description.'), + 'drupal_aware' => new ConfirmationQuestion('Make the command aware of the drupal site installation?', TRUE), + ]; + + $vars = &$this->collectVars($input, $output, $questions); + + $service_short_name = str_replace(':', '_', $vars['command_name']); + $vars['service_name'] = $vars['machine_name'] . '.' . $service_short_name; + $vars['class'] = Utils::camelize($service_short_name) . 'Command'; + $vars['base_class'] = $vars['drupal_aware'] ? 'ContainerAwareCommand' : 'Command'; + + $this->addFile('src/Command/{class}.php') + ->template('other/drupal-console-command.twig'); + + $this->addServicesFile('console.services.yml') + ->template('other/drupal-console-command-services.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Other/DrushCommand.php b/vendor/chi-teck/drupal-code-generator/src/Command/Other/DrushCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..674b2c85020e93813607da8bba76bc71244422c8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Other/DrushCommand.php @@ -0,0 +1,60 @@ +<?php + +namespace DrupalCodeGenerator\Command\Other; + +use DrupalCodeGenerator\Command\BaseGenerator; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements other:drush-command command. + */ +class DrushCommand extends BaseGenerator { + + protected $name = 'other:drush-command'; + protected $description = 'Generates Drush command'; + protected $alias = 'drush-command'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $default_alias = function ($vars) { + return substr($vars['command_name'], 0, 3); + }; + + $default_command_file = function ($vars) { + $directoryBaseName = basename($this->directory); + // The suggestion depends on whether the command global or local. + $prefix = $directoryBaseName == 'drush' || $directoryBaseName == '.drush' ? + $vars['command_name'] : $directoryBaseName; + return str_replace('-', '_', $prefix) . '.drush.inc'; + }; + + $questions = [ + 'command_name' => new Question('Command name', ''), + 'alias' => new Question('Command alias', $default_alias), + 'description' => new Question('Command description', 'Command description.'), + 'argument' => new Question('Argument name', 'foo'), + 'option' => new Question('Option name', 'bar'), + 'command_file' => new Question('Command file', $default_command_file), + ]; + + $vars = &$this->collectVars($input, $output, $questions); + + list($vars['command_file_prefix']) = explode('.drush.inc', $vars['command_file']); + + // Command callback name pattern gets shorter if command file name matches + // command name. + $vars['command_callback_suffix'] = $vars['command_file_prefix'] == str_replace('-', '_', $vars['command_name']) + ? $vars['command_file_prefix'] + : $vars['command_file_prefix'] . '_' . $vars['command_name']; + + $this->addFile() + ->path('{command_file}') + ->template('other/drush-command.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Other/HtmlPage.php b/vendor/chi-teck/drupal-code-generator/src/Command/Other/HtmlPage.php new file mode 100644 index 0000000000000000000000000000000000000000..0dc1518298dd0c9f52796ba9004a92bf2dff6643 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Other/HtmlPage.php @@ -0,0 +1,42 @@ +<?php + +namespace DrupalCodeGenerator\Command\Other; + +use DrupalCodeGenerator\Command\BaseGenerator; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements other:html-page command. + */ +class HtmlPage extends BaseGenerator { + + protected $name = 'other:html-page'; + protected $description = 'Generates a simple html page'; + protected $alias = 'html-page'; + protected $label = 'HTML page'; + protected $destination = FALSE; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + $questions['file_name'] = new Question('File name', 'index.html'); + + $this->collectVars($input, $output, $questions); + + $this->addFile() + ->path('{file_name}') + ->template('other/html.twig'); + + $this->addFile() + ->path('css/main.css') + ->content("body{\n background-color: #EEE;\n}\n"); + + $this->addFile() + ->path('js/main.js') + ->content("console.log('It works!');\n"); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Other/NginxVirtualHost.php b/vendor/chi-teck/drupal-code-generator/src/Command/Other/NginxVirtualHost.php new file mode 100644 index 0000000000000000000000000000000000000000..bca8958b4802fa43f7505bcc50bcb4553ff5639b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Other/NginxVirtualHost.php @@ -0,0 +1,47 @@ +<?php + +namespace DrupalCodeGenerator\Command\Other; + +use DrupalCodeGenerator\Command\BaseGenerator; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements other:nginx-virtual-host command. + */ +class NginxVirtualHost extends BaseGenerator { + + protected $name = 'other:nginx-virtual-host'; + protected $description = 'Generates an Nginx site configuration file'; + protected $alias = 'nginx-virtual-host'; + protected $destination = '/etc/nginx/sites-available'; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + + $socket = PHP_MAJOR_VERSION == 5 + ? '/run/php5-fpm.sock' + : sprintf('/run/php/php%s.%s-fpm.sock', PHP_MAJOR_VERSION, PHP_MINOR_VERSION); + + $questions = [ + 'server_name' => new Question('Server name', 'example.com'), + 'docroot' => new Question('Document root', '/var/www/{server_name}/docroot'), + 'file_public_path' => new Question('Public file system path', 'sites/default/files'), + 'file_private_path' => new Question('Private file system path'), + 'fastcgi_pass' => new Question('Address of a FastCGI server', 'unix:' . $socket), + ]; + + $vars = &$this->collectVars($input, $output, $questions); + + $vars['file_public_path'] = trim($vars['file_public_path'], '/'); + $vars['file_private_path'] = trim($vars['file_private_path'], '/'); + + $this->addFile() + ->path('{server_name}') + ->template('other/nginx-virtual-host.twig'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/GeneratorDiscovery.php b/vendor/chi-teck/drupal-code-generator/src/GeneratorDiscovery.php new file mode 100644 index 0000000000000000000000000000000000000000..31a907ab08ee02988252985c5cc3a12f30a18544 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/GeneratorDiscovery.php @@ -0,0 +1,69 @@ +<?php + +namespace DrupalCodeGenerator; + +use RecursiveDirectoryIterator; +use RecursiveIteratorIterator; +use ReflectionClass; +use Symfony\Component\Filesystem\Filesystem; + +/** + * Discovery of generator commands. + */ +class GeneratorDiscovery { + + const COMMAND_INTERFACE = '\DrupalCodeGenerator\Command\GeneratorInterface'; + + /** + * The file system utility. + * + * @var \Symfony\Component\Filesystem\Filesystem + */ + protected $filesystem; + + /** + * Constructs discovery object. + * + * @param \Symfony\Component\Filesystem\Filesystem $filesystem + * The file system utility. + */ + public function __construct(Filesystem $filesystem) { + $this->filesystem = $filesystem; + } + + /** + * Finds and instantiates generator commands. + * + * @param array $command_directories + * Directories to look up for commands. + * @param string $namespace + * (Optional) The namespace to filter out commands. + * + * @return \Symfony\Component\Console\Command\Command[] + * Array of generators. + */ + public function getGenerators(array $command_directories, $namespace = '\DrupalCodeGenerator\Command') { + $commands = []; + + foreach ($command_directories as $directory) { + $iterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS) + ); + foreach ($iterator as $path => $file) { + if ($file->getExtension() == 'php') { + $relative_path = $this->filesystem->makePathRelative($path, $directory); + $class = $namespace . '\\' . str_replace('/', '\\', preg_replace('#\.php/$#', '', $relative_path)); + if (class_exists($class)) { + $reflected_class = new ReflectionClass($class); + if (!$reflected_class->isInterface() && !$reflected_class->isAbstract() && $reflected_class->implementsInterface(self::COMMAND_INTERFACE)) { + $commands[] = new $class(); + } + } + } + } + } + + return $commands; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/GeneratorTester.php b/vendor/chi-teck/drupal-code-generator/src/GeneratorTester.php new file mode 100644 index 0000000000000000000000000000000000000000..359d0bbdf09c0639a04866404f6de7f121ae959f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/GeneratorTester.php @@ -0,0 +1,188 @@ +<?php + +namespace DrupalCodeGenerator; + +use DrupalCodeGenerator\Tests\QuestionHelper; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Tester\CommandTester; + +/** + * Eases the testing of generator commands. + */ +class GeneratorTester { + + /** + * Command to test. + * + * @var \Symfony\Component\Console\Command\Command + */ + protected $command; + + /** + * Command tester. + * + * @var \Symfony\Component\Console\Tester\CommandTester + */ + protected $commandTester; + + /** + * Working directory. + * + * @var string + */ + protected $directory; + + /** + * An associative array representing an interaction with the generator. + * + * @var array + */ + protected $interaction = []; + + /** + * The fixtures. + * + * @var array + */ + protected $fixtures = []; + + /** + * GeneratorTester constructor. + */ + public function __construct(Command $command) { + $this->command = $command; + $this->commandTester = new CommandTester($this->command); + + $application = ApplicationFactory::create(); + $helper_set = $application->getHelperSet(); + $helper_set->set(new QuestionHelper()); + $application->add($this->command); + + $this->setDirectory(sys_get_temp_dir() . '/dcg_' . uniqid()); + } + + /** + * Getter for the directory. + * + * @return string + * The directory. + */ + public function getDirectory() { + return $this->directory; + } + + /** + * Setter for the directory. + * + * @param string $directory + * The directory. + */ + public function setDirectory($directory) { + $this->directory = $directory; + } + + /** + * Getter for the interaction. + * + * @return array + * The interaction. + */ + public function getInteraction() { + return $this->interaction; + } + + /** + * Setter for the interaction. + * + * @param array $interaction + * The interaction. + */ + public function setInteraction(array $interaction) { + $this->interaction = $interaction; + } + + /** + * Getter for the fixtures. + * + * @return array + * The fixtures. + */ + public function getFixtures() { + return $this->fixtures; + } + + /** + * Setter for the fixtures. + * + * @param array $fixtures + * The fixtures. + */ + public function setFixtures(array $fixtures) { + $this->fixtures = $fixtures; + } + + /** + * Executes the command. + * + * @return int + * The command exit code + */ + public function execute() { + return $this->commandTester + ->setInputs(array_values($this->interaction)) + ->execute(['--directory' => $this->getDirectory()]); + } + + /** + * Gets the display returned by the last execution of the command. + * + * @return string + * The display. + */ + public function getDisplay() { + return $this->commandTester->getDisplay(); + } + + /** + * Gets expected display. + * + * @return string + * Expected display. + */ + public function getExpectedDisplay() { + $default_name = Utils::machine2human(basename($this->directory)); + + $expected_display = "\n"; + $name = $this->command->getName(); + $title = "Welcome to $name generator!"; + $expected_display .= " $title\n"; + $expected_display .= str_repeat('–', strlen($title) + 2) . "\n"; + + foreach ($this->interaction as $question => $answer) { + $question = preg_replace('/^<\d*> /', '', $question); + $expected_display .= "\n"; + $expected_display .= " $question\n"; + // Regular question. + if (strpos($question, "\n") === FALSE) { + $expected_display .= " ➤ \n"; + } + // Choice question. + else { + $expected_display .= " ➤➤➤ \n"; + } + } + + $expected_display = str_replace('%default_name%', $default_name, $expected_display); + $default_machine_name = Utils::human2machine(basename($this->directory)); + $expected_display = str_replace('%default_machine_name%', $default_machine_name, $expected_display); + + $targets = implode("\n • ", array_keys($this->fixtures)); + $expected_display .= "\n"; + $expected_display .= " The following directories and files have been created or updated:\n"; + $expected_display .= "–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––\n"; + $expected_display .= " • $targets\n"; + $expected_display .= "\n"; + return $expected_display; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Helper/Dumper.php b/vendor/chi-teck/drupal-code-generator/src/Helper/Dumper.php new file mode 100644 index 0000000000000000000000000000000000000000..e59ba32a52c6305abb591f3e32c457f2b8d4a428 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Helper/Dumper.php @@ -0,0 +1,186 @@ +<?php + +namespace DrupalCodeGenerator\Helper; + +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Formatter\OutputFormatterStyle; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Filesystem\Filesystem; + +/** + * Output dumper form generators. + */ +class Dumper extends Helper { + + /** + * The file system utility. + * + * @var \Symfony\Component\Filesystem\Filesystem + */ + public $filesystem; + + /** + * Input instance. + * + * @var \Symfony\Component\Console\Input\InputInterface + */ + protected $input; + + /** + * Output instance. + * + * @var \Symfony\Component\Console\Output\OutputInterface + */ + protected $output; + + /** + * Replace flag. + * + * @var bool + */ + protected $replace; + + /** + * Constructs a generator command. + * + * @param \Symfony\Component\Filesystem\Filesystem $filesystem + * The file system utility. + * @param bool $replace + * (optional) Indicates weather or not existing files can be replaced. + */ + public function __construct(Filesystem $filesystem, $replace = NULL) { + $this->filesystem = $filesystem; + $this->replace = $replace; + } + + /** + * {@inheritdoc} + */ + public function getName() { + return 'dcg_dumper'; + } + + /** + * Dumps the generated code to file system. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * Input instance. + * @param \Symfony\Component\Console\Output\OutputInterface $output + * Output instance. + * + * @return array + * List of created or updated files. + */ + public function dump(InputInterface $input, OutputInterface $output) { + $this->input = $input; + $this->output = $output; + $formatter_style = new OutputFormatterStyle('black', 'cyan', []); + $this->output->getFormatter()->setStyle('title', $formatter_style); + + $interactive = $input->isInteractive(); + + // NULL means we should ask user for confirmation. + if ($this->replace !== NULL) { + $input->setInteractive(FALSE); + } + + /** @var \DrupalCodeGenerator\Command\GeneratorInterface $command */ + $command = $this->getHelperSet()->getCommand(); + + $dumped_files = $this->doDump($command->getAssets(), $command->getDirectory()); + + $input->setInteractive($interactive); + return $dumped_files; + } + + /** + * Dumps assets. + * + * @param \DrupalCodeGenerator\Asset[] $assets + * Files to dump. + * @param string $directory + * Directory where to dump the assets. + * + * @return array + * List of created or updated assets. + */ + protected function doDump(array $assets, $directory) { + $dumped_files = []; + + foreach ($assets as $asset) { + + $content = $asset->getContent(); + $path = $asset->getPath(); + + $file_path = "$directory/$path"; + if ($this->filesystem->exists($file_path) && !$asset->isDirectory()) { + $action = $asset->getAction(); + if ($action == 'replace') { + $question_text = sprintf('<info>The file <comment>%s</comment> already exists. Would you like to replace it?</info> [<comment>Yes</comment>]:', $file_path); + if (!$this->confirm($question_text)) { + continue; + } + } + else { + $original_content = file_get_contents($file_path); + if ($action == 'append') { + $header_size = $asset->getHeaderSize(); + // Do not remove header if original file is empty. + if ($original_content && $header_size > 0) { + $content = Utils::removeHeader($content, $header_size); + } + $content = $original_content . "\n" . $content; + } + elseif (is_callable($action)) { + $content = $action($original_content, $content); + } + else { + throw new \LogicException("Unsupported action: $action."); + } + } + } + + // Default mode for all parent directories is 0777. It can be modified by + // changing umask. + $mode = $asset->getMode(); + + // Save data to file system. + if ($asset->isDirectory()) { + $this->filesystem->mkdir([$file_path], $mode); + } + else { + $this->filesystem->dumpFile($file_path, $content); + $this->filesystem->chmod($file_path, $mode); + } + + $dumped_files[] = $asset->getPath(); + } + + return $dumped_files; + } + + /** + * Asks a user for confirmation. + * + * @param string $question_text + * The question to ask to the user. + * + * @return bool + * User confirmation. + */ + protected function confirm($question_text) { + $question_text = "\n $question_text\n ➤ "; + // If the input is not interactive print the question with default answer. + if ($this->replace !== NULL) { + $this->output->writeln($question_text . ($this->replace ? 'Yes' : 'No')); + } + $question = new ConfirmationQuestion($question_text, $this->replace !== FALSE); + /** @var \Symfony\Component\Console\Helper\QuestionHelper $question_helper */ + $question_helper = $this->getHelperSet()->get('question'); + return $question_helper->ask($this->input, $this->output, $question); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Helper/InputHandler.php b/vendor/chi-teck/drupal-code-generator/src/Helper/InputHandler.php new file mode 100644 index 0000000000000000000000000000000000000000..68b1cecb1f52f18dfe6faa3313efb02b18d2c0b6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Helper/InputHandler.php @@ -0,0 +1,184 @@ +<?php + +namespace DrupalCodeGenerator\Helper; + +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Exception\InvalidOptionException; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Generator input handler. + */ +class InputHandler extends Helper { + + use QuestionSettersTrait; + + /** + * {@inheritdoc} + */ + public function getName() { + return 'dcg_input_handler'; + } + + protected $askedQuestions = []; + + /** + * Interacts with the user and returns variables for templates. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * Input instance. + * @param \Symfony\Component\Console\Output\OutputInterface $output + * Output instance. + * @param \Symfony\Component\Console\Question\Question[] $questions + * List of questions that the user should answer. + * @param array $vars + * Array of predefined template variables. + * + * @return array + * Template variables. + */ + public function collectVars(InputInterface $input, OutputInterface $output, array $questions, array $vars = []) { + + // A user can pass answers through the command line option. + $answers = NULL; + if ($answers_raw = $input->getOption('answers')) { + $answers = json_decode($answers_raw, TRUE); + if (!is_array($answers)) { + throw new InvalidOptionException('Answers should be encoded in JSON format.'); + } + } + + /** @var \Symfony\Component\Console\Helper\QuestionHelper $question_helper */ + $question_helper = $this->getHelperSet()->get('question'); + + /** @var \DrupalCodeGenerator\Command\GeneratorInterface $command */ + $command = $this->getHelperSet()->getCommand(); + $directory = $command->getDirectory(); + + foreach ($questions as $name => $question) { + + if (in_array($name, $this->askedQuestions)) { + continue; + } + $this->askedQuestions[] = $name; + + /** @var \Symfony\Component\Console\Question\Question $question */ + $default_value = $question->getDefault(); + + // Make some assumptions based on question name. + if ($default_value === NULL) { + switch ($name) { + case 'name': + $root_directory = basename(Utils::getExtensionRoot($directory) ?: $directory); + $default_value = Utils::machine2human($root_directory); + break; + + case 'machine_name': + $default_value = function (array $vars) use ($directory) { + return Utils::human2machine(isset($vars['name']) ? $vars['name'] : basename($directory)); + }; + break; + } + } + + // Turn the callback into a value acceptable for Symfony question helper. + if (is_callable($default_value)) { + // Do not treat simple strings as callable because they may match PHP + // builtin functions. + if (!is_string($default_value) || strpos('::', $default_value) !== FALSE) { + $default_value = call_user_func($default_value, $vars); + } + } + // Default value may have tokens. + $default_value = Utils::tokenReplace($default_value, $vars); + $this->setQuestionDefault($question, $default_value); + + if ($answers) { + if (array_key_exists($name, $answers)) { + $answer = $answers[$name]; + // Validate provided answer. + if ($validator = $question->getValidator()) { + $validator($answer); + } + // Turn 'yes/no' string into boolean. + if ($question instanceof ConfirmationQuestion && !is_bool($answer)) { + $answer = strcasecmp($answer, 'yes') == 0; + } + } + else { + $answer = $default_value; + } + } + else { + $this->formatQuestionText($question); + $answer = $question_helper->ask($input, $output, $question); + } + + $vars[$name] = $answer; + } + + return $vars; + } + + /** + * Formats question text. + * + * @param \Symfony\Component\Console\Question\Question $question + * The question. + */ + protected function formatQuestionText(Question $question) { + $question_text = $question->getQuestion(); + $default_value = $question->getDefault(); + + $question_text = "\n <info>$question_text</info>"; + if (is_bool($default_value)) { + $default_value = $default_value ? 'Yes' : 'No'; + } + if ($default_value) { + $question_text .= " [<comment>$default_value</comment>]"; + } + $question_text .= ":"; + if ($question instanceof ChoiceQuestion) { + $question->setPrompt(' ➤➤➤ '); + } + else { + $question_text .= "\n ➤ "; + } + + $this->setQuestionText($question, $question_text); + } + + /** + * Normalizes questions. + * + * @param \Symfony\Component\Console\Question\Question[] $questions + * Questions to normalize. + * + * @return \Symfony\Component\Console\Question\Question[] + * Normalized questions + * + * @deprecated + * Use Symfony\Component\Console\Question\Question to define questions. + * + * @codeCoverageIgnore + */ + protected function normalizeQuestions(array $questions) { + return array_map(function ($question) { + // Support array syntax. + if (is_array($question)) { + if (count($question) > 2) { + throw new \OutOfBoundsException('The question array is too long.'); + } + list($question_text, $default_value) = array_pad($question, 2, NULL); + $question = new Question($question_text, $default_value); + } + return $question; + }, $questions); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Helper/OutputHandler.php b/vendor/chi-teck/drupal-code-generator/src/Helper/OutputHandler.php new file mode 100644 index 0000000000000000000000000000000000000000..f0b628c62a80a8180fee6ac45000317fedb1a013 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Helper/OutputHandler.php @@ -0,0 +1,53 @@ +<?php + +namespace DrupalCodeGenerator\Helper; + +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Output printer for generators. + */ +class OutputHandler extends Helper { + + /** + * {@inheritdoc} + */ + public function getName() { + return 'dcg_output_handler'; + } + + /** + * Prints summary. + * + * @param \Symfony\Component\Console\Output\OutputInterface $output + * Output instance. + * @param array $dumped_files + * List of created or updated files. + */ + public function printSummary(OutputInterface $output, array $dumped_files) { + + if (count($dumped_files) > 0) { + // Multiple hooks can be dumped to the same file. + $dumped_files = array_unique($dumped_files); + + usort($dumped_files, function ($a, $b) { + $depth_a = substr_count($a, '/'); + $depth_b = substr_count($b, '/'); + // Top level files should be printed first. + return $depth_a == $depth_b || ($depth_a > 1 && $depth_b > 1) ? + strcmp($a, $b) : ($depth_a > $depth_b ? 1 : -1); + }); + + $output->writeln(''); + $output->writeln(' The following directories and files have been created or updated:'); + $output->writeln('<fg=cyan;options=bold>–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––</>'); + foreach ($dumped_files as $file) { + $output->writeln(" • $file"); + } + $output->writeln(''); + } + + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Helper/QuestionSettersTrait.php b/vendor/chi-teck/drupal-code-generator/src/Helper/QuestionSettersTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..6f4405dcc34953e3a1e67b21918469163a622aff --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Helper/QuestionSettersTrait.php @@ -0,0 +1,48 @@ +<?php + +namespace DrupalCodeGenerator\Helper; + +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\Question; + +/** + * Implements missing Question setters. + */ +trait QuestionSettersTrait { + + /** + * Sets question text. + * + * @param \Symfony\Component\Console\Question\Question $question + * The question to update. + * @param mixed $question_text + * The question text. + */ + protected function setQuestionText(Question $question, $question_text) { + // Choice question has a different constructor signature. + if ($question instanceof ChoiceQuestion) { + $question->__construct($question_text, $question->getChoices(), $question->getDefault()); + } + else { + $question->__construct($question_text, $question->getDefault()); + } + } + + /** + * Sets question default value. + * + * @param \Symfony\Component\Console\Question\Question $question + * The question to update. + * @param mixed $default_value + * Default value for the question. + */ + protected function setQuestionDefault(Question $question, $default_value) { + if ($question instanceof ChoiceQuestion) { + $question->__construct($question->getQuestion(), $question->getChoices(), $default_value); + } + else { + $question->__construct($question->getQuestion(), $default_value); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Helper/Renderer.php b/vendor/chi-teck/drupal-code-generator/src/Helper/Renderer.php new file mode 100644 index 0000000000000000000000000000000000000000..a9256998b1a1c93bc1d763eae097cfdadfa5b6cb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Helper/Renderer.php @@ -0,0 +1,62 @@ +<?php + +namespace DrupalCodeGenerator\Helper; + +use Symfony\Component\Console\Helper\Helper; +use Twig_Environment; + +/** + * Output dumper form generators. + */ +class Renderer extends Helper { + + /** + * The twig environment. + * + * @var \Twig_Environment + */ + protected $twig; + + /** + * Constructs a generator command. + * + * @param \Twig_Environment $twig + * The twig environment. + */ + public function __construct(Twig_Environment $twig) { + $this->twig = $twig; + } + + /** + * {@inheritdoc} + */ + public function getName() { + return 'dcg_renderer'; + } + + /** + * Renders a template. + * + * @param string $template + * Twig template. + * @param array $vars + * Template variables. + * + * @return string + * A string representing the rendered output. + */ + public function render($template, array $vars) { + return $this->twig->render($template, $vars); + } + + /** + * Adds a path where templates are stored. + * + * @param string $path + * A path where to look for templates. + */ + public function addPath($path) { + return $this->twig->getLoader()->addPath($path); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/LegacyUtilsTrait.php b/vendor/chi-teck/drupal-code-generator/src/LegacyUtilsTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..9a66cd49da972003f5b08f70e40a93fa93f4801c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/LegacyUtilsTrait.php @@ -0,0 +1,90 @@ +<?php + +namespace DrupalCodeGenerator; + +/** + * Contains deprecated Utils methods. + */ +trait LegacyUtilsTrait { + + /** + * Returns default questions for module generators. + * + * @return \Symfony\Component\Console\Question\Question[] + * Array of default questions. + * + * @deprecated Use Utils::moduleQuestions(). + */ + public static function defaultQuestions() { + @trigger_error('Utils::defaultQuestions() method is deprecated.', E_USER_DEPRECATED); + return static::moduleQuestions(); + } + + /** + * Returns default questions for plugin generators. + * + * @return \Symfony\Component\Console\Question\Question[] + * Array of default questions. + * + * @deprecated Use Utils::moduleQuestions() and Utils::pluginQuestions(). + */ + public static function defaultPluginQuestions() { + @trigger_error('Utils::defaultPluginQuestions() method is deprecated.', E_USER_DEPRECATED); + $plugin_questions = static::pluginQuestions(); + // Plugin class question wasn't in original method implementation. + unset($plugin_questions['class']); + return static::moduleQuestions() + $plugin_questions; + } + + /** + * Returns normalized file path. + * + * @codeCoverageIgnore + * @deprecated + */ + public static function normalizePath($path) { + $parts = []; + $path = str_replace('\\', '/', $path); + $path = preg_replace('/\/+/', '/', $path); + $segments = explode('/', $path); + foreach ($segments as $segment) { + if ($segment != '.') { + $test = array_pop($parts); + if (is_null($test)) { + $parts[] = $segment; + } + elseif ($segment == '..') { + if ($test == '..') { + $parts[] = $test; + } + if ($test == '..' || $test == '') { + $parts[] = $segment; + } + } + else { + $parts[] = $test; + $parts[] = $segment; + } + } + } + return implode('/', $parts); + } + + /** + * Replaces all tokens in a given string with appropriate values. + * + * @param string $text + * A string potentially containing replaceable tokens. + * @param array $data + * An array where keys are token names and values are replacements. + * + * @return string + * Text with tokens replaced. + * + * @deprecated Use Utils::replaceTokens instead. + */ + public static function tokenReplace($text, array $data) { + return static::replaceTokens($text, $data); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Twig/Twig1Environment.php b/vendor/chi-teck/drupal-code-generator/src/Twig/Twig1Environment.php new file mode 100644 index 0000000000000000000000000000000000000000..36131d76fcb9515f837511d3f2a9dc53df397945 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Twig/Twig1Environment.php @@ -0,0 +1,76 @@ +<?php + +namespace DrupalCodeGenerator\Twig; + +use DrupalCodeGenerator\Utils; +use Twig_SimpleFilter; + +/** + * Stores the Twig configuration. + */ +class Twig1Environment extends \Twig_Environment { + + /** + * Constructs Twig environment object. + * + * @param \Twig_LoaderInterface $loader + * The Twig loader. + */ + public function __construct(\Twig_LoaderInterface $loader) { + parent::__construct($loader); + + $this->addFilter(new Twig_SimpleFilter('plural', [Utils::class, 'pluralize']), ['deprecated' => TRUE]); + + $this->addFilter(new Twig_SimpleFilter('pluralize', [Utils::class, 'pluralize'])); + + $this->addFilter(new Twig_SimpleFilter('article', function ($string) { + $article = in_array(strtolower($string[0]), ['a', 'e', 'i', 'o', 'u']) ? 'an' : 'a'; + return $article . ' ' . $string; + })); + + $this->addFilter(new Twig_SimpleFilter('underscore2hyphen', function ($string) { + // @codeCoverageIgnoreStart + return str_replace('_', '-', $string); + // @codeCoverageIgnoreEnd + }, ['deprecated' => TRUE])); + + $this->addFilter(new Twig_SimpleFilter('hyphen2underscore', function ($string) { + // @codeCoverageIgnoreStart + return str_replace('-', '_', $string); + // @codeCoverageIgnoreEnd + }, ['deprecated' => TRUE])); + + $this->addFilter(new Twig_SimpleFilter('u2h', function ($string) { + return str_replace('_', '-', $string); + })); + + $this->addFilter(new Twig_SimpleFilter('h2u', function ($string) { + return str_replace('-', '_', $string); + })); + + $this->addFilter(new Twig_SimpleFilter('camelize', function ($string, $upper_mode = TRUE) { + return Utils::camelize($string, $upper_mode); + })); + + $this->addTokenParser(new TwigSortTokenParser()); + } + + /** + * {@inheritdoc} + */ + public function tokenize($source, $name = NULL) { + if (!$source instanceof \Twig_Source) { + $source = new \Twig_Source($source, $name); + } + // Remove leading whitespaces to preserve indentation. + // @see https://github.com/twigphp/Twig/issues/1423 + $code = $source->getCode(); + if (strpos($code, '{% verbatim %}') === FALSE) { + $code = preg_replace("/\n +\{%/", "\n{%", $source->getCode()); + } + // Twig source has no setters. + $source = new \Twig_Source($code, $source->getName(), $source->getPath()); + return parent::tokenize($source, $name); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Twig/Twig2Environment.php b/vendor/chi-teck/drupal-code-generator/src/Twig/Twig2Environment.php new file mode 100644 index 0000000000000000000000000000000000000000..1ab16f41638565902cf2475758710d39054ac530 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Twig/Twig2Environment.php @@ -0,0 +1,75 @@ +<?php + +namespace DrupalCodeGenerator\Twig; + +use DrupalCodeGenerator\Utils; +use Twig\Source; +use Twig\TwigFilter; +use Twig\Loader\LoaderInterface; +use Twig\Environment; + +/** + * Stores the Twig configuration. + */ +class Twig2Environment extends Environment { + + /** + * Constructs Twig environment object. + * + * @param \Twig\Loader\LoaderInterface $loader + * The Twig loader. + */ + public function __construct(LoaderInterface $loader) { + parent::__construct($loader); + + $this->addFilter(new TwigFilter('plural', [Utils::class, 'pluralize'], ['deprecated' => TRUE])); + $this->addFilter(new TwigFilter('pluralize', [Utils::class, 'pluralize'])); + + $this->addFilter(new TwigFilter('article', function ($string) { + $article = in_array(strtolower($string[0]), ['a', 'e', 'i', 'o', 'u']) ? 'an' : 'a'; + return $article . ' ' . $string; + })); + + $this->addFilter(new TwigFilter('underscore2hyphen', function ($string) { + // @codeCoverageIgnoreStart + return str_replace('_', '-', $string); + // @codeCoverageIgnoreEnd + }, ['deprecated' => TRUE])); + + $this->addFilter(new TwigFilter('hyphen2underscore', function ($string) { + // @codeCoverageIgnoreStart + return str_replace('-', '_', $string); + // @codeCoverageIgnoreEnd + }, ['deprecated' => TRUE])); + + $this->addFilter(new TwigFilter('u2h', function ($string) { + return str_replace('_', '-', $string); + })); + + $this->addFilter(new TwigFilter('h2u', function ($string) { + return str_replace('-', '_', $string); + })); + + $this->addFilter(new TwigFilter('camelize', function ($string, $upper_mode = TRUE) { + return Utils::camelize($string, $upper_mode); + })); + + $this->addTokenParser(new TwigSortTokenParser()); + } + + /** + * {@inheritdoc} + */ + public function tokenize(Source $source) { + // Remove leading whitespaces to preserve indentation. + // @see https://github.com/twigphp/Twig/issues/1423 + $code = $source->getCode(); + if (strpos($code, '{% verbatim %}') === FALSE) { + $code = preg_replace("/\n +\{%/", "\n{%", $source->getCode()); + } + // Twig source has no setters. + $source = new Source($code, $source->getName(), $source->getPath()); + return parent::tokenize($source); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Twig/TwigSortSetNode.php b/vendor/chi-teck/drupal-code-generator/src/Twig/TwigSortSetNode.php new file mode 100644 index 0000000000000000000000000000000000000000..3d3c95ee18106a801254b2ad5dbda557604d736f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Twig/TwigSortSetNode.php @@ -0,0 +1,27 @@ +<?php + +namespace DrupalCodeGenerator\Twig; + +use Twig_Node; +use Twig_Compiler; + +/** + * A class that defines the compiler for 'sort' token. + */ +class TwigSortSetNode extends Twig_Node { + + /** + * {@inheritdoc} + */ + public function compile(Twig_Compiler $compiler) { + $compiler + ->addDebugInfo($this) + ->write("ob_start();\n") + ->subcompile($this->getNode('body')) + ->write('$data = explode("\n", ob_get_clean());' . "\n") + ->write('$data = array_unique($data);' . "\n") + ->write('sort($data);' . "\n") + ->write('echo ltrim(implode("\n", $data)) . "\n";' . "\n"); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Twig/TwigSortTokenParser.php b/vendor/chi-teck/drupal-code-generator/src/Twig/TwigSortTokenParser.php new file mode 100644 index 0000000000000000000000000000000000000000..d0e09a515fe094c59ac27ab5e7659149067c9b82 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Twig/TwigSortTokenParser.php @@ -0,0 +1,37 @@ +<?php + +namespace DrupalCodeGenerator\Twig; + +use Twig_TokenParser; +use Twig_Token; + +/** + * A class that defines the Twig 'sort' token parser. + */ +class TwigSortTokenParser extends Twig_TokenParser { + + /** + * {@inheritdoc} + */ + public function parse(Twig_Token $token) { + + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse( + function (Twig_Token $token) { + return $token->test('endsort'); + }, + TRUE + ); + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new TwigSortSetNode(['body' => $body], [], $token->getLine(), $this->getTag()); + } + + /** + * {@inheritdoc} + */ + public function getTag() { + return 'sort'; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/Utils.php b/vendor/chi-teck/drupal-code-generator/src/Utils.php new file mode 100644 index 0000000000000000000000000000000000000000..5da145a0fc52cdd22dd3dbfc3f3063431fc578d0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Utils.php @@ -0,0 +1,257 @@ +<?php + +namespace DrupalCodeGenerator; + +use Symfony\Component\Console\Question\Question; + +/** + * Helper methods for code generators. + */ +class Utils { + + use LegacyUtilsTrait; + + /** + * Creates default plugin ID. + */ + public static function defaultPluginId(array $vars) { + return $vars['machine_name'] . '_' . self::human2machine($vars['plugin_label']); + } + + /** + * Transforms a machine name to human name. + */ + public static function machine2human($machine_name) { + return ucfirst(trim(str_replace('_', ' ', $machine_name))); + } + + /** + * Transforms a human name to machine name. + */ + public static function human2machine($human_name) { + return trim(preg_replace( + ['/^[0-9]+/', '/[^a-z0-9_]+/'], + '_', + strtolower($human_name) + ), '_'); + } + + /** + * Transforms a camelized sting to machine name. + */ + public static function camel2machine($input) { + return self::human2machine(preg_replace('/[A-Z]/', ' \0', $input)); + } + + /** + * Camelize a string. + */ + public static function camelize($string, $upper_camel = TRUE) { + $output = preg_replace('/([^A-Z])([A-Z])/', '$1 $2', $string); + $output = strtolower($output); + $output = preg_replace('/[^a-z0-9]/', ' ', $output); + $output = trim($output); + $output = ucwords($output); + $output = str_replace(' ', '', $output); + return $upper_camel ? $output : lcfirst($output); + } + + /** + * Machine name validator. + */ + public static function validateMachineName($value) { + if (!preg_match('/^[a-z][a-z0-9_]*[a-z0-9]$/', $value)) { + throw new \UnexpectedValueException('The value is not correct machine name.'); + } + return $value; + } + + /** + * Class name validator. + * + * @see http://php.net/manual/en/language.oop5.basic.php + */ + public static function validateClassName($value) { + if (!preg_match('/^[A-Z][a-zA-Z0-9]+$/', $value)) { + throw new \UnexpectedValueException('The value is not correct class name.'); + } + return $value; + } + + /** + * Service name validator. + */ + public static function validateServiceName($value) { + if ($value !== '' && !preg_match('/^[a-z][a-z0-9_\.]*[a-z0-9]$/', $value)) { + throw new \UnexpectedValueException('The value is not correct service name.'); + } + return $value; + } + + /** + * Required value validator. + */ + public static function validateRequired($value) { + // FALSE is not considered as empty value because question helper use + // it as negative answer on confirmation questions. + if ($value === NULL || $value === '') { + throw new \UnexpectedValueException('The value is required.'); + } + return $value; + } + + /** + * Returns a validator for allowed options. + * + * @param array $options + * Allowed values. + * + * @return callable + * Question validator. + */ + public static function getOptionsValidator(array $options) { + return function ($value) use ($options) { + if (!in_array($value, $options)) { + $options_formatted = implode(', ', $options); + $error_message = sprintf('The value should be one of the following: %s.', $options_formatted); + throw new \UnexpectedValueException($error_message); + } + return $value; + }; + } + + /** + * Returns default questions for module generators. + * + * @return \Symfony\Component\Console\Question\Question[] + * Array of module questions. + */ + public static function moduleQuestions() { + $questions['name'] = new Question('Module name'); + $questions['name']->setValidator([Utils::class, 'validateRequired']); + $questions['machine_name'] = new Question('Module machine name'); + $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); + return $questions; + } + + /** + * Returns default questions for plugin generators. + * + * @return \Symfony\Component\Console\Question\Question[] + * Array of plugin questions. + */ + public static function pluginQuestions($class_suffix = '') { + $questions['plugin_label'] = new Question('Plugin label', 'Example'); + $questions['plugin_label']->setValidator([Utils::class, 'validateRequired']); + $questions['plugin_id'] = new Question('Plugin ID', [Utils::class, 'defaultPluginId']); + $questions['plugin_id']->setValidator([Utils::class, 'validateMachineName']); + $questions['class'] = static::pluginClassQuestion($class_suffix); + return $questions; + } + + /** + * Creates plugin class question. + */ + public static function pluginClassQuestion($suffix = '') { + $default_class = function ($vars) use ($suffix) { + $unprefixed_plugin_id = preg_replace('/^' . $vars['machine_name'] . '_/', '', $vars['plugin_id']); + return Utils::camelize($unprefixed_plugin_id) . $suffix; + }; + return new Question('Plugin class', $default_class); + } + + /** + * Returns extension root. + * + * @return string|bool + * Extension root directory or false if it was not found. + */ + public static function getExtensionRoot($directory) { + $extension_root = FALSE; + for ($i = 1; $i <= 5; $i++) { + $info_file = $directory . '/' . basename($directory) . '.info'; + if ((file_exists($info_file) && basename($directory) !== 'drush') || file_exists($info_file . '.yml')) { + $extension_root = $directory; + break; + } + $directory = dirname($directory); + } + return $extension_root; + } + + /** + * Removes a given number of lines from the beginning of the string. + */ + public static function removeHeader($content, $header_size) { + return implode("\n", array_slice(explode("\n", $content), $header_size)); + } + + /** + * Return the user's home directory. + */ + public static function getHomeDirectory() { + return isset($_SERVER['HOME']) ? $_SERVER['HOME'] : getenv('HOME'); + } + + /** + * Replaces all tokens in a given string with appropriate values. + * + * @param string $text + * A string potentially containing replaceable tokens. + * @param array $data + * An array where keys are token names and values are replacements. + * + * @return string + * Text with tokens replaced. + */ + public static function replaceTokens($text, array $data) { + $tokens = []; + foreach ($data as $var_name => $var) { + if (is_string($var)) { + $tokens['{' . $var_name . '}'] = $var; + } + } + return str_replace(array_keys($tokens), array_values($tokens), $text); + } + + /** + * Pluralizes a noun. + * + * @param string $string + * A noun to pluralize. + * + * @return string + * The pluralized noun. + */ + public static function pluralize($string) { + switch (substr($string, -1)) { + case 'y': + return substr($string, 0, -1) . 'ies'; + + case 's': + return $string . 'es'; + + default: + return $string . 's'; + } + } + + /** + * Prepares choices. + * + * @param array $raw_choices + * The choices to be prepared. + * + * @return array + * The prepared choices. + */ + public static function prepareChoices(array $raw_choices) { + // The $raw_choices can be an associative array. + $choices = array_values($raw_choices); + // Start choices list form '1'. + array_unshift($choices, NULL); + unset($choices[0]); + return $choices; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/src/bootstrap.php b/vendor/chi-teck/drupal-code-generator/src/bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..78f0049d8c39d43cd7900a65041123d15dc843f4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/bootstrap.php @@ -0,0 +1,46 @@ +<?php + +/** + * @file + * Globals. + */ + +use DrupalCodeGenerator\ApplicationFactory; + +/** + * DCG root. + * + * @deprecated + * Use DrupalCodeGenerator\ApplicationFactory::getRoot + */ +define('DCG_ROOT', dirname(__DIR__)); + +/** + * Creates an application. + * + * @return \Symfony\Component\Console\Application + * The initialized console application. + * + * @deprecated + * Use DrupalCodeGenerator\ApplicationFactory::create + * + * @codeCoverageIgnore + */ +function dcg_create_application() { + return ApplicationFactory::create(); +} + +// Determine major Twig version. +// Twig_Environment::MAJOR_VERSION is not suitable here because of +// https://github.com/twigphp/Twig/pull/2945 +// Use this workaround as drupal/drupal is locked on Twig 1.38. +list($twig_major_version) = sscanf(Twig_Environment::VERSION, '%d.%d.%d'); + +// Twig_Environment::tokenize() signature has been changed in Twig 2, so that +// it is not possible to maintain the same Twig_Environment sub-class for both +// Twig versions. +$twig_environment_class = sprintf('DrupalCodeGenerator\Twig\Twig%dEnvironment', $twig_major_version); +class_alias($twig_environment_class, 'DrupalCodeGenerator\Twig\TwigEnvironment'); + +// Legacy TwigEnvironment class is still used in Drush. +class_alias($twig_environment_class, 'DrupalCodeGenerator\TwigEnvironment'); diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/admin.inc.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/admin.inc.twig new file mode 100644 index 0000000000000000000000000000000000000000..c54d6e03f70950a54bbfe009835ae85857baee51 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/admin.inc.twig @@ -0,0 +1,31 @@ +<?php + +/** + * @file + * Admin page callbacks for the {{ name }} module. + */ + +/** + * Form constructor for the main {{ name }} administration form. + */ +function {{ machine_name }}_settings_form($form, &$form_state) { + + $form['{{ machine_name }}_setting_1'] = array( + '#type' => 'textfield', + '#title' => t('Setting 1'), + '#default_value' => variable_get('{{ machine_name }}_setting_1'), + ); + $form['{{ machine_name }}_setting_2'] = array( + '#type' => 'select', + '#title' => t('Setting 1'), + '#options' => array(t('Option 1'), t('Option 2'), t('Option 3')), + '#default_value' => variable_get('{{ machine_name }}_setting_2'), + ); + $form['{{ machine_name }}_setting_3'] = array( + '#type' => 'checkbox', + '#title' => t('Setting 3'), + '#default_value' => variable_get('{{ machine_name }}_setting_3'), + ); + + return system_settings_form($form); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/access.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/access.twig new file mode 100644 index 0000000000000000000000000000000000000000..5ea49436ae0b740b39803ff3677ad0343773079a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/access.twig @@ -0,0 +1,53 @@ +<?php + +/** + * @file + * {{ plugin_name }} access plugin. + */ + +/** + * Plugin definition. + */ +$plugin = array( + 'single' => TRUE, + 'title' => t('{{ plugin_name }}'), + 'description' => t('{{ description }}'), +{% if context == 'Node' or context == 'User' %} + 'required context' => new ctools_context_required(t('{{ context }}'), '{{ context|lower }}'), +{% elseif context == 'Term' %} + 'required context' => new ctools_context_required(t('{{ context }}'), array('term', 'taxonomy_term')), +{% endif %} + 'category' => t('{{ category }}'), + 'callback' => '{{ machine_name }}_{{ plugin_machine_name }}_access_check', + 'summary' => '{{ machine_name }}_{{ plugin_machine_name }}_access_summary', +); + +/** + * Access callback. + */ +function {{ machine_name }}_{{ plugin_machine_name }}_access_check($conf, $context) { +{% if context != '-' %} + + if (empty($context->data)) { + return; + } +{% endif %} + +{% if context == 'Node' or context == 'Term' %} + ${{ context|lower }} = clone $context->data; + +{% elseif context == 'User' %} +{# Use $account variable avoid confusion with the global $user object #} + $account = clone $context->data; + +{% endif %} + // @TODO: Check access here. + return TRUE; +} + +/** + * Summary callback. + */ +function {{ machine_name }}_{{ plugin_machine_name }}_access_summary($conf, $context) { + return t('Summary placeholder'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/content-type.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/content-type.twig new file mode 100644 index 0000000000000000000000000000000000000000..26a53b973f6a1f82468bebd7b172cbd5541c05c8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/content-type.twig @@ -0,0 +1,52 @@ +<?php + +/** + * @file + * {{ plugin_name }} content type plugin. + */ + +/** + * Plugin definition. + */ +$plugin = array( + 'single' => TRUE, + 'title' => t('{{ plugin_name }}'), + 'description' => t('{{ description }}'), +{% if context == 'Node' or context == 'User' %} + 'required context' => new ctools_context_required(t('{{ context }}'), '{{ context|lower }}'), +{% elseif context == 'Term' %} + 'required context' => new ctools_context_required(t('{{ context }}'), array('term', 'taxonomy_term')), +{% endif %} + 'category' => t('{{ category }}'), + 'render callback' => '{{ machine_name }}_{{ plugin_machine_name }}_content_type_render', +); + +/** + * Render callback. + */ +function {{ machine_name }}_{{ plugin_machine_name }}_content_type_render($subtype, $conf, $panel_args, $context) { +{% if context != '-' %} + + if (empty($context->data)) { + return; + } + +{% endif %} +{% if context == 'Node' or context == 'Term' %} + ${{ context|lower }} = clone $context->data; +{% elseif context == 'User' %} +{# Use $account variable to avoid confusion with the global $user object #} + $account = clone $context->data; +{% endif %} + + // Build pane content. + $build = array( + '#markup' => 'Content placeholder.', + ); + + $block = new stdClass(); + $block->module = '{{ machine_name }}'; + $block->title = t('Title placeholder'); + $block->content = $build; + return $block; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/relationship.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/relationship.twig new file mode 100644 index 0000000000000000000000000000000000000000..bd5fbc2479dae56580f7066ad9b0c8d2208d544a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/relationship.twig @@ -0,0 +1,44 @@ +<?php + +/** + * @file + * {{ plugin_name }} relationship plugin. + */ + +/** + * Plugin definition. + */ +$plugin = array( + 'title' => t('{{ plugin_name }}'), + 'description' => t('{{ description }}'), +{% if context == 'Node' or context == 'User' %} + 'required context' => new ctools_context_required(t('{{ context }}'), '{{ context|lower }}'), +{% elseif context == 'Term' %} + 'required context' => new ctools_context_required(t('{{ context }}'), array('term', 'taxonomy_term')), +{% endif %} + 'context' => '{{ machine_name }}_{{ plugin_machine_name }}_context', +); + +/** +* Returns a new context based on an existing context. + */ +function {{ machine_name }}_{{ plugin_machine_name }}_context($context, $conf) { + + // @TODO: Replace "node" with identifier of the context + // this plugin is meant to provide. + if (empty($context->data)) { + return ctools_context_create_empty('node', NULL); + } + +{% if context == 'Node' or context == 'Term' %} + ${{ context|lower }} = clone $context->data; + +{% elseif context == 'User' %} +{# Use $account variable avoid confusion with the global $user object #} + $account = clone $context->data; + +{% endif %} + // @TODO: Replace this code with your own. + $related_node = node_load(1); + return ctools_context_create('node', $related_node); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/install.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/install.twig new file mode 100644 index 0000000000000000000000000000000000000000..d75b805d8610dd5a572ef9b09f4aca3f9427046e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/install.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Install, update and uninstall functions for the {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/module.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/module.twig new file mode 100644 index 0000000000000000000000000000000000000000..0badaec6f833e0f7abd02d1d94e2c25f5523a5af --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/module.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Primary module hooks for {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/tokens.inc.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/tokens.inc.twig new file mode 100644 index 0000000000000000000000000000000000000000..43668cbdeeb88f7f25e2f95a35f7a5b3f31cf015 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/file-docs/tokens.inc.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Builds tokens for the {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/action_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/action_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..dc44b5bbfca3592298bee2a1746e08404d68f87e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/action_info.twig @@ -0,0 +1,27 @@ +/** + * Implements hook_action_info(). + */ +function {{ machine_name }}_action_info() { + return array( + 'comment_unpublish_action' => array( + 'type' => 'comment', + 'label' => t('Unpublish comment'), + 'configurable' => FALSE, + 'behavior' => array('changes_property'), + 'triggers' => array('comment_presave', 'comment_insert', 'comment_update'), + ), + 'comment_unpublish_by_keyword_action' => array( + 'type' => 'comment', + 'label' => t('Unpublish comment containing keyword(s)'), + 'configurable' => TRUE, + 'behavior' => array('changes_property'), + 'triggers' => array('comment_presave', 'comment_insert', 'comment_update'), + ), + 'comment_save_action' => array( + 'type' => 'comment', + 'label' => t('Save comment'), + 'configurable' => FALSE, + 'triggers' => array('comment_insert', 'comment_update'), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/action_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/action_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..601257c9941947e9570beb36786fac6c7a622c0a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/action_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_action_info_alter(). + */ +function {{ machine_name }}_action_info_alter(&$actions) { + $actions['node_unpublish_action']['label'] = t('Unpublish and remove from public view.'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/actions_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/actions_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..4bcbaba739d3856a8251bc7e7dd8845762efee43 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/actions_delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_actions_delete(). + */ +function {{ machine_name }}_actions_delete($aid) { + db_delete('actions_assignments') + ->condition('aid', $aid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/admin_paths.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/admin_paths.twig new file mode 100644 index 0000000000000000000000000000000000000000..bb7114c9f505096c69465a95afdfe86dd19c60e1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/admin_paths.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_admin_paths(). + */ +function {{ machine_name }}_admin_paths() { + $paths = array( + 'mymodule/*/add' => TRUE, + 'mymodule/*/edit' => TRUE, + ); + return $paths; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/admin_paths_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/admin_paths_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..a66d25be9b058b7fd2abd154084cb907751c7e7d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/admin_paths_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_admin_paths_alter(). + */ +function {{ machine_name }}_admin_paths_alter(&$paths) { + // Treat all user pages as administrative. + $paths['user'] = TRUE; + $paths['user/*'] = TRUE; + // Treat the forum topic node form as a non-administrative page. + $paths['node/add/forum'] = FALSE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_fetch.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_fetch.twig new file mode 100644 index 0000000000000000000000000000000000000000..073e94e9e84e117deac80ece43292831f0238a0c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_fetch.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_aggregator_fetch(). + */ +function {{ machine_name }}_aggregator_fetch($feed) { + $feed->source_string = mymodule_fetch($feed->url); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_fetch_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_fetch_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..0221b47ffc0b640c005549527b36226bc0ca6484 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_fetch_info.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_aggregator_fetch_info(). + */ +function {{ machine_name }}_aggregator_fetch_info() { + return array( + 'title' => t('Default fetcher'), + 'description' => t('Default fetcher for resources available by URL.'), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_parse.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_parse.twig new file mode 100644 index 0000000000000000000000000000000000000000..76c4eef05368f179ee1101971a5adbce0f5246b7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_parse.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_aggregator_parse(). + */ +function {{ machine_name }}_aggregator_parse($feed) { + if ($items = mymodule_parse($feed->source_string)) { + $feed->items = $items; + return TRUE; + } + return FALSE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_parse_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_parse_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..5db7fb17cbb41bc78495d1346b80881c2856ae10 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_parse_info.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_aggregator_parse_info(). + */ +function {{ machine_name }}_aggregator_parse_info() { + return array( + 'title' => t('Default parser'), + 'description' => t('Default parser for RSS, Atom and RDF feeds.'), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_process.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_process.twig new file mode 100644 index 0000000000000000000000000000000000000000..9cd8162439b436ba35eae089010e1bc16f769dfa --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_process.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_aggregator_process(). + */ +function {{ machine_name }}_aggregator_process($feed) { + foreach ($feed->items as $item) { + mymodule_save($item); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_process_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_process_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..695aca2058f6d39035e62d8b16aa6bc72fd24381 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_process_info.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_aggregator_process_info(). + */ +function {{ machine_name }}_aggregator_process_info() { + return array( + 'title' => t('Default processor'), + 'description' => t('Creates lightweight records of feed items.'), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_remove.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_remove.twig new file mode 100644 index 0000000000000000000000000000000000000000..3664e035f56762895c507f8486c7284500b9bdc6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/aggregator_remove.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_aggregator_remove(). + */ +function {{ machine_name }}_aggregator_remove($feed) { + mymodule_remove_items($feed->fid); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/ajax_render_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/ajax_render_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..7d58b733c7fb5a7f3c7d8775a499bd3cfafe8dfa --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/ajax_render_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_ajax_render_alter(). + */ +function {{ machine_name }}_ajax_render_alter(&$commands) { + // Inject any new status messages into the content area. + $commands[] = ajax_command_prepend('#block-system-main .content', theme('status_messages')); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/archiver_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/archiver_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..aea3c5139176dad50baf6ddb1b1c435fdfd473d4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/archiver_info.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_archiver_info(). + */ +function {{ machine_name }}_archiver_info() { + return array( + 'tar' => array( + 'class' => 'ArchiverTar', + 'extensions' => array('tar', 'tar.gz', 'tar.bz2'), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/archiver_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/archiver_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6fc2319187037e361712f858f88fcda1873f7c79 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/archiver_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_archiver_info_alter(). + */ +function {{ machine_name }}_archiver_info_alter(&$info) { + $info['tar']['extensions'][] = 'tgz'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/batch_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/batch_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..3bc30557cdd374676a2c4db118bea9324c548d3c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/batch_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_batch_alter(). + */ +function {{ machine_name }}_batch_alter(&$batch) { + // If the current page request is inside the overlay, add ?render=overlay to + // the success callback URL, so that it appears correctly within the overlay. + if (overlay_get_mode() == 'child') { + if (isset($batch['url_options']['query'])) { + $batch['url_options']['query']['render'] = 'overlay'; + } + else { + $batch['url_options']['query'] = array('render' => 'overlay'); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_cid_parts_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_cid_parts_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..49c13c224b95f393eca64c8074c052df2a30cfa9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_cid_parts_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_block_cid_parts_alter(). + */ +function {{ machine_name }}_block_cid_parts_alter(&$cid_parts, $block) { + global $user; + // This example shows how to cache a block based on the user's timezone. + $cid_parts[] = $user->timezone; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_configure.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_configure.twig new file mode 100644 index 0000000000000000000000000000000000000000..dbf0b710cab7ef585dab7502760dc84c3c2a4e49 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_configure.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_block_configure(). + */ +function {{ machine_name }}_block_configure($delta = '') { + // This example comes from node.module. + $form = array(); + if ($delta == 'recent') { + $form['node_recent_block_count'] = array( + '#type' => 'select', + '#title' => t('Number of recent content items to display'), + '#default_value' => variable_get('node_recent_block_count', 10), + '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)), + ); + } + return $form; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..6d160cd674ec6046985248c51bf50343f100df0d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_info.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_block_info(). + */ +function {{ machine_name }}_block_info() { + // This example comes from node.module. + $blocks['syndicate'] = array( + 'info' => t('Syndicate'), + 'cache' => DRUPAL_NO_CACHE + ); + + $blocks['recent'] = array( + 'info' => t('Recent content'), + // DRUPAL_CACHE_PER_ROLE will be assumed. + ); + + return $blocks; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..fb1d3552aea455e9f8561ab0b67a605057684e8a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_block_info_alter(). + */ +function {{ machine_name }}_block_info_alter(&$blocks, $theme, $code_blocks) { + // Disable the login block. + $blocks['user']['login']['status'] = 0; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_list_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_list_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..858d2887b63a47d7d849e1c32ea267b2202a6f1b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_list_alter.twig @@ -0,0 +1,35 @@ +/** + * Implements hook_block_list_alter(). + */ +function {{ machine_name }}_block_list_alter(&$blocks) { + global $language, $theme_key; + + // This example shows how to achieve language specific visibility setting for + // blocks. + + $result = db_query('SELECT module, delta, language FROM {my_table}'); + $block_languages = array(); + foreach ($result as $record) { + $block_languages[$record->module][$record->delta][$record->language] = TRUE; + } + + foreach ($blocks as $key => $block) { + // Any module using this alter should inspect the data before changing it, + // to ensure it is what they expect. + if (!isset($block->theme) || !isset($block->status) || $block->theme != $theme_key || $block->status != 1) { + // This block was added by a contrib module, leave it in the list. + continue; + } + + if (!isset($block_languages[$block->module][$block->delta])) { + // No language setting for this block, leave it in the list. + continue; + } + + if (!isset($block_languages[$block->module][$block->delta][$language->language])) { + // This block should not be displayed with the active language, remove + // from the list. + unset($blocks[$key]); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_save.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_save.twig new file mode 100644 index 0000000000000000000000000000000000000000..cd9d802ca218fd29e177d88c0da5fccadbdf3bdc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_save.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_block_save(). + */ +function {{ machine_name }}_block_save($delta = '', $edit = array()) { + // This example comes from node.module. + if ($delta == 'recent') { + variable_set('node_recent_block_count', $edit['node_recent_block_count']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..a747b28ebb33d6bf1b2883429873ce150b12def0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view.twig @@ -0,0 +1,33 @@ +/** + * Implements hook_block_view(). + */ +function {{ machine_name }}_block_view($delta = '') { + // This example is adapted from node.module. + $block = array(); + + switch ($delta) { + case 'syndicate': + $block['subject'] = t('Syndicate'); + $block['content'] = array( + '#theme' => 'feed_icon', + '#url' => 'rss.xml', + '#title' => t('Syndicate'), + ); + break; + + case 'recent': + if (user_access('access content')) { + $block['subject'] = t('Recent content'); + if ($nodes = node_get_recent(variable_get('node_recent_block_count', 10))) { + $block['content'] = array( + '#theme' => 'node_recent_block', + '#nodes' => $nodes, + ); + } else { + $block['content'] = t('No content available.'); + } + } + break; + } + return $block; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view_MODULE_DELTA_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view_MODULE_DELTA_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..22238583dc6125fcc77d10a1dcab34e98772f892 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view_MODULE_DELTA_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_block_view_MODULE_DELTA_alter(). + */ +function {{ machine_name }}_block_view_MODULE_DELTA_alter(&$data, $block) { + // This code will only run for a specific block. For example, if MODULE_DELTA + // in the function definition above is set to "mymodule_somedelta", the code + // will only run on the "somedelta" block provided by the "mymodule" module. + + // Change the title of the "somedelta" block provided by the "mymodule" + // module. + $data['subject'] = t('New title of the block'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..2ce776504a1887f17753486906801ffdf7742961 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/block_view_alter.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_block_view_alter(). + */ +function {{ machine_name }}_block_view_alter(&$data, $block) { + // Remove the contextual links on all blocks that provide them. + if (is_array($data['content']) && isset($data['content']['#contextual_links'])) { + unset($data['content']['#contextual_links']); + } + // Add a theme wrapper function defined by the current module to all blocks + // provided by the "somemodule" module. + if (is_array($data['content']) && $block->module == 'somemodule') { + $data['content']['#theme_wrappers'][] = 'mymodule_special_block'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/boot.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/boot.twig new file mode 100644 index 0000000000000000000000000000000000000000..bab9d8b287d9c8fdd9bc9407fa75fcc87edd8f5d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/boot.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_boot(). + */ +function {{ machine_name }}_boot() { + // We need user_access() in the shutdown function. Make sure it gets loaded. + drupal_load('module', 'user'); + drupal_register_shutdown_function('devel_shutdown'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..0021116e4deedc2ce998539bba8cddb2e4a8b4ef --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_delete.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_comment_delete(). + */ +function {{ machine_name }}_comment_delete($comment) { + drupal_set_message(t('Comment: @subject has been deleted', array('@subject' => $comment->subject))); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..1a367476a332daf23260c98e3744c83efbb39281 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_insert.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_comment_insert(). + */ +function {{ machine_name }}_comment_insert($comment) { + // Reindex the node when comments are added. + search_touch_node($comment->nid); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..748fab85f318bcf8d63b23aa8766c74c0243e97a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_load.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_comment_load(). + */ +function {{ machine_name }}_comment_load($comments) { + $result = db_query('SELECT cid, foo FROM {mytable} WHERE cid IN (:cids)', array(':cids' => array_keys($comments))); + foreach ($result as $record) { + $comments[$record->cid]->foo = $record->foo; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..3f51a5725617e2ceb4aa46c2250f0078df4621be --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_presave.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_comment_presave(). + */ +function {{ machine_name }}_comment_presave($comment) { + // Remove leading & trailing spaces from the comment subject. + $comment->subject = trim($comment->subject); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_publish.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_publish.twig new file mode 100644 index 0000000000000000000000000000000000000000..1b63f282af306054b514d08d511c865a5cbcd95f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_publish.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_comment_publish(). + */ +function {{ machine_name }}_comment_publish($comment) { + drupal_set_message(t('Comment: @subject has been published', array('@subject' => $comment->subject))); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_unpublish.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_unpublish.twig new file mode 100644 index 0000000000000000000000000000000000000000..03dcbfbab1c88de642657fa20e8e671c3e3bfaa2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_unpublish.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_comment_unpublish(). + */ +function {{ machine_name }}_comment_unpublish($comment) { + drupal_set_message(t('Comment: @subject has been unpublished', array('@subject' => $comment->subject))); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..e9e025a30c31d82c3aa5a9413420bfe1071d8858 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_update.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_comment_update(). + */ +function {{ machine_name }}_comment_update($comment) { + // Reindex the node when comments are updated. + search_touch_node($comment->nid); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..4cd40991d8b07d13438b175020afc3f9697f70ca --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_view.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_comment_view(). + */ +function {{ machine_name }}_comment_view($comment, $view_mode, $langcode) { + // how old is the comment + $comment->time_ago = time() - $comment->changed; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d486a042520e8d72bc890b58eb387fad5770dabe --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_view_alter.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_comment_view_alter(). + */ +function {{ machine_name }}_comment_view_alter(&$build) { + // Check for the existence of a field added by another module. + if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { + // Change its weight. + $build['an_additional_field']['#weight'] = -10; + } + + // Add a #post_render callback to act on the rendered HTML of the comment. + $build['#post_render'][] = 'my_module_comment_post_render'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/contextual_links_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/contextual_links_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..68bacd9e911c3c09a852aac7761003bd4717c672 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/contextual_links_view_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_contextual_links_view_alter(). + */ +function {{ machine_name }}_contextual_links_view_alter(&$element, $items) { + // Add another class to all contextual link lists to facilitate custom + // styling. + $element['#attributes']['class'][] = 'custom-class'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/countries_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/countries_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..bff6dfa06d05eb84fb03724747c48f7d82bea34f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/countries_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_countries_alter(). + */ +function {{ machine_name }}_countries_alter(&$countries) { + // Elbonia is now independent, so add it to the country list. + $countries['EB'] = 'Elbonia'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron.twig new file mode 100644 index 0000000000000000000000000000000000000000..16e90ed4a5e1f4d2bbd1befaa6395c1f78aab6d1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron.twig @@ -0,0 +1,23 @@ +/** + * Implements hook_cron(). + */ +function {{ machine_name }}_cron() { + // Short-running operation example, not using a queue: + // Delete all expired records since the last cron run. + $expires = variable_get('mymodule_cron_last_run', REQUEST_TIME); + db_delete('mymodule_table') + ->condition('expires', $expires, '>=') + ->execute(); + variable_set('mymodule_cron_last_run', REQUEST_TIME); + + // Long-running operation example, leveraging a queue: + // Fetch feeds from other sites. + $result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < :time AND refresh <> :never', array( + ':time' => REQUEST_TIME, + ':never' => AGGREGATOR_CLEAR_NEVER, + )); + $queue = DrupalQueue::get('aggregator_feeds'); + foreach ($result as $feed) { + $queue->createItem($feed); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron_queue_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron_queue_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..b1e5fcb3f6bbde00b242f44f4b3b3e665a236076 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron_queue_info.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_cron_queue_info(). + */ +function {{ machine_name }}_cron_queue_info() { + $queues['aggregator_feeds'] = array( + 'worker callback' => 'aggregator_refresh', + 'time' => 60, + ); + return $queues; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron_queue_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron_queue_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..e725c7afe30e2571e2474eeee8e1a531185cc331 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/cron_queue_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_cron_queue_info_alter(). + */ +function {{ machine_name }}_cron_queue_info_alter(&$queues) { + // This site has many feeds so let's spend 90 seconds on each cron run + // updating feeds instead of the default 60. + $queues['aggregator_feeds']['time'] = 90; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/css_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/css_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..20a2c7bb6fcdb647ad9d40acdf2152623e159bd2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/css_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_css_alter(). + */ +function {{ machine_name }}_css_alter(&$css) { + // Remove defaults.css file. + unset($css[drupal_get_path('module', 'system') . '/defaults.css']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/custom_theme.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/custom_theme.twig new file mode 100644 index 0000000000000000000000000000000000000000..c9728a369a60f27c0e873611168e37ba6d4860df --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/custom_theme.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_custom_theme(). + */ +function {{ machine_name }}_custom_theme() { + // Allow the user to request a particular theme via a query parameter. + if (isset($_GET['theme'])) { + return $_GET['theme']; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/dashboard_regions.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/dashboard_regions.twig new file mode 100644 index 0000000000000000000000000000000000000000..eb21073ea9bd76b6e72e6b10959f62205b6495cc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/dashboard_regions.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_dashboard_regions(). + */ +function {{ machine_name }}_dashboard_regions() { + // Define a new dashboard region. Your module can also then define + // theme_mymodule_dashboard_region() as a theme wrapper function to control + // the region's appearance. + return array('mymodule_dashboard_region' => "My module's dashboard region"); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/dashboard_regions_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/dashboard_regions_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f7bfa5133da3f88855e4c409637bade3e1084de6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/dashboard_regions_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_dashboard_regions_alter(). + */ +function {{ machine_name }}_dashboard_regions_alter(&$regions) { + // Remove the sidebar region defined by the core dashboard module. + unset($regions['dashboard_sidebar']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_format_types.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_format_types.twig new file mode 100644 index 0000000000000000000000000000000000000000..3cd5b8db09dbbf5e5a535ec79321220777c5a37d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_format_types.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_date_format_types(). + */ +function {{ machine_name }}_date_format_types() { + // Define the core date format types. + return array( + 'long' => t('Long'), + 'medium' => t('Medium'), + 'short' => t('Short'), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_format_types_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_format_types_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..789b579f122b0b4ad1e8b56137e5d42e6733c866 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_format_types_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_date_format_types_alter(). + */ +function {{ machine_name }}_date_format_types_alter(&$types) { + foreach ($types as $name => $type) { + $types[$name]['locked'] = 1; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_formats.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_formats.twig new file mode 100644 index 0000000000000000000000000000000000000000..03a92a428f21777b8d76f317873c04920249cb61 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_formats.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_date_formats(). + */ +function {{ machine_name }}_date_formats() { + return array( + array( + 'type' => 'mymodule_extra_long', + 'format' => 'l jS F Y H:i:s e', + 'locales' => array('en-ie'), + ), + array( + 'type' => 'mymodule_extra_long', + 'format' => 'l jS F Y h:i:sa', + 'locales' => array('en', 'en-us'), + ), + array( + 'type' => 'short', + 'format' => 'F Y', + 'locales' => array(), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_formats_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_formats_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..fdfd4aad8fdd52c249560ec03c9abd09930a89ae --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/date_formats_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_date_formats_alter(). + */ +function {{ machine_name }}_date_formats_alter(&$formats) { + foreach ($formats as $id => $format) { + $formats[$id]['locales'][] = 'en-ca'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..f8de1ad1abb375c66cf14892d9819a1aaf4d5d8a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_delete(). + */ +function {{ machine_name }}_delete($node) { + db_delete('mytable') + ->condition('nid', $node->nid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/disable.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/disable.twig new file mode 100644 index 0000000000000000000000000000000000000000..8fe8269dbb5850a23f5bf89a7f1eafd2e1e8cf02 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/disable.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_disable(). + */ +function {{ machine_name }}_disable() { + mymodule_cache_rebuild(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/drupal_goto_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/drupal_goto_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d8785d4a88ed8343e01473620521c34ff88e2e51 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/drupal_goto_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_drupal_goto_alter(). + */ +function {{ machine_name }}_drupal_goto_alter(&$path, &$options, &$http_response_code) { + // A good addition to misery module. + $http_response_code = 500; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/element_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/element_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..5e58e980473b7069c00433e4a50e43f1445ac145 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/element_info.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_element_info(). + */ +function {{ machine_name }}_element_info() { + $types['filter_format'] = array( + '#input' => TRUE, + ); + return $types; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/element_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/element_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..43d1cf12efd754824313efbee09f48fe7545bde9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/element_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_element_info_alter(). + */ +function {{ machine_name }}_element_info_alter(&$type) { + // Decrease the default size of textfields. + if (isset($type['textfield']['#size'])) { + $type['textfield']['#size'] = 40; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/enable.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/enable.twig new file mode 100644 index 0000000000000000000000000000000000000000..a86432d7cee7ad4348a06783ec357f9b13bafb5a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/enable.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_enable(). + */ +function {{ machine_name }}_enable() { + mymodule_cache_rebuild(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..82c01594d21650ba439a866dbc3c3aa0e2076a2d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_delete.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_entity_delete(). + */ +function {{ machine_name }}_entity_delete($entity, $type) { + // Delete the entity's entry from a fictional table of all entities. + $info = entity_get_info($type); + list($id) = entity_extract_ids($type, $entity); + db_delete('example_entity') + ->condition('type', $type) + ->condition('id', $id) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..ffa0ca1335f0172d64cfbbbcc55c8f2fca983c11 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_info.twig @@ -0,0 +1,73 @@ +/** + * Implements hook_entity_info(). + */ +function {{ machine_name }}_entity_info() { + $return = array( + 'node' => array( + 'label' => t('Node'), + 'controller class' => 'NodeController', + 'base table' => 'node', + 'revision table' => 'node_revision', + 'uri callback' => 'node_uri', + 'fieldable' => TRUE, + 'translation' => array( + 'locale' => TRUE, + ), + 'entity keys' => array( + 'id' => 'nid', + 'revision' => 'vid', + 'bundle' => 'type', + 'language' => 'language', + ), + 'bundle keys' => array( + 'bundle' => 'type', + ), + 'bundles' => array(), + 'view modes' => array( + 'full' => array( + 'label' => t('Full content'), + 'custom settings' => FALSE, + ), + 'teaser' => array( + 'label' => t('Teaser'), + 'custom settings' => TRUE, + ), + 'rss' => array( + 'label' => t('RSS'), + 'custom settings' => FALSE, + ), + ), + ), + ); + + // Search integration is provided by node.module, so search-related + // view modes for nodes are defined here and not in search.module. + if (module_exists('search')) { + $return['node']['view modes'] += array( + 'search_index' => array( + 'label' => t('Search index'), + 'custom settings' => FALSE, + ), + 'search_result' => array( + 'label' => t('Search result highlighting input'), + 'custom settings' => FALSE, + ), + ); + } + + // Bundles must provide a human readable name so we can create help and error + // messages, and the path to attach Field admin pages to. + foreach (node_type_get_names() as $type => $name) { + $return['node']['bundles'][$type] = array( + 'label' => $name, + 'admin' => array( + 'path' => 'admin/structure/types/manage/%node_type', + 'real path' => 'admin/structure/types/manage/' . str_replace('_', '-', $type), + 'bundle argument' => 4, + 'access arguments' => array('administer content types'), + ), + ); + } + + return $return; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c89b6b4f5c34ddb892ca250ae26ae3d7f1a6823f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_entity_info_alter(). + */ +function {{ machine_name }}_entity_info_alter(&$entity_info) { + // Set the controller class for nodes to an alternate implementation of the + // DrupalEntityController interface. + $entity_info['node']['controller class'] = 'MyCustomNodeController'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..261e3079750d2c5f56bbdef2c9c5308a01f79591 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_insert.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_entity_insert(). + */ +function {{ machine_name }}_entity_insert($entity, $type) { + // Insert the new entity into a fictional table of all entities. + $info = entity_get_info($type); + list($id) = entity_extract_ids($type, $entity); + db_insert('example_entity') + ->fields(array( + 'type' => $type, + 'id' => $id, + 'created' => REQUEST_TIME, + 'updated' => REQUEST_TIME, + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..a5014723addb29851aca7fd338479b844d064f2a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_load.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_entity_load(). + */ +function {{ machine_name }}_entity_load($entities, $type) { + foreach ($entities as $entity) { + $entity->foo = mymodule_add_something($entity, $type); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_prepare_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_prepare_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..2ec0a2c94a21c0b11bbeac073e6d4ab6b40c339e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_prepare_view.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_entity_prepare_view(). + */ +function {{ machine_name }}_entity_prepare_view($entities, $type, $langcode) { + // Load a specific node into the user object for later theming. + if ($type == 'user') { + $nodes = mymodule_get_user_nodes(array_keys($entities)); + foreach ($entities as $uid => $entity) { + $entity->user_node = $nodes[$uid]; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..c1d065542c77c86bb907750301a1877e2327efed --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_presave.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_entity_presave(). + */ +function {{ machine_name }}_entity_presave($entity, $type) { + $entity->changed = REQUEST_TIME; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_query_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_query_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d6380aa25fc925eb3d113b57565f41e3e6770589 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_query_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_entity_query_alter(). + */ +function {{ machine_name }}_entity_query_alter($query) { + $query->executeCallback = 'my_module_query_callback'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..7b32e3ad51512da4bdb46e3d1c9f018a7c4a419a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_update.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_entity_update(). + */ +function {{ machine_name }}_entity_update($entity, $type) { + // Update the entity's entry in a fictional table of all entities. + $info = entity_get_info($type); + list($id) = entity_extract_ids($type, $entity); + db_update('example_entity') + ->fields(array( + 'updated' => REQUEST_TIME, + )) + ->condition('type', $type) + ->condition('id', $id) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..0d191b882c1fbf4858409530955a1ddd95c21ecb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_entity_view(). + */ +function {{ machine_name }}_entity_view($entity, $type, $view_mode, $langcode) { + $entity->content['my_additional_field'] = array( + '#markup' => $additional_field, + '#weight' => 10, + '#theme' => 'mymodule_my_additional_field', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..465a12a1f4c4a365680e7006edb93d8539f10d6f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_entity_view_alter(). + */ +function {{ machine_name }}_entity_view_alter(&$build, $type) { + if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { + // Change its weight. + $build['an_additional_field']['#weight'] = -10; + + // Add a #post_render callback to act on the rendered HTML of the entity. + $build['#post_render'][] = 'my_module_node_post_render'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view_mode_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view_mode_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c9e2cb719277dd4c3341302a130cf66b6380d43d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/entity_view_mode_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_view_mode_alter(). + */ +function {{ machine_name }}_entity_view_mode_alter(&$view_mode, $context) { + // For nodes, change the view mode when it is teaser. + if ($context['entity_type'] == 'node' && $view_mode == 'teaser') { + $view_mode = 'my_custom_view_mode'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/exit.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/exit.twig new file mode 100644 index 0000000000000000000000000000000000000000..0839b204267129fc5cddc2f141d5167f853309d7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/exit.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_exit(). + */ +function {{ machine_name }}_exit($destination = NULL) { + db_update('counter') + ->expression('hits', 'hits + 1') + ->condition('type', 1) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..1d5ec7daf9ccdd060163c3041be5e0d925d3c12d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_access.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_access(). + */ +function {{ machine_name }}_field_access($op, $field, $entity_type, $entity, $account) { + if ($field['field_name'] == 'field_of_interest' && $op == 'edit') { + return user_access('edit field of interest', $account); + } + return TRUE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_create_bundle.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_create_bundle.twig new file mode 100644 index 0000000000000000000000000000000000000000..85d27310e35722607f607f08b3e79dddaf811c94 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_create_bundle.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_field_attach_create_bundle(). + */ +function {{ machine_name }}_field_attach_create_bundle($entity_type, $bundle) { + // When a new bundle is created, the menu needs to be rebuilt to add the + // Field UI menu item tabs. + variable_set('menu_rebuild_needed', TRUE); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..dc0e57d2df913b3d78b85e80276e4f7613a8577d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_attach_delete(). + */ +function {{ machine_name }}_field_attach_delete($entity_type, $entity) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete_bundle.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete_bundle.twig new file mode 100644 index 0000000000000000000000000000000000000000..9a9ce948f041423ebace871b2e109bd562b5bee8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete_bundle.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_attach_delete_bundle(). + */ +function {{ machine_name }}_field_attach_delete_bundle($entity_type, $bundle, $instances) { + // Remove the extra weights variable information for this bundle. + $extra_weights = variable_get('field_extra_weights', array()); + if (isset($extra_weights[$entity_type][$bundle])) { + unset($extra_weights[$entity_type][$bundle]); + variable_set('field_extra_weights', $extra_weights); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete_revision.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete_revision.twig new file mode 100644 index 0000000000000000000000000000000000000000..c9faea500bd9e4d6940b82df96aec73193dba4d8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_delete_revision.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_attach_delete_revision(). + */ +function {{ machine_name }}_field_attach_delete_revision($entity_type, $entity) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..a8cacbd4d260a691d911da50f9fb454e9e9ca55a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_form.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_attach_form(). + */ +function {{ machine_name }}_field_attach_form($entity_type, $entity, &$form, &$form_state, $langcode) { + // Add a checkbox allowing a given field to be emptied. + // See hook_field_attach_submit() for the corresponding processing code. + $form['empty_field_foo'] = array( + '#type' => 'checkbox', + '#title' => t("Empty the 'field_foo' field"), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..1d1add2174f3292eeef0474d052ad419d8f13293 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_insert.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_attach_insert(). + */ +function {{ machine_name }}_field_attach_insert($entity_type, $entity) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..3f97fa63c243924d7cd5dc8e6e6e1744e44f56eb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_load.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_attach_load(). + */ +function {{ machine_name }}_field_attach_load($entity_type, $entities, $age, $options) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_prepare_translation_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_prepare_translation_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..81f32aef8fe0209fd763097dc787453d201742c6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_prepare_translation_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_field_attach_prepare_translation_alter(). + */ +function {{ machine_name }}_field_attach_prepare_translation_alter(&$entity, $context) { + if ($context['entity_type'] == 'custom_entity_type') { + $entity->custom_field = $context['source_entity']->custom_field; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_preprocess_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_preprocess_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..604e7f2e300f3d073f0bb4d311cf2f4d7435afbc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_preprocess_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_attach_preprocess_alter(). + */ +function {{ machine_name }}_field_attach_preprocess_alter(&$variables, $context) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..4ff40525ec210339b4b6eb4140d18e60c530a4e1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_presave.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_attach_presave(). + */ +function {{ machine_name }}_field_attach_presave($entity_type, $entity) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_purge.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_purge.twig new file mode 100644 index 0000000000000000000000000000000000000000..dfb0425d04000c4d0446b43e46434129722ff7fb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_purge.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_attach_purge(). + */ +function {{ machine_name }}_field_attach_purge($entity_type, $entity, $field, $instance) { + // find the corresponding data in mymodule and purge it + if ($entity_type == 'node' && $field->field_name == 'my_field_name') { + mymodule_remove_mydata($entity->nid); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_rename_bundle.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_rename_bundle.twig new file mode 100644 index 0000000000000000000000000000000000000000..5fea27dc5755a9e8ca8bc6270cdf6df85a8bb546 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_rename_bundle.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_field_attach_rename_bundle(). + */ +function {{ machine_name }}_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) { + // Update the extra weights variable with new information. + if ($bundle_old !== $bundle_new) { + $extra_weights = variable_get('field_extra_weights', array()); + if (isset($info[$entity_type][$bundle_old])) { + $extra_weights[$entity_type][$bundle_new] = $extra_weights[$entity_type][$bundle_old]; + unset($extra_weights[$entity_type][$bundle_old]); + variable_set('field_extra_weights', $extra_weights); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_submit.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_submit.twig new file mode 100644 index 0000000000000000000000000000000000000000..737e235bc3d181840f29da9a7a3234e8d892fde1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_submit.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_attach_submit(). + */ +function {{ machine_name }}_field_attach_submit($entity_type, $entity, $form, &$form_state) { + // Sample case of an 'Empty the field' checkbox added on the form, allowing + // a given field to be emptied. + $values = drupal_array_get_nested_value($form_state['values'], $form['#parents']); + if (!empty($values['empty_field_foo'])) { + unset($entity->field_foo); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..c8c2e42ef4062245198af42c7a6c61e36c0be8f5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_update.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_attach_update(). + */ +function {{ machine_name }}_field_attach_update($entity_type, $entity) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_validate.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_validate.twig new file mode 100644 index 0000000000000000000000000000000000000000..31ba83898691a8747083c89b819299a38a18b9f3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_validate.twig @@ -0,0 +1,18 @@ +/** + * Implements hook_field_attach_validate(). + */ +function {{ machine_name }}_field_attach_validate($entity_type, $entity, &$errors) { + // Make sure any images in article nodes have an alt text. + if ($entity_type == 'node' && $entity->type == 'article' && !empty($entity->field_image)) { + foreach ($entity->field_image as $langcode => $items) { + foreach ($items as $delta => $item) { + if (!empty($item['fid']) && empty($item['alt'])) { + $errors['field_image'][$langcode][$delta][] = array( + 'error' => 'field_example_invalid', + 'message' => t('All images in articles need to have an alternative text set.'), + ); + } + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f060e66e29a7e67849087d8c67a075dd68b8388a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_view_alter.twig @@ -0,0 +1,20 @@ +/** + * Implements hook_field_attach_view_alter(). + */ +function {{ machine_name }}_field_attach_view_alter(&$output, $context) { + // Append RDF term mappings on displayed taxonomy links. + foreach (element_children($output) as $field_name) { + $element = &$output[$field_name]; + if ($element['#field_type'] == 'taxonomy_term_reference' && $element['#formatter'] == 'taxonomy_term_reference_link') { + foreach ($element['#items'] as $delta => $item) { + $term = $item['taxonomy_term']; + if (!empty($term->rdf_mapping['rdftype'])) { + $element[$delta]['#options']['attributes']['typeof'] = $term->rdf_mapping['rdftype']; + } + if (!empty($term->rdf_mapping['name']['predicates'])) { + $element[$delta]['#options']['attributes']['property'] = $term->rdf_mapping['name']['predicates']; + } + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_available_languages_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_available_languages_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..85236bf90246767f8c9f493729fd8c431976d45d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_available_languages_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_available_languages_alter(). + */ +function {{ machine_name }}_field_available_languages_alter(&$languages, $context) { + // Add an unavailable language. + $languages[] = 'xx'; + + // Remove an available language. + $index = array_search('yy', $languages); + unset($languages[$index]); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_create_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_create_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..3df86bbdf1f1db5dfad746a69c6b04b8add0d987 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_create_field.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_create_field(). + */ +function {{ machine_name }}_field_create_field($field) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_create_instance.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_create_instance.twig new file mode 100644 index 0000000000000000000000000000000000000000..b67a157d1843cfaee7e006de8ccad5237b26ac04 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_create_instance.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_create_instance(). + */ +function {{ machine_name }}_field_create_instance($instance) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..807301a8b8d4b1c46f0dd0ba92dbfb35387830d5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_field_delete(). + */ +function {{ machine_name }}_field_delete($entity_type, $entity, $field, $instance, $langcode, &$items) { + list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); + foreach ($items as $delta => $item) { + // For hook_file_references(), remember that this is being deleted. + $item['file_field_name'] = $field['field_name']; + // Pass in the ID of the object that is being removed so all references can + // be counted in hook_file_references(). + $item['file_field_type'] = $entity_type; + $item['file_field_id'] = $id; + file_field_delete_file($item, $field, $entity_type, $id); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..24c042c77d81c5d3ba3ba37a609ec5f74f94c7e1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_field.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_delete_field(). + */ +function {{ machine_name }}_field_delete_field($field) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_instance.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_instance.twig new file mode 100644 index 0000000000000000000000000000000000000000..b431828f5797e45062c1dadd2bce580fe002800f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_instance.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_delete_instance(). + */ +function {{ machine_name }}_field_delete_instance($instance) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_revision.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_revision.twig new file mode 100644 index 0000000000000000000000000000000000000000..bbc0a5bf2281af1c13406d12b1db6c15e04a1092 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_delete_revision.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_field_delete_revision(). + */ +function {{ machine_name }}_field_delete_revision($entity_type, $entity, $field, $instance, $langcode, &$items) { + list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); + foreach ($items as $delta => $item) { + // For hook_file_references, remember that this file is being deleted. + $item['file_field_name'] = $field['field_name']; + if (file_field_delete_file($item, $field, $entity_type, $id)) { + $items[$delta] = NULL; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_display_ENTITY_TYPE_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_display_ENTITY_TYPE_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9c8397208f7b9c79878277820d9491e59b7531e0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_display_ENTITY_TYPE_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_display_ENTITY_TYPE_alter(). + */ +function {{ machine_name }}_field_display_ENTITY_TYPE_alter(&$display, $context) { + // Leave field labels out of the search index. + if ($context['view_mode'] == 'search_index') { + $display['label'] = 'hidden'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_display_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_display_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..df86471354205bde75352bea806dd5b04208ee85 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_display_alter.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_field_display_alter(). + */ +function {{ machine_name }}_field_display_alter(&$display, $context) { + // Leave field labels out of the search index. + // Note: The check against $context['entity_type'] == 'node' could be avoided + // by using hook_field_display_node_alter() instead of + // hook_field_display_alter(), resulting in less function calls when + // rendering non-node entities. + if ($context['entity_type'] == 'node' && $context['view_mode'] == 'search_index') { + $display['label'] = 'hidden'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields.twig new file mode 100644 index 0000000000000000000000000000000000000000..d8376bc76528f3c1e35fd15931112b8d6a666d25 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields.twig @@ -0,0 +1,33 @@ +/** + * Implements hook_field_extra_fields(). + */ +function {{ machine_name }}_field_extra_fields() { + $extra['node']['poll'] = array( + 'form' => array( + 'choice_wrapper' => array( + 'label' => t('Poll choices'), + 'description' => t('Poll choices'), + 'weight' => -4, + ), + 'settings' => array( + 'label' => t('Poll settings'), + 'description' => t('Poll module settings'), + 'weight' => -3, + ), + ), + 'display' => array( + 'poll_view_voting' => array( + 'label' => t('Poll vote'), + 'description' => t('Poll vote'), + 'weight' => 0, + ), + 'poll_view_results' => array( + 'label' => t('Poll results'), + 'description' => t('Poll results'), + 'weight' => 0, + ), + ) + ); + + return $extra; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..db1e5255094e5c62eb79cbc50481e045d429753a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_extra_fields_alter(). + */ +function {{ machine_name }}_field_extra_fields_alter(&$info) { + // Force node title to always be at the top of the list by default. + foreach (node_type_get_types() as $bundle) { + if (isset($info['node'][$bundle->type]['form']['title'])) { + $info['node'][$bundle->type]['form']['title']['weight'] = -20; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields_display_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields_display_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..e78ca6766086f4dc36a0b7d8dd36d17d01cbf48e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields_display_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_field_extra_fields_display_alter(). + */ +function {{ machine_name }}_field_extra_fields_display_alter(&$displays, $context) { + if ($context['entity_type'] == 'taxonomy_term' && $context['view_mode'] == 'full') { + $displays['description']['visible'] = FALSE; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..cdb2ef0887b57442644f27de9d1e7f097b929e84 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_info.twig @@ -0,0 +1,34 @@ +/** + * Implements hook_field_formatter_info(). + */ +function {{ machine_name }}_field_formatter_info() { + return array( + 'text_default' => array( + 'label' => t('Default'), + 'field types' => array('text', 'text_long', 'text_with_summary'), + ), + 'text_plain' => array( + 'label' => t('Plain text'), + 'field types' => array('text', 'text_long', 'text_with_summary'), + ), + + // The text_trimmed formatter displays the trimmed version of the + // full element of the field. It is intended to be used with text + // and text_long fields. It also works with text_with_summary + // fields though the text_summary_or_trimmed formatter makes more + // sense for that field type. + 'text_trimmed' => array( + 'label' => t('Trimmed'), + 'field types' => array('text', 'text_long', 'text_with_summary'), + ), + + // The 'summary or trimmed' field formatter for text_with_summary + // fields displays returns the summary element of the field or, if + // the summary is empty, the trimmed version of the full element + // of the field. + 'text_summary_or_trimmed' => array( + 'label' => t('Summary or trimmed'), + 'field types' => array('text_with_summary'), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..10e0f7fbce320e5b69ded5a3fb95f012b9e23307 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_info_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_field_formatter_info_alter(). + */ +function {{ machine_name }}_field_formatter_info_alter(&$info) { + // Add a setting to a formatter type. + $info['text_default']['settings'] += array( + 'mymodule_additional_setting' => 'default value', + ); + + // Let a new field type re-use an existing formatter. + $info['text_default']['field types'][] = 'my_field_type'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_prepare_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_prepare_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..1dab13515ffd0b13c97210ddab80fde278e52898 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_prepare_view.twig @@ -0,0 +1,42 @@ +/** + * Implements hook_field_formatter_prepare_view(). + */ +function {{ machine_name }}_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) { + $tids = array(); + + // Collect every possible term attached to any of the fieldable entities. + foreach ($entities as $id => $entity) { + foreach ($items[$id] as $delta => $item) { + // Force the array key to prevent duplicates. + $tids[$item['tid']] = $item['tid']; + } + } + + if ($tids) { + $terms = taxonomy_term_load_multiple($tids); + + // Iterate through the fieldable entities again to attach the loaded term + // data. + foreach ($entities as $id => $entity) { + $rekey = FALSE; + + foreach ($items[$id] as $delta => $item) { + // Check whether the taxonomy term field instance value could be loaded. + if (isset($terms[$item['tid']])) { + // Replace the instance value with the term data. + $items[$id][$delta]['taxonomy_term'] = $terms[$item['tid']]; + } + // Otherwise, unset the instance value, since the term does not exist. + else { + unset($items[$id][$delta]); + $rekey = TRUE; + } + } + + if ($rekey) { + // Rekey the items array. + $items[$id] = array_values($items[$id]); + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_settings_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_settings_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..632106a2e29c2a6308b3c4497f0379eedec15d18 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_settings_form.twig @@ -0,0 +1,23 @@ +/** + * Implements hook_field_formatter_settings_form(). + */ +function {{ machine_name }}_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) { + $display = $instance['display'][$view_mode]; + $settings = $display['settings']; + + $element = array(); + + if ($display['type'] == 'text_trimmed' || $display['type'] == 'text_summary_or_trimmed') { + $element['trim_length'] = array( + '#title' => t('Length'), + '#type' => 'textfield', + '#size' => 20, + '#default_value' => $settings['trim_length'], + '#element_validate' => array('element_validate_integer_positive'), + '#required' => TRUE, + ); + } + + return $element; + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_settings_summary.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_settings_summary.twig new file mode 100644 index 0000000000000000000000000000000000000000..0c790d0aa86353a80cb66a95903f30074ddf4c15 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_settings_summary.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_field_formatter_settings_summary(). + */ +function {{ machine_name }}_field_formatter_settings_summary($field, $instance, $view_mode) { + $display = $instance['display'][$view_mode]; + $settings = $display['settings']; + + $summary = ''; + + if ($display['type'] == 'text_trimmed' || $display['type'] == 'text_summary_or_trimmed') { + $summary = t('Length: @chars chars', array('@chars' => $settings['trim_length'])); + } + + return $summary; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..3ccff4b4afbcb894acd47f46b8517ac85403d802 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_formatter_view.twig @@ -0,0 +1,46 @@ +/** + * Implements hook_field_formatter_view(). + */ +function {{ machine_name }}_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) { + $element = array(); + $settings = $display['settings']; + + switch ($display['type']) { + case 'sample_field_formatter_simple': + // Common case: each value is displayed individually in a sub-element + // keyed by delta. The field.tpl.php template specifies the markup + // wrapping each value. + foreach ($items as $delta => $item) { + $element[$delta] = array('#markup' => $settings['some_setting'] . $item['value']); + } + break; + + case 'sample_field_formatter_themeable': + // More elaborate formatters can defer to a theme function for easier + // customization. + foreach ($items as $delta => $item) { + $element[$delta] = array( + '#theme' => 'mymodule_theme_sample_field_formatter_themeable', + '#data' => $item['value'], + '#some_setting' => $settings['some_setting'], + ); + } + break; + + case 'sample_field_formatter_combined': + // Some formatters might need to display all values within a single piece + // of markup. + $rows = array(); + foreach ($items as $delta => $item) { + $rows[] = array($delta, $item['value']); + } + $element[0] = array( + '#theme' => 'table', + '#header' => array(t('Delta'), t('Value')), + '#rows' => $rows, + ); + break; + } + + return $element; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..3036d8b4ef30cfa64b075babd587949f1bdf2337 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info.twig @@ -0,0 +1,31 @@ +/** + * Implements hook_field_info(). + */ +function {{ machine_name }}_field_info() { + return array( + 'text' => array( + 'label' => t('Text'), + 'description' => t('This field stores varchar text in the database.'), + 'settings' => array('max_length' => 255), + 'instance_settings' => array('text_processing' => 0), + 'default_widget' => 'text_textfield', + 'default_formatter' => 'text_default', + ), + 'text_long' => array( + 'label' => t('Long text'), + 'description' => t('This field stores long text in the database.'), + 'settings' => array('max_length' => ''), + 'instance_settings' => array('text_processing' => 0), + 'default_widget' => 'text_textarea', + 'default_formatter' => 'text_default', + ), + 'text_with_summary' => array( + 'label' => t('Long text and summary'), + 'description' => t('This field stores long text in the database along with optional summary text.'), + 'settings' => array('max_length' => ''), + 'instance_settings' => array('text_processing' => 1, 'display_summary' => 0), + 'default_widget' => 'text_textarea_with_summary', + 'default_formatter' => 'text_summary_or_trimmed', + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..00646428f40c2057b5398c6b4cc3af0149d8a159 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info_alter.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_field_info_alter(). + */ +function {{ machine_name }}_field_info_alter(&$info) { + // Add a setting to all field types. + foreach ($info as $field_type => $field_type_info) { + $info[$field_type]['settings'] += array( + 'mymodule_additional_setting' => 'default value', + ); + } + + // Change the default widget for fields of type 'foo'. + if (isset($info['foo'])) { + $info['foo']['default widget'] = 'mymodule_widget'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info_max_weight.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info_max_weight.twig new file mode 100644 index 0000000000000000000000000000000000000000..e0579b9338978f070c9a9484570537e7e0cba794 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_info_max_weight.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_field_info_max_weight(). + */ +function {{ machine_name }}_field_info_max_weight($entity_type, $bundle, $context) { + $weights = array(); + + foreach (my_module_entity_additions($entity_type, $bundle, $context) as $addition) { + $weights[] = $addition['weight']; + } + + return $weights ? max($weights) : NULL; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..a164ab47765fddc775e842f8923cfc0adb4b8c37 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_insert.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_field_insert(). + */ +function {{ machine_name }}_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) { + if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node' && $entity->status) { + $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created', )); + foreach ($items as $item) { + $query->values(array( + 'nid' => $entity->nid, + 'tid' => $item['tid'], + 'sticky' => $entity->sticky, + 'created' => $entity->created, + )); + } + $query->execute(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_instance_settings_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_instance_settings_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..6a432010600acee89cf59a53c7b62eb3e2439ac4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_instance_settings_form.twig @@ -0,0 +1,30 @@ +/** + * Implements hook_field_instance_settings_form(). + */ +function {{ machine_name }}_field_instance_settings_form($field, $instance) { + $settings = $instance['settings']; + + $form['text_processing'] = array( + '#type' => 'radios', + '#title' => t('Text processing'), + '#default_value' => $settings['text_processing'], + '#options' => array( + t('Plain text'), + t('Filtered text (user selects text format)'), + ), + ); + if ($field['type'] == 'text_with_summary') { + $form['display_summary'] = array( + '#type' => 'select', + '#title' => t('Display summary'), + '#options' => array( + t('No'), + t('Yes'), + ), + '#description' => t('Display the summary to allow the user to input a summary value. Hide the summary to automatically fill it with a trimmed portion from the main post.'), + '#default_value' => !empty($settings['display_summary']) ? $settings['display_summary'] : 0, + ); + } + + return $form; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_is_empty.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_is_empty.twig new file mode 100644 index 0000000000000000000000000000000000000000..d228eb807603dbed399abeb56e21cebb4a602565 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_is_empty.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_is_empty(). + */ +function {{ machine_name }}_field_is_empty($item, $field) { + if (empty($item['value']) && (string) $item['value'] !== '0') { + return TRUE; + } + return FALSE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_language_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_language_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..993676f2bb2b3def92763e25119d01ea9d9046e8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_language_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_field_language_alter(). + */ +function {{ machine_name }}_field_language_alter(&$display_language, $context) { + // Do not apply core language fallback rules if they are disabled or if Locale + // is not registered as a translation handler. + if (variable_get('locale_field_language_fallback', TRUE) && field_has_translation_handler($context['entity_type'], 'locale')) { + locale_field_language_fallback($display_language, $context['entity'], $context['language']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..c5d1a1dd8337e70db000c6036426afce69d91905 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_load.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_field_load(). + */ +function {{ machine_name }}_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) { + // Sample code from text.module: precompute sanitized strings so they are + // stored in the field cache. + foreach ($entities as $id => $entity) { + foreach ($items[$id] as $delta => $item) { + // Only process items with a cacheable format, the rest will be handled + // by formatters if needed. + if (empty($instances[$id]['settings']['text_processing']) || filter_format_allowcache($item['format'])) { + $items[$id][$delta]['safe_value'] = isset($item['value']) ? _text_sanitize($instances[$id], $langcode, $item, 'value') : ''; + if ($field['type'] == 'text_with_summary') { + $items[$id][$delta]['safe_summary'] = isset($item['summary']) ? _text_sanitize($instances[$id], $langcode, $item, 'summary') : ''; + } + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_prepare_translation.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_prepare_translation.twig new file mode 100644 index 0000000000000000000000000000000000000000..6eacc519d5f883a46ebc421a0f5b5083e0dff4e3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_prepare_translation.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_field_prepare_translation(). + */ +function {{ machine_name }}_field_prepare_translation($entity_type, $entity, $field, $instance, $langcode, &$items, $source_entity, $source_langcode) { + // If the translating user is not permitted to use the assigned text format, + // we must not expose the source values. + $field_name = $field['field_name']; + $formats = filter_formats(); + $format_id = $source_entity->{$field_name}[$source_langcode][0]['format']; + if (!filter_access($formats[$format_id])) { + $items = array(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_prepare_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_prepare_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..bb44e13315be03a77d0d9c1dd447f39d3b706d19 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_prepare_view.twig @@ -0,0 +1,18 @@ +/** + * Implements hook_field_prepare_view(). + */ +function {{ machine_name }}_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) { + // Sample code from image.module: if there are no images specified at all, + // use the default image. + foreach ($entities as $id => $entity) { + if (empty($items[$id]) && $field['settings']['default_image']) { + if ($file = file_load($field['settings']['default_image'])) { + $items[$id][0] = (array) $file + array( + 'is_default' => TRUE, + 'alt' => '', + 'title' => '', + ); + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..342b680bd09fb51bf4287d9e478aff3cf07baa4c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_presave.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_field_presave(). + */ +function {{ machine_name }}_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) { + if ($field['type'] == 'number_decimal') { + // Let PHP round the value to ensure consistent behavior across storage + // backends. + foreach ($items as $delta => $item) { + if (isset($item['value'])) { + $items[$delta]['value'] = round($item['value'], $field['settings']['scale']); + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_purge_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_purge_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..18f3fb41f1dc718493a4123e98c39cb86ae16b59 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_purge_field.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_field_purge_field(). + */ +function {{ machine_name }}_field_purge_field($field) { + db_delete('my_module_field_info') + ->condition('id', $field['id']) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_purge_instance.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_purge_instance.twig new file mode 100644 index 0000000000000000000000000000000000000000..120bb8e45b33428743dcb08ff8817a268388f090 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_purge_instance.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_field_purge_instance(). + */ +function {{ machine_name }}_field_purge_instance($instance) { + db_delete('my_module_field_instance_info') + ->condition('id', $instance['id']) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_read_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_read_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..bd2962d14b4a52861df30f96da2f2630b3bebd1f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_read_field.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_read_field(). + */ +function {{ machine_name }}_field_read_field($field) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_read_instance.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_read_instance.twig new file mode 100644 index 0000000000000000000000000000000000000000..71c969b96560701d493edad9ac6d41a8d723e384 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_read_instance.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_read_instance(). + */ +function {{ machine_name }}_field_read_instance($instance) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..4ac78da858fdaa3b7e54e71ffdb95044cbe9aced --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_schema.twig @@ -0,0 +1,42 @@ +/** + * Implements hook_field_schema(). + */ +function {{ machine_name }}_field_schema($field) { + if ($field['type'] == 'text_long') { + $columns = array( + 'value' => array( + 'type' => 'text', + 'size' => 'big', + 'not null' => FALSE, + ), + ); + } + else { + $columns = array( + 'value' => array( + 'type' => 'varchar', + 'length' => $field['settings']['max_length'], + 'not null' => FALSE, + ), + ); + } + $columns += array( + 'format' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + ), + ); + return array( + 'columns' => $columns, + 'indexes' => array( + 'format' => array('format'), + ), + 'foreign keys' => array( + 'format' => array( + 'table' => 'filter_format', + 'columns' => array('format' => 'format'), + ), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_settings_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_settings_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..fb8d5c817b68fc86b77bfc3dc743d558bbd19a40 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_settings_form.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_field_settings_form(). + */ +function {{ machine_name }}_field_settings_form($field, $instance, $has_data) { + $settings = $field['settings']; + $form['max_length'] = array( + '#type' => 'textfield', + '#title' => t('Maximum length'), + '#default_value' => $settings['max_length'], + '#required' => FALSE, + '#element_validate' => array('element_validate_integer_positive'), + '#description' => t('The maximum length of the field in characters. Leave blank for an unlimited size.'), + ); + return $form; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_create_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_create_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..7aa884f570cefbb656f75b34622d4e5978d06948 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_create_field.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_field_storage_create_field(). + */ +function {{ machine_name }}_field_storage_create_field($field) { + $schema = _field_sql_storage_schema($field); + foreach ($schema as $name => $table) { + db_create_table($name, $table); + } + drupal_get_schema(NULL, TRUE); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..089c8d40833992e89b7e90aef045b6dd634edfc3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_field_storage_delete(). + */ +function {{ machine_name }}_field_storage_delete($entity_type, $entity, $fields) { + list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); + + foreach (field_info_instances($entity_type, $bundle) as $instance) { + if (isset($fields[$instance['field_id']])) { + $field = field_info_field_by_id($instance['field_id']); + field_sql_storage_field_storage_purge($entity_type, $entity, $field, $instance); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..610de3f47c1b3bd2e61d532117fc17a2e8d2c619 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_field.twig @@ -0,0 +1,20 @@ +/** + * Implements hook_field_storage_delete_field(). + */ +function {{ machine_name }}_field_storage_delete_field($field) { + // Mark all data associated with the field for deletion. + $field['deleted'] = 0; + $table = _field_sql_storage_tablename($field); + $revision_table = _field_sql_storage_revision_tablename($field); + db_update($table) + ->fields(array('deleted' => 1)) + ->execute(); + + // Move the table to a unique name while the table contents are being deleted. + $field['deleted'] = 1; + $new_table = _field_sql_storage_tablename($field); + $revision_new_table = _field_sql_storage_revision_tablename($field); + db_rename_table($table, $new_table); + db_rename_table($revision_table, $revision_new_table); + drupal_get_schema(NULL, TRUE); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_instance.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_instance.twig new file mode 100644 index 0000000000000000000000000000000000000000..f796835c0e25eb8dc7b62b5541ac2458f79f5d64 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_instance.twig @@ -0,0 +1,18 @@ +/** + * Implements hook_field_storage_delete_instance(). + */ +function {{ machine_name }}_field_storage_delete_instance($instance) { + $field = field_info_field($instance['field_name']); + $table_name = _field_sql_storage_tablename($field); + $revision_name = _field_sql_storage_revision_tablename($field); + db_update($table_name) + ->fields(array('deleted' => 1)) + ->condition('entity_type', $instance['entity_type']) + ->condition('bundle', $instance['bundle']) + ->execute(); + db_update($revision_name) + ->fields(array('deleted' => 1)) + ->condition('entity_type', $instance['entity_type']) + ->condition('bundle', $instance['bundle']) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_revision.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_revision.twig new file mode 100644 index 0000000000000000000000000000000000000000..2d99caef55470fa62a39f63032d73b437dd0a551 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_delete_revision.twig @@ -0,0 +1,18 @@ +/** + * Implements hook_field_storage_delete_revision(). + */ +function {{ machine_name }}_field_storage_delete_revision($entity_type, $entity, $fields) { + list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); + + if (isset($vid)) { + foreach ($fields as $field_id) { + $field = field_info_field_by_id($field_id); + $revision_name = _field_sql_storage_revision_tablename($field); + db_delete($revision_name) + ->condition('entity_type', $entity_type) + ->condition('entity_id', $id) + ->condition('revision_id', $vid) + ->execute(); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details.twig new file mode 100644 index 0000000000000000000000000000000000000000..2c72e67e1f20afc820c96455e23222c4d744d784 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_field_storage_details(). + */ +function {{ machine_name }}_field_storage_details($field) { + $details = array(); + + // Add field columns. + foreach ((array) $field['columns'] as $column_name => $attributes) { + $real_name = _field_sql_storage_columnname($field['field_name'], $column_name); + $columns[$column_name] = $real_name; + } + return array( + 'sql' => array( + FIELD_LOAD_CURRENT => array( + _field_sql_storage_tablename($field) => $columns, + ), + FIELD_LOAD_REVISION => array( + _field_sql_storage_revision_tablename($field) => $columns, + ), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..8d9d248b1e2ceb1637df35b78777a3c85a79f83b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details_alter.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_field_storage_details_alter(). + */ +function {{ machine_name }}_field_storage_details_alter(&$details, $field) { + if ($field['field_name'] == 'field_of_interest') { + $columns = array(); + foreach ((array) $field['columns'] as $column_name => $attributes) { + $columns[$column_name] = $column_name; + } + $details['drupal_variables'] = array( + FIELD_LOAD_CURRENT => array( + 'moon' => $columns, + ), + FIELD_LOAD_REVISION => array( + 'mars' => $columns, + ), + ); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..54ac287fd87fa3a0b2a4059a8ed6497394de1a79 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_info.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_field_storage_info(). + */ +function {{ machine_name }}_field_storage_info() { + return array( + 'field_sql_storage' => array( + 'label' => t('Default SQL storage'), + 'description' => t('Stores fields in the local SQL database, using per-field tables.'), + 'settings' => array(), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..8b816001f68d85f7c7dd2769af9bd095efa84eb1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_storage_info_alter(). + */ +function {{ machine_name }}_field_storage_info_alter(&$info) { + // Add a setting to a storage type. + $info['field_sql_storage']['settings'] += array( + 'mymodule_additional_setting' => 'default value', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..0eb4b5a8a1d3fee95faea291856bd8433666b8ff --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_load.twig @@ -0,0 +1,50 @@ +/** + * Implements hook_field_storage_load(). + */ +function {{ machine_name }}_field_storage_load($entity_type, $entities, $age, $fields, $options) { + $load_current = $age == FIELD_LOAD_CURRENT; + + foreach ($fields as $field_id => $ids) { + // By the time this hook runs, the relevant field definitions have been + // populated and cached in FieldInfo, so calling field_info_field_by_id() + // on each field individually is more efficient than loading all fields in + // memory upfront with field_info_field_by_ids(). + $field = field_info_field_by_id($field_id); + $field_name = $field['field_name']; + $table = $load_current ? _field_sql_storage_tablename($field) : _field_sql_storage_revision_tablename($field); + + $query = db_select($table, 't') + ->fields('t') + ->condition('entity_type', $entity_type) + ->condition($load_current ? 'entity_id' : 'revision_id', $ids, 'IN') + ->condition('language', field_available_languages($entity_type, $field), 'IN') + ->orderBy('delta'); + + if (empty($options['deleted'])) { + $query->condition('deleted', 0); + } + + $results = $query->execute(); + + $delta_count = array(); + foreach ($results as $row) { + if (!isset($delta_count[$row->entity_id][$row->language])) { + $delta_count[$row->entity_id][$row->language] = 0; + } + + if ($field['cardinality'] == FIELD_CARDINALITY_UNLIMITED || $delta_count[$row->entity_id][$row->language] < $field['cardinality']) { + $item = array(); + // For each column declared by the field, populate the item + // from the prefixed database column. + foreach ($field['columns'] as $column => $attributes) { + $column_name = _field_sql_storage_columnname($field_name, $column); + $item[$column] = $row->$column_name; + } + + // Add the item to the field values for the entity. + $entities[$row->entity_id]->{$field_name}[$row->language][] = $item; + $delta_count[$row->entity_id][$row->language]++; + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..aa100dfb1952743ab3d135a4e58b58d6537d5c69 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_insert.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_field_storage_pre_insert(). + */ +function {{ machine_name }}_field_storage_pre_insert($entity_type, $entity, &$skip_fields) { + if ($entity_type == 'node' && $entity->status && _forum_node_check_node_type($entity)) { + $query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp')); + foreach ($entity->taxonomy_forums as $language) { + foreach ($language as $delta) { + $query->values(array( + 'nid' => $entity->nid, + 'title' => $entity->title, + 'tid' => $delta['value'], + 'sticky' => $entity->sticky, + 'created' => $entity->created, + 'comment_count' => 0, + 'last_comment_timestamp' => $entity->created, + )); + } + } + $query->execute(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..1f12dd0a56a287aa60567406735a95ccab6a9436 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_load.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_storage_pre_load(). + */ +function {{ machine_name }}_field_storage_pre_load($entity_type, $entities, $age, &$skip_fields, $options) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..7e48fc7719c1a6ba246c0a83f7bb4192a540de61 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_pre_update.twig @@ -0,0 +1,37 @@ +/** + * Implements hook_field_storage_pre_update(). + */ +function {{ machine_name }}_field_storage_pre_update($entity_type, $entity, &$skip_fields) { + $first_call = &drupal_static(__FUNCTION__, array()); + + if ($entity_type == 'node' && $entity->status && _forum_node_check_node_type($entity)) { + // We don't maintain data for old revisions, so clear all previous values + // from the table. Since this hook runs once per field, per entity, make + // sure we only wipe values once. + if (!isset($first_call[$entity->nid])) { + $first_call[$entity->nid] = FALSE; + db_delete('forum_index')->condition('nid', $entity->nid)->execute(); + } + // Only save data to the table if the node is published. + if ($entity->status) { + $query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp')); + foreach ($entity->taxonomy_forums as $language) { + foreach ($language as $delta) { + $query->values(array( + 'nid' => $entity->nid, + 'title' => $entity->title, + 'tid' => $delta['value'], + 'sticky' => $entity->sticky, + 'created' => $entity->created, + 'comment_count' => 0, + 'last_comment_timestamp' => $entity->created, + )); + } + } + $query->execute(); + // The logic for determining last_comment_count is fairly complex, so + // call _forum_update_forum_index() too. + _forum_update_forum_index($entity->nid); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge.twig new file mode 100644 index 0000000000000000000000000000000000000000..4d9d0158e91a983b4e2f3a8628139fa46cd1e764 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_field_storage_purge(). + */ +function {{ machine_name }}_field_storage_purge($entity_type, $entity, $field, $instance) { + list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); + + $table_name = _field_sql_storage_tablename($field); + $revision_name = _field_sql_storage_revision_tablename($field); + db_delete($table_name) + ->condition('entity_type', $entity_type) + ->condition('entity_id', $id) + ->execute(); + db_delete($revision_name) + ->condition('entity_type', $entity_type) + ->condition('entity_id', $id) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..be79851bbaee8064067ca9fe02a4693152877e92 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge_field.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_storage_purge_field(). + */ +function {{ machine_name }}_field_storage_purge_field($field) { + $table_name = _field_sql_storage_tablename($field); + $revision_name = _field_sql_storage_revision_tablename($field); + db_drop_table($table_name); + db_drop_table($revision_name); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge_field_instance.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge_field_instance.twig new file mode 100644 index 0000000000000000000000000000000000000000..8cbb35539b6ea4f04bdb8e3ec3d267acfb69cb9b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_purge_field_instance.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_field_storage_purge_field_instance(). + */ +function {{ machine_name }}_field_storage_purge_field_instance($instance) { + db_delete('my_module_field_instance_info') + ->condition('id', $instance['id']) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_query.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_query.twig new file mode 100644 index 0000000000000000000000000000000000000000..7d7febc612a6d667066f5d223d645aa049b3adc9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_query.twig @@ -0,0 +1,103 @@ +/** + * Implements hook_field_storage_query(). + */ +function {{ machine_name }}_field_storage_query($query) { + $groups = array(); + if ($query->age == FIELD_LOAD_CURRENT) { + $tablename_function = '_field_sql_storage_tablename'; + $id_key = 'entity_id'; + } + else { + $tablename_function = '_field_sql_storage_revision_tablename'; + $id_key = 'revision_id'; + } + $table_aliases = array(); + // Add tables for the fields used. + foreach ($query->fields as $key => $field) { + $tablename = $tablename_function($field); + // Every field needs a new table. + $table_alias = $tablename . $key; + $table_aliases[$key] = $table_alias; + if ($key) { + $select_query->join($tablename, $table_alias, "$table_alias.entity_type = $field_base_table.entity_type AND $table_alias.$id_key = $field_base_table.$id_key"); + } + else { + $select_query = db_select($tablename, $table_alias); + $select_query->addTag('entity_field_access'); + $select_query->addMetaData('base_table', $tablename); + $select_query->fields($table_alias, array('entity_type', 'entity_id', 'revision_id', 'bundle')); + $field_base_table = $table_alias; + } + if ($field['cardinality'] != 1) { + $select_query->distinct(); + } + } + + // Add field conditions. + foreach ($query->fieldConditions as $key => $condition) { + $table_alias = $table_aliases[$key]; + $field = $condition['field']; + // Add the specified condition. + $sql_field = "$table_alias." . _field_sql_storage_columnname($field['field_name'], $condition['column']); + $query->addCondition($select_query, $sql_field, $condition); + // Add delta / language group conditions. + foreach (array('delta', 'language') as $column) { + if (isset($condition[$column . '_group'])) { + $group_name = $condition[$column . '_group']; + if (!isset($groups[$column][$group_name])) { + $groups[$column][$group_name] = $table_alias; + } + else { + $select_query->where("$table_alias.$column = " . $groups[$column][$group_name] . ".$column"); + } + } + } + } + + if (isset($query->deleted)) { + $select_query->condition("$field_base_table.deleted", (int) $query->deleted); + } + + // Is there a need to sort the query by property? + $has_property_order = FALSE; + foreach ($query->order as $order) { + if ($order['type'] == 'property') { + $has_property_order = TRUE; + } + } + + if ($query->propertyConditions || $has_property_order) { + if (empty($query->entityConditions['entity_type']['value'])) { + throw new EntityFieldQueryException('Property conditions and orders must have an entity type defined.'); + } + $entity_type = $query->entityConditions['entity_type']['value']; + $entity_base_table = _field_sql_storage_query_join_entity($select_query, $entity_type, $field_base_table); + $query->entityConditions['entity_type']['operator'] = '='; + foreach ($query->propertyConditions as $property_condition) { + $query->addCondition($select_query, "$entity_base_table." . $property_condition['column'], $property_condition); + } + } + foreach ($query->entityConditions as $key => $condition) { + $query->addCondition($select_query, "$field_base_table.$key", $condition); + } + + // Order the query. + foreach ($query->order as $order) { + if ($order['type'] == 'entity') { + $key = $order['specifier']; + $select_query->orderBy("$field_base_table.$key", $order['direction']); + } + elseif ($order['type'] == 'field') { + $specifier = $order['specifier']; + $field = $specifier['field']; + $table_alias = $table_aliases[$specifier['index']]; + $sql_field = "$table_alias." . _field_sql_storage_columnname($field['field_name'], $specifier['column']); + $select_query->orderBy($sql_field, $order['direction']); + } + elseif ($order['type'] == 'property') { + $select_query->orderBy("$entity_base_table." . $order['specifier'], $order['direction']); + } + } + + return $query->finishQuery($select_query, $id_key); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_update_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_update_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..97ce77446b776ca7acea5b594fed83f71c48cf3d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_update_field.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_field_storage_update_field(). + */ +function {{ machine_name }}_field_storage_update_field($field, $prior_field, $has_data) { + if (!$has_data) { + // There is no data. Re-create the tables completely. + $prior_schema = _field_sql_storage_schema($prior_field); + foreach ($prior_schema as $name => $table) { + db_drop_table($name, $table); + } + $schema = _field_sql_storage_schema($field); + foreach ($schema as $name => $table) { + db_create_table($name, $table); + } + } + else { + // There is data. See field_sql_storage_field_storage_update_field() for + // an example of what to do to modify the schema in place, preserving the + // old data as much as possible. + } + drupal_get_schema(NULL, TRUE); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_write.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_write.twig new file mode 100644 index 0000000000000000000000000000000000000000..adab9fccb84da1b39dc3a401746181f40b1ed04b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_write.twig @@ -0,0 +1,82 @@ +/** + * Implements hook_field_storage_write(). + */ +function {{ machine_name }}_field_storage_write($entity_type, $entity, $op, $fields) { + list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); + if (!isset($vid)) { + $vid = $id; + } + + foreach ($fields as $field_id) { + $field = field_info_field_by_id($field_id); + $field_name = $field['field_name']; + $table_name = _field_sql_storage_tablename($field); + $revision_name = _field_sql_storage_revision_tablename($field); + + $all_languages = field_available_languages($entity_type, $field); + $field_languages = array_intersect($all_languages, array_keys((array) $entity->$field_name)); + + // Delete and insert, rather than update, in case a value was added. + if ($op == FIELD_STORAGE_UPDATE) { + // Delete languages present in the incoming $entity->$field_name. + // Delete all languages if $entity->$field_name is empty. + $languages = !empty($entity->$field_name) ? $field_languages : $all_languages; + if ($languages) { + db_delete($table_name) + ->condition('entity_type', $entity_type) + ->condition('entity_id', $id) + ->condition('language', $languages, 'IN') + ->execute(); + db_delete($revision_name) + ->condition('entity_type', $entity_type) + ->condition('entity_id', $id) + ->condition('revision_id', $vid) + ->condition('language', $languages, 'IN') + ->execute(); + } + } + + // Prepare the multi-insert query. + $do_insert = FALSE; + $columns = array('entity_type', 'entity_id', 'revision_id', 'bundle', 'delta', 'language'); + foreach ($field['columns'] as $column => $attributes) { + $columns[] = _field_sql_storage_columnname($field_name, $column); + } + $query = db_insert($table_name)->fields($columns); + $revision_query = db_insert($revision_name)->fields($columns); + + foreach ($field_languages as $langcode) { + $items = (array) $entity->{$field_name}[$langcode]; + $delta_count = 0; + foreach ($items as $delta => $item) { + // We now know we have something to insert. + $do_insert = TRUE; + $record = array( + 'entity_type' => $entity_type, + 'entity_id' => $id, + 'revision_id' => $vid, + 'bundle' => $bundle, + 'delta' => $delta, + 'language' => $langcode, + ); + foreach ($field['columns'] as $column => $attributes) { + $record[_field_sql_storage_columnname($field_name, $column)] = isset($item[$column]) ? $item[$column] : NULL; + } + $query->values($record); + if (isset($vid)) { + $revision_query->values($record); + } + + if ($field['cardinality'] != FIELD_CARDINALITY_UNLIMITED && ++$delta_count == $field['cardinality']) { + break; + } + } + } + + // Execute the query if we have values to insert. + if ($do_insert) { + $query->execute(); + $revision_query->execute(); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..79acf7c8dca472c89748aee4eb26efb83b128528 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update.twig @@ -0,0 +1,29 @@ +/** + * Implements hook_field_update(). + */ +function {{ machine_name }}_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) { + if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node') { + $first_call = &drupal_static(__FUNCTION__, array()); + + // We don't maintain data for old revisions, so clear all previous values + // from the table. Since this hook runs once per field, per object, make + // sure we only wipe values once. + if (!isset($first_call[$entity->nid])) { + $first_call[$entity->nid] = FALSE; + db_delete('taxonomy_index')->condition('nid', $entity->nid)->execute(); + } + // Only save data to the table if the node is published. + if ($entity->status) { + $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created')); + foreach ($items as $item) { + $query->values(array( + 'nid' => $entity->nid, + 'tid' => $item['tid'], + 'sticky' => $entity->sticky, + 'created' => $entity->created, + )); + } + $query->execute(); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..1fdc7f931d0b9094052132f6087ea8baddbdbc1b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_field.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_field_update_field(). + */ +function {{ machine_name }}_field_update_field($field, $prior_field, $has_data) { + // Reset the static value that keeps track of allowed values for list fields. + drupal_static_reset('list_allowed_values'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_forbid.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_forbid.twig new file mode 100644 index 0000000000000000000000000000000000000000..dd1e03eb70914b3156213f4e86ee96208e24bb89 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_forbid.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_field_update_forbid(). + */ +function {{ machine_name }}_field_update_forbid($field, $prior_field, $has_data) { + // A 'list' field stores integer keys mapped to display values. If + // the new field will have fewer values, and any data exists for the + // abandoned keys, the field will have no way to display them. So, + // forbid such an update. + if ($has_data && count($field['settings']['allowed_values']) < count($prior_field['settings']['allowed_values'])) { + // Identify the keys that will be lost. + $lost_keys = array_diff(array_keys($field['settings']['allowed_values']), array_keys($prior_field['settings']['allowed_values'])); + // If any data exist for those keys, forbid the update. + $query = new EntityFieldQuery(); + $found = $query + ->fieldCondition($prior_field['field_name'], 'value', $lost_keys) + ->range(0, 1) + ->execute(); + if ($found) { + throw new FieldUpdateForbiddenException("Cannot update a list field not to include keys with existing data"); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_instance.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_instance.twig new file mode 100644 index 0000000000000000000000000000000000000000..e0208bbf351c47ed7a17e3fb868d12d794908497 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_update_instance.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_update_instance(). + */ +function {{ machine_name }}_field_update_instance($instance, $prior_instance) { + // @todo Needs function body. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_validate.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_validate.twig new file mode 100644 index 0000000000000000000000000000000000000000..45864cbc965dc5a759cb551f76168e75bbacf08a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_validate.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_field_validate(). + */ +function {{ machine_name }}_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) { + foreach ($items as $delta => $item) { + if (!empty($item['value'])) { + if (!empty($field['settings']['max_length']) && drupal_strlen($item['value']) > $field['settings']['max_length']) { + $errors[$field['field_name']][$langcode][$delta][] = array( + 'error' => 'text_max_length', + 'message' => t('%name: the value may not be longer than %max characters.', array('%name' => $instance['label'], '%max' => $field['settings']['max_length'])), + ); + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_WIDGET_TYPE_form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_WIDGET_TYPE_form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..366ed69e08ad804724c0635d5a2e9fa1d0cc7fa5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_WIDGET_TYPE_form_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_widget_WIDGET_TYPE_form_alter(). + */ +function {{ machine_name }}_field_widget_WIDGET_TYPE_form_alter(&$element, &$form_state, $context) { + // Code here will only act on widgets of type WIDGET_TYPE. For example, + // hook_field_widget_mymodule_autocomplete_form_alter() will only act on + // widgets of type 'mymodule_autocomplete'. + $element['#autocomplete_path'] = 'mymodule/autocomplete_path'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_error.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_error.twig new file mode 100644 index 0000000000000000000000000000000000000000..2c6100b0e857ece4d0fa3c456ed42e63d0d3cb7f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_error.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_field_widget_error(). + */ +function {{ machine_name }}_field_widget_error($element, $error, $form, &$form_state) { + form_error($element, $error['message']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..c6fcf5c1128302139dba50476895c3e9fd751a9d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_form.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_field_widget_form(). + */ +function {{ machine_name }}_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) { + $element += array( + '#type' => $instance['widget']['type'], + '#default_value' => isset($items[$delta]) ? $items[$delta] : '', + ); + return array('value' => $element); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..03f04be1930801a1cc195f090ec21a928802939c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_form_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_field_widget_form_alter(). + */ +function {{ machine_name }}_field_widget_form_alter(&$element, &$form_state, $context) { + // Add a css class to widget form elements for all fields of type mytype. + if ($context['field']['type'] == 'mytype') { + // Be sure not to overwrite existing attributes. + $element['#attributes']['class'][] = 'myclass'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..a72061c54eae1f9a33e22e693c14507a2b5643b3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_info.twig @@ -0,0 +1,36 @@ +/** + * Implements hook_field_widget_info(). + */ +function {{ machine_name }}_field_widget_info() { + return array( + 'text_textfield' => array( + 'label' => t('Text field'), + 'field types' => array('text'), + 'settings' => array('size' => 60), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + 'default value' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'text_textarea' => array( + 'label' => t('Text area (multiple rows)'), + 'field types' => array('text_long'), + 'settings' => array('rows' => 5), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + 'default value' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'text_textarea_with_summary' => array( + 'label' => t('Text area with a summary'), + 'field types' => array('text_with_summary'), + 'settings' => array('rows' => 20, 'summary_rows' => 5), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + 'default value' => FIELD_BEHAVIOR_DEFAULT, + ), + // As an advanced widget, force it to sink to the bottom of the choices. + 'weight' => 2, + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..8d2f5c203578d411f61d91663a36d3b0381d31b8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_info_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_field_widget_info_alter(). + */ +function {{ machine_name }}_field_widget_info_alter(&$info) { + // Add a setting to a widget type. + $info['text_textfield']['settings'] += array( + 'mymodule_additional_setting' => 'default value', + ); + + // Let a new field type re-use an existing widget. + $info['options_select']['field types'][] = 'my_field_type'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_properties_ENTITY_TYPE_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_properties_ENTITY_TYPE_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b141b6a2b43360895d7a49a0dd3a4ddecc2adc58 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_properties_ENTITY_TYPE_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_widget_properties_ENTITY_TYPE_alter(). + */ +function {{ machine_name }}_field_widget_properties_ENTITY_TYPE_alter(&$widget, $context) { + // Change a widget's type according to the time of day. + $field = $context['field']; + if ($field['field_name'] == 'field_foo') { + $time = date('H'); + $widget['type'] = $time < 12 ? 'widget_am' : 'widget_pm'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_properties_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_properties_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..8e4f42a6d4a7413f1cd3fd5f9c6f0fc7a6351ce2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_properties_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_widget_properties_alter(). + */ +function {{ machine_name }}_field_widget_properties_alter(&$widget, $context) { + // Change a widget's type according to the time of day. + $field = $context['field']; + if ($context['entity_type'] == 'node' && $field['field_name'] == 'field_foo') { + $time = date('H'); + $widget['type'] = $time < 12 ? 'widget_am' : 'widget_pm'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_settings_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_settings_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..c398ccb1380df0b1d18ae7c8d3053e13acf6cdbb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_settings_form.twig @@ -0,0 +1,28 @@ +/** + * Implements hook_field_widget_settings_form(). + */ +function {{ machine_name }}_field_widget_settings_form($field, $instance) { + $widget = $instance['widget']; + $settings = $widget['settings']; + + if ($widget['type'] == 'text_textfield') { + $form['size'] = array( + '#type' => 'textfield', + '#title' => t('Size of textfield'), + '#default_value' => $settings['size'], + '#element_validate' => array('element_validate_integer_positive'), + '#required' => TRUE, + ); + } + else { + $form['rows'] = array( + '#type' => 'textfield', + '#title' => t('Rows'), + '#default_value' => $settings['rows'], + '#element_validate' => array('element_validate_integer_positive'), + '#required' => TRUE, + ); + } + + return $form; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_copy.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_copy.twig new file mode 100644 index 0000000000000000000000000000000000000000..d7ecc192f6ebc09703d48b4dbdc10351f7800a89 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_copy.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_file_copy(). + */ +function {{ machine_name }}_file_copy($file, $source) { + $file_user = user_load($file->uid); + // Make sure that the file name starts with the owner's user name. + if (strpos($file->filename, $file_user->name) !== 0) { + $file->filename = $file_user->name . '_' . $file->filename; + $file->save(); + + watchdog('file', t('Copied file %source has been renamed to %destination', array('%source' => $source->filename, '%destination' => $file->filename))); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..76b5589082b3a9095b49cd178628d87d731b8cf7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_delete.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_file_delete(). + */ +function {{ machine_name }}_file_delete($file) { + // Delete all information associated with the file. + db_delete('upload')->condition('fid', $file->fid)->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download.twig new file mode 100644 index 0000000000000000000000000000000000000000..fd1453814ccaa9bf70a43188759268b0da514364 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_file_download(). + */ +function {{ machine_name }}_file_download($uri) { + // Check if the file is controlled by the current module. + if (!file_prepare_directory($uri)) { + $uri = FALSE; + } + if (strpos(file_uri_target($uri), variable_get('user_picture_path', 'pictures') . '/picture-') === 0) { + if (!user_access('access user profiles')) { + // Access to the file is denied. + return -1; + } + else { + $info = image_get_info($uri); + return array('Content-Type' => $info['mime_type']); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..0648ab51b7d34cbdb468d230aeb5a9b683aef711 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download_access.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_file_download_access(). + */ +function {{ machine_name }}_file_download_access($file_item, $entity_type, $entity) { + if ($entity_type == 'node') { + return node_access('view', $entity); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download_access_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download_access_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..7a6199855b9aba63b7c4631d3ee267ee764c54ee --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_download_access_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_file_download_access_alter(). + */ +function {{ machine_name }}_file_download_access_alter(&$grants, $file_item, $entity_type, $entity) { + // For our example module, we always enforce the rules set by node module. + if (isset($grants['node'])) { + $grants = array('node' => $grants['node']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..da167b19dae51ac833f008ed2a8a97a9a04eb11c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_insert.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_file_insert(). + */ +function {{ machine_name }}_file_insert($file) { + // Add a message to the log, if the file is a jpg + $validate = file_validate_extensions($file, 'jpg'); + if (empty($validate)) { + watchdog('file', 'A jpg has been added.'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..8ba6da0ec35811a7976e7e02bd7c27e8fd8a467c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_load.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_file_load(). + */ +function {{ machine_name }}_file_load($files) { + // Add the upload specific data into the file object. + $result = db_query('SELECT * FROM {upload} u WHERE u.fid IN (:fids)', array(':fids' => array_keys($files)))->fetchAll(PDO::FETCH_ASSOC); + foreach ($result as $record) { + foreach ($record as $key => $value) { + $files[$record['fid']]->$key = $value; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_mimetype_mapping_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_mimetype_mapping_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..af72a39a05785aec605ae5620f795244b07db9aa --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_mimetype_mapping_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_file_mimetype_mapping_alter(). + */ +function {{ machine_name }}_file_mimetype_mapping_alter(&$mapping) { + // Add new MIME type 'drupal/info'. + $mapping['mimetypes']['example_info'] = 'drupal/info'; + // Add new extension '.info' and map it to the 'drupal/info' MIME type. + $mapping['extensions']['info'] = 'example_info'; + // Override existing extension mapping for '.ogg' files. + $mapping['extensions']['ogg'] = 189; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_move.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_move.twig new file mode 100644 index 0000000000000000000000000000000000000000..2f13cb8f27ba70ca213896e001ee067524882620 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_move.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_file_move(). + */ +function {{ machine_name }}_file_move($file, $source) { + $file_user = user_load($file->uid); + // Make sure that the file name starts with the owner's user name. + if (strpos($file->filename, $file_user->name) !== 0) { + $file->filename = $file_user->name . '_' . $file->filename; + $file->save(); + + watchdog('file', t('Moved file %source has been renamed to %destination', array('%source' => $source->filename, '%destination' => $file->filename))); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..bee1b0c970c649e0717716bf47533e1cc4308dd9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_presave.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_file_presave(). + */ +function {{ machine_name }}_file_presave($file) { + // Change the file timestamp to an hour prior. + $file->timestamp -= 3600; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..b8064d13910625952b53c36df102c7601c22b6a7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_update.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_file_update(). + */ +function {{ machine_name }}_file_update($file) { + $file_user = user_load($file->uid); + // Make sure that the file name starts with the owner's user name. + if (strpos($file->filename, $file_user->name) !== 0) { + $old_filename = $file->filename; + $file->filename = $file_user->name . '_' . $file->filename; + $file->save(); + + watchdog('file', t('%source has been renamed to %destination', array('%source' => $old_filename, '%destination' => $file->filename))); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_url_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_url_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..05dc717687bedad2b09f0d1493db9c01e96dfbc6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_url_alter.twig @@ -0,0 +1,47 @@ +/** + * Implements hook_file_url_alter(). + */ +function {{ machine_name }}_file_url_alter(&$uri) { + global $user; + + // User 1 will always see the local file in this example. + if ($user->uid == 1) { + return; + } + + $cdn1 = 'http://cdn1.example.com'; + $cdn2 = 'http://cdn2.example.com'; + $cdn_extensions = array('css', 'js', 'gif', 'jpg', 'jpeg', 'png'); + + // Most CDNs don't support private file transfers without a lot of hassle, + // so don't support this in the common case. + $schemes = array('public'); + + $scheme = file_uri_scheme($uri); + + // Only serve shipped files and public created files from the CDN. + if (!$scheme || in_array($scheme, $schemes)) { + // Shipped files. + if (!$scheme) { + $path = $uri; + } + // Public created files. + else { + $wrapper = file_stream_wrapper_get_instance_by_scheme($scheme); + $path = $wrapper->getDirectoryPath() . '/' . file_uri_target($uri); + } + + // Clean up Windows paths. + $path = str_replace('\\', '/', $path); + + // Serve files with one of the CDN extensions from CDN 1, all others from + // CDN 2. + $pathinfo = pathinfo($path); + if (isset($pathinfo['extension']) && in_array($pathinfo['extension'], $cdn_extensions)) { + $uri = $cdn1 . '/' . $path; + } + else { + $uri = $cdn2 . '/' . $path; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_validate.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_validate.twig new file mode 100644 index 0000000000000000000000000000000000000000..9023d789d9c891ef56134c6123ec10602d72d666 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/file_validate.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_file_validate(). + */ +function {{ machine_name }}_file_validate($file) { + $errors = array(); + + if (empty($file->filename)) { + $errors[] = t("The file's name is empty. Please give a name to the file."); + } + if (strlen($file->filename) > 255) { + $errors[] = t("The file's name exceeds the 255 characters limit. Please rename the file and try again."); + } + + return $errors; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filetransfer_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filetransfer_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..60dace2ee422df7fd141b3a93349839ee65963d6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filetransfer_info.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_filetransfer_info(). + */ +function {{ machine_name }}_filetransfer_info() { + $info['sftp'] = array( + 'title' => t('SFTP (Secure FTP)'), + 'file' => 'sftp.filetransfer.inc', + 'class' => 'FileTransferSFTP', + 'weight' => 10, + ); + return $info; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filetransfer_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filetransfer_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..abb026c97da9874c66e4f96d13c265ae5e4b7377 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filetransfer_info_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_filetransfer_info_alter(). + */ +function {{ machine_name }}_filetransfer_info_alter(&$filetransfer_info) { + if (variable_get('paranoia', FALSE)) { + // Remove the FTP option entirely. + unset($filetransfer_info['ftp']); + // Make sure the SSH option is listed first. + $filetransfer_info['ssh']['weight'] = -10; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_disable.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_disable.twig new file mode 100644 index 0000000000000000000000000000000000000000..94ad1e918abcb0d126c01a15b40ca077593ffc82 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_disable.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_filter_format_disable(). + */ +function {{ machine_name }}_filter_format_disable($format) { + mymodule_cache_rebuild(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..ba10a453936a1c8d22a15133659c983315f8a907 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_insert.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_filter_format_insert(). + */ +function {{ machine_name }}_filter_format_insert($format) { + mymodule_cache_rebuild(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..d7328937ff7a9b9537048a18a72fb0edd9bca07f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_format_update.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_filter_format_update(). + */ +function {{ machine_name }}_filter_format_update($format) { + mymodule_cache_rebuild(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..f17e628024d488752d08831a1b1fa17cc9992edf --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_info.twig @@ -0,0 +1,24 @@ +/** + * Implements hook_filter_info(). + */ +function {{ machine_name }}_filter_info() { + $filters['filter_html'] = array( + 'title' => t('Limit allowed HTML tags'), + 'description' => t('Allows you to restrict the HTML tags the user can use. It will also remove harmful content such as JavaScript events, JavaScript URLs and CSS styles from those tags that are not removed.'), + 'process callback' => '_filter_html', + 'settings callback' => '_filter_html_settings', + 'default settings' => array( + 'allowed_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>', + 'filter_html_help' => 1, + 'filter_html_nofollow' => 0, + ), + 'tips callback' => '_filter_html_tips', + ); + $filters['filter_autop'] = array( + 'title' => t('Convert line breaks'), + 'description' => t('Converts line breaks into HTML (i.e. <br> and <p>) tags.'), + 'process callback' => '_filter_autop', + 'tips callback' => '_filter_autop_tips', + ); + return $filters; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..008b375317e1152bee0d84aee0966460be434af2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/filter_info_alter.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_filter_info_alter(). + */ +function {{ machine_name }}_filter_info_alter(&$info) { + // Replace the PHP evaluator process callback with an improved + // PHP evaluator provided by a module. + $info['php_code']['process callback'] = 'my_module_php_evaluator'; + + // Alter the default settings of the URL filter provided by core. + $info['filter_url']['default settings'] = array( + 'filter_url_length' => 100, + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/flush_caches.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/flush_caches.twig new file mode 100644 index 0000000000000000000000000000000000000000..080b0fed83529e2e70dcb1f3dd97003766385b1a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/flush_caches.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_flush_caches(). + */ +function {{ machine_name }}_flush_caches() { + return array('cache_example'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form.twig new file mode 100644 index 0000000000000000000000000000000000000000..9173771c2366f27a387201df572efc9ad94f97d9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form.twig @@ -0,0 +1,33 @@ +/** + * Implements hook_form(). + */ +function {{ machine_name }}_form($node, &$form_state) { + $type = node_type_get_type($node); + + $form['title'] = array( + '#type' => 'textfield', + '#title' => check_plain($type->title_label), + '#default_value' => !empty($node->title) ? $node->title : '', + '#required' => TRUE, '#weight' => -5 + ); + + $form['field1'] = array( + '#type' => 'textfield', + '#title' => t('Custom field'), + '#default_value' => $node->field1, + '#maxlength' => 127, + ); + $form['selectbox'] = array( + '#type' => 'select', + '#title' => t('Select box'), + '#default_value' => $node->selectbox, + '#options' => array( + 1 => 'Option A', + 2 => 'Option B', + 3 => 'Option C', + ), + '#description' => t('Choose an option.'), + ); + + return $form; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_BASE_FORM_ID_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_BASE_FORM_ID_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..75d51c4e7b286575b0ad7d0286f0652a0314c8c0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_BASE_FORM_ID_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_form_BASE_FORM_ID_alter(). + */ +function {{ machine_name }}_form_BASE_FORM_ID_alter(&$form, &$form_state, $form_id) { + // Modification for the form with the given BASE_FORM_ID goes here. For + // example, if BASE_FORM_ID is "node_form", this code would run on every + // node form, regardless of node type. + + // Add a checkbox to the node form about agreeing to terms of use. + $form['terms_of_use'] = array( + '#type' => 'checkbox', + '#title' => t("I agree with the website's terms and conditions."), + '#required' => TRUE, + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_FORM_ID_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_FORM_ID_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..25de86904314e261910a1d83d4a3b63cf6957f09 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_FORM_ID_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_form_FORM_ID_alter(). + */ +function {{ machine_name }}_form_FORM_ID_alter(&$form, &$form_state, $form_id) { + // Modification for the form with the given form ID goes here. For example, if + // FORM_ID is "user_register_form" this code would run only on the user + // registration form. + + // Add a checkbox to registration form about agreeing to terms of use. + $form['terms_of_use'] = array( + '#type' => 'checkbox', + '#title' => t("I agree with the website's terms and conditions."), + '#required' => TRUE, + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..2eca12a646da57ce642c28d36d1504996a26c662 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_alter.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_form_alter(). + */ +function {{ machine_name }}_form_alter(&$form, &$form_state, $form_id) { + if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) { + $form['workflow']['upload_' . $form['type']['#value']] = array( + '#type' => 'radios', + '#title' => t('Attachments'), + '#default_value' => variable_get('upload_' . $form['type']['#value'], 1), + '#options' => array(t('Disabled'), t('Enabled')), + ); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_system_theme_settings_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_system_theme_settings_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..bc011c3dcacbe7521c16b126929c33336ddc34fc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/form_system_theme_settings_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_form_system_theme_settings_alter(). + */ +function {{ machine_name }}_form_system_theme_settings_alter(&$form, &$form_state) { + // Add a checkbox to toggle the breadcrumb trail. + $form['toggle_breadcrumb'] = array( + '#type' => 'checkbox', + '#title' => t('Display the breadcrumb'), + '#default_value' => theme_get_setting('toggle_breadcrumb'), + '#description' => t('Show a trail of links from the homepage to the current page.'), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/forms.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/forms.twig new file mode 100644 index 0000000000000000000000000000000000000000..d26a23af1610d28e2574972c810b98dada5dd9f4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/forms.twig @@ -0,0 +1,36 @@ +/** + * Implements hook_forms(). + */ +function {{ machine_name }}_forms($form_id, $args) { + // Simply reroute the (non-existing) $form_id 'mymodule_first_form' to + // 'mymodule_main_form'. + $forms['mymodule_first_form'] = array( + 'callback' => 'mymodule_main_form', + ); + + // Reroute the $form_id and prepend an additional argument that gets passed to + // the 'mymodule_main_form' form builder function. + $forms['mymodule_second_form'] = array( + 'callback' => 'mymodule_main_form', + 'callback arguments' => array('some parameter'), + ); + + // Reroute the $form_id, but invoke the form builder function + // 'mymodule_main_form_wrapper' first, so we can prepopulate the $form array + // that is passed to the actual form builder 'mymodule_main_form'. + $forms['mymodule_wrapped_form'] = array( + 'callback' => 'mymodule_main_form', + 'wrapper_callback' => 'mymodule_main_form_wrapper', + ); + + // Build a form with a static class callback. + $forms['mymodule_class_generated_form'] = array( + // This will call: MyClass::generateMainForm(). + 'callback' => array('MyClass', 'generateMainForm'), + // The base_form_id is required when the callback is a static function in + // a class. This can also be used to keep newer code backwards compatible. + 'base_form_id' => 'mymodule_main_form', + ); + + return $forms; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/help.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/help.twig new file mode 100644 index 0000000000000000000000000000000000000000..48d1c4f13235cb7f29cec568aeedd355856c3ae0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/help.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_help(). + */ +function {{ machine_name }}_help($path, $arg) { + switch ($path) { + // Main module help for the block module + case 'admin/help#block': + return '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/structure/block'))) . '</p>'; + + // Help for another path in the block module + case 'admin/structure/block': + return '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page.') . '</p>'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/hook_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/hook_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..00136a6f8d0884d3eeb64fd8bf18808b691cb27b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/hook_info.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_hook_info(). + */ +function {{ machine_name }}_hook_info() { + $hooks['token_info'] = array( + 'group' => 'tokens', + ); + $hooks['tokens'] = array( + 'group' => 'tokens', + ); + return $hooks; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/hook_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/hook_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..997cb9cbacc8ac63f80ec1a18e26dc14f364bf85 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/hook_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_hook_info_alter(). + */ +function {{ machine_name }}_hook_info_alter(&$hooks) { + // Our module wants to completely override the core tokens, so make + // sure the core token hooks are not found. + $hooks['token_info']['group'] = 'mytokens'; + $hooks['tokens']['group'] = 'mytokens'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/html_head_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/html_head_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b931d6e793a0dd2ab64ac4e1b3b42bee18a6ea78 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/html_head_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_html_head_alter(). + */ +function {{ machine_name }}_html_head_alter(&$head_elements) { + foreach ($head_elements as $key => $element) { + if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') { + // I want a custom canonical URL. + $head_elements[$key]['#attributes']['href'] = mymodule_canonical_url(); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_default_styles.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_default_styles.twig new file mode 100644 index 0000000000000000000000000000000000000000..8c447241ba63f21fcabda387411bc84ad7b28128 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_default_styles.twig @@ -0,0 +1,24 @@ +/** + * Implements hook_image_default_styles(). + */ +function {{ machine_name }}_image_default_styles() { + $styles = array(); + + $styles['mymodule_preview'] = array( + 'label' => 'My module preview', + 'effects' => array( + array( + 'name' => 'image_scale', + 'data' => array('width' => 400, 'height' => 400, 'upscale' => 1), + 'weight' => 0, + ), + array( + 'name' => 'image_desaturate', + 'data' => array(), + 'weight' => 1, + ), + ), + ); + + return $styles; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_effect_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_effect_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..cb8e9b6369e7bfbf5468a19f2793d3574d93bb91 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_effect_info.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_image_effect_info(). + */ +function {{ machine_name }}_image_effect_info() { + $effects = array(); + + $effects['mymodule_resize'] = array( + 'label' => t('Resize'), + 'help' => t('Resize an image to an exact set of dimensions, ignoring aspect ratio.'), + 'effect callback' => 'mymodule_resize_effect', + 'dimensions callback' => 'mymodule_resize_dimensions', + 'form callback' => 'mymodule_resize_form', + 'summary theme' => 'mymodule_resize_summary', + ); + + return $effects; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_effect_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_effect_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..80dc5ade0261cb76043adf361689a26497967ea5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_effect_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_image_effect_info_alter(). + */ +function {{ machine_name }}_image_effect_info_alter(&$effects) { + // Override the Image module's crop effect with more options. + $effects['image_crop']['effect callback'] = 'mymodule_crop_effect'; + $effects['image_crop']['dimensions callback'] = 'mymodule_crop_dimensions'; + $effects['image_crop']['form callback'] = 'mymodule_crop_form'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..541fb18a438d3ac673c9223c844fd1aedb72df03 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_delete.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_image_style_delete(). + */ +function {{ machine_name }}_image_style_delete($style) { + // Administrators can choose an optional replacement style when deleting. + // Update the modules style variable accordingly. + if (isset($style['old_name']) && $style['old_name'] == variable_get('mymodule_image_style', '')) { + variable_set('mymodule_image_style', $style['name']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_flush.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_flush.twig new file mode 100644 index 0000000000000000000000000000000000000000..e561bb681e69e45df1b5bf46e1298536964d492b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_flush.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_image_style_flush(). + */ +function {{ machine_name }}_image_style_flush($style) { + // Empty cached data that contains information about the style. + cache_clear_all('*', 'cache_mymodule', TRUE); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_save.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_save.twig new file mode 100644 index 0000000000000000000000000000000000000000..b489997b3dc7746cbda7a0c69a15de170a881471 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_style_save.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_image_style_save(). + */ +function {{ machine_name }}_image_style_save($style) { + // If a module defines an image style and that style is renamed by the user + // the module should update any references to that style. + if (isset($style['old_name']) && $style['old_name'] == variable_get('mymodule_image_style', '')) { + variable_set('mymodule_image_style', $style['name']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_styles_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_styles_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..0ee5ecda52946b075be5411d2fd3a62fbf87d286 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_styles_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_image_styles_alter(). + */ +function {{ machine_name }}_image_styles_alter(&$styles) { + // Check that we only affect a default style. + if ($styles['thumbnail']['storage'] == IMAGE_STORAGE_DEFAULT) { + // Add an additional effect to the thumbnail style. + $styles['thumbnail']['effects'][] = array( + 'name' => 'image_desaturate', + 'data' => array(), + 'weight' => 1, + 'effect callback' => 'image_desaturate_effect', + ); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_toolkits.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_toolkits.twig new file mode 100644 index 0000000000000000000000000000000000000000..47aa8630e1da9e157629e003a57f2417bb6b17e1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_toolkits.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_image_toolkits(). + */ +function {{ machine_name }}_image_toolkits() { + return array( + 'working' => array( + 'title' => t('A toolkit that works.'), + 'available' => TRUE, + ), + 'broken' => array( + 'title' => t('A toolkit that is "broken" and will not be listed.'), + 'available' => FALSE, + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/init.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/init.twig new file mode 100644 index 0000000000000000000000000000000000000000..98cbebc4d0649574d496b45f44866a63982c1767 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/init.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_init(). + */ +function {{ machine_name }}_init() { + // Since this file should only be loaded on the front page, it cannot be + // declared in the info file. + if (drupal_is_front_page()) { + drupal_add_css(drupal_get_path('module', 'foo') . '/foo.css'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..70fb0fb4cd273eee931db5611133f3fe780ae5f2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/insert.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_insert(). + */ +function {{ machine_name }}_insert($node) { + db_insert('mytable') + ->fields(array( + 'nid' => $node->nid, + 'extra' => $node->extra, + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install.twig new file mode 100644 index 0000000000000000000000000000000000000000..ba2007b1dbb2729af65b98ba99f11844bee0ad98 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_install(). + */ +function {{ machine_name }}_install() { + // Populate the default {node_access} record. + db_insert('node_access') + ->fields(array( + 'nid' => 0, + 'gid' => 0, + 'realm' => 'all', + 'grant_view' => 1, + 'grant_update' => 0, + 'grant_delete' => 0, + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install_tasks.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install_tasks.twig new file mode 100644 index 0000000000000000000000000000000000000000..d25595727493c123afb0a59c209779083a456d0a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install_tasks.twig @@ -0,0 +1,63 @@ +/** + * Implements hook_install_tasks(). + */ +function {{ machine_name }}_install_tasks(&$install_state) { + // Here, we define a variable to allow tasks to indicate that a particular, + // processor-intensive batch process needs to be triggered later on in the + // installation. + $myprofile_needs_batch_processing = variable_get('myprofile_needs_batch_processing', FALSE); + $tasks = array( + // This is an example of a task that defines a form which the user who is + // installing the site will be asked to fill out. To implement this task, + // your profile would define a function named myprofile_data_import_form() + // as a normal form API callback function, with associated validation and + // submit handlers. In the submit handler, in addition to saving whatever + // other data you have collected from the user, you might also call + // variable_set('myprofile_needs_batch_processing', TRUE) if the user has + // entered data which requires that batch processing will need to occur + // later on. + 'myprofile_data_import_form' => array( + 'display_name' => st('Data import options'), + 'type' => 'form', + ), + // Similarly, to implement this task, your profile would define a function + // named myprofile_settings_form() with associated validation and submit + // handlers. This form might be used to collect and save additional + // information from the user that your profile needs. There are no extra + // steps required for your profile to act as an "installation wizard"; you + // can simply define as many tasks of type 'form' as you wish to execute, + // and the forms will be presented to the user, one after another. + 'myprofile_settings_form' => array( + 'display_name' => st('Additional options'), + 'type' => 'form', + ), + // This is an example of a task that performs batch operations. To + // implement this task, your profile would define a function named + // myprofile_batch_processing() which returns a batch API array definition + // that the installer will use to execute your batch operations. Due to the + // 'myprofile_needs_batch_processing' variable used here, this task will be + // hidden and skipped unless your profile set it to TRUE in one of the + // previous tasks. + 'myprofile_batch_processing' => array( + 'display_name' => st('Import additional data'), + 'display' => $myprofile_needs_batch_processing, + 'type' => 'batch', + 'run' => $myprofile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP, + ), + // This is an example of a task that will not be displayed in the list that + // the user sees. To implement this task, your profile would define a + // function named myprofile_final_site_setup(), in which additional, + // automated site setup operations would be performed. Since this is the + // last task defined by your profile, you should also use this function to + // call variable_del('myprofile_needs_batch_processing') and clean up the + // variable that was used above. If you want the user to pass to the final + // Drupal installation tasks uninterrupted, return no output from this + // function. Otherwise, return themed output that the user will see (for + // example, a confirmation page explaining that your profile's tasks are + // complete, with a link to reload the current page and therefore pass on + // to the final Drupal installation tasks when the user is ready to do so). + 'myprofile_final_site_setup' => array( + ), + ); + return $tasks; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install_tasks_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install_tasks_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ee6dec7b133eb12641bc46f204ea9d4efba436a8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/install_tasks_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_install_tasks_alter(). + */ +function {{ machine_name }}_install_tasks_alter(&$tasks, $install_state) { + // Replace the "Choose language" installation task provided by Drupal core + // with a custom callback function defined by this installation profile. + $tasks['install_select_locale']['function'] = 'myprofile_locale_selection'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/js_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/js_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..77dcde889228c6a58f6bcaa0c5a131bde563673f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/js_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_js_alter(). + */ +function {{ machine_name }}_js_alter(&$javascript) { + // Swap out jQuery to use an updated version of the library. + $javascript['misc/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_fallback_candidates_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_fallback_candidates_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c9ddee13568dab037a6d5c8e46a67f8d96d38bc5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_fallback_candidates_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_language_fallback_candidates_alter(). + */ +function {{ machine_name }}_language_fallback_candidates_alter(array &$fallback_candidates) { + $fallback_candidates = array_reverse($fallback_candidates); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_init.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_init.twig new file mode 100644 index 0000000000000000000000000000000000000000..6f416d387c09c742c282298d52955e042709156e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_init.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_language_init(). + */ +function {{ machine_name }}_language_init() { + global $language, $conf; + + switch ($language->language) { + case 'it': + $conf['site_name'] = 'Il mio sito Drupal'; + break; + + case 'fr': + $conf['site_name'] = 'Mon site Drupal'; + break; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_negotiation_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_negotiation_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..3e346bd1398ee0e5c1ea00b21139b3eded0a966a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_negotiation_info.twig @@ -0,0 +1,20 @@ +/** + * Implements hook_language_negotiation_info(). + */ +function {{ machine_name }}_language_negotiation_info() { + return array( + 'custom_language_provider' => array( + 'callbacks' => array( + 'language' => 'custom_language_provider_callback', + 'switcher' => 'custom_language_switcher_callback', + 'url_rewrite' => 'custom_language_url_rewrite_callback', + ), + 'file' => drupal_get_path('module', 'custom') . '/custom.module', + 'weight' => -4, + 'types' => array('custom_language_type'), + 'name' => t('Custom language negotiation provider'), + 'description' => t('This is a custom language negotiation provider.'), + 'cache' => 0, + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_negotiation_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_negotiation_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6b1c412d7c0858c7f09b4834a67e901906609c03 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_negotiation_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_language_negotiation_info_alter(). + */ +function {{ machine_name }}_language_negotiation_info_alter(array &$language_providers) { + if (isset($language_providers['custom_language_provider'])) { + $language_providers['custom_language_provider']['config'] = 'admin/config/regional/language/configure/custom-language-provider'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_switch_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_switch_links_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..66d7a3e4262caa99498bd28fc76cfeace52eacf0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_switch_links_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_language_switch_links_alter(). + */ +function {{ machine_name }}_language_switch_links_alter(array &$links, $type, $path) { + global $language; + + if ($type == LANGUAGE_TYPE_CONTENT && isset($links[$language->language])) { + foreach ($links[$language->language] as $link) { + $link['attributes']['class'][] = 'active-language'; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_types_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_types_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..b69538b102a0bc55473f269a3ffedbf8788a8802 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_types_info.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_language_types_info(). + */ +function {{ machine_name }}_language_types_info() { + return array( + 'custom_language_type' => array( + 'name' => t('Custom language'), + 'description' => t('A custom language type.'), + ), + 'fixed_custom_language_type' => array( + 'fixed' => array('custom_language_provider'), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_types_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_types_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..06e599f90ec397b4a45550ee210ad4c43b19e746 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/language_types_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_language_types_info_alter(). + */ +function {{ machine_name }}_language_types_info_alter(array &$language_types) { + if (isset($language_types['custom_language_type'])) { + $language_types['custom_language_type_custom']['description'] = t('A far better description.'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/library.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/library.twig new file mode 100644 index 0000000000000000000000000000000000000000..508c0b951d90eeab85e64782cd454cefc539a9d7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/library.twig @@ -0,0 +1,42 @@ +/** + * Implements hook_library(). + */ +function {{ machine_name }}_library() { + // Library One. + $libraries['library-1'] = array( + 'title' => 'Library One', + 'website' => 'http://example.com/library-1', + 'version' => '1.2', + 'js' => array( + drupal_get_path('module', 'my_module') . '/library-1.js' => array(), + ), + 'css' => array( + drupal_get_path('module', 'my_module') . '/library-2.css' => array( + 'type' => 'file', + 'media' => 'screen', + ), + ), + ); + // Library Two. + $libraries['library-2'] = array( + 'title' => 'Library Two', + 'website' => 'http://example.com/library-2', + 'version' => '3.1-beta1', + 'js' => array( + // JavaScript settings may use the 'data' key. + array( + 'type' => 'setting', + 'data' => array('library2' => TRUE), + ), + ), + 'dependencies' => array( + // Require jQuery UI core by System module. + array('system', 'ui'), + // Require our other library. + array('my_module', 'library-1'), + // Require another library. + array('other_module', 'library-3'), + ), + ); + return $libraries; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/library_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/library_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..492ffb64580d1252ea93f39718133788b88c665a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/library_alter.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_library_alter(). + */ +function {{ machine_name }}_library_alter(&$libraries, $module) { + // Update Farbtastic to version 2.0. + if ($module == 'system' && isset($libraries['farbtastic'])) { + // Verify existing version is older than the one we are updating to. + if (version_compare($libraries['farbtastic']['version'], '2.0', '<')) { + // Update the existing Farbtastic to version 2.0. + $libraries['farbtastic']['version'] = '2.0'; + $libraries['farbtastic']['js'] = array( + drupal_get_path('module', 'farbtastic_update') . '/farbtastic-2.0.js' => array(), + ); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/load.twig new file mode 100644 index 0000000000000000000000000000000000000000..2e6febbae2b5f9911a63ec6db51ef1085bfb485e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/load.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_load(). + */ +function {{ machine_name }}_load($nodes) { + $result = db_query('SELECT nid, foo FROM {mytable} WHERE nid IN (:nids)', array(':nids' => array_keys($nodes))); + foreach ($result as $record) { + $nodes[$record->nid]->foo = $record->foo; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/locale.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/locale.twig new file mode 100644 index 0000000000000000000000000000000000000000..9ad9bc19c72a876d613d6e548a2efd6b7a838f47 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/locale.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_locale(). + */ +function {{ machine_name }}_locale($op = 'groups') { + switch ($op) { + case 'groups': + return array('custom' => t('Custom')); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/mail.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/mail.twig new file mode 100644 index 0000000000000000000000000000000000000000..84b056691ea4f2a52622717b11640503490e8e12 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/mail.twig @@ -0,0 +1,40 @@ +/** + * Implements hook_mail(). + */ +function {{ machine_name }}_mail($key, &$message, $params) { + $account = $params['account']; + $context = $params['context']; + $variables = array( + '%site_name' => variable_get('site_name', 'Drupal'), + '%username' => format_username($account), + ); + if ($context['hook'] == 'taxonomy') { + $entity = $params['entity']; + $vocabulary = taxonomy_vocabulary_load($entity->vid); + $variables += array( + '%term_name' => $entity->name, + '%term_description' => $entity->description, + '%term_id' => $entity->tid, + '%vocabulary_name' => $vocabulary->name, + '%vocabulary_description' => $vocabulary->description, + '%vocabulary_id' => $vocabulary->vid, + ); + } + + // Node-based variable translation is only available if we have a node. + if (isset($params['node'])) { + $node = $params['node']; + $variables += array( + '%uid' => $node->uid, + '%node_url' => url('node/' . $node->nid, array('absolute' => TRUE)), + '%node_type' => node_type_get_name($node), + '%title' => $node->title, + '%teaser' => $node->teaser, + '%body' => $node->body, + ); + } + $subject = strtr($context['subject'], $variables); + $body = strtr($context['message'], $variables); + $message['subject'] .= str_replace(array("\r", "\n"), '', $subject); + $message['body'][] = drupal_html_to_text($body); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/mail_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/mail_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..e476e64c4810f57e2b469d450464ab7d61e03993 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/mail_alter.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_mail_alter(). + */ +function {{ machine_name }}_mail_alter(&$message) { + if ($message['id'] == 'modulename_messagekey') { + if (!example_notifications_optin($message['to'], $message['id'])) { + // If the recipient has opted to not receive such messages, cancel + // sending. + $message['send'] = FALSE; + return; + } + $message['body'][] = "--\nMail sent out from " . variable_get('site_name', t('Drupal')); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu.twig new file mode 100644 index 0000000000000000000000000000000000000000..871bcfb319db92f079fa9b88a08f5e2f6bba5ef6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_menu(). + */ +function {{ machine_name }}_menu() { + $items['example'] = array( + 'title' => 'Example Page', + 'page callback' => 'example_page', + 'access arguments' => array('access content'), + 'type' => MENU_SUGGESTED_ITEM, + ); + $items['example/feed'] = array( + 'title' => 'Example RSS feed', + 'page callback' => 'example_feed', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9ea6b2c8646bee915dd03db48b363d18e606d0a3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_menu_alter(). + */ +function {{ machine_name }}_menu_alter(&$items) { + // Example - disable the page at node/add + $items['node/add']['access callback'] = FALSE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_breadcrumb_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_breadcrumb_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..bef85eb22f4a1cddd55d2bcdfb98613e309cf2e5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_breadcrumb_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_menu_breadcrumb_alter(). + */ +function {{ machine_name }}_menu_breadcrumb_alter(&$active_trail, $item) { + // Always display a link to the current page by duplicating the last link in + // the active trail. This means that menu_get_active_breadcrumb() will remove + // the last link (for the current page), but since it is added once more here, + // it will appear. + if (!drupal_is_front_page()) { + $end = end($active_trail); + if ($item['href'] == $end['href']) { + $active_trail[] = $end; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_contextual_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_contextual_links_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..21c365e30b0aa9d3cd2f2414bbc5da6bb2c2de17 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_contextual_links_alter.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_menu_contextual_links_alter(). + */ +function {{ machine_name }}_menu_contextual_links_alter(&$links, $router_item, $root_path) { + // Add a link to all contextual links for nodes. + if ($root_path == 'node/%') { + $links['foo'] = array( + 'title' => t('Do fu'), + 'href' => 'foo/do', + 'localized_options' => array( + 'query' => array( + 'foo' => 'bar', + ), + ), + ); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..b59b77c2e43a0ebe2cc1f0a525821839df810193 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_delete.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_menu_delete(). + */ +function {{ machine_name }}_menu_delete($menu) { + // Delete the record from our variable. + $my_menus = variable_get('my_module_menus', array()); + unset($my_menus[$menu['menu_name']]); + variable_set('my_module_menus', $my_menus); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_get_item_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_get_item_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d2c4925d9b6e7a6b8372d55df846ef6e4d7e6121 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_get_item_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_menu_get_item_alter(). + */ +function {{ machine_name }}_menu_get_item_alter(&$router_item, $path, $original_map) { + // When retrieving the router item for the current path... + if ($path == $_GET['q']) { + // ...call a function that prepares something for this request. + mymodule_prepare_something(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..658e177c573ea3b85827a8d92d1b91f5ae7a1b47 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_insert.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_menu_insert(). + */ +function {{ machine_name }}_menu_insert($menu) { + // For example, we track available menus in a variable. + $my_menus = variable_get('my_module_menus', array()); + $my_menus[$menu['menu_name']] = $menu['menu_name']; + variable_set('my_module_menus', $my_menus); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f3e95805cfaf28b5878c5dce8628785805d1dc4e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_alter.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_menu_link_alter(). + */ +function {{ machine_name }}_menu_link_alter(&$item) { + // Make all new admin links hidden (a.k.a disabled). + if (strpos($item['link_path'], 'admin') === 0 && empty($item['mlid'])) { + $item['hidden'] = 1; + } + // Flag a link to be altered by hook_translated_menu_link_alter(). + if ($item['link_path'] == 'devel/cache/clear') { + $item['options']['alter'] = TRUE; + } + // Flag a link to be altered by hook_translated_menu_link_alter(), but only + // if it is derived from a menu router item; i.e., do not alter a custom + // menu link pointing to the same path that has been created by a user. + if ($item['link_path'] == 'user' && $item['module'] == 'system') { + $item['options']['alter'] = TRUE; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..5e1ff92f1c0b017cd45936b8c3d15d8f91f8eda8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_delete.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_menu_link_delete(). + */ +function {{ machine_name }}_menu_link_delete($link) { + // Delete the record from our table. + db_delete('menu_example') + ->condition('mlid', $link['mlid']) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..97764ea927d405a7bad5c54d922bcb6f1483b2c8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_insert.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_menu_link_insert(). + */ +function {{ machine_name }}_menu_link_insert($link) { + // In our sample case, we track menu items as editing sections + // of the site. These are stored in our table as 'disabled' items. + $record['mlid'] = $link['mlid']; + $record['menu_name'] = $link['menu_name']; + $record['status'] = 0; + drupal_write_record('menu_example', $record); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..765056aa980741860c1cc6c744b6b2fda6a11da8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_update.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_menu_link_update(). + */ +function {{ machine_name }}_menu_link_update($link) { + // If the parent menu has changed, update our record. + $menu_name = db_query("SELECT menu_name FROM {menu_example} WHERE mlid = :mlid", array(':mlid' => $link['mlid']))->fetchField(); + if ($menu_name != $link['menu_name']) { + db_update('menu_example') + ->fields(array('menu_name' => $link['menu_name'])) + ->condition('mlid', $link['mlid']) + ->execute(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_local_tasks_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_local_tasks_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9abb2190124b7f82091bed071e35fd9db3b4e24e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_local_tasks_alter.twig @@ -0,0 +1,36 @@ +/** + * Implements hook_menu_local_tasks_alter(). + */ +function {{ machine_name }}_menu_local_tasks_alter(&$data, $router_item, $root_path) { + // Add an action linking to node/add to all pages. + $data['actions']['output'][] = array( + '#theme' => 'menu_local_task', + '#link' => array( + 'title' => t('Add new content'), + 'href' => 'node/add', + 'localized_options' => array( + 'attributes' => array( + 'title' => t('Add new content'), + ), + ), + ), + ); + + // Add a tab linking to node/add to all pages. + $data['tabs'][0]['output'][] = array( + '#theme' => 'menu_local_task', + '#link' => array( + 'title' => t('Example tab'), + 'href' => 'node/add', + 'localized_options' => array( + 'attributes' => array( + 'title' => t('Add new content'), + ), + ), + ), + // Define whether this link is active. This can be omitted for + // implementations that add links to pages outside of the current page + // context. + '#active' => ($router_item['path'] == $root_path), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_site_status_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_site_status_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..01656d3d2d7364fc0757f4740ea8ab0eba1a1dab --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_site_status_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_menu_site_status_alter(). + */ +function {{ machine_name }}_menu_site_status_alter(&$menu_site_status, $path) { + // Allow access to my_module/authentication even if site is in offline mode. + if ($menu_site_status == MENU_SITE_OFFLINE && user_is_anonymous() && $path == 'my_module/authentication') { + $menu_site_status = MENU_SITE_ONLINE; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..ed04a30d29873a0c392b95bbc3d175c1b07878ec --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_update.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_menu_update(). + */ +function {{ machine_name }}_menu_update($menu) { + // For example, we track available menus in a variable. + $my_menus = variable_get('my_module_menus', array()); + $my_menus[$menu['menu_name']] = $menu['menu_name']; + variable_set('my_module_menus', $my_menus); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/module_implements_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/module_implements_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..7fbe12576451e1f6c62208a17cc5b32a389cf128 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/module_implements_alter.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_module_implements_alter(). + */ +function {{ machine_name }}_module_implements_alter(&$implementations, $hook) { + if ($hook == 'rdf_mapping') { + // Move my_module_rdf_mapping() to the end of the list. module_implements() + // iterates through $implementations with a foreach loop which PHP iterates + // in the order that the items were added, so to move an item to the end of + // the array, we remove it and then add it. + $group = $implementations['my_module']; + unset($implementations['my_module']); + $implementations['my_module'] = $group; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_disabled.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_disabled.twig new file mode 100644 index 0000000000000000000000000000000000000000..8b28f496e74c8b29be45cae6e3640c03c25621b4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_disabled.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_modules_disabled(). + */ +function {{ machine_name }}_modules_disabled($modules) { + if (in_array('lousy_module', $modules)) { + mymodule_enable_functionality(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_enabled.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_enabled.twig new file mode 100644 index 0000000000000000000000000000000000000000..51dbf2b9947b40fffa26a89008a5cac80efc18c1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_enabled.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_modules_enabled(). + */ +function {{ machine_name }}_modules_enabled($modules) { + if (in_array('lousy_module', $modules)) { + drupal_set_message(t('mymodule is not compatible with lousy_module'), 'error'); + mymodule_disable_functionality(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_installed.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_installed.twig new file mode 100644 index 0000000000000000000000000000000000000000..592cbf88b6af8adc025dc5a972e4315b90a3e06e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_installed.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_modules_installed(). + */ +function {{ machine_name }}_modules_installed($modules) { + if (in_array('lousy_module', $modules)) { + variable_set('lousy_module_conflicting_variable', FALSE); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_uninstalled.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_uninstalled.twig new file mode 100644 index 0000000000000000000000000000000000000000..efc2dceaeaeb2f55deb60516b9872e563421de0d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/modules_uninstalled.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_modules_uninstalled(). + */ +function {{ machine_name }}_modules_uninstalled($modules) { + foreach ($modules as $module) { + db_delete('mymodule_table') + ->condition('module', $module) + ->execute(); + } + mymodule_cache_rebuild(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/multilingual_settings_changed.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/multilingual_settings_changed.twig new file mode 100644 index 0000000000000000000000000000000000000000..0d2782eb0c10b381d3b2b7a8ae49799def1aa870 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/multilingual_settings_changed.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_multilingual_settings_changed(). + */ +function {{ machine_name }}_multilingual_settings_changed() { + field_info_cache_clear(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..1c290c4dd4f7ab7ce8f94b0ad3fa59b7f3432662 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access.twig @@ -0,0 +1,27 @@ +/** + * Implements hook_node_access(). + */ +function {{ machine_name }}_node_access($node, $op, $account) { + $type = is_string($node) ? $node : $node->type; + + if (in_array($type, node_permissions_get_configured_types())) { + if ($op == 'create' && user_access('create ' . $type . ' content', $account)) { + return NODE_ACCESS_ALLOW; + } + + if ($op == 'update') { + if (user_access('edit any ' . $type . ' content', $account) || (user_access('edit own ' . $type . ' content', $account) && ($account->uid == $node->uid))) { + return NODE_ACCESS_ALLOW; + } + } + + if ($op == 'delete') { + if (user_access('delete any ' . $type . ' content', $account) || (user_access('delete own ' . $type . ' content', $account) && ($account->uid == $node->uid))) { + return NODE_ACCESS_ALLOW; + } + } + } + + // Returning nothing from this function would have the same effect. + return NODE_ACCESS_IGNORE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access_records.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access_records.twig new file mode 100644 index 0000000000000000000000000000000000000000..24afad910780135288d6fea421aacea8ea02c94f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access_records.twig @@ -0,0 +1,36 @@ +/** + * Implements hook_node_access_records(). + */ +function {{ machine_name }}_node_access_records($node) { + // We only care about the node if it has been marked private. If not, it is + // treated just like any other node and we completely ignore it. + if ($node->private) { + $grants = array(); + // Only published nodes should be viewable to all users. If we allow access + // blindly here, then all users could view an unpublished node. + if ($node->status) { + $grants[] = array( + 'realm' => 'example', + 'gid' => 1, + 'grant_view' => 1, + 'grant_update' => 0, + 'grant_delete' => 0, + 'priority' => 0, + ); + } + // For the example_author array, the GID is equivalent to a UID, which + // means there are many groups of just 1 user. + // Note that an author can always view his or her nodes, even if they + // have status unpublished. + $grants[] = array( + 'realm' => 'example_author', + 'gid' => $node->uid, + 'grant_view' => 1, + 'grant_update' => 1, + 'grant_delete' => 1, + 'priority' => 0, + ); + + return $grants; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access_records_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access_records_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..320883882a7da91a2986bdb24dcf73bfdf0ff688 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_access_records_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_node_access_records_alter(). + */ +function {{ machine_name }}_node_access_records_alter(&$grants, $node) { + // Our module allows editors to mark specific articles with the 'is_preview' + // field. If the node being saved has a TRUE value for that field, then only + // our grants are retained, and other grants are removed. Doing so ensures + // that our rules are enforced no matter what priority other grants are given. + if ($node->is_preview) { + // Our module grants are set in $grants['example']. + $temp = $grants['example']; + // Now remove all module grants but our own. + $grants = array('example' => $temp); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..460f17df916de5361b72a404196ec71beb633b22 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_node_delete(). + */ +function {{ machine_name }}_node_delete($node) { + db_delete('mytable') + ->condition('nid', $node->nid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_grants.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_grants.twig new file mode 100644 index 0000000000000000000000000000000000000000..340edc3a6a91a0b18c2a9dc5c30ebee6c7d12721 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_grants.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_node_grants(). + */ +function {{ machine_name }}_node_grants($account, $op) { + if (user_access('access private content', $account)) { + $grants['example'] = array(1); + } + $grants['example_author'] = array($account->uid); + return $grants; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_grants_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_grants_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b7663901fa74dd2139e7be0de545214fe6a4ca68 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_grants_alter.twig @@ -0,0 +1,21 @@ +/** + * Implements hook_node_grants_alter(). + */ +function {{ machine_name }}_node_grants_alter(&$grants, $account, $op) { + // Our sample module never allows certain roles to edit or delete + // content. Since some other node access modules might allow this + // permission, we expressly remove it by returning an empty $grants + // array for roles specified in our variable setting. + + // Get our list of banned roles. + $restricted = variable_get('example_restricted_roles', array()); + + if ($op != 'view' && !empty($restricted)) { + // Now check the roles for this account against the restrictions. + foreach ($restricted as $role_id) { + if (isset($account->roles[$role_id])) { + $grants = array(); + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..eee1448d05b647600d7045b6533e5e9cff577a06 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_info.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_node_info(). + */ +function {{ machine_name }}_node_info() { + return array( + 'blog' => array( + 'name' => t('Blog entry'), + 'base' => 'blog', + 'description' => t('Use for multi-user blogs. Every user gets a personal blog.'), + ) + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..e8cd55b827e3dbe6bdee5669721364c9f07b6ff6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_insert.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_node_insert(). + */ +function {{ machine_name }}_node_insert($node) { + db_insert('mytable') + ->fields(array( + 'nid' => $node->nid, + 'extra' => $node->extra, + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..2eba93e3373acf681eef3ee9ade52802f09ca8bb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_load.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_node_load(). + */ +function {{ machine_name }}_node_load($nodes, $types) { + // Decide whether any of $types are relevant to our purposes. + if (count(array_intersect($types_we_want_to_process, $types))) { + // Gather our extra data for each of these nodes. + $result = db_query('SELECT nid, foo FROM {mytable} WHERE nid IN(:nids)', array(':nids' => array_keys($nodes))); + // Add our extra data to the node objects. + foreach ($result as $record) { + $nodes[$record->nid]->foo = $record->foo; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_operations.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_operations.twig new file mode 100644 index 0000000000000000000000000000000000000000..d0f2b7a6f68a44f54dd32c61b7a4c7415b4ee6d5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_operations.twig @@ -0,0 +1,42 @@ +/** + * Implements hook_node_operations(). + */ +function {{ machine_name }}_node_operations() { + $operations = array( + 'publish' => array( + 'label' => t('Publish selected content'), + 'callback' => 'node_mass_update', + 'callback arguments' => array('updates' => array('status' => NODE_PUBLISHED)), + ), + 'unpublish' => array( + 'label' => t('Unpublish selected content'), + 'callback' => 'node_mass_update', + 'callback arguments' => array('updates' => array('status' => NODE_NOT_PUBLISHED)), + ), + 'promote' => array( + 'label' => t('Promote selected content to front page'), + 'callback' => 'node_mass_update', + 'callback arguments' => array('updates' => array('status' => NODE_PUBLISHED, 'promote' => NODE_PROMOTED)), + ), + 'demote' => array( + 'label' => t('Demote selected content from front page'), + 'callback' => 'node_mass_update', + 'callback arguments' => array('updates' => array('promote' => NODE_NOT_PROMOTED)), + ), + 'sticky' => array( + 'label' => t('Make selected content sticky'), + 'callback' => 'node_mass_update', + 'callback arguments' => array('updates' => array('status' => NODE_PUBLISHED, 'sticky' => NODE_STICKY)), + ), + 'unsticky' => array( + 'label' => t('Make selected content not sticky'), + 'callback' => 'node_mass_update', + 'callback arguments' => array('updates' => array('sticky' => NODE_NOT_STICKY)), + ), + 'delete' => array( + 'label' => t('Delete selected content'), + 'callback' => NULL, + ), + ); + return $operations; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_prepare.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_prepare.twig new file mode 100644 index 0000000000000000000000000000000000000000..48813648241cc4e4a2aef23c51ed254bad195b9f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_prepare.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_node_prepare(). + */ +function {{ machine_name }}_node_prepare($node) { + if (!isset($node->comment)) { + $node->comment = variable_get("comment_$node->type", COMMENT_NODE_OPEN); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..2f0f75a075032acca550eae6ea06ec4fbceb286a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_presave.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_node_presave(). + */ +function {{ machine_name }}_node_presave($node) { + if ($node->nid && $node->moderate) { + // Reset votes when node is updated: + $node->score = 0; + $node->users = ''; + $node->votes = 0; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_revision_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_revision_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..ba98567eb6471cda0fd2589dcb670c0e7de7270b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_revision_delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_node_revision_delete(). + */ +function {{ machine_name }}_node_revision_delete($node) { + db_delete('mytable') + ->condition('vid', $node->vid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_search_result.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_search_result.twig new file mode 100644 index 0000000000000000000000000000000000000000..9372dc179998f678df2563b09d8f998ac722e522 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_search_result.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_node_search_result(). + */ +function {{ machine_name }}_node_search_result($node) { + $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField(); + return array('comment' => format_plural($comments, '1 comment', '@count comments')); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_submit.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_submit.twig new file mode 100644 index 0000000000000000000000000000000000000000..b04ec0cfd31bdc95c8fc616ac6e5fce0dae07bfc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_submit.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_node_submit(). + */ +function {{ machine_name }}_node_submit($node, $form, &$form_state) { + // Decompose the selected menu parent option into 'menu_name' and 'plid', if + // the form used the default parent selection widget. + if (!empty($form_state['values']['menu']['parent'])) { + list($node->menu['menu_name'], $node->menu['plid']) = explode(':', $form_state['values']['menu']['parent']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..c4afe57ce47b38d04af093c869b0bdd85c8f6d4c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_delete.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_node_type_delete(). + */ +function {{ machine_name }}_node_type_delete($info) { + variable_del('comment_' . $info->type); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..35490cbba9bdb91d1c397711440ef4f51818bcb8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_insert.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_node_type_insert(). + */ +function {{ machine_name }}_node_type_insert($info) { + drupal_set_message(t('You have just created a content type with a machine name %type.', array('%type' => $info->type))); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..28ea1743d15f4312ed5e665efa87d7c218ffdb07 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_type_update.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_node_type_update(). + */ +function {{ machine_name }}_node_type_update($info) { + if (!empty($info->old_type) && $info->old_type != $info->type) { + $setting = variable_get('comment_' . $info->old_type, COMMENT_NODE_OPEN); + variable_del('comment_' . $info->old_type); + variable_set('comment_' . $info->type, $setting); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..7d92d9de08db7539e01b1fa333ae237f76635a58 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_update.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_node_update(). + */ +function {{ machine_name }}_node_update($node) { + db_update('mytable') + ->fields(array('extra' => $node->extra)) + ->condition('nid', $node->nid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_update_index.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_update_index.twig new file mode 100644 index 0000000000000000000000000000000000000000..42e533fb3762335fa960f3b5d9f11a26a471aaa8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_update_index.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_node_update_index(). + */ +function {{ machine_name }}_node_update_index($node) { + $text = ''; + $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(':nid' => $node->nid, ':status' => COMMENT_PUBLISHED)); + foreach ($comments as $comment) { + $text .= '<h2>' . check_plain($comment->subject) . '</h2>' . check_markup($comment->comment, $comment->format, '', TRUE); + } + return $text; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_validate.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_validate.twig new file mode 100644 index 0000000000000000000000000000000000000000..ac37efce75cf5f466c8fd9ad100bb8aac14d8059 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_validate.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_node_validate(). + */ +function {{ machine_name }}_node_validate($node, $form, &$form_state) { + if (isset($node->end) && isset($node->start)) { + if ($node->start > $node->end) { + form_set_error('time', t('An event may not end before it starts.')); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..86019fccd1542806f135fed3ecc45e216bd78d6d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_view.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_node_view(). + */ +function {{ machine_name }}_node_view($node, $view_mode, $langcode) { + $node->content['my_additional_field'] = array( + '#markup' => $additional_field, + '#weight' => 10, + '#theme' => 'mymodule_my_additional_field', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..3316300856e689746c3dfc428b3f2e1f5845fb8b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_view_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_node_view_alter(). + */ +function {{ machine_name }}_node_view_alter(&$build) { + if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { + // Change its weight. + $build['an_additional_field']['#weight'] = -10; + } + + // Add a #post_render callback to act on the rendered HTML of the node. + $build['#post_render'][] = 'my_module_node_post_render'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid.twig new file mode 100644 index 0000000000000000000000000000000000000000..8e0e9f38e13c29f55a9b3797e408791f341ca9a5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_openid(). + */ +function {{ machine_name }}_openid($op, $request) { + if ($op == 'request') { + $request['openid.identity'] = 'http://myname.myopenid.com/'; + } + return $request; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_discovery_method_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_discovery_method_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..5f212fe2b6b4301016ebd3b01e3d2c86bb44d584 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_discovery_method_info.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_openid_discovery_method_info(). + */ +function {{ machine_name }}_openid_discovery_method_info() { + return array( + 'new_discovery_idea' => '_my_discovery_method', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_discovery_method_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_discovery_method_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..374d67c9f6969c1f6071bc9e72e6be0fac58afec --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_discovery_method_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_openid_discovery_method_info_alter(). + */ +function {{ machine_name }}_openid_discovery_method_info_alter(&$methods) { + // Remove XRI discovery scheme. + unset($methods['xri']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_normalization_method_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_normalization_method_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..95e630133059fe65269adb95d01a6dc62cda4a2d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_normalization_method_info.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_openid_normalization_method_info(). + */ +function {{ machine_name }}_openid_normalization_method_info() { + return array( + 'new_normalization_idea' => '_my_normalization_method', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_normalization_method_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_normalization_method_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..40581702187916d650946e38370cd10af59ecc03 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_normalization_method_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_openid_normalization_method_info_alter(). + */ +function {{ machine_name }}_openid_normalization_method_info_alter(&$methods) { + // Remove Google IDP normalization. + unset($methods['google_idp']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_response.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_response.twig new file mode 100644 index 0000000000000000000000000000000000000000..476b66c1e9ac178e9e168d869b930d12bf69f1de --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/openid_response.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_openid_response(). + */ +function {{ machine_name }}_openid_response($response, $account) { + if (isset($response['openid.ns.ax'])) { + _mymodule_store_ax_fields($response, $account); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/options_list.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/options_list.twig new file mode 100644 index 0000000000000000000000000000000000000000..0934dc8d9c8dc94fcc30a994fd0987048d8fed86 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/options_list.twig @@ -0,0 +1,40 @@ +/** + * Implements hook_options_list(). + */ +function {{ machine_name }}_options_list($field, $instance, $entity_type, $entity) { + // Sample structure. + $options = array( + 0 => t('Zero'), + 1 => t('One'), + 2 => t('Two'), + 3 => t('Three'), + ); + + // Sample structure with groups. Only one level of nesting is allowed. This + // is only supported by the 'options_select' widget. Other widgets will + // flatten the array. + $options = array( + t('First group') => array( + 0 => t('Zero'), + ), + t('Second group') => array( + 1 => t('One'), + 2 => t('Two'), + ), + 3 => t('Three'), + ); + + // In actual implementations, the array of options will most probably depend + // on properties of the field. Example from taxonomy.module: + $options = array(); + foreach ($field['settings']['allowed_values'] as $tree) { + $terms = taxonomy_get_tree($tree['vid'], $tree['parent']); + if ($terms) { + foreach ($terms as $term) { + $options[$term->tid] = str_repeat('-', $term->depth) . $term->name; + } + } + } + + return $options; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/overlay_child_initialize.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/overlay_child_initialize.twig new file mode 100644 index 0000000000000000000000000000000000000000..1c26aa89e80cccc32bb6076bc4feca275ba0eb41 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/overlay_child_initialize.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_overlay_child_initialize(). + */ +function {{ machine_name }}_overlay_child_initialize() { + // Add our custom JavaScript. + drupal_add_js(drupal_get_path('module', 'hook') . '/hook-overlay-child.js'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/overlay_parent_initialize.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/overlay_parent_initialize.twig new file mode 100644 index 0000000000000000000000000000000000000000..18dc7c2877c5600fa4a93455fe56d018fae91755 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/overlay_parent_initialize.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_overlay_parent_initialize(). + */ +function {{ machine_name }}_overlay_parent_initialize() { + // Add our custom JavaScript. + drupal_add_js(drupal_get_path('module', 'hook') . '/hook-overlay.js'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d29b114f6ef1b62e0efe774ff9d67de36ca743f0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_page_alter(). + */ +function {{ machine_name }}_page_alter(&$page) { + // Add help text to the user login block. + $page['sidebar_first']['user_login']['help'] = array( + '#weight' => -10, + '#markup' => t('To post comments or add new content, you first have to log in.'), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_build.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_build.twig new file mode 100644 index 0000000000000000000000000000000000000000..3f660889f439f81aff3a84ff857c1b081a65f842 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_build.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_page_build(). + */ +function {{ machine_name }}_page_build(&$page) { + if (menu_get_object('node', 1)) { + // We are on a node detail page. Append a standard disclaimer to the + // content region. + $page['content']['disclaimer'] = array( + '#markup' => t('Acme, Inc. is not responsible for the contents of this sample code.'), + '#weight' => 25, + ); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_delivery_callback_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_delivery_callback_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..3c1ae81d2fe1dc15d33ea3ec6a775fbb875a716e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/page_delivery_callback_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_page_delivery_callback_alter(). + */ +function {{ machine_name }}_page_delivery_callback_alter(&$callback) { + // jQuery sets a HTTP_X_REQUESTED_WITH header of 'XMLHttpRequest'. + // If a page would normally be delivered as an html page, and it is called + // from jQuery, deliver it instead as an Ajax response. + if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && $callback == 'drupal_deliver_html_page') { + $callback = 'ajax_deliver'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..a6b38c37807bd746cd7c57e15d98703dec20b9e3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_path_delete(). + */ +function {{ machine_name }}_path_delete($path) { + db_delete('mytable') + ->condition('pid', $path['pid']) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..7a43127fff4adb208178cd99628d7629bee96047 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_insert.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_path_insert(). + */ +function {{ machine_name }}_path_insert($path) { + db_insert('mytable') + ->fields(array( + 'alias' => $path['alias'], + 'pid' => $path['pid'], + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..19b7067268072c03e026cb95d6dd58f26f382b69 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/path_update.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_path_update(). + */ +function {{ machine_name }}_path_update($path) { + db_update('mytable') + ->fields(array('alias' => $path['alias'])) + ->condition('pid', $path['pid']) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/permission.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/permission.twig new file mode 100644 index 0000000000000000000000000000000000000000..3a4510196921f35b4f308aee3a7cded86d8faad6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/permission.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_permission(). + */ +function {{ machine_name }}_permission() { + return array( + 'administer my module' => array( + 'title' => t('Administer my module'), + 'description' => t('Perform administration tasks for my module.'), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/prepare.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/prepare.twig new file mode 100644 index 0000000000000000000000000000000000000000..b663f54582f7ddc8bacf684d31495a557eeec2b6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/prepare.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_prepare(). + */ +function {{ machine_name }}_prepare($node) { + if (!isset($node->mymodule_value)) { + $node->mymodule_value = 'foo'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/preprocess.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/preprocess.twig new file mode 100644 index 0000000000000000000000000000000000000000..fa36102d37a7efdc90d71020a86de5652d513a19 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/preprocess.twig @@ -0,0 +1,36 @@ +/** + * Implements hook_preprocess(). + */ +function {{ machine_name }}_preprocess(&$variables, $hook) { + static $hooks; + + // Add contextual links to the variables, if the user has permission. + + if (!user_access('access contextual links')) { + return; + } + + if (!isset($hooks)) { + $hooks = theme_get_registry(); + } + + // Determine the primary theme function argument. + if (isset($hooks[$hook]['variables'])) { + $keys = array_keys($hooks[$hook]['variables']); + $key = $keys[0]; + } + else { + $key = $hooks[$hook]['render element']; + } + + if (isset($variables[$key])) { + $element = $variables[$key]; + } + + if (isset($element) && is_array($element) && !empty($element['#contextual_links'])) { + $variables['title_suffix']['contextual_links'] = contextual_links_view($element); + if (!empty($variables['title_suffix']['contextual_links'])) { + $variables['classes_array'][] = 'contextual-links-region'; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/preprocess_HOOK.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/preprocess_HOOK.twig new file mode 100644 index 0000000000000000000000000000000000000000..8f7f4704442a722117232bc266fe479f891db771 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/preprocess_HOOK.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_preprocess_HOOK(). + */ +function {{ machine_name }}_preprocess_HOOK(&$variables) { + // This example is from rdf_preprocess_image(). It adds an RDF attribute + // to the image hook's variables. + $variables['attributes']['typeof'] = array('foaf:Image'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/process.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/process.twig new file mode 100644 index 0000000000000000000000000000000000000000..cd42c89c29f45139e262e02f5576fc0cb639f41d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/process.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_process(). + */ +function {{ machine_name }}_process(&$variables, $hook) { + // Wraps variables in RDF wrappers. + if (!empty($variables['rdf_template_variable_attributes_array'])) { + foreach ($variables['rdf_template_variable_attributes_array'] as $variable_name => $attributes) { + $context = array( + 'hook' => $hook, + 'variable_name' => $variable_name, + 'variables' => $variables, + ); + $variables[$variable_name] = theme('rdf_template_variable_wrapper', array('content' => $variables[$variable_name], 'attributes' => $attributes, 'context' => $context)); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/process_HOOK.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/process_HOOK.twig new file mode 100644 index 0000000000000000000000000000000000000000..8f170394a90b54cc169618bbc53669a93c44fda1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/process_HOOK.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_process_HOOK(). + */ +function {{ machine_name }}_process_HOOK(&$variables) { + // @todo There are no use-cases in Drupal core for this hook. Find one from a + // contributed module, or come up with a good example. Coming up with a good + // example might be tough, since the intent is for nearly everything to be + // achievable via preprocess functions, and for process functions to only be + // used when requiring the later execution time. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/query_TAG_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/query_TAG_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..60974e3e4857be3154a062dc8b7006e3701eb823 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/query_TAG_alter.twig @@ -0,0 +1,35 @@ +/** + * Implements hook_query_TAG_alter(). + */ +function {{ machine_name }}_query_TAG_alter(QueryAlterableInterface $query) { + // Skip the extra expensive alterations if site has no node access control modules. + if (!node_access_view_all_nodes()) { + // Prevent duplicates records. + $query->distinct(); + // The recognized operations are 'view', 'update', 'delete'. + if (!$op = $query->getMetaData('op')) { + $op = 'view'; + } + // Skip the extra joins and conditions for node admins. + if (!user_access('bypass node access')) { + // The node_access table has the access grants for any given node. + $access_alias = $query->join('node_access', 'na', '%alias.nid = n.nid'); + $or = db_or(); + // If any grant exists for the specified user, then user has access to the node for the specified operation. + foreach (node_access_grants($op, $query->getMetaData('account')) as $realm => $gids) { + foreach ($gids as $gid) { + $or->condition(db_and() + ->condition($access_alias . '.gid', $gid) + ->condition($access_alias . '.realm', $realm) + ); + } + } + + if (count($or->conditions())) { + $query->condition($or); + } + + $query->condition($access_alias . 'grant_' . $op, 1, '>='); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/query_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/query_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..1238cae1dc289a503b58f786e4c550aebe0a8784 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/query_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_query_alter(). + */ +function {{ machine_name }}_query_alter(QueryAlterableInterface $query) { + if ($query->hasTag('micro_limit')) { + $query->range(0, 2); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/ranking.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/ranking.twig new file mode 100644 index 0000000000000000000000000000000000000000..2d6ae32c8c8e918a2329fe5b07816388d8094132 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/ranking.twig @@ -0,0 +1,26 @@ +/** + * Implements hook_ranking(). + */ +function {{ machine_name }}_ranking() { + // If voting is disabled, we can avoid returning the array, no hard feelings. + if (variable_get('vote_node_enabled', TRUE)) { + return array( + 'vote_average' => array( + 'title' => t('Average vote'), + // Note that we use i.sid, the search index's search item id, rather than + // n.nid. + 'join' => array( + 'type' => 'LEFT', + 'table' => 'vote_node_data', + 'alias' => 'vote_node_data', + 'on' => 'vote_node_data.nid = i.sid', + ), + // The highest possible score should be 1, and the lowest possible score, + // always 0, should be 0. + 'score' => 'vote_node_data.average / CAST(%f AS DECIMAL)', + // Pass in the highest possible voting score as a decimal argument. + 'arguments' => array(variable_get('vote_score_max', 5)), + ), + ); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/rdf_mapping.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/rdf_mapping.twig new file mode 100644 index 0000000000000000000000000000000000000000..3b5344ca5a715b8d76c2cc4536a6d1af5f2bd05d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/rdf_mapping.twig @@ -0,0 +1,32 @@ +/** + * Implements hook_rdf_mapping(). + */ +function {{ machine_name }}_rdf_mapping() { + return array( + array( + 'type' => 'node', + 'bundle' => 'blog', + 'mapping' => array( + 'rdftype' => array('sioct:Weblog'), + 'title' => array( + 'predicates' => array('dc:title'), + ), + 'created' => array( + 'predicates' => array('dc:date', 'dc:created'), + 'datatype' => 'xsd:dateTime', + 'callback' => 'date_iso8601', + ), + 'body' => array( + 'predicates' => array('content:encoded'), + ), + 'uid' => array( + 'predicates' => array('sioc:has_creator'), + 'type' => 'rel', + ), + 'name' => array( + 'predicates' => array('foaf:name'), + ), + ), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/rdf_namespaces.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/rdf_namespaces.twig new file mode 100644 index 0000000000000000000000000000000000000000..997ac542166e444f9e7d94852019926855c51876 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/rdf_namespaces.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_rdf_namespaces(). + */ +function {{ machine_name }}_rdf_namespaces() { + return array( + 'content' => 'http://purl.org/rss/1.0/modules/content/', + 'dc' => 'http://purl.org/dc/terms/', + 'foaf' => 'http://xmlns.com/foaf/0.1/', + 'og' => 'http://ogp.me/ns#', + 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', + 'sioc' => 'http://rdfs.org/sioc/ns#', + 'sioct' => 'http://rdfs.org/sioc/types#', + 'skos' => 'http://www.w3.org/2004/02/skos/core#', + 'xsd' => 'http://www.w3.org/2001/XMLSchema#', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/registry_files_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/registry_files_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..fc4dc58de798cad183eac52689d7a9b53dde303f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/registry_files_alter.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_registry_files_alter(). + */ +function {{ machine_name }}_registry_files_alter(&$files, $modules) { + foreach ($modules as $module) { + // Only add test files for disabled modules, as enabled modules should + // already include any test files they provide. + if (!$module->status) { + $dir = $module->dir; + foreach ($module->info['files'] as $file) { + if (substr($file, -5) == '.test') { + $files["$dir/$file"] = array('module' => $module->name, 'weight' => $module->weight); + } + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/requirements.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/requirements.twig new file mode 100644 index 0000000000000000000000000000000000000000..10d58fca3003052fb4228b03309b47493442b118 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/requirements.twig @@ -0,0 +1,49 @@ +/** + * Implements hook_requirements(). + */ +function {{ machine_name }}_requirements($phase) { + $requirements = array(); + // Ensure translations don't break during installation. + $t = get_t(); + + // Report Drupal version + if ($phase == 'runtime') { + $requirements['drupal'] = array( + 'title' => $t('Drupal'), + 'value' => VERSION, + 'severity' => REQUIREMENT_INFO + ); + } + + // Test PHP version + $requirements['php'] = array( + 'title' => $t('PHP'), + 'value' => ($phase == 'runtime') ? l(phpversion(), 'admin/reports/status/php') : phpversion(), + ); + if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) { + $requirements['php']['description'] = $t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); + $requirements['php']['severity'] = REQUIREMENT_ERROR; + } + + // Report cron status + if ($phase == 'runtime') { + $cron_last = variable_get('cron_last'); + + if (is_numeric($cron_last)) { + $requirements['cron']['value'] = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last))); + } + else { + $requirements['cron'] = array( + 'description' => $t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for <a href="@url">configuring cron jobs</a>.', array('@url' => 'http://drupal.org/cron')), + 'severity' => REQUIREMENT_ERROR, + 'value' => $t('Never run'), + ); + } + + $requirements['cron']['description'] .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron'))); + + $requirements['cron']['title'] = $t('Cron maintenance tasks'); + } + + return $requirements; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..3294edfc40a84af62dd0473740b5a1d9f80014b4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema.twig @@ -0,0 +1,60 @@ +/** + * Implements hook_schema(). + */ +function {{ machine_name }}_schema() { + $schema['node'] = array( + // Example (partial) specification for table "node". + 'description' => 'The base table for nodes.', + 'fields' => array( + 'nid' => array( + 'description' => 'The primary identifier for a node.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'vid' => array( + 'description' => 'The current {node_revision}.vid version identifier.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'type' => array( + 'description' => 'The {node_type} of this node.', + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'title' => array( + 'description' => 'The title of this node, always treated as non-markup plain text.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + ), + 'indexes' => array( + 'node_changed' => array('changed'), + 'node_created' => array('created'), + ), + 'unique keys' => array( + 'nid_vid' => array('nid', 'vid'), + 'vid' => array('vid'), + ), + // For documentation purposes only; foreign keys are not created in the + // database. + 'foreign keys' => array( + 'node_revision' => array( + 'table' => 'node_revision', + 'columns' => array('vid' => 'vid'), + ), + 'node_author' => array( + 'table' => 'users', + 'columns' => array('uid' => 'uid'), + ), + ), + 'primary key' => array('nid'), + ); + return $schema; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..4a7ae8f0266623e909b9495b9185fb91e358d84b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_schema_alter(). + */ +function {{ machine_name }}_schema_alter(&$schema) { + // Add field to existing schema. + $schema['users']['fields']['timezone_id'] = array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Per-user timezone configuration.', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..2ba37aacd97652fdcc70353f61b92c535fd04dd5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_access.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_search_access(). + */ +function {{ machine_name }}_search_access() { + return user_access('access content'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_admin.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_admin.twig new file mode 100644 index 0000000000000000000000000000000000000000..7459bf9ee14cb19fc8b29a50e1dc37369d1fef57 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_admin.twig @@ -0,0 +1,26 @@ +/** + * Implements hook_search_admin(). + */ +function {{ machine_name }}_search_admin() { + // Output form for defining rank factor weights. + $form['content_ranking'] = array( + '#type' => 'fieldset', + '#title' => t('Content ranking'), + ); + $form['content_ranking']['#theme'] = 'node_search_admin'; + $form['content_ranking']['info'] = array( + '#value' => '<em>' . t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') . '</em>' + ); + + // Note: reversed to reflect that higher number = higher ranking. + $options = drupal_map_assoc(range(0, 10)); + foreach (module_invoke_all('ranking') as $var => $values) { + $form['content_ranking']['factors']['node_rank_' . $var] = array( + '#title' => $values['title'], + '#type' => 'select', + '#options' => $options, + '#default_value' => variable_get('node_rank_' . $var, 0), + ); + } + return $form; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_execute.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_execute.twig new file mode 100644 index 0000000000000000000000000000000000000000..49ecbb5ac4a4559944791cafc9ec8bb989138a75 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_execute.twig @@ -0,0 +1,58 @@ +/** + * Implements hook_search_execute(). + */ +function {{ machine_name }}_search_execute($keys = NULL, $conditions = NULL) { + // Build matching conditions + $query = db_select('search_index', 'i', array('target' => 'slave'))->extend('SearchQuery')->extend('PagerDefault'); + $query->join('node', 'n', 'n.nid = i.sid'); + $query + ->condition('n.status', 1) + ->addTag('node_access') + ->searchExpression($keys, 'node'); + + // Insert special keywords. + $query->setOption('type', 'n.type'); + $query->setOption('language', 'n.language'); + if ($query->setOption('term', 'ti.tid')) { + $query->join('taxonomy_index', 'ti', 'n.nid = ti.nid'); + } + // Only continue if the first pass query matches. + if (!$query->executeFirstPass()) { + return array(); + } + + // Add the ranking expressions. + _node_rankings($query); + + // Load results. + $find = $query + ->limit(10) + ->execute(); + $results = array(); + foreach ($find as $item) { + // Build the node body. + $node = node_load($item->sid); + node_build_content($node, 'search_result'); + $node->body = drupal_render($node->content); + + // Fetch comments for snippet. + $node->rendered .= ' ' . module_invoke('comment', 'node_update_index', $node); + // Fetch terms for snippet. + $node->rendered .= ' ' . module_invoke('taxonomy', 'node_update_index', $node); + + $extra = module_invoke_all('node_search_result', $node); + + $results[] = array( + 'link' => url('node/' . $item->sid, array('absolute' => TRUE)), + 'type' => check_plain(node_type_get_name($node)), + 'title' => $node->title, + 'user' => theme('username', array('account' => $node)), + 'date' => $node->changed, + 'node' => $node, + 'extra' => $extra, + 'score' => $item->calculated_score, + 'snippet' => search_excerpt($keys, $node->body), + ); + } + return $results; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..e4e0c3c7310afd7a13c13a3e67a580492026b4b6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_info.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_search_info(). + */ +function {{ machine_name }}_search_info() { + // Make the title translatable. + t('Content'); + + return array( + 'title' => 'Content', + 'path' => 'node', + 'conditions_callback' => 'callback_search_conditions', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_page.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_page.twig new file mode 100644 index 0000000000000000000000000000000000000000..0aff6594fb735c487b591c2ca4853d51848d9413 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_page.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_search_page(). + */ +function {{ machine_name }}_search_page($results) { + $output['prefix']['#markup'] = '<ol class="search-results">'; + + foreach ($results as $entry) { + $output[] = array( + '#theme' => 'search_result', + '#result' => $entry, + '#module' => 'my_module_name', + ); + } + $output['suffix']['#markup'] = '</ol>' . theme('pager'); + + return $output; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_preprocess.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_preprocess.twig new file mode 100644 index 0000000000000000000000000000000000000000..a38c6158d0444a3b87b10b16be9cf696313105ee --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_preprocess.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_search_preprocess(). + */ +function {{ machine_name }}_search_preprocess($text) { + // Do processing on $text + return $text; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_reset.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_reset.twig new file mode 100644 index 0000000000000000000000000000000000000000..b44388e8d78d0ebe98d02de647cfd14299413cab --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_reset.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_search_reset(). + */ +function {{ machine_name }}_search_reset() { + db_update('search_dataset') + ->fields(array('reindex' => REQUEST_TIME)) + ->condition('type', 'node') + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_status.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_status.twig new file mode 100644 index 0000000000000000000000000000000000000000..56814d3af859152d5d72bdf0090b1c9e51f1ab93 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/search_status.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_search_status(). + */ +function {{ machine_name }}_search_status() { + $total = db_query('SELECT COUNT(*) FROM {node} WHERE status = 1')->fetchField(); + $remaining = db_query("SELECT COUNT(*) FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE n.status = 1 AND d.sid IS NULL OR d.reindex <> 0")->fetchField(); + return array('remaining' => $remaining, 'total' => $total); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/shortcut_default_set.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/shortcut_default_set.twig new file mode 100644 index 0000000000000000000000000000000000000000..0eb4405907c4f0cc9b4dfc298cbde8e4b23d8e9e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/shortcut_default_set.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_shortcut_default_set(). + */ +function {{ machine_name }}_shortcut_default_set($account) { + // Use a special set of default shortcuts for administrators only. + if (in_array(variable_get('user_admin_role', 0), $account->roles)) { + return variable_get('mymodule_shortcut_admin_default_set'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/simpletest_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/simpletest_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..98cc76eff7cf8c7899026092c49cc9a84f9e25dc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/simpletest_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_simpletest_alter(). + */ +function {{ machine_name }}_simpletest_alter(&$groups) { + // An alternative session handler module would not want to run the original + // Session HTTPS handling test because it checks the sessions table in the + // database. + unset($groups['Session']['testHttpsSession']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/stream_wrappers.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/stream_wrappers.twig new file mode 100644 index 0000000000000000000000000000000000000000..b695608886703b8d657933921c16f1356af8c87a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/stream_wrappers.twig @@ -0,0 +1,40 @@ +/** + * Implements hook_stream_wrappers(). + */ +function {{ machine_name }}_stream_wrappers() { + return array( + 'public' => array( + 'name' => t('Public files'), + 'class' => 'DrupalPublicStreamWrapper', + 'description' => t('Public local files served by the webserver.'), + 'type' => STREAM_WRAPPERS_LOCAL_NORMAL, + ), + 'private' => array( + 'name' => t('Private files'), + 'class' => 'DrupalPrivateStreamWrapper', + 'description' => t('Private local files served by Drupal.'), + 'type' => STREAM_WRAPPERS_LOCAL_NORMAL, + ), + 'temp' => array( + 'name' => t('Temporary files'), + 'class' => 'DrupalTempStreamWrapper', + 'description' => t('Temporary local files for upload and previews.'), + 'type' => STREAM_WRAPPERS_LOCAL_HIDDEN, + ), + 'cdn' => array( + 'name' => t('Content delivery network files'), + 'class' => 'MyModuleCDNStreamWrapper', + 'description' => t('Files served by a content delivery network.'), + // 'type' can be omitted to use the default of STREAM_WRAPPERS_NORMAL + ), + 'youtube' => array( + 'name' => t('YouTube video'), + 'class' => 'MyModuleYouTubeStreamWrapper', + 'description' => t('Video streamed from YouTube.'), + // A module implementing YouTube integration may decide to support using + // the YouTube API for uploading video, but here, we assume that this + // particular module only supports playing YouTube video. + 'type' => STREAM_WRAPPERS_READ_VISIBLE, + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/stream_wrappers_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/stream_wrappers_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..39b58a0eecb8b194d4ac48e2c3f1e9ee82439211 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/stream_wrappers_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_stream_wrappers_alter(). + */ +function {{ machine_name }}_stream_wrappers_alter(&$wrappers) { + // Change the name of private files to reflect the performance. + $wrappers['private']['name'] = t('Slow files'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6b07505bde8d498b5434560950cb45a3c305f80c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_system_info_alter(). + */ +function {{ machine_name }}_system_info_alter(&$info, $file, $type) { + // Only fill this in if the .info file does not define a 'datestamp'. + if (empty($info['datestamp'])) { + $info['datestamp'] = filemtime($file->filename); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_theme_engine_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_theme_engine_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..70d508b10361ed264ae408187699766be10f3e2b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_theme_engine_info.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_system_theme_engine_info(). + */ +function {{ machine_name }}_system_theme_engine_info() { + $theme_engines['izumi'] = drupal_get_path('module', 'mymodule') . '/izumi/izumi.engine'; + return $theme_engines; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_theme_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_theme_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..de5095c3c4903be91bb673269041f03a4ccbe8aa --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_theme_info.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_system_theme_info(). + */ +function {{ machine_name }}_system_theme_info() { + $themes['mymodule_test_theme'] = drupal_get_path('module', 'mymodule') . '/mymodule_test_theme/mymodule_test_theme.info'; + return $themes; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_themes_page_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_themes_page_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..722792be4dd0f38e7817667abe6d675e516599a2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/system_themes_page_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_system_themes_page_alter(). + */ +function {{ machine_name }}_system_themes_page_alter(&$theme_groups) { + foreach ($theme_groups as $state => &$group) { + foreach ($theme_groups[$state] as &$theme) { + // Add a foo link to each list of theme operations. + $theme->operations[] = array( + 'title' => t('Foo'), + 'href' => 'admin/appearance/foo', + 'query' => array('theme' => $theme->name) + ); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..277ad4bc9696f4e0cb1134fe7c932fe43442d673 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_taxonomy_term_delete(). + */ +function {{ machine_name }}_taxonomy_term_delete($term) { + db_delete('mytable') + ->condition('tid', $term->tid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..ee7706096e634ff2e247afa9b9bd8cbe5e9d7255 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_insert.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_taxonomy_term_insert(). + */ +function {{ machine_name }}_taxonomy_term_insert($term) { + db_insert('mytable') + ->fields(array( + 'tid' => $term->tid, + 'foo' => $term->foo, + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..a8b08a741bd017505ea8fb764d5fcc0344b6bef0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_load.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_taxonomy_term_load(). + */ +function {{ machine_name }}_taxonomy_term_load($terms) { + $result = db_select('mytable', 'm') + ->fields('m', array('tid', 'foo')) + ->condition('m.tid', array_keys($terms), 'IN') + ->execute(); + foreach ($result as $record) { + $terms[$record->tid]->foo = $record->foo; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..b54fd019765fcaeb592474c8705940f335d73024 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_presave.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_taxonomy_term_presave(). + */ +function {{ machine_name }}_taxonomy_term_presave($term) { + $term->foo = 'bar'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..f46b83b4deef93fd7a4a3078cdcde1b5e8de136f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_update.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_taxonomy_term_update(). + */ +function {{ machine_name }}_taxonomy_term_update($term) { + db_update('mytable') + ->fields(array('foo' => $term->foo)) + ->condition('tid', $term->tid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..189ef8c0127dd7189c6856eb01c4e65bdabe50d5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_view.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_taxonomy_term_view(). + */ +function {{ machine_name }}_taxonomy_term_view($term, $view_mode, $langcode) { + $term->content['my_additional_field'] = array( + '#markup' => $additional_field, + '#weight' => 10, + '#theme' => 'mymodule_my_additional_field', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..0a6cca38e0226c706e0c4df7d812fd11c605895b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_term_view_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_taxonomy_term_view_alter(). + */ +function {{ machine_name }}_taxonomy_term_view_alter(&$build) { + if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { + // Change its weight. + $build['an_additional_field']['#weight'] = -10; + } + + // Add a #post_render callback to act on the rendered HTML of the term. + $build['#post_render'][] = 'my_module_node_post_render'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..749768e7531adb955e99cccd7e48c0974025eebd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_taxonomy_vocabulary_delete(). + */ +function {{ machine_name }}_taxonomy_vocabulary_delete($vocabulary) { + db_delete('mytable') + ->condition('vid', $vocabulary->vid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..4f04b98a5d37a0b4f90d60812d537242fd379ab5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_insert.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_taxonomy_vocabulary_insert(). + */ +function {{ machine_name }}_taxonomy_vocabulary_insert($vocabulary) { + if ($vocabulary->machine_name == 'my_vocabulary') { + $vocabulary->weight = 100; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..097851086431fce730991b7a7baf179c22966808 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_load.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_taxonomy_vocabulary_load(). + */ +function {{ machine_name }}_taxonomy_vocabulary_load($vocabularies) { + $result = db_select('mytable', 'm') + ->fields('m', array('vid', 'foo')) + ->condition('m.vid', array_keys($vocabularies), 'IN') + ->execute(); + foreach ($result as $record) { + $vocabularies[$record->vid]->foo = $record->foo; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..ef15a044ae8e500f167f7f32438cc8c8f1050c57 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_presave.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_taxonomy_vocabulary_presave(). + */ +function {{ machine_name }}_taxonomy_vocabulary_presave($vocabulary) { + $vocabulary->foo = 'bar'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..97c2c5190df3a77500b9921768b501fba6134270 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_update.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_taxonomy_vocabulary_update(). + */ +function {{ machine_name }}_taxonomy_vocabulary_update($vocabulary) { + db_update('mytable') + ->fields(array('foo' => $vocabulary->foo)) + ->condition('vid', $vocabulary->vid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_finished.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_finished.twig new file mode 100644 index 0000000000000000000000000000000000000000..dff6f4af66785144ef352d9fcd762ab9a2a8787f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_finished.twig @@ -0,0 +1,5 @@ +/** + * Implements hook_test_finished(). + */ +function {{ machine_name }}_test_finished($results) { +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_group_finished.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_group_finished.twig new file mode 100644 index 0000000000000000000000000000000000000000..b2e850ef39df41da8b9fcbba755a424ce5d3f54a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_group_finished.twig @@ -0,0 +1,5 @@ +/** + * Implements hook_test_group_finished(). + */ +function {{ machine_name }}_test_group_finished() { +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_group_started.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_group_started.twig new file mode 100644 index 0000000000000000000000000000000000000000..fe1c858489f4bb3f4bab1099abae0030cf9d79ce --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/test_group_started.twig @@ -0,0 +1,5 @@ +/** + * Implements hook_test_group_started(). + */ +function {{ machine_name }}_test_group_started() { +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/theme.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/theme.twig new file mode 100644 index 0000000000000000000000000000000000000000..7c05a465d307c8d21528ef567c9c06b474381976 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/theme.twig @@ -0,0 +1,27 @@ +/** + * Implements hook_theme(). + */ +function {{ machine_name }}_theme($existing, $type, $theme, $path) { + return array( + 'forum_display' => array( + 'variables' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + ), + 'forum_list' => array( + 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), + ), + 'forum_topic_list' => array( + 'variables' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + ), + 'forum_icon' => array( + 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + ), + 'status_report' => array( + 'render element' => 'requirements', + 'file' => 'system.admin.inc', + ), + 'system_date_time_settings' => array( + 'render element' => 'form', + 'file' => 'system.admin.inc', + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/theme_registry_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/theme_registry_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..cdbb17e9f8318212c7323ab8807293e9f908adbf --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/theme_registry_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_theme_registry_alter(). + */ +function {{ machine_name }}_theme_registry_alter(&$theme_registry) { + // Kill the next/previous forum topic navigation links. + foreach ($theme_registry['forum_topic_navigation']['preprocess functions'] as $key => $value) { + if ($value == 'template_preprocess_forum_topic_navigation') { + unset($theme_registry['forum_topic_navigation']['preprocess functions'][$key]); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/themes_disabled.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/themes_disabled.twig new file mode 100644 index 0000000000000000000000000000000000000000..e24cf46b864b8054ca8085b5bc58ed9237625ee3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/themes_disabled.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_themes_disabled(). + */ +function {{ machine_name }}_themes_disabled($theme_list) { + // Clear all update module caches. + _update_cache_clear(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/themes_enabled.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/themes_enabled.twig new file mode 100644 index 0000000000000000000000000000000000000000..e7205725bbc351739458a60b0c11b0a3e7ef6be3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/themes_enabled.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_themes_enabled(). + */ +function {{ machine_name }}_themes_enabled($theme_list) { + foreach ($theme_list as $theme) { + block_theme_initialize($theme); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/token_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/token_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..6850c7cb6e85231fedc034dfe786e3f25f6fcbe4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/token_info.twig @@ -0,0 +1,41 @@ +/** + * Implements hook_token_info(). + */ +function {{ machine_name }}_token_info() { + $type = array( + 'name' => t('Nodes'), + 'description' => t('Tokens related to individual nodes.'), + 'needs-data' => 'node', + ); + + // Core tokens for nodes. + $node['nid'] = array( + 'name' => t("Node ID"), + 'description' => t("The unique ID of the node."), + ); + $node['title'] = array( + 'name' => t("Title"), + 'description' => t("The title of the node."), + ); + $node['edit-url'] = array( + 'name' => t("Edit URL"), + 'description' => t("The URL of the node's edit page."), + ); + + // Chained tokens for nodes. + $node['created'] = array( + 'name' => t("Date created"), + 'description' => t("The date the node was posted."), + 'type' => 'date', + ); + $node['author'] = array( + 'name' => t("Author"), + 'description' => t("The author of the node."), + 'type' => 'user', + ); + + return array( + 'types' => array('node' => $type), + 'tokens' => array('node' => $node), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/token_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/token_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..911b98bb476606be168b6daf35c022be1672d61f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/token_info_alter.twig @@ -0,0 +1,21 @@ +/** + * Implements hook_token_info_alter(). + */ +function {{ machine_name }}_token_info_alter(&$data) { + // Modify description of node tokens for our site. + $data['tokens']['node']['nid'] = array( + 'name' => t("Node ID"), + 'description' => t("The unique ID of the article."), + ); + $data['tokens']['node']['title'] = array( + 'name' => t("Title"), + 'description' => t("The title of the article."), + ); + + // Chained tokens for nodes. + $data['tokens']['node']['created'] = array( + 'name' => t("Date created"), + 'description' => t("The date the article was posted."), + 'type' => 'date', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/tokens.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/tokens.twig new file mode 100644 index 0000000000000000000000000000000000000000..8e3f911e2fcd807035a9aaac2971c1c27d6e4831 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/tokens.twig @@ -0,0 +1,58 @@ +/** + * Implements hook_tokens(). + */ +function {{ machine_name }}_tokens($type, $tokens, array $data = array(), array $options = array()) { + $url_options = array('absolute' => TRUE); + if (isset($options['language'])) { + $url_options['language'] = $options['language']; + $language_code = $options['language']->language; + } + else { + $language_code = NULL; + } + $sanitize = !empty($options['sanitize']); + + $replacements = array(); + + if ($type == 'node' && !empty($data['node'])) { + $node = $data['node']; + + foreach ($tokens as $name => $original) { + switch ($name) { + // Simple key values on the node. + case 'nid': + $replacements[$original] = $node->nid; + break; + + case 'title': + $replacements[$original] = $sanitize ? check_plain($node->title) : $node->title; + break; + + case 'edit-url': + $replacements[$original] = url('node/' . $node->nid . '/edit', $url_options); + break; + + // Default values for the chained tokens handled below. + case 'author': + $name = ($node->uid == 0) ? variable_get('anonymous', t('Anonymous')) : $node->name; + $replacements[$original] = $sanitize ? filter_xss($name) : $name; + break; + + case 'created': + $replacements[$original] = format_date($node->created, 'medium', '', NULL, $language_code); + break; + } + } + + if ($author_tokens = token_find_with_prefix($tokens, 'author')) { + $author = user_load($node->uid); + $replacements += token_generate('user', $author_tokens, array('user' => $author), $options); + } + + if ($created_tokens = token_find_with_prefix($tokens, 'created')) { + $replacements += token_generate('date', $created_tokens, array('date' => $node->created), $options); + } + } + + return $replacements; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/tokens_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/tokens_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b6014496c4c0fffb092e776093d3fbd6ccd8b165 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/tokens_alter.twig @@ -0,0 +1,26 @@ +/** + * Implements hook_tokens_alter(). + */ +function {{ machine_name }}_tokens_alter(array &$replacements, array $context) { + $options = $context['options']; + + if (isset($options['language'])) { + $url_options['language'] = $options['language']; + $language_code = $options['language']->language; + } + else { + $language_code = NULL; + } + $sanitize = !empty($options['sanitize']); + + if ($context['type'] == 'node' && !empty($context['data']['node'])) { + $node = $context['data']['node']; + + // Alter the [node:title] token, and replace it with the rendered content + // of a field (field_title). + if (isset($context['tokens']['title'])) { + $title = field_view_field('node', $node, 'field_title', 'default', $language_code); + $replacements[$context['tokens']['title']] = drupal_render($title); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/translated_menu_link_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/translated_menu_link_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..30945514c394b5471dc5cb2d277a8c0f29850c3c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/translated_menu_link_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_translated_menu_link_alter(). + */ +function {{ machine_name }}_translated_menu_link_alter(&$item, $map) { + if ($item['href'] == 'devel/cache/clear') { + $item['localized_options']['query'] = drupal_get_destination(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/trigger_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/trigger_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..3972bd2dce2b13dda21bffe4adeda0cf4799b24e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/trigger_info.twig @@ -0,0 +1,24 @@ +/** + * Implements hook_trigger_info(). + */ +function {{ machine_name }}_trigger_info() { + return array( + 'node' => array( + 'node_presave' => array( + 'label' => t('When either saving new content or updating existing content'), + ), + 'node_insert' => array( + 'label' => t('After saving new content'), + ), + 'node_update' => array( + 'label' => t('After saving updated content'), + ), + 'node_delete' => array( + 'label' => t('After deleting content'), + ), + 'node_view' => array( + 'label' => t('When content is viewed by an authenticated user'), + ), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/trigger_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/trigger_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..fd51f8daac5e1e603d9dd40b1491c3a9db1a3f0c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/trigger_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_trigger_info_alter(). + */ +function {{ machine_name }}_trigger_info_alter(&$triggers) { + $triggers['node']['node_insert']['label'] = t('When content is saved'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/uninstall.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/uninstall.twig new file mode 100644 index 0000000000000000000000000000000000000000..32017d32a3360133b9724c1b593f8d8ef1b2b5d8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/uninstall.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_uninstall(). + */ +function {{ machine_name }}_uninstall() { + variable_del('upload_file_types'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update.twig new file mode 100644 index 0000000000000000000000000000000000000000..9798ba838d4da03dfc87c2bc2d203e264bdc2534 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_update(). + */ +function {{ machine_name }}_update($node) { + db_update('mytable') + ->fields(array('extra' => $node->extra)) + ->condition('nid', $node->nid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_N.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_N.twig new file mode 100644 index 0000000000000000000000000000000000000000..af5a8e0d5b2361fe781279d9fca82a8e8f210171 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_N.twig @@ -0,0 +1,49 @@ +/** + * Implements hook_update_N(). + */ +function {{ machine_name }}_update_N(&$sandbox) { + // For non-multipass updates, the signature can simply be; + // function {{ machine_name }}_update_N() { + + // For most updates, the following is sufficient. + db_add_field('mytable1', 'newcol', array('type' => 'int', 'not null' => TRUE, 'description' => 'My new integer column.')); + + // However, for more complex operations that may take a long time, + // you may hook into Batch API as in the following example. + + // Update 3 users at a time to have an exclamation point after their names. + // (They're really happy that we can do batch API in this hook!) + if (!isset($sandbox['progress'])) { + $sandbox['progress'] = 0; + $sandbox['current_uid'] = 0; + // We'll -1 to disregard the uid 0... + $sandbox['max'] = db_query('SELECT COUNT(DISTINCT uid) FROM {users}')->fetchField() - 1; + } + + $users = db_select('users', 'u') + ->fields('u', array('uid', 'name')) + ->condition('uid', $sandbox['current_uid'], '>') + ->range(0, 3) + ->orderBy('uid', 'ASC') + ->execute(); + + foreach ($users as $user) { + $user->name .= '!'; + db_update('users') + ->fields(array('name' => $user->name)) + ->condition('uid', $user->uid) + ->execute(); + + $sandbox['progress']++; + $sandbox['current_uid'] = $user->uid; + } + + $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); + + // To display a message to the user when the update is completed, return it. + // If you do not want to display a completion message, simply return nothing. + return t('The update did what it was supposed to do.'); + + // In case of an error, simply throw an exception with an error message. + throw new DrupalUpdateException('Something went wrong; here is what you should do.'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_dependencies.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_dependencies.twig new file mode 100644 index 0000000000000000000000000000000000000000..009d4b277ad2c906713a10b37a2feed79b8150f9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_dependencies.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_update_dependencies(). + */ +function {{ machine_name }}_update_dependencies() { + // Indicate that the mymodule_update_7000() function provided by this module + // must run after the another_module_update_7002() function provided by the + // 'another_module' module. + $dependencies['mymodule'][7000] = array( + 'another_module' => 7002, + ); + // Indicate that the mymodule_update_7001() function provided by this module + // must run before the yet_another_module_update_7004() function provided by + // the 'yet_another_module' module. (Note that declaring dependencies in this + // direction should be done only in rare situations, since it can lead to the + // following problem: If a site has already run the yet_another_module + // module's database updates before it updates its codebase to pick up the + // newest mymodule code, then the dependency declared here will be ignored.) + $dependencies['yet_another_module'][7004] = array( + 'mymodule' => 7001, + ); + return $dependencies; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_index.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_index.twig new file mode 100644 index 0000000000000000000000000000000000000000..1052df6cda8b5460c13126eb0ae77c8f7601a233 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_index.twig @@ -0,0 +1,31 @@ +/** + * Implements hook_update_index(). + */ +function {{ machine_name }}_update_index() { + $limit = (int)variable_get('search_cron_limit', 100); + + $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit); + + foreach ($result as $node) { + $node = node_load($node->nid); + + // Save the changed time of the most recent indexed node, for the search + // results half-life calculation. + variable_set('node_cron_last', $node->changed); + + // Render the node. + node_build_content($node, 'search_index'); + $node->rendered = drupal_render($node->content); + + $text = '<h1>' . check_plain($node->title) . '</h1>' . $node->rendered; + + // Fetch extra data normally not visible + $extra = module_invoke_all('node_update_index', $node); + foreach ($extra as $t) { + $text .= $t; + } + + // Update index + search_index($node->nid, 'node', $text); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_last_removed.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_last_removed.twig new file mode 100644 index 0000000000000000000000000000000000000000..bc17f6f286646e0c4bbb33da53d3213aa140648b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_last_removed.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_update_last_removed(). + */ +function {{ machine_name }}_update_last_removed() { + // We've removed the 5.x-1.x version of mymodule, including database updates. + // The next update function is mymodule_update_5200(). + return 5103; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_projects_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_projects_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b2bd0d3e42957f1a07f3808cb3e88e92a2d72dca --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_projects_alter.twig @@ -0,0 +1,41 @@ +/** + * Implements hook_update_projects_alter(). + */ +function {{ machine_name }}_update_projects_alter(&$projects) { + // Hide a site-specific module from the list. + unset($projects['site_specific_module']); + + // Add a disabled module to the list. + // The key for the array should be the machine-readable project "short name". + $projects['disabled_project_name'] = array( + // Machine-readable project short name (same as the array key above). + 'name' => 'disabled_project_name', + // Array of values from the main .info file for this project. + 'info' => array( + 'name' => 'Some disabled module', + 'description' => 'A module not enabled on the site that you want to see in the available updates report.', + 'version' => '7.x-1.0', + 'core' => '7.x', + // The maximum file change time (the "ctime" returned by the filectime() + // PHP method) for all of the .info files included in this project. + '_info_file_ctime' => 1243888165, + ), + // The date stamp when the project was released, if known. If the disabled + // project was an officially packaged release from drupal.org, this will + // be included in the .info file as the 'datestamp' field. This only + // really matters for development snapshot releases that are regenerated, + // so it can be left undefined or set to 0 in most cases. + 'datestamp' => 1243888185, + // Any modules (or themes) included in this project. Keyed by machine- + // readable "short name", value is the human-readable project name printed + // in the UI. + 'includes' => array( + 'disabled_project' => 'Disabled module', + 'disabled_project_helper' => 'Disabled module helper module', + 'disabled_project_foo' => 'Disabled module foo add-on module', + ), + // Does this project contain a 'module', 'theme', 'disabled-module', or + // 'disabled-theme'? + 'project_type' => 'disabled-module', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_status_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_status_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..bc7ab68bdeaa55c59f2ae9571942b56c7f68d796 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/update_status_alter.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_update_status_alter(). + */ +function {{ machine_name }}_update_status_alter(&$projects) { + $settings = variable_get('update_advanced_project_settings', array()); + foreach ($projects as $project => $project_info) { + if (isset($settings[$project]) && isset($settings[$project]['check']) && + ($settings[$project]['check'] == 'never' || + (isset($project_info['recommended']) && + $settings[$project]['check'] === $project_info['recommended']))) { + $projects[$project]['status'] = UPDATE_NOT_CHECKED; + $projects[$project]['reason'] = t('Ignored from settings'); + if (!empty($settings[$project]['notes'])) { + $projects[$project]['extra'][] = array( + 'class' => array('admin-note'), + 'label' => t('Administrator note'), + 'data' => $settings[$project]['notes'], + ); + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/updater_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/updater_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..dc6e6cc98be4cd0ea1ee06824d25c719b7da6e0c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/updater_info.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_updater_info(). + */ +function {{ machine_name }}_updater_info() { + return array( + 'module' => array( + 'class' => 'ModuleUpdater', + 'name' => t('Update modules'), + 'weight' => 0, + ), + 'theme' => array( + 'class' => 'ThemeUpdater', + 'name' => t('Update themes'), + 'weight' => 0, + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/updater_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/updater_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c8221304244509469b5094832686beb615602dc9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/updater_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_updater_info_alter(). + */ +function {{ machine_name }}_updater_info_alter(&$updaters) { + // Adjust weight so that the theme Updater gets a chance to handle a given + // update task before module updaters. + $updaters['theme']['weight'] = -1; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/url_inbound_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/url_inbound_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f62e7b4dbf58185fe1da13fdc0a480a4ae18979b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/url_inbound_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_url_inbound_alter(). + */ +function {{ machine_name }}_url_inbound_alter(&$path, $original_path, $path_language) { + // Create the path user/me/edit, which allows a user to edit their account. + if (preg_match('|^user/me/edit(/.*)?|', $path, $matches)) { + global $user; + $path = 'user/' . $user->uid . '/edit' . $matches[1]; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/url_outbound_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/url_outbound_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..903a608bb191f7354c307e4d0b5f6e9d8375a778 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/url_outbound_alter.twig @@ -0,0 +1,18 @@ +/** + * Implements hook_url_outbound_alter(). + */ +function {{ machine_name }}_url_outbound_alter(&$path, &$options, $original_path) { + // Use an external RSS feed rather than the Drupal one. + if ($path == 'rss.xml') { + $path = 'http://example.com/rss.xml'; + $options['external'] = TRUE; + } + + // Instead of pointing to user/[uid]/edit, point to user/me/edit. + if (preg_match('|^user/([0-9]*)/edit(/.*)?|', $path, $matches)) { + global $user; + if ($user->uid == $matches[1]) { + $path = 'user/me/edit' . $matches[2]; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_cancel.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_cancel.twig new file mode 100644 index 0000000000000000000000000000000000000000..e1d45bb429bcc3e3441cd101178168b873a83a23 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_cancel.twig @@ -0,0 +1,37 @@ +/** + * Implements hook_user_cancel(). + */ +function {{ machine_name }}_user_cancel($edit, $account, $method) { + switch ($method) { + case 'user_cancel_block_unpublish': + // Unpublish nodes (current revisions). + module_load_include('inc', 'node', 'node.admin'); + $nodes = db_select('node', 'n') + ->fields('n', array('nid')) + ->condition('uid', $account->uid) + ->execute() + ->fetchCol(); + node_mass_update($nodes, array('status' => 0)); + break; + + case 'user_cancel_reassign': + // Anonymize nodes (current revisions). + module_load_include('inc', 'node', 'node.admin'); + $nodes = db_select('node', 'n') + ->fields('n', array('nid')) + ->condition('uid', $account->uid) + ->execute() + ->fetchCol(); + node_mass_update($nodes, array('uid' => 0)); + // Anonymize old revisions. + db_update('node_revision') + ->fields(array('uid' => 0)) + ->condition('uid', $account->uid) + ->execute(); + // Clean history. + db_delete('history') + ->condition('uid', $account->uid) + ->execute(); + break; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_cancel_methods_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_cancel_methods_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ca5d1d75b76d9113fee2e05ec22cf4367b0a8b47 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_cancel_methods_alter.twig @@ -0,0 +1,18 @@ +/** + * Implements hook_user_cancel_methods_alter(). + */ +function {{ machine_name }}_user_cancel_methods_alter(&$methods) { + // Limit access to disable account and unpublish content method. + $methods['user_cancel_block_unpublish']['access'] = user_access('administer site configuration'); + + // Remove the content re-assigning method. + unset($methods['user_cancel_reassign']); + + // Add a custom zero-out method. + $methods['mymodule_zero_out'] = array( + 'title' => t('Delete the account and remove all content.'), + 'description' => t('All your content will be replaced by empty strings.'), + // access should be used for administrative methods only. + 'access' => user_access('access zero-out account cancellation method'), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_categories.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_categories.twig new file mode 100644 index 0000000000000000000000000000000000000000..7b597e0e757d58754dd962a5d20eb9ca2fa16a6f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_categories.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_user_categories(). + */ +function {{ machine_name }}_user_categories() { + return array(array( + 'name' => 'account', + 'title' => t('Account settings'), + 'weight' => 1, + )); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..e5379de4f3ab6059d9cbd78f783f0f6d38649c99 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_user_delete(). + */ +function {{ machine_name }}_user_delete($account) { + db_delete('mytable') + ->condition('uid', $account->uid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..66dd593fb6afdd72179a0bff8012e78884ee30c8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_insert.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_user_insert(). + */ +function {{ machine_name }}_user_insert(&$edit, $account, $category) { + db_insert('mytable') + ->fields(array( + 'myfield' => $edit['myfield'], + 'uid' => $account->uid, + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..adb193ea69efa6d1d6a11a3051a8c6bc12c8f39c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_load.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_user_load(). + */ +function {{ machine_name }}_user_load($users) { + $result = db_query('SELECT uid, foo FROM {my_table} WHERE uid IN (:uids)', array(':uids' => array_keys($users))); + foreach ($result as $record) { + $users[$record->uid]->foo = $record->foo; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_login.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_login.twig new file mode 100644 index 0000000000000000000000000000000000000000..c4879e91c2e8a0429627fdcbb46db46d96cd9d2a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_login.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_user_login(). + */ +function {{ machine_name }}_user_login(&$edit, $account) { + // If the user has a NULL time zone, notify them to set a time zone. + if (!$account->timezone && variable_get('configurable_timezones', 1) && variable_get('empty_timezone_message', 0)) { + drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => url("user/$account->uid/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone'))))); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_logout.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_logout.twig new file mode 100644 index 0000000000000000000000000000000000000000..cab41eebcfe08d435c49e30011e1aca9476be370 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_logout.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_user_logout(). + */ +function {{ machine_name }}_user_logout($account) { + db_insert('logouts') + ->fields(array( + 'uid' => $account->uid, + 'time' => time(), + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_operations.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_operations.twig new file mode 100644 index 0000000000000000000000000000000000000000..27b9eec90ce1888a918edd1fa51384757b7951f9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_operations.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_user_operations(). + */ +function {{ machine_name }}_user_operations() { + $operations = array( + 'unblock' => array( + 'label' => t('Unblock the selected users'), + 'callback' => 'user_user_operations_unblock', + ), + 'block' => array( + 'label' => t('Block the selected users'), + 'callback' => 'user_user_operations_block', + ), + 'cancel' => array( + 'label' => t('Cancel the selected user accounts'), + ), + ); + return $operations; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..dcedbc4af7041de3c33bc1852d7a82fad5210618 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_presave.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_user_presave(). + */ +function {{ machine_name }}_user_presave(&$edit, $account, $category) { + // Make sure that our form value 'mymodule_foo' is stored as + // 'mymodule_bar' in the 'data' (serialized) column. + if (isset($edit['mymodule_foo'])) { + $edit['data']['mymodule_bar'] = $edit['mymodule_foo']; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..bfc140ac06eb6919e398cfe7e2f2f7984d96f01c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_delete.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_user_role_delete(). + */ +function {{ machine_name }}_user_role_delete($role) { + // Delete existing instances of the deleted role. + db_delete('my_module_table') + ->condition('rid', $role->rid) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..857cd9a9331d520f6275d31be57ee7d8cca50c8a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_insert.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_user_role_insert(). + */ +function {{ machine_name }}_user_role_insert($role) { + // Save extra fields provided by the module to user roles. + db_insert('my_module_table') + ->fields(array( + 'rid' => $role->rid, + 'role_description' => $role->description, + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..4f41ef5c17359f41b73522b0d979a87d17a24a13 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_presave.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_user_role_presave(). + */ +function {{ machine_name }}_user_role_presave($role) { + // Set a UUID for the user role if it doesn't already exist + if (empty($role->uuid)) { + $role->uuid = uuid_uuid(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..9f8fbbad9d134ab61f68c45e553abd0666b18ce9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_role_update.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_user_role_update(). + */ +function {{ machine_name }}_user_role_update($role) { + // Save extra fields provided by the module to user roles. + db_merge('my_module_table') + ->key(array('rid' => $role->rid)) + ->fields(array( + 'role_description' => $role->description + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..26b09dcf15fd1c49e41d833bfce3a31ddda7ade6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_update.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_user_update(). + */ +function {{ machine_name }}_user_update(&$edit, $account, $category) { + db_insert('user_changes') + ->fields(array( + 'uid' => $account->uid, + 'changed' => time(), + )) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..7c427d765a623783677041c9179a105c63c094a6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_user_view(). + */ +function {{ machine_name }}_user_view($account, $view_mode, $langcode) { + if (user_access('create blog content', $account)) { + $account->content['summary']['blog'] = array( + '#type' => 'user_profile_item', + '#title' => t('Blog'), + '#markup' => l(t('View recent blog entries'), "blog/$account->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($account)))))), + '#attributes' => array('class' => array('blog')), + ); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b85027085df46d454c220303cf0b33303faee29b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view_alter.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_user_view_alter(). + */ +function {{ machine_name }}_user_view_alter(&$build) { + // Check for the existence of a field added by another module. + if (isset($build['an_additional_field'])) { + // Change its weight. + $build['an_additional_field']['#weight'] = -10; + } + + // Add a #post_render callback to act on the rendered HTML of the user. + $build['#post_render'][] = 'my_module_user_post_render'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/username_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/username_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..5892dc55a3cdd49ebf5c766a45547a3e1c863db1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/username_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_username_alter(). + */ +function {{ machine_name }}_username_alter(&$name, $account) { + // Display the user's uid instead of name. + if (isset($account->uid)) { + $name = t('User !uid', array('!uid' => $account->uid)); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/validate.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/validate.twig new file mode 100644 index 0000000000000000000000000000000000000000..136abb12a3878a2503394a841a6d0fe3755c939c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/validate.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_validate(). + */ +function {{ machine_name }}_validate($node, $form, &$form_state) { + if (isset($node->end) && isset($node->start)) { + if ($node->start > $node->end) { + form_set_error('time', t('An event may not end before it starts.')); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/verify_update_archive.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/verify_update_archive.twig new file mode 100644 index 0000000000000000000000000000000000000000..ffd96e9098336ef326fe5b53d16015eafb4735ad --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/verify_update_archive.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_verify_update_archive(). + */ +function {{ machine_name }}_verify_update_archive($project, $archive_file, $directory) { + $errors = array(); + if (!file_exists($directory)) { + $errors[] = t('The %directory does not exist.', array('%directory' => $directory)); + } + // Add other checks on the archive integrity here. + return $errors; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/view.twig new file mode 100644 index 0000000000000000000000000000000000000000..650db6f2e96d167a0ca901a1a6ff34c6f44f4401 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/view.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_view(). + */ +function {{ machine_name }}_view($node, $view_mode, $langcode = NULL) { + if ($view_mode == 'full' && node_is_page($node)) { + $breadcrumb = array(); + $breadcrumb[] = l(t('Home'), NULL); + $breadcrumb[] = l(t('Example'), 'example'); + $breadcrumb[] = l($node->field1, 'example/' . $node->field1); + drupal_set_breadcrumb($breadcrumb); + } + + $node->content['myfield'] = array( + '#markup' => theme('mymodule_myfield', $node->myfield), + '#weight' => 1, + ); + + return $node; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/watchdog.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/watchdog.twig new file mode 100644 index 0000000000000000000000000000000000000000..8e6a77b5ec21af1b8a60858002043b8c3aa8ae7d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/watchdog.twig @@ -0,0 +1,52 @@ +/** + * Implements hook_watchdog(). + */ +function {{ machine_name }}_watchdog(array $log_entry) { + global $base_url, $language; + + $severity_list = array( + WATCHDOG_EMERGENCY => t('Emergency'), + WATCHDOG_ALERT => t('Alert'), + WATCHDOG_CRITICAL => t('Critical'), + WATCHDOG_ERROR => t('Error'), + WATCHDOG_WARNING => t('Warning'), + WATCHDOG_NOTICE => t('Notice'), + WATCHDOG_INFO => t('Info'), + WATCHDOG_DEBUG => t('Debug'), + ); + + $to = 'someone@example.com'; + $params = array(); + $params['subject'] = t('[@site_name] @severity_desc: Alert from your web site', array( + '@site_name' => variable_get('site_name', 'Drupal'), + '@severity_desc' => $severity_list[$log_entry['severity']], + )); + + $params['message'] = "\nSite: @base_url"; + $params['message'] .= "\nSeverity: (@severity) @severity_desc"; + $params['message'] .= "\nTimestamp: @timestamp"; + $params['message'] .= "\nType: @type"; + $params['message'] .= "\nIP Address: @ip"; + $params['message'] .= "\nRequest URI: @request_uri"; + $params['message'] .= "\nReferrer URI: @referer_uri"; + $params['message'] .= "\nUser: (@uid) @name"; + $params['message'] .= "\nLink: @link"; + $params['message'] .= "\nMessage: \n\n@message"; + + $params['message'] = t($params['message'], array( + '@base_url' => $base_url, + '@severity' => $log_entry['severity'], + '@severity_desc' => $severity_list[$log_entry['severity']], + '@timestamp' => format_date($log_entry['timestamp']), + '@type' => $log_entry['type'], + '@ip' => $log_entry['ip'], + '@request_uri' => $log_entry['request_uri'], + '@referer_uri' => $log_entry['referer'], + '@uid' => $log_entry['uid'], + '@name' => $log_entry['user']->name, + '@link' => strip_tags($log_entry['link']), + '@message' => strip_tags($log_entry['message']), + )); + + drupal_mail('emaillog', 'entry', $to, $language, $params); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc.twig new file mode 100644 index 0000000000000000000000000000000000000000..e69279d55e6bf3696d663faeb3dec64a2006d426 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_xmlrpc(). + */ +function {{ machine_name }}_xmlrpc() { + return array( + 'drupal.login' => 'drupal_login', + array( + 'drupal.site.ping', + 'drupal_directory_ping', + array('boolean', 'string', 'string', 'string', 'string', 'string'), + t('Handling ping request')) + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..8896c13c6dec4b676e497d0a54c76db5d78e9b0e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc_alter.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_xmlrpc_alter(). + */ +function {{ machine_name }}_xmlrpc_alter(&$methods) { + // Directly change a simple method. + $methods['drupal.login'] = 'mymodule_login'; + + // Alter complex definitions. + foreach ($methods as $key => &$method) { + // Skip simple method definitions. + if (!is_int($key)) { + continue; + } + // Perform the wanted manipulation. + if ($method[0] == 'drupal.site.ping') { + $method[1] = 'mymodule_directory_ping'; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/install.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/install.twig new file mode 100644 index 0000000000000000000000000000000000000000..cadbcf329b3fa974603d12f096023d48883c29cc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/install.twig @@ -0,0 +1,44 @@ +<?php + +/** + * @file + * Install, update and uninstall functions for the {{ name }} module. + */ + +/** + * Implements hook_schema(). + */ +function {{ machine_name }}_schema() { + $schema['{{ machine_name }}_table'] = array( + 'description' => 'Table description', + 'fields' => array( + 'id' => array( + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique ID.', + ), + 'title' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Column description', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Column description', + ), + ), + 'primary key' => array('id'), + 'unique keys' => array( + 'title' => array('title'), + ), + 'indexes' => array( + 'weight' => array('weight'), + ), + ); + + return $schema; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/javascript.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/javascript.twig new file mode 100644 index 0000000000000000000000000000000000000000..23beb5bfc49285fb12ed0779917a22f5d40a028c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/javascript.twig @@ -0,0 +1,17 @@ +/** + * {{ name }} behaviors. + */ +(function ($) { + + /** + * Behavior description. + */ + Drupal.behaviors.{{ machine_name|camelize(false) }} = { + attach: function (context, settings) { + + console.log('It works!'); + + } + } + +}(jQuery)); diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/module-info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/module-info.twig new file mode 100644 index 0000000000000000000000000000000000000000..17ae0affc4518c141761c5df9d176c9b3c7eb7fd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/module-info.twig @@ -0,0 +1,8 @@ +name = {{ name }} +description = {{ description }} +package = {{ package }} +core = 7.x + +;configure = admin/config/system/{{ machine_name }} +;dependencies[] = system (>7.34) +;files[] = tests/{{ machine_name }}.test diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/module.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/module.twig new file mode 100644 index 0000000000000000000000000000000000000000..3a3b408357714e4b55066512eff10caad8334464 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/module.twig @@ -0,0 +1,57 @@ +<?php + +/** + * @file + * Primary module hooks for {{ name }} module. + */ + +/** + * Implements hook_init(). + */ +function {{ machine_name }}_init() { + drupal_set_message('It works!'); +} + +/** + * Implements hook_menu(). + */ +function {{ machine_name }}_menu() { + + $items['{{ machine_name }}'] = array( + 'title' => '{{ machine_name }}', + 'description' => '{{ machine_name }} main page.', + 'page callback' => '{{ machine_name }}_main_page', + 'page arguments' => array('{{ machine_name }}_settings_form'), + 'access arguments' => array('view {{ machine_name }} page'), + 'file' => '{{ machine_name }}.pages.inc', + 'type' => MENU_CALLBACK, + ); + + $items['admin/config/system/{{ machine_name }}'] = array( + 'title' => '{{ name }}', + 'description' => '{{ name }} settings.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('{{ machine_name }}_settings_form'), + 'access arguments' => array('administer {{ machine_name }} configuration'), + 'file' => '{{ machine_name }}.admin.inc', + ); + + return $items; +} + +/** + * Implements hook_permission(). + */ +function {{ machine_name }}_permission() { + return array( + 'view {{ machine_name }} page' => array( + 'title' => t('View {{ machine_name }} page'), + 'description' => t('View {{ machine_name }} page.'), + ), + 'administer {{ machine_name }} configuration' => array( + 'title' => t('Administer {{ machine_name }} configuration'), + 'description' => t('Administer {{ machine_name }} configuration.'), + 'restrict access' => TRUE, + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/pages.inc.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/pages.inc.twig new file mode 100644 index 0000000000000000000000000000000000000000..157dcab4c06d3bd08ad5aebdeb060e51faff8096 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/pages.inc.twig @@ -0,0 +1,17 @@ +<?php + +/** + * @file + * Page callbacks for {{ name }} module. + */ + +/** + * Menu callback; presents main {{ name }} page. + */ +function {{ machine_name }}_main_page() { + + $build['content']['#markup'] = 'It works!'; + $build['#attached']['js'][] = drupal_get_path('module', '{{ machine_name }}') . '/{{ machine_name }}.js'; + + return $build; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/settings.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/settings.twig new file mode 100644 index 0000000000000000000000000000000000000000..9bf0e81639d923fd2dcbfd8f0c1b1c4ee79068f2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/settings.twig @@ -0,0 +1,644 @@ +<?php + +/** + * @file + * Drupal site-specific configuration file. + * + * IMPORTANT NOTE: + * This file may have been set to read-only by the Drupal installation program. + * If you make changes to this file, be sure to protect it again after making + * your modifications. Failure to remove write permissions to this file is a + * security risk. + * + * The configuration file to be loaded is based upon the rules below. However + * if the multisite aliasing file named sites/sites.php is present, it will be + * loaded, and the aliases in the array $sites will override the default + * directory rules below. See sites/example.sites.php for more information about + * aliases. + * + * The configuration directory will be discovered by stripping the website's + * hostname from left to right and pathname from right to left. The first + * configuration file found will be used and any others will be ignored. If no + * other configuration file is found then the default configuration file at + * 'sites/default' will be used. + * + * For example, for a fictitious site installed at + * http://www.drupal.org:8080/mysite/test/, the 'settings.php' file is searched + * for in the following directories: + * + * - sites/8080.www.drupal.org.mysite.test + * - sites/www.drupal.org.mysite.test + * - sites/drupal.org.mysite.test + * - sites/org.mysite.test + * + * - sites/8080.www.drupal.org.mysite + * - sites/www.drupal.org.mysite + * - sites/drupal.org.mysite + * - sites/org.mysite + * + * - sites/8080.www.drupal.org + * - sites/www.drupal.org + * - sites/drupal.org + * - sites/org + * + * - sites/default + * + * Note that if you are installing on a non-standard port number, prefix the + * hostname with that number. For example, + * http://www.drupal.org:8080/mysite/test/ could be loaded from + * sites/8080.www.drupal.org.mysite.test/. + * + * @see example.sites.php + * @see conf_path() + */ + +/** + * Database settings: + * + * The $databases array specifies the database connection or + * connections that Drupal may use. Drupal is able to connect + * to multiple databases, including multiple types of databases, + * during the same request. + * + * Each database connection is specified as an array of settings, + * similar to the following: + * @code + * array( + * 'driver' => 'mysql', + * 'database' => 'databasename', + * 'username' => 'username', + * 'password' => 'password', + * 'host' => 'localhost', + * 'port' => 3306, + * 'prefix' => 'myprefix_', + * 'collation' => 'utf8_general_ci', + * ); + * @endcode + * + * The "driver" property indicates what Drupal database driver the + * connection should use. This is usually the same as the name of the + * database type, such as mysql or sqlite, but not always. The other + * properties will vary depending on the driver. For SQLite, you must + * specify a database file name in a directory that is writable by the + * webserver. For most other drivers, you must specify a + * username, password, host, and database name. + * + * Transaction support is enabled by default for all drivers that support it, + * including MySQL. To explicitly disable it, set the 'transactions' key to + * FALSE. + * Note that some configurations of MySQL, such as the MyISAM engine, don't + * support it and will proceed silently even if enabled. If you experience + * transaction related crashes with such configuration, set the 'transactions' + * key to FALSE. + * + * For each database, you may optionally specify multiple "target" databases. + * A target database allows Drupal to try to send certain queries to a + * different database if it can but fall back to the default connection if not. + * That is useful for master/slave replication, as Drupal may try to connect + * to a slave server when appropriate and if one is not available will simply + * fall back to the single master server. + * + * The general format for the $databases array is as follows: + * @code + * $databases['default']['default'] = $info_array; + * $databases['default']['slave'][] = $info_array; + * $databases['default']['slave'][] = $info_array; + * $databases['extra']['default'] = $info_array; + * @endcode + * + * In the above example, $info_array is an array of settings described above. + * The first line sets a "default" database that has one master database + * (the second level default). The second and third lines create an array + * of potential slave databases. Drupal will select one at random for a given + * request as needed. The fourth line creates a new database with a name of + * "extra". + * + * For a single database configuration, the following is sufficient: + * @code + * $databases['default']['default'] = array( + * 'driver' => 'mysql', + * 'database' => 'databasename', + * 'username' => 'username', + * 'password' => 'password', + * 'host' => 'localhost', + * 'prefix' => 'main_', + * 'collation' => 'utf8_general_ci', + * ); + * @endcode + * + * For handling full UTF-8 in MySQL, including multi-byte characters such as + * emojis, Asian symbols, and mathematical symbols, you may set the collation + * and charset to "utf8mb4" prior to running install.php: + * @code + * $databases['default']['default'] = array( + * 'driver' => 'mysql', + * 'database' => 'databasename', + * 'username' => 'username', + * 'password' => 'password', + * 'host' => 'localhost', + * 'charset' => 'utf8mb4', + * 'collation' => 'utf8mb4_general_ci', + * ); + * @endcode + * When using this setting on an existing installation, ensure that all existing + * tables have been converted to the utf8mb4 charset, for example by using the + * utf8mb4_convert contributed project available at + * https://www.drupal.org/project/utf8mb4_convert, so as to prevent mixing data + * with different charsets. + * Note this should only be used when all of the following conditions are met: + * - In order to allow for large indexes, MySQL must be set up with the + * following my.cnf settings: + * [mysqld] + * innodb_large_prefix=true + * innodb_file_format=barracuda + * innodb_file_per_table=true + * These settings are available as of MySQL 5.5.14, and are defaults in + * MySQL 5.7.7 and up. + * - The PHP MySQL driver must support the utf8mb4 charset (libmysqlclient + * 5.5.3 and up, as well as mysqlnd 5.0.9 and up). + * - The MySQL server must support the utf8mb4 charset (5.5.3 and up). + * + * You can optionally set prefixes for some or all database table names + * by using the 'prefix' setting. If a prefix is specified, the table + * name will be prepended with its value. Be sure to use valid database + * characters only, usually alphanumeric and underscore. If no prefixes + * are desired, leave it as an empty string ''. + * + * To have all database names prefixed, set 'prefix' as a string: + * @code + * 'prefix' => 'main_', + * @endcode + * To provide prefixes for specific tables, set 'prefix' as an array. + * The array's keys are the table names and the values are the prefixes. + * The 'default' element is mandatory and holds the prefix for any tables + * not specified elsewhere in the array. Example: + * @code + * 'prefix' => array( + * 'default' => 'main_', + * 'users' => 'shared_', + * 'sessions' => 'shared_', + * 'role' => 'shared_', + * 'authmap' => 'shared_', + * ), + * @endcode + * You can also use a reference to a schema/database as a prefix. This may be + * useful if your Drupal installation exists in a schema that is not the default + * or you want to access several databases from the same code base at the same + * time. + * Example: + * @code + * 'prefix' => array( + * 'default' => 'main.', + * 'users' => 'shared.', + * 'sessions' => 'shared.', + * 'role' => 'shared.', + * 'authmap' => 'shared.', + * ); + * @endcode + * NOTE: MySQL and SQLite's definition of a schema is a database. + * + * Advanced users can add or override initial commands to execute when + * connecting to the database server, as well as PDO connection settings. For + * example, to enable MySQL SELECT queries to exceed the max_join_size system + * variable, and to reduce the database connection timeout to 5 seconds: + * + * @code + * $databases['default']['default'] = array( + * 'init_commands' => array( + * 'big_selects' => 'SET SQL_BIG_SELECTS=1', + * ), + * 'pdo' => array( + * PDO::ATTR_TIMEOUT => 5, + * ), + * ); + * @endcode + * + * WARNING: These defaults are designed for database portability. Changing them + * may cause unexpected behavior, including potential data loss. + * + * @see DatabaseConnection_mysql::__construct + * @see DatabaseConnection_pgsql::__construct + * @see DatabaseConnection_sqlite::__construct + * + * Database configuration format: + * @code + * $databases['default']['default'] = array( + * 'driver' => 'mysql', + * 'database' => 'databasename', + * 'username' => 'username', + * 'password' => 'password', + * 'host' => 'localhost', + * 'prefix' => '', + * ); + * $databases['default']['default'] = array( + * 'driver' => 'pgsql', + * 'database' => 'databasename', + * 'username' => 'username', + * 'password' => 'password', + * 'host' => 'localhost', + * 'prefix' => '', + * ); + * $databases['default']['default'] = array( + * 'driver' => 'sqlite', + * 'database' => '/path/to/databasefilename', + * ); + * @endcode + */ +$databases = array ( + 'default' => + array ( + 'default' => + array ( + 'database' => '{{ db_name }}', + 'username' => '{{ db_user }}', + 'password' => '{{ db_password }}', + 'host' => 'localhost', + 'port' => '', + 'driver' => '{{ db_driver }}', + 'prefix' => '', + ), + ), +); + +/** + * Access control for update.php script. + * + * If you are updating your Drupal installation using the update.php script but + * are not logged in using either an account with the "Administer software + * updates" permission or the site maintenance account (the account that was + * created during installation), you will need to modify the access check + * statement below. Change the FALSE to a TRUE to disable the access check. + * After finishing the upgrade, be sure to open this file again and change the + * TRUE back to a FALSE! + */ +$update_free_access = FALSE; + +/** + * Salt for one-time login links and cancel links, form tokens, etc. + * + * This variable will be set to a random value by the installer. All one-time + * login links will be invalidated if the value is changed. Note that if your + * site is deployed on a cluster of web servers, you must ensure that this + * variable has the same value on each server. If this variable is empty, a hash + * of the serialized database credentials will be used as a fallback salt. + * + * For enhanced security, you may set this variable to a value using the + * contents of a file outside your docroot that is never saved together + * with any backups of your Drupal files and database. + * + * Example: + * $drupal_hash_salt = file_get_contents('/home/example/salt.txt'); + * + */ +$drupal_hash_salt = '{{ hash_salt }}'; + +/** + * Base URL (optional). + * + * If Drupal is generating incorrect URLs on your site, which could + * be in HTML headers (links to CSS and JS files) or visible links on pages + * (such as in menus), uncomment the Base URL statement below (remove the + * leading hash sign) and fill in the absolute URL to your Drupal installation. + * + * You might also want to force users to use a given domain. + * See the .htaccess file for more information. + * + * Examples: + * $base_url = 'http://www.example.com'; + * $base_url = 'http://www.example.com:8888'; + * $base_url = 'http://www.example.com/drupal'; + * $base_url = 'https://www.example.com:8888/drupal'; + * + * It is not allowed to have a trailing slash; Drupal will add it + * for you. + */ +# $base_url = 'http://www.example.com'; // NO trailing slash! + +/** + * PHP settings: + * + * To see what PHP settings are possible, including whether they can be set at + * runtime (by using ini_set()), read the PHP documentation: + * http://www.php.net/manual/ini.list.php + * See drupal_environment_initialize() in includes/bootstrap.inc for required + * runtime settings and the .htaccess file for non-runtime settings. Settings + * defined there should not be duplicated here so as to avoid conflict issues. + */ + +/** + * Some distributions of Linux (most notably Debian) ship their PHP + * installations with garbage collection (gc) disabled. Since Drupal depends on + * PHP's garbage collection for clearing sessions, ensure that garbage + * collection occurs by using the most common settings. + */ +ini_set('session.gc_probability', 1); +ini_set('session.gc_divisor', 100); + +/** + * Set session lifetime (in seconds), i.e. the time from the user's last visit + * to the active session may be deleted by the session garbage collector. When + * a session is deleted, authenticated users are logged out, and the contents + * of the user's $_SESSION variable is discarded. + */ +ini_set('session.gc_maxlifetime', 200000); + +/** + * Set session cookie lifetime (in seconds), i.e. the time from the session is + * created to the cookie expires, i.e. when the browser is expected to discard + * the cookie. The value 0 means "until the browser is closed". + */ +ini_set('session.cookie_lifetime', 2000000); + +/** + * If you encounter a situation where users post a large amount of text, and + * the result is stripped out upon viewing but can still be edited, Drupal's + * output filter may not have sufficient memory to process it. If you + * experience this issue, you may wish to uncomment the following two lines + * and increase the limits of these variables. For more information, see + * http://php.net/manual/pcre.configuration.php. + */ +# ini_set('pcre.backtrack_limit', 200000); +# ini_set('pcre.recursion_limit', 200000); + +/** + * Drupal automatically generates a unique session cookie name for each site + * based on its full domain name. If you have multiple domains pointing at the + * same Drupal site, you can either redirect them all to a single domain (see + * comment in .htaccess), or uncomment the line below and specify their shared + * base domain. Doing so assures that users remain logged in as they cross + * between your various domains. Make sure to always start the $cookie_domain + * with a leading dot, as per RFC 2109. + */ +# $cookie_domain = '.example.com'; + +/** + * Variable overrides: + * + * To override specific entries in the 'variable' table for this site, + * set them here. You usually don't need to use this feature. This is + * useful in a configuration file for a vhost or directory, rather than + * the default settings.php. Any configuration setting from the 'variable' + * table can be given a new value. Note that any values you provide in + * these variable overrides will not be modifiable from the Drupal + * administration interface. + * + * The following overrides are examples: + * - site_name: Defines the site's name. + * - theme_default: Defines the default theme for this site. + * - anonymous: Defines the human-readable name of anonymous users. + * Remove the leading hash signs to enable. + */ +# $conf['site_name'] = 'My Drupal site'; +# $conf['theme_default'] = 'garland'; +# $conf['anonymous'] = 'Visitor'; + +/** + * A custom theme can be set for the offline page. This applies when the site + * is explicitly set to maintenance mode through the administration page or when + * the database is inactive due to an error. It can be set through the + * 'maintenance_theme' key. The template file should also be copied into the + * theme. It is located inside 'modules/system/maintenance-page.tpl.php'. + * Note: This setting does not apply to installation and update pages. + */ +# $conf['maintenance_theme'] = 'bartik'; + +/** + * Reverse Proxy Configuration: + * + * Reverse proxy servers are often used to enhance the performance + * of heavily visited sites and may also provide other site caching, + * security, or encryption benefits. In an environment where Drupal + * is behind a reverse proxy, the real IP address of the client should + * be determined such that the correct client IP address is available + * to Drupal's logging, statistics, and access management systems. In + * the most simple scenario, the proxy server will add an + * X-Forwarded-For header to the request that contains the client IP + * address. However, HTTP headers are vulnerable to spoofing, where a + * malicious client could bypass restrictions by setting the + * X-Forwarded-For header directly. Therefore, Drupal's proxy + * configuration requires the IP addresses of all remote proxies to be + * specified in $conf['reverse_proxy_addresses'] to work correctly. + * + * Enable this setting to get Drupal to determine the client IP from + * the X-Forwarded-For header (or $conf['reverse_proxy_header'] if set). + * If you are unsure about this setting, do not have a reverse proxy, + * or Drupal operates in a shared hosting environment, this setting + * should remain commented out. + * + * In order for this setting to be used you must specify every possible + * reverse proxy IP address in $conf['reverse_proxy_addresses']. + * If a complete list of reverse proxies is not available in your + * environment (for example, if you use a CDN) you may set the + * $_SERVER['REMOTE_ADDR'] variable directly in settings.php. + * Be aware, however, that it is likely that this would allow IP + * address spoofing unless more advanced precautions are taken. + */ +# $conf['reverse_proxy'] = TRUE; + +/** + * Specify every reverse proxy IP address in your environment. + * This setting is required if $conf['reverse_proxy'] is TRUE. + */ +# $conf['reverse_proxy_addresses'] = array('a.b.c.d', ...); + +/** + * Set this value if your proxy server sends the client IP in a header + * other than X-Forwarded-For. + */ +# $conf['reverse_proxy_header'] = 'HTTP_X_CLUSTER_CLIENT_IP'; + +/** + * Page caching: + * + * By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page + * views. This tells a HTTP proxy that it may return a page from its local + * cache without contacting the web server, if the user sends the same Cookie + * header as the user who originally requested the cached page. Without "Vary: + * Cookie", authenticated users would also be served the anonymous page from + * the cache. If the site has mostly anonymous users except a few known + * editors/administrators, the Vary header can be omitted. This allows for + * better caching in HTTP proxies (including reverse proxies), i.e. even if + * clients send different cookies, they still get content served from the cache. + * However, authenticated users should access the site directly (i.e. not use an + * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid + * getting cached pages from the proxy. + */ +# $conf['omit_vary_cookie'] = TRUE; + +/** + * CSS/JS aggregated file gzip compression: + * + * By default, when CSS or JS aggregation and clean URLs are enabled Drupal will + * store a gzip compressed (.gz) copy of the aggregated files. If this file is + * available then rewrite rules in the default .htaccess file will serve these + * files to browsers that accept gzip encoded content. This allows pages to load + * faster for these users and has minimal impact on server load. If you are + * using a webserver other than Apache httpd, or a caching reverse proxy that is + * configured to cache and compress these files itself you may want to uncomment + * one or both of the below lines, which will prevent gzip files being stored. + */ +# $conf['css_gzip_compression'] = FALSE; +# $conf['js_gzip_compression'] = FALSE; + +/** + * Block caching: + * + * Block caching may not be compatible with node access modules depending on + * how the original block cache policy is defined by the module that provides + * the block. By default, Drupal therefore disables block caching when one or + * more modules implement hook_node_grants(). If you consider block caching to + * be safe on your site and want to bypass this restriction, uncomment the line + * below. + */ +# $conf['block_cache_bypass_node_grants'] = TRUE; + +/** + * String overrides: + * + * To override specific strings on your site with or without enabling the Locale + * module, add an entry to this list. This functionality allows you to change + * a small number of your site's default English language interface strings. + * + * Remove the leading hash signs to enable. + */ +# $conf['locale_custom_strings_en'][''] = array( +# 'forum' => 'Discussion board', +# '@count min' => '@count minutes', +# ); + +/** + * + * IP blocking: + * + * To bypass database queries for denied IP addresses, use this setting. + * Drupal queries the {blocked_ips} table by default on every page request + * for both authenticated and anonymous users. This allows the system to + * block IP addresses from within the administrative interface and before any + * modules are loaded. However on high traffic websites you may want to avoid + * this query, allowing you to bypass database access altogether for anonymous + * users under certain caching configurations. + * + * If using this setting, you will need to add back any IP addresses which + * you may have blocked via the administrative interface. Each element of this + * array represents a blocked IP address. Uncommenting the array and leaving it + * empty will have the effect of disabling IP blocking on your site. + * + * Remove the leading hash signs to enable. + */ +# $conf['blocked_ips'] = array( +# 'a.b.c.d', +# ); + +/** + * Fast 404 pages: + * + * Drupal can generate fully themed 404 pages. However, some of these responses + * are for images or other resource files that are not displayed to the user. + * This can waste bandwidth, and also generate server load. + * + * The options below return a simple, fast 404 page for URLs matching a + * specific pattern: + * - 404_fast_paths_exclude: A regular expression to match paths to exclude, + * such as images generated by image styles, or dynamically-resized images. + * The default pattern provided below also excludes the private file system. + * If you need to add more paths, you can add '|path' to the expression. + * - 404_fast_paths: A regular expression to match paths that should return a + * simple 404 page, rather than the fully themed 404 page. If you don't have + * any aliases ending in htm or html you can add '|s?html?' to the expression. + * - 404_fast_html: The html to return for simple 404 pages. + * + * Add leading hash signs if you would like to disable this functionality. + */ +$conf['404_fast_paths_exclude'] = '/\/(?:styles)|(?:system\/files)\//'; +$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +$conf['404_fast_html'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>'; + +/** + * By default the page request process will return a fast 404 page for missing + * files if they match the regular expression set in '404_fast_paths' and not + * '404_fast_paths_exclude' above. 404 errors will simultaneously be logged in + * the Drupal system log. + * + * You can choose to return a fast 404 page earlier for missing pages (as soon + * as settings.php is loaded) by uncommenting the line below. This speeds up + * server response time when loading 404 error pages and prevents the 404 error + * from being logged in the Drupal system log. In order to prevent valid pages + * such as image styles and other generated content that may match the + * '404_fast_paths' regular expression from returning 404 errors, it is + * necessary to add them to the '404_fast_paths_exclude' regular expression + * above. Make sure that you understand the effects of this feature before + * uncommenting the line below. + */ +# drupal_fast_404(); + +/** + * External access proxy settings: + * + * If your site must access the Internet via a web proxy then you can enter + * the proxy settings here. Currently only basic authentication is supported + * by using the username and password variables. The proxy_user_agent variable + * can be set to NULL for proxies that require no User-Agent header or to a + * non-empty string for proxies that limit requests to a specific agent. The + * proxy_exceptions variable is an array of host names to be accessed directly, + * not via proxy. + */ +# $conf['proxy_server'] = ''; +# $conf['proxy_port'] = 8080; +# $conf['proxy_username'] = ''; +# $conf['proxy_password'] = ''; +# $conf['proxy_user_agent'] = ''; +# $conf['proxy_exceptions'] = array('127.0.0.1', 'localhost'); + +/** + * Authorized file system operations: + * + * The Update manager module included with Drupal provides a mechanism for + * site administrators to securely install missing updates for the site + * directly through the web user interface. On securely-configured servers, + * the Update manager will require the administrator to provide SSH or FTP + * credentials before allowing the installation to proceed; this allows the + * site to update the new files as the user who owns all the Drupal files, + * instead of as the user the webserver is running as. On servers where the + * webserver user is itself the owner of the Drupal files, the administrator + * will not be prompted for SSH or FTP credentials (note that these server + * setups are common on shared hosting, but are inherently insecure). + * + * Some sites might wish to disable the above functionality, and only update + * the code directly via SSH or FTP themselves. This setting completely + * disables all functionality related to these authorized file operations. + * + * @see http://drupal.org/node/244924 + * + * Remove the leading hash signs to disable. + */ +# $conf['allow_authorize_operations'] = FALSE; + +/** + * Theme debugging: + * + * When debugging is enabled: + * - The markup of each template is surrounded by HTML comments that contain + * theming information, such as template file name suggestions. + * - Note that this debugging markup will cause automated tests that directly + * check rendered HTML to fail. + * + * For more information about debugging theme templates, see + * https://www.drupal.org/node/223440#theme-debug. + * + * Not recommended in production environments. + * + * Remove the leading hash sign to enable. + */ +# $conf['theme_debug'] = TRUE; + +/** + * CSS identifier double underscores allowance: + * + * To allow CSS identifiers to contain double underscores (.example__selector) + * for Drupal's BEM-style naming standards, uncomment the line below. + * Note that if you change this value in existing sites, existing page styles + * may be broken. + * + * @see drupal_clean_css_identifier() + */ +# $conf['allow_css_double_underscores'] = TRUE; diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/template.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/template.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..6776ca6c04a4adf67ebe0c3bab15498deb110690 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/template.php.twig @@ -0,0 +1,27 @@ +<?php + +/** + * @file + * Template overrides and (pre-)process hooks for the {{ name }} theme. + */ + +/** + * Implements HOOK_preprocess_html(). + */ +function {{ machine_name }}_preprocess_html(&$vars) { + +} + +/** + * Implements HOOK_preprocess_page(). + */ +function {{ machine_name }}_preprocess_page(&$vars) { + +} + +/** + * Implements HOOK_preprocess_node(). + */ +function {{ machine_name }}_preprocess_node(&$vars) { + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/test.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/test.twig new file mode 100644 index 0000000000000000000000000000000000000000..ac7dabaee3456da948c0e326fe7ed3e563b23fa2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/test.twig @@ -0,0 +1,54 @@ +<?php + +/** + * @file + * Tests for {{ name }}.module. + */ + +/** + * Tests the functionality of the {{ name }} module. + */ +class {{ class }} extends DrupalWebTestCase { + + /** + * A user with permission to administer {{ machine_name }} configuration. + * + * @var object + */ + protected $admin_user; + + public static function getInfo() { + return array( + 'name' => '{{ name }}', + 'description' => 'Test description', + 'group' => '{{ machine_name }}', + ); + } + + function setUp() { + parent::setUp(array('{{ machine_name }}')); + + // Create admin account. + $this->admin_user = $this->drupalCreateUser(array('administer {{ machine_name }} configuration')); + + $this->drupalLogin($this->admin_user); + } + + /** + * Tests configuration form. + */ + function testAdminForm() { + $fields = array( + '{{ machine_name }}_setting_1' => 'test', + '{{ machine_name }}_setting_2' => 1, + '{{ machine_name }}_setting_3' => 1, + ); + $this->drupalPost('admin/config/system/{{ machine_name }}', $fields, t('Save configuration')); + + $this->assertFieldByName('{{ machine_name }}_setting_1', 'test'); + $this->assertFieldByName('{{ machine_name }}_setting_2', 1); + $this->assertFieldByName('{{ machine_name }}_setting_3', 1); + $this->assertRaw(t('The configuration options have been saved.')); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/theme-css.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/theme-css.twig new file mode 100644 index 0000000000000000000000000000000000000000..14676d58e3fad32dabb5f7641696e22327a66435 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/theme-css.twig @@ -0,0 +1,5 @@ + +/** + * @file + * Example styles. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/theme-info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/theme-info.twig new file mode 100644 index 0000000000000000000000000000000000000000..e71cf39a043726c35f81ececea0ce4750a5fae3a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/theme-info.twig @@ -0,0 +1,9 @@ +name = {{ name }} +description = {{ description }} +{% if base_theme %} +base theme = {{ base_theme }} +{% endif %} +core = 7.x + +stylesheets[all][] = css/{{ machine_name }}.css +scripts[] = js/{{ machine_name }}.js diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default-views.inc.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default-views.inc.twig new file mode 100644 index 0000000000000000000000000000000000000000..c4f1b05c4f7002c2d594a5897eb43cf30e5c674a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default-views.inc.twig @@ -0,0 +1,21 @@ +<?php + +/** + * @file + * Provide views data and handlers for {{ name }} module. + */ + +/** + * Implements hook_views_plugins(). + */ +function {{ machine_name }}_views_plugins() { + return array( + 'module' => '{{ machine_name }}', + 'argument default' => array( + '{{ plugin_machine_name }}' => array( + 'title' => t('{{ plugin_name }}'), + 'handler' => 'views_plugin_argument_{{ plugin_machine_name }}', + ), + ), + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default.module.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default.module.twig new file mode 100644 index 0000000000000000000000000000000000000000..76f4c1e029b9ad938307c53ab5779ef6800d2f62 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default.module.twig @@ -0,0 +1,16 @@ +<?php + +/** + * @file + * Primary module hooks for {{ name }} module. + */ + +/** + * Implements hook_views_api(). + */ +function {{ machine_name }}_views_api() { + return array( + 'api' => '3.0', + 'path' => drupal_get_path('module', '{{ machine_name }}') . '/views', + ); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default.twig new file mode 100644 index 0000000000000000000000000000000000000000..fcdb3d666b32523fda1968a3db8ec17109f08abc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/views-plugin/argument-default.twig @@ -0,0 +1,67 @@ +<?php + +/** + * @file + * Contains the {{ plugin_name }} argument default plugin. + * + * @DCG This file needs to be referenced from {{ machine_name }}.info using files[] directive. + */ + +/** + * Plugin description. + */ +class views_plugin_argument_{{ plugin_machine_name }} extends views_plugin_argument_default { + + /** + * {@inheritdoc} + */ + public function option_definition() { + $options = parent::option_definition(); + $options['example_option'] = array('default' => 15); + return $options; + } + + /** + * {@inheritdoc} + */ + public function options_form(&$form, &$form_state) { + $form['example_option'] = array( + '#type' => 'textfield', + '#title' => t('Some example option.'), + '#default_value' => $this->options['example_option'], + ); + } + + /** + * {@inheritdoc} + */ + public function options_validate(&$form, &$form_state) { + if ($form_state['values']['options']['argument_default']['{{ plugin_machine_name }}']['example_option'] == 10) { + form_error($form['example_option'], t('The value is not correct.')); + } + } + + /** + * {@inheritdoc} + */ + public function options_submit(&$form, &$form_state, &$options) { + $options['example_option'] = $form_state['values']['options']['argument_default']['{{ plugin_machine_name }}']['example_option']; + } + + /** + * {@inheritdoc} + */ + public function get_argument() { + + // @DCG + // Here is the place where you should create a default argument for the + // contextual filter. The source of this argument depends on your needs. + // For example, you can extract the value from the URL or fetch it from + // some fields of the current viewed entity. + // For now lets use example option as an argument. + $argument = $this->options['example_option']; + + return $argument; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_field/default-formatter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/default-formatter.twig new file mode 100644 index 0000000000000000000000000000000000000000..515bcbad402d9c604b0c5056af4a95e037d0e5b0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/default-formatter.twig @@ -0,0 +1,148 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Field\FieldFormatter; + +{% sort %} + {% if datetime %} +use Drupal\Core\Datetime\DrupalDateTime; + {% endif %} +use Drupal\Core\Field\FieldItemListInterface; +use Drupal\Core\Field\FormatterBase; + {% if formatter_settings %} +use Drupal\Core\Form\FormStateInterface; + {% endif %} + {% if link %} +use Drupal\Core\Url; + {% endif %} + {% if list %} +use Drupal\{{ machine_name }}\Plugin\Field\FieldType\{{ type_class }}; + {% endif %} +{% endsort %} + +/** + * Plugin implementation of the '{{ field_id }}_default' formatter. + * + * @FieldFormatter( + * id = "{{ field_id }}_default", + * label = @Translation("Default"), + * field_types = {"{{ field_id }}"} + * ) + */ +class {{ formatter_class }} extends FormatterBase { + +{% if formatter_settings %} + /** + * {@inheritdoc} + */ + public static function defaultSettings() { + return ['foo' => 'bar'] + parent::defaultSettings(); + } + + /** + * {@inheritdoc} + */ + public function settingsForm(array $form, FormStateInterface $form_state) { + $settings = $this->getSettings(); + $element['foo'] = [ + '#type' => 'textfield', + '#title' => $this->t('Foo'), + '#default_value' => $settings['foo'], + ]; + return $element; + } + + /** + * {@inheritdoc} + */ + public function settingsSummary() { + $settings = $this->getSettings(); + $summary[] = $this->t('Foo: @foo', ['@foo' => $settings['foo']]); + return $summary; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function viewElements(FieldItemListInterface $items, $langcode) { + $element = []; + + foreach ($items as $delta => $item) { + +{% for subfield in subfields %} + {% if subfield.type == 'boolean' %} + $element[$delta]['{{ subfield.machine_name }}'] = [ + '#type' => 'item', + '#title' => $this->t('{{ subfield.name }}'), + '#markup' => $item->{{ subfield.machine_name }} ? $this->t('Yes') : $this->t('No'), + ]; + + {% else %} + if ($item->{{ subfield.machine_name }}) { + {% if subfield.list %} + $allowed_values = {{ type_class }}::{{ subfield.allowed_values_method }}(); + {% endif %} + {% set item_value %} + {% if subfield.list %}$allowed_values[$item->{{ subfield.machine_name }}]{% else %}$item->{{ subfield.machine_name }}{% endif %} + {% endset %} + {% if subfield.type == 'datetime' %} + $date = DrupalDateTime::createFromFormat('{{ subfield.date_storage_format }}', $item->{{ subfield.machine_name }}); + // @DCG: Consider injecting the date formatter service. + // @codingStandardsIgnoreStart + $date_formatter = \Drupal::service('date.formatter'); + // @codingStandardsIgnoreStart + $timestamp = $date->getTimestamp(); + {% if subfield.list %} + $formatted_date = {{ item_value }}; + {% else %} + $formatted_date = $date_formatter->format($timestamp, 'long'); + {% endif %} + $iso_date = $date_formatter->format($timestamp, 'custom', 'Y-m-d\TH:i:s') . 'Z'; + $element[$delta]['{{ subfield.machine_name }}'] = [ + '#type' => 'item', + '#title' => $this->t('{{ subfield.name }}'), + 'content' => [ + '#theme' => 'time', + '#text' => $formatted_date, + '#html' => FALSE, + '#attributes' => [ + 'datetime' => $iso_date, + ], + '#cache' => [ + 'contexts' => [ + 'timezone', + ], + ], + ], + ]; + {% else %} + $element[$delta]['{{ subfield.machine_name }}'] = [ + '#type' => 'item', + '#title' => $this->t('{{ subfield.name }}'), + {% if subfield.link %} + 'content' => [ + '#type' => 'link', + '#title' => {{ item_value }}, + {% if subfield.type == 'email' %} + '#url' => Url::fromUri('mailto:' . $item->{{ subfield.machine_name }}), + {% elseif subfield.type == 'telephone' %} + '#url' => Url::fromUri('tel:' . rawurlencode(preg_replace('/\s+/', '', $item->{{ subfield.machine_name }}))), + {% elseif subfield.type == 'uri' %} + '#url' => Url::fromUri($item->{{ subfield.machine_name }}), + {% endif %} + ], + {% else %} + '#markup' => {{ item_value }}, + {% endif %} + ]; + {% endif %} + } + + {% endif %} +{% endfor %} + } + + return $element; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_field/key-value-formatter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/key-value-formatter.twig new file mode 100644 index 0000000000000000000000000000000000000000..2f854ffb5cede8bf83bec8c6d5f985916e16660f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/key-value-formatter.twig @@ -0,0 +1,105 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Field\FieldFormatter; + +{% sort %} + {% if datetime %} +use Drupal\Core\Datetime\DrupalDateTime; + {% endif %} +use Drupal\Core\Field\FieldItemListInterface; +use Drupal\Core\Field\FormatterBase; + {% if list %} +use Drupal\{{ machine_name }}\Plugin\Field\FieldType\{{ type_class }}; + {% endif %} +{% endsort %} + +/** + * Plugin implementation of the '{{ field_id }}_key_value' formatter. + * + * @FieldFormatter( + * id = "{{ field_id }}_key_value", + * label = @Translation("Key-value"), + * field_types = {"{{ field_id }}"} + * ) + */ +class {{ key_value_formatter_class }} extends FormatterBase { + + /** + * {@inheritdoc} + */ + public function viewElements(FieldItemListInterface $items, $langcode) { + + $element = []; + + foreach ($items as $delta => $item) { + + $table = [ + '#type' => 'table', + ]; + +{% for subfield in subfields %} + // {{ subfield.name }}. + if ($item->{{ subfield.machine_name }}) { + {% if subfield.type == 'datetime' %} + $date = DrupalDateTime::createFromFormat('{{ subfield.date_storage_format }}', $item->{{ subfield.machine_name }}); + $date_formatter = \Drupal::service('date.formatter'); + $timestamp = $date->getTimestamp(); + {% if subfield.list %} + $allowed_values = {{ type_class }}::{{ subfield.allowed_values_method }}(); + $formatted_date = $allowed_values[$item->{{ subfield.machine_name }}]; + {% else %} + $formatted_date = $date_formatter->format($timestamp, 'long'); + {% endif %} + $iso_date = $date_formatter->format($timestamp, 'custom', 'Y-m-d\TH:i:s') . 'Z'; + + {% elseif subfield.list %} + $allowed_values = {{ type_class }}::{{ subfield.allowed_values_method }}(); + + {% endif %} + $table['#rows'][] = [ + 'data' => [ + [ + 'header' => TRUE, + 'data' => [ + '#markup' => $this->t('{{ subfield.name }}'), + ], + ], + [ + 'data' => [ + {% if subfield.type == 'boolean' %} + '#markup' => $item->{{ subfield.machine_name }} ? $this->t('Yes') : $this->t('No'), + {% elseif subfield.type == 'datetime' %} + '#theme' => 'time', + '#text' => $formatted_date, + '#html' => FALSE, + '#attributes' => [ + 'datetime' => $iso_date, + ], + '#cache' => [ + 'contexts' => [ + 'timezone', + ], + ], + {% else %} + {% if subfield.list %} + '#markup' => $allowed_values[$item->{{ subfield.machine_name }}], + {% else %} + '#markup' => $item->{{ subfield.machine_name }}, + {% endif %} + {% endif %} + ], + ], + ], + 'no_striping' => TRUE, + ]; + } + +{% endfor %} + $element[$delta] = $table; + + } + + return $element; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_field/libraries.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/libraries.twig new file mode 100644 index 0000000000000000000000000000000000000000..d61ad18def1b372d2f02681d81c50883d39b721f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/libraries.twig @@ -0,0 +1,4 @@ +{{ field_id }}: + css: + component: + css/{{ field_id|u2h }}-widget.css: {} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_field/schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..e3612e61317f7fdf04114b4a66cba35e30bbf825 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/schema.twig @@ -0,0 +1,50 @@ +{% if storage_settings %} +# Field storage. +field.storage_settings.{{ field_id }}: + type: mapping + label: Example storage settings + mapping: + foo: + type: string + label: Foo +{% endif %} +{% if instance_settings %} +# Field instance. +field.field_settings.{{ field_id }}: + type: mapping + label: Example field settings + mapping: + bar: + type: string + label: Bar +{% endif %} +# Default value. +field.value.{{ field_id }}: + type: mapping + label: Default value + mapping: +{% for subfield in subfields %} + {{ subfield.machine_name }}: + type: {{ subfield.type }} + label: {{ subfield.name }} +{% endfor %} +{% if widget_settings %} +# Field widget. +field.widget.settings.{{ field_id }}: + type: mapping + label: Example widget settings + mapping: + foo: + type: string + label: Foo +{% endif %} +{% if formatter_settings %} +# Field formatter. +field.formatter.settings.{{ field_id }}_default: + type: mapping + label: Example formatter settings + mapping: + foo: + type: string + label: Foo +{% endif %} \ No newline at end of file diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_field/table-formatter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/table-formatter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6351643c7d668555b907875e3cde40b7ce44cea3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/table-formatter.twig @@ -0,0 +1,102 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Field\FieldFormatter; + +{% sort %} + {% if datetime %} +use Drupal\Core\Datetime\DrupalDateTime; + {% endif %} +use Drupal\Core\Field\FieldItemListInterface; +use Drupal\Core\Field\FormatterBase; + {% if list %} +use Drupal\{{ machine_name }}\Plugin\Field\FieldType\{{ type_class }}; + {% endif %} +{% endsort %} + +/** + * Plugin implementation of the '{{ field_id }}_table' formatter. + * + * @FieldFormatter( + * id = "{{ field_id }}_table", + * label = @Translation("Table"), + * field_types = {"{{ field_id }}"} + * ) + */ +class {{ table_formatter_class }} extends FormatterBase { + + /** + * {@inheritdoc} + */ + public function viewElements(FieldItemListInterface $items, $langcode) { + + $header[] = '#'; +{% for subfield in subfields %} + $header[] = $this->t('{{ subfield.name }}'); +{% endfor %} + + $table = [ + '#type' => 'table', + '#header' => $header, + ]; + + foreach ($items as $delta => $item) { + $row = []; + + $row[]['#markup'] = $delta + 1; + +{% for subfield in subfields %} + {% if subfield.type == 'boolean' %} + $row[]['#markup'] = $item->{{ subfield.machine_name }} ? $this->t('Yes') : $this->t('No'); + + {% elseif subfield.type == 'datetime' %} + if ($item->{{ subfield.machine_name }}) { + $date = DrupalDateTime::createFromFormat('{{ subfield.date_storage_format }}', $item->{{ subfield.machine_name }}); + $date_formatter = \Drupal::service('date.formatter'); + $timestamp = $date->getTimestamp(); + {% if subfield.list %} + $allowed_values = {{ type_class }}::{{ subfield.allowed_values_method }}(); + $formatted_date = $allowed_values[$item->{{ subfield.machine_name }}]; + {% else %} + $formatted_date = $date_formatter->format($timestamp, 'long'); + {% endif %} + $iso_date = $date_formatter->format($timestamp, 'custom', 'Y-m-d\TH:i:s') . 'Z'; + $row[] = [ + '#theme' => 'time', + '#text' => $formatted_date, + '#html' => FALSE, + '#attributes' => [ + 'datetime' => $iso_date, + ], + '#cache' => [ + 'contexts' => [ + 'timezone', + ], + ], + ]; + } + else { + $row[]['#markup'] = ''; + } + + {% else %} + {% if subfield.list %} + if ($item->{{ subfield.machine_name }}) { + $allowed_values = {{ type_class }}::{{ subfield.allowed_values_method }}(); + $row[]['#markup'] = $allowed_values[$item->{{ subfield.machine_name }}]; + } + else { + $row[]['#markup'] = ''; + } + {% else %} + $row[]['#markup'] = $item->{{ subfield.machine_name }}; + {% endif %} + + {% endif %} +{% endfor %} + $table[$delta] = $row; + } + + return [$table]; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_field/type.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/type.twig new file mode 100644 index 0000000000000000000000000000000000000000..dee8d020d8fc618d8f1a14b39c8811e0a5e89f3a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/type.twig @@ -0,0 +1,316 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Field\FieldType; + +{% if random %} +use Drupal\Component\Utility\Random; +{% endif %} +use Drupal\Core\Field\FieldDefinitionInterface; +use Drupal\Core\Field\FieldItemBase; +use Drupal\Core\Field\FieldStorageDefinitionInterface; +{% if storage_settings or instance_settings %} +use Drupal\Core\Form\FormStateInterface; +{% endif %} +{% if email %} +use Drupal\Core\Render\Element\Email; +{% endif %} +use Drupal\Core\TypedData\DataDefinition; + +/** + * Defines the '{{ field_id }}' field type. + * + * @FieldType( + * id = "{{ field_id }}", + * label = @Translation("{{ field_label }}"), + * category = @Translation("General"), + * default_widget = "{{ field_id }}", + * default_formatter = "{{ field_id }}_default" + * ) + */ +class {{ type_class }} extends FieldItemBase { + +{% if storage_settings %} + /** + * {@inheritdoc} + */ + public static function defaultStorageSettings() { + $settings = ['foo' => 'example']; + return $settings + parent::defaultStorageSettings(); + } + + /** + * {@inheritdoc} + */ + public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data) { + $settings = $this->getSettings(); + + $element['foo'] = [ + '#type' => 'textfield', + '#title' => $this->t('Foo'), + '#default_value' => $settings['foo'], + '#disabled' => $has_data, + ]; + + return $element; + } + +{% endif %} +{% if instance_settings %} + /** + * {@inheritdoc} + */ + public static function defaultFieldSettings() { + $settings = ['bar' => 'example']; + return $settings + parent::defaultFieldSettings(); + } + + /** + * {@inheritdoc} + */ + public function fieldSettingsForm(array $form, FormStateInterface $form_state) { + $settings = $this->getSettings(); + + $element['bar'] = [ + '#type' => 'textfield', + '#title' => $this->t('Foo'), + '#default_value' => $settings['bar'], + ]; + + return $element; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function isEmpty() { +{% for subfield in subfields %} + {% set condition %} + {% if subfield.type == 'boolean' %}$this->{{ subfield.machine_name }} == 1{% else %}$this->{{ subfield.machine_name }} !== NULL{% endif %} + {% endset %} + {% if loop.index == 1 %} + if ({{ condition }}) { + {% else %} + elseif ({{ condition }}) { + {% endif %} + return FALSE; + } +{% endfor %} + return TRUE; + } + + /** + * {@inheritdoc} + */ + public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + +{% for subfield in subfields %} + $properties['{{ subfield.machine_name }}'] = DataDefinition::create('{{ subfield.data_type }}') + ->setLabel(t('{{ subfield.name }}')); +{% endfor %} + + return $properties; + } + + /** + * {@inheritdoc} + */ + public function getConstraints() { + $constraints = parent::getConstraints(); + +{% for subfield in subfields %} + {% if subfield.list %} + $options['{{ subfield.machine_name }}']['AllowedValues'] = array_keys({{ type_class }}::{{ subfield.allowed_values_method }}()); + + {% endif %} + {% if subfield.required %} + {% if subfield.type == 'boolean' %} + // NotBlank validator is not suitable for booleans because it does not + // recognize '0' as an empty value. + $options['{{ subfield.machine_name }}']['AllowedValues']['choices'] = [1]; + $options['{{ subfield.machine_name }}']['AllowedValues']['message'] = $this->t('This value should not be blank.'); + + {% else %} + $options['{{ subfield.machine_name }}']['NotBlank'] = []; + + {% if subfield.type == 'email' %} + $options['{{ subfield.machine_name }}']['Length']['max'] = Email::EMAIL_MAX_LENGTH; + + {% endif %} + {% endif %} + {% endif %} +{% endfor %} +{% if list or required %} + $constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager(); + $constraints[] = $constraint_manager->create('ComplexData', $options); +{% endif %} + // @todo Add more constrains here. + return $constraints; + } + + /** + * {@inheritdoc} + */ + public static function schema(FieldStorageDefinitionInterface $field_definition) { + + $columns = [ +{% for subfield in subfields %} + '{{ subfield.machine_name }}' => [ + {% if subfield.type == 'boolean' %} + 'type' => 'int', + 'size' => 'tiny', + {% elseif subfield.type == 'string' %} + 'type' => 'varchar', + 'length' => 255, + {% elseif subfield.type == 'text' %} + 'type' => 'text', + 'size' => 'big', + {% elseif subfield.type == 'integer' %} + 'type' => 'int', + 'size' => 'normal', + {% elseif subfield.type == 'float' %} + 'type' => 'float', + 'size' => 'normal', + {% elseif subfield.type == 'numeric' %} + 'type' => 'numeric', + 'precision' => 10, + 'scale' => 2, + {% elseif subfield.type == 'email' %} + 'type' => 'varchar', + 'length' => Email::EMAIL_MAX_LENGTH, + {% elseif subfield.type == 'telephone' %} + 'type' => 'varchar', + 'length' => 255, + {% elseif subfield.type == 'uri' %} + 'type' => 'varchar', + 'length' => 2048, + {% elseif subfield.type == 'datetime' %} + 'type' => 'varchar', + 'length' => 20, + {% endif %} + ], +{% endfor %} + ]; + + $schema = [ + 'columns' => $columns, + // @DCG Add indexes here if necessary. + ]; + + return $schema; + } + + /** + * {@inheritdoc} + */ + public static function generateSampleValue(FieldDefinitionInterface $field_definition) { + +{% if random %} + $random = new Random(); + +{% endif %} +{% for subfield in subfields %} + {% if subfield.list %} + $values['{{ subfield.machine_name }}'] = array_rand(self::{{ subfield.allowed_values_method }}()); + + {% elseif subfield.type == 'boolean' %} + $values['{{ subfield.machine_name }}'] = (bool) mt_rand(0, 1); + + {% elseif subfield.type == 'string' %} + $values['{{ subfield.machine_name }}'] = $random->word(mt_rand(1, 255)); + + {% elseif subfield.type == 'text' %} + $values['{{ subfield.machine_name }}'] = $random->paragraphs(5); + + {% elseif subfield.type == 'integer' %} + $values['{{ subfield.machine_name }}'] = mt_rand(-1000, 1000); + + {% elseif subfield.type == 'float' %} + $scale = rand(1, 5); + $random_decimal = mt_rand() / mt_getrandmax() * (1000 - 0); + $values['{{ subfield.machine_name }}'] = floor($random_decimal * pow(10, $scale)) / pow(10, $scale); + + {% elseif subfield.type == 'numeric' %} + $scale = rand(10, 2); + $random_decimal = -1000 + mt_rand() / mt_getrandmax() * (-1000 - 1000); + $values['{{ subfield.machine_name }}'] = floor($random_decimal * pow(10, $scale)) / pow(10, $scale); + + {% elseif subfield.type == 'email' %} + $values['{{ subfield.machine_name }}'] = strtolower($random->name()) . '@example.com'; + + {% elseif subfield.type == 'telephone' %} + $values['{{ subfield.machine_name }}'] = mt_rand(pow(10, 8), pow(10, 9) - 1); + + {% elseif subfield.type == 'uri' %} + $tlds = ['com', 'net', 'gov', 'org', 'edu', 'biz', 'info']; + $domain_length = mt_rand(7, 15); + $protocol = mt_rand(0, 1) ? 'https' : 'http'; + $www = mt_rand(0, 1) ? 'www' : ''; + $domain = $random->word($domain_length); + $tld = $tlds[mt_rand(0, (count($tlds) - 1))]; + $values['{{ subfield.machine_name }}'] = "$protocol://$www.$domain.$tld"; + + {% elseif subfield.type == 'datetime' %} + $timestamp = \Drupal::time()->getRequestTime() - mt_rand(0, 86400 * 365); + $values['{{ subfield.machine_name }}'] = gmdate('{{ subfield.date_storage_format }}', $timestamp); + + {% endif %} +{% endfor %} + return $values; + } + +{% for subfield in subfields %} + {% if subfield.list %} + /** + * Returns allowed values for '{{ subfield.machine_name }}' sub-field. + * + * @return array + * The list of allowed values. + */ + public static function {{ subfield.allowed_values_method }}() { + return [ + {% if subfield.type == 'string' %} + 'alpha' => t('Alpha'), + 'beta' => t('Beta'), + 'gamma' => t('Gamma'), + {% elseif subfield.type == 'integer' %} + 123 => 123, + 456 => 456, + 789 => 789, + {% elseif subfield.type == 'float' %} + '12.3' => '12.3', + '4.56' => '4.56', + '0.789' => '0.789', + {% elseif subfield.type == 'numeric' %} + '12.35' => '12.35', + '45.65' => '45.65', + '78.95' => '78.95', + {% elseif subfield.type == 'email' %} + 'alpha@example.com' => 'alpha@example.com', + 'beta@example.com' => 'beta@example.com', + 'gamma@example.com' => 'gamma@example.com', + {% elseif subfield.type == 'telephone' %} + '71234567001' => '+7(123)45-67-001', + '71234567002' => '+7(123)45-67-002', + '71234567003' => '+7(123)45-67-003', + {% elseif subfield.type == 'uri' %} + 'https://example.com' => 'https://example.com', + 'http://www.php.net' => 'http://www.php.net', + 'https://www.drupal.org' => 'https://www.drupal.org', + {% elseif subfield.type == 'datetime' %} + {% if subfield.date_type == 'date' %} + '2018-01-01' => '1 January 2018', + '2018-02-01' => '1 February 2018', + '2018-03-01' => '1 March 2018', + {% else %} + '2018-01-01T00:10:10' => '1 January 2018, 00:10:10', + '2018-02-01T00:20:20' => '1 February 2018, 00:20:20', + '2018-03-01T00:30:30' => '1 March 2018, 00:30:30', + {% endif %} + {% endif %} + ]; + } + + {% endif %} +{% endfor %} +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_field/widget-css.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/widget-css.twig new file mode 100644 index 0000000000000000000000000000000000000000..558dd111dbd1bd4e756ea194e6c633af9b66d10a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/widget-css.twig @@ -0,0 +1,13 @@ +{% set class = field_id|u2h ~ '-elements' %} +{% if inline %} +.container-inline.{{ class }} .form-item { + margin: 0 3px; +} +.container-inline.{{ class }} label { + display: block; +} +{% else %} +tr.odd .{{ class }} .form-item { + margin-bottom: 8px; +} +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_field/widget.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/widget.twig new file mode 100644 index 0000000000000000000000000000000000000000..e7ea8b83668b928deb65511c6ed8141e7ddb7487 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_field/widget.twig @@ -0,0 +1,202 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Field\FieldWidget; + +{% sort %} + {% if datetime %} +use Drupal\Core\Datetime\DrupalDateTime; + {% endif %} +use Drupal\Core\Field\FieldItemListInterface; +use Drupal\Core\Field\WidgetBase; +use Drupal\Core\Form\FormStateInterface; +use Symfony\Component\Validator\ConstraintViolationInterface; + {% if list %} +use Drupal\{{ machine_name }}\Plugin\Field\FieldType\{{ type_class }}; + {% endif %} +{% endsort %} + +/** + * Defines the '{{ field_id }}' field widget. + * + * @FieldWidget( + * id = "{{ field_id }}", + * label = @Translation("{{ field_label }}"), + * field_types = {"{{ field_id }}"}, + * ) + */ +class {{ widget_class }} extends WidgetBase { + +{% if widget_settings %} + /** + * {@inheritdoc} + */ + public static function defaultSettings() { + return ['foo' => 'bar'] + parent::defaultSettings(); + } + + /** + * {@inheritdoc} + */ + public function settingsForm(array $form, FormStateInterface $form_state) { + $settings = $this->getSettings(); + $element['foo'] = [ + '#type' => 'textfield', + '#title' => $this->t('Foo'), + '#default_value' => $settings['foo'], + ]; + return $element; + } + + /** + * {@inheritdoc} + */ + public function settingsSummary() { + $settings = $this->getSettings(); + $summary[] = $this->t('Foo: @foo', ['@foo' => $settings['foo']]); + return $summary; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { + +{% for subfield in subfields %} + {% set title %}'#title' => $this->t('{{ subfield.name }}'),{% endset %} + {% set default_value %}'#default_value' => isset($items[$delta]->{{ subfield.machine_name }}) ? $items[$delta]->{{ subfield.machine_name }} : NULL,{% endset %} + {% set size %}'#size' => 20,{% endset %} + {% if subfield.list %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'select', + {{ title }} + '#options' => ['' => $this->t('- {{ subfield.required ? 'Select a value' : 'None' }} -')] + {{ type_class }}::{{ subfield.allowed_values_method }}(), + {{ default_value }} + ]; + {% else %} + {% if subfield.type == 'boolean' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'checkbox', + {{ title }} + {{ default_value }} + ]; + {% elseif subfield.type == 'string' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'textfield', + {{ title }} + {{ default_value }} + {% if inline %} + {{ size }} + {% endif %} + ]; + {% elseif subfield.type == 'text' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'textarea', + {{ title }} + {{ default_value }} + ]; + {% elseif subfield.type == 'integer' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'number', + {{ title }} + {{ default_value }} + ]; + {% elseif subfield.type == 'float' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'number', + {{ title }} + {{ default_value }} + '#step' => 0.001, + ]; + {% elseif subfield.type == 'numeric' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'number', + {{ title }} + {{ default_value }} + '#step' => 0.01, + ]; + {% elseif subfield.type == 'email' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'email', + {{ title }} + {{ default_value }} + {% if inline %} + {{ size }} + {% endif %} + ]; + {% elseif subfield.type == 'telephone' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'tel', + {{ title }} + {{ default_value }} + {% if inline %} + {{ size }} + {% endif %} + ]; + {% elseif subfield.type == 'uri' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'url', + {{ title }} + {{ default_value }} + {% if inline %} + {{ size }} + {% endif %} + ]; + {% elseif subfield.type == 'datetime' %} + $element['{{ subfield.machine_name }}'] = [ + '#type' => 'datetime', + {{ title }} + '#default_value' => NULL, + {% if subfield.date_type == 'date' %} + '#date_time_element' => 'none', + '#date_time_format' => '', + {% endif %} + ]; + if (isset($items[$delta]->{{ subfield.machine_name }})) { + $element['{{ subfield.machine_name }}']['#default_value'] = DrupalDateTime::createFromFormat( + '{{ subfield.date_storage_format }}', + $items[$delta]->{{ subfield.machine_name }}, + 'UTC' + ); + } + {% endif %} + {% endif %} + +{% endfor %} + $element['#theme_wrappers'] = ['container', 'form_element']; +{% if inline %} + $element['#attributes']['class'][] = 'container-inline'; +{% endif %} + $element['#attributes']['class'][] = '{{ field_id|u2h }}-elements'; + $element['#attached']['library'][] = '{{ machine_name }}/{{ field_id }}'; + + return $element; + } + + /** + * {@inheritdoc} + */ + public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) { + return isset($violation->arrayPropertyPath[0]) ? $element[$violation->arrayPropertyPath[0]] : $element; + } + + /** + * {@inheritdoc} + */ + public function massageFormValues(array $values, array $form, FormStateInterface $form_state) { + foreach ($values as $delta => $value) { +{% for subfield in subfields %} + if ($value['{{ subfield.machine_name }}'] === '') { + $values[$delta]['{{ subfield.machine_name }}'] = NULL; + } + {% if subfield.type == 'datetime' %} + if ($value['{{ subfield.machine_name }}'] instanceof DrupalDateTime) { + $values[$delta]['{{ subfield.machine_name }}'] = $value['{{ subfield.machine_name }}']->format('{{ subfield.date_storage_format }}'); + } + {% endif %} +{% endfor %} + } + return $values; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/javascript.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/javascript.twig new file mode 100644 index 0000000000000000000000000000000000000000..e4ae4dcc9418bf95757cd5261fca259addf6c412 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/javascript.twig @@ -0,0 +1,18 @@ +/** + * @file + * Custom behaviors for {{ layout_name|lower }} layout. + */ + +(function (Drupal) { + + 'use strict'; + + Drupal.behaviors.{{ layout_machine_name|camelize(false) }} = { + attach: function (context, settings) { + + console.log('It works!'); + + } + }; + +} (Drupal)); diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/layouts.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/layouts.twig new file mode 100644 index 0000000000000000000000000000000000000000..32b78903534dfad37091647f4d629a85b59e8f2d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/layouts.twig @@ -0,0 +1,16 @@ +{{ machine_name }}_{{ layout_machine_name }}: + label: '{{ layout_name }}' + category: '{{ category }}' + path: layouts/{{ layout_machine_name }} + template: {{ layout_machine_name|u2h }} +{% if js or css %} + library: {{ machine_name }}/{{ layout_machine_name }} +{% endif %} + regions: + main: + label: Main content + sidebar: + label: Sidebar + default_region: main + icon_map: + - [main, main, sidebar] diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/libraries.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/libraries.twig new file mode 100644 index 0000000000000000000000000000000000000000..8519d50bdf7cee0b58159db272926f6c2c56d31f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/libraries.twig @@ -0,0 +1,10 @@ +{{ layout_machine_name }}: +{% if js %} + js: + layouts/{{ layout_machine_name }}/{{ layout_machine_name|u2h }}.js: {} +{% endif %} +{% if css %} + css: + component: + layouts/{{ layout_machine_name }}/{{ layout_machine_name|u2h }}.css: {} +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/styles.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/styles.twig new file mode 100644 index 0000000000000000000000000000000000000000..9b969d25656cc5eafaaf569f16b563b970e24266 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/styles.twig @@ -0,0 +1,28 @@ +.layout--{{ layout_machine_name|u2h }} { + outline: solid 1px orange; + display: flex; + padding: 10px; +} + +.layout--{{ layout_machine_name|u2h }} > .layout__region { + outline: solid 1px orange; + margin: 10px; + padding: 20px; +} + +.layout--{{ layout_machine_name|u2h }} .layout__region--main { + width: 66%; +} + +.layout--{{ layout_machine_name|u2h }} .layout__region--sidebar { + width: 33%; +} + +@media all and (max-width: 850px) { + .layout--{{ layout_machine_name|u2h }} { + flex-direction: column; + } + .layout--{{ layout_machine_name|u2h }} > .layout__region { + width: auto; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/template.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/template.twig new file mode 100644 index 0000000000000000000000000000000000000000..a14b73ab1e429978a5d605a6a91eb1f246167215 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_layout/template.twig @@ -0,0 +1,37 @@ +{{ '{' }}# +/** + * @file + * Default theme implementation to display {{ layout_name|lower }} layout. + * + * Available variables: + * - content: The content for this layout. + * - attributes: HTML attributes for the layout wrapper. + * + * @ingroup themeable + */ +#{{ '}' }} +{{ '{' }}% + set classes = [ + 'layout', + 'layout--{{ layout_machine_name|u2h }}', + ] +%{{ '}' }} +{% verbatim %} +{% if content %} + <div{{ attributes.addClass(classes) }}> + + {% if content.main %} + <div {{ region_attributes.main.addClass('layout__region', 'layout__region--main') }}> + {{ content.main }} + </div> + {% endif %} + + {% if content.sidebar %} + <div {{ region_attributes.sidebar.addClass('layout__region', 'layout__region--sidebar') }}> + {{ content.sidebar }} + </div> + {% endif %} + + </div> +{% endif %} +{% endverbatim %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/Commands/PolicyCommands.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/Commands/PolicyCommands.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..5d0ace54def15be5499b8581d61f2ed3a7898471 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/Commands/PolicyCommands.php.twig @@ -0,0 +1,40 @@ +<?php + +namespace Drush\Commands; + +use Consolidation\AnnotatedCommand\CommandData; + +/** + * Site policy. + */ +class PolicyCommands extends DrushCommands { + + /** + * Limit sql-sync operations to remote sites. + * + * @hook validate sql:sync + * + * @throws \Exception + */ + public function sqlSyncValidate(CommandData $commandData) { + $target = $commandData->input()->getArgument('target'); + if ($target != '@local') { + throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__])); + } + } + + /** + * Limit rsync operations to remote sites. + * + * @hook validate core:rsync + * + * @throws \Exception + */ + public function rsyncValidate(CommandData $commandData) { + $target = $commandData->input()->getArgument('target'); + if (strpos($target, '@prod') == 0) { + throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__])); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/drush.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/drush.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..ce1893c9565dabbd3d3208d53fc590f0475f3ce0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/drush.yml.twig @@ -0,0 +1,3 @@ +# Running commands without a pseudo-terminal on remote server is safer. +ssh: + tty: false diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/sites/self.site.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/sites/self.site.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..dd4f953d7a27b39bf20bf80b665854bee400f192 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/drush/sites/self.site.yml.twig @@ -0,0 +1,16 @@ +# Edit or remove this file as needed. +# Docs at https://github.com/drush-ops/drush/blob/master/examples/example.site.yml +prod: + host: example.com + user: prod-user + root: /path/to/drupal + uri: http://www.example.com + +stage: + host: stage.domain.com + user: stage-user + root: /path/to/drupal + uri: http://stage.example.com + +local: + uri: http://localhost diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/env.example.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/env.example.twig new file mode 100644 index 0000000000000000000000000000000000000000..3b2d9791a7568e1679e81347ef1ba84676428f9a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/env.example.twig @@ -0,0 +1,28 @@ +# Copy and rename this file to .env at root of this project. +# +# A common use case is to supply database credentials via the environment. +# Edit settings.php like so: +# +# $databases['default']['default'] = [ +# 'database' => getenv('MYSQL_DATABASE'), +# 'driver' => 'mysql', +# 'host' => getenv('MYSQL_HOST'), +# 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql', +# 'password' => getenv('MYSQL_PASSWORD'), +# 'port' => getenv('MYSQL_PORT'), +# 'prefix' => '', +# 'username' => getenv('MYSQL_USER'), +# ]; +# +# Uncomment and populate as needed. +# MYSQL_DATABASE= +# MYSQL_HOST= +# MYSQL_PASSWORD= +# MYSQL_PORT= +# MYSQL_USER= + +{% if drush %} +# Another common use case is to set Drush's --uri via environment. +# DRUSH_OPTIONS_URI=http://localhost + +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/gitignore.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/gitignore.twig new file mode 100644 index 0000000000000000000000000000000000000000..df0fac44debd8329327f38a3dc79d1076fa268e2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/gitignore.twig @@ -0,0 +1,26 @@ +# Ignore directories generated by Composer. +{% if drush %} +/drush/contrib/ +{% endif %} +/vendor/ +/{{ document_root_path }}core/ +/{{ document_root_path }}modules/contrib/ +/{{ document_root_path }}themes/contrib/ +/{{ document_root_path }}profiles/contrib/ +/{{ document_root_path }}libraries/ + +# Ignore sensitive information. +/{{ document_root_path }}sites/*/settings.php +/{{ document_root_path }}sites/*/settings.local.php + +# Ignore Drupal's file directory. +/{{ document_root_path }}sites/*/files/ + +# Ignore SimpleTest multi-site environment. +/{{ document_root_path }}sites/simpletest/ + +# Ignore files generated by PhpStorm. +/.idea/ + +# Ignore .env files as they are personal. +/.env diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/load.environment.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/load.environment.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..fb54095221c075184d5c9a0fd4687f120765aa63 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/load.environment.php.twig @@ -0,0 +1,16 @@ +<?php + +/** + * @file + * Loads environment variables from .env files. + * + * This file is included very early. + * @see composer.json For autoload section. + */ + +use Symfony\Component\Dotenv\Dotenv; + +$file = __DIR__ . '/.env'; +if (file_exists($file)) { + (new Dotenv())->load($file); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/phpcs.xml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/phpcs.xml.twig new file mode 100644 index 0000000000000000000000000000000000000000..0b0c5e6e2970551d0aad8a216da33c7211d81c89 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/phpcs.xml.twig @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<ruleset name="Default"> + <description>PHP CodeSniffer configuration for "{{ name }}" project.</description> + <config name="installed_paths" value="vendor/drupal/coder/coder_sniffer"/> + <arg name="colors"/> + <arg value="p"/> + <file>./{{ document_root_path }}modules/custom</file> +{% if drush %} + <file>./drush/Commands</file> +{% endif %} + <rule ref="Drupal"/> + <rule ref="DrupalPractice"/> +</ruleset> diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/scripts/composer/create_required_files.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/scripts/composer/create_required_files.php.twig new file mode 100755 index 0000000000000000000000000000000000000000..bf718dfead446457779b8c3896447a27c3ab483f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/scripts/composer/create_required_files.php.twig @@ -0,0 +1,58 @@ +#!/usr/bin/env php +<?php + +// -- settings.php file. +$default_settings_file = './{{ document_root_path }}sites/default/default.settings.php'; +$settings_file = './{{ document_root_path }}sites/default/settings.php'; + +if (!file_exists($settings_file) && file_exists($default_settings_file)) { + $content = file_get_contents($default_settings_file); + +{% if docrument_root %} + // Specify a directory for configuration data. + $current_code = '$config_directories = [];'; + $new_code = <<<'EOS' +$config_directories = [ + CONFIG_SYNC_DIRECTORY => DRUPAL_ROOT . '/../config/sync', +]; +EOS; + $content = str_replace($current_code, $new_code, $content); + +{% endif %} + // Allow local development configuration. + $current_code = <<<'EOS' +# +# if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { +# include $app_root . '/' . $site_path . '/settings.local.php'; +# } +EOS; + $new_code = str_replace(["#\n", '# '], '', $current_code); + $content = str_replace($current_code, $new_code, $content); + + if (!@file_put_contents($settings_file, $content)) { + file_put_contents('php://stderr', "Could not create $settings_file file.\n", FILE_APPEND); + } +} + +// -- settings.local.php file. +$example_local_settings_file = './{{ document_root_path }}sites/example.settings.local.php'; +$local_settings_file = './{{ document_root_path }}sites/default/settings.local.php'; +if (!file_exists($local_settings_file) && file_exists($example_local_settings_file)) { + if (@copy($example_local_settings_file, $local_settings_file)) { + chmod($settings_file, 0666); + } + else { + file_put_contents('php://stderr', "Could not create $local_settings_file file.\n", FILE_APPEND); + } +} + +// -- files directory. +$default_dir = './{{ document_root_path }}sites/default'; +$files_dir = $default_dir . '/files'; +if (file_exists($default_dir) && !file_exists($files_dir)) { + $original_umask = umask(0); + if (!@mkdir($files_dir, 0777)) { + file_put_contents('php://stderr', "Could not create $files_dir directory.\n", FILE_APPEND); + } + umask($original_umask); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/scripts/sync-site.sh.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/scripts/sync-site.sh.twig new file mode 100644 index 0000000000000000000000000000000000000000..22158b29d376e07c63991155899b361c9a10b4a4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/scripts/sync-site.sh.twig @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +# Synchronize local site instance with remote one. + +set -e + +ROOT_DIR=$(dirname "$(readlink -f "$0")")/.. + +function label { + echo -e "\n\e[1;47;44m "$@" \e[0m" +} + +function local_drush { + $ROOT_DIR/vendor/drush/drush/drush --root $ROOT_DIR/{{ document_root_path }} $@ +} + +SOURCE_ENVIRONMENT=$1 + +# Source environment from which we copy the database and files. +if [ -z "$SOURCE_ENVIRONMENT" ]; then + read -p "Source environment: " SOURCE_ENVIRONMENT +fi + +label 'Empty current database' +local_drush sql:drop -y + +label "Import database from $SOURCE_ENVIRONMENT" +# @DCG gzip does not make much sense for small databases. +local_drush @$SOURCE_ENVIRONMENT sql:dump --gzip | gunzip | local_drush sql:cli + +label "Synchronize files with $SOURCE_ENVIRONMENT" +# @DCG To save time and disk space consider using Stage File Proxy module. +local_drush core:rsync -y @$SOURCE_ENVIRONMENT:sites/default/files/ $(realpath $ROOT_DIR/{{ document_root_path }}sites/default/files) || true + +label 'Apply DB updates' +local_drush updatedb -y + +label 'Import configuration' +local_drush config:import -y + +label 'Check config status' +local_drush config:status + +label 'Rebuild caches' +local_drush cache:rebuild + +label 'Run CRON hooks' +local_drush core:cron + +label 'Delete log records' +local_drush watchdog:delete all -y + +label 'Warm cache' +URL=$(local_drush core:status --field=uri) +if [[ $URL == *"default"* ]]; then + echo -e "\n\e[91m"URL is not set. Skipping."\e[0m" >&2 +else + curl -s -o /dev/null -w "URL: %{url_effective}\nStatus code: %{http_code}\nTime total: %{time_total} sec.\n" $URL +fi + +label 'Check site status' +local_drush core:status diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/behat.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/behat.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..84d5829dc72183d16a84b7f799037d0edc4698e3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/behat.yml.twig @@ -0,0 +1,42 @@ +# Default Behat configuration. +default: + autoload: + '': '%paths.base%/bootstrap' + suites: + example: + paths: + - '%paths.base%/features/example' + contexts: + - ExampleContext + - Drupal\DrupalExtension\Context\DrupalContext + - Drupal\DrupalExtension\Context\MessageContext + filters: + tags: ~@ignore + extensions: + Behat\MinkExtension: + base_url: 'PLACEHOLDER' + goutte: + # The below is necessary to avoid errors when using self-signed certs. + guzzle_parameters: + verify: false + sessions: + default: + selenium2: + wd_host: http://localhost:4444/wd/hub + browser: chrome + Drupal\DrupalExtension: + blackbox: ~ + api_driver: 'drupal' +{% if drush %} + drush: + alias: 'PLACEHOLDER' + binary: '%paths.base%/../../vendor/drush/drush/drush' +{% endif %} + region_map: + header: '#header' + content: '#content' + footer: '#footer' + selectors: + message_selector: '.messages' + error_message_selector: '.messages.messages-error' + success_message_selector: '.messages.messages-status' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/bootstrap/BaseContext.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/bootstrap/BaseContext.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..f5db0b722aea871fd7fe1ac7feeb3944b2ed1031 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/bootstrap/BaseContext.php.twig @@ -0,0 +1,14 @@ +<?php + +use Drupal\DrupalExtension\Context\MinkContext; + +/** + * Base class for Behat contexts. + * + * @DCG + * Put there step definitions and helpers that need to be shared across multiple + * Behat contexts. + */ +abstract class BaseContext extends MinkContext { + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/bootstrap/ExampleContext.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/bootstrap/ExampleContext.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..b8f50485e93d665e6e2ef23a640e0714e4b012fd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/bootstrap/ExampleContext.php.twig @@ -0,0 +1,8 @@ +<?php + +/** + * Example context. + */ +class ExampleContext extends BaseContext { + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/features/example/user_forms.feature.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/features/example/user_forms.feature.twig new file mode 100644 index 0000000000000000000000000000000000000000..aabe916404c53ab706122454180b1dc1c18cd0da --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/features/example/user_forms.feature.twig @@ -0,0 +1,11 @@ +Feature: User forms + I need to be able to use the most common areas of the site. + + @javascript + Scenario: Registration + Given I am on "/user/register" + Then I should see "Create new account" in the "content" region + Then I fill in "Email address" with "test@example.com" + And I fill in "Username" with "test" + And I press "Create new account" + Then I should see the message "Thank you for applying for an account." diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/local.behat.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/local.behat.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..930d8d3181fb1d0c008d20b1927ce4b7c1a35b9d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/_project/tests/behat/local.behat.yml.twig @@ -0,0 +1,12 @@ +# Local overrides of Behat configuration. +imports: + - behat.yml +default: + extensions: + Behat\MinkExtension: + base_url: 'http://localhost' +{% if drush %} + Drupal\DrupalExtension: + drush: + alias: 'local' +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/composer.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/composer.twig new file mode 100644 index 0000000000000000000000000000000000000000..f9a7ffd781e4aeb28ec4e4fcc71d58575c46eb13 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/composer.twig @@ -0,0 +1,26 @@ +{ + "name": "drupal/{{ machine_name }}", + "type": "{{ type }}", + "description": "{{ description }}", + "keywords": ["Drupal"]{{ drupal_org ? ',' }} +{% if (drupal_org) %} + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/{{ machine_name }}", + "authors": [ + { + "name": "Your name here", + "homepage": "https://www.drupal.org/u/your_name_here", + "role": "Maintainer" + }, + { + "name": "Contributors", + "homepage": "https://www.drupal.org/node/NID/committers", + "role": "Contributors" + } + ], + "support": { + "issues": "https://www.drupal.org/project/issues/{{ machine_name }}", + "source": "http://cgit.drupalcode.org/{{ machine_name }}" + } +{% endif %} +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/controller-route.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/controller-route.twig new file mode 100644 index 0000000000000000000000000000000000000000..bb4548d85e532ce1bd4c5516237e7e409613e7fd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/controller-route.twig @@ -0,0 +1,7 @@ +{{ route_name }}: + path: '{{ route_path }}' + defaults: + _title: '{{ route_title }}' + _controller: '\Drupal\{{ machine_name }}\Controller\{{ class }}::build' + requirements: + _permission: '{{ route_permission }}' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/controller.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/controller.twig new file mode 100644 index 0000000000000000000000000000000000000000..159f93af773c566123ec5a7ef06199d8fbcc0462 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/controller.twig @@ -0,0 +1,54 @@ +{% import 'lib/di.twig' as di %} +<?php + +namespace Drupal\{{ machine_name }}\Controller; + +{% sort %} +use Drupal\Core\Controller\ControllerBase; + {% if services %} +use Symfony\Component\DependencyInjection\ContainerInterface; +{{ di.use(services) }} + {% endif %} +{% endsort %} + +/** + * Returns responses for {{ name }} routes. + */ +class {{ class }} extends ControllerBase { + +{% if services %} +{{ di.properties(services) }} + + /** + * The controller constructor. + * +{{ di.annotation(services) }} + */ + public function __construct({{ di.signature(services) }}) { +{{ di.assignment(services) }} + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( +{{ di.container(services) }} + ); + } + +{% endif %} + /** + * Builds the response. + */ + public function build() { + + $build['content'] = [ + '#type' => 'item', + '#markup' => $this->t('It works!'), + ]; + + return $build; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/install.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/install.twig new file mode 100644 index 0000000000000000000000000000000000000000..d75b805d8610dd5a572ef9b09f4aca3f9427046e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/install.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Install, update and uninstall functions for the {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/module.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/module.twig new file mode 100644 index 0000000000000000000000000000000000000000..0badaec6f833e0f7abd02d1d94e2c25f5523a5af --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/module.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Primary module hooks for {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/post_update.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/post_update.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..ac38e3ffc73c8c57615af43edd6e58da5aa8c937 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/post_update.php.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Post update functions for the {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/tokens.inc.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/tokens.inc.twig new file mode 100644 index 0000000000000000000000000000000000000000..43668cbdeeb88f7f25e2f95a35f7a5b3f31cf015 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/tokens.inc.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Builds tokens for the {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/views.inc.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/views.inc.twig new file mode 100644 index 0000000000000000000000000000000000000000..d022c1070991dffa3e8a551183ae556698dc97fe --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/views.inc.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Views hooks for the {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/views_execution.inc.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/views_execution.inc.twig new file mode 100644 index 0000000000000000000000000000000000000000..bc0fc5014b044308a28c87fb28e91e399ddd9d1c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/file-docs/views_execution.inc.twig @@ -0,0 +1,6 @@ +<?php + +/** + * @file + * Provide views runtime hooks for the {{ name }} module. + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/form/config.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/form/config.twig new file mode 100644 index 0000000000000000000000000000000000000000..d093f1c7039a148262364e7e0fb029cbe373e9b0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/form/config.twig @@ -0,0 +1,59 @@ +<?php + +namespace Drupal\{{ machine_name }}\Form; + +use Drupal\Core\Form\ConfigFormBase; +use Drupal\Core\Form\FormStateInterface; + +/** + * Configure {{ name }} settings for this site. + */ +class {{ class }} extends ConfigFormBase { + + /** + * {@inheritdoc} + */ + public function getFormId() { + return '{{ form_id }}'; + } + + /** + * {@inheritdoc} + */ + protected function getEditableConfigNames() { + return ['{{ machine_name }}.settings']; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + $form['example'] = [ + '#type' => 'textfield', + '#title' => $this->t('Example'), + '#default_value' => $this->config('{{ machine_name }}.settings')->get('example'), + ]; + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function validateForm(array &$form, FormStateInterface $form_state) { + if ($form_state->getValue('example') != 'example') { + $form_state->setErrorByName('example', $this->t('The value is not correct.')); + } + parent::validateForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->config('{{ machine_name }}.settings') + ->set('example', $form_state->getValue('example')) + ->save(); + parent::submitForm($form, $form_state); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/form/confirm.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/form/confirm.twig new file mode 100644 index 0000000000000000000000000000000000000000..903bb1e13e07054be93fef484cb40fcd22567073 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/form/confirm.twig @@ -0,0 +1,44 @@ +<?php + +namespace Drupal\{{ machine_name }}\Form; + +use Drupal\Core\Form\ConfirmFormBase; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Url; + +/** + * Provides a confirmation form before clearing out the examples. + */ +class {{ class }} extends ConfirmFormBase { + + /** + * {@inheritdoc} + */ + public function getFormId() { + return '{{ form_id }}'; + } + + /** + * {@inheritdoc} + */ + public function getQuestion() { + return $this->t('Are you sure you want to do this?'); + } + + /** + * {@inheritdoc} + */ + public function getCancelUrl() { + return new Url('system.admin_config'); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + // @DCG Place your code here. + $this->messenger()->addStatus($this->t('Done!')); + $form_state->setRedirectUrl($this->getCancelUrl()); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/form/links.menu.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/form/links.menu.twig new file mode 100644 index 0000000000000000000000000000000000000000..c836d064b4e2fe70137beef7dc88d6a2b2c89ea1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/form/links.menu.twig @@ -0,0 +1,10 @@ +{{ route_name }}: + title: {{ link_title }} +{% if link_description %} + description: {{ link_description }} +{% endif %} +{% if link_parent %} + parent: {{ link_parent }} +{% endif %} + route_name: {{ route_name }} + weight: 10 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/form/routing.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/form/routing.twig new file mode 100644 index 0000000000000000000000000000000000000000..00533570e0a254946d6d3caa2772f7b9b3404eff --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/form/routing.twig @@ -0,0 +1,7 @@ +{{ route_name }}: + path: '{{ route_path }}' + defaults: + _title: '{{ route_title }}' + _form: 'Drupal\{{ machine_name }}\Form\{{ class }}' + requirements: + _permission: '{{ route_permission }}' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/form/simple.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/form/simple.twig new file mode 100644 index 0000000000000000000000000000000000000000..396b3e2606f644dad989b1e52dee0544b0bbf4e5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/form/simple.twig @@ -0,0 +1,59 @@ +<?php + +namespace Drupal\{{ machine_name }}\Form; + +use Drupal\Core\Form\FormBase; +use Drupal\Core\Form\FormStateInterface; + +/** + * Provides a {{ name }} form. + */ +class {{ class }} extends FormBase { + + /** + * {@inheritdoc} + */ + public function getFormId() { + return '{{ form_id }}'; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + + $form['message'] = [ + '#type' => 'textarea', + '#title' => $this->t('Message'), + '#required' => TRUE, + ]; + + $form['actions'] = [ + '#type' => 'actions', + ]; + $form['actions']['submit'] = [ + '#type' => 'submit', + '#value' => $this->t('Send'), + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function validateForm(array &$form, FormStateInterface $form_state) { + if (mb_strlen($form_state->getValue('message')) < 10) { + $form_state->setErrorByName('name', $this->t('Message should be at least 10 characters.')); + } + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->messenger()->addStatus($this->t('The message has been sent.')); + $form_state->setRedirect('<front>'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..a939b5431c97fa428ccfe76f0f0fb3876cf38e39 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_access.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_ENTITY_TYPE_access(). + */ +function {{ machine_name }}_ENTITY_TYPE_access(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Session\AccountInterface $account) { + // No opinion. + return AccessResult::neutral(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_build_defaults_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_build_defaults_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ff9841f6a997e656fc558342c7ace0ee6c7a0fba --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_build_defaults_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_ENTITY_TYPE_build_defaults_alter(). + */ +function {{ machine_name }}_ENTITY_TYPE_build_defaults_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity, $view_mode) { + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_create.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_create.twig new file mode 100644 index 0000000000000000000000000000000000000000..812b30b7a5832cbcf86ce11a3cdb21dd6acb1287 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_create.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_ENTITY_TYPE_create(). + */ +function {{ machine_name }}_ENTITY_TYPE_create(\Drupal\Core\Entity\EntityInterface $entity) { + \Drupal::logger('example')->info('ENTITY_TYPE created: @label', ['@label' => $entity->label()]); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_create_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_create_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..941b7c5c47e3d603c23e7cc504de4d93b09f391a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_create_access.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_ENTITY_TYPE_create_access(). + */ +function {{ machine_name }}_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle) { + // No opinion. + return AccessResult::neutral(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..3e8e6b9c421af3250d119ef831438586f2873cb5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_delete.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_ENTITY_TYPE_delete(). + */ +function {{ machine_name }}_ENTITY_TYPE_delete(Drupal\Core\Entity\EntityInterface $entity) { + // Delete the entity's entry from a fictional table of all entities. + \Drupal::database()->delete('example_entity') + ->condition('type', $entity->getEntityTypeId()) + ->condition('id', $entity->id()) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_field_values_init.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_field_values_init.twig new file mode 100644 index 0000000000000000000000000000000000000000..ac7ec12be8a3360c1dd216bd6f9489f03c6b7d74 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_field_values_init.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_ENTITY_TYPE_field_values_init(). + */ +function {{ machine_name }}_ENTITY_TYPE_field_values_init(\Drupal\Core\Entity\FieldableEntityInterface $entity) { + if (!$entity->foo->value) { + $entity->foo->value = 'some_initial_value'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..744ad48931166cb20ddf4663c12e879d4adde4e3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_insert.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_ENTITY_TYPE_insert(). + */ +function {{ machine_name }}_ENTITY_TYPE_insert(Drupal\Core\Entity\EntityInterface $entity) { + // Insert the new entity into a fictional table of this type of entity. + \Drupal::database()->insert('example_entity') + ->fields([ + 'id' => $entity->id(), + 'created' => REQUEST_TIME, + 'updated' => REQUEST_TIME, + ]) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..6eeaf817b601ddf35ca389caef6adad60f917c51 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_load.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_ENTITY_TYPE_load(). + */ +function {{ machine_name }}_ENTITY_TYPE_load($entities) { + foreach ($entities as $entity) { + $entity->foo = mymodule_add_something($entity); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_predelete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_predelete.twig new file mode 100644 index 0000000000000000000000000000000000000000..d4572f5d0708a6617c32f92f775529837b47f791 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_predelete.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_ENTITY_TYPE_predelete(). + */ +function {{ machine_name }}_ENTITY_TYPE_predelete(Drupal\Core\Entity\EntityInterface $entity) { + $connection = \Drupal::database(); + // Count references to this entity in a custom table before they are removed + // upon entity deletion. + $id = $entity->id(); + $type = $entity->getEntityTypeId(); + $count = \Drupal::database()->select('example_entity_data') + ->condition('type', $type) + ->condition('id', $id) + ->countQuery() + ->execute() + ->fetchField(); + + // Log the count in a table that records this statistic for deleted entities. + $connection->merge('example_deleted_entity_statistics') + ->key(['type' => $type, 'id' => $id]) + ->fields(['count' => $count]) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_prepare_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_prepare_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..baeba52c5d2052af956e04d753054a7eb7faeefe --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_prepare_form.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_ENTITY_TYPE_prepare_form(). + */ +function {{ machine_name }}_ENTITY_TYPE_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Form\FormStateInterface $form_state) { + if ($operation == 'edit') { + $entity->label->value = 'Altered label'; + $form_state->set('label_altered', TRUE); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..2e3c0967c499c2d263978eda298a9144e903a20b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_presave.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_ENTITY_TYPE_presave(). + */ +function {{ machine_name }}_ENTITY_TYPE_presave(Drupal\Core\Entity\EntityInterface $entity) { + if ($entity->isTranslatable()) { + $route_match = \Drupal::routeMatch(); + \Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode')); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_revision_create.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_revision_create.twig new file mode 100644 index 0000000000000000000000000000000000000000..ed6a011853a96167dca62156255b5546bf777f95 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_revision_create.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_ENTITY_TYPE_revision_create(). + */ +function {{ machine_name }}_ENTITY_TYPE_revision_create(Drupal\Core\Entity\EntityInterface $new_revision, Drupal\Core\Entity\EntityInterface $entity, $keep_untranslatable_fields) { + // Retain the value from an untranslatable field, which are by default + // synchronized from the default revision. + $new_revision->set('untranslatable_field', $entity->get('untranslatable_field')); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_revision_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_revision_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..59e4f6385e1cb5906e96d18058be3081241fe8f7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_revision_delete.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_ENTITY_TYPE_revision_delete(). + */ +function {{ machine_name }}_ENTITY_TYPE_revision_delete(Drupal\Core\Entity\EntityInterface $entity) { + $referenced_files_by_field = _editor_get_file_uuids_by_field($entity); + foreach ($referenced_files_by_field as $field => $uuids) { + _editor_delete_file_usage($uuids, $entity, 1); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_storage_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_storage_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..8318cc44458122acaadbdd8012159295cf230fb1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_storage_load.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_ENTITY_TYPE_storage_load(). + */ +function {{ machine_name }}_ENTITY_TYPE_storage_load(array $entities) { + foreach ($entities as $entity) { + $entity->foo = mymodule_add_something_uncached($entity); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_create.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_create.twig new file mode 100644 index 0000000000000000000000000000000000000000..1ff6d5d837ae54e4e64dac33fb2120481503133f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_create.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_ENTITY_TYPE_translation_create(). + */ +function {{ machine_name }}_ENTITY_TYPE_translation_create(\Drupal\Core\Entity\EntityInterface $translation) { + \Drupal::logger('example')->info('ENTITY_TYPE translation created: @label', ['@label' => $translation->label()]); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..b583fde94f8edfa985b5efc0004c3ce8b23ae4ca --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_delete.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_ENTITY_TYPE_translation_delete(). + */ +function {{ machine_name }}_ENTITY_TYPE_translation_delete(\Drupal\Core\Entity\EntityInterface $translation) { + $variables = [ + '@language' => $translation->language()->getName(), + '@label' => $translation->label(), + ]; + \Drupal::logger('example')->notice('The @language translation of @label has just been deleted.', $variables); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..604470a8b3d1f8bb898d03d62aa7999cfb9f2ffd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_insert.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_ENTITY_TYPE_translation_insert(). + */ +function {{ machine_name }}_ENTITY_TYPE_translation_insert(\Drupal\Core\Entity\EntityInterface $translation) { + $variables = [ + '@language' => $translation->language()->getName(), + '@label' => $translation->getUntranslated()->label(), + ]; + \Drupal::logger('example')->notice('The @language translation of @label has just been stored.', $variables); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..ad79d58bca8a59e8d713edc02c9bddcedaa720e6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_update.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_ENTITY_TYPE_update(). + */ +function {{ machine_name }}_ENTITY_TYPE_update(Drupal\Core\Entity\EntityInterface $entity) { + // Update the entity's entry in a fictional table of this type of entity. + \Drupal::database()->update('example_entity') + ->fields([ + 'updated' => REQUEST_TIME, + ]) + ->condition('id', $entity->id()) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..dd53624ce94e410b40587f62d2842f8eecccfa5c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_view.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_ENTITY_TYPE_view(). + */ +function {{ machine_name }}_ENTITY_TYPE_view(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) { + // Only do the extra work if the component is configured to be displayed. + // This assumes a 'mymodule_addition' extra field has been defined for the + // entity bundle in hook_entity_extra_field_info(). + if ($display->getComponent('mymodule_addition')) { + $build['mymodule_addition'] = [ + '#markup' => mymodule_addition($entity), + '#theme' => 'mymodule_my_additional_field', + ]; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..3c814b2f2e1b5bcc703cb02c7ece1b8083363a97 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_view_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_ENTITY_TYPE_view_alter(). + */ +function {{ machine_name }}_ENTITY_TYPE_view_alter(array &$build, Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) { + if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { + // Change its weight. + $build['an_additional_field']['#weight'] = -10; + + // Add a #post_render callback to act on the rendered HTML of the entity. + $build['#post_render'][] = 'my_module_node_post_render'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_fetcher_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_fetcher_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..4388910b33cdd1e4fda63bae445c1a3c09439ac5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_fetcher_info_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_aggregator_fetcher_info_alter(). + */ +function {{ machine_name }}_aggregator_fetcher_info_alter(array &$info) { + if (empty($info['foo_fetcher'])) { + return; + } + + $info['foo_fetcher']['class'] = Drupal\foo\Plugin\aggregator\fetcher\FooDefaultFetcher::class; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_parser_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_parser_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..1d1c074c7b50fd4644a754b9e0ef3082928ee48c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_parser_info_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_aggregator_parser_info_alter(). + */ +function {{ machine_name }}_aggregator_parser_info_alter(array &$info) { + if (empty($info['foo_parser'])) { + return; + } + + $info['foo_parser']['class'] = Drupal\foo\Plugin\aggregator\parser\FooDefaultParser::class; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_processor_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_processor_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b74888128edf4dddfaa0656c4bf3f525960ddcf3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/aggregator_processor_info_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_aggregator_processor_info_alter(). + */ +function {{ machine_name }}_aggregator_processor_info_alter(array &$info) { + if (empty($info['foo_processor'])) { + return; + } + + $info['foo_processor']['class'] = Drupal\foo\Plugin\aggregator\processor\FooDefaultProcessor::class; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ajax_render_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ajax_render_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..02a1bcfc8cad6fd2746a03061b3b4834a6641e13 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ajax_render_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_ajax_render_alter(). + */ +function {{ machine_name }}_ajax_render_alter(array &$data) { + // Inject any new status messages into the content area. + $status_messages = ['#type' => 'status_messages']; + $command = new \Drupal\Core\Ajax\PrependCommand('#block-system-main .content', \Drupal::service('renderer')->renderRoot($status_messages)); + $data[] = $command->render(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/archiver_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/archiver_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6fc2319187037e361712f858f88fcda1873f7c79 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/archiver_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_archiver_info_alter(). + */ +function {{ machine_name }}_archiver_info_alter(&$info) { + $info['tar']['extensions'][] = 'tgz'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/batch_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/batch_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..50a73045cf4ec30f96b1a17ba4e2e98b331fd984 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/batch_alter.twig @@ -0,0 +1,5 @@ +/** + * Implements hook_batch_alter(). + */ +function {{ machine_name }}_batch_alter(&$batch) { +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..970128e1abf79902b6d8caa8565b7fa24efe31fe --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_access.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_block_access(). + */ +function {{ machine_name }}_block_access(\Drupal\block\Entity\Block $block, $operation, \Drupal\Core\Session\AccountInterface $account) { + // Example code that would prevent displaying the 'Powered by Drupal' block in + // a region different than the footer. + if ($operation == 'view' && $block->getPluginId() == 'system_powered_by_block') { + return AccessResult::forbiddenIf($block->getRegion() != 'footer')->addCacheableDependency($block); + } + + // No opinion. + return AccessResult::neutral(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_build_BASE_BLOCK_ID_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_build_BASE_BLOCK_ID_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..335b51bb4137ad76db7d79096f973c8beddc7b17 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_build_BASE_BLOCK_ID_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_block_build_BASE_BLOCK_ID_alter(). + */ +function {{ machine_name }}_block_build_BASE_BLOCK_ID_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) { + // Explicitly enable placeholdering of the specific block. + $build['#create_placeholder'] = TRUE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_build_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_build_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9c5bf293dad6f2ca46ef78b62dd0e70941c94062 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_build_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_block_build_alter(). + */ +function {{ machine_name }}_block_build_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) { + // Add the 'user' cache context to some blocks. + if ($block->label() === 'some condition') { + $build['#cache']['contexts'][] = 'user'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_view_BASE_BLOCK_ID_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_view_BASE_BLOCK_ID_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..35bfe638bfc96cd4ca0bacba3c513395a9d4a7ff --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_view_BASE_BLOCK_ID_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_block_view_BASE_BLOCK_ID_alter(). + */ +function {{ machine_name }}_block_view_BASE_BLOCK_ID_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) { + // Change the title of the specific block. + $build['#title'] = t('New title of the block'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6a112f443b506e2ed9499d287c439a3f09db9880 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/block_view_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_block_view_alter(). + */ +function {{ machine_name }}_block_view_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) { + // Remove the contextual links on all blocks that provide them. + if (isset($build['#contextual_links'])) { + unset($build['#contextual_links']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/cache_flush.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/cache_flush.twig new file mode 100644 index 0000000000000000000000000000000000000000..9bacaf71f8f948153248799a5b1276fc665d54f8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/cache_flush.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_cache_flush(). + */ +function {{ machine_name }}_cache_flush() { + if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') { + _update_cache_clear(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ckeditor_css_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ckeditor_css_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..90ed85e628140f5927d23088fa38b4743df0c11a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ckeditor_css_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_ckeditor_css_alter(). + */ +function {{ machine_name }}_ckeditor_css_alter(array &$css, Editor $editor) { + $css[] = drupal_get_path('module', 'mymodule') . '/css/mymodule-ckeditor.css'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ckeditor_plugin_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ckeditor_plugin_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..929e3721398d2a3dd627ffebf6d0700f8bea8939 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ckeditor_plugin_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_ckeditor_plugin_info_alter(). + */ +function {{ machine_name }}_ckeditor_plugin_info_alter(array &$plugins) { + $plugins['someplugin']['label'] = t('Better name'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/comment_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/comment_links_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..196d99cf40c4433492d4b20562a88ae0f095bba8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/comment_links_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_comment_links_alter(). + */ +function {{ machine_name }}_comment_links_alter(array &$links, CommentInterface $entity, array &$context) { + $links['mymodule'] = [ + '#theme' => 'links__comment__mymodule', + '#attributes' => ['class' => ['links', 'inline']], + '#links' => [ + 'comment-report' => [ + 'title' => t('Report'), + 'url' => Url::fromRoute('comment_test.report', ['comment' => $entity->id()], ['query' => ['token' => \Drupal::getContainer()->get('csrf_token')->get("comment/{$entity->id()}/report")]]), + ], + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_import_steps_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_import_steps_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6c4fc9cbb28633ca29d45896fea770d76a1b8ece --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_import_steps_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_config_import_steps_alter(). + */ +function {{ machine_name }}_config_import_steps_alter(&$sync_steps, \Drupal\Core\Config\ConfigImporter $config_importer) { + $deletes = $config_importer->getUnprocessedConfiguration('delete'); + if (isset($deletes['field.storage.node.body'])) { + $sync_steps[] = '_additional_configuration_step'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_schema_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_schema_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c6821c9ca634fa458bdb81b91299cf7dd8f83ced --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_schema_info_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_config_schema_info_alter(). + */ +function {{ machine_name }}_config_schema_info_alter(&$definitions) { + // Enhance the text and date type definitions with classes to generate proper + // form elements in ConfigTranslationFormBase. Other translatable types will + // appear as a one line textfield. + $definitions['text']['form_element_class'] = '\Drupal\config_translation\FormElement\Textarea'; + $definitions['date_format']['form_element_class'] = '\Drupal\config_translation\FormElement\DateFormat'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_translation_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_translation_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..7730724b09801ffd13f94d14dd15e8080933b8eb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_translation_info.twig @@ -0,0 +1,34 @@ +/** + * Implements hook_config_translation_info(). + */ +function {{ machine_name }}_config_translation_info(&$info) { + $entity_type_manager = \Drupal::entityTypeManager(); + $route_provider = \Drupal::service('router.route_provider'); + + // If field UI is not enabled, the base routes of the type + // "entity.field_config.{$entity_type}_field_edit_form" are not defined. + if (\Drupal::moduleHandler()->moduleExists('field_ui')) { + // Add fields entity mappers to all fieldable entity types defined. + foreach ($entity_type_manager->getDefinitions() as $entity_type_id => $entity_type) { + $base_route = NULL; + try { + $base_route = $route_provider->getRouteByName('entity.field_config.' . $entity_type_id . '_field_edit_form'); + } + catch (RouteNotFoundException $e) { + // Ignore non-existent routes. + } + + // Make sure entity type has field UI enabled and has a base route. + if ($entity_type->get('field_ui_base_route') && !empty($base_route)) { + $info[$entity_type_id . '_fields'] = [ + 'base_route_name' => 'entity.field_config.' . $entity_type_id . '_field_edit_form', + 'entity_type' => 'field_config', + 'title' => t('Title'), + 'class' => '\Drupal\config_translation\ConfigFieldMapper', + 'base_entity_type' => $entity_type_id, + 'weight' => 10, + ]; + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_translation_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_translation_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b0ed1ed96a2fcacc52605e47d11b668c6d3d25c7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/config_translation_info_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_config_translation_info_alter(). + */ +function {{ machine_name }}_config_translation_info_alter(&$info) { + // Add additional site settings to the site information screen, so it shows + // up on the translation screen. (Form alter in the elements whose values are + // stored in this config file using regular form altering on the original + // configuration form.) + $info['system.site_information_settings']['names'][] = 'example.site.setting'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..1750edaa316ee00afd728720ed7d76385e8529ab --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_contextual_links_alter(). + */ +function {{ machine_name }}_contextual_links_alter(array &$links, $group, array $route_parameters) { + if ($group == 'menu') { + // Dynamically use the menu name for the title of the menu_edit contextual + // link. + $menu = \Drupal::entityTypeManager()->getStorage('menu')->load($route_parameters['menu']); + $links['menu_edit']['title'] = t('Edit menu: @label', ['@label' => $menu->label()]); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_plugins_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_plugins_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f4ca37b2c6b7cda1418692af48b452e0533a515e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_plugins_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_contextual_links_plugins_alter(). + */ +function {{ machine_name }}_contextual_links_plugins_alter(array &$contextual_links) { + $contextual_links['menu_edit']['title'] = 'Edit the menu'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..68bacd9e911c3c09a852aac7761003bd4717c672 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_view_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_contextual_links_view_alter(). + */ +function {{ machine_name }}_contextual_links_view_alter(&$element, $items) { + // Add another class to all contextual link lists to facilitate custom + // styling. + $element['#attributes']['class'][] = 'custom-class'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/countries_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/countries_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..bff6dfa06d05eb84fb03724747c48f7d82bea34f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/countries_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_countries_alter(). + */ +function {{ machine_name }}_countries_alter(&$countries) { + // Elbonia is now independent, so add it to the country list. + $countries['EB'] = 'Elbonia'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/cron.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/cron.twig new file mode 100644 index 0000000000000000000000000000000000000000..da2065b14e2f019932810d311b528cbf4b1fdedd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/cron.twig @@ -0,0 +1,34 @@ +/** + * Implements hook_cron(). + */ +function {{ machine_name }}_cron() { + // Short-running operation example, not using a queue: + // Delete all expired records since the last cron run. + $expires = \Drupal::state()->get('mymodule.last_check', 0); + \Drupal::database()->delete('mymodule_table') + ->condition('expires', $expires, '>=') + ->execute(); + \Drupal::state()->set('mymodule.last_check', REQUEST_TIME); + + // Long-running operation example, leveraging a queue: + // Queue news feeds for updates once their refresh interval has elapsed. + $queue = \Drupal::queue('aggregator_feeds'); + $ids = \Drupal::entityTypeManager()->getStorage('aggregator_feed')->getFeedIdsToRefresh(); + foreach (Feed::loadMultiple($ids) as $feed) { + if ($queue->createItem($feed)) { + // Add timestamp to avoid queueing item more than once. + $feed->setQueuedTime(REQUEST_TIME); + $feed->save(); + } + } + $ids = \Drupal::entityQuery('aggregator_feed') + ->condition('queued', REQUEST_TIME - (3600 * 6), '<') + ->execute(); + if ($ids) { + $feeds = Feed::loadMultiple($ids); + foreach ($feeds as $feed) { + $feed->setQueuedTime(0); + $feed->save(); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/css_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/css_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..5c5d8f0ae34855cb50ac1ddd794234e6a3526ae8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/css_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_css_alter(). + */ +function {{ machine_name }}_css_alter(&$css, \Drupal\Core\Asset\AttachedAssetsInterface $assets) { + // Remove defaults.css file. + unset($css[drupal_get_path('module', 'system') . '/defaults.css']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/data_type_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/data_type_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f040b0a9f1420303fee9ff1d5453d88e356e9674 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/data_type_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_data_type_info_alter(). + */ +function {{ machine_name }}_data_type_info_alter(&$data_types) { + $data_types['email']['class'] = '\Drupal\mymodule\Type\Email'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/display_variant_plugin_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/display_variant_plugin_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..536eda54fb287fd7d424c02e9adb5ae649377e0f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/display_variant_plugin_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_display_variant_plugin_alter(). + */ +function {{ machine_name }}_display_variant_plugin_alter(array &$definitions) { + $definitions['full_page']['admin_label'] = t('Block layout'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ba06f09e4c6cc286c2dce380a0e095fc3bc10043 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_editor_info_alter(). + */ +function {{ machine_name }}_editor_info_alter(array &$editors) { + $editors['some_other_editor']['label'] = t('A different name'); + $editors['some_other_editor']['library']['module'] = 'myeditoroverride'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_js_settings_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_js_settings_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..71270711ec72e6a970c9208452d696d532f4216c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_js_settings_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_editor_js_settings_alter(). + */ +function {{ machine_name }}_editor_js_settings_alter(array &$settings) { + if (isset($settings['editor']['formats']['basic_html'])) { + $settings['editor']['formats']['basic_html']['editor'] = 'MyDifferentEditor'; + $settings['editor']['formats']['basic_html']['editorSettings']['buttons'] = ['strong', 'italic', 'underline']; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_xss_filter_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_xss_filter_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b6d3b5bd33bb418398ff4f3f34657cc54da0716b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/editor_xss_filter_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_editor_xss_filter_alter(). + */ +function {{ machine_name }}_editor_xss_filter_alter(&$editor_xss_filter_class, FilterFormatInterface $format, FilterFormatInterface $original_format = NULL) { + $filters = $format->filters()->getAll(); + if (isset($filters['filter_wysiwyg']) && $filters['filter_wysiwyg']->status) { + $editor_xss_filter_class = '\Drupal\filter_wysiwyg\EditorXssFilter\WysiwygFilter'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/element_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/element_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b0eee52857615b5d224723ac88eb61aadddc0568 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/element_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_element_info_alter(). + */ +function {{ machine_name }}_element_info_alter(array &$info) { + // Decrease the default size of textfields. + if (isset($info['textfield']['#size'])) { + $info['textfield']['#size'] = 40; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..c22b583d1d023f3377e78e9e76cc52077b1efa06 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_access.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_entity_access(). + */ +function {{ machine_name }}_entity_access(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Session\AccountInterface $account) { + // No opinion. + return AccessResult::neutral(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_base_field_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_base_field_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..8f4e1ac168dbeb1c0c884912a0413c9acf105a09 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_base_field_info.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_entity_base_field_info(). + */ +function {{ machine_name }}_entity_base_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) { + if ($entity_type->id() == 'node') { + $fields = []; + $fields['mymodule_text'] = BaseFieldDefinition::create('string') + ->setLabel(t('The text')) + ->setDescription(t('A text property added by mymodule.')) + ->setComputed(TRUE) + ->setClass('\Drupal\mymodule\EntityComputedText'); + + return $fields; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_base_field_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_base_field_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..594d2aa598489f65a2daf5c948fb2234eb65240f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_base_field_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_base_field_info_alter(). + */ +function {{ machine_name }}_entity_base_field_info_alter(&$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type) { + // Alter the mymodule_text field to use a custom class. + if ($entity_type->id() == 'node' && !empty($fields['mymodule_text'])) { + $fields['mymodule_text']->setClass('\Drupal\anothermodule\EntityComputedText'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_build_defaults_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_build_defaults_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..1e6ab7aba031fd8dd22bb1c2001b16e0e633e463 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_build_defaults_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_entity_build_defaults_alter(). + */ +function {{ machine_name }}_entity_build_defaults_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity, $view_mode) { + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_create.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_create.twig new file mode 100644 index 0000000000000000000000000000000000000000..dc83623cf02732489e5bba5ed5bdf3982fdd8463 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_create.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_entity_bundle_create(). + */ +function {{ machine_name }}_entity_bundle_create($entity_type_id, $bundle) { + // When a new bundle is created, the menu needs to be rebuilt to add the + // Field UI menu item tabs. + \Drupal::service('router.builder')->setRebuildNeeded(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..3dc879a9ea33f1eed46638d4e6d4cf8afa687e4f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_delete.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_entity_bundle_delete(). + */ +function {{ machine_name }}_entity_bundle_delete($entity_type_id, $bundle) { + // Remove the settings associated with the bundle in my_module.settings. + $config = \Drupal::config('my_module.settings'); + $bundle_settings = $config->get('bundle_settings'); + if (isset($bundle_settings[$entity_type_id][$bundle])) { + unset($bundle_settings[$entity_type_id][$bundle]); + $config->set('bundle_settings', $bundle_settings); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_field_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_field_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..ecb43b8ec6a54264c9ea84374e0c4aa839e1f01d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_field_info.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_entity_bundle_field_info(). + */ +function {{ machine_name }}_entity_bundle_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) { + // Add a property only to nodes of the 'article' bundle. + if ($entity_type->id() == 'node' && $bundle == 'article') { + $fields = []; + $storage_definitions = mymodule_entity_field_storage_info($entity_type); + $fields['mymodule_bundle_field'] = FieldDefinition::createFromFieldStorageDefinition($storage_definitions['mymodule_bundle_field']) + ->setLabel(t('Bundle Field')); + return $fields; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_field_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_field_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..21217921b76c2a86c23522c80d09482648f9408b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_field_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_bundle_field_info_alter(). + */ +function {{ machine_name }}_entity_bundle_field_info_alter(&$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle) { + if ($entity_type->id() == 'node' && $bundle == 'article' && !empty($fields['mymodule_text'])) { + // Alter the mymodule_text field to use a custom class. + $fields['mymodule_text']->setClass('\Drupal\anothermodule\EntityComputedText'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..74035b0ae3a62fef3f65f052c3245791eac76153 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_info.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_entity_bundle_info(). + */ +function {{ machine_name }}_entity_bundle_info() { + $bundles['user']['user']['label'] = t('User'); + return $bundles; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..752be03949bcb28b99666f14685429a3171a8511 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_bundle_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_entity_bundle_info_alter(). + */ +function {{ machine_name }}_entity_bundle_info_alter(&$bundles) { + $bundles['user']['user']['label'] = t('Full account'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_create.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_create.twig new file mode 100644 index 0000000000000000000000000000000000000000..9fa38f8e8664667efd980e22d4163c4b3cc9f6da --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_create.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_entity_create(). + */ +function {{ machine_name }}_entity_create(\Drupal\Core\Entity\EntityInterface $entity) { + \Drupal::logger('example')->info('Entity created: @label', ['@label' => $entity->label()]); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_create_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_create_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..af759337642709f6f11d13fd5cd46b8392ab1c57 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_create_access.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_entity_create_access(). + */ +function {{ machine_name }}_entity_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle) { + // No opinion. + return AccessResult::neutral(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..f893f3d852bcf80f57e30a0e6475bf4fae372cba --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_delete.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_entity_delete(). + */ +function {{ machine_name }}_entity_delete(Drupal\Core\Entity\EntityInterface $entity) { + // Delete the entity's entry from a fictional table of all entities. + \Drupal::database()->delete('example_entity') + ->condition('type', $entity->getEntityTypeId()) + ->condition('id', $entity->id()) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_display_build_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_display_build_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..330be3dbe492ca043d1b490192c7f760e8114efd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_display_build_alter.twig @@ -0,0 +1,20 @@ +/** + * Implements hook_entity_display_build_alter(). + */ +function {{ machine_name }}_entity_display_build_alter(&$build, $context) { + // Append RDF term mappings on displayed taxonomy links. + foreach (Element::children($build) as $field_name) { + $element = &$build[$field_name]; + if ($element['#field_type'] == 'entity_reference' && $element['#formatter'] == 'entity_reference_label') { + foreach ($element['#items'] as $delta => $item) { + $term = $item->entity; + if (!empty($term->rdf_mapping['rdftype'])) { + $element[$delta]['#options']['attributes']['typeof'] = $term->rdf_mapping['rdftype']; + } + if (!empty($term->rdf_mapping['name']['predicates'])) { + $element[$delta]['#options']['attributes']['property'] = $term->rdf_mapping['name']['predicates']; + } + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_extra_field_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_extra_field_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..9badf0a9f161785751bc97ce3c4543636738ce06 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_extra_field_info.twig @@ -0,0 +1,34 @@ +/** + * Implements hook_entity_extra_field_info(). + */ +function {{ machine_name }}_entity_extra_field_info() { + $extra = []; + $module_language_enabled = \Drupal::moduleHandler()->moduleExists('language'); + $description = t('Node module element'); + + foreach (NodeType::loadMultiple() as $bundle) { + + // Add also the 'language' select if Language module is enabled and the + // bundle has multilingual support. + // Visibility of the ordering of the language selector is the same as on the + // node/add form. + if ($module_language_enabled) { + $configuration = ContentLanguageSettings::loadByEntityTypeBundle('node', $bundle->id()); + if ($configuration->isLanguageAlterable()) { + $extra['node'][$bundle->id()]['form']['language'] = [ + 'label' => t('Language'), + 'description' => $description, + 'weight' => 0, + ]; + } + } + $extra['node'][$bundle->id()]['display']['language'] = [ + 'label' => t('Language'), + 'description' => $description, + 'weight' => 0, + 'visible' => FALSE, + ]; + } + + return $extra; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_extra_field_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_extra_field_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..06d8e80c74e052520d9a16e91fc9709c34830c94 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_extra_field_info_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_entity_extra_field_info_alter(). + */ +function {{ machine_name }}_entity_extra_field_info_alter(&$info) { + // Force node title to always be at the top of the list by default. + foreach (NodeType::loadMultiple() as $bundle) { + if (isset($info['node'][$bundle->id()]['form']['title'])) { + $info['node'][$bundle->id()]['form']['title']['weight'] = -20; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..6ea8d4a65d87f281ae0e70462b411a3427a369c6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_access.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_field_access(). + */ +function {{ machine_name }}_entity_field_access($operation, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, \Drupal\Core\Session\AccountInterface $account, \Drupal\Core\Field\FieldItemListInterface $items = NULL) { + if ($field_definition->getName() == 'field_of_interest' && $operation == 'edit') { + return AccessResult::allowedIfHasPermission($account, 'update field of interest'); + } + return AccessResult::neutral(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_access_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_access_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..7982a8241859f0a17abf316cc482a86b1756df94 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_access_alter.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_entity_field_access_alter(). + */ +function {{ machine_name }}_entity_field_access_alter(array &$grants, array $context) { + /** @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */ + $field_definition = $context['field_definition']; + if ($field_definition->getName() == 'field_of_interest' && $grants['node']->isForbidden()) { + // Override node module's restriction to no opinion (neither allowed nor + // forbidden). We don't want to provide our own access hook, we only want to + // take out node module's part in the access handling of this field. We also + // don't want to switch node module's grant to + // AccessResultInterface::isAllowed() , because the grants of other modules + // should still decide on their own if this field is accessible or not + $grants['node'] = AccessResult::neutral()->inheritCacheability($grants['node']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_storage_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_storage_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..b28c7f0bdb8e222545799ed5cce1a92ed62ac973 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_storage_info.twig @@ -0,0 +1,20 @@ +/** + * Implements hook_entity_field_storage_info(). + */ +function {{ machine_name }}_entity_field_storage_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) { + if (\Drupal::entityTypeManager()->getStorage($entity_type->id()) instanceof DynamicallyFieldableEntityStorageInterface) { + // Query by filtering on the ID as this is more efficient than filtering + // on the entity_type property directly. + $ids = \Drupal::entityQuery('field_storage_config') + ->condition('id', $entity_type->id() . '.', 'STARTS_WITH') + ->execute(); + // Fetch all fields and key them by field name. + $field_storages = FieldStorageConfig::loadMultiple($ids); + $result = []; + foreach ($field_storages as $field_storage) { + $result[$field_storage->getName()] = $field_storage; + } + + return $result; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_storage_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_storage_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ea641313331a835a37522a8a4689b580eaa18ccd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_storage_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_field_storage_info_alter(). + */ +function {{ machine_name }}_entity_field_storage_info_alter(&$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type) { + // Alter the max_length setting. + if ($entity_type->id() == 'node' && !empty($fields['mymodule_text'])) { + $fields['mymodule_text']->setSetting('max_length', 128); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_values_init.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_values_init.twig new file mode 100644 index 0000000000000000000000000000000000000000..1d15bc36221d5c3cda5887d75946722a0aad1947 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_field_values_init.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_entity_field_values_init(). + */ +function {{ machine_name }}_entity_field_values_init(\Drupal\Core\Entity\FieldableEntityInterface $entity) { + if ($entity instanceof \Drupal\Core\Entity\ContentEntityInterface && !$entity->foo->value) { + $entity->foo->value = 'some_initial_value'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_form_display_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_form_display_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..5dad932a6e38595c4a7f85f65695f9dd2e49f2ee --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_form_display_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_entity_form_display_alter(). + */ +function {{ machine_name }}_entity_form_display_alter(\Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display, array $context) { + // Hide the 'user_picture' field from the register form. + if ($context['entity_type'] == 'user' && $context['form_mode'] == 'register') { + $form_display->setComponent('user_picture', [ + 'region' => 'hidden', + ]); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..5fa1b9a94789510ca9428bf4ef9d0b1e459f9f7a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_insert.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_entity_insert(). + */ +function {{ machine_name }}_entity_insert(Drupal\Core\Entity\EntityInterface $entity) { + // Insert the new entity into a fictional table of all entities. + \Drupal::database()->insert('example_entity') + ->fields([ + 'type' => $entity->getEntityTypeId(), + 'id' => $entity->id(), + 'created' => REQUEST_TIME, + 'updated' => REQUEST_TIME, + ]) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..1d6d48df7ff0cd06a9f77bfc3f9c3d682f003eba --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_load.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_entity_load(). + */ +function {{ machine_name }}_entity_load(array $entities, $entity_type_id) { + foreach ($entities as $entity) { + $entity->foo = mymodule_add_something($entity); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation.twig new file mode 100644 index 0000000000000000000000000000000000000000..e86fe35dbc7e1424caeac4191e84954944ba94c9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_entity_operation(). + */ +function {{ machine_name }}_entity_operation(\Drupal\Core\Entity\EntityInterface $entity) { + $operations = []; + $operations['translate'] = [ + 'title' => t('Translate'), + 'url' => \Drupal\Core\Url::fromRoute('foo_module.entity.translate'), + 'weight' => 50, + ]; + + return $operations; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..a16f03156f6df6158b28806009835a27d34a7419 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_entity_operation_alter(). + */ +function {{ machine_name }}_entity_operation_alter(array &$operations, \Drupal\Core\Entity\EntityInterface $entity) { + // Alter the title and weight. + $operations['translate']['title'] = t('Translate @entity_type', [ + '@entity_type' => $entity->getEntityTypeId(), + ]); + $operations['translate']['weight'] = 99; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_predelete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_predelete.twig new file mode 100644 index 0000000000000000000000000000000000000000..7f7fb6bdf644b48304824d33d595852ef819f020 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_predelete.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_entity_predelete(). + */ +function {{ machine_name }}_entity_predelete(Drupal\Core\Entity\EntityInterface $entity) { + $connection = \Drupal::database(); + // Count references to this entity in a custom table before they are removed + // upon entity deletion. + $id = $entity->id(); + $type = $entity->getEntityTypeId(); + $count = \Drupal::database()->select('example_entity_data') + ->condition('type', $type) + ->condition('id', $id) + ->countQuery() + ->execute() + ->fetchField(); + + // Log the count in a table that records this statistic for deleted entities. + $connection->merge('example_deleted_entity_statistics') + ->key(['type' => $type, 'id' => $id]) + ->fields(['count' => $count]) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_preload.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_preload.twig new file mode 100644 index 0000000000000000000000000000000000000000..2117986d532d0444b3a54d9cfb2d5607a510e906 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_preload.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_entity_preload(). + */ +function {{ machine_name }}_entity_preload(array $ids, $entity_type_id) { + $entities = []; + + foreach ($ids as $id) { + $entities[] = mymodule_swap_revision($id); + } + + return $entities; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_prepare_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_prepare_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..aa20155c9e4441b33a95f631a2b3b52ff60a7557 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_prepare_form.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_prepare_form(). + */ +function {{ machine_name }}_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Form\FormStateInterface $form_state) { + if ($operation == 'edit') { + $entity->label->value = 'Altered label'; + $form_state->set('label_altered', TRUE); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_prepare_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_prepare_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..efe2cff4b9bd2d4c80f54d9b56023588be3a57a7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_prepare_view.twig @@ -0,0 +1,23 @@ +/** + * Implements hook_entity_prepare_view(). + */ +function {{ machine_name }}_entity_prepare_view($entity_type_id, array $entities, array $displays, $view_mode) { + // Load a specific node into the user object for later theming. + if (!empty($entities) && $entity_type_id == 'user') { + // Only do the extra work if the component is configured to be + // displayed. This assumes a 'mymodule_addition' extra field has been + // defined for the entity bundle in hook_entity_extra_field_info(). + $ids = []; + foreach ($entities as $id => $entity) { + if ($displays[$entity->bundle()]->getComponent('mymodule_addition')) { + $ids[] = $id; + } + } + if ($ids) { + $nodes = mymodule_get_user_nodes($ids); + foreach ($ids as $id) { + $entities[$id]->user_node = $nodes[$id]; + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_presave.twig new file mode 100644 index 0000000000000000000000000000000000000000..1708dcb9f5b00531a35b1f5188feb3c392849e5f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_presave.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_presave(). + */ +function {{ machine_name }}_entity_presave(Drupal\Core\Entity\EntityInterface $entity) { + if ($entity instanceof ContentEntityInterface && $entity->isTranslatable()) { + $route_match = \Drupal::routeMatch(); + \Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode')); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_create.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_create.twig new file mode 100644 index 0000000000000000000000000000000000000000..95e3549041ca57cee4cb026f529e70cdaa7307be --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_create.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_entity_revision_create(). + */ +function {{ machine_name }}_entity_revision_create(Drupal\Core\Entity\EntityInterface $new_revision, Drupal\Core\Entity\EntityInterface $entity, $keep_untranslatable_fields) { + // Retain the value from an untranslatable field, which are by default + // synchronized from the default revision. + $new_revision->set('untranslatable_field', $entity->get('untranslatable_field')); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..c0c8978a40956e72b59dd6f1c222568f76994cb0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_delete.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_revision_delete(). + */ +function {{ machine_name }}_entity_revision_delete(Drupal\Core\Entity\EntityInterface $entity) { + $referenced_files_by_field = _editor_get_file_uuids_by_field($entity); + foreach ($referenced_files_by_field as $field => $uuids) { + _editor_delete_file_usage($uuids, $entity, 1); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_storage_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_storage_load.twig new file mode 100644 index 0000000000000000000000000000000000000000..6d2fc2ec16454ae3d563c9d26480e10d95246220 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_storage_load.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_entity_storage_load(). + */ +function {{ machine_name }}_entity_storage_load(array $entities, $entity_type) { + foreach ($entities as $entity) { + $entity->foo = mymodule_add_something_uncached($entity); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_create.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_create.twig new file mode 100644 index 0000000000000000000000000000000000000000..c3e4a481a52978ceb7b0a54f246b87241820fd98 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_create.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_entity_translation_create(). + */ +function {{ machine_name }}_entity_translation_create(\Drupal\Core\Entity\EntityInterface $translation) { + \Drupal::logger('example')->info('Entity translation created: @label', ['@label' => $translation->label()]); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..ffbf2d918f4c42d462039f9c89d1b9fbff43a5bd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_delete.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_entity_translation_delete(). + */ +function {{ machine_name }}_entity_translation_delete(\Drupal\Core\Entity\EntityInterface $translation) { + $variables = [ + '@language' => $translation->language()->getName(), + '@label' => $translation->label(), + ]; + \Drupal::logger('example')->notice('The @language translation of @label has just been deleted.', $variables); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..f075648022b7ee0af5153d041281a5d6b102951f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_translation_insert.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_entity_translation_insert(). + */ +function {{ machine_name }}_entity_translation_insert(\Drupal\Core\Entity\EntityInterface $translation) { + $variables = [ + '@language' => $translation->language()->getName(), + '@label' => $translation->getUntranslated()->label(), + ]; + \Drupal::logger('example')->notice('The @language translation of @label has just been stored.', $variables); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_type_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_type_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ef3f9945f1a90a119eec31264f62a5f58fc7aea9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_type_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_type_alter(). + */ +function {{ machine_name }}_entity_type_alter(array &$entity_types) { + /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ + // Set the controller class for nodes to an alternate implementation of the + // Drupal\Core\Entity\EntityStorageInterface interface. + $entity_types['node']->setStorageClass('Drupal\mymodule\MyCustomNodeStorage'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_type_build.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_type_build.twig new file mode 100644 index 0000000000000000000000000000000000000000..e6a32b933d10298fb13699343174b3ea0ceaec49 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_type_build.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_type_build(). + */ +function {{ machine_name }}_entity_type_build(array &$entity_types) { + /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ + // Add a form for a custom node form without overriding the default + // node form. To override the default node form, use hook_entity_type_alter(). + $entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..9cc8636e3ebe41f870195afdb826bbc0ef2dc6b6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_update.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_entity_update(). + */ +function {{ machine_name }}_entity_update(Drupal\Core\Entity\EntityInterface $entity) { + // Update the entity's entry in a fictional table of all entities. + \Drupal::database()->update('example_entity') + ->fields([ + 'updated' => REQUEST_TIME, + ]) + ->condition('type', $entity->getEntityTypeId()) + ->condition('id', $entity->id()) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..57b5f9b8e20e153c9e1b9abd984a122beb85fad5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_entity_view(). + */ +function {{ machine_name }}_entity_view(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) { + // Only do the extra work if the component is configured to be displayed. + // This assumes a 'mymodule_addition' extra field has been defined for the + // entity bundle in hook_entity_extra_field_info(). + if ($display->getComponent('mymodule_addition')) { + $build['mymodule_addition'] = [ + '#markup' => mymodule_addition($entity), + '#theme' => 'mymodule_my_additional_field', + ]; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..39b3900ff6d968a4658109cc7ab0e8659859fe4a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_entity_view_alter(). + */ +function {{ machine_name }}_entity_view_alter(array &$build, Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) { + if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { + // Change its weight. + $build['an_additional_field']['#weight'] = -10; + + // Add a #post_render callback to act on the rendered HTML of the entity. + $build['#post_render'][] = 'my_module_node_post_render'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_display_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_display_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..df17a7860c9c318e30e143d3e8559b793fab7d7b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_display_alter.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_entity_view_display_alter(). + */ +function {{ machine_name }}_entity_view_display_alter(\Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, array $context) { + // Leave field labels out of the search index. + if ($context['entity_type'] == 'node' && $context['view_mode'] == 'search_index') { + foreach ($display->getComponents() as $name => $options) { + if (isset($options['label'])) { + $options['label'] = 'hidden'; + $display->setComponent($name, $options); + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_mode_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_mode_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..92d87fed6e529bcd0069e0583969eec4a125a75c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_mode_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_view_mode_alter(). + */ +function {{ machine_name }}_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInterface $entity, $context) { + // For nodes, change the view mode when it is teaser. + if ($entity->getEntityTypeId() == 'node' && $view_mode == 'teaser') { + $view_mode = 'my_custom_view_mode'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_mode_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_mode_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..92c5fa5da36e2fe8851a7bb151ee2974cf66116a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_view_mode_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_entity_view_mode_info_alter(). + */ +function {{ machine_name }}_entity_view_mode_info_alter(&$view_modes) { + $view_modes['user']['full']['status'] = TRUE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/extension.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/extension.twig new file mode 100644 index 0000000000000000000000000000000000000000..8a4f98773b55c97d1f5891c4be2bf94e353485da --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/extension.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_extension(). + */ +function {{ machine_name }}_extension() { + // Extension for template base names in Twig. + return '.html.twig'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6ae86a43e008943f7894d4f7893f32b3b7fd82a6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_field_formatter_info_alter(). + */ +function {{ machine_name }}_field_formatter_info_alter(array &$info) { + // Let a new field type re-use an existing formatter. + $info['text_default']['field_types'][] = 'my_field_type'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_settings_summary_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_settings_summary_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..bca07559105a088acba095349b52523d127bae07 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_settings_summary_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_field_formatter_settings_summary_alter(). + */ +function {{ machine_name }}_field_formatter_settings_summary_alter(array &$summary, array $context) { + // Append a message to the summary when an instance of foo_formatter has + // mysetting set to TRUE for the current view mode. + if ($context['formatter']->getPluginId() == 'foo_formatter') { + if ($context['formatter']->getThirdPartySetting('my_module', 'my_setting')) { + $summary[] = t('My setting enabled.'); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_third_party_settings_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_third_party_settings_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..f70fddb2793206bd4f468789ed3b227423275df6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_third_party_settings_form.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_field_formatter_third_party_settings_form(). + */ +function {{ machine_name }}_field_formatter_third_party_settings_form(\Drupal\Core\Field\FormatterInterface $plugin, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, $view_mode, array $form, \Drupal\Core\Form\FormStateInterface $form_state) { + $element = []; + // Add a 'my_setting' checkbox to the settings form for 'foo_formatter' field + // formatters. + if ($plugin->getPluginId() == 'foo_formatter') { + $element['my_setting'] = [ + '#type' => 'checkbox', + '#title' => t('My setting'), + '#default_value' => $plugin->getThirdPartySetting('my_module', 'my_setting'), + ]; + } + return $element; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..aba90abf7c0d707f7f3e1f0ab406e20c1bae74b7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_info_alter(). + */ +function {{ machine_name }}_field_info_alter(&$info) { + // Change the default widget for fields of type 'foo'. + if (isset($info['foo'])) { + $info['foo']['default widget'] = 'mymodule_widget'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_info_max_weight.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_info_max_weight.twig new file mode 100644 index 0000000000000000000000000000000000000000..bae8630ff831545d61cf19fc6fbdd7162f566b12 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_info_max_weight.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_field_info_max_weight(). + */ +function {{ machine_name }}_field_info_max_weight($entity_type, $bundle, $context, $context_mode) { + $weights = []; + + foreach (my_module_entity_additions($entity_type, $bundle, $context, $context_mode) as $addition) { + $weights[] = $addition['weight']; + } + + return $weights ? max($weights) : NULL; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_purge_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_purge_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..212963a04088c0de3bca25b38941e2efdf7c44ef --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_purge_field.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_field_purge_field(). + */ +function {{ machine_name }}_field_purge_field(\Drupal\field\Entity\FieldConfig $field) { + \Drupal::database()->delete('my_module_field_info') + ->condition('id', $field->id()) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_purge_field_storage.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_purge_field_storage.twig new file mode 100644 index 0000000000000000000000000000000000000000..fff21f02f479e51a3340eb8aa3a77be0533ff597 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_purge_field_storage.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_field_purge_field_storage(). + */ +function {{ machine_name }}_field_purge_field_storage(\Drupal\field\Entity\FieldStorageConfig $field_storage) { + \Drupal::database()->delete('my_module_field_storage_info') + ->condition('uuid', $field_storage->uuid()) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_storage_config_update_forbid.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_storage_config_update_forbid.twig new file mode 100644 index 0000000000000000000000000000000000000000..77fd3c1ee6ac1ea0d91d85b031e36a209cdacd84 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_storage_config_update_forbid.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_field_storage_config_update_forbid(). + */ +function {{ machine_name }}_field_storage_config_update_forbid(\Drupal\field\FieldStorageConfigInterface $field_storage, \Drupal\field\FieldStorageConfigInterface $prior_field_storage) { + if ($field_storage->module == 'options' && $field_storage->hasData()) { + // Forbid any update that removes allowed values with actual data. + $allowed_values = $field_storage->getSetting('allowed_values'); + $prior_allowed_values = $prior_field_storage->getSetting('allowed_values'); + $lost_keys = array_keys(array_diff_key($prior_allowed_values, $allowed_values)); + if (_options_values_in_use($field_storage->getTargetEntityTypeId(), $field_storage->getName(), $lost_keys)) { + throw new \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException(t('A list field (@field_name) with existing data cannot have its keys changed.', ['@field_name' => $field_storage->getName()])); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_ui_preconfigured_options_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_ui_preconfigured_options_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..e86d816d88a5723983c2be32127b42445f3f49ce --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_ui_preconfigured_options_alter.twig @@ -0,0 +1,18 @@ +/** + * Implements hook_field_ui_preconfigured_options_alter(). + */ +function {{ machine_name }}_field_ui_preconfigured_options_alter(array &$options, $field_type) { + // If the field is not an "entity_reference"-based field, bail out. + /** @var \Drupal\Core\Field\FieldTypePluginManager $field_type_manager */ + $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); + $class = $field_type_manager->getPluginClass($field_type); + if (!is_a($class, 'Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem', TRUE)) { + return; + } + + // Set the default formatter for media in entity reference fields to be the + // "Rendered entity" formatter. + if (!empty($options['media'])) { + $options['media']['entity_view_display']['type'] = 'entity_reference_entity_view'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data.twig new file mode 100644 index 0000000000000000000000000000000000000000..101eb7a793f766ab5be3dbc9e0658cecc28a87e7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_field_views_data(). + */ +function {{ machine_name }}_field_views_data(\Drupal\field\FieldStorageConfigInterface $field_storage) { + $data = views_field_default_views_data($field_storage); + foreach ($data as $table_name => $table_data) { + // Add the relationship only on the target_id field. + $data[$table_name][$field_storage->getName() . '_target_id']['relationship'] = [ + 'id' => 'standard', + 'base' => 'file_managed', + 'base field' => 'target_id', + 'label' => t('image from @field_name', ['@field_name' => $field_storage->getName()]), + ]; + } + + return $data; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..21c30dd239a53ff8e6bce1aeab814bc53e80beb9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data_alter.twig @@ -0,0 +1,32 @@ +/** + * Implements hook_field_views_data_alter(). + */ +function {{ machine_name }}_field_views_data_alter(array &$data, \Drupal\field\FieldStorageConfigInterface $field_storage) { + $entity_type_id = $field_storage->getTargetEntityTypeId(); + $field_name = $field_storage->getName(); + $entity_type = \Drupal::entityTypeManager()->getDefinition($entity_type_id); + $pseudo_field_name = 'reverse_' . $field_name . '_' . $entity_type_id; + $table_mapping = \Drupal::entityTypeManager()->getStorage($entity_type_id)->getTableMapping(); + + list($label) = views_entity_field_label($entity_type_id, $field_name); + + $data['file_managed'][$pseudo_field_name]['relationship'] = [ + 'title' => t('@entity using @field', ['@entity' => $entity_type->getLabel(), '@field' => $label]), + 'help' => t('Relate each @entity with a @field set to the image.', ['@entity' => $entity_type->getLabel(), '@field' => $label]), + 'id' => 'entity_reverse', + 'field_name' => $field_name, + 'entity_type' => $entity_type_id, + 'field table' => $table_mapping->getDedicatedDataTableName($field_storage), + 'field field' => $field_name . '_target_id', + 'base' => $entity_type->getBaseTable(), + 'base field' => $entity_type->getKey('id'), + 'label' => $field_name, + 'join_extra' => [ + 0 => [ + 'field' => 'deleted', + 'value' => 0, + 'numeric' => TRUE, + ], + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data_views_data_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data_views_data_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9423dd8ec96b53d219ea84f0d98bf296c720ef11 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_views_data_views_data_alter.twig @@ -0,0 +1,33 @@ +/** + * Implements hook_field_views_data_views_data_alter(). + */ +function {{ machine_name }}_field_views_data_views_data_alter(array &$data, \Drupal\field\FieldStorageConfigInterface $field) { + $field_name = $field->getName(); + $data_key = 'field_data_' . $field_name; + $entity_type_id = $field->entity_type; + $entity_type = \Drupal::entityTypeManager()->getDefinition($entity_type_id); + $pseudo_field_name = 'reverse_' . $field_name . '_' . $entity_type_id; + list($label) = views_entity_field_label($entity_type_id, $field_name); + $table_mapping = \Drupal::entityTypeManager()->getStorage($entity_type_id)->getTableMapping(); + + // Views data for this field is in $data[$data_key]. + $data[$data_key][$pseudo_field_name]['relationship'] = [ + 'title' => t('@entity using @field', ['@entity' => $entity_type->getLabel(), '@field' => $label]), + 'help' => t('Relate each @entity with a @field set to the term.', ['@entity' => $entity_type->getLabel(), '@field' => $label]), + 'id' => 'entity_reverse', + 'field_name' => $field_name, + 'entity_type' => $entity_type_id, + 'field table' => $table_mapping->getDedicatedDataTableName($field), + 'field field' => $field_name . '_target_id', + 'base' => $entity_type->getBaseTable(), + 'base field' => $entity_type->getKey('id'), + 'label' => $field_name, + 'join_extra' => [ + 0 => [ + 'field' => 'deleted', + 'value' => 0, + 'numeric' => TRUE, + ], + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_WIDGET_TYPE_form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_WIDGET_TYPE_form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b3b19c8b07c4a09d5f85d37c5c250c78d19dbf74 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_WIDGET_TYPE_form_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_field_widget_WIDGET_TYPE_form_alter(). + */ +function {{ machine_name }}_field_widget_WIDGET_TYPE_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) { + // Code here will only act on widgets of type WIDGET_TYPE. For example, + // hook_field_widget_mymodule_autocomplete_form_alter() will only act on + // widgets of type 'mymodule_autocomplete'. + $element['#autocomplete_route_name'] = 'mymodule.autocomplete_route'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..a1ad97a6f3e3f7bac04f1a7a9f8414e641777844 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_form_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_widget_form_alter(). + */ +function {{ machine_name }}_field_widget_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) { + // Add a css class to widget form elements for all fields of type mytype. + $field_definition = $context['items']->getFieldDefinition(); + if ($field_definition->getType() == 'mytype') { + // Be sure not to overwrite existing attributes. + $element['#attributes']['class'][] = 'myclass'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..57808d2c03e94aeb33e1a641bb53e9b42ba66c9b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_field_widget_info_alter(). + */ +function {{ machine_name }}_field_widget_info_alter(array &$info) { + // Let a new field type re-use an existing widget. + $info['options_select']['field_types'][] = 'my_field_type'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_multivalue_WIDGET_TYPE_form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_multivalue_WIDGET_TYPE_form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..21ded3343d73b003cfa5906ec3ff59cbf3b57f3f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_multivalue_WIDGET_TYPE_form_alter.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_field_widget_multivalue_WIDGET_TYPE_form_alter(). + */ +function {{ machine_name }}_field_widget_multivalue_WIDGET_TYPE_form_alter(array &$elements, \Drupal\Core\Form\FormStateInterface $form_state, array $context) { + // Code here will only act on widgets of type WIDGET_TYPE. For example, + // hook_field_widget_multivalue_mymodule_autocomplete_form_alter() will only + // act on widgets of type 'mymodule_autocomplete'. + // Change the autocomplete route for each autocomplete element within the + // multivalue widget. + foreach (Element::children($elements) as $delta => $element) { + $elements[$delta]['#autocomplete_route_name'] = 'mymodule.autocomplete_route'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_multivalue_form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_multivalue_form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f0432c38721b7be036ea5977ea81584a88c6f463 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_multivalue_form_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_field_widget_multivalue_form_alter(). + */ +function {{ machine_name }}_field_widget_multivalue_form_alter(array &$elements, \Drupal\Core\Form\FormStateInterface $form_state, array $context) { + // Add a css class to widget form elements for all fields of type mytype. + $field_definition = $context['items']->getFieldDefinition(); + if ($field_definition->getType() == 'mytype') { + // Be sure not to overwrite existing attributes. + $elements['#attributes']['class'][] = 'myclass'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_settings_summary_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_settings_summary_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ad13eedc0e02fe16fe753d87f065720d740463df --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_settings_summary_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_field_widget_settings_summary_alter(). + */ +function {{ machine_name }}_field_widget_settings_summary_alter(array &$summary, array $context) { + // Append a message to the summary when an instance of foo_widget has + // mysetting set to TRUE for the current view mode. + if ($context['widget']->getPluginId() == 'foo_widget') { + if ($context['widget']->getThirdPartySetting('my_module', 'my_setting')) { + $summary[] = t('My setting enabled.'); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_third_party_settings_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_third_party_settings_form.twig new file mode 100644 index 0000000000000000000000000000000000000000..6e953160a3fc0eccf254b7baca2adeeb9a61ee21 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_widget_third_party_settings_form.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_field_widget_third_party_settings_form(). + */ +function {{ machine_name }}_field_widget_third_party_settings_form(\Drupal\Core\Field\WidgetInterface $plugin, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, $form_mode, array $form, \Drupal\Core\Form\FormStateInterface $form_state) { + $element = []; + // Add a 'my_setting' checkbox to the settings form for 'foo_widget' field + // widgets. + if ($plugin->getPluginId() == 'foo_widget') { + $element['my_setting'] = [ + '#type' => 'checkbox', + '#title' => t('My setting'), + '#default_value' => $plugin->getThirdPartySetting('my_module', 'my_setting'), + ]; + } + return $element; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_copy.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_copy.twig new file mode 100644 index 0000000000000000000000000000000000000000..1fa6532b10a9a1177602fc4101bd43b64f3968ce --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_copy.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_file_copy(). + */ +function {{ machine_name }}_file_copy(Drupal\file\FileInterface $file, Drupal\file\FileInterface $source) { + // Make sure that the file name starts with the owner's user name. + if (strpos($file->getFilename(), $file->getOwner()->name) !== 0) { + $file->setFilename($file->getOwner()->name . '_' . $file->getFilename()); + $file->save(); + + \Drupal::logger('file')->notice('Copied file %source has been renamed to %destination', ['%source' => $source->filename, '%destination' => $file->getFilename()]); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_download.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_download.twig new file mode 100644 index 0000000000000000000000000000000000000000..6af126643583a547796554e4ad9b3b698e83f913 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_download.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_file_download(). + */ +function {{ machine_name }}_file_download($uri) { + // Check to see if this is a config download. + $scheme = StreamWrapperManager::getScheme($uri); + $target = StreamWrapperManager::getTarget($uri); + if ($scheme == 'temporary' && $target == 'config.tar.gz') { + return [ + 'Content-disposition' => 'attachment; filename="config.tar.gz"', + ]; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_mimetype_mapping_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_mimetype_mapping_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..0cf9e0954df05211508bdaad149caaba2c5b96c6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_mimetype_mapping_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_file_mimetype_mapping_alter(). + */ +function {{ machine_name }}_file_mimetype_mapping_alter(&$mapping) { + // Add new MIME type 'drupal/info'. + $mapping['mimetypes']['example_info'] = 'drupal/info'; + // Add new extension '.info.yml' and map it to the 'drupal/info' MIME type. + $mapping['extensions']['info'] = 'example_info'; + // Override existing extension mapping for '.ogg' files. + $mapping['extensions']['ogg'] = 189; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_move.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_move.twig new file mode 100644 index 0000000000000000000000000000000000000000..51138b5904efccfb4d5181d96f07ea76c59e328f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_move.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_file_move(). + */ +function {{ machine_name }}_file_move(Drupal\file\FileInterface $file, Drupal\file\FileInterface $source) { + // Make sure that the file name starts with the owner's user name. + if (strpos($file->getFilename(), $file->getOwner()->name) !== 0) { + $file->setFilename($file->getOwner()->name . '_' . $file->getFilename()); + $file->save(); + + \Drupal::logger('file')->notice('Moved file %source has been renamed to %destination', ['%source' => $source->filename, '%destination' => $file->getFilename()]); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_url_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_url_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d6d362b1306d658761e443fd8850b02809574b99 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_url_alter.twig @@ -0,0 +1,50 @@ +/** + * Implements hook_file_url_alter(). + */ +function {{ machine_name }}_file_url_alter(&$uri) { + $user = \Drupal::currentUser(); + + // User 1 will always see the local file in this example. + if ($user->id() == 1) { + return; + } + + $cdn1 = 'http://cdn1.example.com'; + $cdn2 = 'http://cdn2.example.com'; + $cdn_extensions = ['css', 'js', 'gif', 'jpg', 'jpeg', 'png']; + + // Most CDNs don't support private file transfers without a lot of hassle, + // so don't support this in the common case. + $schemes = ['public']; + + /** @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager */ + $stream_wrapper_manager = \Drupal::service('stream_wrapper_manager'); + + $scheme = $stream_wrapper_manager::getScheme($uri); + + // Only serve shipped files and public created files from the CDN. + if (!$scheme || in_array($scheme, $schemes)) { + // Shipped files. + if (!$scheme) { + $path = $uri; + } + // Public created files. + else { + $wrapper = $stream_wrapper_manager->getViaScheme($scheme); + $path = $wrapper->getDirectoryPath() . '/' . $stream_wrapper_manager::getTarget($uri); + } + + // Clean up Windows paths. + $path = str_replace('\\', '/', $path); + + // Serve files with one of the CDN extensions from CDN 1, all others from + // CDN 2. + $pathinfo = pathinfo($path); + if (isset($pathinfo['extension']) && in_array($pathinfo['extension'], $cdn_extensions)) { + $uri = $cdn1 . '/' . $path; + } + else { + $uri = $cdn2 . '/' . $path; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_validate.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_validate.twig new file mode 100644 index 0000000000000000000000000000000000000000..0080a6aec44b7bc4eccf264cbd0dd3a603ded20f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/file_validate.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_file_validate(). + */ +function {{ machine_name }}_file_validate(Drupal\file\FileInterface $file) { + $errors = []; + + if (!$file->getFilename()) { + $errors[] = t("The file's name is empty. Please give a name to the file."); + } + if (strlen($file->getFilename()) > 255) { + $errors[] = t("The file's name exceeds the 255 characters limit. Please rename the file and try again."); + } + + return $errors; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filetransfer_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filetransfer_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..ce2828a5bd34004549d1233d4d540dc947911fea --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filetransfer_info.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_filetransfer_info(). + */ +function {{ machine_name }}_filetransfer_info() { + $info['sftp'] = [ + 'title' => t('SFTP (Secure FTP)'), + 'class' => 'Drupal\Core\FileTransfer\SFTP', + 'weight' => 10, + ]; + return $info; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filetransfer_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filetransfer_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ca8816c87a347db97a63cf88f0076220e0f2b9b3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filetransfer_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_filetransfer_info_alter(). + */ +function {{ machine_name }}_filetransfer_info_alter(&$filetransfer_info) { + // Remove the FTP option entirely. + unset($filetransfer_info['ftp']); + // Make sure the SSH option is listed first. + $filetransfer_info['ssh']['weight'] = -10; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_format_disable.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_format_disable.twig new file mode 100644 index 0000000000000000000000000000000000000000..94ad1e918abcb0d126c01a15b40ca077593ffc82 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_format_disable.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_filter_format_disable(). + */ +function {{ machine_name }}_filter_format_disable($format) { + mymodule_cache_rebuild(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..84aa521bb8cfcc1b8f4e2634ab92100d22764ccc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_filter_info_alter(). + */ +function {{ machine_name }}_filter_info_alter(&$info) { + // Alter the default settings of the URL filter provided by core. + $info['filter_url']['default_settings'] = [ + 'filter_url_length' => 100, + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_secure_image_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_secure_image_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..103acf9148f0895e79200a56bb7730a367143c7d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/filter_secure_image_alter.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_filter_secure_image_alter(). + */ +function {{ machine_name }}_filter_secure_image_alter(&$image) { + // Turn an invalid image into an error indicator. + $image->setAttribute('src', base_path() . 'core/misc/icons/e32700/error.svg'); + $image->setAttribute('alt', t('Image removed.')); + $image->setAttribute('title', t('This image has been removed. For security reasons, only images from the local domain are allowed.')); + + // Add a CSS class to aid in styling. + $class = ($image->getAttribute('class') ? trim($image->getAttribute('class')) . ' ' : ''); + $class .= 'filter-image-invalid'; + $image->setAttribute('class', $class); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_BASE_FORM_ID_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_BASE_FORM_ID_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d3d58563da7f011934f08e5be7bf4d7e6aca1d20 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_BASE_FORM_ID_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_form_BASE_FORM_ID_alter(). + */ +function {{ machine_name }}_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { + // Modification for the form with the given BASE_FORM_ID goes here. For + // example, if BASE_FORM_ID is "node_form", this code would run on every + // node form, regardless of node type. + + // Add a checkbox to the node form about agreeing to terms of use. + $form['terms_of_use'] = [ + '#type' => 'checkbox', + '#title' => t("I agree with the website's terms and conditions."), + '#required' => TRUE, + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_FORM_ID_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_FORM_ID_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..473f3db629f9fb0923c6c4c4a23cb44c56a4d286 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_FORM_ID_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_form_FORM_ID_alter(). + */ +function {{ machine_name }}_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { + // Modification for the form with the given form ID goes here. For example, if + // FORM_ID is "user_register_form" this code would run only on the user + // registration form. + + // Add a checkbox to registration form about agreeing to terms of use. + $form['terms_of_use'] = [ + '#type' => 'checkbox', + '#title' => t("I agree with the website's terms and conditions."), + '#required' => TRUE, + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..4adff844d0fa7965d7e31f2e69978f4d74f75a55 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_alter.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_form_alter(). + */ +function {{ machine_name }}_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { + if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) { + $upload_enabled_types = \Drupal::config('mymodule.settings')->get('upload_enabled_types'); + $form['workflow']['upload_' . $form['type']['#value']] = [ + '#type' => 'radios', + '#title' => t('Attachments'), + '#default_value' => in_array($form['type']['#value'], $upload_enabled_types) ? 1 : 0, + '#options' => [t('Disabled'), t('Enabled')], + ]; + // Add a custom submit handler to save the array of types back to the config file. + $form['actions']['submit']['#submit'][] = 'mymodule_upload_enabled_types_submit'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_system_theme_settings_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_system_theme_settings_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..983a8a6bb6b79052bcdbda32a1864b2be3894a0b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/form_system_theme_settings_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_form_system_theme_settings_alter(). + */ +function {{ machine_name }}_form_system_theme_settings_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state) { + // Add a checkbox to toggle the breadcrumb trail. + $form['toggle_breadcrumb'] = [ + '#type' => 'checkbox', + '#title' => t('Display the breadcrumb'), + '#default_value' => theme_get_setting('features.breadcrumb'), + '#description' => t('Show a trail of links from the homepage to the current page.'), + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hal_relation_uri_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hal_relation_uri_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c1d831237801f87918366bf36c670d146854f9ac --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hal_relation_uri_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_hal_relation_uri_alter(). + */ +function {{ machine_name }}_hal_relation_uri_alter(&$uri, $context = []) { + if ($context['mymodule'] == TRUE) { + $base = \Drupal::config('hal.settings')->get('link_domain'); + $uri = str_replace($base, 'http://mymodule.domain', $uri); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hal_type_uri_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hal_type_uri_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..504a2e7910a1c4bf937d4709935d87001becf781 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hal_type_uri_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_hal_type_uri_alter(). + */ +function {{ machine_name }}_hal_type_uri_alter(&$uri, $context = []) { + if ($context['mymodule'] == TRUE) { + $base = \Drupal::config('hal.settings')->get('link_domain'); + $uri = str_replace($base, 'http://mymodule.domain', $uri); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help.twig new file mode 100644 index 0000000000000000000000000000000000000000..4355b44c5d720477519b119610e9bca2ddcc8143 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_help(). + */ +function {{ machine_name }}_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the block module. + case 'help.page.block': + return '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The <a href=":blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', [':blocks' => Url::fromRoute('block.admin_display')->toString()]) . '</p>'; + + // Help for another path in the block module. + case 'block.admin_display': + return '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page.') . '</p>'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help_section_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help_section_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..30777b7c64ba15450228d10d26d113ad8611b3c0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help_section_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_help_section_info_alter(). + */ +function {{ machine_name }}_help_section_info_alter(&$info) { + // Alter the header for the module overviews section. + $info['hook_help']['header'] = t('Overviews of modules'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help_topics_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help_topics_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..a90c9cef7b0cee5ad16e0d787dfa8f6fd10b4763 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/help_topics_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_help_topics_info_alter(). + */ +function {{ machine_name }}_help_topics_info_alter(array &$info) { + // Alter the help topic to be displayed on admin/help. + $info['example.help_topic']['top_level'] = TRUE; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hook_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hook_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..83d061aeff2e04e1e63866467f03fbd764a59cfa --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/hook_info.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_hook_info(). + */ +function {{ machine_name }}_hook_info() { + $hooks['token_info'] = [ + 'group' => 'tokens', + ]; + $hooks['tokens'] = [ + 'group' => 'tokens', + ]; + return $hooks; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/image_effect_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/image_effect_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..3743cf51c9687c224326d867d1fe7f9d55038369 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/image_effect_info_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_image_effect_info_alter(). + */ +function {{ machine_name }}_image_effect_info_alter(&$effects) { + // Override the Image module's 'Scale and Crop' effect label. + $effects['image_scale_and_crop']['label'] = t('Bangers and Mash'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/image_style_flush.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/image_style_flush.twig new file mode 100644 index 0000000000000000000000000000000000000000..3edacc3c52b97fa6cff3496cc6e060c24b88ca4e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/image_style_flush.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_image_style_flush(). + */ +function {{ machine_name }}_image_style_flush($style) { + // Empty cached data that contains information about the style. + \Drupal::cache('mymodule')->deleteAll(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install.twig new file mode 100644 index 0000000000000000000000000000000000000000..52274cbfb8caf8635f854ecd06cf9412270b4fb1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_install(). + */ +function {{ machine_name }}_install() { + // Create the styles directory and ensure it's writable. + $directory = \Drupal::config('system.file')->get('default_scheme') . '://styles'; + \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install_tasks.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install_tasks.twig new file mode 100644 index 0000000000000000000000000000000000000000..6e5258193f506e53aad7a2a01901b960060f6fee --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install_tasks.twig @@ -0,0 +1,63 @@ +/** + * Implements hook_install_tasks(). + */ +function {{ machine_name }}_install_tasks(&$install_state) { + // Here, we define a variable to allow tasks to indicate that a particular, + // processor-intensive batch process needs to be triggered later on in the + // installation. + $myprofile_needs_batch_processing = \Drupal::state()->get('myprofile.needs_batch_processing', FALSE); + $tasks = [ + // This is an example of a task that defines a form which the user who is + // installing the site will be asked to fill out. To implement this task, + // your profile would define a function named myprofile_data_import_form() + // as a normal form API callback function, with associated validation and + // submit handlers. In the submit handler, in addition to saving whatever + // other data you have collected from the user, you might also call + // \Drupal::state()->set('myprofile.needs_batch_processing', TRUE) if the + // user has entered data which requires that batch processing will need to + // occur later on. + 'myprofile_data_import_form' => [ + 'display_name' => t('Data import options'), + 'type' => 'form', + ], + // Similarly, to implement this task, your profile would define a function + // named myprofile_settings_form() with associated validation and submit + // handlers. This form might be used to collect and save additional + // information from the user that your profile needs. There are no extra + // steps required for your profile to act as an "installation wizard"; you + // can simply define as many tasks of type 'form' as you wish to execute, + // and the forms will be presented to the user, one after another. + 'myprofile_settings_form' => [ + 'display_name' => t('Additional options'), + 'type' => 'form', + ], + // This is an example of a task that performs batch operations. To + // implement this task, your profile would define a function named + // myprofile_batch_processing() which returns a batch API array definition + // that the installer will use to execute your batch operations. Due to the + // 'myprofile.needs_batch_processing' variable used here, this task will be + // hidden and skipped unless your profile set it to TRUE in one of the + // previous tasks. + 'myprofile_batch_processing' => [ + 'display_name' => t('Import additional data'), + 'display' => $myprofile_needs_batch_processing, + 'type' => 'batch', + 'run' => $myprofile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP, + ], + // This is an example of a task that will not be displayed in the list that + // the user sees. To implement this task, your profile would define a + // function named myprofile_final_site_setup(), in which additional, + // automated site setup operations would be performed. Since this is the + // last task defined by your profile, you should also use this function to + // call \Drupal::state()->delete('myprofile.needs_batch_processing') and + // clean up the state that was used above. If you want the user to pass + // to the final Drupal installation tasks uninterrupted, return no output + // from this function. Otherwise, return themed output that the user will + // see (for example, a confirmation page explaining that your profile's + // tasks are complete, with a link to reload the current page and therefore + // pass on to the final Drupal installation tasks when the user is ready to + // do so). + 'myprofile_final_site_setup' => [], + ]; + return $tasks; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install_tasks_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install_tasks_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..09cd37fd23b26c5abfbb97bb2504eefbf580743c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/install_tasks_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_install_tasks_alter(). + */ +function {{ machine_name }}_install_tasks_alter(&$tasks, $install_state) { + // Replace the entire site configuration form provided by Drupal core + // with a custom callback function defined by this installation profile. + $tasks['install_configure_form']['function'] = 'myprofile_install_configure_form'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b530f2f3a09acc8eef5653bef16f54e7eea1bf63 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_js_alter(). + */ +function {{ machine_name }}_js_alter(&$javascript, \Drupal\Core\Asset\AttachedAssetsInterface $assets) { + // Swap out jQuery to use an updated version of the library. + $javascript['core/assets/vendor/jquery/jquery.min.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_settings_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_settings_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..7bda6861617f614e205baf1799592b250a5cab3c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_settings_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_js_settings_alter(). + */ +function {{ machine_name }}_js_settings_alter(array &$settings, \Drupal\Core\Asset\AttachedAssetsInterface $assets) { + // Add settings. + $settings['user']['uid'] = \Drupal::currentUser(); + + // Manipulate settings. + if (isset($settings['dialog'])) { + $settings['dialog']['autoResize'] = FALSE; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_settings_build.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_settings_build.twig new file mode 100644 index 0000000000000000000000000000000000000000..9b709bd2f8426a86dbb7e27df58b475438f13980 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/js_settings_build.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_js_settings_build(). + */ +function {{ machine_name }}_js_settings_build(array &$settings, \Drupal\Core\Asset\AttachedAssetsInterface $assets) { + // Manipulate settings. + if (isset($settings['dialog'])) { + $settings['dialog']['autoResize'] = FALSE; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_ENTITY_TYPE_filter_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_ENTITY_TYPE_filter_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..136b7b823e2d4e1dbd450e663a5230bdce20152f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_ENTITY_TYPE_filter_access.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_jsonapi_ENTITY_TYPE_filter_access(). + */ +function {{ machine_name }}_jsonapi_ENTITY_TYPE_filter_access(\Drupal\Core\Entity\EntityTypeInterface $entity_type, \Drupal\Core\Session\AccountInterface $account) { + return ([ + JSONAPI_FILTER_AMONG_ALL => AccessResult::allowedIfHasPermission($account, 'administer llamas'), + JSONAPI_FILTER_AMONG_PUBLISHED => AccessResult::allowedIfHasPermission($account, 'view all published llamas'), + JSONAPI_FILTER_AMONG_OWN => AccessResult::allowedIfHasPermissions($account, ['view own published llamas', 'view own unpublished llamas'], 'AND'), + ]); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_entity_field_filter_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_entity_field_filter_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..4fad438f73e983106731b1f271f4a6104e36801d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_entity_field_filter_access.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_jsonapi_entity_field_filter_access(). + */ +function {{ machine_name }}_jsonapi_entity_field_filter_access(\Drupal\Core\Field\FieldDefinitionInterface $field_definition, \Drupal\Core\Session\AccountInterface $account) { + if ($field_definition->getTargetEntityTypeId() === 'node' && $field_definition->getName() === 'field_sensitive_data') { + $has_sufficient_access = FALSE; + foreach (['administer nodes', 'view all sensitive field data'] as $permission) { + $has_sufficient_access = $has_sufficient_access ?: $account->hasPermission($permission); + } + return AccessResult::forbiddenIf(!$has_sufficient_access)->cachePerPermissions(); + } + return AccessResult::neutral(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_entity_filter_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_entity_filter_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..b237c300890dcd6b0602d6b428e3b53679cad7c4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/jsonapi_entity_filter_access.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_jsonapi_entity_filter_access(). + */ +function {{ machine_name }}_jsonapi_entity_filter_access(\Drupal\Core\Entity\EntityTypeInterface $entity_type, \Drupal\Core\Session\AccountInterface $account) { + // For every entity type that has an admin permission, allow access to filter + // by all entities of that type to users with that permission. + if ($admin_permission = $entity_type->getAdminPermission()) { + return ([ + JSONAPI_FILTER_AMONG_ALL => AccessResult::allowedIfHasPermission($account, $admin_permission), + ]); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_fallback_candidates_OPERATION_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_fallback_candidates_OPERATION_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b79e3749ed8cd769765d8c54485f3bdb072e9e84 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_fallback_candidates_OPERATION_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_language_fallback_candidates_OPERATION_alter(). + */ +function {{ machine_name }}_language_fallback_candidates_OPERATION_alter(array &$candidates, array $context) { + // We know that the current OPERATION deals with entities so no need to check + // here. + if ($context['data']->getEntityTypeId() == 'node') { + $candidates = array_reverse($candidates); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_fallback_candidates_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_fallback_candidates_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..607c9ef2e5925e62d273ed6c9c2a77b2c20f9f9c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_fallback_candidates_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_language_fallback_candidates_alter(). + */ +function {{ machine_name }}_language_fallback_candidates_alter(array &$candidates, array $context) { + $candidates = array_reverse($candidates); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_negotiation_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_negotiation_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..99294b6e7bf4dec68367698a52f193f2760585e0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_negotiation_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_language_negotiation_info_alter(). + */ +function {{ machine_name }}_language_negotiation_info_alter(array &$negotiation_info) { + if (isset($negotiation_info['custom_language_method'])) { + $negotiation_info['custom_language_method']['config'] = 'admin/config/regional/language/detection/custom-language-method'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_switch_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_switch_links_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..5d57b69a64cfdae06898e55659589cc2dd28e05d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_switch_links_alter.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_language_switch_links_alter(). + */ +function {{ machine_name }}_language_switch_links_alter(array &$links, $type, \Drupal\Core\Url $url) { + $language_interface = \Drupal::languageManager()->getCurrentLanguage(); + + if ($type == LanguageInterface::TYPE_CONTENT && isset($links[$language_interface->getId()])) { + foreach ($links[$language_interface->getId()] as $link) { + $link['attributes']['class'][] = 'active-language'; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_types_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_types_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..65a5e5a0ff41ef0fd6fb600dc73c6ed809bbf247 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_types_info.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_language_types_info(). + */ +function {{ machine_name }}_language_types_info() { + return [ + 'custom_language_type' => [ + 'name' => t('Custom language'), + 'description' => t('A custom language type.'), + 'locked' => FALSE, + ], + 'fixed_custom_language_type' => [ + 'locked' => TRUE, + 'fixed' => ['custom_language_negotiation_method'], + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_types_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_types_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..06e599f90ec397b4a45550ee210ad4c43b19e746 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/language_types_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_language_types_info_alter(). + */ +function {{ machine_name }}_language_types_info_alter(array &$language_types) { + if (isset($language_types['custom_language_type'])) { + $language_types['custom_language_type_custom']['description'] = t('A far better description.'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/layout_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/layout_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..e3319a276dc96b83282c627b5efc6662dd9696e5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/layout_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_layout_alter(). + */ +function {{ machine_name }}_layout_alter(&$definitions) { + // Remove a layout. + unset($definitions['twocol']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/library_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/library_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9b08a70d5aa8e8cfacd48066f9198b91e2c2bc08 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/library_info_alter.twig @@ -0,0 +1,33 @@ +/** + * Implements hook_library_info_alter(). + */ +function {{ machine_name }}_library_info_alter(&$libraries, $extension) { + // Update Farbtastic to version 2.0. + if ($extension == 'core' && isset($libraries['jquery.farbtastic'])) { + // Verify existing version is older than the one we are updating to. + if (version_compare($libraries['jquery.farbtastic']['version'], '2.0', '<')) { + // Update the existing Farbtastic to version 2.0. + $libraries['jquery.farbtastic']['version'] = '2.0'; + // To accurately replace library files, the order of files and the options + // of each file have to be retained; e.g., like this: + $old_path = 'assets/vendor/farbtastic'; + // Since the replaced library files are no longer located in a directory + // relative to the original extension, specify an absolute path (relative + // to DRUPAL_ROOT / base_path()) to the new location. + $new_path = '/' . drupal_get_path('module', 'farbtastic_update') . '/js'; + $new_js = []; + $replacements = [ + $old_path . '/farbtastic.js' => $new_path . '/farbtastic-2.0.js', + ]; + foreach ($libraries['jquery.farbtastic']['js'] as $source => $options) { + if (isset($replacements[$source])) { + $new_js[$replacements[$source]] = $options; + } + else { + $new_js[$source] = $options; + } + } + $libraries['jquery.farbtastic']['js'] = $new_js; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/library_info_build.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/library_info_build.twig new file mode 100644 index 0000000000000000000000000000000000000000..a833bc4d7e5f173127f51ffadba35ec2645b46d7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/library_info_build.twig @@ -0,0 +1,58 @@ +/** + * Implements hook_library_info_build(). + */ +function {{ machine_name }}_library_info_build() { + $libraries = []; + // Add a library whose information changes depending on certain conditions. + $libraries['mymodule.zombie'] = [ + 'dependencies' => [ + 'core/backbone', + ], + ]; + if (Drupal::moduleHandler()->moduleExists('minifyzombies')) { + $libraries['mymodule.zombie'] += [ + 'js' => [ + 'mymodule.zombie.min.js' => [], + ], + 'css' => [ + 'base' => [ + 'mymodule.zombie.min.css' => [], + ], + ], + ]; + } + else { + $libraries['mymodule.zombie'] += [ + 'js' => [ + 'mymodule.zombie.js' => [], + ], + 'css' => [ + 'base' => [ + 'mymodule.zombie.css' => [], + ], + ], + ]; + } + + // Add a library only if a certain condition is met. If code wants to + // integrate with this library it is safe to (try to) load it unconditionally + // without reproducing this check. If the library definition does not exist + // the library (of course) not be loaded but no notices or errors will be + // triggered. + if (Drupal::moduleHandler()->moduleExists('vampirize')) { + $libraries['mymodule.vampire'] = [ + 'js' => [ + 'js/vampire.js' => [], + ], + 'css' => [ + 'base' => [ + 'css/vampire.css', + ], + ], + 'dependencies' => [ + 'core/jquery', + ], + ]; + } + return $libraries; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/link_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/link_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f088b9cb48bb847d4a4775cb028b6e15cc46a408 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/link_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_link_alter(). + */ +function {{ machine_name }}_link_alter(&$variables) { + // Add a warning to the end of route links to the admin section. + if (isset($variables['route_name']) && strpos($variables['route_name'], 'admin') !== FALSE) { + $variables['text'] = t('@text (Warning!)', ['@text' => $variables['text']]); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/local_tasks_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/local_tasks_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..de992e27468cd2487afd2efa3b890ad0699f470c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/local_tasks_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_local_tasks_alter(). + */ +function {{ machine_name }}_local_tasks_alter(&$local_tasks) { + // Remove a specified local task plugin. + unset($local_tasks['example_plugin_id']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/locale_translation_projects_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/locale_translation_projects_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..dc3d3ccfebc4da3066a350175a218748e29f66a3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/locale_translation_projects_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_locale_translation_projects_alter(). + */ +function {{ machine_name }}_locale_translation_projects_alter(&$projects) { + // The translations are located at a custom translation sever. + $projects['existing_project'] = [ + 'info' => [ + 'interface translation server pattern' => 'http://example.com/files/translations/%core/%project/%project-%version.%language.po', + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail.twig new file mode 100644 index 0000000000000000000000000000000000000000..03c5ccfe4c4a6e7c232463390319fc3574d45605 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail.twig @@ -0,0 +1,41 @@ +/** + * Implements hook_mail(). + */ +function {{ machine_name }}_mail($key, &$message, $params) { + $account = $params['account']; + $context = $params['context']; + $variables = [ + '%site_name' => \Drupal::config('system.site')->get('name'), + '%username' => $account->getDisplayName(), + ]; + if ($context['hook'] == 'taxonomy') { + $entity = $params['entity']; + $vocabulary = Vocabulary::load($entity->id()); + $variables += [ + '%term_name' => $entity->name, + '%term_description' => $entity->description, + '%term_id' => $entity->id(), + '%vocabulary_name' => $vocabulary->label(), + '%vocabulary_description' => $vocabulary->getDescription(), + '%vocabulary_id' => $vocabulary->id(), + ]; + } + + // Node-based variable translation is only available if we have a node. + if (isset($params['node'])) { + /** @var \Drupal\node\NodeInterface $node */ + $node = $params['node']; + $variables += [ + '%uid' => $node->getOwnerId(), + '%url' => $node->toUrl('canonical', ['absolute' => TRUE])->toString(), + '%node_type' => node_get_type_label($node), + '%title' => $node->getTitle(), + '%teaser' => $node->teaser, + '%body' => $node->body, + ]; + } + $subject = strtr($context['subject'], $variables); + $body = strtr($context['message'], $variables); + $message['subject'] .= str_replace(["\r", "\n"], '', $subject); + $message['body'][] = MailFormatHelper::htmlToText($body); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..51b6cc0e5edcdec57e1acffdc1eb251c223fdb21 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail_alter.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_mail_alter(). + */ +function {{ machine_name }}_mail_alter(&$message) { + if ($message['id'] == 'modulename_messagekey') { + if (!example_notifications_optin($message['to'], $message['id'])) { + // If the recipient has opted to not receive such messages, cancel + // sending. + $message['send'] = FALSE; + return; + } + $message['body'][] = "--\nMail sent out from " . \Drupal::config('system.site')->get('name'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail_backend_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail_backend_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..1684c403b004e9811859af7f2bdc5f36be947fdd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/mail_backend_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_mail_backend_info_alter(). + */ +function {{ machine_name }}_mail_backend_info_alter(&$info) { + unset($info['test_mail_collector']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/media_source_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/media_source_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f83048352409d8d74d342a91ad5d9216a1c02791 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/media_source_info_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_media_source_info_alter(). + */ +function {{ machine_name }}_media_source_info_alter(array &$sources) { + $sources['youtube']['label'] = t('Youtube rocks!'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_links_discovered_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_links_discovered_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..3c06cd1a1016c3b3c136aa1bceacbe1d627526b4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_links_discovered_alter.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_menu_links_discovered_alter(). + */ +function {{ machine_name }}_menu_links_discovered_alter(&$links) { + // Change the weight and title of the user.logout link. + $links['user.logout']['weight'] = -10; + $links['user.logout']['title'] = new \Drupal\Core\StringTranslation\TranslatableMarkup('Logout'); + // Conditionally add an additional link with a title that's not translated. + if (\Drupal::moduleHandler()->moduleExists('search')) { + $links['menu.api.search'] = [ + 'title' => \Drupal::config('system.site')->get('name'), + 'route_name' => 'menu.api.search', + 'description' => new \Drupal\Core\StringTranslation\TranslatableMarkup('View popular search phrases for this site.'), + 'parent' => 'system.admin_reports', + ]; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_local_actions_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_local_actions_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..b23362af45c8a4fb230af6f84367cb84a19bcafc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_local_actions_alter.twig @@ -0,0 +1,5 @@ +/** + * Implements hook_menu_local_actions_alter(). + */ +function {{ machine_name }}_menu_local_actions_alter(&$local_actions) { +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_local_tasks_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_local_tasks_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..aebe422102e9b4b49f60b8caafad9b68114a6f84 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/menu_local_tasks_alter.twig @@ -0,0 +1,21 @@ +/** + * Implements hook_menu_local_tasks_alter(). + */ +function {{ machine_name }}_menu_local_tasks_alter(&$data, $route_name, \Drupal\Core\Cache\RefinableCacheableDependencyInterface &$cacheability) { + + // Add a tab linking to node/add to all pages. + $data['tabs'][0]['node.add_page'] = [ + '#theme' => 'menu_local_task', + '#link' => [ + 'title' => t('Example tab'), + 'url' => Url::fromRoute('node.add_page'), + 'localized_options' => [ + 'attributes' => [ + 'title' => t('Add content'), + ], + ], + ], + ]; + // The tab we're adding is dependent on a user's access to add content. + $cacheability->addCacheTags(['user.permissions']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migrate_MIGRATION_ID_prepare_row.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migrate_MIGRATION_ID_prepare_row.twig new file mode 100644 index 0000000000000000000000000000000000000000..69aee2302bda8b9360ccdaca52540ccceabfb004 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migrate_MIGRATION_ID_prepare_row.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_migrate_MIGRATION_ID_prepare_row(). + */ +function {{ machine_name }}_migrate_MIGRATION_ID_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) { + $value = $source->getDatabase()->query('SELECT value FROM {variable} WHERE name = :name', [':name' => 'mymodule_filter_foo_' . $row->getSourceProperty('format')])->fetchField(); + if ($value) { + $row->setSourceProperty('settings:mymodule:foo', unserialize($value)); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migrate_prepare_row.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migrate_prepare_row.twig new file mode 100644 index 0000000000000000000000000000000000000000..f8d9a88a73e7ee56ae61acc7f187594933bcfd30 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migrate_prepare_row.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_migrate_prepare_row(). + */ +function {{ machine_name }}_migrate_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) { + if ($migration->id() == 'd6_filter_formats') { + $value = $source->getDatabase()->query('SELECT value FROM {variable} WHERE name = :name', [':name' => 'mymodule_filter_foo_' . $row->getSourceProperty('format')])->fetchField(); + if ($value) { + $row->setSourceProperty('settings:mymodule:foo', unserialize($value)); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migration_plugins_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migration_plugins_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..7ff11ea65fe3585bcc403fca7d3256ffb1ccfc01 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migration_plugins_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_migration_plugins_alter(). + */ +function {{ machine_name }}_migration_plugins_alter(array &$migrations) { + $migrations = array_filter($migrations, function (array $migration) { + $tags = isset($migration['migration_tags']) ? (array) $migration['migration_tags'] : []; + return !in_array('Drupal 6', $tags); + }); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_implements_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_implements_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..7b878525349ec8f278d41927ac470a3ad0892045 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_implements_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_module_implements_alter(). + */ +function {{ machine_name }}_module_implements_alter(&$implementations, $hook) { + if ($hook == 'form_alter') { + // Move my_module_form_alter() to the end of the list. + // \Drupal::moduleHandler()->getImplementations() + // iterates through $implementations with a foreach loop which PHP iterates + // in the order that the items were added, so to move an item to the end of + // the array, we remove it and then add it. + $group = $implementations['my_module']; + unset($implementations['my_module']); + $implementations['my_module'] = $group; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_preinstall.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_preinstall.twig new file mode 100644 index 0000000000000000000000000000000000000000..4717a778460fb310869dcea1bf370aa5fb728432 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_preinstall.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_module_preinstall(). + */ +function {{ machine_name }}_module_preinstall($module) { + mymodule_cache_clear(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_preuninstall.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_preuninstall.twig new file mode 100644 index 0000000000000000000000000000000000000000..0d5e2dd46894a187404265fe20eefcef56a9d898 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/module_preuninstall.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_module_preuninstall(). + */ +function {{ machine_name }}_module_preuninstall($module) { + mymodule_cache_clear(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/modules_installed.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/modules_installed.twig new file mode 100644 index 0000000000000000000000000000000000000000..1fd277d8a2c99fd24f875d3a75f522d5267d3c99 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/modules_installed.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_modules_installed(). + */ +function {{ machine_name }}_modules_installed($modules) { + if (in_array('lousy_module', $modules)) { + \Drupal::state()->set('mymodule.lousy_module_compatibility', TRUE); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/modules_uninstalled.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/modules_uninstalled.twig new file mode 100644 index 0000000000000000000000000000000000000000..5fd9366b17b12c724bd73ea41ef5f35d48a15f13 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/modules_uninstalled.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_modules_uninstalled(). + */ +function {{ machine_name }}_modules_uninstalled($modules) { + if (in_array('lousy_module', $modules)) { + \Drupal::state()->delete('mymodule.lousy_module_compatibility'); + } + mymodule_cache_rebuild(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access.twig new file mode 100644 index 0000000000000000000000000000000000000000..e51127a76dac6b81e1e4184fd3fa188c44fe5a82 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access.twig @@ -0,0 +1,31 @@ +/** + * Implements hook_node_access(). + */ +function {{ machine_name }}_node_access(\Drupal\node\NodeInterface $node, $op, \Drupal\Core\Session\AccountInterface $account) { + $type = $node->bundle(); + + switch ($op) { + case 'create': + return AccessResult::allowedIfHasPermission($account, 'create ' . $type . ' content'); + + case 'update': + if ($account->hasPermission('edit any ' . $type . ' content')) { + return AccessResult::allowed()->cachePerPermissions(); + } + else { + return AccessResult::allowedIf($account->hasPermission('edit own ' . $type . ' content') && ($account->id() == $node->getOwnerId()))->cachePerPermissions()->cachePerUser()->addCacheableDependency($node); + } + + case 'delete': + if ($account->hasPermission('delete any ' . $type . ' content')) { + return AccessResult::allowed()->cachePerPermissions(); + } + else { + return AccessResult::allowedIf($account->hasPermission('delete own ' . $type . ' content') && ($account->id() == $node->getOwnerId()))->cachePerPermissions()->cachePerUser()->addCacheableDependency($node); + } + + default: + // No opinion. + return AccessResult::neutral(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access_records.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access_records.twig new file mode 100644 index 0000000000000000000000000000000000000000..53aacdbeac7f829a71a5c374e885edad7e719e90 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access_records.twig @@ -0,0 +1,39 @@ +/** + * Implements hook_node_access_records(). + */ +function {{ machine_name }}_node_access_records(\Drupal\node\NodeInterface $node) { + // We only care about the node if it has been marked private. If not, it is + // treated just like any other node and we completely ignore it. + if ($node->private->value) { + $grants = []; + // Only published Catalan translations of private nodes should be viewable + // to all users. If we fail to check $node->isPublished(), all users would be able + // to view an unpublished node. + if ($node->isPublished()) { + $grants[] = [ + 'realm' => 'example', + 'gid' => 1, + 'grant_view' => 1, + 'grant_update' => 0, + 'grant_delete' => 0, + 'langcode' => 'ca', + ]; + } + // For the example_author array, the GID is equivalent to a UID, which + // means there are many groups of just 1 user. + // Note that an author can always view nodes they own, even if they have + // status unpublished. + if ($node->getOwnerId()) { + $grants[] = [ + 'realm' => 'example_author', + 'gid' => $node->getOwnerId(), + 'grant_view' => 1, + 'grant_update' => 1, + 'grant_delete' => 1, + 'langcode' => 'ca', + ]; + } + + return $grants; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access_records_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access_records_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..0004dc5bdc1c1c2c701e319b85c5cc8c470bef76 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_access_records_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_node_access_records_alter(). + */ +function {{ machine_name }}_node_access_records_alter(&$grants, Drupal\node\NodeInterface $node) { + // Our module allows editors to mark specific articles with the 'is_preview' + // field. If the node being saved has a TRUE value for that field, then only + // our grants are retained, and other grants are removed. Doing so ensures + // that our rules are enforced no matter what priority other grants are given. + if ($node->is_preview) { + // Our module grants are set in $grants['example']. + $temp = $grants['example']; + // Now remove all module grants but our own. + $grants = ['example' => $temp]; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_grants.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_grants.twig new file mode 100644 index 0000000000000000000000000000000000000000..fc68293410c257e3b495839a29b4c84afabbf194 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_grants.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_node_grants(). + */ +function {{ machine_name }}_node_grants(\Drupal\Core\Session\AccountInterface $account, $op) { + if ($account->hasPermission('access private content')) { + $grants['example'] = [1]; + } + if ($account->id()) { + $grants['example_author'] = [$account->id()]; + } + return $grants; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_grants_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_grants_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d41ab6df7c2bb052bc420ef8b5e97ec3c1ff03a7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_grants_alter.twig @@ -0,0 +1,21 @@ +/** + * Implements hook_node_grants_alter(). + */ +function {{ machine_name }}_node_grants_alter(&$grants, \Drupal\Core\Session\AccountInterface $account, $op) { + // Our sample module never allows certain roles to edit or delete + // content. Since some other node access modules might allow this + // permission, we expressly remove it by returning an empty $grants + // array for roles specified in our variable setting. + + // Get our list of banned roles. + $restricted = \Drupal::config('example.settings')->get('restricted_roles'); + + if ($op != 'view' && !empty($restricted)) { + // Now check the roles for this account against the restrictions. + foreach ($account->getRoles() as $rid) { + if (in_array($rid, $restricted)) { + $grants = []; + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_links_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..57641f9f6fee257578b42c0dc7ccf16811882daf --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_links_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_node_links_alter(). + */ +function {{ machine_name }}_node_links_alter(array &$links, NodeInterface $entity, array &$context) { + $links['mymodule'] = [ + '#theme' => 'links__node__mymodule', + '#attributes' => ['class' => ['links', 'inline']], + '#links' => [ + 'node-report' => [ + 'title' => t('Report'), + 'url' => Url::fromRoute('node_test.report', ['node' => $entity->id()], ['query' => ['token' => \Drupal::getContainer()->get('csrf_token')->get("node/{$entity->id()}/report")]]), + ], + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_search_result.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_search_result.twig new file mode 100644 index 0000000000000000000000000000000000000000..a20a80fce8b88d101885cda68f69a26852207d19 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_search_result.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_node_search_result(). + */ +function {{ machine_name }}_node_search_result(\Drupal\node\NodeInterface $node) { + $rating = \Drupal::database()->query('SELECT SUM(points) FROM {my_rating} WHERE nid = :nid', ['nid' => $node->id()])->fetchField(); + return ['rating' => \Drupal::translation()->formatPlural($rating, '1 point', '@count points')]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_update_index.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_update_index.twig new file mode 100644 index 0000000000000000000000000000000000000000..d32296abdfd8d19ae1769c76e146604fcf6097ff --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/node_update_index.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_node_update_index(). + */ +function {{ machine_name }}_node_update_index(\Drupal\node\NodeInterface $node) { + $text = ''; + $ratings = \Drupal::database()->query('SELECT title, description FROM {my_ratings} WHERE nid = :nid', [':nid' => $node->id()]); + foreach ($ratings as $rating) { + $text .= '<h2>' . Html::escape($rating->title) . '</h2>' . Xss::filter($rating->description); + } + return $text; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/oembed_resource_url_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/oembed_resource_url_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..330b956204634edba9759d4326b448f4b9215f54 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/oembed_resource_url_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_oembed_resource_url_alter(). + */ +function {{ machine_name }}_oembed_resource_url_alter(array &$parsed_url, \Drupal\media\OEmbed\Provider $provider) { + // Always serve YouTube videos from youtube-nocookie.com. + if ($provider->getName() === 'YouTube') { + $parsed_url['path'] = str_replace('://youtube.com/', '://youtube-nocookie.com/', $parsed_url['path']); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/options_list_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/options_list_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ae6864512b0ff1437de401d7467d35e6765fa458 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/options_list_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_options_list_alter(). + */ +function {{ machine_name }}_options_list_alter(array &$options, array $context) { + // Check if this is the field we want to change. + if ($context['fieldDefinition']->id() == 'field_option') { + // Change the label of the empty option. + $options['_none'] = t('== Empty =='); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_attachments.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_attachments.twig new file mode 100644 index 0000000000000000000000000000000000000000..3468151ab273321c6ace28a091f1be1aadfc3e1b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_attachments.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_page_attachments(). + */ +function {{ machine_name }}_page_attachments(array &$attachments) { + // Unconditionally attach an asset to the page. + $attachments['#attached']['library'][] = 'core/domready'; + + // Conditionally attach an asset to the page. + if (!\Drupal::currentUser()->hasPermission('may pet kittens')) { + $attachments['#attached']['library'][] = 'core/jquery'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_attachments_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_attachments_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..5ef312655b2c9273af86c8e9bb87089e7b07631f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_attachments_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_page_attachments_alter(). + */ +function {{ machine_name }}_page_attachments_alter(array &$attachments) { + // Conditionally remove an asset. + if (in_array('core/jquery', $attachments['#attached']['library'])) { + $index = array_search('core/jquery', $attachments['#attached']['library']); + unset($attachments['#attached']['library'][$index]); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_bottom.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_bottom.twig new file mode 100644 index 0000000000000000000000000000000000000000..851d2ce2fe89ecff5ec45b751fc78250170e7403 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_bottom.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_page_bottom(). + */ +function {{ machine_name }}_page_bottom(array &$page_bottom) { + $page_bottom['mymodule'] = ['#markup' => 'This is the bottom.']; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_top.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_top.twig new file mode 100644 index 0000000000000000000000000000000000000000..4e32a98c887f6e91107205e93080b4de8972a4f8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/page_top.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_page_top(). + */ +function {{ machine_name }}_page_top(array &$page_top) { + $page_top['mymodule'] = ['#markup' => 'This is the top.']; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_delete.twig new file mode 100644 index 0000000000000000000000000000000000000000..0e8a7df3e798c14534e74eb58143ba204729af32 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_delete.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_path_delete(). + */ +function {{ machine_name }}_path_delete($path) { + \Drupal::database()->delete('mytable') + ->condition('pid', $path['pid']) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_insert.twig new file mode 100644 index 0000000000000000000000000000000000000000..5d6f27c8a42edfef122536d4fbb761cb2971d447 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_insert.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_path_insert(). + */ +function {{ machine_name }}_path_insert($path) { + \Drupal::database()->insert('mytable') + ->fields([ + 'alias' => $path['alias'], + 'pid' => $path['pid'], + ]) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_update.twig new file mode 100644 index 0000000000000000000000000000000000000000..99b3fdb6efd60e3d311da21c962cd6abaf9d490b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_update.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_path_update(). + */ +function {{ machine_name }}_path_update($path) { + if ($path['alias'] != $path['original']['alias']) { + \Drupal::database()->update('mytable') + ->fields(['alias' => $path['alias']]) + ->condition('pid', $path['pid']) + ->execute(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/plugin_filter_TYPE__CONSUMER_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/plugin_filter_TYPE__CONSUMER_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d843ea6a050914ca8364b55b2dc4e2a5829dda65 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/plugin_filter_TYPE__CONSUMER_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_plugin_filter_TYPE__CONSUMER_alter(). + */ +function {{ machine_name }}_plugin_filter_TYPE__CONSUMER_alter(array &$definitions, array $extra) { + // Explicitly remove the "Help" block for this consumer. + unset($definitions['help_block']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/plugin_filter_TYPE_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/plugin_filter_TYPE_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..4f4ae358bf406cbbad588f1942cc1d7a4beb3bb8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/plugin_filter_TYPE_alter.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_plugin_filter_TYPE_alter(). + */ +function {{ machine_name }}_plugin_filter_TYPE_alter(array &$definitions, array $extra, $consumer) { + // Remove the "Help" block from the Block UI list. + if ($consumer == 'block_ui') { + unset($definitions['help_block']); + } + + // If the theme is specified, remove the branding block from the Bartik theme. + if (isset($extra['theme']) && $extra['theme'] === 'bartik') { + unset($definitions['system_branding_block']); + } + + // Remove the "Main page content" block from everywhere. + unset($definitions['system_main_block']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/post_update_NAME.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/post_update_NAME.twig new file mode 100644 index 0000000000000000000000000000000000000000..5a98f1bf361141012fe4ad04b57655b92b300eb5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/post_update_NAME.twig @@ -0,0 +1,34 @@ +/** + * Implements hook_post_update_NAME(). + */ +function {{ machine_name }}_post_update_NAME(&$sandbox) { + // Example of updating some content. + $node = \Drupal\node\Entity\Node::load(123); + $node->setTitle('foo'); + $node->save(); + + $result = t('Node %nid saved', ['%nid' => $node->id()]); + + // Example of disabling blocks with missing condition contexts. Note: The + // block itself is in a state which is valid at that point. + // @see block_update_8001() + // @see block_post_update_disable_blocks_with_missing_contexts() + $block_update_8001 = \Drupal::keyValue('update_backup')->get('block_update_8001', []); + + $block_ids = array_keys($block_update_8001); + $block_storage = \Drupal::entityTypeManager()->getStorage('block'); + $blocks = $block_storage->loadMultiple($block_ids); + /** @var $blocks \Drupal\block\BlockInterface[] */ + foreach ($blocks as $block) { + // This block has had conditions removed due to an inability to resolve + // contexts in block_update_8001() so disable it. + + // Disable currently enabled blocks. + if ($block_update_8001[$block->id()]['status']) { + $block->setStatus(FALSE); + $block->save(); + } + } + + return $result; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/preprocess.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/preprocess.twig new file mode 100644 index 0000000000000000000000000000000000000000..8e35e7b9c124dd7a3cb1a41508053e5be80f717e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/preprocess.twig @@ -0,0 +1,36 @@ +/** + * Implements hook_preprocess(). + */ +function {{ machine_name }}_preprocess(&$variables, $hook) { + static $hooks; + + // Add contextual links to the variables, if the user has permission. + + if (!\Drupal::currentUser()->hasPermission('access contextual links')) { + return; + } + + if (!isset($hooks)) { + $hooks = theme_get_registry(); + } + + // Determine the primary theme function argument. + if (isset($hooks[$hook]['variables'])) { + $keys = array_keys($hooks[$hook]['variables']); + $key = $keys[0]; + } + else { + $key = $hooks[$hook]['render element']; + } + + if (isset($variables[$key])) { + $element = $variables[$key]; + } + + if (isset($element) && is_array($element) && !empty($element['#contextual_links'])) { + $variables['title_suffix']['contextual_links'] = contextual_links_view($element); + if (!empty($variables['title_suffix']['contextual_links'])) { + $variables['attributes']['class'][] = 'contextual-links-region'; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/preprocess_HOOK.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/preprocess_HOOK.twig new file mode 100644 index 0000000000000000000000000000000000000000..e082e34ed1ce48599d2fe52aa9c579b272bdbd20 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/preprocess_HOOK.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_preprocess_HOOK(). + */ +function {{ machine_name }}_preprocess_HOOK(&$variables) { + // This example is from rdf_preprocess_image(). It adds an RDF attribute + // to the image hook's variables. + $variables['attributes']['typeof'] = ['foaf:Image']; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/query_TAG_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/query_TAG_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..15cc658d27c1dbf166b17ee491019312c1fe8a9c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/query_TAG_alter.twig @@ -0,0 +1,35 @@ +/** + * Implements hook_query_TAG_alter(). + */ +function {{ machine_name }}_query_TAG_alter(Drupal\Core\Database\Query\AlterableInterface $query) { + // Skip the extra expensive alterations if site has no node access control modules. + if (!node_access_view_all_nodes()) { + // Prevent duplicates records. + $query->distinct(); + // The recognized operations are 'view', 'update', 'delete'. + if (!$op = $query->getMetaData('op')) { + $op = 'view'; + } + // Skip the extra joins and conditions for node admins. + if (!\Drupal::currentUser()->hasPermission('bypass node access')) { + // The node_access table has the access grants for any given node. + $access_alias = $query->join('node_access', 'na', '%alias.nid = n.nid'); + $or = new Condition('OR'); + // If any grant exists for the specified user, then user has access to the node for the specified operation. + foreach (node_access_grants($op, $query->getMetaData('account')) as $realm => $gids) { + foreach ($gids as $gid) { + $or->condition((new Condition('AND')) + ->condition($access_alias . '.gid', $gid) + ->condition($access_alias . '.realm', $realm) + ); + } + } + + if (count($or->conditions())) { + $query->condition($or); + } + + $query->condition($access_alias . 'grant_' . $op, 1, '>='); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/query_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/query_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..37a0f4d27f5ff38e876cdbcddb057bf9f6438786 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/query_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_query_alter(). + */ +function {{ machine_name }}_query_alter(Drupal\Core\Database\Query\AlterableInterface $query) { + if ($query->hasTag('micro_limit')) { + $query->range(0, 2); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/queue_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/queue_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f014875d79d0e863d3d28d86f3adc2039104077b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/queue_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_queue_info_alter(). + */ +function {{ machine_name }}_queue_info_alter(&$queues) { + // This site has many feeds so let's spend 90 seconds on each cron run + // updating feeds instead of the default 60. + $queues['aggregator_feeds']['cron']['time'] = 90; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/quickedit_editor_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/quickedit_editor_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..20fcdf273d9c922cf3786e21fcd042f40d8449c0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/quickedit_editor_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_quickedit_editor_alter(). + */ +function {{ machine_name }}_quickedit_editor_alter(&$editors) { + // Cleanly override editor.module's in-place editor plugin. + $editors['editor']['class'] = 'Drupal\advanced_editor\Plugin\quickedit\editor\AdvancedEditor'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/quickedit_render_field.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/quickedit_render_field.twig new file mode 100644 index 0000000000000000000000000000000000000000..ce90eee7318bbcf3f16cbcfaa6809fcf59af1a97 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/quickedit_render_field.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_quickedit_render_field(). + */ +function {{ machine_name }}_quickedit_render_field(Drupal\Core\Entity\EntityInterface $entity, $field_name, $view_mode_id, $langcode) { + return [ + '#prefix' => '<div class="example-markup">', + 'field' => $entity->getTranslation($langcode)->get($field_name)->view($view_mode_id), + '#suffix' => '</div>', + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ranking.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ranking.twig new file mode 100644 index 0000000000000000000000000000000000000000..71942cd29c71a0eee1f731e9cb197c1588af1cc4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ranking.twig @@ -0,0 +1,26 @@ +/** + * Implements hook_ranking(). + */ +function {{ machine_name }}_ranking() { + // If voting is disabled, we can avoid returning the array, no hard feelings. + if (\Drupal::config('vote.settings')->get('node_enabled')) { + return [ + 'vote_average' => [ + 'title' => t('Average vote'), + // Note that we use i.sid, the search index's search item id, rather than + // n.nid. + 'join' => [ + 'type' => 'LEFT', + 'table' => 'vote_node_data', + 'alias' => 'vote_node_data', + 'on' => 'vote_node_data.nid = i.sid', + ], + // The highest possible score should be 1, and the lowest possible score, + // always 0, should be 0. + 'score' => 'vote_node_data.average / CAST(%f AS DECIMAL)', + // Pass in the highest possible voting score as a decimal argument. + 'arguments' => [\Drupal::config('vote.settings')->get('score_max')], + ], + ]; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rdf_namespaces.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rdf_namespaces.twig new file mode 100644 index 0000000000000000000000000000000000000000..4caef0d762a20171ba8fde0c652374c988ae5143 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rdf_namespaces.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_rdf_namespaces(). + */ +function {{ machine_name }}_rdf_namespaces() { + return [ + 'content' => 'http://purl.org/rss/1.0/modules/content/', + 'dc' => 'http://purl.org/dc/terms/', + 'foaf' => 'http://xmlns.com/foaf/0.1/', + 'og' => 'http://ogp.me/ns#', + 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', + 'sioc' => 'http://rdfs.org/sioc/ns#', + 'sioct' => 'http://rdfs.org/sioc/types#', + 'skos' => 'http://www.w3.org/2004/02/skos/core#', + 'xsd' => 'http://www.w3.org/2001/XMLSchema#', + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rebuild.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rebuild.twig new file mode 100644 index 0000000000000000000000000000000000000000..fa61bab38e49b5674d89de559bd12c611fe6b98f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rebuild.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_rebuild(). + */ +function {{ machine_name }}_rebuild() { + $themes = \Drupal::service('theme_handler')->listInfo(); + foreach ($themes as $theme) { + _block_rehash($theme->getName()); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/render_template.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/render_template.twig new file mode 100644 index 0000000000000000000000000000000000000000..49c6a4dc5b292e5a60b42d1785dfaf16d6d16ecd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/render_template.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_render_template(). + */ +function {{ machine_name }}_render_template($template_file, $variables) { + $twig_service = \Drupal::service('twig'); + + return $twig_service->loadTemplate($template_file)->render($variables); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/requirements.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/requirements.twig new file mode 100644 index 0000000000000000000000000000000000000000..d007eac994fd01716dec0934d8cc5aa853e44b14 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/requirements.twig @@ -0,0 +1,47 @@ +/** + * Implements hook_requirements(). + */ +function {{ machine_name }}_requirements($phase) { + $requirements = []; + + // Report Drupal version + if ($phase == 'runtime') { + $requirements['drupal'] = [ + 'title' => t('Drupal'), + 'value' => \Drupal::VERSION, + 'severity' => REQUIREMENT_INFO, + ]; + } + + // Test PHP version + $requirements['php'] = [ + 'title' => t('PHP'), + 'value' => ($phase == 'runtime') ? \Drupal::l(phpversion(), new Url('system.php')) : phpversion(), + ]; + if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) { + $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', ['%version' => DRUPAL_MINIMUM_PHP]); + $requirements['php']['severity'] = REQUIREMENT_ERROR; + } + + // Report cron status + if ($phase == 'runtime') { + $cron_last = \Drupal::state()->get('system.cron_last'); + + if (is_numeric($cron_last)) { + $requirements['cron']['value'] = t('Last run @time ago', ['@time' => \Drupal::service('date.formatter')->formatTimeDiffSince($cron_last)]); + } + else { + $requirements['cron'] = [ + 'description' => t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for <a href=":url">configuring cron jobs</a>.', [':url' => 'https://www.drupal.org/cron']), + 'severity' => REQUIREMENT_ERROR, + 'value' => t('Never run'), + ]; + } + + $requirements['cron']['description'] .= ' ' . t('You can <a href=":cron">run cron manually</a>.', [':cron' => Url::fromRoute('system.run_cron')->toString()]); + + $requirements['cron']['title'] = t('Cron maintenance tasks'); + } + + return $requirements; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_relation_uri_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_relation_uri_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..4a326090b8f6fb0f223ec2a5af5138831815bb38 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_relation_uri_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_rest_relation_uri_alter(). + */ +function {{ machine_name }}_rest_relation_uri_alter(&$uri, $context = []) { + if ($context['mymodule'] == TRUE) { + $base = \Drupal::config('serialization.settings')->get('link_domain'); + $uri = str_replace($base, 'http://mymodule.domain', $uri); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_resource_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_resource_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..6c4f3f7d591b5aa225f9826dc5e936b8f87bb33a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_resource_alter.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_rest_resource_alter(). + */ +function {{ machine_name }}_rest_resource_alter(&$definitions) { + if (isset($definitions['entity:node'])) { + // We want to handle REST requests regarding nodes with our own plugin + // class. + $definitions['entity:node']['class'] = 'Drupal\mymodule\Plugin\rest\resource\NodeResource'; + // Serialized nodes should be expanded to my specific node class. + $definitions['entity:node']['serialization_class'] = 'Drupal\mymodule\Entity\MyNode'; + } + // We don't want Views to show up in the array of plugins at all. + unset($definitions['entity:view']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_type_uri_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_type_uri_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..7c8c472bc335a0da1e8bbbcfe6949b57a1593688 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/rest_type_uri_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_rest_type_uri_alter(). + */ +function {{ machine_name }}_rest_type_uri_alter(&$uri, $context = []) { + if ($context['mymodule'] == TRUE) { + $base = \Drupal::config('serialization.settings')->get('link_domain'); + $uri = str_replace($base, 'http://mymodule.domain', $uri); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..54785ebc7972ca55cab8793ad988921ef6b57aed --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/schema.twig @@ -0,0 +1,61 @@ +/** + * Implements hook_schema(). + */ +function {{ machine_name }}_schema() { + $schema['users_data'] = [ + 'description' => 'Stores module data as key/value pairs per user.', + 'fields' => [ + 'uid' => [ + 'description' => 'The {users}.uid this record affects.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ], + 'module' => [ + 'description' => 'The name of the module declaring the variable.', + 'type' => 'varchar_ascii', + 'length' => DRUPAL_EXTENSION_NAME_MAX_LENGTH, + 'not null' => TRUE, + 'default' => '', + ], + 'name' => [ + 'description' => 'The identifier of the data.', + 'type' => 'varchar_ascii', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + ], + 'value' => [ + 'description' => 'The value.', + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ], + 'serialized' => [ + 'description' => 'Whether value is serialized.', + 'type' => 'int', + 'size' => 'tiny', + 'unsigned' => TRUE, + 'default' => 0, + ], + ], + 'primary key' => ['uid', 'module', 'name'], + 'indexes' => [ + 'module' => ['module'], + 'name' => ['name'], + ], + // For documentation purposes only; foreign keys are not created in the + // database. + 'foreign keys' => [ + 'data_user' => [ + 'table' => 'users', + 'columns' => [ + 'uid' => 'uid', + ], + ], + ], + ]; + + return $schema; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/search_plugin_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/search_plugin_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c41aec4868afc9e8c3a5c273ef16224b82585b0b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/search_plugin_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_search_plugin_alter(). + */ +function {{ machine_name }}_search_plugin_alter(array &$definitions) { + if (isset($definitions['node_search'])) { + $definitions['node_search']['title'] = t('Nodes'); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/search_preprocess.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/search_preprocess.twig new file mode 100644 index 0000000000000000000000000000000000000000..bcfa79bdbb5e44b0270f432fd60e7b432a247534 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/search_preprocess.twig @@ -0,0 +1,20 @@ +/** + * Implements hook_search_preprocess(). + */ +function {{ machine_name }}_search_preprocess($text, $langcode = NULL) { + // If the language is not set, get it from the language manager. + if (!isset($langcode)) { + $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); + } + + // If the langcode is set to 'en' then add variations of the word "testing" + // which can also be found during English language searches. + if ($langcode == 'en') { + // Add the alternate verb forms for the word "testing". + if ($text == 'we are testing') { + $text .= ' test tested'; + } + } + + return $text; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/shortcut_default_set.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/shortcut_default_set.twig new file mode 100644 index 0000000000000000000000000000000000000000..5127f0e74bdee86622060344ea38e9eeab14d30e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/shortcut_default_set.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_shortcut_default_set(). + */ +function {{ machine_name }}_shortcut_default_set($account) { + // Use a special set of default shortcuts for administrators only. + $roles = \Drupal::entityTypeManager()->getStorage('user_role')->loadByProperties(['is_admin' => TRUE]); + $user_admin_roles = array_intersect(array_keys($roles), $account->getRoles()); + if ($user_admin_roles) { + return 'admin-shortcuts'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/simpletest_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/simpletest_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..98cc76eff7cf8c7899026092c49cc9a84f9e25dc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/simpletest_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_simpletest_alter(). + */ +function {{ machine_name }}_simpletest_alter(&$groups) { + // An alternative session handler module would not want to run the original + // Session HTTPS handling test because it checks the sessions table in the + // database. + unset($groups['Session']['testHttpsSession']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_breadcrumb_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_breadcrumb_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..3f6e3a45403b43b9ce4a907f91a3fa6d254d0d60 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_breadcrumb_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_system_breadcrumb_alter(). + */ +function {{ machine_name }}_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context) { + // Add an item to the end of the breadcrumb. + $breadcrumb->addLink(\Drupal\Core\Link::createFromRoute(t('Text'), 'example_route_name')); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..94353f7b3150f7ab077616cdf72a45ab68c464e6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_system_info_alter(). + */ +function {{ machine_name }}_system_info_alter(array &$info, \Drupal\Core\Extension\Extension $file, $type) { + // Only fill this in if the .info.yml file does not define a 'datestamp'. + if (empty($info['datestamp'])) { + $info['datestamp'] = $file->getMTime(); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_themes_page_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_themes_page_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..26109f4ef210386418f37d6fb4b53a20313d6b11 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/system_themes_page_alter.twig @@ -0,0 +1,15 @@ +/** + * Implements hook_system_themes_page_alter(). + */ +function {{ machine_name }}_system_themes_page_alter(&$theme_groups) { + foreach ($theme_groups as $state => &$group) { + foreach ($theme_groups[$state] as &$theme) { + // Add a foo link to each list of theme operations. + $theme->operations[] = [ + 'title' => t('Foo'), + 'url' => Url::fromRoute('system.themes_page'), + 'query' => ['theme' => $theme->getName()], + ]; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/template_preprocess_default_variables_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/template_preprocess_default_variables_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..14238f67f7646c6c6bd342e46821fd471f0c16c0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/template_preprocess_default_variables_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_template_preprocess_default_variables_alter(). + */ +function {{ machine_name }}_template_preprocess_default_variables_alter(&$variables) { + $variables['is_admin'] = \Drupal::currentUser()->hasPermission('access administration pages'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_finished.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_finished.twig new file mode 100644 index 0000000000000000000000000000000000000000..dff6f4af66785144ef352d9fcd762ab9a2a8787f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_finished.twig @@ -0,0 +1,5 @@ +/** + * Implements hook_test_finished(). + */ +function {{ machine_name }}_test_finished($results) { +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_group_finished.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_group_finished.twig new file mode 100644 index 0000000000000000000000000000000000000000..b2e850ef39df41da8b9fcbba755a424ce5d3f54a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_group_finished.twig @@ -0,0 +1,5 @@ +/** + * Implements hook_test_group_finished(). + */ +function {{ machine_name }}_test_group_finished() { +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_group_started.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_group_started.twig new file mode 100644 index 0000000000000000000000000000000000000000..fe1c858489f4bb3f4bab1099abae0030cf9d79ce --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/test_group_started.twig @@ -0,0 +1,5 @@ +/** + * Implements hook_test_group_started(). + */ +function {{ machine_name }}_test_group_started() { +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme.twig new file mode 100644 index 0000000000000000000000000000000000000000..76935e80f3854b220ffb9784fbb5ec3e660b1ea4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme.twig @@ -0,0 +1,20 @@ +/** + * Implements hook_theme(). + */ +function {{ machine_name }}_theme($existing, $type, $theme, $path) { + return [ + 'forum_display' => [ + 'variables' => ['forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL], + ], + 'forum_list' => [ + 'variables' => ['forums' => NULL, 'parents' => NULL, 'tid' => NULL], + ], + 'forum_icon' => [ + 'variables' => ['new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0], + ], + 'status_report' => [ + 'render element' => 'requirements', + 'file' => 'system.admin.inc', + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_registry_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_registry_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..cdbb17e9f8318212c7323ab8807293e9f908adbf --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_registry_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_theme_registry_alter(). + */ +function {{ machine_name }}_theme_registry_alter(&$theme_registry) { + // Kill the next/previous forum topic navigation links. + foreach ($theme_registry['forum_topic_navigation']['preprocess functions'] as $key => $value) { + if ($value == 'template_preprocess_forum_topic_navigation') { + unset($theme_registry['forum_topic_navigation']['preprocess functions'][$key]); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_HOOK.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_HOOK.twig new file mode 100644 index 0000000000000000000000000000000000000000..f099429f702b7e733f9bb0c99ea879790e823699 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_HOOK.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_theme_suggestions_HOOK(). + */ +function {{ machine_name }}_theme_suggestions_HOOK(array $variables) { + $suggestions = []; + + $suggestions[] = 'hookname__' . $variables['elements']['#langcode']; + + return $suggestions; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_HOOK_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_HOOK_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9db930e10f33dc1f0ba2366e772aa342b17fc895 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_HOOK_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_theme_suggestions_HOOK_alter(). + */ +function {{ machine_name }}_theme_suggestions_HOOK_alter(array &$suggestions, array $variables) { + if (empty($variables['header'])) { + $suggestions[] = 'hookname__no_header'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..8a6c6cb561d0f53619f8952d3e74c076ca536bd2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/theme_suggestions_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_theme_suggestions_alter(). + */ +function {{ machine_name }}_theme_suggestions_alter(array &$suggestions, array $variables, $hook) { + // Add an interface-language specific suggestion to all theme hooks. + $suggestions[] = $hook . '__' . \Drupal::languageManager()->getCurrentLanguage()->getId(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/themes_installed.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/themes_installed.twig new file mode 100644 index 0000000000000000000000000000000000000000..beed725ec4826184e0beb2ef4ef388bbfc9e30d8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/themes_installed.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_themes_installed(). + */ +function {{ machine_name }}_themes_installed($theme_list) { + foreach ($theme_list as $theme) { + block_theme_initialize($theme); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/themes_uninstalled.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/themes_uninstalled.twig new file mode 100644 index 0000000000000000000000000000000000000000..21664d2c93a3c15cc8fcb9dd2d7adc04145f5be2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/themes_uninstalled.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_themes_uninstalled(). + */ +function {{ machine_name }}_themes_uninstalled(array $themes) { + // Remove some state entries depending on the theme. + foreach ($themes as $theme) { + \Drupal::state()->delete('example.' . $theme); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/token_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/token_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..c6340eef85199834a4cf606e26e129bc3192d6a7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/token_info.twig @@ -0,0 +1,38 @@ +/** + * Implements hook_token_info(). + */ +function {{ machine_name }}_token_info() { + $type = [ + 'name' => t('Nodes'), + 'description' => t('Tokens related to individual nodes.'), + 'needs-data' => 'node', + ]; + + // Core tokens for nodes. + $node['nid'] = [ + 'name' => t("Node ID"), + 'description' => t("The unique ID of the node."), + ]; + $node['title'] = [ + 'name' => t("Title"), + ]; + $node['edit-url'] = [ + 'name' => t("Edit URL"), + 'description' => t("The URL of the node's edit page."), + ]; + + // Chained tokens for nodes. + $node['created'] = [ + 'name' => t("Date created"), + 'type' => 'date', + ]; + $node['author'] = [ + 'name' => t("Author"), + 'type' => 'user', + ]; + + return [ + 'types' => ['node' => $type], + 'tokens' => ['node' => $node], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/token_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/token_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..3b0b20a19b5b2cee7a019d65e316e147412ea019 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/token_info_alter.twig @@ -0,0 +1,21 @@ +/** + * Implements hook_token_info_alter(). + */ +function {{ machine_name }}_token_info_alter(&$data) { + // Modify description of node tokens for our site. + $data['tokens']['node']['nid'] = [ + 'name' => t("Node ID"), + 'description' => t("The unique ID of the article."), + ]; + $data['tokens']['node']['title'] = [ + 'name' => t("Title"), + 'description' => t("The title of the article."), + ]; + + // Chained tokens for nodes. + $data['tokens']['node']['created'] = [ + 'name' => t("Date created"), + 'description' => t("The date the article was posted."), + 'type' => 'date', + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tokens.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tokens.twig new file mode 100644 index 0000000000000000000000000000000000000000..b4e605c566f9207b8f804c68021d971ef41b1558 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tokens.twig @@ -0,0 +1,59 @@ +/** + * Implements hook_tokens(). + */ +function {{ machine_name }}_tokens($type, $tokens, array $data, array $options, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata) { + $token_service = \Drupal::token(); + + $url_options = ['absolute' => TRUE]; + if (isset($options['langcode'])) { + $url_options['language'] = \Drupal::languageManager()->getLanguage($options['langcode']); + $langcode = $options['langcode']; + } + else { + $langcode = NULL; + } + $replacements = []; + + if ($type == 'node' && !empty($data['node'])) { + /** @var \Drupal\node\NodeInterface $node */ + $node = $data['node']; + + foreach ($tokens as $name => $original) { + switch ($name) { + // Simple key values on the node. + case 'nid': + $replacements[$original] = $node->nid; + break; + + case 'title': + $replacements[$original] = $node->getTitle(); + break; + + case 'edit-url': + $replacements[$original] = $node->toUrl('edit-form', $url_options)->toString(); + break; + + // Default values for the chained tokens handled below. + case 'author': + $account = $node->getOwner() ? $node->getOwner() : User::load(0); + $replacements[$original] = $account->label(); + $bubbleable_metadata->addCacheableDependency($account); + break; + + case 'created': + $replacements[$original] = \Drupal::service('date.formatter')->format($node->getCreatedTime(), 'medium', '', NULL, $langcode); + break; + } + } + + if ($author_tokens = $token_service->findWithPrefix($tokens, 'author')) { + $replacements += $token_service->generate('user', $author_tokens, ['user' => $node->getOwner()], $options, $bubbleable_metadata); + } + + if ($created_tokens = $token_service->findWithPrefix($tokens, 'created')) { + $replacements += $token_service->generate('date', $created_tokens, ['date' => $node->getCreatedTime()], $options, $bubbleable_metadata); + } + } + + return $replacements; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tokens_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tokens_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..4d44be7afdab3dafaa9a0f14decc5ba0fd956562 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tokens_alter.twig @@ -0,0 +1,25 @@ +/** + * Implements hook_tokens_alter(). + */ +function {{ machine_name }}_tokens_alter(array &$replacements, array $context, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata) { + $options = $context['options']; + + if (isset($options['langcode'])) { + $url_options['language'] = \Drupal::languageManager()->getLanguage($options['langcode']); + $langcode = $options['langcode']; + } + else { + $langcode = NULL; + } + + if ($context['type'] == 'node' && !empty($context['data']['node'])) { + $node = $context['data']['node']; + + // Alter the [node:title] token, and replace it with the rendered content + // of a field (field_title). + if (isset($context['tokens']['title'])) { + $title = $node->field_title->view('default'); + $replacements[$context['tokens']['title']] = drupal_render($title); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/toolbar.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/toolbar.twig new file mode 100644 index 0000000000000000000000000000000000000000..29fbe5ffda3fcdbc3b952c9c314ea9ac46f3ed96 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/toolbar.twig @@ -0,0 +1,107 @@ +/** + * Implements hook_toolbar(). + */ +function {{ machine_name }}_toolbar() { + $items = []; + + // Add a search field to the toolbar. The search field employs no toolbar + // module theming functions. + $items['global_search'] = [ + '#type' => 'toolbar_item', + 'tab' => [ + '#type' => 'search', + '#attributes' => [ + 'placeholder' => t('Search the site'), + 'class' => ['search-global'], + ], + ], + '#weight' => 200, + // Custom CSS, JS or a library can be associated with the toolbar item. + '#attached' => [ + 'library' => [ + 'search/global', + ], + ], + ]; + + // The 'Home' tab is a simple link, which is wrapped in markup associated + // with a visual tab styling. + $items['home'] = [ + '#type' => 'toolbar_item', + 'tab' => [ + '#type' => 'link', + '#title' => t('Home'), + '#url' => Url::fromRoute('<front>'), + '#options' => [ + 'attributes' => [ + 'title' => t('Home page'), + 'class' => ['toolbar-icon', 'toolbar-icon-home'], + ], + ], + ], + '#weight' => -20, + ]; + + // A tray may be associated with a tab. + // + // When the tab is activated, the tray will become visible, either in a + // horizontal or vertical orientation on the screen. + // + // The tray should contain a renderable array. An optional #heading property + // can be passed. This text is written to a heading tag in the tray as a + // landmark for accessibility. + $items['commerce'] = [ + '#type' => 'toolbar_item', + 'tab' => [ + '#type' => 'link', + '#title' => t('Shopping cart'), + '#url' => Url::fromRoute('cart'), + '#options' => [ + 'attributes' => [ + 'title' => t('Shopping cart'), + ], + ], + ], + 'tray' => [ + '#heading' => t('Shopping cart actions'), + 'shopping_cart' => [ + '#theme' => 'item_list', + '#items' => [/* An item list renderable array */], + ], + ], + '#weight' => 150, + ]; + + // The tray can be used to render arbitrary content. + // + // A renderable array passed to the 'tray' property will be rendered outside + // the administration bar but within the containing toolbar element. + // + // If the default behavior and styling of a toolbar tray is not desired, one + // can render content to the toolbar element and apply custom theming and + // behaviors. + $items['user_messages'] = [ + // Include the toolbar_tab_wrapper to style the link like a toolbar tab. + // Exclude the theme wrapper if custom styling is desired. + '#type' => 'toolbar_item', + 'tab' => [ + '#type' => 'link', + '#theme' => 'user_message_toolbar_tab', + '#theme_wrappers' => [], + '#title' => t('Messages'), + '#url' => Url::fromRoute('user.message'), + '#options' => [ + 'attributes' => [ + 'title' => t('Messages'), + ], + ], + ], + 'tray' => [ + '#heading' => t('User messages'), + 'messages' => [/* renderable content */], + ], + '#weight' => 125, + ]; + + return $items; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/toolbar_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/toolbar_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f648cb510e923a92877c5dfec105d8459cb291a7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/toolbar_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_toolbar_alter(). + */ +function {{ machine_name }}_toolbar_alter(&$items) { + // Move the User tab to the right. + $items['commerce']['#weight'] = 5; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tour_tips_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tour_tips_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d17ede84fe12681c76d02d6924199986f6fe8f2a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tour_tips_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_tour_tips_alter(). + */ +function {{ machine_name }}_tour_tips_alter(array &$tour_tips, Drupal\Core\Entity\EntityInterface $entity) { + foreach ($tour_tips as $tour_tip) { + if ($tour_tip->get('id') == 'tour-code-test-1') { + $tour_tip->set('body', 'Altered by hook_tour_tips_alter'); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tour_tips_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tour_tips_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..fd5573413de4399457ae6bca549b20aa1b090356 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/tour_tips_info_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_tour_tips_info_alter(). + */ +function {{ machine_name }}_tour_tips_info_alter(&$info) { + // Swap out the class used for this tip plugin. + if (isset($info['text'])) { + $info['class'] = 'Drupal\mymodule\Plugin\tour\tip\MyCustomTipPlugin'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/transliteration_overrides_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/transliteration_overrides_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9f7c9ad7b7d0b2a61e180969f9529d358a4d68a2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/transliteration_overrides_alter.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_transliteration_overrides_alter(). + */ +function {{ machine_name }}_transliteration_overrides_alter(&$overrides, $langcode) { + // Provide special overrides for German for a custom site. + if ($langcode == 'de') { + // The core-provided transliteration of Ä is Ae, but we want just A. + $overrides[0xC4] = 'A'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/uninstall.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/uninstall.twig new file mode 100644 index 0000000000000000000000000000000000000000..a6eb20865823fd6b46d5e33fda81d066471506ef --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/uninstall.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_uninstall(). + */ +function {{ machine_name }}_uninstall() { + // Remove the styles directory and generated images. + \Drupal::service('file_system')->deleteRecursive(\Drupal::config('system.file')->get('default_scheme') . '://styles'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_N.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_N.twig new file mode 100644 index 0000000000000000000000000000000000000000..193de2eedb3fffde599c277f4064538db5d7d647 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_N.twig @@ -0,0 +1,57 @@ +/** + * Implements hook_update_N(). + */ +function {{ machine_name }}_update_N(&$sandbox) { + // For non-batch updates, the signature can simply be: + // function {{ machine_name }}_update_N() { + + // Example function body for adding a field to a database table, which does + // not require a batch operation: + $spec = [ + 'type' => 'varchar', + 'description' => "New Col", + 'length' => 20, + 'not null' => FALSE, + ]; + $schema = Database::getConnection()->schema(); + $schema->addField('mytable1', 'newcol', $spec); + + // Example of what to do if there is an error during your update. + if ($some_error_condition_met) { + throw new UpdateException('Something went wrong; here is what you should do.'); + } + + // Example function body for a batch update. In this example, the values in + // a database field are updated. + if (!isset($sandbox['progress'])) { + // This must be the first run. Initialize the sandbox. + $sandbox['progress'] = 0; + $sandbox['current_pk'] = 0; + $sandbox['max'] = Database::getConnection()->query('SELECT COUNT(myprimarykey) FROM {mytable1}')->fetchField(); + } + + // Update in chunks of 20. + $records = Database::getConnection()->select('mytable1', 'm') + ->fields('m', ['myprimarykey', 'otherfield']) + ->condition('myprimarykey', $sandbox['current_pk'], '>') + ->range(0, 20) + ->orderBy('myprimarykey', 'ASC') + ->execute(); + foreach ($records as $record) { + // Here, you would make an update something related to this record. In this + // example, some text is added to the other field. + Database::getConnection()->update('mytable1') + ->fields(['otherfield' => $record->otherfield . '-suffix']) + ->condition('myprimarykey', $record->myprimarykey) + ->execute(); + + $sandbox['progress']++; + $sandbox['current_pk'] = $record->myprimarykey; + } + + $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); + + // To display a message to the user when the update is completed, return it. + // If you do not want to display a completion message, return nothing. + return t('All foo bars were updated with the new suffix'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_dependencies.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_dependencies.twig new file mode 100644 index 0000000000000000000000000000000000000000..a7373b04d245f52f66507ea1ee0fb5da91b18625 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_dependencies.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_update_dependencies(). + */ +function {{ machine_name }}_update_dependencies() { + // Indicate that the mymodule_update_8001() function provided by this module + // must run after the another_module_update_8003() function provided by the + // 'another_module' module. + $dependencies['mymodule'][8001] = [ + 'another_module' => 8003, + ]; + // Indicate that the mymodule_update_8002() function provided by this module + // must run before the yet_another_module_update_8005() function provided by + // the 'yet_another_module' module. (Note that declaring dependencies in this + // direction should be done only in rare situations, since it can lead to the + // following problem: If a site has already run the yet_another_module + // module's database updates before it updates its codebase to pick up the + // newest mymodule code, then the dependency declared here will be ignored.) + $dependencies['yet_another_module'][8005] = [ + 'mymodule' => 8002, + ]; + return $dependencies; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_last_removed.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_last_removed.twig new file mode 100644 index 0000000000000000000000000000000000000000..71b8eb0a5af49de771e036e0469dff0706d92955 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_last_removed.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_update_last_removed(). + */ +function {{ machine_name }}_update_last_removed() { + // We've removed the 8.x-1.x version of mymodule, including database updates. + // The next update function is mymodule_update_8200(). + return 8103; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_projects_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_projects_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..41691cd9be990cd7cc44bb2e2597bab10b359aa3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_projects_alter.twig @@ -0,0 +1,41 @@ +/** + * Implements hook_update_projects_alter(). + */ +function {{ machine_name }}_update_projects_alter(&$projects) { + // Hide a site-specific module from the list. + unset($projects['site_specific_module']); + + // Add a disabled module to the list. + // The key for the array should be the machine-readable project "short name". + $projects['disabled_project_name'] = [ + // Machine-readable project short name (same as the array key above). + 'name' => 'disabled_project_name', + // Array of values from the main .info.yml file for this project. + 'info' => [ + 'name' => 'Some disabled module', + 'description' => 'A module not enabled on the site that you want to see in the available updates report.', + 'version' => '8.x-1.0', + 'core' => '8.x', + // The maximum file change time (the "ctime" returned by the filectime() + // PHP method) for all of the .info.yml files included in this project. + '_info_file_ctime' => 1243888165, + ], + // The date stamp when the project was released, if known. If the disabled + // project was an officially packaged release from drupal.org, this will + // be included in the .info.yml file as the 'datestamp' field. This only + // really matters for development snapshot releases that are regenerated, + // so it can be left undefined or set to 0 in most cases. + 'datestamp' => 1243888185, + // Any modules (or themes) included in this project. Keyed by machine- + // readable "short name", value is the human-readable project name printed + // in the UI. + 'includes' => [ + 'disabled_project' => 'Disabled module', + 'disabled_project_helper' => 'Disabled module helper module', + 'disabled_project_foo' => 'Disabled module foo add-on module', + ], + // Does this project contain a 'module', 'theme', 'disabled-module', or + // 'disabled-theme'? + 'project_type' => 'disabled-module', + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_status_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_status_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..0ecd08608049cc4651faf205c8e954c6d40a78e2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/update_status_alter.twig @@ -0,0 +1,22 @@ +/** + * Implements hook_update_status_alter(). + */ +function {{ machine_name }}_update_status_alter(&$projects) { + $settings = \Drupal::config('update_advanced.settings')->get('projects'); + foreach ($projects as $project => $project_info) { + if (isset($settings[$project]) && isset($settings[$project]['check']) && + ($settings[$project]['check'] == 'never' || + (isset($project_info['recommended']) && + $settings[$project]['check'] === $project_info['recommended']))) { + $projects[$project]['status'] = UPDATE_NOT_CHECKED; + $projects[$project]['reason'] = t('Ignored from settings'); + if (!empty($settings[$project]['notes'])) { + $projects[$project]['extra'][] = [ + 'class' => ['admin-note'], + 'label' => t('Administrator note'), + 'data' => $settings[$project]['notes'], + ]; + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/updater_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/updater_info.twig new file mode 100644 index 0000000000000000000000000000000000000000..4bee33ca9c4b8f1cbfc665302a337afcb1c9ee43 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/updater_info.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_updater_info(). + */ +function {{ machine_name }}_updater_info() { + return [ + 'module' => [ + 'class' => 'Drupal\Core\Updater\Module', + 'name' => t('Update modules'), + 'weight' => 0, + ], + 'theme' => [ + 'class' => 'Drupal\Core\Updater\Theme', + 'name' => t('Update themes'), + 'weight' => 0, + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/updater_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/updater_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c8221304244509469b5094832686beb615602dc9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/updater_info_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_updater_info_alter(). + */ +function {{ machine_name }}_updater_info_alter(&$updaters) { + // Adjust weight so that the theme Updater gets a chance to handle a given + // update task before module updaters. + $updaters['theme']['weight'] = -1; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_cancel.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_cancel.twig new file mode 100644 index 0000000000000000000000000000000000000000..8ecdbd06a7339518e37e51998c8407f3056840f6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_cancel.twig @@ -0,0 +1,29 @@ +/** + * Implements hook_user_cancel(). + */ +function {{ machine_name }}_user_cancel($edit, UserInterface $account, $method) { + switch ($method) { + case 'user_cancel_block_unpublish': + // Unpublish nodes (current revisions). + module_load_include('inc', 'node', 'node.admin'); + $nodes = \Drupal::entityQuery('node') + ->condition('uid', $account->id()) + ->execute(); + node_mass_update($nodes, ['status' => 0], NULL, TRUE); + break; + + case 'user_cancel_reassign': + // Anonymize nodes (current revisions). + module_load_include('inc', 'node', 'node.admin'); + $nodes = \Drupal::entityQuery('node') + ->condition('uid', $account->id()) + ->execute(); + node_mass_update($nodes, ['uid' => 0], NULL, TRUE); + // Anonymize old revisions. + \Drupal::database()->update('node_field_revision') + ->fields(['uid' => 0]) + ->condition('uid', $account->id()) + ->execute(); + break; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_cancel_methods_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_cancel_methods_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d445894063a36fdb4a31ffcb27b6369dd17a0cf6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_cancel_methods_alter.twig @@ -0,0 +1,19 @@ +/** + * Implements hook_user_cancel_methods_alter(). + */ +function {{ machine_name }}_user_cancel_methods_alter(&$methods) { + $account = \Drupal::currentUser(); + // Limit access to disable account and unpublish content method. + $methods['user_cancel_block_unpublish']['access'] = $account->hasPermission('administer site configuration'); + + // Remove the content re-assigning method. + unset($methods['user_cancel_reassign']); + + // Add a custom zero-out method. + $methods['mymodule_zero_out'] = [ + 'title' => t('Delete the account and remove all content.'), + 'description' => t('All your content will be replaced by empty strings.'), + // access should be used for administrative methods only. + 'access' => $account->hasPermission('access zero-out account cancellation method'), + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_format_name_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_format_name_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d1d13f6f71a372fde91dd76c57cff21574abc783 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_format_name_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_user_format_name_alter(). + */ +function {{ machine_name }}_user_format_name_alter(&$name, AccountInterface $account) { + // Display the user's uid instead of name. + if ($account->id()) { + $name = t('User @uid', ['@uid' => $account->id()]); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_login.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_login.twig new file mode 100644 index 0000000000000000000000000000000000000000..7a4f8c49f6bcd62c29798f0f8ef626d7bde3d8bb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_login.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_user_login(). + */ +function {{ machine_name }}_user_login(UserInterface $account) { + $config = \Drupal::config('system.date'); + // If the user has a NULL time zone, notify them to set a time zone. + if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) { + \Drupal::messenger() + ->addStatus(t('Configure your <a href=":user-edit">account time zone setting</a>.', [ + ':user-edit' => $account->toUrl('edit-form', [ + 'query' => \Drupal::destination() + ->getAsArray(), + 'fragment' => 'edit-timezone', + ])->toString(), + ])); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_logout.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_logout.twig new file mode 100644 index 0000000000000000000000000000000000000000..5dfff2f0ada14ab0f35e4990854d9e60f94dc82c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/user_logout.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_user_logout(). + */ +function {{ machine_name }}_user_logout(AccountInterface $account) { + \Drupal::database()->insert('logouts') + ->fields([ + 'uid' => $account->id(), + 'time' => time(), + ]) + ->execute(); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/validation_constraint_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/validation_constraint_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..8d368f3dfde31718880b5ce0a28117157c4ebfb7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/validation_constraint_alter.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_validation_constraint_alter(). + */ +function {{ machine_name }}_validation_constraint_alter(array &$definitions) { + $definitions['Null']['class'] = '\Drupal\mymodule\Validator\Constraints\MyClass'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/verify_update_archive.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/verify_update_archive.twig new file mode 100644 index 0000000000000000000000000000000000000000..5c124567eefd5047e00758dd8dcd0bfab36b1ab6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/verify_update_archive.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_verify_update_archive(). + */ +function {{ machine_name }}_verify_update_archive($project, $archive_file, $directory) { + $errors = []; + if (!file_exists($directory)) { + $errors[] = t('The %directory does not exist.', ['%directory' => $directory]); + } + // Add other checks on the archive integrity here. + return $errors; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_analyze.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_analyze.twig new file mode 100644 index 0000000000000000000000000000000000000000..08f8fecd170009f8e1292f4f9832a9ad89dfa8b3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_analyze.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_views_analyze(). + */ +function {{ machine_name }}_views_analyze(Drupal\views\ViewExecutable $view) { + $messages = []; + + if ($view->display_handler->options['pager']['type'] == 'none') { + $messages[] = Drupal\views\Analyzer::formatMessage(t('This view has no pager. This could cause performance issues when the view contains many items.'), 'warning'); + } + + return $messages; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_data.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_data.twig new file mode 100644 index 0000000000000000000000000000000000000000..855d9a7c857c1fb6df3fb75a803d3fd2526257ab --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_data.twig @@ -0,0 +1,311 @@ +/** + * Implements hook_views_data(). + */ +function {{ machine_name }}_views_data() { + // This example describes how to write hook_views_data() for a table defined + // like this: + // CREATE TABLE example_table ( + // nid INT(11) NOT NULL COMMENT 'Primary key: {node}.nid.', + // plain_text_field VARCHAR(32) COMMENT 'Just a plain text field.', + // numeric_field INT(11) COMMENT 'Just a numeric field.', + // boolean_field INT(1) COMMENT 'Just an on/off field.', + // timestamp_field INT(8) COMMENT 'Just a timestamp field.', + // langcode VARCHAR(12) COMMENT 'Language code field.', + // PRIMARY KEY(nid) + // ); + + // Define the return array. + $data = []; + + // The outermost keys of $data are Views table names, which should usually + // be the same as the hook_schema() table names. + $data['example_table'] = []; + + // The value corresponding to key 'table' gives properties of the table + // itself. + $data['example_table']['table'] = []; + + // Within 'table', the value of 'group' (translated string) is used as a + // prefix in Views UI for this table's fields, filters, etc. When adding + // a field, filter, etc. you can also filter by the group. + $data['example_table']['table']['group'] = t('Example table'); + + // Within 'table', the value of 'provider' is the module that provides schema + // or the entity type that causes the table to exist. Setting this ensures + // that views have the correct dependencies. This is automatically set to the + // module that implements hook_views_data(). + $data['example_table']['table']['provider'] = 'example_module'; + + // Some tables are "base" tables, meaning that they can be the base tables + // for views. Non-base tables can only be brought in via relationships in + // views based on other tables. To define a table to be a base table, add + // key 'base' to the 'table' array: + $data['example_table']['table']['base'] = [ + // Identifier (primary) field in this table for Views. + 'field' => 'nid', + // Label in the UI. + 'title' => t('Example table'), + // Longer description in the UI. Required. + 'help' => t('Example table contains example content and can be related to nodes.'), + 'weight' => -10, + ]; + + // Some tables have an implicit, automatic relationship to other tables, + // meaning that when the other table is available in a view (either as the + // base table or through a relationship), this table's fields, filters, etc. + // are automatically made available without having to add an additional + // relationship. To define an implicit relationship that will make your + // table automatically available when another table is present, add a 'join' + // section to your 'table' section. Note that it is usually only a good idea + // to do this for one-to-one joins, because otherwise your automatic join + // will add more rows to the view. It is also not a good idea to do this if + // most views won't need your table -- if that is the case, define a + // relationship instead (see below). + // + // If you've decided an automatic join is a good idea, here's how to do it; + // the resulting SQL query will look something like this: + // ... FROM example_table et ... JOIN node_field_data nfd + // ON et.nid = nfd.nid AND ('extra' clauses will be here) ... + // although the table aliases will be different. + $data['example_table']['table']['join'] = [ + // Within the 'join' section, list one or more tables to automatically + // join to. In this example, every time 'node_field_data' is available in + // a view, 'example_table' will be too. The array keys here are the array + // keys for the other tables, given in their hook_views_data() + // implementations. If the table listed here is from another module's + // hook_views_data() implementation, make sure your module depends on that + // other module. + 'node_field_data' => [ + // Primary key field in node_field_data to use in the join. + 'left_field' => 'nid', + // Foreign key field in example_table to use in the join. + 'field' => 'nid', + // 'extra' is an array of additional conditions on the join. + 'extra' => [ + 0 => [ + // Adds AND node_field_data.published = TRUE to the join. + 'field' => 'published', + 'value' => TRUE, + ], + 1 => [ + // Adds AND example_table.numeric_field = 1 to the join. + 'left_field' => 'numeric_field', + 'value' => 1, + // If true, the value will not be surrounded in quotes. + 'numeric' => TRUE, + ], + 2 => [ + // Adds AND example_table.boolean_field <> + // node_field_data.published to the join. + 'field' => 'published', + 'left_field' => 'boolean_field', + // The operator used, Defaults to "=". + 'operator' => '!=', + ], + ], + ], + ]; + + // You can also do a more complex join, where in order to get to a certain + // base table defined in a hook_views_data() implementation, you will join + // to a different table that Views knows how to auto-join to the base table. + // For instance, if another module that your module depends on had + // defined a table 'foo' with an automatic join to 'node_field_table' (as + // shown above), you could join to 'node_field_table' via the 'foo' table. + // Here's how to do this, and the resulting SQL query would look something + // like this: + // ... FROM example_table et ... JOIN foo foo + // ON et.nid = foo.nid AND ('extra' clauses will be here) ... + // JOIN node_field_data nfd ON (definition of the join from the foo + // module goes here) ... + // although the table aliases will be different. + $data['example_table']['table']['join']['node_field_data'] = [ + // 'node_field_data' above is the base we're joining to in Views. + // 'left_table' is the table we're actually joining to, in order to get to + // 'node_field_data'. It has to be something that Views knows how to join + // to 'node_field_data'. + 'left_table' => 'foo', + 'left_field' => 'nid', + 'field' => 'nid', + // 'extra' is an array of additional conditions on the join. + 'extra' => [ + // This syntax matches additional fields in the two tables: + // ... AND foo.langcode = example_table.langcode ... + ['left_field' => 'langcode', 'field' => 'langcode'], + // This syntax adds a condition on our table. 'operator' defaults to + // '=' for non-array values, or 'IN' for array values. + // ... AND example_table.numeric_field > 0 ... + ['field' => 'numeric_field', 'value' => 0, 'numeric' => TRUE, 'operator' => '>'], + ], + ]; + + // Other array elements at the top level of your table's array describe + // individual database table fields made available to Views. The array keys + // are the names (unique within the table) used by Views for the fields, + // usually equal to the database field names. + // + // Each field entry must have the following elements: + // - title: Translated label for the field in the UI. + // - help: Description of the field in the UI. + // + // Each field entry may also have one or more of the following elements, + // describing "handlers" (plugins) for the field: + // - relationship: Specifies a handler that allows this field to be used + // to define a relationship to another table in Views. + // - field: Specifies a handler to make it available to Views as a field. + // - filter: Specifies a handler to make it available to Views as a filter. + // - sort: Specifies a handler to make it available to Views as a sort. + // - argument: Specifies a handler to make it available to Views as an + // argument, or contextual filter as it is known in the UI. + // - area: Specifies a handler to make it available to Views to add content + // to the header, footer, or as no result behavior. + // + // Note that when specifying handlers, you must give the handler plugin ID + // and you may also specify overrides for various settings that make up the + // plugin definition. See examples below; the Boolean example demonstrates + // setting overrides. + + // Node ID field, exposed as relationship only, since it is a foreign key + // in this table. + $data['example_table']['nid'] = [ + 'title' => t('Example content'), + 'help' => t('Relate example content to the node content'), + + // Define a relationship to the node_field_data table, so views whose + // base table is example_table can add a relationship to nodes. To make a + // relationship in the other direction, you can: + // - Use hook_views_data_alter() -- see the function body example on that + // hook for details. + // - Use the implicit join method described above. + 'relationship' => [ + // Views name of the table to join to for the relationship. + 'base' => 'node_field_data', + // Database field name in the other table to join on. + 'base field' => 'nid', + // ID of relationship handler plugin to use. + 'id' => 'standard', + // Default label for relationship in the UI. + 'label' => t('Example node'), + ], + ]; + + // Plain text field, exposed as a field, sort, filter, and argument. + $data['example_table']['plain_text_field'] = [ + 'title' => t('Plain text field'), + 'help' => t('Just a plain text field.'), + + 'field' => [ + // ID of field handler plugin to use. + 'id' => 'standard', + ], + + 'sort' => [ + // ID of sort handler plugin to use. + 'id' => 'standard', + ], + + 'filter' => [ + // ID of filter handler plugin to use. + 'id' => 'string', + ], + + 'argument' => [ + // ID of argument handler plugin to use. + 'id' => 'string', + ], + ]; + + // Numeric field, exposed as a field, sort, filter, and argument. + $data['example_table']['numeric_field'] = [ + 'title' => t('Numeric field'), + 'help' => t('Just a numeric field.'), + + 'field' => [ + // ID of field handler plugin to use. + 'id' => 'numeric', + ], + + 'sort' => [ + // ID of sort handler plugin to use. + 'id' => 'standard', + ], + + 'filter' => [ + // ID of filter handler plugin to use. + 'id' => 'numeric', + ], + + 'argument' => [ + // ID of argument handler plugin to use. + 'id' => 'numeric', + ], + ]; + + // Boolean field, exposed as a field, sort, and filter. The filter section + // illustrates overriding various settings. + $data['example_table']['boolean_field'] = [ + 'title' => t('Boolean field'), + 'help' => t('Just an on/off field.'), + + 'field' => [ + // ID of field handler plugin to use. + 'id' => 'boolean', + ], + + 'sort' => [ + // ID of sort handler plugin to use. + 'id' => 'standard', + ], + + 'filter' => [ + // ID of filter handler plugin to use. + 'id' => 'boolean', + // Override the generic field title, so that the filter uses a different + // label in the UI. + 'label' => t('Published'), + // Override the default BooleanOperator filter handler's 'type' setting, + // to display this as a "Yes/No" filter instead of a "True/False" filter. + 'type' => 'yes-no', + // Override the default Boolean filter handler's 'use_equal' setting, to + // make the query use 'boolean_field = 1' instead of 'boolean_field <> 0'. + 'use_equal' => TRUE, + ], + ]; + + // Integer timestamp field, exposed as a field, sort, and filter. + $data['example_table']['timestamp_field'] = [ + 'title' => t('Timestamp field'), + 'help' => t('Just a timestamp field.'), + + 'field' => [ + // ID of field handler plugin to use. + 'id' => 'date', + ], + + 'sort' => [ + // ID of sort handler plugin to use. + 'id' => 'date', + ], + + 'filter' => [ + // ID of filter handler plugin to use. + 'id' => 'date', + ], + ]; + + // Area example. Areas are not generally associated with actual data + // tables and fields. This example is from views_views_data(), which defines + // the "Global" table (not really a table, but a group of Fields, Filters, + // etc. that are grouped into section "Global" in the UI). Here's the + // definition of the generic "Text area": + $data['views']['area'] = [ + 'title' => t('Text area'), + 'help' => t('Provide markup text for the area.'), + 'area' => [ + // ID of the area handler plugin to use. + 'id' => 'text', + ], + ]; + + return $data; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_data_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_data_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..03bc80bcdfe92b306bc7e4025d611ed7ed982c21 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_data_alter.twig @@ -0,0 +1,54 @@ +/** + * Implements hook_views_data_alter(). + */ +function {{ machine_name }}_views_data_alter(array &$data) { + // Alter the title of the node_field_data:nid field in the Views UI. + $data['node_field_data']['nid']['title'] = t('Node-Nid'); + + // Add an additional field to the users_field_data table. + $data['users_field_data']['example_field'] = [ + 'title' => t('Example field'), + 'help' => t('Some example content that references a user'), + + 'field' => [ + // ID of the field handler to use. + 'id' => 'example_field', + ], + ]; + + // Change the handler of the node title field, presumably to a handler plugin + // you define in your module. Give the ID of this plugin. + $data['node_field_data']['title']['field']['id'] = 'node_title'; + + // Add a relationship that will allow a view whose base table is 'foo' (from + // another module) to have a relationship to 'example_table' (from my module), + // via joining foo.fid to example_table.eid. + // + // This relationship has to be added to the 'foo' Views data, which my module + // does not control, so it must be done in hook_views_data_alter(), not + // hook_views_data(). + // + // In Views data definitions, each field can have only one relationship. So + // rather than adding this relationship directly to the $data['foo']['fid'] + // field entry, which could overwrite an existing relationship, we define + // a dummy field key to handle the relationship. + $data['foo']['unique_dummy_name'] = [ + 'title' => t('Title seen while adding relationship'), + 'help' => t('More information about the relationship'), + + 'relationship' => [ + // Views name of the table being joined to from foo. + 'base' => 'example_table', + // Database field name in example_table for the join. + 'base field' => 'eid', + // Real database field name in foo for the join, to override + // 'unique_dummy_name'. + 'field' => 'fid', + // ID of relationship handler plugin to use. + 'id' => 'standard', + 'label' => t('Default label for relationship'), + ], + ]; + + // Note that the $data array is not returned – it is modified by reference. +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_form_substitutions.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_form_substitutions.twig new file mode 100644 index 0000000000000000000000000000000000000000..52ffe755174c3a24b3db74c9ab8654fdbe28f743 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_form_substitutions.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_views_form_substitutions(). + */ +function {{ machine_name }}_views_form_substitutions() { + return [ + '<!--views-form-example-substitutions-->' => 'Example Substitution', + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_invalidate_cache.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_invalidate_cache.twig new file mode 100644 index 0000000000000000000000000000000000000000..86ccde1fa4989e4d19ca0dc24a28628f3afa84cc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_invalidate_cache.twig @@ -0,0 +1,6 @@ +/** + * Implements hook_views_invalidate_cache(). + */ +function {{ machine_name }}_views_invalidate_cache() { + \Drupal\Core\Cache\Cache::invalidateTags(['views']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_access_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_access_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..299993c413af7bcc8570bd3b05511def6e02a7d6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_access_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_access_alter(). + */ +function {{ machine_name }}_views_plugins_access_alter(array &$plugins) { + // Remove the available plugin because the users should not have access to it. + unset($plugins['role']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_area_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_area_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..9f6d5645e02c2ed4a5b8f6ab38c82885f73d8d75 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_area_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_area_alter(). + */ +function {{ machine_name }}_views_plugins_area_alter(array &$plugins) { + // Change the 'title' handler class. + $plugins['title']['class'] = 'Drupal\\example\\ExampleClass'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..61dd60b140c5ee4187ebcf231a6aacaeab28190a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_argument_alter(). + */ +function {{ machine_name }}_views_plugins_argument_alter(array &$plugins) { + // Change the 'title' handler class. + $plugins['title']['class'] = 'Drupal\\example\\ExampleClass'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_default_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_default_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..211f90a770373f62a7a6ccce58f2a3cdc3f11336 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_default_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_argument_default_alter(). + */ +function {{ machine_name }}_views_plugins_argument_default_alter(array &$plugins) { + // Remove the available plugin because the users should not have access to it. + unset($plugins['php']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_validator_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_validator_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..89cc74cd70cd5058d7799f20383937dae66ea46b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_argument_validator_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_argument_validator_alter(). + */ +function {{ machine_name }}_views_plugins_argument_validator_alter(array &$plugins) { + // Remove the available plugin because the users should not have access to it. + unset($plugins['php']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_cache_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_cache_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..c9acf027ebf3d9bf110eb1452c29bd824dc3852f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_cache_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_cache_alter(). + */ +function {{ machine_name }}_views_plugins_cache_alter(array &$plugins) { + // Change the title. + $plugins['time']['title'] = t('Custom title'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_display_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_display_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..dabb6ed6e7d755b24f3f4f9adad4a361518d49ea --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_display_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_display_alter(). + */ +function {{ machine_name }}_views_plugins_display_alter(array &$plugins) { + // Alter the title of an existing plugin. + $plugins['rest_export']['title'] = t('Export'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_display_extenders_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_display_extenders_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..ba86f74008ed3f128e7867f482bf5dcb9ebd4ab6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_display_extenders_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_display_extenders_alter(). + */ +function {{ machine_name }}_views_plugins_display_extenders_alter(array &$plugins) { + // Alter the title of an existing plugin. + $plugins['time']['title'] = t('Custom title'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_exposed_form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_exposed_form_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..1877b656457b5eccf57cf01b38838e3b0e460e50 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_exposed_form_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_exposed_form_alter(). + */ +function {{ machine_name }}_views_plugins_exposed_form_alter(array &$plugins) { + // Remove the available plugin because the users should not have access to it. + unset($plugins['input_required']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_field_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_field_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..4ec9bb92e788c2b7fedd2cebc06e8c74cc69661e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_field_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_field_alter(). + */ +function {{ machine_name }}_views_plugins_field_alter(array &$plugins) { + // Change the 'title' handler class. + $plugins['title']['class'] = 'Drupal\\example\\ExampleClass'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_filter_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_filter_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..bd96df7217af2be98a01316901d049e73e5217f0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_filter_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_filter_alter(). + */ +function {{ machine_name }}_views_plugins_filter_alter(array &$plugins) { + // Change the 'title' handler class. + $plugins['title']['class'] = 'Drupal\\example\\ExampleClass'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_join_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_join_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..f01eb0a8e2d6785b304805cdc8cec92c3a141c55 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_join_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_join_alter(). + */ +function {{ machine_name }}_views_plugins_join_alter(array &$plugins) { + // Print out all join plugin names for debugging purposes. + debug($plugins); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_pager_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_pager_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..888b21c141d741c9d994f45fdd0f4731363a9dd4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_pager_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_pager_alter(). + */ +function {{ machine_name }}_views_plugins_pager_alter(array &$plugins) { + // Remove the sql based plugin to force good performance. + unset($plugins['full']); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_query_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_query_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d2c6440495b58f27e696fd3338fbc27e03c2a78e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_query_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_query_alter(). + */ +function {{ machine_name }}_views_plugins_query_alter(array &$plugins) { + // Print out all query plugin names for debugging purposes. + debug($plugins); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_relationship_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_relationship_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..e435d0b7623e55438d34a6198470ffd3e21b93b7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_relationship_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_relationship_alter(). + */ +function {{ machine_name }}_views_plugins_relationship_alter(array &$plugins) { + // Change the 'title' handler class. + $plugins['title']['class'] = 'Drupal\\example\\ExampleClass'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_row_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_row_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..267acc43554b1e644ba17862c12f670e3ea85947 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_row_alter.twig @@ -0,0 +1,8 @@ +/** + * Implements hook_views_plugins_row_alter(). + */ +function {{ machine_name }}_views_plugins_row_alter(array &$plugins) { + // Change the used class of a plugin. + $plugins['entity:node']['class'] = 'Drupal\node\Plugin\views\row\NodeRow'; + $plugins['entity:node']['module'] = 'node'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_sort_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_sort_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..efbc03c0995bfef1d25c17e3aa6d65c1b7d4ddeb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_sort_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_sort_alter(). + */ +function {{ machine_name }}_views_plugins_sort_alter(array &$plugins) { + // Change the 'title' handler class. + $plugins['title']['class'] = 'Drupal\\example\\ExampleClass'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_style_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_style_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..72dd3b49f7c29159649c8802f4d2247842b9af54 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_style_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_style_alter(). + */ +function {{ machine_name }}_views_plugins_style_alter(array &$plugins) { + // Change the theme hook of a plugin. + $plugins['html_list']['theme'] = 'custom_views_view_list'; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_wizard_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_wizard_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..e842068c56b92eb140f00d5dc9e7b742599a76f7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_plugins_wizard_alter.twig @@ -0,0 +1,7 @@ +/** + * Implements hook_views_plugins_wizard_alter(). + */ +function {{ machine_name }}_views_plugins_wizard_alter(array &$plugins) { + // Change the title of a plugin. + $plugins['node_revision']['title'] = t('Node revision wizard'); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_build.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_build.twig new file mode 100644 index 0000000000000000000000000000000000000000..bfd25720a042ffc1aab01271694abda37061cf44 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_build.twig @@ -0,0 +1,16 @@ +/** + * Implements hook_views_post_build(). + */ +function {{ machine_name }}_views_post_build(ViewExecutable $view) { + // If the exposed field 'type' is set, hide the column containing the content + // type. (Note that this is a solution for a particular view, and makes + // assumptions about both exposed filter settings and the fields in the view. + // Also note that this alter could be done at any point before the view being + // rendered.) + if ($view->id() == 'my_view' && isset($view->exposed_raw_input['type']) && $view->exposed_raw_input['type'] != 'All') { + // 'Type' should be interpreted as content type. + if (isset($view->field['type'])) { + $view->field['type']->options['exclude'] = TRUE; + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_execute.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_execute.twig new file mode 100644 index 0000000000000000000000000000000000000000..dfad5f44ce610c38bbc5a6b3b8e5eb72ae81f73f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_execute.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_views_post_execute(). + */ +function {{ machine_name }}_views_post_execute(ViewExecutable $view) { + // If there are more than 100 results, show a message that encourages the user + // to change the filter settings. + // (This action could be performed later in the execution process, but not + // earlier.) + if ($view->total_rows > 100) { + \Drupal::messenger()->addStatus(t('You have more than 100 hits. Use the filter settings to narrow down your list.')); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_render.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_render.twig new file mode 100644 index 0000000000000000000000000000000000000000..63370538d540d32ebc9008c723398bb46a2e4ae3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_post_render.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_views_post_render(). + */ +function {{ machine_name }}_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) { + // When using full pager, disable any time-based caching if there are fewer + // than 10 results. + if ($view->pager instanceof Drupal\views\Plugin\views\pager\Full && $cache instanceof Drupal\views\Plugin\views\cache\Time && count($view->result) < 10) { + $cache->options['results_lifespan'] = 0; + $cache->options['output_lifespan'] = 0; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_build.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_build.twig new file mode 100644 index 0000000000000000000000000000000000000000..6465616895e66f0d7e5fc29e4e2b042caf3b1cc7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_build.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_views_pre_build(). + */ +function {{ machine_name }}_views_pre_build(ViewExecutable $view) { + // Because of some inexplicable business logic, we should remove all + // attachments from all views on Mondays. + // (This alter could be done later in the execution process as well.) + if (date('D') == 'Mon') { + unset($view->attachment_before); + unset($view->attachment_after); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_execute.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_execute.twig new file mode 100644 index 0000000000000000000000000000000000000000..92cae5ffc5033893574eadea4dc75a4e3de9970f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_execute.twig @@ -0,0 +1,14 @@ +/** + * Implements hook_views_pre_execute(). + */ +function {{ machine_name }}_views_pre_execute(ViewExecutable $view) { + // Whenever a view queries more than two tables, show a message that notifies + // view administrators that the query might be heavy. + // (This action could be performed later in the execution process, but not + // earlier.) + $account = \Drupal::currentUser(); + + if (count($view->query->tables) > 2 && $account->hasPermission('administer views')) { + \Drupal::messenger()->addWarning(t('The view %view may be heavy to execute.', ['%view' => $view->id()])); + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_render.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_render.twig new file mode 100644 index 0000000000000000000000000000000000000000..0cf94e13f1c7c8f46e3121313e59097ce5cee12d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_render.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_views_pre_render(). + */ +function {{ machine_name }}_views_pre_render(ViewExecutable $view) { + // Scramble the order of the rows shown on this result page. + // Note that this could be done earlier, but not later in the view execution + // process. + shuffle($view->result); +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_view.twig new file mode 100644 index 0000000000000000000000000000000000000000..bd725df566aedc0e3c687c3a0566970500817c29 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_pre_view.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_views_pre_view(). + */ +function {{ machine_name }}_views_pre_view(ViewExecutable $view, $display_id, array &$args) { + + // Modify contextual filters for my_special_view if user has 'my special permission'. + $account = \Drupal::currentUser(); + + if ($view->id() == 'my_special_view' && $account->hasPermission('my special permission') && $display_id == 'public_display') { + $args[0] = 'custom value'; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_preview_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_preview_info_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..1c50ce2443bd335e8dbeef0407095219c2aed87b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_preview_info_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_views_preview_info_alter(). + */ +function {{ machine_name }}_views_preview_info_alter(array &$rows, ViewExecutable $view) { + // Adds information about the tables being queried by the view to the query + // part of the info box. + $rows['query'][] = [ + t('<strong>Table queue</strong>'), + count($view->query->table_queue) . ': (' . implode(', ', array_keys($view->query->table_queue)) . ')', + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_query_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_query_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d09a7e41e4f8b7e90a4deea98e41f752fe366c38 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_query_alter.twig @@ -0,0 +1,24 @@ +/** + * Implements hook_views_query_alter(). + */ +function {{ machine_name }}_views_query_alter(ViewExecutable $view, QueryPluginBase $query) { + // (Example assuming a view with an exposed filter on node title.) + // If the input for the title filter is a positive integer, filter against + // node ID instead of node title. + if ($view->id() == 'my_view' && is_numeric($view->exposed_raw_input['title']) && $view->exposed_raw_input['title'] > 0) { + // Traverse through the 'where' part of the query. + foreach ($query->where as &$condition_group) { + foreach ($condition_group['conditions'] as &$condition) { + // If this is the part of the query filtering on title, chang the + // condition to filter on node ID. + if ($condition['field'] == 'node.title') { + $condition = [ + 'field' => 'node.nid', + 'value' => $view->exposed_raw_input['title'], + 'operator' => '=', + ]; + } + } + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_query_substitutions.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_query_substitutions.twig new file mode 100644 index 0000000000000000000000000000000000000000..7a43d9e8e556f2c1c40516d2699463fea50b621d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_query_substitutions.twig @@ -0,0 +1,12 @@ +/** + * Implements hook_views_query_substitutions(). + */ +function {{ machine_name }}_views_query_substitutions(ViewExecutable $view) { + // Example from views_views_query_substitutions(). + return [ + '***CURRENT_VERSION***' => \Drupal::VERSION, + '***CURRENT_TIME***' => REQUEST_TIME, + '***LANGUAGE_language_content***' => \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId(), + PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT => \Drupal::languageManager()->getDefaultLanguage()->getId(), + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_ui_display_top_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_ui_display_top_links_alter.twig new file mode 100644 index 0000000000000000000000000000000000000000..96ec9f1d913ce55f9ce0fe54cdb6128afae3dd03 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/views_ui_display_top_links_alter.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_views_ui_display_top_links_alter(). + */ +function {{ machine_name }}_views_ui_display_top_links_alter(array &$links, ViewExecutable $view, $display_id) { + // Put the export link first in the list. + if (isset($links['export'])) { + $links = ['export' => $links['export']] + $links; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/install.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/install.twig new file mode 100644 index 0000000000000000000000000000000000000000..cdcc1be4892c8a8748a5da2f93196851d8023c20 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/install.twig @@ -0,0 +1,96 @@ +<?php + +/** + * @file + * Install, update and uninstall functions for the {{ name }} module. + */ + +/** + * Implements hook_install(). + */ +function {{ machine_name }}_install() { + \Drupal::messenger()->addStatus(__FUNCTION__); +} + +/** + * Implements hook_uninstall(). + */ +function {{ machine_name }}_uninstall() { + \Drupal::messenger()->addStatus(__FUNCTION__); +} + +/** + * Implements hook_schema(). + */ +function {{ machine_name }}_schema() { + $schema['{{ machine_name }}_example'] = [ + 'description' => 'Table description.', + 'fields' => [ + 'id' => [ + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique record ID.', + ], + 'uid' => [ + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {users}.uid of the user who created the record.', + ], + 'status' => [ + 'description' => 'Boolean indicating whether this record is active.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ], + 'type' => [ + 'type' => 'varchar_ascii', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Type of the record.', + ], + 'created' => [ + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Timestamp when the record was created.', + ], + 'data' => [ + 'type' => 'blob', + 'not null' => TRUE, + 'size' => 'big', + 'description' => 'The arbitrary data for the item.', + ], + ], + 'primary key' => ['id'], + 'indexes' => [ + 'type' => ['type'], + 'uid' => ['uid'], + 'status' => ['status'], + ], + ]; + + return $schema; +} + +/** + * Implements hook_requirements(). + */ +function {{ machine_name }}_requirements($phase) { + $requirements = []; + + if ($phase == 'runtime') { + $value = mt_rand(0, 100); + $requirements['{{ machine_name }}_status'] = [ + 'title' => t('{{ name }} status'), + 'value' => t('{{ name }} value: @value', ['@value' => $value]), + 'severity' => $value > 50 ? REQUIREMENT_INFO : REQUIREMENT_WARNING, + ]; + } + + return $requirements; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/javascript.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/javascript.twig new file mode 100644 index 0000000000000000000000000000000000000000..4b36af2b8150306dba11fc3efcc4aab1c80fc46d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/javascript.twig @@ -0,0 +1,21 @@ +/** + * @file + * {{ name }} behaviors. + */ + +(function ($, Drupal) { + + 'use strict'; + + /** + * Behavior description. + */ + Drupal.behaviors.{{ machine_name|camelize(false) }} = { + attach: function (context, settings) { + + console.log('It works!'); + + } + }; + +} (jQuery, Drupal)); diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module.twig new file mode 100644 index 0000000000000000000000000000000000000000..24725d3061e7be94db5eb1b0513fc40b0e4a497a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module.twig @@ -0,0 +1,10 @@ +<?php + +/** + * @file + * Primary module hooks for {{ name }} module. + * + * @DCG + * This file is no longer required in Drupal 8. + * @see https://www.drupal.org/node/2217931 + */ diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/config/schema/model.schema.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/config/schema/model.schema.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..6b60a8c84583c612c31512ac6f9d9edbdddd239b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/config/schema/model.schema.yml.twig @@ -0,0 +1,14 @@ +{{ machine_name }}.{{ entity_type_id }}.*: + type: config_entity + label: {{ entity_type_label }} + mapping: + id: + type: string + label: ID + label: + type: label + label: Label + uuid: + type: string + description: + type: string diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.info.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.info.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..d5dc3b157a725f9847543fc8675fea7a1eec95f7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.info.yml.twig @@ -0,0 +1,12 @@ +name: {{ name }} +type: module +description: 'Provides {{ entity_type_label|article|lower }} configuration entity.' +package: {{ package }} +core: 8.x +{% if dependencies %} +dependencies: +{% for dependency in dependencies %} + - {{ dependency }} +{% endfor %} +{% endif %} +configure: entity.{{ entity_type_id }}.collection diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.links.action.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.links.action.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..2e187516571e6a74dbb1ea5bc162f263e721acd2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.links.action.yml.twig @@ -0,0 +1,5 @@ +entity.{{ entity_type_id }}.add_form: + route_name: 'entity.{{ entity_type_id }}.add_form' + title: 'Add {{ entity_type_label|lower }}' + appears_on: + - entity.{{ entity_type_id }}.collection diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.links.menu.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.links.menu.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..4915766c32fc2cced353536a38917f3d3ac09912 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.links.menu.yml.twig @@ -0,0 +1,5 @@ +entity.{{ entity_type_id }}.overview: + title: {{ entity_type_label|plural }} + parent: system.admin_structure + description: 'List of {{ entity_type_label|lower|plural }} to extend site functionality.' + route_name: entity.{{ entity_type_id }}.collection diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.permissions.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.permissions.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..d4a108638c2f32445452bf5bb827c405a6510eeb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.permissions.yml.twig @@ -0,0 +1,2 @@ +administer {{ entity_type_id }}: + title: 'Administer {{ entity_type_label|lower }}' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.routing.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.routing.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..dd281aa6e35e4843f60189393e1fc91c83f13f15 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/model.routing.yml.twig @@ -0,0 +1,31 @@ +entity.{{ entity_type_id }}.collection: + path: '/admin/structure/{{ entity_type_id|u2h }}' + defaults: + _entity_list: '{{ entity_type_id }}' + _title: '{{ entity_type_label }} configuration' + requirements: + _permission: 'administer {{ entity_type_id }}' + +entity.{{ entity_type_id }}.add_form: + path: '/admin/structure/{{ entity_type_id }}/add' + defaults: + _entity_form: '{{ entity_type_id }}.add' + _title: 'Add {{ entity_type_label|article|lower }}' + requirements: + _permission: 'administer {{ entity_type_id }}' + +entity.{{ entity_type_id }}.edit_form: + path: '/admin/structure/{{ entity_type_id|u2h }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}' + defaults: + _entity_form: '{{ entity_type_id }}.edit' + _title: 'Edit {{ entity_type_label|article|lower }}' + requirements: + _permission: 'administer {{ entity_type_id }}' + +entity.{{ entity_type_id }}.delete_form: + path: '/admin/structure/{{ entity_type_id|u2h }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}/delete' + defaults: + _entity_form: '{{ entity_type_id }}.delete' + _title: 'Delete {{ entity_type_label|article|lower }}' + requirements: + _permission: 'administer {{ entity_type_id }}' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/Entity/Example.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/Entity/Example.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..c25d59283edffc21e54ff72fefa6ce43ef8af60f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/Entity/Example.php.twig @@ -0,0 +1,81 @@ +<?php + +namespace Drupal\{{ machine_name }}\Entity; + +{% sort %} +use Drupal\Core\Config\Entity\ConfigEntityBase; +use Drupal\{{ machine_name }}\{{ class_prefix }}Interface; +{% endsort %} + +/** + * Defines the {{ entity_type_label|lower }} entity type. + * + * @ConfigEntityType( + * id = "{{ entity_type_id }}", + * label = @Translation("{{ entity_type_label }}"), + * label_collection = @Translation("{{ entity_type_label|plural }}"), + * label_singular = @Translation("{{ entity_type_label|lower }}"), + * label_plural = @Translation("{{ entity_type_label|plural|lower }}"), + * label_count = @PluralTranslation( + * singular = "@count {{ entity_type_label|lower }}", + * plural = "@count {{ entity_type_label|plural|lower }}", + * ), + * handlers = { + * "list_builder" = "Drupal\{{ machine_name }}\{{ class_prefix }}ListBuilder", + * "form" = { + * "add" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}Form", + * "edit" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}Form", + * "delete" = "Drupal\Core\Entity\EntityDeleteForm" + * } + * }, + * config_prefix = "{{ entity_type_id }}", + * admin_permission = "administer {{ entity_type_id }}", + * links = { + * "collection" = "/admin/structure/{{ entity_type_id|u2h }}", + * "add-form" = "/admin/structure/{{ entity_type_id|u2h }}/add", + * "edit-form" = "/admin/structure/{{ entity_type_id|u2h }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}", + * "delete-form" = "/admin/structure/{{ entity_type_id|u2h }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}/delete" + * }, + * entity_keys = { + * "id" = "id", + * "label" = "label", + * "uuid" = "uuid" + * }, + * config_export = { + * "id", + * "label", + * "description" + * } + * ) + */ +class {{ class_prefix }} extends ConfigEntityBase implements {{ class_prefix }}Interface { + + /** + * The {{ entity_type_label|lower }} ID. + * + * @var string + */ + protected $id; + + /** + * The {{ entity_type_label|lower }} label. + * + * @var string + */ + protected $label; + + /** + * The {{ entity_type_label|lower }} status. + * + * @var bool + */ + protected $status; + + /** + * The {{ entity_type_id|lower }} description. + * + * @var string + */ + protected $description; + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/ExampleInterface.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/ExampleInterface.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..09f04528f4b47c9cc52b4729e24977ab31539e7e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/ExampleInterface.php.twig @@ -0,0 +1,12 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Config\Entity\ConfigEntityInterface; + +/** + * Provides an interface defining {{ entity_type_label|article|lower }} entity type. + */ +interface {{ class_prefix }}Interface extends ConfigEntityInterface { + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/ExampleListBuilder.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/ExampleListBuilder.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..8de78d50b855e8f427b190364ab4b14ac78c18e1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/ExampleListBuilder.php.twig @@ -0,0 +1,34 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; +use Drupal\Core\Entity\EntityInterface; + +/** + * Provides a listing of {{ entity_type_label|lower|plural }}. + */ +class {{ class_prefix }}ListBuilder extends ConfigEntityListBuilder { + + /** + * {@inheritdoc} + */ + public function buildHeader() { + $header['label'] = $this->t('Label'); + $header['id'] = $this->t('Machine name'); + $header['status'] = $this->t('Status'); + return $header + parent::buildHeader(); + } + + /** + * {@inheritdoc} + */ + public function buildRow(EntityInterface $entity) { + /** @var \Drupal\{{ machine_name }}\{{ class_prefix }}Interface $entity */ + $row['label'] = $entity->label(); + $row['id'] = $entity->id(); + $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled'); + return $row + parent::buildRow($entity); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/Form/ExampleForm.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/Form/ExampleForm.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..b61beba103c45aa3ea47597fd9bff64c9c919ead --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/Form/ExampleForm.php.twig @@ -0,0 +1,70 @@ +<?php + +namespace Drupal\{{ machine_name }}\Form; + +use Drupal\Core\Entity\EntityForm; +use Drupal\Core\Form\FormStateInterface; + +/** + * {{ entity_type_label }} form. + * + * @property \Drupal\{{ machine_name }}\{{ class_prefix }}Interface $entity + */ +class {{ class_prefix }}Form extends EntityForm { + + /** + * {@inheritdoc} + */ + public function form(array $form, FormStateInterface $form_state) { + + $form = parent::form($form, $form_state); + + $form['label'] = [ + '#type' => 'textfield', + '#title' => $this->t('Label'), + '#maxlength' => 255, + '#default_value' => $this->entity->label(), + '#description' => $this->t('Label for the {{ entity_type_label|lower }}.'), + '#required' => TRUE, + ]; + + $form['id'] = [ + '#type' => 'machine_name', + '#default_value' => $this->entity->id(), + '#machine_name' => [ + 'exists' => '\Drupal\{{ machine_name }}\Entity\{{ class_prefix }}::load', + ], + '#disabled' => !$this->entity->isNew(), + ]; + + $form['status'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Enabled'), + '#default_value' => $this->entity->status(), + ]; + + $form['description'] = [ + '#type' => 'textarea', + '#title' => $this->t('Description'), + '#default_value' => $this->entity->get('description'), + '#description' => $this->t('Description of the {{ entity_type_label|lower }}.'), + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function save(array $form, FormStateInterface $form_state) { + $result = parent::save($form, $form_state); + $message_args = ['%label' => $this->entity->label()]; + $message = $result == SAVED_NEW + ? $this->t('Created new {{ entity_type_label|lower }} %label.', $message_args) + : $this->t('Updated {{ entity_type_label|lower }} %label.', $message_args); + $this->messenger()->addStatus($message); + $form_state->setRedirectUrl($this->entity->toUrl('collection')); + return $result; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/config/optional/rest.resource.entity.example.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/config/optional/rest.resource.entity.example.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..830ddea29f288c8ea2ee83ed1977d894987bf034 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/config/optional/rest.resource.entity.example.yml.twig @@ -0,0 +1,31 @@ +id: entity.{{ entity_type_id }} +plugin_id: 'entity:{{ entity_type_id }}' +granularity: method +configuration: + GET: + supported_formats: + - json + - xml + supported_auth: + - cookie + POST: + supported_formats: + - json + - xml + supported_auth: + - cookie + PATCH: + supported_formats: + - json + - xml + supported_auth: + - cookie + DELETE: + supported_formats: + - json + - xml + supported_auth: + - cookie +dependencies: + module: + - user diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/config/schema/model.entity_type.schema.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/config/schema/model.entity_type.schema.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..f648254748bbd388533d1e19ffb575b7a1408cdd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/config/schema/model.entity_type.schema.yml.twig @@ -0,0 +1,12 @@ +{{ machine_name }}.{{ entity_type_id }}_type.*: + type: config_entity + label: '{{ entity_type_label }} type config' + mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' + uuid: + type: string diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.info.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.info.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..ec3a80036f344119aac6410946c41cce0a11f1a4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.info.yml.twig @@ -0,0 +1,14 @@ +name: {{ name }} +type: module +description: 'Provides {{ entity_type_label|article|lower }} entity.' +package: {{ package }} +core: 8.x +{% if dependencies %} +dependencies: +{% for dependency in dependencies %} + - {{ dependency }} +{% endfor %} +{% endif %} +{% if configure %} +configure: {{ configure }} +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.action.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.action.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..c093809da52f3ba5c4a0fd618e7127288df04db4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.action.yml.twig @@ -0,0 +1,19 @@ +{% if bundle %} +{{ entity_type_id }}.type_add: + route_name: entity.{{ entity_type_id }}_type.add_form + title: 'Add {{ entity_type_label|lower }} type' + appears_on: + - entity.{{ entity_type_id }}_type.collection + +{{ entity_type_id }}.add_page: + route_name: entity.{{ entity_type_id }}.add_page + title: 'Add {{ entity_type_label|lower }}' + appears_on: + - entity.{{ entity_type_id }}.collection +{% else %} +{{ entity_type_id }}.add_form: + route_name: entity.{{ entity_type_id }}.add_form + title: 'Add {{ entity_type_label|lower }}' + appears_on: + - entity.{{ entity_type_id }}.collection +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.menu.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.menu.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..e5803fa487a203595f682cd85a5ec18385b1c1e1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.menu.yml.twig @@ -0,0 +1,18 @@ +{% if fieldable_no_bundle %} +entity.{{ entity_type_id }}.settings: + title: {{ entity_type_label }} + description: Configure {{ entity_type_label|article }} entity type + route_name: entity.{{ entity_type_id }}.settings + parent: system.admin_structure +entity.{{ entity_type_id }}.collection: + title: {{ entity_type_label|plural }} + description: List of {{ entity_type_label|plural|lower }} + route_name: entity.{{ entity_type_id }}.collection + parent: system.admin_content +{% elseif bundle %} +entity.{{ entity_type_id }}_type.collection: + title: '{{ entity_type_label }} types' + parent: system.admin_structure + description: 'Manage and CRUD actions on {{ entity_type_label }} type.' + route_name: entity.{{ entity_type_id }}_type.collection +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.task.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.task.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..ef22ad6378c2d004f65e0665c4a00aefb58dcd25 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.links.task.yml.twig @@ -0,0 +1,34 @@ +{% if fieldable_no_bundle %} +entity.{{ entity_type_id }}.settings: + title: Settings + route_name: entity.{{ entity_type_id }}.settings + base_route: entity.{{ entity_type_id }}.settings +{% endif %} +entity.{{ entity_type_id }}.view: + title: View + route_name: entity.{{ entity_type_id }}.canonical + base_route: entity.{{ entity_type_id }}.canonical +entity.{{ entity_type_id }}.edit_form: + title: Edit + route_name: entity.{{ entity_type_id }}.edit_form + base_route: entity.{{ entity_type_id }}.canonical +entity.{{ entity_type_id }}.delete_form: + title: Delete + route_name: entity.{{ entity_type_id }}.delete_form + base_route: entity.{{ entity_type_id }}.canonical + weight: 10 +entity.{{ entity_type_id }}.collection: + title: {{ entity_type_label }} + route_name: entity.{{ entity_type_id }}.collection + base_route: system.admin_content + weight: 10 +{% if bundle %} +entity.{{ entity_type_id }}_type.edit_form: + title: Edit + route_name: entity.{{ entity_type_id }}_type.edit_form + base_route: entity.{{ entity_type_id }}_type.edit_form +entity.{{ entity_type_id }}_type.collection: + title: List + route_name: entity.{{ entity_type_id }}_type.collection + base_route: entity.{{ entity_type_id }}_type.collection +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.module.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.module.twig new file mode 100644 index 0000000000000000000000000000000000000000..8b3ffa9e9b22f88777aee4e67d04e317fda02c2d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.module.twig @@ -0,0 +1,36 @@ +<?php + +/** + * @file + * Provides {{ entity_type_label|article|lower }} entity type. + */ + +use Drupal\Core\Render\Element; + +/** + * Implements hook_theme(). + */ +function {{ machine_name }}_theme() { + return [ + '{{ entity_type_id }}' => [ + 'render element' => 'elements', + ], + ]; +} + +/** + * Prepares variables for {{ entity_type_label|lower }} templates. + * + * Default template: {{ template_name }}. + * + * @param array $variables + * An associative array containing: + * - elements: An associative array containing the {{ entity_type_label|lower }} information and any + * fields attached to the entity. + * - attributes: HTML attributes for the containing element. + */ +function template_preprocess_{{ entity_type_id }}(array &$variables) { + foreach (Element::children($variables['elements']) as $key) { + $variables['content'][$key] = $variables['elements'][$key]; + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.permissions.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.permissions.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..c03d7a58de9041f076cc2eb0e76ece3bd73d8760 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.permissions.yml.twig @@ -0,0 +1,22 @@ +{% if bundle %} +administer {{ entity_type_label|lower }} types: + title: 'Administer {{ entity_type_label|lower }} types' + description: 'Maintain the types of {{ entity_type_label|lower }} entity.' + restrict access: true +{% elseif fieldable %} +administer {{ entity_type_label|lower }}: + title: 'Administer {{ entity_type_label|lower }} settings' + restrict access: true +{% endif %} +access {{ entity_type_label|lower }} overview: + title: 'Access {{ entity_type_label|lower }} overview page' +{% if access_controller %} +delete {{ entity_type_label|lower }}: + title: Delete {{ entity_type_label|lower }} +create {{ entity_type_label|lower }}: + title: Create {{ entity_type_label|lower }} +view {{ entity_type_label|lower }}: + title: View {{ entity_type_label|lower }} +edit {{ entity_type_label|lower }}: + title: Edit {{ entity_type_label|lower }} +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.routing.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.routing.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..300eab1fbe12c95d654d1738b37471b222ab7d99 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/model.routing.yml.twig @@ -0,0 +1,9 @@ +{% if fieldable_no_bundle %} +entity.{{ entity_type_id }}.settings: + path: 'admin/structure/{{ entity_type_id|u2h }}' + defaults: + _form: '\Drupal\{{ machine_name }}\Form\{{ class_prefix }}SettingsForm' + _title: '{{ entity_type_label }}' + requirements: + _permission: 'administer {{ entity_type_label|lower }}' +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Entity/Example.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Entity/Example.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..3f03e5ffc446a36a411748570f10989950a4f40d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Entity/Example.php.twig @@ -0,0 +1,368 @@ +<?php + +namespace Drupal\{{ machine_name }}\Entity; + +{% sort %} +{% if not revisionable %} +use Drupal\Core\Entity\ContentEntityBase; +{% endif %} +{% if author_base_field %} +use Drupal\Core\Entity\EntityStorageInterface; +{% endif %} +use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Field\BaseFieldDefinition; +{% if revisionable %} +use Drupal\Core\Entity\RevisionableContentEntityBase; +{% endif %} +use Drupal\{{ machine_name }}\{{ class_prefix }}Interface; +{% if author_base_field %} +use Drupal\user\UserInterface; +{% endif %} +{% if changed_base_field %} +use Drupal\Core\Entity\EntityChangedTrait; +{% endif %} +{% endsort %} + +/** + * Defines the {{ entity_type_label|lower }} entity class. + * + * @ContentEntityType( + * id = "{{ entity_type_id }}", + * label = @Translation("{{ entity_type_label }}"), + * label_collection = @Translation("{{ entity_type_label|plural }}"), +{% if bundle %} + * bundle_label = @Translation("{{ entity_type_label }} type"), +{% endif %} + * handlers = { +{% if template %} + * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder", +{% else %} + * "view_builder" = "Drupal\{{ machine_name }}\{{ class_prefix }}ViewBuilder", +{% endif %} + * "list_builder" = "Drupal\{{ machine_name }}\{{ class_prefix }}ListBuilder", + * "views_data" = "Drupal\views\EntityViewsData", +{% if access_controller %} + * "access" = "Drupal\{{ machine_name }}\{{ class_prefix }}AccessControlHandler", +{% endif %} + * "form" = { + * "add" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}Form", + * "edit" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}Form", + * "delete" = "Drupal\Core\Entity\ContentEntityDeleteForm" + * }, + * "route_provider" = { + * "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider", + * } + * }, + * base_table = "{{ entity_type_id }}", +{% if translatable %} + * data_table = "{{ entity_type_id }}_field_data", +{% endif %} +{% if revisionable %} + * revision_table = "{{ entity_type_id }}_revision", +{% endif %} +{% if revisionable and translatable %} + * revision_data_table = "{{ entity_type_id }}_field_revision", +{% endif %} +{% if revisionable %} + * show_revision_ui = TRUE, +{% endif %} +{% if translatable %} + * translatable = TRUE, +{% endif %} +{% if bundle %} + * admin_permission = "administer {{ entity_type_label|lower }} types", +{% elseif fieldable %} + * admin_permission = "administer {{ entity_type_label|lower }}", + {% endif %} + * entity_keys = { + * "id" = "id", +{% if revisionable %} + * "revision" = "revision_id", +{% endif %} +{% if translatable %} + * "langcode" = "langcode", +{% endif %} +{% if bundle %} + * "bundle" = "bundle", +{% endif %} + * "label" = "{{ title_base_field ? 'title' : 'id' }}", + * "uuid" = "uuid" + * }, +{% if revisionable %} + * revision_metadata_keys = { +{% if author_base_field %} + * "revision_user" = "revision_uid", +{% endif %} +{% if created_base_field %} + * "revision_created" = "revision_timestamp", +{% endif %} + * "revision_log_message" = "revision_log" + * }, +{% endif %} + * links = { +{% if bundle %} + * "add-form" = "{{ entity_base_path }}/add/{{ '{' }}{{ entity_type_id }}{{ '_type}' }}", + * "add-page" = "{{ entity_base_path }}/add", +{% else %} + * "add-form" = "{{ entity_base_path }}/add", +{% endif %} + * "canonical" = "/{{ entity_type_id }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}", + * "edit-form" = "{{ entity_base_path }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}/edit", + * "delete-form" = "{{ entity_base_path }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}/delete", + * "collection" = "/admin/content/{{ entity_type_id|u2h }}" + * }, +{% if bundle %} + * bundle_entity_type = "{{ entity_type_id }}_type", + * field_ui_base_route = "entity.{{ entity_type_id }}_type.edit_form" +{% elseif fieldable %} + * field_ui_base_route = "entity.{{ entity_type_id }}.settings" +{% endif %} + * ) + */ +class {{ class_prefix }} extends {% if revisionable %}Revisionable{% endif %}ContentEntityBase implements {{ class_prefix }}Interface { + +{% if changed_base_field %} + use EntityChangedTrait; + +{% endif %} +{% if author_base_field %} + /** + * {@inheritdoc} + * + * When a new {{ entity_type_label|lower }} entity is created, set the uid entity reference to + * the current user as the creator of the entity. + */ + public static function preCreate(EntityStorageInterface $storage_controller, array &$values) { + parent::preCreate($storage_controller, $values); + $values += ['uid' => \Drupal::currentUser()->id()]; + } + +{% endif %} +{% if title_base_field %} + /** + * {@inheritdoc} + */ + public function getTitle() { + return $this->get('title')->value; + } + + /** + * {@inheritdoc} + */ + public function setTitle($title) { + $this->set('title', $title); + return $this; + } + +{% endif %} +{% if status_base_field %} + /** + * {@inheritdoc} + */ + public function isEnabled() { + return (bool) $this->get('status')->value; + } + + /** + * {@inheritdoc} + */ + public function setStatus($status) { + $this->set('status', $status); + return $this; + } + +{% endif %} +{% if created_base_field %} + /** + * {@inheritdoc} + */ + public function getCreatedTime() { + return $this->get('created')->value; + } + + /** + * {@inheritdoc} + */ + public function setCreatedTime($timestamp) { + $this->set('created', $timestamp); + return $this; + } + +{% endif %} +{% if author_base_field %} + /** + * {@inheritdoc} + */ + public function getOwner() { + return $this->get('uid')->entity; + } + + /** + * {@inheritdoc} + */ + public function getOwnerId() { + return $this->get('uid')->target_id; + } + + /** + * {@inheritdoc} + */ + public function setOwnerId($uid) { + $this->set('uid', $uid); + return $this; + } + + /** + * {@inheritdoc} + */ + public function setOwner(UserInterface $account) { + $this->set('uid', $account->id()); + return $this; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + + $fields = parent::baseFieldDefinitions($entity_type); + +{% if title_base_field %} + $fields['title'] = BaseFieldDefinition::create('string') +{% if revisionable %} + ->setRevisionable(TRUE) +{% endif %} +{% if translatable %} + ->setTranslatable(TRUE) +{% endif %} + ->setLabel(t('Title')) + ->setDescription(t('The title of the {{ entity_type_label|lower }} entity.')) + ->setRequired(TRUE) + ->setSetting('max_length', 255) + ->setDisplayOptions('form', [ + 'type' => 'string_textfield', + 'weight' => -5, + ]) + ->setDisplayConfigurable('form', TRUE) + ->setDisplayOptions('view', [ + 'label' => 'hidden', + 'type' => 'string', + 'weight' => -5, + ]) + ->setDisplayConfigurable('view', TRUE); + +{% endif %} +{% if status_base_field %} + $fields['status'] = BaseFieldDefinition::create('boolean') +{% if revisionable %} + ->setRevisionable(TRUE) +{% endif %} + ->setLabel(t('Status')) + ->setDescription(t('A boolean indicating whether the {{ entity_type_label|lower }} is enabled.')) + ->setDefaultValue(TRUE) + ->setSetting('on_label', 'Enabled') + ->setDisplayOptions('form', [ + 'type' => 'boolean_checkbox', + 'settings' => [ + 'display_label' => FALSE, + ], + 'weight' => 0, + ]) + ->setDisplayConfigurable('form', TRUE) + ->setDisplayOptions('view', [ + 'type' => 'boolean', + 'label' => 'above', + 'weight' => 0, + 'settings' => [ + 'format' => 'enabled-disabled', + ], + ]) + ->setDisplayConfigurable('view', TRUE); + +{% endif %} +{% if description_base_field %} + $fields['description'] = BaseFieldDefinition::create('text_long') +{% if revisionable %} + ->setRevisionable(TRUE) +{% endif %} +{% if translatable %} + ->setTranslatable(TRUE) +{% endif %} + ->setLabel(t('Description')) + ->setDescription(t('A description of the {{ entity_type_label|lower }}.')) + ->setDisplayOptions('form', [ + 'type' => 'text_textarea', + 'weight' => 10, + ]) + ->setDisplayConfigurable('form', TRUE) + ->setDisplayOptions('view', [ + 'type' => 'text_default', + 'label' => 'above', + 'weight' => 10, + ]) + ->setDisplayConfigurable('view', TRUE); + +{% endif %} +{% if author_base_field %} + $fields['uid'] = BaseFieldDefinition::create('entity_reference') +{% if revisionable %} + ->setRevisionable(TRUE) +{% endif %} +{% if translatable %} + ->setTranslatable(TRUE) +{% endif %} + ->setLabel(t('Author')) + ->setDescription(t('The user ID of the {{ entity_type_label|lower }} author.')) + ->setSetting('target_type', 'user') + ->setDisplayOptions('form', [ + 'type' => 'entity_reference_autocomplete', + 'settings' => [ + 'match_operator' => 'CONTAINS', + 'size' => 60, + 'placeholder' => '', + ], + 'weight' => 15, + ]) + ->setDisplayConfigurable('form', TRUE) + ->setDisplayOptions('view', [ + 'label' => 'above', + 'type' => 'author', + 'weight' => 15, + ]) + ->setDisplayConfigurable('view', TRUE); + +{% endif %} +{% if created_base_field %} + $fields['created'] = BaseFieldDefinition::create('created') + ->setLabel(t('Authored on')) +{% if translatable %} + ->setTranslatable(TRUE) +{% endif %} + ->setDescription(t('The time that the {{ entity_type_label|lower }} was created.')) + ->setDisplayOptions('view', [ + 'label' => 'above', + 'type' => 'timestamp', + 'weight' => 20, + ]) + ->setDisplayConfigurable('form', TRUE) + ->setDisplayOptions('form', [ + 'type' => 'datetime_timestamp', + 'weight' => 20, + ]) + ->setDisplayConfigurable('view', TRUE); + +{% endif %} +{% if changed_base_field %} + $fields['changed'] = BaseFieldDefinition::create('changed') + ->setLabel(t('Changed')) +{% if translatable %} + ->setTranslatable(TRUE) +{% endif %} + ->setDescription(t('The time that the {{ entity_type_label|lower }} was last edited.')); + +{% endif %} + return $fields; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Entity/ExampleType.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Entity/ExampleType.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..144e1150791cfd4f52ce55fe4b8fe1b269f4e5e3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Entity/ExampleType.php.twig @@ -0,0 +1,61 @@ +<?php + +namespace Drupal\{{ machine_name }}\Entity; + +use Drupal\Core\Config\Entity\ConfigEntityBundleBase; + +/** + * Defines the {{ entity_type_label }} type configuration entity. + * + * @ConfigEntityType( + * id = "{{ entity_type_id }}_type", + * label = @Translation("{{ entity_type_label }} type"), + * handlers = { + * "form" = { + * "add" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}TypeForm", + * "edit" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}TypeForm", + * "delete" = "Drupal\Core\Entity\EntityDeleteForm", + * }, + * "list_builder" = "Drupal\{{ machine_name }}\{{ class_prefix }}TypeListBuilder", + * "route_provider" = { + * "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider", + * } + * }, + * admin_permission = "administer {{ entity_type_label|lower }} types", + * bundle_of = "{{ entity_type_id }}", + * config_prefix = "{{ entity_type_id }}_type", + * entity_keys = { + * "id" = "id", + * "label" = "label", + * "uuid" = "uuid" + * }, + * links = { + * "add-form" = "/admin/structure/{{ entity_type_id }}_types/add", + * "edit-form" = "/admin/structure/{{ entity_type_id }}_types/manage/{{ '{' ~ entity_type_id ~ '_type}' }}", + * "delete-form" = "/admin/structure/{{ entity_type_id }}_types/manage/{{ '{' ~ entity_type_id ~ '_type}' }}/delete", + * "collection" = "/admin/structure/{{ entity_type_id }}_types" + * }, + * config_export = { + * "id", + * "label", + * "uuid", + * } + * ) + */ +class {{ class_prefix }}Type extends ConfigEntityBundleBase { + + /** + * The machine name of this {{ entity_type_label|lower }} type. + * + * @var string + */ + protected $id; + + /** + * The human-readable name of the {{ entity_type_label|lower }} type. + * + * @var string + */ + protected $label; + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleAccessControlHandler.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleAccessControlHandler.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..6ac5e9d022cb399aac267b496358118ee64b966f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleAccessControlHandler.php.twig @@ -0,0 +1,44 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Access\AccessResult; +use Drupal\Core\Entity\EntityAccessControlHandler; +use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Session\AccountInterface; + +/** + * Defines the access control handler for the {{ entity_type_label|lower }} entity type. + */ +class {{ class_prefix }}AccessControlHandler extends EntityAccessControlHandler { + + /** + * {@inheritdoc} + */ + protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) { + + switch ($operation) { + case 'view': + return AccessResult::allowedIfHasPermission($account, 'view {{ entity_type_label|lower }}'); + + case 'update': + return AccessResult::allowedIfHasPermissions($account, ['edit {{ entity_type_label|lower }}', 'administer {{ entity_type_label|lower }}'], 'OR'); + + case 'delete': + return AccessResult::allowedIfHasPermissions($account, ['delete {{ entity_type_label|lower }}', 'administer {{ entity_type_label|lower }}'], 'OR'); + + default: + // No opinion. + return AccessResult::neutral(); + } + + } + + /** + * {@inheritdoc} + */ + protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { + return AccessResult::allowedIfHasPermissions($account, ['create {{ entity_type_label|lower }}', 'administer {{ entity_type_label|lower }}'], 'OR'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleInterface.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleInterface.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..14571877f8721a6fa4e2801799e492c10bca54b9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleInterface.php.twig @@ -0,0 +1,81 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Entity\ContentEntityInterface; +{% if author_base_field %} +use Drupal\user\EntityOwnerInterface; +{% endif %} +{% if changed_base_field %} +use Drupal\Core\Entity\EntityChangedInterface; +{% endif %} + +/** + * Provides an interface defining {{ entity_type_label|article|lower }} entity type. + */ +interface {{ class_prefix }}Interface extends ContentEntityInterface{% if author_base_field %}, EntityOwnerInterface{% endif %}{% if changed_base_field %}, EntityChangedInterface{% endif %} { + +{% if title_base_field %} + /** + * Gets the {{ entity_type_label|lower }} title. + * + * @return string + * Title of the {{ entity_type_label|lower }}. + */ + public function getTitle(); + + /** + * Sets the {{ entity_type_label|lower }} title. + * + * @param string $title + * The {{ entity_type_label|lower }} title. + * + * @return \Drupal\{{ machine_name }}\{{ class_prefix }}Interface + * The called {{ entity_type_label|lower }} entity. + */ + public function setTitle($title); + +{% endif %} +{% if created_base_field %} + /** + * Gets the {{ entity_type_label|lower }} creation timestamp. + * + * @return int + * Creation timestamp of the {{ entity_type_label|lower }}. + */ + public function getCreatedTime(); + + /** + * Sets the {{ entity_type_label|lower }} creation timestamp. + * + * @param int $timestamp + * The {{ entity_type_label|lower }} creation timestamp. + * + * @return \Drupal\{{ machine_name }}\{{ class_prefix }}Interface + * The called {{ entity_type_label|lower }} entity. + */ + public function setCreatedTime($timestamp); + +{% endif %} +{% if status_base_field %} + /** + * Returns the {{ entity_type_label|lower }} status. + * + * @return bool + * TRUE if the {{ entity_type_label|lower }} is enabled, FALSE otherwise. + */ + public function isEnabled(); + + /** + * Sets the {{ entity_type_label|lower }} status. + * + * @param bool $status + * TRUE to enable this {{ entity_type_label|lower }}, FALSE to disable. + * + * @return \Drupal\{{ machine_name }}\{{ class_prefix }}Interface + * The called {{ entity_type_label|lower }} entity. + */ + public function setStatus($status); + +{% endif %} +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleListBuilder.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleListBuilder.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..a82b03dc95176492ad1406cc399bdfd2e39ffede --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleListBuilder.php.twig @@ -0,0 +1,139 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityListBuilder; +use Drupal\Core\Datetime\DateFormatterInterface; +use Drupal\Core\Entity\EntityStorageInterface; +use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Routing\RedirectDestinationInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Provides a list controller for the {{ entity_type_label|lower }} entity type. + */ +class {{ class_prefix }}ListBuilder extends EntityListBuilder { + + /** + * The date formatter service. + * + * @var \Drupal\Core\Datetime\DateFormatterInterface + */ + protected $dateFormatter; + + /** + * The redirect destination service. + * + * @var \Drupal\Core\Routing\RedirectDestinationInterface + */ + protected $redirectDestination; + + /** + * Constructs a new {{ class_prefix }}ListBuilder object. + * + * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type + * The entity type definition. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter + * The date formatter service. + * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination + * The redirect destination service. + */ + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, DateFormatterInterface $date_formatter, RedirectDestinationInterface $redirect_destination) { + parent::__construct($entity_type, $storage); + $this->dateFormatter = $date_formatter; + $this->redirectDestination = $redirect_destination; + } + + /** + * {@inheritdoc} + */ + public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { + return new static( + $entity_type, + $container->get('entity_type.manager')->getStorage($entity_type->id()), + $container->get('date.formatter'), + $container->get('redirect.destination') + ); + } + + /** + * {@inheritdoc} + */ + public function render() { + $build['table'] = parent::render(); + + $total = $this->getStorage() + ->getQuery() + ->count() + ->execute(); + + $build['summary']['#markup'] = $this->t('Total {{ entity_type_label|lower|plural }}: @total', ['@total' => $total]); + return $build; + } + + /** + * {@inheritdoc} + */ + public function buildHeader() { + $header['id'] = $this->t('ID'); +{% if title_base_field %} + $header['title'] = $this->t('Title'); +{% endif %} +{% if status_base_field %} + $header['status'] = $this->t('Status'); +{% endif %} +{% if author_base_field %} + $header['uid'] = $this->t('Author'); +{% endif %} +{% if created_base_field %} + $header['created'] = $this->t('Created'); +{% endif %} +{% if changed_base_field %} + $header['changed'] = $this->t('Updated'); +{% endif %} + return $header + parent::buildHeader(); + } + + /** + * {@inheritdoc} + */ + public function buildRow(EntityInterface $entity) { + /* @var $entity \Drupal\{{ machine_name }}\{{ class_prefix }}Interface */ + $row['id'] = $entity->{{ title_base_field ? 'id' : 'link' }}(); +{% if title_base_field %} + $row['title'] = $entity->toLink(); +{% endif %} +{% if status_base_field %} + $row['status'] = $entity->isEnabled() ? $this->t('Enabled') : $this->t('Disabled'); +{% endif %} +{% if author_base_field %} + $row['uid']['data'] = [ + '#theme' => 'username', + '#account' => $entity->getOwner(), + ]; +{% endif %} +{% if created_base_field %} + $row['created'] = $this->dateFormatter->format($entity->getCreatedTime()); +{% endif %} +{% if changed_base_field %} + $row['changed'] = $this->dateFormatter->format($entity->getChangedTime()); +{% endif %} + return $row + parent::buildRow($entity); + } + + /** + * {@inheritdoc} + */ + protected function getDefaultOperations(EntityInterface $entity) { + $operations = parent::getDefaultOperations($entity); + $destination = $this->redirectDestination->getAsArray(); + foreach ($operations as $key => $operation) { + $operations[$key]['query'] = $destination; + } + return $operations; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleTypeListBuilder.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleTypeListBuilder.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..03aeca5c1998510e953bc1002baaa78fe370932a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleTypeListBuilder.php.twig @@ -0,0 +1,51 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; +use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Url; + +/** + * Defines a class to build a listing of {{ entity_type_label|lower }} type entities. + * + * @see \Drupal\{{ machine_name }}\Entity\{{ class_prefix }}Type + */ +class {{ class_prefix }}TypeListBuilder extends ConfigEntityListBuilder { + + /** + * {@inheritdoc} + */ + public function buildHeader() { + $header['title'] = $this->t('Label'); + + return $header + parent::buildHeader(); + } + + /** + * {@inheritdoc} + */ + public function buildRow(EntityInterface $entity) { + $row['title'] = [ + 'data' => $entity->label(), + 'class' => ['menu-label'], + ]; + + return $row + parent::buildRow($entity); + } + + /** + * {@inheritdoc} + */ + public function render() { + $build = parent::render(); + + $build['table']['#empty'] = $this->t( + 'No {{ entity_type_label|lower }} types available. <a href=":link">Add {{ entity_type_label|lower }} type</a>.', + [':link' => Url::fromRoute('entity.{{ entity_type_id }}_type.add_form')->toString()] + ); + + return $build; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleViewBuilder.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleViewBuilder.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..389abfbd6b4b85f85b578da8687f45a3d799ffda --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/ExampleViewBuilder.php.twig @@ -0,0 +1,23 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityViewBuilder; + +/** + * Provides a view controller for {{ entity_type_label|article|lower }} entity type. + */ +class {{ class_prefix }}ViewBuilder extends EntityViewBuilder { + + /** + * {@inheritdoc} + */ + protected function getBuildDefaults(EntityInterface $entity, $view_mode) { + $build = parent::getBuildDefaults($entity, $view_mode); + // The {{ entity_type_label|lower }} has no entity template itself. + unset($build['#theme']); + return $build; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleForm.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleForm.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..51aeccd41d5b164b392c73373f5932c9db1b2e4c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleForm.php.twig @@ -0,0 +1,37 @@ +<?php + +namespace Drupal\{{ machine_name }}\Form; + +use Drupal\Core\Entity\ContentEntityForm; +use Drupal\Core\Form\FormStateInterface; + +/** + * Form controller for the {{ entity_type_label|lower }} entity edit forms. + */ +class {{ class_prefix }}Form extends ContentEntityForm { + + /** + * {@inheritdoc} + */ + public function save(array $form, FormStateInterface $form_state) { + + $entity = $this->getEntity(); + $result = $entity->save(); + $link = $entity->toLink($this->t('View'))->toRenderable(); + + $message_arguments = ['%label' => $this->entity->label()]; + $logger_arguments = $message_arguments + ['link' => render($link)]; + + if ($result == SAVED_NEW) { + $this->messenger()->addStatus($this->t('New {{ entity_type_label|lower }} %label has been created.', $message_arguments)); + $this->logger('{{ machine_name }}')->notice('Created new {{ entity_type_label|lower }} %label', $logger_arguments); + } + else { + $this->messenger()->addStatus($this->t('The {{ entity_type_label|lower }} %label has been updated.', $message_arguments)); + $this->logger('{{ machine_name }}')->notice('Updated new {{ entity_type_label|lower }} %label.', $logger_arguments); + } + + $form_state->setRedirect('entity.{{ entity_type_id }}.canonical', ['{{ entity_type_id }}' => $entity->id()]); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleSettingsForm.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleSettingsForm.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..e767f3c83617659490f172208e97206b575af494 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleSettingsForm.php.twig @@ -0,0 +1,48 @@ +<?php + +namespace Drupal\{{ machine_name }}\Form; + +use Drupal\Core\Form\FormBase; +use Drupal\Core\Form\FormStateInterface; + +/** + * Configuration form for {{ entity_type_label|article|lower }} entity type. + */ +class {{ class_prefix }}SettingsForm extends FormBase { + + /** + * {@inheritdoc} + */ + public function getFormId() { + return '{{ entity_type_id }}_settings'; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + + $form['settings'] = [ + '#markup' => $this->t('Settings form for {{ entity_type_label|article|lower }} entity type.'), + ]; + + $form['actions'] = [ + '#type' => 'actions', + ]; + + $form['actions']['submit'] = [ + '#type' => 'submit', + '#value' => $this->t('Save'), + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->messenger()->addStatus($this->t('The configuration has been updated.')); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleTypeForm.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleTypeForm.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..f329344e5d56a7e1c8ca9141f046f440be0aa6e1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleTypeForm.php.twig @@ -0,0 +1,87 @@ +<?php + +namespace Drupal\{{ machine_name }}\Form; + +use Drupal\Core\Entity\BundleEntityFormBase; +use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Form\FormStateInterface; + +/** + * Form handler for {{ entity_type_label|lower }} type forms. + */ +class {{ class_prefix }}TypeForm extends BundleEntityFormBase { + + /** + * {@inheritdoc} + */ + public function form(array $form, FormStateInterface $form_state) { + $form = parent::form($form, $form_state); + + $entity_type = $this->entity; + if ($this->operation == 'add') { + $form['#title'] = $this->t('Add {{ entity_type_label|lower }} type'); + } + else { + $form['#title'] = $this->t( + 'Edit %label {{ entity_type_label|lower }} type', + ['%label' => $entity_type->label()] + ); + } + + $form['label'] = [ + '#title' => $this->t('Label'), + '#type' => 'textfield', + '#default_value' => $entity_type->label(), + '#description' => $this->t('The human-readable name of this {{ entity_type_label|lower }} type.'), + '#required' => TRUE, + '#size' => 30, + ]; + + $form['id'] = [ + '#type' => 'machine_name', + '#default_value' => $entity_type->id(), + '#maxlength' => EntityTypeInterface::BUNDLE_MAX_LENGTH, + '#machine_name' => [ + 'exists' => ['Drupal\{{ machine_name }}\Entity\{{ class_prefix }}Type', 'load'], + 'source' => ['label'], + ], + '#description' => $this->t('A unique machine-readable name for this {{ entity_type_label|lower }} type. It must only contain lowercase letters, numbers, and underscores.'), + ]; + + return $this->protectBundleIdElement($form); + } + + /** + * {@inheritdoc} + */ + protected function actions(array $form, FormStateInterface $form_state) { + $actions = parent::actions($form, $form_state); + $actions['submit']['#value'] = $this->t('Save {{ entity_type_label|lower }} type'); + $actions['delete']['#value'] = $this->t('Delete {{ entity_type_label|lower }} type'); + return $actions; + } + + /** + * {@inheritdoc} + */ + public function save(array $form, FormStateInterface $form_state) { + $entity_type = $this->entity; + + $entity_type->set('id', trim($entity_type->id())); + $entity_type->set('label', trim($entity_type->label())); + + $status = $entity_type->save(); + + $t_args = ['%name' => $entity_type->label()]; + if ($status == SAVED_UPDATED) { + $message = $this->t('The {{ entity_type_label|lower }} type %name has been updated.', $t_args); + } + elseif ($status == SAVED_NEW) { + $message = $this->t('The {{ entity_type_label|lower }} type %name has been added.', $t_args); + } + $this->messenger()->addStatus($message); + + $form_state->setRedirectUrl($entity_type->toUrl('collection')); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/templates/model-example.html.twig.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/templates/model-example.html.twig.twig new file mode 100644 index 0000000000000000000000000000000000000000..e88cf237e3ca3d3e256e972e8bf5689f1ff70b6e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/templates/model-example.html.twig.twig @@ -0,0 +1,21 @@ +{{ '{#' }} +/** + * @file + * Default theme implementation to present {{ entity_type_label|article|lower }} entity. + * + * This template is used when viewing a registered {{ entity_type_label|lower }}'s page, + * e.g., {{ entity_base_path }})/123. 123 being the {{ entity_type_label|lower }}'s ID. + * + * Available variables: + * - content: A list of content items. Use 'content' to print all content, or + * print a subset such as 'content.title'. + * - attributes: HTML attributes for the container element. + * + * @see template_preprocess_{{ entity_type_id }}() + */ +{{ '#}' }}{% verbatim %} +<article{{ attributes }}> + {% if content %} + {{- content -}} + {% endif %} +</article>{% endverbatim %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/model.services.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/model.services.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..65d61f802b6bbad28b36b8610128b532542f519b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/model.services.yml.twig @@ -0,0 +1,4 @@ +services: + plugin.manager.{{ plugin_type }}: + class: Drupal\{{ machine_name }}\{{ class_prefix }}PluginManager + parent: default_plugin_manager diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/Annotation/Example.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/Annotation/Example.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..6dd2134c156924d31b2446a487ba678b477cbdea --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/Annotation/Example.php.twig @@ -0,0 +1,39 @@ +<?php + +namespace Drupal\{{ machine_name }}\Annotation; + +use Drupal\Component\Annotation\Plugin; + +/** + * Defines {{ plugin_type }} annotation object. + * + * @Annotation + */ +class {{ class_prefix }} extends Plugin { + + /** + * The plugin ID. + * + * @var string + */ + public $id; + + /** + * The human-readable name of the plugin. + * + * @var \Drupal\Core\Annotation\Translation + * + * @ingroup plugin_translatable + */ + public $title; + + /** + * The description of the plugin. + * + * @var \Drupal\Core\Annotation\Translation + * + * @ingroup plugin_translatable + */ + public $description; + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExampleInterface.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExampleInterface.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..c15879d0cb6e46f6b817af1572da4077f35e2887 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExampleInterface.php.twig @@ -0,0 +1,18 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +/** + * Interface for {{ plugin_type }} plugins. + */ +interface {{ class_prefix }}Interface { + + /** + * Returns the translated plugin label. + * + * @return string + * The translated title. + */ + public function label(); + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExamplePluginBase.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExamplePluginBase.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..9a08bc5d2b6a33ce2fa46d4fa5a5f9d6aa6670c5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExamplePluginBase.php.twig @@ -0,0 +1,20 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Component\Plugin\PluginBase; + +/** + * Base class for {{ plugin_type }} plugins. + */ +abstract class {{ class_prefix }}PluginBase extends PluginBase implements {{ class_prefix }}Interface { + + /** + * {@inheritdoc} + */ + public function label() { + // Cast the label to a string since it is a TranslatableMarkup object. + return (string) $this->pluginDefinition['label']; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExamplePluginManager.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExamplePluginManager.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..e498a3eefebfc3295d12b7516de0b92e6c2a7b98 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/ExamplePluginManager.php.twig @@ -0,0 +1,37 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Plugin\DefaultPluginManager; + +/** + * {{ class_prefix }} plugin manager. + */ +class {{ class_prefix }}PluginManager extends DefaultPluginManager { + + /** + * Constructs {{ class_prefix }}PluginManager object. + * + * @param \Traversable $namespaces + * An object that implements \Traversable which contains the root paths + * keyed by the corresponding namespace to look for plugin implementations. + * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend + * Cache backend instance to use. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler to invoke the alter hook with. + */ + public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { + parent::__construct( + 'Plugin/{{ class_prefix }}', + $namespaces, + $module_handler, + 'Drupal\{{ machine_name }}\{{ class_prefix }}Interface', + 'Drupal\{{ machine_name }}\Annotation\{{ class_prefix }}' + ); + $this->alterInfo('{{ plugin_type }}_info'); + $this->setCacheBackend($cache_backend, '{{ plugin_type }}_plugins'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/Plugin/Example/Foo.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/Plugin/Example/Foo.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..b1e31e1ed5ce9da51546441a8d3bc357ef8a2f1b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/annotation/src/Plugin/Example/Foo.php.twig @@ -0,0 +1,18 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\{{ class_prefix }}; + +use Drupal\{{ machine_name }}\{{ class_prefix }}PluginBase; + +/** + * Plugin implementation of the {{ plugin_type }}. + * + * @{{ class_prefix }}( + * id = "foo", + * label = @Translation("Foo"), + * description = @Translation("Foo description.") + * ) + */ +class Foo extends {{ class_prefix }}PluginBase { + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/model.module.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/model.module.twig new file mode 100644 index 0000000000000000000000000000000000000000..1d671d21f3a74039128e08dbc65eff5f396f43e8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/model.module.twig @@ -0,0 +1,17 @@ +/** + * Implements hook_{{ plugin_type }}_info(). + */ +function {{ machine_name }}_{{ plugin_type }}_info() { + return [ + 'foo' => [ + 'id' => 'foo', + 'label' => t('Foo'), + 'description' => t('Foo description.'), + ], + 'bar' => [ + 'id' => 'bar', + 'label' => t('Bar'), + 'description' => t('Bar description.'), + ], + ]; +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/model.services.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/model.services.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..87c0e73914c5a80de74a3277d57b4acf848b1c2f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/model.services.yml.twig @@ -0,0 +1,4 @@ +services: + plugin.manager.{{ plugin_type }}: + class: Drupal\{{ machine_name }}\{{ class_prefix }}PluginManager + arguments: ['@module_handler', '@cache.discovery'] diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExampleDefault.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExampleDefault.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..508e5cd50e14b77bd332d46ecc397bc6c5f0904d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExampleDefault.php.twig @@ -0,0 +1,20 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Plugin\PluginBase; + +/** + * Default class used for {{ plugin_type|plural }} plugins. + */ +class {{ class_prefix }}Default extends PluginBase implements {{ class_prefix }}Interface { + + /** + * {@inheritdoc} + */ + public function label() { + // The title from hook discovery may be a TranslatableMarkup object. + return (string) $this->pluginDefinition['label']; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExampleInterface.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExampleInterface.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..c15879d0cb6e46f6b817af1572da4077f35e2887 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExampleInterface.php.twig @@ -0,0 +1,18 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +/** + * Interface for {{ plugin_type }} plugins. + */ +interface {{ class_prefix }}Interface { + + /** + * Returns the translated plugin label. + * + * @return string + * The translated title. + */ + public function label(); + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExamplePluginManager.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExamplePluginManager.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..a8acb83e4a6f9d0e45b25726cccf39117f3ea875 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/hook/src/ExamplePluginManager.php.twig @@ -0,0 +1,59 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Plugin\DefaultPluginManager; +use Drupal\Core\Plugin\Discovery\HookDiscovery; +use Drupal\Core\Plugin\Factory\ContainerFactory; + +/** + * Defines a plugin manager to deal with {{ plugin_type|plural }}. + * + * @see \Drupal\{{ machine_name }}\{{ class_prefix }}Default + * @see \Drupal\{{ machine_name }}\{{ class_prefix }}Interface + * @see plugin_api + */ +class {{ class_prefix }}PluginManager extends DefaultPluginManager { + + /** + * {@inheritdoc} + */ + protected $defaults = [ + // The {{ plugin_type }} id. Set by the plugin system based on the array key. + 'id' => '', + // The {{ plugin_type }} label. + 'label' => '', + // The {{ plugin_type }} description. + 'description' => '', + // Default plugin class. + 'class' => 'Drupal\{{ machine_name }}\{{ class_prefix }}Default', + ]; + + /** + * Constructs {{ class_prefix }}PluginManager object. + * + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler to invoke the alter hook with. + * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend + * Cache backend instance to use. + */ + public function __construct(ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend) { + $this->factory = new ContainerFactory($this); + $this->moduleHandler = $module_handler; + $this->alterInfo('{{ plugin_type }}_info'); + $this->setCacheBackend($cache_backend, '{{ plugin_type }}_plugins'); + } + + /** + * {@inheritdoc} + */ + protected function getDiscovery() { + if (!isset($this->discovery)) { + $this->discovery = new HookDiscovery($this->moduleHandler, '{{ plugin_type }}_info'); + } + return $this->discovery; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/model.examples.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/model.examples.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..a06f3d036d317309b90066a3862bbbb3a7b95a76 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/model.examples.yml.twig @@ -0,0 +1,9 @@ +foo_1: + label: 'Foo 1' + description: 'Plugin description.' +foo_2: + label: 'Foo 2' + description: 'Plugin description.' +foo_3: + label: 'Foo 3' + description: 'Plugin description.' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/model.services.yml.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/model.services.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..87c0e73914c5a80de74a3277d57b4acf848b1c2f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/model.services.yml.twig @@ -0,0 +1,4 @@ +services: + plugin.manager.{{ plugin_type }}: + class: Drupal\{{ machine_name }}\{{ class_prefix }}PluginManager + arguments: ['@module_handler', '@cache.discovery'] diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExampleDefault.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExampleDefault.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..51975264274739eb601dd076afdf913fb5010ae0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExampleDefault.php.twig @@ -0,0 +1,20 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Plugin\PluginBase; + +/** + * Default class used for {{ plugin_type|plural }} plugins. + */ +class {{ class_prefix }}Default extends PluginBase implements {{ class_prefix }}Interface { + + /** + * {@inheritdoc} + */ + public function label() { + // The title from YAML file discovery may be a TranslatableMarkup object. + return (string) $this->pluginDefinition['label']; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExampleInterface.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExampleInterface.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..c15879d0cb6e46f6b817af1572da4077f35e2887 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExampleInterface.php.twig @@ -0,0 +1,18 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +/** + * Interface for {{ plugin_type }} plugins. + */ +interface {{ class_prefix }}Interface { + + /** + * Returns the translated plugin label. + * + * @return string + * The translated title. + */ + public function label(); + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExamplePluginManager.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExamplePluginManager.php.twig new file mode 100644 index 0000000000000000000000000000000000000000..f8ff705bc7b975e8a9bf5947601344962ee5d2c7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin-manager/yaml/src/ExamplePluginManager.php.twig @@ -0,0 +1,70 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Plugin\DefaultPluginManager; +use Drupal\Core\Plugin\Discovery\YamlDiscovery; +use Drupal\Core\Plugin\Factory\ContainerFactory; + +/** + * Defines a plugin manager to deal with {{ plugin_type|plural }}. + * + * Modules can define {{ plugin_type|plural }} in a MODULE_NAME.{{ plugin_type|plural }}.yml file contained + * in the module's base directory. Each {{ plugin_type }} has the following structure: + * + * @code + * MACHINE_NAME: + * label: STRING + * description: STRING + * @endcode + * + * @see \Drupal\{{ machine_name }}\{{ class_prefix }}Default + * @see \Drupal\{{ machine_name }}\{{ class_prefix }}Interface + * @see plugin_api + */ +class {{ class_prefix }}PluginManager extends DefaultPluginManager { + + /** + * {@inheritdoc} + */ + protected $defaults = [ + // The {{ plugin_type }} id. Set by the plugin system based on the top-level YAML key. + 'id' => '', + // The {{ plugin_type }} label. + 'label' => '', + // The {{ plugin_type }} description. + 'description' => '', + // Default plugin class. + 'class' => 'Drupal\{{ machine_name }}\{{ class_prefix }}Default', + ]; + + /** + * Constructs {{ class_prefix }}PluginManager object. + * + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler to invoke the alter hook with. + * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend + * Cache backend instance to use. + */ + public function __construct(ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend) { + $this->factory = new ContainerFactory($this); + $this->moduleHandler = $module_handler; + $this->alterInfo('{{ plugin_type }}_info'); + $this->setCacheBackend($cache_backend, '{{ plugin_type }}_plugins'); + } + + /** + * {@inheritdoc} + */ + protected function getDiscovery() { + if (!isset($this->discovery)) { + $this->discovery = new YamlDiscovery('{{ plugin_type|plural }}', $this->moduleHandler->getModuleDirectories()); + $this->discovery->addTranslatableProperty('label', 'label_context'); + $this->discovery->addTranslatableProperty('description', 'description_context'); + } + return $this->discovery; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/ckeditor.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/ckeditor.twig new file mode 100644 index 0000000000000000000000000000000000000000..b12884a89560bf93568d0f1545b261f2b6ed7361 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/ckeditor.twig @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\CKEditorPlugin; + +use Drupal\ckeditor\CKEditorPluginBase; +use Drupal\editor\Entity\Editor; + +/** + * Defines the "{{ plugin_label }}" plugin. + * + * @CKEditorPlugin( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}"), + * module = "{{ machine_name }}" + * ) + */ +class {{ class }} extends CKEditorPluginBase { + + /** + * {@inheritdoc} + */ + public function getFile() { + return drupal_get_path('module', '{{ machine_name }}') . '/js/plugins/{{ short_plugin_id }}/plugin.js'; + } + + /** + * {@inheritdoc} + */ + public function getConfig(Editor $editor) { + return []; + } + + /** + * {@inheritdoc} + */ + public function getButtons() { + $module_path = drupal_get_path('module', '{{ machine_name }}'); + return [ + '{{ short_plugin_id }}' => [ + 'label' => $this->t('{{ plugin_label }}'), + 'image' => $module_path . '/js/plugins/{{ short_plugin_id }}/icons/{{ short_plugin_id }}.png', + ], + ]; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/dialog.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/dialog.twig new file mode 100644 index 0000000000000000000000000000000000000000..dfdbdc352da18380bd5a9d32561e4ff4ed8b2212 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/dialog.twig @@ -0,0 +1,70 @@ +/** + * @file + * Defines dialog for {{ plugin_label }} CKEditor plugin. + */ +(function (Drupal) { + + 'use strict'; + + // Dialog definition. + CKEDITOR.dialog.add('{{ command_name }}Dialog', function(editor) { + + return { + + // Basic properties of the dialog window: title, minimum size. + title: Drupal.t('Abbreviation properties'), + minWidth: 400, + minHeight: 150, + + // Dialog window content definition. + contents: [ + { + // Definition of the settings dialog tab. + id: 'tab-settings', + label: 'Settings', + + // The tab content. + elements: [ + { + // Text input field for the abbreviation text. + type: 'text', + id: 'abbr', + label: Drupal.t('Abbreviation'), + + // Validation checking whether the field is not empty. + validate: CKEDITOR.dialog.validate.notEmpty(Drupal.t('Abbreviation field cannot be empty.')) + }, + { + // Text input field for the abbreviation title (explanation). + type: 'text', + id: 'title', + label: Drupal.t('Explanation'), + validate: CKEDITOR.dialog.validate.notEmpty(Drupal.t('Explanation field cannot be empty.')) + } + ] + } + ], + + // This method is invoked once a user clicks the OK button, confirming the + // dialog. + onOk: function() { + + // The context of this function is the dialog object itself. + // See http://docs.ckeditor.com/#!/api/CKEDITOR.dialog. + var dialog = this; + + // Create a new <abbr> element. + var abbr = editor.document.createElement('abbr'); + + // Set element attribute and text by getting the defined field values. + abbr.setAttribute('title', dialog.getValueOf('tab-settings', 'title')); + abbr.setText( dialog.getValueOf('tab-settings', 'abbr')); + + // Finally, insert the element into the editor at the caret position. + editor.insertElement(abbr); + } + }; + + }); + +} (Drupal)); diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/icon.png b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5148ccf86569139fcf6dd9a1a5c82293ff776e34 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/icon.png @@ -0,0 +1,4 @@ +�PNG + +��� IHDR�����������a���bKGD������������� pHYs�������o�d���IDAT8˥��J#A�����H�$,�[����E�B��g���,yOK�(�\�SH� �tWW���6{���������+ +!����5R����J��t: k-"�b�������i������1<??J�ү�o��9�h4bcc#����(��v���r~~�h4�i���jq||���l6��x8������9���n��V�_��"�Z����s�f3NNN���f���`������$I�1��d�����"�����1�R��t:e>�g1����z��� ��$I��`���鉏#n4���ZU��ZB���;;;��4&"�f3���QU�s�i� ���yyy!���>#��f=P�%A���� @�P ��S.��T*�r9677��gey�WZ�ι�9"���!��>���~�T��Z�����~}}��rxx�6~yyI�X,x{{CD�!(�xﹹ�YKB ��6���Ƙo�������p�}]^��u����:e�����IEND�B`� \ No newline at end of file diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/plugin.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/plugin.twig new file mode 100644 index 0000000000000000000000000000000000000000..663f104f72e1b26d839794fe513facd53e27a6db --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/plugin.twig @@ -0,0 +1,44 @@ +/** + * @file + * {{ plugin_label }} CKEditor plugin. + * + * Basic plugin inserting abbreviation elements into the CKEditor editing area. + * + * @DCG The code is based on an example from CKEditor Plugin SDK tutorial. + * + * @see http://docs.ckeditor.com/#!/guide/plugin_sdk_sample_1 + */ +(function (Drupal) { + + 'use strict'; + + CKEDITOR.plugins.add('{{ plugin_id }}', { + + // Register the icons. + icons: '{{ short_plugin_id }}', + + // The plugin initialization logic goes inside this method. + init: function(editor) { + + // Define an editor command that opens our dialog window. + editor.addCommand('{{ command_name }}', new CKEDITOR.dialogCommand('{{ command_name }}Dialog')); + + // Create a toolbar button that executes the above command. + editor.ui.addButton('{{ short_plugin_id }}', { + + // The text part of the button (if available) and the tooltip. + label: Drupal.t('Insert abbreviation'), + + // The command to execute on click. + command: '{{ command_name }}', + + // The button placement in the toolbar (toolbar group name). + toolbar: 'insert' + }); + + // Register our dialog file, this.path is the plugin folder path. + CKEDITOR.dialog.add('{{ command_name }}Dialog', this.path + 'dialogs/{{ short_plugin_id }}.js'); + } + }); + +} (Drupal)); diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/action-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/action-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..b4edf27b0cac493f3f045fa58ed46270af4ee911 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/action-schema.twig @@ -0,0 +1,7 @@ +action.configuration.{{ plugin_id }}: + type: mapping + label: 'Configuration for "{{ plugin_label }}" action' + mapping: + title: + type: string + label: Title diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/action.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/action.twig new file mode 100644 index 0000000000000000000000000000000000000000..6b5f5c96d185c3ba29df97f34c0b113332197873 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/action.twig @@ -0,0 +1,80 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Action; + +{% if configurable %} +use Drupal\Core\Action\ConfigurableActionBase; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Session\AccountInterface; +{% else %} +use Drupal\Core\Action\ActionBase; +use Drupal\Core\Session\AccountInterface; +{% endif %} + +/** + * Provides a {{ plugin_label|article }} action. + * + * @Action( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}"), + * type = "node", + * category = @Translation("{{ category }}") + * ) + * + * @DCG + * For a simple updating entity fields consider extending FieldUpdateActionBase. + */ +class {{ class }} extends {{ configurable ? 'ConfigurableActionBase' : 'ActionBase' }} { + +{% if configurable %} + /** + * {@inheritdoc} + */ + public function defaultConfiguration() { + return ['title' => '']; + } + + /** + * {@inheritdoc} + */ + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { + $form['title'] = [ + '#title' => $this->t('New title'), + '#type' => 'textfield', + '#required' => TRUE, + '#default_value' => $this->configuration['title'], + ]; + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { + $this->configuration['title'] = $form_state->getValue('title'); + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function access($node, AccountInterface $account = NULL, $return_as_object = FALSE) { + /** @var \Drupal\node\NodeInterface $node */ + $access = $node->access('update', $account, TRUE) + ->andIf($node->title->access('edit', $account, TRUE)); + return $return_as_object ? $access : $access->isAllowed(); + } + + /** + * {@inheritdoc} + */ + public function execute($node = NULL) { + /** @var \Drupal\node\NodeInterface $node */ +{% if configurable %} + $node->setTitle($this->configuration['title'])->save(); +{% else %} + $node->setTitle($this->t('New title'))->save(); +{% endif %} + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/block-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/block-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..866de58b4d8a2e1d7182259ef30443057092f3ba --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/block-schema.twig @@ -0,0 +1,7 @@ +block.settings.{{ plugin_id }}: + type: block_settings + label: '{{ plugin_label }} block' + mapping: + foo: + type: string + label: Foo diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/block.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/block.twig new file mode 100644 index 0000000000000000000000000000000000000000..ab96052a9058961bc3013375114761109976d614 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/block.twig @@ -0,0 +1,119 @@ +{% import 'lib/di.twig' as di %} +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Block; + +{% sort %} + {% if access %} +use Drupal\Core\Access\AccessResult; +use Drupal\Core\Session\AccountInterface; + {% endif %} +use Drupal\Core\Block\BlockBase; + {% if configurable %} +use Drupal\Core\Form\FormStateInterface; + {% endif %} + {% if services %} +{{ di.use(services) }} +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + {% endif %} +{% endsort %} + +/** + * Provides {{ plugin_label|article|lower }} block. + * + * @Block( + * id = "{{ plugin_id }}", + * admin_label = @Translation("{{ plugin_label }}"), + * category = @Translation("{{ category }}") + * ) + */ +class {{ class }} extends BlockBase {% if services %}implements ContainerFactoryPluginInterface {% endif %}{ + +{% if services %} +{{ di.properties(services) }} + + /** + * Constructs a new {{ class }} instance. + * + * @param array $configuration + * The plugin configuration, i.e. an array with configuration values keyed + * by configuration option name. The special key 'context' may be used to + * initialize the defined contexts by setting it to an array of context + * values keyed by context names. + * @param string $plugin_id + * The plugin_id for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. +{{ di.annotation(services) }} + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, {{ di.signature(services) }}) { + parent::__construct($configuration, $plugin_id, $plugin_definition); +{{ di.assignment(services) }} + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, +{{ di.container(services) }} + ); + } + +{% endif %} +{% if configurable %} + /** + * {@inheritdoc} + */ + public function defaultConfiguration() { + return [ + 'foo' => $this->t('Hello world!'), + ]; + } + + /** + * {@inheritdoc} + */ + public function blockForm($form, FormStateInterface $form_state) { + $form['foo'] = [ + '#type' => 'textarea', + '#title' => $this->t('Foo'), + '#default_value' => $this->configuration['foo'], + ]; + return $form; + } + + /** + * {@inheritdoc} + */ + public function blockSubmit($form, FormStateInterface $form_state) { + $this->configuration['foo'] = $form_state->getValue('foo'); + } + +{% endif %} +{% if access %} + /** + * {@inheritdoc} + */ + protected function blockAccess(AccountInterface $account) { + // @DCG Evaluate the access condition here. + $condition = TRUE; + return AccessResult::allowedIf($condition); + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function build() { + $build['content'] = [ + '#markup' => $this->t('It works!'), + ]; + return $build; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/condition-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/condition-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..fa08f5be8c020f11520415409ecb409336c1940e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/condition-schema.twig @@ -0,0 +1,7 @@ +condition.plugin.{{ plugin_id }}: + type: condition.plugin + label: '{{ plugin_label }} condition' + mapping: + age: + type: integer + label: Age diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/condition.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/condition.twig new file mode 100644 index 0000000000000000000000000000000000000000..52d5098473cec900a4757a654ec02b4f23fca0c9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/condition.twig @@ -0,0 +1,131 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Condition; + +use Drupal\Component\Datetime\TimeInterface; +use Drupal\Core\Condition\ConditionPluginBase; +use Drupal\Core\Datetime\DateFormatterInterface; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Provides a '{{ plugin_label }}' condition. + * + * @Condition( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}"), + * context_definitions = { + * "node" = @ContextDefinition( + * "entity:node", + * label = @Translation("Node") + * ) + * } + * ) + * + * @DCG prior to Drupal 8.7 the 'context_definitions' key was called 'context'. + */ +class {{ class }} extends ConditionPluginBase implements ContainerFactoryPluginInterface { + + /** + * The date formatter. + * + * @var \Drupal\Core\Datetime\DateFormatterInterface + */ + protected $dateFormatter; + + /** + * The time service. + * + * @var \Drupal\Component\Datetime\TimeInterface + */ + protected $time; + + /** + * Creates a new {{ class }} instance. + * + * @param array $configuration + * The plugin configuration, i.e. an array with configuration values keyed + * by configuration option name. The special key 'context' may be used to + * initialize the defined contexts by setting it to an array of context + * values keyed by context names. + * @param string $plugin_id + * The plugin_id for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter + * The date formatter. + * @param \Drupal\Component\Datetime\TimeInterface $time + * The time service. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatterInterface $date_formatter, TimeInterface $time) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->dateFormatter = $date_formatter; + $this->time = $time; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('date.formatter'), + $container->get('datetime.time') + ); + } + + /** + * {@inheritdoc} + */ + public function defaultConfiguration() { + return ['age' => NULL] + parent::defaultConfiguration(); + } + + /** + * {@inheritdoc} + */ + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { + + $form['age'] = [ + '#title' => $this->t('Node age, sec'), + '#type' => 'number', + '#min' => 0, + '#default_value' => $this->configuration['age'], + ]; + + return parent::buildConfigurationForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { + $this->configuration['age'] = $form_state->getValue('age'); + parent::submitConfigurationForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function summary() { + return $this->t( + 'Node age: @age', + ['@age' => $this->dateFormatter->formatInterval($this->configuration['age'])] + ); + } + + /** + * {@inheritdoc} + */ + public function evaluate() { + if (!$this->configuration['age'] && !$this->isNegated()) { + return TRUE; + } + $age = $this->time->getRequestTime() - $this->getContextValue('node')->getCreatedTime(); + return $age < $this->configuration['age']; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/constraint-validator.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/constraint-validator.twig new file mode 100644 index 0000000000000000000000000000000000000000..5537908e95b9a999597bdbbe8d9e592d6cfac1ef --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/constraint-validator.twig @@ -0,0 +1,62 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Validation\Constraint; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; + +/** + * Validates the {{ plugin_label }} constraint. + */ +class {{ class }}Validator extends ConstraintValidator { + + /** + * {@inheritdoc} + */ +{% if input_type == 'entity' %} + public function validate($entity, Constraint $constraint) { + + // @DCG Validate the entity here. + if ($entity->label() == 'foo') { + $this->context->buildViolation($constraint->errorMessage) + // @DCG The path depends on entity type. It can be title, name, etc. + ->atPath('title') + ->addViolation(); + } + + } +{% elseif input_type == 'item_list' %} + public function validate($items, Constraint $constraint) { + + foreach ($items as $delta => $item) { + // @DCG Validate the item here. + if ($item->value == 'foo') { + $this->context->buildViolation($constraint->errorMessage) + ->atPath($delta) + ->addViolation(); + } + } + + } +{% elseif input_type == 'item' %} + public function validate($item, Constraint $constraint) { + + $value = $item->getValue()['value']; + // @DCG Validate the value here. + if ($value == 'foo') { + $this->context->addViolation($constraint->errorMessage); + } + + } +{% else %} + public function validate($value, Constraint $constraint) { + + // @DCG Validate the value here. + if ($value == 'foo') { + $this->context->addViolation($constraint->errorMessage); + } + + } +{% endif %} + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/constraint.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/constraint.twig new file mode 100644 index 0000000000000000000000000000000000000000..97dd76b27c6f03c331d6cf28b1fce6a9fc2cdf53 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/constraint.twig @@ -0,0 +1,35 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Validation\Constraint; + +use Symfony\Component\Validator\Constraint; + +/** + * Provides {{ plugin_label|article }} constraint. + * + * @Constraint( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}", context = "Validation"), + * ) +{% if input_type == 'entity' %} + * + * @DCG + * To apply this constraint on a particular field implement + * hook_entity_type_build(). +{% elseif input_type == 'item_list' %} + * + * @DCG + * To apply this constraint on third party entity types implement either + * hook_entity_base_field_info_alter() or hook_entity_bundle_field_info_alter(). +{% elseif input_type == 'item' %} + * + * @DCG + * To apply this constraint on third party field types. Implement + * hook_field_info_alter(). +{% endif %} + */ +class {{ class }} extends Constraint { + + public $errorMessage = 'The error message.'; + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/entity-reference-selection-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/entity-reference-selection-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..c8cf867366f6124936a390307293ac86714567c3 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/entity-reference-selection-schema.twig @@ -0,0 +1,10 @@ +entity_reference_selection.{{ plugin_id }}: +{# User selection plugin provides has some additional options. #} + type: entity_reference_selection.default{{ entity_type == 'user' ? ':user' }} + label: '{{ plugin_label }} handler settings' +{% if configurable %} + mapping: + foo: + type: string + label: Foo +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/entity-reference-selection.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/entity-reference-selection.twig new file mode 100644 index 0000000000000000000000000000000000000000..296fba0c2cbbb0c192414b2fea08d4bff74dcd2e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/entity-reference-selection.twig @@ -0,0 +1,68 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\EntityReferenceSelection; + +{% sort %} +{% if configurable %} +use Drupal\Core\Form\FormStateInterface; +{% endif %} +use {{ base_class_full }}; +{% endsort %} + +/** + * Plugin description. + * + * @EntityReferenceSelection( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}"), + * group = "{{ plugin_id }}", + * entity_types = {"{{ entity_type }}"}, + * weight = 0 + * ) + */ +class {{ class }} extends {{ base_class }} { + +{% if configurable %} + /** + * {@inheritdoc} + */ + public function defaultConfiguration() { + + $default_configuration = [ + 'foo' => 'bar', + ]; + + return $default_configuration + parent::defaultConfiguration(); + } + + /** + * {@inheritdoc} + */ + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { + $form = parent::buildConfigurationForm($form, $form_state); + + $form['foo'] = [ + '#type' => 'textfield', + '#title' => $this->t('Foo'), + '#default_value' => $this->configuration['foo'], + ]; + + return $form; + } + +{% endif %} + /** + * {@inheritdoc} + */ + protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') { + $query = parent::buildEntityQuery($match, $match_operator); + + // @DCG + // Here you can apply addition conditions, sorting, etc to the query. + // Also see self::entityQueryAlter(). + $query->condition('field_example', 123); + + return $query; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/formatter-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/formatter-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..24087a35250e28bfc883d8c5948c883cb99d38cb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/formatter-schema.twig @@ -0,0 +1,7 @@ +field.formatter.settings.{{ plugin_id }}: + type: mapping + label: {{ plugin_label }} formatter settings + mapping: + foo: + type: string + label: Foo diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/formatter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/formatter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d92203d1b87cbedfac1b9ec5ba79a7428a18e6e2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/formatter.twig @@ -0,0 +1,72 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Field\FieldFormatter; + +use Drupal\Core\Field\FieldItemListInterface; +use Drupal\Core\Field\FormatterBase; +{% if configurable %} +use Drupal\Core\Form\FormStateInterface; +{% endif %} + +/** + * Plugin implementation of the '{{ plugin_label }}' formatter. + * + * @FieldFormatter( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}"), + * field_types = { + * "string" + * } + * ) + */ +class {{ class }} extends FormatterBase { + +{% if configurable %} + /** + * {@inheritdoc} + */ + public static function defaultSettings() { + return [ + 'foo' => 'bar', + ] + parent::defaultSettings(); + } + + /** + * {@inheritdoc} + */ + public function settingsForm(array $form, FormStateInterface $form_state) { + + $elements['foo'] = [ + '#type' => 'textfield', + '#title' => $this->t('Foo'), + '#default_value' => $this->getSetting('foo'), + ]; + + return $elements; + } + + /** + * {@inheritdoc} + */ + public function settingsSummary() { + $summary[] = $this->t('Foo: @foo', ['@foo' => $this->getSetting('foo')]); + return $summary; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function viewElements(FieldItemListInterface $items, $langcode) { + $element = []; + + foreach ($items as $delta => $item) { + $element[$delta] = [ + '#markup' => $item->value, + ]; + } + + return $element; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/type-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/type-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..55d10652015e2cf854d6227432a665dee39eb638 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/type-schema.twig @@ -0,0 +1,27 @@ +{% if configurable_storage %} +field.storage_settings.{{ plugin_id }}: + type: mapping + label: {{ plugin_label }} storage settings + mapping: + foo: + type: string + label: Foo + +{% endif %} +{% if configurable_instance %} +field.field_settings.{{ plugin_id }}: + type: mapping + label: {{ plugin_label }} field settings + mapping: + bar: + type: string + label: Bar + +{% endif %} +field.value.{{ plugin_id }}: + type: mapping + label: Default value + mapping: + value: + type: label + label: Value diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/type.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/type.twig new file mode 100644 index 0000000000000000000000000000000000000000..2a65f89c3267ed1996a0de2b942ad8f71b33e0e4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/type.twig @@ -0,0 +1,154 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Field\FieldType; + +use Drupal\Component\Utility\Random; +use Drupal\Core\Field\FieldDefinitionInterface; +use Drupal\Core\Field\FieldItemBase; +use Drupal\Core\Field\FieldStorageDefinitionInterface; +{% if configurable_storage or configurable_instance %} +use Drupal\Core\Form\FormStateInterface; +{% endif %} +use Drupal\Core\TypedData\DataDefinition; + +/** + * Defines the '{{ plugin_id }}' field type. + * + * @FieldType( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}"), + * category = @Translation("General"), + * default_widget = "string_textfield", + * default_formatter = "string" + * ) + * + * @DCG + * If you are implementing a single value field type you may want to inherit + * this class form some of the field type classes provided by Drupal core. + * Check out /core/lib/Drupal/Core/Field/Plugin/Field/FieldType directory for a + * list of available field type implementations. + */ +class {{ class }} extends FieldItemBase { + +{% if configurable_storage %} + /** + * {@inheritdoc} + */ + public static function defaultStorageSettings() { + $settings = ['foo' => 'wine']; + return $settings + parent::defaultStorageSettings(); + } + + /** + * {@inheritdoc} + */ + public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data) { + + $element['foo'] = [ + '#type' => 'textfield', + '#title' => $this->t('Foo'), + '#default_value' => $this->getSetting('foo'), + '#disabled' => $has_data, + ]; + + return $element; + } + +{% endif %} +{% if configurable_instance %} + /** + * {@inheritdoc} + */ + public static function defaultFieldSettings() { + $settings = ['bar' => 'beer']; + return $settings + parent::defaultFieldSettings(); + } + + /** + * {@inheritdoc} + */ + public function fieldSettingsForm(array $form, FormStateInterface $form_state) { + + $element['bar'] = [ + '#type' => 'textfield', + '#title' => $this->t('Bar'), + '#default_value' => $this->getSetting('bar'), + ]; + + return $element; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function isEmpty() { + $value = $this->get('value')->getValue(); + return $value === NULL || $value === ''; + } + + /** + * {@inheritdoc} + */ + public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + + // @DCG + // See /core/lib/Drupal/Core/TypedData/Plugin/DataType directory for + // available data types. + $properties['value'] = DataDefinition::create('string') + ->setLabel(t('Text value')) + ->setRequired(TRUE); + + return $properties; + } + + /** + * {@inheritdoc} + */ + public function getConstraints() { + $constraints = parent::getConstraints(); + + $constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager(); + + // @DCG Suppose our value must not be longer than 10 characters. + $options['value']['Length']['max'] = 10; + + // @DCG + // See /core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint + // directory for available constraints. + $constraints[] = $constraint_manager->create('ComplexData', $options); + return $constraints; + } + + /** + * {@inheritdoc} + */ + public static function schema(FieldStorageDefinitionInterface $field_definition) { + + $columns = [ + 'value' => [ + 'type' => 'varchar', + 'not null' => FALSE, + 'description' => 'Column description.', + 'length' => 255, + ], + ]; + + $schema = [ + 'columns' => $columns, + // @DCG Add indexes here if necessary. + ]; + + return $schema; + } + + /** + * {@inheritdoc} + */ + public static function generateSampleValue(FieldDefinitionInterface $field_definition) { + $random = new Random(); + $values['value'] = $random->word(mt_rand(1, 50)); + return $values; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/widget-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/widget-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..2c98edbdc8417b9cd81f5ccb89a76b4185d30d0b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/widget-schema.twig @@ -0,0 +1,7 @@ +field.widget.settings.{{ plugin_id }}: + type: mapping + label: {{ plugin_label }} widget settings + mapping: + foo: + type: string + label: Foo diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/widget.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/widget.twig new file mode 100644 index 0000000000000000000000000000000000000000..5089c302f2e86cebc7313f81ed501121b4ccf733 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/field/widget.twig @@ -0,0 +1,66 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Field\FieldWidget; + +use Drupal\Core\Field\FieldItemListInterface; +use Drupal\Core\Field\WidgetBase; +use Drupal\Core\Form\FormStateInterface; + +/** + * Defines the '{{ plugin_id }}' field widget. + * + * @FieldWidget( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}"), + * field_types = {"string"}, + * ) + */ +class {{ class }} extends WidgetBase { + +{% if configurable %} + /** + * {@inheritdoc} + */ + public static function defaultSettings() { + return [ + 'foo' => 'bar', + ] + parent::defaultSettings(); + } + + /** + * {@inheritdoc} + */ + public function settingsForm(array $form, FormStateInterface $form_state) { + + $element['foo'] = [ + '#type' => 'textfield', + '#title' => $this->t('Foo'), + '#default_value' => $this->getSetting('foo'), + ]; + + return $element; + } + + /** + * {@inheritdoc} + */ + public function settingsSummary() { + $summary[] = $this->t('Foo: @foo', ['@foo' => $this->getSetting('foo')]); + return $summary; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { + + $element['value'] = $element + [ + '#type' => 'textfield', + '#default_value' => isset($items[$delta]->value) ? $items[$delta]->value : NULL, + ]; + + return $element; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/filter-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/filter-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..83dec2bac220c6ab91cad0d202a90d881567eb53 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/filter-schema.twig @@ -0,0 +1,7 @@ +filter_settings.{{ plugin_id }}: + type: filter + label: '{{ plugin_label }} filter' + mapping: + example: + type: string + label: Example diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/filter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/filter.twig new file mode 100644 index 0000000000000000000000000000000000000000..d080e2bc675a9ad61308d1bb52388a1ca4309e06 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/filter.twig @@ -0,0 +1,54 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Filter; + +use Drupal\Core\Form\FormStateInterface; +use Drupal\filter\FilterProcessResult; +use Drupal\filter\Plugin\FilterBase; + +/** + * Provides a '{{ plugin_label }}' filter. + * + * @Filter( + * id = "{{ plugin_id }}", + * title = @Translation("{{ plugin_label }}"), + * type = Drupal\filter\Plugin\FilterInterface::{{ filter_type }}, + * settings = { + * "example" = "foo", + * }, + * weight = -10 + * ) + */ +class {{ class }} extends FilterBase { + + /** + * {@inheritdoc} + */ + public function settingsForm(array $form, FormStateInterface $form_state) { + $form['example'] = [ + '#type' => 'textfield', + '#title' => $this->t('Example'), + '#default_value' => $this->settings['example'], + '#description' => $this->t('Description of the setting.'), + ]; + return $form; + } + + /** + * {@inheritdoc} + */ + public function process($text, $langcode) { + // @DCG Process text here. + $example = $this->settings['example']; + $text = str_replace($example, "<b>$example</b>", $text); + return new FilterProcessResult($text); + } + + /** + * {@inheritdoc} + */ + public function tips($long = FALSE) { + return $this->t('Some filter tips here.'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/menu-link.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/menu-link.twig new file mode 100644 index 0000000000000000000000000000000000000000..560e99fa442990f67ac550cf7295c4da0d3f060f --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/menu-link.twig @@ -0,0 +1,77 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\Menu; + +use Drupal\Core\Database\Connection; +use Drupal\Core\Menu\MenuLinkDefault; +use Drupal\Core\Menu\StaticMenuLinkOverridesInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * A menu link that displays count of messages. + */ +class {{ class }} extends MenuLinkDefault { + + /** + * The database connection. + * + * @var \Drupal\Core\Database\Connection + */ + protected $dbConnection; + + /** + * Constructs the plugin object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * The plugin_id for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\Core\Menu\StaticMenuLinkOverridesInterface $static_override + * The static override storage. + * @param \Drupal\Core\Database\Connection $db_connection + * The database connection. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, StaticMenuLinkOverridesInterface $static_override, Connection $db_connection) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $static_override); + $this->dbConnection = $db_connection; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('menu_link.static.overrides'), + $container->get('database') + ); + } + + /** + * {@inheritdoc} + */ + public function getTitle() { + $count = $this->dbConnection->query('SELECT COUNT(*) FROM {messages}')->fetchField(); + return $this->t('Messages (@count)', ['@count' => $count]); + } + + /** + * {@inheritdoc} + */ + public function getRouteName() { + return '{{ machine_name }}.messages'; + } + + /** + * {@inheritdoc} + */ + public function getCacheTags() { + // @DCG Invalidate this tags when messages are created or removed. + return ['{{ machine_name }}.messages_count']; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/destination.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/destination.twig new file mode 100644 index 0000000000000000000000000000000000000000..78664e35b2ad1794b8fbb3748ea7eaab83aef607 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/destination.twig @@ -0,0 +1,101 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\migrate\destination; + +use Drupal\Core\Database\Connection; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\migrate\Plugin\migrate\destination\DestinationBase; +use Drupal\migrate\Plugin\MigrationInterface; +use Drupal\migrate\Row; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * The '{{ plugin_id }}' destination plugin. + * + * @MigrateDestination( + * id = "{{ plugin_id }}" + * ) + */ +class {{ class }} extends DestinationBase implements ContainerFactoryPluginInterface { + + /** + * The database connection. + * + * @var \Drupal\Core\Database\Connection + */ + protected $connection; + + /** + * Constructs the plugin. + * + * @param array $configuration + * Plugin configuration. + * @param string $plugin_id + * The plugin ID. + * @param mixed $plugin_definition + * The plugin definition. + * @param \Drupal\migrate\Plugin\MigrationInterface $migration + * The current migration. + * @param \Drupal\Core\Database\Connection $connection + * The database connection. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, Connection $connection) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $migration); + $this->connection = $connection; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $migration, + $container->get('database') + ); + } + + /** + * {@inheritdoc} + */ + public function import(Row $row, array $old_destination_id_values = []) { + + // Save the row to custom table. + $this->connection + ->insert('example') + ->fields([ + 'id' => $row->getDestinationProperty('id'), + 'name' => $row->getDestinationProperty('name'), + 'status' => $row->getDestinationProperty('status'), + ]) + ->execute(); + + return [$row->getDestinationProperty('id')]; + } + + /** + * {@inheritdoc} + */ + public function getIds() { + $ids['id']['type'] = [ + 'type' => 'integer', + 'unsigned' => TRUE, + 'size' => 'big', + ]; + return $ids; + } + + /** + * {@inheritdoc} + */ + public function fields(MigrationInterface $migration = NULL) { + return [ + 'id' => $this->t('The record ID.'), + 'name' => $this->t('The record name.'), + 'status' => $this->t('The record status'), + ]; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/process.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/process.twig new file mode 100644 index 0000000000000000000000000000000000000000..4b01043538a6fe3924fe6c82674d118c26821b3c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/process.twig @@ -0,0 +1,79 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\migrate\process; + +use Drupal\Component\Transliteration\TransliterationInterface; +use Drupal\Core\Language\LanguageInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\migrate\MigrateExecutableInterface; +use Drupal\migrate\ProcessPluginBase; +use Drupal\migrate\Row; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Provides {{ plugin_id|article }} plugin. + * + * Usage: + * + * @code + * process: + * bar: + * plugin: {{ plugin_id }} + * source: foo + * @endcode + * + * @MigrateProcessPlugin( + * id = "{{ plugin_id }}" + * ) + * + * @DCG + * ContainerFactoryPluginInterface is optional here. If you have no need for + * external services just remove it and all other stuff except transform() + * method. + */ +class {{ class }} extends ProcessPluginBase implements ContainerFactoryPluginInterface { + + /** + * The transliteration service. + * + * @var \Drupal\Component\Transliteration\TransliterationInterface + */ + protected $transliteration; + + /** + * Constructs {{ class|article }} plugin. + * + * @param array $configuration + * The plugin configuration. + * @param string $plugin_id + * The plugin ID. + * @param mixed $plugin_definition + * The plugin definition. + * @param \Drupal\Component\Transliteration\TransliterationInterface $transliteration + * The transliteration service. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, TransliterationInterface $transliteration) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->transliteration = $transliteration; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('transliteration') + ); + } + + /** + * {@inheritdoc} + */ + public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { + return $this->transliteration->transliterate($value, LanguageInterface::LANGCODE_DEFAULT); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/source.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/source.twig new file mode 100644 index 0000000000000000000000000000000000000000..4dfb24d80321b340d9ef7f5e7da4e2f4c3a7d19a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/migrate/source.twig @@ -0,0 +1,112 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\migrate\source; + +use Drupal\migrate\Plugin\migrate\source\{{ base_class }}; +use Drupal\migrate\Row; + +/** + * The '{{ plugin_id }}' source plugin. + * + * @MigrateSource( + * id = "{{ plugin_id }}", + * source_module = "{{ machine_name }}" + * ) + */ +class {{ class }} extends {{ base_class }} { + +{% if source_type == 'sql' %} + /** + * {@inheritdoc} + */ + public function query() { + $query = $this->select('example', 'e') + ->fields('e', ['id', 'name', 'status']); + return $query; + } + +{% else %} + /** + * {@inheritdoc} + */ + public function __toString() { + // @DCG You may return something meaningful here. + return ''; + } + + /** + * {@inheritdoc} + */ + protected function initializeIterator() { + + // @DCG + // In this example we return a hardcoded set of records. + // + // For large sets of data consider using generators like follows: + // @code + // foreach ($foo->nextRecord() as $record) { + // yield $record; + // } + // @endcode + $records = [ + [ + 'id' => 1, + 'name' => 'Alpha', + 'status' => TRUE, + ], + [ + 'id' => 2, + 'name' => 'Beta', + 'status' => FALSE, + ], + [ + 'id' => 3, + 'name' => 'Gamma', + 'status' => TRUE, + ], + ]; + + return new \ArrayIterator($records); + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function fields() { + return [ + 'id' => $this->t('The record ID.'), + 'name' => $this->t('The record name.'), + 'status' => $this->t('The record status'), + ]; + } + + /** + * {@inheritdoc} + */ + public function getIds() { + $ids['id']['type'] = [ + 'type' => 'integer', + 'unsigned' => TRUE, + 'size' => 'big', + ]; + return $ids; + } + + /** + * {@inheritdoc} + */ + public function prepareRow(Row $row) { + + // @DCG + // Extend/modify the row here if needed. + // + // Example: + // @code + // $name = $row->getSourceProperty('name'); + // $row->setSourceProperty('name', Html::escape('$name'); + // @endcode + return parent::prepareRow($row); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/queue-worker.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/queue-worker.twig new file mode 100644 index 0000000000000000000000000000000000000000..50a26ae986ccc35d9172ae2b54fe5e8981a073a4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/queue-worker.twig @@ -0,0 +1,25 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\QueueWorker; + +use Drupal\Core\Queue\QueueWorkerBase; + +/** + * Defines '{{ plugin_id }}' queue worker. + * + * @QueueWorker( + * id = "{{ plugin_id }}", + * title = @Translation("{{ plugin_label }}"), + * cron = {"time" = 60} + * ) + */ +class {{ class }} extends QueueWorkerBase { + + /** + * {@inheritdoc} + */ + public function processItem($data) { + // @todo Process data here. + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/rest-resource.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/rest-resource.twig new file mode 100644 index 0000000000000000000000000000000000000000..6c20fa2403fc0b141cb3f78ed5537b6475277ef1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/rest-resource.twig @@ -0,0 +1,316 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\rest\resource; + +use Drupal\Component\Plugin\DependentPluginInterface; +use Drupal\Core\Database\Connection; +use Drupal\Core\Routing\BcRoute; +use Drupal\rest\ModifiedResourceResponse; +use Drupal\rest\Plugin\ResourceBase; +use Drupal\rest\ResourceResponse; +use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; + +/** + * Represents {{ plugin_label }} records as resources. + * + * @RestResource ( + * id = "{{ plugin_id }}", + * label = @Translation("{{ plugin_label }}"), + * uri_paths = { + * "canonical" = "/api/{{ plugin_id|u2h }}/{id}", + * "https://www.drupal.org/link-relations/create" = "/api/{{ plugin_id|u2h }}" + * } + * ) + * + * @DCG + * This plugin exposes database records as REST resources. In order to enable it + * import the resource configuration into active configuration storage. You may + * find an example of such configuration in the following file: + * core/modules/rest/config/optional/rest.resource.entity.node.yml. + * Alternatively you can make use of REST UI module. + * @see https://www.drupal.org/project/restui + * For accessing Drupal entities through REST interface use + * \Drupal\rest\Plugin\rest\resource\EntityResource plugin. + */ +class {{ class }} extends ResourceBase implements DependentPluginInterface { + + /** + * The database connection. + * + * @var \Drupal\Core\Database\Connection + */ + protected $dbConnection; + + /** + * Constructs a Drupal\rest\Plugin\rest\resource\EntityResource object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * The plugin_id for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param array $serializer_formats + * The available serialization formats. + * @param \Psr\Log\LoggerInterface $logger + * A logger instance. + * @param \Drupal\Core\Database\Connection $db_connection + * The database connection. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, array $serializer_formats, LoggerInterface $logger, Connection $db_connection) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer_formats, $logger); + $this->dbConnection = $db_connection; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->getParameter('serializer.formats'), + $container->get('logger.factory')->get('rest'), + $container->get('database') + ); + } + + /** + * Responds to GET requests. + * + * @param int $id + * The ID of the record. + * + * @return \Drupal\rest\ResourceResponse + * The response containing the record. + * + * @throws \Symfony\Component\HttpKernel\Exception\HttpException + */ + public function get($id) { + return new ResourceResponse($this->loadRecord($id)); + } + + /** + * Responds to POST requests and saves the new record. + * + * @param mixed $record + * Data to write into the database. + * + * @return \Drupal\rest\ModifiedResourceResponse + * The HTTP response object. + */ + public function post($record) { + + $this->validate($record); + + $id = $this->dbConnection->insert('{{ plugin_id }}') + ->fields($record) + ->execute(); + + $this->logger->notice('New {{ plugin_label|lower }} record has been created.'); + + $created_record = $this->loadRecord($id); + + // Return the newly created record in the response body. + return new ModifiedResourceResponse($created_record, 201); + } + + /** + * Responds to entity PATCH requests. + * + * @param int $id + * The ID of the record. + * @param mixed $record + * Data to write into the database. + * + * @return \Drupal\rest\ModifiedResourceResponse + * The HTTP response object. + */ + public function patch($id, $record) { + $this->validate($record); + return $this->updateRecord($id, $record); + } + + /** + * Responds to entity PUT requests. + * + * @param int $id + * The ID of the record. + * @param mixed $record + * Data to write into the database. + * + * @return \Drupal\rest\ModifiedResourceResponse + * The HTTP response object. + */ + public function put($id, $record) { + + $this->validate($record); + + // Provide default values to make sure the record is completely replaced. + $record += [ + 'title' => '', + 'description' => '', + 'price' => 0, + ]; + + return $this->updateRecord($id, $record); + } + + /** + * Responds to entity DELETE requests. + * + * @param int $id + * The ID of the record. + * + * @return \Drupal\rest\ModifiedResourceResponse + * The HTTP response object. + * + * @throws \Symfony\Component\HttpKernel\Exception\HttpException + */ + public function delete($id) { + + // Make sure the record still exists. + $this->loadRecord($id); + + $this->dbConnection->delete('{{ plugin_id }}') + ->condition('id', $id) + ->execute(); + + $this->logger->notice('{{ plugin_label }} record @id has been deleted.', ['@id' => $id]); + + // Deleted responses have an empty body. + return new ModifiedResourceResponse(NULL, 204); + } + + /** + * {@inheritdoc} + */ + protected function getBaseRoute($canonical_path, $method) { + $route = parent::getBaseRoute($canonical_path, $method); + + // Change ID validation pattern. + if ($method != 'POST') { + $route->setRequirement('id', '\d+'); + } + + return $route; + } + + /** + * {@inheritdoc} + */ + public function calculateDependencies() { + return []; + } + + /** + * {@inheritdoc} + */ + public function routes() { + $collection = parent::routes(); + + // ResourceBase class does not support PUT method by some reason. + $definition = $this->getPluginDefinition(); + $canonical_path = $definition['uri_paths']['canonical']; + $route = $this->getBaseRoute($canonical_path, 'PUT'); + $route->addRequirements(['_content_type_format' => implode('|', $this->serializerFormats)]); + $collection->add('{{ plugin_id }}.PUT', $route); + + // Take out BC routes added in base class. + // @see https://www.drupal.org/node/2865645 + // @todo Remove this in Drupal 9. + foreach ($collection as $route_name => $route) { + if ($route instanceof BcRoute) { + $collection->remove($route_name); + } + } + + return $collection; + } + + /** + * Validates incoming record. + * + * @param mixed $record + * Data to validate. + * + * @throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException + */ + protected function validate($record) { + if (!is_array($record) || count($record) == 0) { + throw new BadRequestHttpException('No record content received.'); + } + + $allowed_fields = [ + 'title', + 'description', + 'price', + ]; + + if (count(array_diff(array_keys($record), $allowed_fields)) > 0) { + throw new BadRequestHttpException('Record structure is not correct.'); + } + + if (empty($record['title'])) { + throw new BadRequestHttpException('Title is required.'); + } + elseif (isset($record['title']) && strlen($record['title']) > 255) { + throw new BadRequestHttpException('Title is too big.'); + } + // @DCG Add more validation rules here. + } + + /** + * Loads record from database. + * + * @param int $id + * The ID of the record. + * + * @return array + * The database record. + * + * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException + */ + protected function loadRecord($id) { + $record = $this->dbConnection->query('SELECT * FROM {{ '{' }}{{ plugin_id }}{{ '}' }} WHERE id = :id', [':id' => $id])->fetchAssoc(); + if (!$record) { + throw new NotFoundHttpException('The record was not found.'); + } + return $record; + } + + /** + * Updates record. + * + * @param int $id + * The ID of the record. + * @param array $record + * The record to validate. + * + * @return \Drupal\rest\ModifiedResourceResponse + * The HTTP response object. + */ + protected function updateRecord($id, array $record) { + + // Make sure the record already exists. + $this->loadRecord($id); + + $this->validate($record); + + $this->dbConnection->update('{{ plugin_id }}') + ->fields($record) + ->condition('id', $id) + ->execute(); + + $this->logger->notice('{{ plugin_label }} record @id has been updated.', ['@id' => $id]); + + // Return the updated record in the response body. + $updated_record = $this->loadRecord($id); + return new ModifiedResourceResponse($updated_record, 200); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/argument-default-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/argument-default-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..c5d2bef05f88921c49e3a9242a309214707b86b5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/argument-default-schema.twig @@ -0,0 +1,7 @@ +views.argument_default.{{ plugin_id }}: + type: mapping + label: '{{ plugin_label }}' + mapping: + example: + type: string + label: 'Example' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/argument-default.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/argument-default.twig new file mode 100644 index 0000000000000000000000000000000000000000..95625c6c147374dca5227fa3c2f3cc45e91ae343 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/argument-default.twig @@ -0,0 +1,116 @@ +{% import 'lib/di.twig' as di %} +<?php + +namespace Drupal\{{ machine_name }}\Plugin\views\argument_default; + +{% sort %} +use Drupal\Core\Cache\Cache; +use Drupal\Core\Cache\CacheableDependencyInterface; + {% if configurable %} +use Drupal\Core\Form\FormStateInterface; + {% endif %} +use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase; + {% if services %} +{{ di.use(services) }} +use Symfony\Component\DependencyInjection\ContainerInterface; + {% endif %} +{% endsort %} + +/** + * {{ plugin_label }} argument default plugin. + * + * @ViewsArgumentDefault( + * id = "{{ plugin_id }}", + * title = @Translation("{{ plugin_label }}") + * ) + */ +class {{ class }} extends ArgumentDefaultPluginBase implements CacheableDependencyInterface { + +{% if services %} +{{ di.properties(services) }} + + /** + * Constructs a new {{ class }} instance. + * + * @param array $configuration + * The plugin configuration, i.e. an array with configuration values keyed + * by configuration option name. The special key 'context' may be used to + * initialize the defined contexts by setting it to an array of context + * values keyed by context names. + * @param string $plugin_id + * The plugin_id for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. +{{ di.annotation(services) }} + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, {{ di.signature(services) }}) { + parent::__construct($configuration, $plugin_id, $plugin_definition); +{{ di.assignment(services) }} + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, +{{ di.container(services) }} + ); + } + +{% endif %} +{% if configurable %} + /** + * {@inheritdoc} + */ + protected function defineOptions() { + $options = parent::defineOptions(); + $options['example'] = ['default' => '']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state) { + $form['example'] = [ + '#type' => 'textfield', + '#title' => $this->t('Example'), + '#default_value' => $this->options['example'], + ]; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function getArgument() { + + // @DCG + // Here is the place where you should create a default argument for the + // contextual filter. The source of this argument depends on your needs. + // For example, you can extract the value from the URL or fetch it from + // some fields of the current viewed entity. + $argument = 123; + + return $argument; + } + + /** + * {@inheritdoc} + */ + public function getCacheMaxAge() { + return Cache::PERMANENT; + } + + /** + * {@inheritdoc} + */ + public function getCacheContexts() { + // @DCG Use 'url' context if the argument comes from URL. + return []; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/field-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/field-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..98756a0a006799fc38f38f0d867d7f36c2f92fce --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/field-schema.twig @@ -0,0 +1,7 @@ +views.field.{{ plugin_id }}: + type: views.field.field + label: '{{ plugin_label }}' + mapping: + example: + type: string + label: 'Example' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/field.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/field.twig new file mode 100644 index 0000000000000000000000000000000000000000..36b797073136578ffc76105eedb401754e6d4eed --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/field.twig @@ -0,0 +1,98 @@ +{% import 'lib/di.twig' as di %} +<?php + +namespace Drupal\{{ machine_name }}\Plugin\views\field; + +{% sort %} +use Drupal\views\Plugin\views\field\FieldPluginBase; +use Drupal\views\ResultRow; + {% if configurable %} +use Drupal\Core\Form\FormStateInterface; + {% endif %} + {% if services %} +{{ di.use(services) }} +use Symfony\Component\DependencyInjection\ContainerInterface; + {% endif %} +{% endsort %} + +/** + * Provides {{ plugin_label }} field handler. + * + * @ViewsField("{{ plugin_id }}") + * + * @DCG + * The plugin needs to be assigned to a specific table column through + * hook_views_data() or hook_views_data_alter(). + * For non-existent columns (i.e. computed fields) you need to override + * self::query() method. + */ +class {{ class }} extends FieldPluginBase { + +{% if services %} +{{ di.properties(services) }} + + /** + * Constructs a new {{ class }} instance. + * + * @param array $configuration + * The plugin configuration, i.e. an array with configuration values keyed + * by configuration option name. The special key 'context' may be used to + * initialize the defined contexts by setting it to an array of context + * values keyed by context names. + * @param string $plugin_id + * The plugin_id for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. +{{ di.annotation(services) }} + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, {{ di.signature(services) }}) { + parent::__construct($configuration, $plugin_id, $plugin_definition); +{{ di.assignment(services) }} + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, +{{ di.container(services) }} + ); + } + +{% endif %} +{% if configurable %} + /** + * {@inheritdoc} + */ + protected function defineOptions() { + $options = parent::defineOptions(); + $options['example'] = ['default' => '']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state) { + parent::buildOptionsForm($form, $form_state); + $form['example'] = [ + '#type' => 'textfield', + '#title' => $this->t('Example'), + '#default_value' => $this->options['example'], + ]; + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function render(ResultRow $values) { + $value = parent::render($values); + // @DCG Modify or replace the rendered value here. + return $value; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-plugin.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-plugin.twig new file mode 100644 index 0000000000000000000000000000000000000000..7b9f7968caf0d793b99f8f9c3ca97db37edd85e8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-plugin.twig @@ -0,0 +1,57 @@ +<?php + +namespace Drupal\{{ machine_name }}\Plugin\views\style; + +{% if configurable %} +use Drupal\Core\Form\FormStateInterface; +{% endif %} +use Drupal\views\Plugin\views\style\StylePluginBase; + +/** + * {{ plugin_label }} style plugin. + * + * @ViewsStyle( + * id = "{{ plugin_id }}", + * title = @Translation("{{ plugin_label }}"), + * help = @Translation("Foo style plugin help."), + * theme = "views_style_{{ plugin_id }}", + * display_types = {"normal"} + * ) + */ +class {{ class }} extends StylePluginBase { + + /** + * {@inheritdoc} + */ + protected $usesRowPlugin = TRUE; + + /** + * {@inheritdoc} + */ + protected $usesRowClass = TRUE; + +{% if configurable %} + /** + * {@inheritdoc} + */ + protected function defineOptions() { + $options = parent::defineOptions(); + $options['wrapper_class'] = ['default' => 'item-list']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state) { + parent::buildOptionsForm($form, $form_state); + $form['wrapper_class'] = [ + '#title' => $this->t('Wrapper class'), + '#description' => $this->t('The class to provide on the wrapper, outside rows.'), + '#type' => 'textfield', + '#default_value' => $this->options['wrapper_class'], + ]; + } + +{% endif %} +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-preprocess.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-preprocess.twig new file mode 100644 index 0000000000000000000000000000000000000000..4f77ad745c70f282c34c4b2dc87be98c471abb9b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-preprocess.twig @@ -0,0 +1,27 @@ +use Drupal\Core\Template\Attribute; + +/** + * Prepares variables for views-style-{{ plugin_id|u2h }}.html.twig template. + */ +function template_preprocess_views_style_{{ plugin_id }}(&$variables) { + + $view = $variables['view']; + $options = $view->style_plugin->options; + +{% if configurable %} + // Fetch wrapper classes from handler options. + if ($options['wrapper_class']) { + $variables['attributes']['class'] = explode(' ', $options['wrapper_class']); + } + +{% endif %} + $variables['default_row_class'] = $options['default_row_class']; + foreach ($variables['rows'] as $id => $row) { + $variables['rows'][$id] = []; + $variables['rows'][$id]['content'] = $row; + $variables['rows'][$id]['attributes'] = new Attribute(); + if ($row_class = $view->style_plugin->getRowClass($id)) { + $variables['rows'][$id]['attributes']->addClass($row_class); + } + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..af3316dc1180844ebdd99e17fc5ec911402845b0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-schema.twig @@ -0,0 +1,7 @@ +views.style.{{ plugin_id }}: + type: views_style + label: '{{ plugin_label }}' + mapping: + wrapper_class: + type: string + label: Wrapper class diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-template.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-template.twig new file mode 100644 index 0000000000000000000000000000000000000000..57ae2339eb8602136e0c381616c2d79dbcc01abc --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/views/style-template.twig @@ -0,0 +1,27 @@ +{{ '{#' }} +/** + * @file + * Default theme implementation for a view template to display a list of rows. + * + * Available variables: + * - attributes: HTML attributes for the container. + * - rows: A list of rows. + * - attributes: The row's HTML attributes. + * - content: The row's contents. + * - title: The title of this group of rows. May be empty. + * + * @see template_preprocess_views_style_{{ plugin_id }}() + */ +{{ '#}' }}{% verbatim %} +<div{{ attributes }}> + {% + set row_classes = [ + default_row_class ? 'views-row', + ] + %} + {% for row in rows %} + <div{{ row.attributes.addClass(row_classes) }}> + {{ row.content }} + </div> + {% endfor %} +</div>{% endverbatim %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/render-element.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/render-element.twig new file mode 100644 index 0000000000000000000000000000000000000000..66c2856ce142df1796e90ad789ed4f02947da6bd --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/render-element.twig @@ -0,0 +1,70 @@ +<?php + +namespace Drupal\{{ machine_name }}\Element; + +use Drupal\Core\Render\Element\RenderElement; + +/** + * Provides a render element to display an entity. + * + * Properties: + * - #entity_type: The entity type. + * - #entity_id: The entity ID. + * - #view_mode: The view mode that should be used to render the entity. + * - #langcode: For which language the entity should be rendered. + * + * Usage Example: + * @code + * $build['node'] = [ + * '#type' => 'entity', + * '#entity_type' => 'node', + * '#entity_id' => 1, + * '#view_mode' => 'teaser, + * '#langcode' => 'en', + * ]; + * @endcode + * + * @RenderElement("entity") + */ +class Entity extends RenderElement { + + /** + * {@inheritdoc} + */ + public function getInfo() { + return [ + '#pre_render' => [ + [get_class($this), 'preRenderEntityElement'], + ], + '#view_mode' => 'full', + '#langcode' => NULL, + ]; + } + + /** + * Entity element pre render callback. + * + * @param array $element + * An associative array containing the properties of the entity element. + * + * @return array + * The modified element. + */ + public static function preRenderEntityElement(array $element) { + + $entity_type_manager = \Drupal::entityTypeManager(); + + $entity = $entity_type_manager + ->getStorage($element['#entity_type']) + ->load($element['#entity_id']); + + if ($entity && $entity->access('view')) { + $element['entity'] = $entity_type_manager + ->getViewBuilder($element['#entity_type']) + ->view($entity, $element['#view_mode'], $element['#langcode']); + } + + return $element; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service-provider.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service-provider.twig new file mode 100644 index 0000000000000000000000000000000000000000..c55af934b14f20865749ffd51b868b8e67708322 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service-provider.twig @@ -0,0 +1,35 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\DependencyInjection\ContainerBuilder; +use Drupal\Core\DependencyInjection\ServiceProviderBase; +use Symfony\Component\DependencyInjection\Reference; + +/** + * Defines a service provider for the {{ name }} module. + */ +class {{ class }} extends ServiceProviderBase { + + /** + * {@inheritdoc} + */ + public function register(ContainerBuilder $container) { + $container->register('{{ machine_name }}.subscriber', 'Drupal\{{ machine_name }}\EventSubscriber\{{ machine_name|camelize }}Subscriber') + ->addTag('event_subscriber') + ->addArgument(new Reference('entity_type.manager')); + } + + /** + * {@inheritdoc} + */ + public function alter(ContainerBuilder $container) { + $modules = $container->getParameter('container.modules'); + if (isset($modules['dblog'])) { + // Override default DB logger to exclude some unwanted log messages. + $container->getDefinition('logger.dblog') + ->setClass('Drupal\{{ machine_name }}\Logger\{{ machine_name|camelize }}Log'); + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/access-checker.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/access-checker.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..f5cce419497053b2d039537ce662da6a873dbbdb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/access-checker.services.twig @@ -0,0 +1,5 @@ +services: + access_check.{{ machine_name }}.{{ applies_to|trim('_') }}: + class: Drupal\{{ machine_name }}\Access\{{ class }} + tags: + - { name: access_check, applies_to: {{ applies_to }} } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/access-checker.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/access-checker.twig new file mode 100644 index 0000000000000000000000000000000000000000..c585ed380f27e78f9135c4077ce4fc2c4b5376be --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/access-checker.twig @@ -0,0 +1,33 @@ +<?php + +namespace Drupal\{{ machine_name }}\Access; + +use Drupal\Core\Access\AccessResult; +use Drupal\Core\Routing\Access\AccessInterface; +use Symfony\Component\Routing\Route; + +/** + * Checks if passed parameter matches the route configuration. + * + * @DCG + * To make use of this access checker add '{{ applies_to }}: Some value' entry to route + * definition under requirements section. + */ +class {{ class }} implements AccessInterface { + + /** + * Access callback. + * + * @param \Symfony\Component\Routing\Route $route + * The route to check against. + * @param \ExampleInterface $parameter + * The parameter to test. + * + * @return \Drupal\Core\Access\AccessResultInterface + * The access result. + */ + public function access(Route $route, \ExampleInterface $parameter) { + return AccessResult::allowedIf($parameter->getSomeValue() == $route->getRequirement('{{ applies_to }}')); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/breadcrumb-builder.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/breadcrumb-builder.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..07b204199ff094c9ec74f5b9e20c1244c4d40381 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/breadcrumb-builder.services.twig @@ -0,0 +1,5 @@ +services: + {{ machine_name }}.breadcrumb: + class: Drupal\{{ machine_name }}\{{ class }} + tags: + - { name: breadcrumb_builder, priority: 1000 } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/breadcrumb-builder.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/breadcrumb-builder.twig new file mode 100644 index 0000000000000000000000000000000000000000..91ed742ce29cc970607dd9918ae8e81d0dc9ddd1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/breadcrumb-builder.twig @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Breadcrumb\Breadcrumb; +use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface; +use Drupal\Core\Link; +use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\node\NodeInterface; + +/** + * Provides a breadcrumb builder for articles. + */ +class {{ class }} implements BreadcrumbBuilderInterface { + + use StringTranslationTrait; + + /** + * {@inheritdoc} + */ + public function applies(RouteMatchInterface $route_match) { + $node = $route_match->getParameter('node'); + return $node instanceof NodeInterface && $node->getType() == 'article'; + } + + /** + * {@inheritdoc} + */ + public function build(RouteMatchInterface $route_match) { + $breadcrumb = new Breadcrumb(); + + $links[] = Link::createFromRoute($this->t('Home'), '<front>'); + + // Articles page is a view. + $links[] = Link::createFromRoute($this->t('Articles'), 'view.articles.page_1'); + + $node = $route_match->getParameter('node'); + $links[] = Link::createFromRoute($node->label(), '<none>'); + + $breadcrumb->setLinks($links); + + return $breadcrumb; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/cache-context.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/cache-context.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..8e441f0867a3e365a29b24502bc81b9b9620a796 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/cache-context.services.twig @@ -0,0 +1,10 @@ +services: + cache_context.{{ context_id }}: + class: Drupal\{{ machine_name }}\Cache\Context\{{ class }} +{% if base_class == 'RequestStackCacheContextBase' %} + arguments: ['@request_stack'] +{% elseif base_class == 'UserCacheContextBase' %} + arguments: ['@current_user'] +{% endif %} + tags: + - { name: cache.context} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/cache-context.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/cache-context.twig new file mode 100644 index 0000000000000000000000000000000000000000..394402af4b8d6d10e2a27bcaffe5aba23ec493b0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/cache-context.twig @@ -0,0 +1,45 @@ +<?php + +namespace Drupal\{{ machine_name }}\Cache\Context; + +use Drupal\Core\Cache\CacheableMetadata; +use Drupal\Core\Cache\Context\{{ interface }}; +{% if base_class %} +use Drupal\Core\Cache\Context\{{ base_class }}; +{% endif %} + +/** + * Defines the ExampleCacheContext service. + * + * Cache context ID: '{{ context_id }}'. + * + * @DCG + * Check out the core/lib/Drupal/Core/Cache/Context directory for examples of + * cache contexts provided by Drupal core. + */ +class {{ class }} {% if base_class %}extends {{ base_class }} {% endif %}implements {{ interface }} { + + /** + * {@inheritdoc} + */ + public static function getLabel() { + return t('{{ context_label }}'); + } + + /** + * {@inheritdoc} + */ + public function getContext({% if calculated %}$parameter = NULL{% endif %}) { + // @DCG: Define the cache context here. + $context = 'some_string_value'; + return $context; + } + + /** + * {@inheritdoc} + */ + public function getCacheableMetadata({% if calculated %}$parameter = NULL{% endif %}) { + return new CacheableMetadata(); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/custom.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/custom.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..9a59fc2e268d2186e9a00e1577871cba960ff2b1 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/custom.services.twig @@ -0,0 +1,7 @@ +{% import 'lib/di.twig' as di %} +services: + {{ service_name }}: + class: Drupal\{{ machine_name }}\{{ class }} +{% if services %} + arguments: [{{ di.arguments(services) }}] +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/custom.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/custom.twig new file mode 100644 index 0000000000000000000000000000000000000000..20f085718449139e8ab18c409d785b8617534602 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/custom.twig @@ -0,0 +1,34 @@ +{% import 'lib/di.twig' as di %} +<?php + +namespace Drupal\{{ machine_name }}; + +{% if services %} +{{ di.use(services) }} +{% endif %} +/** + * {{ class }} service. + */ +class {{ class }} { + +{% if services %} +{{ di.properties(services) }} + + /** + * Constructs {{ class|article }} object. + * +{{ di.annotation(services) }} + */ + public function __construct({{ di.signature(services) }}) { +{{ di.assignment(services) }} + } + +{% endif %} + /** + * Method description. + */ + public function doSomething() { + // @DCG place your code here. + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/event-subscriber.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/event-subscriber.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..b4cac6c85cff9c8670cec52c2d23fbced1de3403 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/event-subscriber.services.twig @@ -0,0 +1,6 @@ +services: + {{ machine_name }}.event_subscriber: + class: Drupal\{{ machine_name }}\EventSubscriber\{{ class }} + arguments: ['@messenger'] + tags: + - { name: event_subscriber } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/event-subscriber.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/event-subscriber.twig new file mode 100644 index 0000000000000000000000000000000000000000..7b89d53a74e6ae4356a794e0477712074b9fce3b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/event-subscriber.twig @@ -0,0 +1,63 @@ +<?php + +namespace Drupal\{{ machine_name }}\EventSubscriber; + +use Drupal\Core\Messenger\MessengerInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\KernelEvents; + +/** + * {{ name }} event subscriber. + */ +class {{ class }} implements EventSubscriberInterface { + + /** + * The messenger. + * + * @var \Drupal\Core\Messenger\MessengerInterface + */ + protected $messenger; + + /** + * Constructs event subscriber. + * + * @param \Drupal\Core\Messenger\MessengerInterface $messenger + * The messenger. + */ + public function __construct(MessengerInterface $messenger) { + $this->messenger = $messenger; + } + + /** + * Kernel request event handler. + * + * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event + * Response event. + */ + public function onKernelRequest(GetResponseEvent $event) { + $this->messenger->addStatus(__FUNCTION__); + } + + /** + * Kernel response event handler. + * + * @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event + * Response event. + */ + public function onKernelResponse(FilterResponseEvent $event) { + $this->messenger->addStatus(__FUNCTION__); + } + + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() { + return [ + KernelEvents::REQUEST => ['onKernelRequest'], + KernelEvents::RESPONSE => ['onKernelResponse'], + ]; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/logger.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/logger.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..69c8ac064ec4fe4a3a73e46440071ac728993228 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/logger.services.twig @@ -0,0 +1,6 @@ +services: + logger.{{ machine_name }}: + class: Drupal\{{ machine_name }}\Logger\{{ class }} + arguments: ['@config.factory', '@logger.log_message_parser', '@date.formatter'] + tags: + - { name: logger } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/logger.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/logger.twig new file mode 100644 index 0000000000000000000000000000000000000000..0747d116146300778d67b52b1c40e1ef00043a6d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/logger.twig @@ -0,0 +1,83 @@ +<?php + +namespace Drupal\{{ machine_name }}\Logger; + +use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Datetime\DateFormatterInterface; +use Drupal\Core\Logger\LogMessageParserInterface; +use Drupal\Core\Logger\RfcLoggerTrait; +use Drupal\Core\Logger\RfcLogLevel; +use Psr\Log\LoggerInterface; + +/** + * Redirects messages to a file. + */ +class {{ class }} implements LoggerInterface { + + use RfcLoggerTrait; + + /** + * A configuration object containing system.file settings. + * + * @var \Drupal\Core\Config\Config + */ + protected $config; + + /** + * The message's placeholders parser. + * + * @var \Drupal\Core\Logger\LogMessageParserInterface + */ + protected $parser; + + /** + * The date formatter service. + * + * @var \Drupal\Core\Datetime\DateFormatterInterface + */ + protected $dateFormatter; + + /** + * Constructs {{ class|article }} object. + * + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The configuration factory object. + * @param \Drupal\Core\Logger\LogMessageParserInterface $parser + * The parser to use when extracting message variables. + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter + * The date formatter service. + */ + public function __construct(ConfigFactoryInterface $config_factory, LogMessageParserInterface $parser, DateFormatterInterface $date_formatter) { + $this->config = $config_factory->get('system.file'); + $this->parser = $parser; + $this->dateFormatter = $date_formatter; + } + + /** + * {@inheritdoc} + */ + public function log($level, $message, array $context = []) { + + // Populate the message placeholders and then replace them in the message. + $message_placeholders = $this->parser->parseMessagePlaceholders($message, $context); + $message = empty($message_placeholders) ? $message : strtr($message, $message_placeholders); + + $entry = [ + 'message' => strip_tags($message), + 'date' => $this->dateFormatter->format($context['timestamp']), + 'type' => $context['channel'], + 'ip' => $context['ip'], + 'request_uri' => $context['request_uri'], + 'referer' => $context['referer'], + 'severity' => (string) RfcLogLevel::getLevels()[$level], + 'uid' => $context['uid'], + ]; + + file_put_contents( + $this->config->get('path.temporary') . '/drupal.log', + print_r($entry, TRUE), + FILE_APPEND + ); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/middleware.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/middleware.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..e3e0d29693ca8ba3e548f63f3e4bce441848ce2d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/middleware.services.twig @@ -0,0 +1,5 @@ +services: + {{ machine_name }}.middleware: + class: Drupal\{{ machine_name }}\{{ class }} + tags: + - { name: http_middleware, priority: 1000 } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/middleware.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/middleware.twig new file mode 100644 index 0000000000000000000000000000000000000000..9aba5584984dbe98c3666ca61be1d7c7bd889c2b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/middleware.twig @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\StringTranslation\StringTranslationTrait; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\HttpKernelInterface; + +/** + * {{ class }} middleware. + */ +class {{ class }} implements HttpKernelInterface { + + use StringTranslationTrait; + + /** + * The kernel. + * + * @var \Symfony\Component\HttpKernel\HttpKernelInterface + */ + protected $httpKernel; + + /** + * Constructs the {{ class }} object. + * + * @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel + * The decorated kernel. + */ + public function __construct(HttpKernelInterface $http_kernel) { + $this->httpKernel = $http_kernel; + } + + /** + * {@inheritdoc} + */ + public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) { + + if ($request->getClientIp() == '127.0.0.10') { + return new Response($this->t('Bye!'), 403); + } + + return $this->httpKernel->handle($request, $type, $catch); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/param-converter.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/param-converter.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..a7bfd1e57ec8bbf23c79130a9950f3cef8788687 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/param-converter.services.twig @@ -0,0 +1,6 @@ +services: + {{ machine_name }}.foo_param_converter: + class: Drupal\{{ machine_name }}\{{ class }} + arguments: ['@database'] + tags: + - { name: paramconverter } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/param-converter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/param-converter.twig new file mode 100644 index 0000000000000000000000000000000000000000..771506d6052d69c37b2535b4e64e37efa2e22513 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/param-converter.twig @@ -0,0 +1,65 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Core\Database\Connection; +use Drupal\Core\ParamConverter\ParamConverterInterface; +use Symfony\Component\Routing\Route; + +/** + * Converts parameters for upcasting database record IDs to full std objects. + * + * @DCG + * To use this converter specify parameter type in a relevant route as follows: + * @code + * {{ machine_name }}.{{ parameter_type }}_parameter_converter: + * path: example/{record} + * defaults: + * _controller: '\Drupal\{{ machine_name }}\Controller\{{ controller_class }}::build' + * requirements: + * _access: 'TRUE' + * options: + * parameters: + * record: + * type: {{ parameter_type }} + * @endcode + * + * Note that for entities you can make use of existing parameter converter + * provided by Drupal core. + * @see \Drupal\Core\ParamConverter\EntityConverter + */ +class {{ class }} implements ParamConverterInterface { + + /** + * The database connection. + * + * @var \Drupal\Core\Database\Connection + */ + protected $connection; + + /** + * Constructs a new {{ class }}. + * + * @param \Drupal\Core\Database\Connection $connection + * The default database connection. + */ + public function __construct(Connection $connection) { + $this->connection = $connection; + } + + /** + * {@inheritdoc} + */ + public function convert($value, $definition, $name, array $defaults) { + // Return NULL if record not found to trigger 404 HTTP error. + return $this->connection->query('SELECT * FROM {table_name} WHERE id = ?', [$value])->fetch() ?: NULL; + } + + /** + * {@inheritdoc} + */ + public function applies($definition, $name, Route $route) { + return !empty($definition['type']) && $definition['type'] == '{{ parameter_type }}'; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/path-processor.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/path-processor.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..c2716747495c78d9240d6a0bd207aff5db178a1a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/path-processor.services.twig @@ -0,0 +1,6 @@ +services: + path_processor.{{ machine_name }}: + class: Drupal\{{ machine_name }}\PathProcessor\{{ class }} + tags: + - { name: path_processor_inbound, priority: 1000 } + - { name: path_processor_outbound, priority: 1000 } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/path-processor.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/path-processor.twig new file mode 100644 index 0000000000000000000000000000000000000000..8f370db590737e88bb4bb1b411f90ae2be89d143 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/path-processor.twig @@ -0,0 +1,29 @@ +<?php + +namespace Drupal\{{ machine_name }}\PathProcessor; + +use Drupal\Core\PathProcessor\InboundPathProcessorInterface; +use Drupal\Core\PathProcessor\OutboundPathProcessorInterface; +use Drupal\Core\Render\BubbleableMetadata; +use Symfony\Component\HttpFoundation\Request; + +/** + * Path processor to replace 'node' with 'content' in URLs. + */ +class {{ class }} implements InboundPathProcessorInterface, OutboundPathProcessorInterface { + + /** + * {@inheritdoc} + */ + public function processInbound($path, Request $request) { + return preg_replace('#^/content/#', '/node/', $path); + } + + /** + * {@inheritdoc} + */ + public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) { + return preg_replace('#^/node/#', '/content/', $path); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/request-policy.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/request-policy.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..a165c50c94cc1a9b13950e8efb7e8389ef6cdd7a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/request-policy.services.twig @@ -0,0 +1,5 @@ +services: + {{ machine_name }}.page_cache_request_policy.example: + class: Drupal\{{ machine_name }}\PageCache\{{ class }} + tags: + - { name: page_cache_request_policy } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/request-policy.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/request-policy.twig new file mode 100644 index 0000000000000000000000000000000000000000..316295529c47215343862f0f809a969af730e6c5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/request-policy.twig @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\{{ machine_name }}\PageCache; + +use Drupal\Core\PageCache\RequestPolicyInterface; +use Symfony\Component\HttpFoundation\Request; + +/** + * A policy allowing to bypass cache for requests with 'no-cache' parameter. + * + * Example: https://example.com/node?no-cache. + */ +class {{ class }} implements RequestPolicyInterface { + + /** + * {@inheritdoc} + */ + public function check(Request $request) { + if (!is_null($request->get('no-cache'))) { + return self::DENY; + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/response-policy.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/response-policy.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..51a94b720c91eda39e484fe9d559e5d707b87dd9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/response-policy.services.twig @@ -0,0 +1,7 @@ +services: + {{ machine_name }}.page_cache_response_policy.example: + class: Drupal\{{ machine_name }}\PageCache\{{ class }} + public: false + tags: + - { name: page_cache_response_policy } + - { name: dynamic_page_cache_response_policy } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/response-policy.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/response-policy.twig new file mode 100644 index 0000000000000000000000000000000000000000..2dd7672db0a64898c0c7877aa61cbdcdb16600ba --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/response-policy.twig @@ -0,0 +1,23 @@ +<?php + +namespace Drupal\{{ machine_name }}\PageCache; + +use Drupal\Core\PageCache\ResponsePolicyInterface; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * A policy disallowing caching requests with certain cookies. + */ +class {{ class }} implements ResponsePolicyInterface { + + /** + * {@inheritdoc} + */ + public function check(Response $response, Request $request) { + if ($request->cookies->get('foo')) { + return self::DENY; + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/route-subscriber.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/route-subscriber.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..9881ab2d24cba5c8e7fbd2f107ea16c031aceff5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/route-subscriber.services.twig @@ -0,0 +1,5 @@ +services: + {{ machine_name }}.route_subscriber: + class: Drupal\{{ machine_name }}\EventSubscriber\{{ class }} + tags: + - { name: event_subscriber } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/route-subscriber.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/route-subscriber.twig new file mode 100644 index 0000000000000000000000000000000000000000..b1c1992fa5a0fe9d51fe723098810ee39287f2b9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/route-subscriber.twig @@ -0,0 +1,39 @@ +<?php + +namespace Drupal\{{ machine_name }}\EventSubscriber; + +use Drupal\Core\Routing\RouteSubscriberBase; +use Drupal\Core\Routing\RoutingEvents; +use Symfony\Component\Routing\RouteCollection; + +/** + * {{ name }} route subscriber. + */ +class {{ class }} extends RouteSubscriberBase { + + /** + * {@inheritdoc} + */ + protected function alterRoutes(RouteCollection $collection) { + foreach ($collection->all() as $route) { + // Hide taxonomy pages from unprivileged users. + if (strpos($route->getPath(), '/taxonomy/term') === 0) { + $route->setRequirement('_role', 'administrator'); + } + } + } + + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() { + $events = parent::getSubscribedEvents(); + + // Use a lower priority than \Drupal\views\EventSubscriber\RouteSubscriber + // to ensure the requirement will be added to its routes. + $events[RoutingEvents::ALTER] = ['onAlterRoutes', -300]; + + return $events; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/theme-negotiator.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/theme-negotiator.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..1e83b4a7c887bdf6f559e1584d98a0d24d06d81e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/theme-negotiator.services.twig @@ -0,0 +1,6 @@ +services: + theme.negotiator.{{ machine_name }}.example: + class: Drupal\{{ machine_name }}\Theme\{{ class }} + arguments: ['@request_stack'] + tags: + - { name: theme_negotiator, priority: 1000 } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/theme-negotiator.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/theme-negotiator.twig new file mode 100644 index 0000000000000000000000000000000000000000..1c63e6b41a1e3411df0501b1abaddab6e3df23da --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/theme-negotiator.twig @@ -0,0 +1,49 @@ +<?php + +namespace Drupal\{{ machine_name }}\Theme; + +use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\Theme\ThemeNegotiatorInterface; +use Symfony\Component\HttpFoundation\RequestStack; + +/** + * Defines a theme negotiator that deals with the active theme on example page. + */ +class {{ class }} implements ThemeNegotiatorInterface { + + /** + * The request stack. + * + * @var \Symfony\Component\HttpFoundation\RequestStack + */ + protected $requestStack; + + /** + * Constructs a new {{ class }}. + * + * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack + * The request stack used to retrieve the current request. + */ + public function __construct(RequestStack $request_stack) { + $this->requestStack = $request_stack; + } + + /** + * {@inheritdoc} + */ + public function applies(RouteMatchInterface $route_match) { + return $route_match->getRouteName() == '{{ machine_name }}.example'; + } + + /** + * {@inheritdoc} + */ + public function determineActiveTheme(RouteMatchInterface $route_match) { + // Allow users to pass theme name through 'theme' query parameter. + $theme = $this->requestStack->getCurrentRequest()->query->get('theme'); + if (is_string($theme)) { + return $theme; + } + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..eaccbc0252debd68c19d387c4a55972c99ae7f75 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.services.twig @@ -0,0 +1,9 @@ +{% import 'lib/di.twig' as di %} +services: + {{ machine_name }}.twig_extension: + class: Drupal\{{ machine_name }}\{{ class }} +{% if services %} + arguments: [{{ di.arguments(services) }}] +{% endif %} + tags: + - { name: twig.extension } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.twig new file mode 100644 index 0000000000000000000000000000000000000000..1ae34fea7443c356e9a51b29b795010c79595baf --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.twig @@ -0,0 +1,60 @@ +{% import 'lib/di.twig' as di %} +<?php + +namespace Drupal\{{ machine_name }}; + +{% if services %} +{{ di.use(services) }} +{% endif %} +/** + * Twig extension. + */ +class {{ class }} extends \Twig_Extension { + +{% if services %} +{{ di.properties(services) }} + + /** + * Constructs a new {{ class }} object. + * +{{ di.annotation(services) }} + */ + public function __construct({{ di.signature(services) }}) { +{{ di.assignment(services) }} + } + +{% endif %} + /** + * {@inheritdoc} + */ + public function getFunctions() { + return [ + new \Twig_SimpleFunction('foo', function ($argument = NULL) { + return 'Foo: ' . $argument; + }), + ]; + } + + /** + * {@inheritdoc} + */ + public function getFilters() { + return [ + new \Twig_SimpleFilter('bar', function ($text) { + return str_replace('bar', 'BAR', $text); + }), + ]; + } + + /** + * {@inheritdoc} + */ + public function getTests() { + return [ + new \Twig_SimpleTest('color', function ($text) { + return preg_match('/^#(?:[0-9a-f]{3}){1,2}$/i', $text); + }), + ]; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/uninstall-validator.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/uninstall-validator.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..a00c2f9ee3d3f3966250cec9bbde91f7f7adda22 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/uninstall-validator.services.twig @@ -0,0 +1,6 @@ +services: + {{ machine_name }}.uninstall_validator: + class: Drupal\{{ machine_name }}\{{ class }} + tags: + - { name: module_install.uninstall_validator } + arguments: ['@plugin.manager.block', '@entity_type.manager', '@string_translation'] diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/uninstall-validator.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/uninstall-validator.twig new file mode 100644 index 0000000000000000000000000000000000000000..ebceaca168a6c2ae6ac91b39e0bb4570cad82eb0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/uninstall-validator.twig @@ -0,0 +1,70 @@ +<?php + +namespace Drupal\{{ machine_name }}; + +use Drupal\Component\Plugin\PluginManagerInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Extension\ModuleUninstallValidatorInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\Core\StringTranslation\TranslationInterface; + +/** + * Prevents uninstalling of modules providing used block plugins. + */ +class {{ class }} implements ModuleUninstallValidatorInterface { + + use StringTranslationTrait; + + /** + * The block plugin manager. + * + * @var \Drupal\Component\Plugin\PluginManagerInterface + */ + protected $blockManager; + + /** + * The block entity storage. + * + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface + */ + protected $blockStorage; + + /** + * Constructs a new FilterUninstallValidator. + * + * @param \Drupal\Component\Plugin\PluginManagerInterface $block_manager + * The filter plugin manager. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager + * The entity manager. + * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation + * The string translation service. + */ + public function __construct(PluginManagerInterface $block_manager, EntityTypeManagerInterface $entity_manager, TranslationInterface $string_translation) { + $this->blockManager = $block_manager; + $this->blockStorage = $entity_manager->getStorage('block'); + $this->stringTranslation = $string_translation; + } + + /** + * {@inheritdoc} + */ + public function validate($module) { + $reasons = []; + + foreach ($this->blockStorage->loadMultiple() as $block) { + /** @var \Drupal\block\BlockInterface $block */ + $definition = $block->getPlugin() + ->getPluginDefinition(); + if ($definition['provider'] == $module) { + $message_arguments = [ + ':url' => $block->toUrl('edit-form')->toString(), + '@block_id' => $block->id(), + ]; + $reasons[] = $this->t('Provides a block plugin that is in use in the following block: <a href=":url">@block_id</a>', $message_arguments); + } + } + + return $reasons; + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/settings.local.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/settings.local.twig new file mode 100644 index 0000000000000000000000000000000000000000..4072128b45775947c6d94b1bece3974cb0a91a98 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/settings.local.twig @@ -0,0 +1,131 @@ +<?php + +/** + * @file + * Local development override configuration feature. + * + * To activate this feature, copy and rename it such that its path plus + * filename is 'sites/default/settings.local.php'. Then, go to the bottom of + * 'sites/default/settings.php' and uncomment the commented lines that mention + * 'settings.local.php'. + * + * If you are using a site name in the path, such as 'sites/example.com', copy + * this file to 'sites/example.com/settings.local.php', and uncomment the lines + * at the bottom of 'sites/example.com/settings.php'. + */ + +/** + * Assertions. + * + * The Drupal project primarily uses runtime assertions to enforce the + * expectations of the API by failing when incorrect calls are made by code + * under development. + * + * @see http://php.net/assert + * @see https://www.drupal.org/node/2492225 + * + * If you are using PHP 7.0 it is strongly recommended that you set + * zend.assertions=1 in the PHP.ini file (It cannot be changed from .htaccess + * or runtime) on development machines and to 0 in production. + * + * @see https://wiki.php.net/rfc/expectations + */ +assert_options(ASSERT_ACTIVE, TRUE); +\Drupal\Component\Assertion\Handle::register(); + +/** + * Enable local development services. + */ +$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml'; + +/** + * Show all error messages, with backtrace information. + * + * In case the error level could not be fetched from the database, as for + * example the database connection failed, we rely only on this value. + */ +$config['system.logging']['error_level'] = 'verbose'; + +/** + * Disable CSS and JS aggregation. + */ +$config['system.performance']['css']['preprocess'] = FALSE; +$config['system.performance']['js']['preprocess'] = FALSE; + +/** + * Disable the render cache (this includes the page cache). + * + * Note: you should test with the render cache enabled, to ensure the correct + * cacheability metadata is present. However, in the early stages of + * development, you may want to disable it. + * + * This setting disables the render cache by using the Null cache back-end + * defined by the development.services.yml file above. + * + * Do not use this setting until after the site is installed. + */ +# $settings['cache']['bins']['render'] = 'cache.backend.null'; + +/** + * Disable caching for migrations. + * + * Uncomment the code below to only store migrations in memory and not in the + * database. This makes it easier to develop custom migrations. + */ +# $settings['cache']['bins']['discovery_migration'] = 'cache.backend.memory'; + +/** + * Disable Dynamic Page Cache. + * + * Note: you should test with Dynamic Page Cache enabled, to ensure the correct + * cacheability metadata is present (and hence the expected behavior). However, + * in the early stages of development, you may want to disable it. + */ +# $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null'; + +/** + * Allow test modules and themes to be installed. + * + * Drupal ignores test modules and themes by default for performance reasons. + * During development it can be useful to install test extensions for debugging + * purposes. + */ +$settings['extension_discovery_scan_tests'] = TRUE; + +/** + * Enable access to rebuild.php. + * + * This setting can be enabled to allow Drupal's php and database cached + * storage to be cleared via the rebuild.php page. Access to this page can also + * be gained by generating a query string from rebuild_token_calculator.sh and + * using these parameters in a request to rebuild.php. + */ +$settings['rebuild_access'] = TRUE; + +/** + * Skip file system permissions hardening. + * + * The system module will periodically check the permissions of your site's + * site directory to ensure that it is not writable by the website user. For + * sites that are managed with a version control system, this can cause problems + * when files in that directory such as settings.php are updated, because the + * user pulling in the changes won't have permissions to modify files in the + * directory. + */ +$settings['skip_permissions_hardening'] = TRUE; +{% if db_override %} + +/** + * Database settings. + */ +$databases['default']['default'] = [ + 'database' => '{{ database }}', + 'username' => '{{ username }}', + 'password' => '{{ password }}', + 'prefix' => '', + 'host' => '{{ host }}', + 'port' => '', + 'namespace' => 'Drupal\\Core\\Database\\Driver\\{{ driver }}', + 'driver' => '{{ driver }}', +]; +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/template-module.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/template-module.twig new file mode 100644 index 0000000000000000000000000000000000000000..da322d1c0114ac1434e1c41e9b982cb49a0303db --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/template-module.twig @@ -0,0 +1,34 @@ +<?php + +/** + * @file + * Primary module hooks for {{ name }} module. + */ +{% if create_theme %} + +/** + * Implements hook_theme(). + */ +function {{ machine_name }}_theme() { + return [ + '{{ template_name|h2u }}' => [ + 'variables' => ['foo' => NULL], + ], + ]; +} +{% endif %} +{% if create_preprocess %} + +/** + * Prepares variables for {{ template_name }} template. + * + * Default template: {{ template_name }}.html.twig. + * + * @param array $variables + * An associative array containing: + * - foo: Foo variable description. + */ +function template_preprocess_{{ template_name|h2u }}(array &$variables) { + $variables['foo'] = 'bar'; +} +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/template-template.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/template-template.twig new file mode 100644 index 0000000000000000000000000000000000000000..890ad760442d11be86254ad85bf0e702353c82d8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/template-template.twig @@ -0,0 +1,18 @@ +{{ '{#' }} +/** + * @file + * Default theme implementation to display something. + * + * Available variables: + * - foo: Foo variable description. +{% if create_preprocess %} + * + * @see template_preprocess_{{ template_name|h2u }}() +{% endif %} + * + * @ingroup themeable + */ +{{ '#}' }} +<div class="wrapper-class"> + {{ '{{' }} foo {{ '}}' }} +</div> diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/test/browser.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/test/browser.twig new file mode 100644 index 0000000000000000000000000000000000000000..239e41da32de5e20856cd1ca992aae7936e26a41 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/test/browser.twig @@ -0,0 +1,37 @@ +<?php + +namespace Drupal\Tests\{{ machine_name }}\Functional; + +use Drupal\Tests\BrowserTestBase; + +/** + * Test description. + * + * @group {{ machine_name }} + */ +class {{ class }} extends BrowserTestBase { + + /** + * {@inheritdoc} + */ + public static $modules = ['{{ machine_name }}']; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + // Set up the test here. + } + + /** + * Test callback. + */ + public function testSomething() { + $admin_user = $this->drupalCreateUser(['access administration pages']); + $this->drupalLogin($admin_user); + $this->drupalGet('admin'); + $this->assertSession()->elementExists('xpath', '//h1[text() = "Administration"]'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/test/kernel.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/test/kernel.twig new file mode 100644 index 0000000000000000000000000000000000000000..84af97e430d25b2424c0631c4bee8348dc36208b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/test/kernel.twig @@ -0,0 +1,35 @@ +<?php + +namespace Drupal\Tests\{{ machine_name }}\Kernel; + +use Drupal\KernelTests\KernelTestBase; + +/** + * Test description. + * + * @group {{ machine_name }} + */ +class {{ class }} extends KernelTestBase { + + /** + * {@inheritdoc} + */ + public static $modules = ['{{ machine_name }}']; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + // Mock required services here. + } + + /** + * Test callback. + */ + public function testSomething() { + $result = $this->container->get('transliteration')->transliterate('Друпал'); + $this->assertEquals('Drupal', $result); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/test/nightwatch.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/test/nightwatch.twig new file mode 100644 index 0000000000000000000000000000000000000000..d92fc529a75554627535f507d67ea121cdefba0d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/test/nightwatch.twig @@ -0,0 +1,16 @@ +module.exports = { + '@tags': ['{{ machine_name }}'], + before(browser) { + browser.drupalInstall(); + }, + after(browser) { + browser.drupalUninstall(); + }, + 'Front page': browser => { + browser + .drupalRelativeURL('/') + .waitForElementVisible('body', 1000) + .assert.containsText('h1', 'Log in') + .drupalLogAndEnd({onlyOnError: false}); + }, +}; diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/test/unit.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/test/unit.twig new file mode 100644 index 0000000000000000000000000000000000000000..5b142b642a624cc129a1a11a4a8c2c8731c38a08 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/test/unit.twig @@ -0,0 +1,29 @@ +<?php + +namespace Drupal\Tests\{{ machine_name }}\Unit; + +use Drupal\Tests\UnitTestCase; + +/** + * Test description. + * + * @group {{ machine_name }} + */ +class {{ class }} extends UnitTestCase { + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + // @TODO: Mock required classes here. + } + + /** + * Tests something. + */ + public function testSomething() { + $this->assertTrue(TRUE, 'This is TRUE!'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/test/web.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/test/web.twig new file mode 100644 index 0000000000000000000000000000000000000000..2824ffdeb056430b8ba376bab063b86493c05380 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/test/web.twig @@ -0,0 +1,50 @@ +<?php + +namespace Drupal\{{ machine_name }}\Tests; + +use Drupal\simpletest\WebTestBase; + +/** + * Tests site configuration. + * + * @group {{ machine_name }} + */ +class {{ class }} extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = [ + 'node', + 'field', + 'contact', + 'views', + 'taxonomy', + ]; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $user = $this->drupalCreateUser(['administer site configuration']); + $this->drupalLogin($user); + } + + /** + * Test site information form. + */ + public function testFieldStorageSettingsForm() { + $edit = [ + 'site_name' => 'Drupal', + 'site_slogan' => 'Community plumbing', + 'site_mail' => 'admin@example.local', + 'site_frontpage' => '/user', + ]; + $this->drupalPostForm('admin/config/system/site-information', $edit, 'Save configuration'); + $this->assertText('The configuration options have been saved.', 'Configuration options have been saved'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/test/webdriver.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/test/webdriver.twig new file mode 100644 index 0000000000000000000000000000000000000000..77e565b5bf34f9407dad998fb87b83acaa886053 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/test/webdriver.twig @@ -0,0 +1,55 @@ +<?php + +namespace Drupal\Tests\{{ machine_name }}\FunctionalJavascript; + +use Drupal\FunctionalJavascriptTests\WebDriverTestBase; + +/** + * Tests the JavaScript functionality of the {{ name }} module. + * + * @group {{ machine_name }} + */ +class {{ class }} extends WebDriverTestBase { + + /** + * {@inheritdoc} + */ + public static $modules = ['{{ machine_name }}']; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + // Set up the test here. + } + + /** + * Test callback. + */ + public function testSomething() { + // Let's test password strength widget. + \Drupal::configFactory()->getEditable('user.settings') + ->set('verify_mail', FALSE) + ->save(); + + $this->drupalGet('user/register'); + + $page = $this->getSession()->getPage(); + + $password_field = $page->findField('Password'); + $password_strength = $page->find('css', '.js-password-strength__text'); + + $this->assertEquals('', $password_strength->getText()); + + $password_field->setValue('abc'); + $this->assertEquals('Weak', $password_strength->getText()); + + $password_field->setValue('abcABC123!'); + $this->assertEquals('Fair', $password_strength->getText()); + + $password_field->setValue('abcABC123!sss'); + $this->assertEquals('Strong', $password_strength->getText()); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/theme-logo.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-logo.twig new file mode 100644 index 0000000000000000000000000000000000000000..aa0c4a4fb53fa5c010a6678a579986a0025bcd01 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-logo.twig @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="100" height="60"> + <rect x="3" y="3" rx="10" ry="10" width="94" height="54" style="stroke: #187bb8; fill: #f5f5ff;"/> + <text x="50%" y="50%" text-anchor="middle" alignment-baseline="middle" style="font-family: Arial, 'Helvetica Neue', Helvetica; fill: #187bb8;">{{ name }} logo</text> +</svg> diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/theme-package.json.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-package.json.twig new file mode 100644 index 0000000000000000000000000000000000000000..c7a0fc3b9591b9f71c4012a9de81d4dfe4f1c9a0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-package.json.twig @@ -0,0 +1,15 @@ +{ + "name": "{{ machine_name }}", + "private": true, + "scripts": { + "sass-watch": "node-sass -w --output-style expanded scss -o css", + "sass-compile": "node-sass --output-style expanded scss -o css", + "livereload": "livereload css", + "start": "run-p sass-watch livereload" + }, + "devDependencies": { + "livereload": "^0.7.0", + "node-sass": "^4.9.3", + "npm-run-all": "^4.1.3" + } +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-config.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-config.twig new file mode 100644 index 0000000000000000000000000000000000000000..9a68d6be07ebbd1d23b66aac0a6dd0b6b10f6fe9 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-config.twig @@ -0,0 +1,2 @@ +# Default settings of {{ name }} theme. +font_size: 16 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-form.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-form.twig new file mode 100644 index 0000000000000000000000000000000000000000..1611208006a896201e992012a5ca068ddb6e188a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-form.twig @@ -0,0 +1,27 @@ +<?php + +/** + * @file + * Theme settings form for {{ name }} theme. + */ + +/** + * Implements hook_form_system_theme_settings_alter(). + */ +function {{ machine_name }}_form_system_theme_settings_alter(&$form, &$form_state) { + + $form['{{ machine_name }}'] = [ + '#type' => 'details', + '#title' => t('{{ name }}'), + '#open' => TRUE, + ]; + + $form['{{ machine_name }}']['font_size'] = [ + '#type' => 'number', + '#title' => t('Font size'), + '#min' => 12, + '#max' => 18, + '#default_value' => theme_get_setting('font_size'), + ]; + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-schema.twig new file mode 100644 index 0000000000000000000000000000000000000000..3dc7cdcd6d03ef82dca76accaaefe1eb9c23fc7d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/theme-settings-schema.twig @@ -0,0 +1,8 @@ +# Schema for the configuration files of the {{ name }} theme. +{{ machine_name }}.settings: + type: theme_settings + label: '{{ name }} settings' + mapping: + font_size: + type: integer + label: Font size diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/theme.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/theme.twig new file mode 100644 index 0000000000000000000000000000000000000000..b0214cc48013393828b1e9ddf701fc25048aeeb6 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/theme.twig @@ -0,0 +1,27 @@ +<?php + +/** + * @file + * Functions to support theming in the {{ name }} theme. + */ + +/** + * Implements hook_preprocess_HOOK() for html.html.twig. + */ +function {{ machine_name }}_preprocess_html(&$variables) { + +} + +/** + * Implements hook_preprocess_HOOK() for page.html.twig. + */ +function {{ machine_name }}_preprocess_page(&$variables) { + +} + +/** + * Implements hook_preprocess_HOOK() for node.html.twig. + */ +function {{ machine_name }}_preprocess_node(&$variables) { + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/breakpoints.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/breakpoints.twig new file mode 100644 index 0000000000000000000000000000000000000000..b6ba8426b227b31e7e10b6a2c8a33075a33cfea4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/breakpoints.twig @@ -0,0 +1,30 @@ +{{ machine_name }}.extra_small: + label: mobile + mediaQuery: '' + weight: 0 + multipliers: + - 1x +{{ machine_name }}.small: + label: mobile + mediaQuery: 'all and (min-width: 576px) and (max-width: 767px)' + weight: 1 + multipliers: + - 1x +{{ machine_name }}.medium: + label: narrow + mediaQuery: 'all and (min-width: 768px) and (max-width: 991px)' + weight: 2 + multipliers: + - 1x +{{ machine_name }}.large: + label: wide + mediaQuery: 'all and (min-width: 992px) and (max-width: 1199px)' + weight: 3 + multipliers: + - 1x +{{ machine_name }}.extra_large: + label: wide + mediaQuery: 'all and (min-width: 1200px)' + weight: 4 + multipliers: + - 1x diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.action.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.action.twig new file mode 100644 index 0000000000000000000000000000000000000000..e25041020dfbb83c22a50318896e798b9406b9c8 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.action.twig @@ -0,0 +1,10 @@ +{{ machine_name }}.add_article: + route_name: node.add + route_parameters: + node_type: article + options: + attributes: {target: _blank} + title: Add article + weight: 10 + appears_on: + - system.admin_content diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.contextual.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.contextual.twig new file mode 100644 index 0000000000000000000000000000000000000000..27823ffa2cd4c406ec9d0dd8024af8102c93fa4d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.contextual.twig @@ -0,0 +1,12 @@ +{{ machine_name }}.edit_block: + title: Edit this block + route_name: entity.block.edit_form + group: block +{{ machine_name }}.view_node: + title: Edit this node + route_name: entity.node.edit_form + group: node +{{ machine_name }}.edit_view: + title: Edit this view + route_name: entity.view.edit_form + group: entity.view.edit_form diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.menu.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.menu.twig new file mode 100644 index 0000000000000000000000000000000000000000..c02502cd894591533f199a40d6c9f7382670112c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.menu.twig @@ -0,0 +1,34 @@ +# Simple link. +{{ machine_name }}.node_add: + title: Add content + description: Add new content. + menu_name: main + route_name: node.add_page + weight: 10 + +# Child link. +{{ machine_name }}.node_add_article: + title: Add article + menu_name: main + parent: {{ machine_name }}.node_add + route_name: node.add + route_parameters: + node_type: article + weight: 20 + +# Dynamic link. +{{ machine_name }}.user: + menu_name: main + class: Drupal\user\Plugin\Menu\LoginLogoutMenuLink + weight: 30 + +# External link. +{{ machine_name }}.drupal.org: + title: Drupal.org + description: Drupal is an open source platform for building amazing digital experiences. + url: https://www.drupal.org + menu_name: main + weight: 40 + options: + attributes: + target: _blank diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.task.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.task.twig new file mode 100644 index 0000000000000000000000000000000000000000..39bb9583d11f83de71733751b4c4991b5ba79dad --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/links.task.twig @@ -0,0 +1,23 @@ +{{ machine_name }}.foo: + title: Foo + route_name: example.foo + base_route: example.foo +{{ machine_name }}.foo_1: + title: Foo 1 + route_name: example.foo_1 + base_route: example.foo_1 + parent_id: example.foo +{{ machine_name }}.foo_2: + title: Foo 2 + route_name: example.foo_2 + base_route: example.foo_2 + parent_id: example.foo +{{ machine_name }}.foo_3: + title: Foo 3 + route_name: example.foo_3 + base_route: example.foo_3 + parent_id: example.foo +{{ machine_name }}.bar: + title: bar + route_name: example.bar + base_route: example.foo diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/module-info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/module-info.twig new file mode 100644 index 0000000000000000000000000000000000000000..c4277eb4662798cb70d940e0d2d9f45d4a410110 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/module-info.twig @@ -0,0 +1,14 @@ +name: {{ name }} +type: module +description: {{ description }} +package: {{ package }} +core: 8.x +{% if dependencies %} +dependencies: +{% for dependency in dependencies %} + - {{ dependency }} +{% endfor %} +{% endif %} +{% if configure %} +configure: {{ configure }} +{% endif %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/module-libraries.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/module-libraries.twig new file mode 100644 index 0000000000000000000000000000000000000000..22147924fdd372f43f77d6b853d98da521f2eed2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/module-libraries.twig @@ -0,0 +1,37 @@ +# Custom module library for general purposes. +{{ machine_name }}: + js: + js/{{ machine_name|u2h }}.js: {} + css: + component: + css/{{ machine_name|u2h }}.css: {} + dependencies: + - core/drupalSettings + - {{ machine_name }}/jquery-labelauty + +# Third-party library (self hosted). +jquery-labelauty: + remote: https://github.com/fntneves/jquery-labelauty + version: 1.1.0 + license: + name: MIT + url: https://github.com/fntneves/jquery-labelauty/blob/v1.1.0/LICENSE + gpl-compatible: true + js: + /libraries/jquery-labelauty/source/jquery-labelauty.js: {} + css: + component: + /libraries/jquery-labelauty/source/jquery-labelauty.css: {} + dependencies: + - core/jquery + +# Third-party library (CDN). +vuejs: + remote: https://vuejs.org + version: 2.0.5 + license: + name: MIT + url: https://github.com/vuejs/vue/blob/dev/LICENSE + gpl-compatible: true + js: + https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.4/vue.min.js: {type: external, minified: true} diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/permissions.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/permissions.twig new file mode 100644 index 0000000000000000000000000000000000000000..8d3612e7e07e19d6ee9f221950a80271923f6012 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/permissions.twig @@ -0,0 +1,4 @@ +administer {{ machine_name }} configuration: + title: 'Administer {{ machine_name }} configuration' + description: 'Optional description.' + restrict access: true diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/routing.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/routing.twig new file mode 100644 index 0000000000000000000000000000000000000000..ab372c50efed9a913b8182ff41bab26bb932839d --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/routing.twig @@ -0,0 +1,14 @@ +{{ machine_name }}.reports: + path: '/admin/reports/{{ machine_name }}' + defaults: + _controller: '\Drupal\{{ machine_name }}\Controller\{{ class }}::build' + _title: '{{ name }} report' + requirements: + _permission: 'access site reports' +{{ machine_name }}.settings: + path: '/admin/config/{{ machine_name }}/settings' + defaults: + _form: 'Drupal\{{ machine_name }}\Form\SettingsForm' + _title: '{{ name }} settings' + requirements: + _permission: 'administer {{ machine_name }} configuration' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/services.twig new file mode 100644 index 0000000000000000000000000000000000000000..33ec73cce980c6b450092c53fe538426b98b9b4a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/services.twig @@ -0,0 +1,13 @@ +services: + {{ machine_name }}.example: + class: Drupal\{{ machine_name }}\{{ class }}Example + arguments: ['@entity.query', '@entity_type.manager'] + {{ machine_name }}.middleware: + class: Drupal\{{ machine_name }}\{{ class }}Middleware + tags: + - { name: http_middleware, priority: 10 } + {{ machine_name }}.event_subscriber: + class: Drupal\{{ machine_name }}\EventSubscriber\{{ class }}Subscriber + arguments: ['@current_user'] + tags: + - { name: event_subscriber } diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/theme-info.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/theme-info.twig new file mode 100644 index 0000000000000000000000000000000000000000..e11ffdda0527c1b0efc86d73a7c920541f1d2457 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/theme-info.twig @@ -0,0 +1,20 @@ +name: {{ name }} +type: theme +base theme: {{ base_theme }} +description: {{ description }} +package: {{ package }} +core: 8.x +libraries: + - {{ machine_name }}/global +regions: + header: 'Header' + primary_menu: 'Primary menu' + secondary_menu: 'Secondary menu' + page_top: 'Page top' + page_bottom: 'Page bottom' + featured: 'Featured' + breadcrumb: 'Breadcrumb' + content: 'Content' + sidebar_first: 'Sidebar first' + sidebar_second: 'Sidebar second' + footer: 'Footer' diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/yml/theme-libraries.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/theme-libraries.twig new file mode 100644 index 0000000000000000000000000000000000000000..dbd4e271a09a76926eba1c12923fcdb13b554614 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/yml/theme-libraries.twig @@ -0,0 +1,24 @@ +# Main theme library. +global: + js: + js/{{ machine_name|u2h }}.js: {} + css: + base: + css/base/elements.css: {} + component: + css/components/block.css: {} + css/components/breadcrumb.css: {} + css/components/field.css: {} + css/components/form.css: {} + css/components/header.css: {} + css/components/menu.css: {} + css/components/messages.css: {} + css/components/node.css: {} + css/components/sidebar.css: {} + css/components/table.css: {} + css/components/tabs.css: {} + css/components/buttons.css: {} + layout: + css/layouts/layout.css: {} + theme: + css/theme/print.css: { media: print } diff --git a/vendor/chi-teck/drupal-code-generator/templates/lib/di.twig b/vendor/chi-teck/drupal-code-generator/templates/lib/di.twig new file mode 100644 index 0000000000000000000000000000000000000000..bab50269b57ac60848ef33deb40f9b019cd7529e --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/lib/di.twig @@ -0,0 +1,46 @@ +{% macro arguments(services) %} + {% for service_id, service in services %}'@{{ service_id }}'{{ loop.last ? '' : ', ' }}{% endfor %} +{% endmacro %} + +{% macro use(services) %} + {% sort %} + {% for service in services %} +use {{ service.type }}; + {% endfor %} + {% endsort %} +{% endmacro %} + +{% macro properties(services) %} + {% for service in services %} + /** + * {{ service.description }} + * + * @var \{{ service.type }} + */ + protected ${{ service.name|camelize(false) }};{{ loop.last ? '' : "\n\n" }} + {%- endfor %} +{% endmacro %} + +{% macro annotation(services) %} + {% for service in services %} + * @param \{{ service.type }} ${{ service.name }} + * {{ service.description }}{{ loop.last ? '' : "\n" }} + {%- endfor %} +{% endmacro %} + +{% macro signature(services) %} + {% for service in services %}{{ service.short_type }} ${{ service.name }}{{ loop.last ? '' : ', ' }}{% endfor %} +{% endmacro %} + +{% macro assignment(services) %} + {% for service in services %} + $this->{{ service.name|camelize(false) }} = ${{ service.name }};{{ loop.last ? '' : "\n" }} + {%- endfor %} +{% endmacro %} + +{% macro container(services) %} + {% for service_id, service in services %} + $container->get('{{ service_id }}'){{ loop.last ? '' : ",\n" }} + {%- endfor %} +{% endmacro %} + diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/apache-virtual-host.twig b/vendor/chi-teck/drupal-code-generator/templates/other/apache-virtual-host.twig new file mode 100644 index 0000000000000000000000000000000000000000..b9618d823f82a4e506681e42417e995b3e101e7c --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/apache-virtual-host.twig @@ -0,0 +1,14 @@ +<VirtualHost *:80> + ServerName {{ hostname }} + ServerAlias www.{{ hostname }} + ServerAlias m.{{ hostname }} + DocumentRoot {{ docroot }} + + <Directory {{ docroot }}> + Options All + AllowOverride All + Order allow,deny + Allow from all + </Directory> + +</VirtualHost> diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/dcg-command-template.twig b/vendor/chi-teck/drupal-code-generator/templates/other/dcg-command-template.twig new file mode 100644 index 0000000000000000000000000000000000000000..0c94e4b11db3b9f8bb84ca5b3e9daf135f264fba --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/dcg-command-template.twig @@ -0,0 +1,17 @@ +{% verbatim %}<?php + +namespace Drupal\{{ machine_name }}; + +/** + * Some custom service of the {{ name }} module. + */ +class {{ class }} { + + /** + * Method description. + */ + public function meow() { + echo 'Meow!'; + } + +}{% endverbatim %} diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/dcg-command.twig b/vendor/chi-teck/drupal-code-generator/templates/other/dcg-command.twig new file mode 100644 index 0000000000000000000000000000000000000000..51145aa214390c6a45bc7e7c3a37aae1d445f62b --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/dcg-command.twig @@ -0,0 +1,43 @@ +<?php + +// @DCG Place this file to $HOME/.dcg/Command{{ path }} directory. + +namespace {{ namespace }}; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements {{ name }} command. + */ +class {{ class }} extends BaseGenerator { + + protected $name = '{{ name }}'; + protected $description = '{{ description }}'; + protected $alias = '{{ alias }}'; + protected $templatePath = __DIR__; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) { + // Ask the user some questions. + $questions = Utils::moduleQuestions(); + $default_class = function ($vars) { + return Utils::camelize($vars['machine_name']) . 'Example'; + }; + $questions['class'] = new Question('Class', $default_class); + + $this->collectVars($input, $output, $questions); + + // @DCG The template should be located under directory specified in + // $self::templatePath property. + $this->addFile() + ->path('src/{class}.php') + ->template('{{ template_name }}'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/drupal-console-command-services.twig b/vendor/chi-teck/drupal-code-generator/templates/other/drupal-console-command-services.twig new file mode 100644 index 0000000000000000000000000000000000000000..2458bb4994f2eae2aa3964ca388424a1dcb01df2 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/drupal-console-command-services.twig @@ -0,0 +1,5 @@ +services: + {{ service_name }}: + class: Drupal\{{ machine_name }}\Command\{{ class }} + tags: + - { name: drupal.command } diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/drupal-console-command.twig b/vendor/chi-teck/drupal-code-generator/templates/other/drupal-console-command.twig new file mode 100644 index 0000000000000000000000000000000000000000..a4e5a80b6c60bfb9af59eb741969cfb91a9b3488 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/drupal-console-command.twig @@ -0,0 +1,35 @@ +<?php + +namespace Drupal\{{ machine_name }}\Command; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Drupal\Console\Core\Command\{{ base_class }}; + +/** + * Class {{ class }}. + * + * Drupal\Console\Annotations\DrupalCommand ( + * extension="{{ machine_name }}", + * extensionType="module" + * ) + */ +class {{ class }} extends {{ base_class }} { + + /** + * {@inheritdoc} + */ + protected function configure() { + $this + ->setName('{{ command_name }}') + ->setDescription('{{ description }}'); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) { + $this->getIo()->info('It works!'); + } + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/drush-command.twig b/vendor/chi-teck/drupal-code-generator/templates/other/drush-command.twig new file mode 100644 index 0000000000000000000000000000000000000000..1bbc5ebfe1c42a51dafe82f61681208dfe3ae25a --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/drush-command.twig @@ -0,0 +1,55 @@ +<?php + +/** + * @file + * Contains {{ command_name }} drush command. + */ + +/** + * Implements hook_drush_help(). + */ +function {{ command_file_prefix|h2u }}_drush_help($section) { + switch ($section) { + case 'drush:{{ command_name }}': + $help = dt('Help text here.'); + return $help; + } +} + +/** + * Implements hook_drush_command(). + */ +function {{ command_file_prefix|h2u }}_drush_command() { + + $items['{{ command_name }}'] = [ + 'description' => '{{ description }}', + 'arguments' => [ + '{{ argument }}' => 'Argument description', + ], + 'required-arguments' => TRUE, + 'options' => [ + '{{ option }}' => 'Option description', + ], + 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, + 'aliases' => ['{{ alias }}'], + 'examples' => [ + 'drush {{ alias }} {{ argument }} --{{ option }}' => 'It does something with this argument', + ], + ]; + + return $items; +} + +/** + * Callback function for {{ command_name }} command. + */ +function drush_{{ command_callback_suffix|h2u }}($argument) { + + $option = drush_get_option('{{ option }}', 'default'); + drush_print(dt('Argument value is "@argument".', ['@argument' => $argument])); + drush_print(dt('Option value is "@option".', ['@option' => $option])); + + drush_set_error(dt('Error text here.')); + drush_log(dt('Log text here')); + +} diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/html.twig b/vendor/chi-teck/drupal-code-generator/templates/other/html.twig new file mode 100644 index 0000000000000000000000000000000000000000..10966a05aa4b3fce8d358e4b19c035655a3091b0 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/html.twig @@ -0,0 +1,14 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>Hello world!</title> + <link rel="stylesheet" href="css/main.css"> +</head> +<body> + +<h1>Hello world!</h1> + +<script src="js/main.js"></script> +</body> +</html> diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/nginx-virtual-host.twig b/vendor/chi-teck/drupal-code-generator/templates/other/nginx-virtual-host.twig new file mode 100644 index 0000000000000000000000000000000000000000..e40d39ddea844f51567ffc09f8f7f85474cb09a5 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/nginx-virtual-host.twig @@ -0,0 +1,105 @@ +# +# @DCG +# The configuration is based on official Nginx recipe. +# See https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/ +# Check out Perusio's config for more delicate configuration. +# See https://github.com/perusio/drupal-with-nginx +# +server { + server_name {{ server_name }}; + root {{ docroot }}; + + client_max_body_size 16m; + + location = /favicon.ico { + log_not_found off; + access_log off; + } + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + # Very rarely should these ever be accessed. + location ~* \.(make|txt|log|engine|inc|info|install|module|profile|po|pot|sh|sql|test|theme)$ { + return 404; + } + + location ~ \..*/.*\.php$ { + return 404; + } + +{% if file_private_path %} + location ~ ^/{{ file_private_path }}/ { + return 403; + } + +{% endif %} + # Allow "Well-Known URIs" as per RFC 5785. + location ~* ^/.well-known/ { + allow all; + } + + # Block access to "hidden" files and directories whose names begin with a + # period. This includes directories used by version control systems such + # as Subversion or Git to store control files. + location ~ (^|/)\. { + return 404; + } + + location / { + try_files $uri /index.php?$query_string; + } + + location @rewrite { + rewrite ^/(.*)$ /index.php?q=$1; + } + + # Don't allow direct access to PHP files in the vendor directory. + location ~ /vendor/.*\.php$ { + deny all; + return 404; + } + + # In Drupal 8, we must also match new paths where the '.php' appears in + # the middle, such as update.php/selection. The rule we use is strict, + # and only allows this pattern with the update.php front controller. + # This allows legacy path aliases in the form of + # blog/index.php/legacy-path to continue to route to Drupal nodes. If + # you do not have any paths like that, then you might prefer to use a + # laxer rule, such as: + # location ~ \.php(/|$) { + # The laxer rule will continue to work if Drupal uses this new URL + # pattern with front controllers other than update.php in a future + # release. + location ~ '\.php$|^/update.php' { + fastcgi_split_path_info ^(.+?\.php)(|/.*)$; + # Security note: If you're running a version of PHP older than the + # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. + # See http://serverfault.com/q/627903/94922 for details. + include fastcgi_params; + # Block httpoxy attacks. See https://httpoxy.org/. + fastcgi_param HTTP_PROXY ""; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_intercept_errors on; + fastcgi_pass {{ fastcgi_pass }}; + } + + # Fighting with Styles? This little gem is amazing. + location ~ ^/{{ file_public_path }}/styles/ { + try_files $uri @rewrite; + } + + # Handle private files through Drupal. + location ~ ^/system/files/ { + try_files $uri /index.php?$query_string; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { + expires max; + log_not_found off; + } +} diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index dc02dfb114fb6af2eacf89407a529c37ab8e7eb8..fce8549f0781bafdc7da2301b84d048286757445 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -279,7 +279,7 @@ public function isClassMapAuthoritative() */ public function setApcuPrefix($apcuPrefix) { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** @@ -377,7 +377,7 @@ private function findFileWithExtension($class, $ext) $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); - $search = $subPath.'\\'; + $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 5fda7ff2c50bbace59d8b4191214fcf0f556165a..c5e34374e7dd0d909d5c6cac61e53d4a2308ceaa 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -319,6 +319,48 @@ 'Consolidation\\AnnotatedCommand\\Parser\\Internal\\FullyQualifiedClassCache' => $vendorDir . '/consolidation/annotated-command/src/Parser/Internal/FullyQualifiedClassCache.php', 'Consolidation\\AnnotatedCommand\\Parser\\Internal\\TagFactory' => $vendorDir . '/consolidation/annotated-command/src/Parser/Internal/TagFactory.php', 'Consolidation\\AnnotatedCommand\\ResultWriter' => $vendorDir . '/consolidation/annotated-command/src/ResultWriter.php', + 'Consolidation\\Config\\Config' => $vendorDir . '/consolidation/config/src/Config.php', + 'Consolidation\\Config\\ConfigAwareInterface' => $vendorDir . '/consolidation/config/src/ConfigAwareInterface.php', + 'Consolidation\\Config\\ConfigAwareTrait' => $vendorDir . '/consolidation/config/src/ConfigAwareTrait.php', + 'Consolidation\\Config\\ConfigInterface' => $vendorDir . '/consolidation/config/src/ConfigInterface.php', + 'Consolidation\\Config\\GlobalOptionDefaultValuesInterface' => $vendorDir . '/consolidation/config/src/GlobalOptionDefaultValuesInterface.php', + 'Consolidation\\Config\\Inject\\ConfigForCommand' => $vendorDir . '/consolidation/config/src/Inject/ConfigForCommand.php', + 'Consolidation\\Config\\Inject\\ConfigForSetters' => $vendorDir . '/consolidation/config/src/Inject/ConfigForSetters.php', + 'Consolidation\\Config\\Loader\\ConfigLoader' => $vendorDir . '/consolidation/config/src/Loader/ConfigLoader.php', + 'Consolidation\\Config\\Loader\\ConfigLoaderInterface' => $vendorDir . '/consolidation/config/src/Loader/ConfigLoaderInterface.php', + 'Consolidation\\Config\\Loader\\ConfigProcessor' => $vendorDir . '/consolidation/config/src/Loader/ConfigProcessor.php', + 'Consolidation\\Config\\Loader\\YamlConfigLoader' => $vendorDir . '/consolidation/config/src/Loader/YamlConfigLoader.php', + 'Consolidation\\Config\\Util\\ArrayUtil' => $vendorDir . '/consolidation/config/src/Util/ArrayUtil.php', + 'Consolidation\\Config\\Util\\ConfigFallback' => $vendorDir . '/consolidation/config/src/Util/ConfigFallback.php', + 'Consolidation\\Config\\Util\\ConfigGroup' => $vendorDir . '/consolidation/config/src/Util/ConfigGroup.php', + 'Consolidation\\Config\\Util\\ConfigInterpolatorInterface' => $vendorDir . '/consolidation/config/src/Util/ConfigInterpolatorInterface.php', + 'Consolidation\\Config\\Util\\ConfigInterpolatorTrait' => $vendorDir . '/consolidation/config/src/Util/ConfigInterpolatorTrait.php', + 'Consolidation\\Config\\Util\\ConfigMerge' => $vendorDir . '/consolidation/config/src/Util/ConfigMerge.php', + 'Consolidation\\Config\\Util\\ConfigOverlay' => $vendorDir . '/consolidation/config/src/Util/ConfigOverlay.php', + 'Consolidation\\Config\\Util\\ConfigRuntimeInterface' => $vendorDir . '/consolidation/config/src/Util/ConfigRuntimeInterface.php', + 'Consolidation\\Config\\Util\\EnvConfig' => $vendorDir . '/consolidation/config/src/Util/EnvConfig.php', + 'Consolidation\\Config\\Util\\Interpolator' => $vendorDir . '/consolidation/config/src/Util/Interpolator.php', + 'Consolidation\\Filter\\Cli\\OpCommands' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/Cli/OpCommands.php', + 'Consolidation\\Filter\\FactoryInterface' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/FactoryInterface.php', + 'Consolidation\\Filter\\FilterOutputData' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/FilterOutputData.php', + 'Consolidation\\Filter\\Hooks\\FilterHooks' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/Hooks/FilterHooks.php', + 'Consolidation\\Filter\\LogicalOpFactory' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/LogicalOpFactory.php', + 'Consolidation\\Filter\\OperatorFactory' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/OperatorFactory.php', + 'Consolidation\\Filter\\OperatorInterface' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/OperatorInterface.php', + 'Consolidation\\Filter\\Operators\\ContainsOp' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/Operators/ContainsOp.php', + 'Consolidation\\Filter\\Operators\\EqualsOp' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/Operators/EqualsOp.php', + 'Consolidation\\Filter\\Operators\\LogicalAndOp' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/Operators/LogicalAndOp.php', + 'Consolidation\\Filter\\Operators\\LogicalOrOp' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/Operators/LogicalOrOp.php', + 'Consolidation\\Filter\\Operators\\NotOp' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/Operators/NotOp.php', + 'Consolidation\\Filter\\Operators\\RegexOp' => $vendorDir . '/consolidation/filter-via-dot-access-data/src/Operators/RegexOp.php', + 'Consolidation\\Log\\ConsoleLogLevel' => $vendorDir . '/consolidation/log/src/ConsoleLogLevel.php', + 'Consolidation\\Log\\LogOutputStyler' => $vendorDir . '/consolidation/log/src/LogOutputStyler.php', + 'Consolidation\\Log\\LogOutputStylerInterface' => $vendorDir . '/consolidation/log/src/LogOutputStylerInterface.php', + 'Consolidation\\Log\\Logger' => $vendorDir . '/consolidation/log/src/Logger.php', + 'Consolidation\\Log\\LoggerManager' => $vendorDir . '/consolidation/log/src/LoggerManager.php', + 'Consolidation\\Log\\StylableLoggerInterface' => $vendorDir . '/consolidation/log/src/StylableLoggerInterface.php', + 'Consolidation\\Log\\SymfonyLogOutputStyler' => $vendorDir . '/consolidation/log/src/SymfonyLogOutputStyler.php', + 'Consolidation\\Log\\UnstyledLogOutputStyler' => $vendorDir . '/consolidation/log/src/UnstyledLogOutputStyler.php', 'Consolidation\\OutputFormatters\\Exception\\AbstractDataFormatException' => $vendorDir . '/consolidation/output-formatters/src/Exception/AbstractDataFormatException.php', 'Consolidation\\OutputFormatters\\Exception\\IncompatibleDataException' => $vendorDir . '/consolidation/output-formatters/src/Exception/IncompatibleDataException.php', 'Consolidation\\OutputFormatters\\Exception\\InvalidFormatException' => $vendorDir . '/consolidation/output-formatters/src/Exception/InvalidFormatException.php', @@ -394,6 +436,45 @@ 'Consolidation\\OutputFormatters\\Validate\\ValidDataTypesInterface' => $vendorDir . '/consolidation/output-formatters/src/Validate/ValidDataTypesInterface.php', 'Consolidation\\OutputFormatters\\Validate\\ValidDataTypesTrait' => $vendorDir . '/consolidation/output-formatters/src/Validate/ValidDataTypesTrait.php', 'Consolidation\\OutputFormatters\\Validate\\ValidationInterface' => $vendorDir . '/consolidation/output-formatters/src/Validate/ValidationInterface.php', + 'Consolidation\\SiteAlias\\Cli\\SiteAliasCommands' => $vendorDir . '/consolidation/site-alias/src/Cli/SiteAliasCommands.php', + 'Consolidation\\SiteAlias\\DataFileLoaderInterface' => $vendorDir . '/consolidation/site-alias/src/DataFileLoaderInterface.php', + 'Consolidation\\SiteAlias\\HostPath' => $vendorDir . '/consolidation/site-alias/src/HostPath.php', + 'Consolidation\\SiteAlias\\SiteAlias' => $vendorDir . '/consolidation/site-alias/src/SiteAlias.php', + 'Consolidation\\SiteAlias\\SiteAliasFileDiscovery' => $vendorDir . '/consolidation/site-alias/src/SiteAliasFileDiscovery.php', + 'Consolidation\\SiteAlias\\SiteAliasFileLoader' => $vendorDir . '/consolidation/site-alias/src/SiteAliasFileLoader.php', + 'Consolidation\\SiteAlias\\SiteAliasInterface' => $vendorDir . '/consolidation/site-alias/src/SiteAliasInterface.php', + 'Consolidation\\SiteAlias\\SiteAliasManager' => $vendorDir . '/consolidation/site-alias/src/SiteAliasManager.php', + 'Consolidation\\SiteAlias\\SiteAliasManagerAwareInterface' => $vendorDir . '/consolidation/site-alias/src/SiteAliasManagerAwareInterface.php', + 'Consolidation\\SiteAlias\\SiteAliasManagerAwareTrait' => $vendorDir . '/consolidation/site-alias/src/SiteAliasManagerAwareTrait.php', + 'Consolidation\\SiteAlias\\SiteAliasManagerInitializationInterface' => $vendorDir . '/consolidation/site-alias/src/SiteAliasManagerInitializationInterface.php', + 'Consolidation\\SiteAlias\\SiteAliasManagerInterface' => $vendorDir . '/consolidation/site-alias/src/SiteAliasManagerInterface.php', + 'Consolidation\\SiteAlias\\SiteAliasName' => $vendorDir . '/consolidation/site-alias/src/SiteAliasName.php', + 'Consolidation\\SiteAlias\\SiteAliasTrait' => $vendorDir . '/consolidation/site-alias/src/SiteAliasTrait.php', + 'Consolidation\\SiteAlias\\SiteAliasWithConfig' => $vendorDir . '/consolidation/site-alias/src/SiteAliasWithConfig.php', + 'Consolidation\\SiteAlias\\SiteSpecParser' => $vendorDir . '/consolidation/site-alias/src/SiteSpecParser.php', + 'Consolidation\\SiteAlias\\Util\\FsUtils' => $vendorDir . '/consolidation/site-alias/src/Util/FsUtils.php', + 'Consolidation\\SiteAlias\\Util\\YamlDataFileLoader' => $vendorDir . '/consolidation/site-alias/src/Util/YamlDataFileLoader.php', + 'Consolidation\\SiteProcess\\Factory\\DockerComposeTransportFactory' => $vendorDir . '/consolidation/site-process/src/Factory/DockerComposeTransportFactory.php', + 'Consolidation\\SiteProcess\\Factory\\SshTransportFactory' => $vendorDir . '/consolidation/site-process/src/Factory/SshTransportFactory.php', + 'Consolidation\\SiteProcess\\Factory\\TransportFactoryInterface' => $vendorDir . '/consolidation/site-process/src/Factory/TransportFactoryInterface.php', + 'Consolidation\\SiteProcess\\Factory\\VagrantTransportFactory' => $vendorDir . '/consolidation/site-process/src/Factory/VagrantTransportFactory.php', + 'Consolidation\\SiteProcess\\ProcessBase' => $vendorDir . '/consolidation/site-process/src/ProcessBase.php', + 'Consolidation\\SiteProcess\\ProcessManager' => $vendorDir . '/consolidation/site-process/src/ProcessManager.php', + 'Consolidation\\SiteProcess\\ProcessManagerAwareInterface' => $vendorDir . '/consolidation/site-process/src/ProcessManagerAwareInterface.php', + 'Consolidation\\SiteProcess\\ProcessManagerAwareTrait' => $vendorDir . '/consolidation/site-process/src/ProcessManagerAwareTrait.php', + 'Consolidation\\SiteProcess\\Remo\\RemoCommands' => $vendorDir . '/consolidation/site-process/src/Remo/RemoCommands.php', + 'Consolidation\\SiteProcess\\SiteProcess' => $vendorDir . '/consolidation/site-process/src/SiteProcess.php', + 'Consolidation\\SiteProcess\\Transport\\DockerComposeTransport' => $vendorDir . '/consolidation/site-process/src/Transport/DockerComposeTransport.php', + 'Consolidation\\SiteProcess\\Transport\\LocalTransport' => $vendorDir . '/consolidation/site-process/src/Transport/LocalTransport.php', + 'Consolidation\\SiteProcess\\Transport\\SshTransport' => $vendorDir . '/consolidation/site-process/src/Transport/SshTransport.php', + 'Consolidation\\SiteProcess\\Transport\\TransportInterface' => $vendorDir . '/consolidation/site-process/src/Transport/TransportInterface.php', + 'Consolidation\\SiteProcess\\Transport\\VagrantTransport' => $vendorDir . '/consolidation/site-process/src/Transport/VagrantTransport.php', + 'Consolidation\\SiteProcess\\Util\\ArgumentProcessor' => $vendorDir . '/consolidation/site-process/src/Util/ArgumentProcessor.php', + 'Consolidation\\SiteProcess\\Util\\Escape' => $vendorDir . '/consolidation/site-process/src/Util/Escape.php', + 'Consolidation\\SiteProcess\\Util\\RealtimeOutputHandler' => $vendorDir . '/consolidation/site-process/src/Util/RealtimeOutputHandler.php', + 'Consolidation\\SiteProcess\\Util\\Shell' => $vendorDir . '/consolidation/site-process/src/Util/Shell.php', + 'Consolidation\\SiteProcess\\Util\\ShellOperatorInterface' => $vendorDir . '/consolidation/site-process/src/Util/ShellOperatorInterface.php', + 'Consolidation\\SiteProcess\\Util\\Tty' => $vendorDir . '/consolidation/site-process/src/Util/Tty.php', 'Dflydev\\DotAccessConfiguration\\AbstractConfiguration' => $vendorDir . '/dflydev/dot-access-configuration/src/Dflydev/DotAccessConfiguration/AbstractConfiguration.php', 'Dflydev\\DotAccessConfiguration\\AbstractConfigurationBuilder' => $vendorDir . '/dflydev/dot-access-configuration/src/Dflydev/DotAccessConfiguration/AbstractConfigurationBuilder.php', 'Dflydev\\DotAccessConfiguration\\AbstractPlaceholderResolverFactory' => $vendorDir . '/dflydev/dot-access-configuration/src/Dflydev/DotAccessConfiguration/AbstractPlaceholderResolverFactory.php', @@ -539,6 +620,123 @@ 'Doctrine\\Common\\Util\\Inflector' => $vendorDir . '/doctrine/common/lib/Doctrine/Common/Util/Inflector.php', 'Doctrine\\Common\\Version' => $vendorDir . '/doctrine/common/lib/Doctrine/Common/Version.php', 'Drupal' => $baseDir . '/web/core/lib/Drupal.php', + 'DrupalCodeGenerator\\ApplicationFactory' => $vendorDir . '/chi-teck/drupal-code-generator/src/ApplicationFactory.php', + 'DrupalCodeGenerator\\Asset' => $vendorDir . '/chi-teck/drupal-code-generator/src/Asset.php', + 'DrupalCodeGenerator\\Box\\PhpCompactor' => $vendorDir . '/chi-teck/drupal-code-generator/src/Box/PhpCompactor.php', + 'DrupalCodeGenerator\\Command\\BaseGenerator' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/BaseGenerator.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\CToolsPlugin\\Access' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Access.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\CToolsPlugin\\BasePlugin' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/BasePlugin.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\CToolsPlugin\\ContentType' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/ContentType.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\CToolsPlugin\\Relationship' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Relationship.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Hook' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Hook.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\InstallFile' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/InstallFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Javascript' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Javascript.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Module' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Module.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\ModuleFile' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\ModuleInfo' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleInfo.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Settings' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Settings.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\TemplatePhp' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/TemplatePhp.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Test' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Test.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Theme' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Theme.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\ThemeInfo' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/ThemeInfo.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\ViewsPlugin\\ArgumentDefault' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/ViewsPlugin/ArgumentDefault.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Composer' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Composer.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Controller' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Controller.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Field' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Field.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Form\\Config' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Config.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Form\\Confirm' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Confirm.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Form\\RouteInteractionTrait' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/RouteInteractionTrait.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Form\\Simple' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Simple.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Hook' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Hook.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\InstallFile' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/InstallFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Javascript' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Javascript.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Layout' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Layout.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\ModuleFile' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/ModuleFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Module\\ConfigurationEntity' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ConfigurationEntity.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Module\\ContentEntity' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ContentEntity.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Module\\Standard' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/Standard.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\PluginManager' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/PluginManager.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Action' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Action.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Block' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Block.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\CKEditor' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/CKEditor.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Condition' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Condition.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Constraint' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Constraint.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\EntityReferenceSelection' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/EntityReferenceSelection.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Field\\Formatter' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Formatter.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Field\\Type' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Type.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Field\\Widget' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Widget.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Filter' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Filter.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\MenuLink' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/MenuLink.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Migrate\\Destination' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Destination.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Migrate\\Process' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Process.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Migrate\\Source' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Source.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\QueueWorker' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/QueueWorker.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\RestResource' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/RestResource.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Views\\ArgumentDefault' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/ArgumentDefault.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Views\\Field' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Field.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Views\\Style' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Style.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Project' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Project.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\RenderElement' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/RenderElement.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\ServiceProvider' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/ServiceProvider.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\AccessChecker' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/AccessChecker.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\BreadcrumbBuilder' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/BreadcrumbBuilder.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\CacheContext' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/CacheContext.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\Custom' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Custom.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\EventSubscriber' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/EventSubscriber.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\Logger' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Logger.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\Middleware' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Middleware.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\ParamConverter' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ParamConverter.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\PathProcessor' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/PathProcessor.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\RequestPolicy' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RequestPolicy.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\ResponsePolicy' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ResponsePolicy.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\RouteSubscriber' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RouteSubscriber.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\ThemeNegotiator' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ThemeNegotiator.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\TwigExtension' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/TwigExtension.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\UninstallValidator' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/UninstallValidator.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\SettingsLocal' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/SettingsLocal.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Template' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Template.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Browser' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Browser.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Kernel' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Kernel.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Nightwatch' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Nightwatch.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Unit' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Unit.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Web' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Web.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\WebDriver' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/WebDriver.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Theme' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Theme.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\ThemeFile' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\ThemeSettings' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeSettings.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Breakpoints' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Breakpoints.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Links\\Action' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Action.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Links\\Contextual' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Contextual.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Links\\Menu' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Menu.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Links\\Task' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Task.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\ModuleInfo' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleInfo.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\ModuleLibraries' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleLibraries.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Permissions' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Permissions.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Routing' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Routing.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Services' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Services.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\ThemeInfo' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeInfo.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\ThemeLibraries' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeLibraries.php', + 'DrupalCodeGenerator\\Command\\GeneratorInterface' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/GeneratorInterface.php', + 'DrupalCodeGenerator\\Command\\Navigation' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Navigation.php', + 'DrupalCodeGenerator\\Command\\Other\\ApacheVirtualHost' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Other/ApacheVirtualHost.php', + 'DrupalCodeGenerator\\Command\\Other\\DcgCommand' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Other/DcgCommand.php', + 'DrupalCodeGenerator\\Command\\Other\\DrupalConsoleCommand' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Other/DrupalConsoleCommand.php', + 'DrupalCodeGenerator\\Command\\Other\\DrushCommand' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Other/DrushCommand.php', + 'DrupalCodeGenerator\\Command\\Other\\HtmlPage' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Other/HtmlPage.php', + 'DrupalCodeGenerator\\Command\\Other\\NginxVirtualHost' => $vendorDir . '/chi-teck/drupal-code-generator/src/Command/Other/NginxVirtualHost.php', + 'DrupalCodeGenerator\\GeneratorDiscovery' => $vendorDir . '/chi-teck/drupal-code-generator/src/GeneratorDiscovery.php', + 'DrupalCodeGenerator\\GeneratorTester' => $vendorDir . '/chi-teck/drupal-code-generator/src/GeneratorTester.php', + 'DrupalCodeGenerator\\Helper\\Dumper' => $vendorDir . '/chi-teck/drupal-code-generator/src/Helper/Dumper.php', + 'DrupalCodeGenerator\\Helper\\InputHandler' => $vendorDir . '/chi-teck/drupal-code-generator/src/Helper/InputHandler.php', + 'DrupalCodeGenerator\\Helper\\OutputHandler' => $vendorDir . '/chi-teck/drupal-code-generator/src/Helper/OutputHandler.php', + 'DrupalCodeGenerator\\Helper\\QuestionSettersTrait' => $vendorDir . '/chi-teck/drupal-code-generator/src/Helper/QuestionSettersTrait.php', + 'DrupalCodeGenerator\\Helper\\Renderer' => $vendorDir . '/chi-teck/drupal-code-generator/src/Helper/Renderer.php', + 'DrupalCodeGenerator\\LegacyUtilsTrait' => $vendorDir . '/chi-teck/drupal-code-generator/src/LegacyUtilsTrait.php', + 'DrupalCodeGenerator\\Twig\\Twig1Environment' => $vendorDir . '/chi-teck/drupal-code-generator/src/Twig/Twig1Environment.php', + 'DrupalCodeGenerator\\Twig\\Twig2Environment' => $vendorDir . '/chi-teck/drupal-code-generator/src/Twig/Twig2Environment.php', + 'DrupalCodeGenerator\\Twig\\TwigSortSetNode' => $vendorDir . '/chi-teck/drupal-code-generator/src/Twig/TwigSortSetNode.php', + 'DrupalCodeGenerator\\Twig\\TwigSortTokenParser' => $vendorDir . '/chi-teck/drupal-code-generator/src/Twig/TwigSortTokenParser.php', + 'DrupalCodeGenerator\\Utils' => $vendorDir . '/chi-teck/drupal-code-generator/src/Utils.php', 'DrupalComposer\\DrupalScaffold\\CommandProvider' => $vendorDir . '/drupal-composer/drupal-scaffold/src/CommandProvider.php', 'DrupalComposer\\DrupalScaffold\\DrupalScaffoldCommand' => $vendorDir . '/drupal-composer/drupal-scaffold/src/DrupalScaffoldCommand.php', 'DrupalComposer\\DrupalScaffold\\FileFetcher' => $vendorDir . '/drupal-composer/drupal-scaffold/src/FileFetcher.php', @@ -1972,8 +2170,6 @@ 'Drupal\\Core\\Language\\LanguageManager' => $baseDir . '/web/core/lib/Drupal/Core/Language/LanguageManager.php', 'Drupal\\Core\\Language\\LanguageManagerInterface' => $baseDir . '/web/core/lib/Drupal/Core/Language/LanguageManagerInterface.php', 'Drupal\\Core\\Layout\\Annotation\\Layout' => $baseDir . '/web/core/lib/Drupal/Core/Layout/Annotation/Layout.php', - 'Drupal\\Core\\Layout\\Icon\\IconBuilderInterface' => $baseDir . '/web/core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php', - 'Drupal\\Core\\Layout\\Icon\\SvgIconBuilder' => $baseDir . '/web/core/lib/Drupal/Core/Layout/Icon/SvgIconBuilder.php', 'Drupal\\Core\\Layout\\LayoutDefault' => $baseDir . '/web/core/lib/Drupal/Core/Layout/LayoutDefault.php', 'Drupal\\Core\\Layout\\LayoutDefinition' => $baseDir . '/web/core/lib/Drupal/Core/Layout/LayoutDefinition.php', 'Drupal\\Core\\Layout\\LayoutInterface' => $baseDir . '/web/core/lib/Drupal/Core/Layout/LayoutInterface.php', @@ -2541,92 +2737,171 @@ 'Drupal\\redis\\Queue\\ReliableQueueBase' => $baseDir . '/web/modules/redis/src/Queue/ReliableQueueBase.php', 'Drupal\\redis\\Queue\\ReliableQueueRedisFactory' => $baseDir . '/web/modules/redis/src/Queue/ReliableQueueRedisFactory.php', 'Drupal\\redis\\RedisPrefixTrait' => $baseDir . '/web/modules/redis/src/RedisPrefixTrait.php', - 'Drush\\Boot\\BaseBoot' => $vendorDir . '/drush/drush/lib/Drush/Boot/BaseBoot.php', - 'Drush\\Boot\\Boot' => $vendorDir . '/drush/drush/lib/Drush/Boot/Boot.php', - 'Drush\\Boot\\DrupalBoot' => $vendorDir . '/drush/drush/lib/Drush/Boot/DrupalBoot.php', - 'Drush\\Boot\\DrupalBoot6' => $vendorDir . '/drush/drush/lib/Drush/Boot/DrupalBoot6.php', - 'Drush\\Boot\\DrupalBoot7' => $vendorDir . '/drush/drush/lib/Drush/Boot/DrupalBoot7.php', - 'Drush\\Boot\\DrupalBoot8' => $vendorDir . '/drush/drush/lib/Drush/Boot/DrupalBoot8.php', - 'Drush\\Boot\\EmptyBoot' => $vendorDir . '/drush/drush/lib/Drush/Boot/EmptyBoot.php', - 'Drush\\Cache\\CacheInterface' => $vendorDir . '/drush/drush/lib/Drush/Cache/CacheInterface.php', - 'Drush\\Cache\\FileCache' => $vendorDir . '/drush/drush/lib/Drush/Cache/FileCache.php', - 'Drush\\Cache\\JSONCache' => $vendorDir . '/drush/drush/lib/Drush/Cache/JSONCache.php', - 'Drush\\CommandFiles\\Core\\BrowseCommands' => $vendorDir . '/drush/drush/lib/Drush/CommandFiles/core/browseCommands.php', - 'Drush\\CommandFiles\\ExampleCommandFile' => $vendorDir . '/drush/drush/lib/Drush/CommandFiles/ExampleCommandFile.php', - 'Drush\\CommandFiles\\core\\DrupliconCommands' => $vendorDir . '/drush/drush/lib/Drush/CommandFiles/core/DrupliconCommands.php', - 'Drush\\Command\\Commandfiles' => $vendorDir . '/drush/drush/lib/Drush/Command/Commandfiles.php', - 'Drush\\Command\\CommandfilesInterface' => $vendorDir . '/drush/drush/lib/Drush/Command/CommandfilesInterface.php', - 'Drush\\Command\\DrushInputAdapter' => $vendorDir . '/drush/drush/lib/Drush/Command/DrushInputAdapter.php', - 'Drush\\Command\\DrushOutputAdapter' => $vendorDir . '/drush/drush/lib/Drush/Command/DrushOutputAdapter.php', - 'Drush\\Command\\ServiceCommandlist' => $vendorDir . '/drush/drush/lib/Drush/Command/ServiceCommandlist.php', - 'Drush\\Commands\\DrushCommands' => $vendorDir . '/drush/drush/lib/Drush/Commands/DrushCommands.php', - 'Drush\\Commands\\core\\SanitizeCommands' => $vendorDir . '/drush/drush/lib/Drush/Commands/core/SanitizeCommands.php', - 'Drush\\Commands\\core\\StatusCommands' => $vendorDir . '/drush/drush/lib/Drush/Commands/core/StatusCommands.php', - 'Drush\\ConfigAdapter' => $vendorDir . '/drush/drush/lib/Drush/ConfigAdapter.php', - 'Drush\\Drupal\\DrupalKernel' => $vendorDir . '/drush/drush/lib/Drush/Drupal/DrupalKernel.php', - 'Drush\\Drupal\\DrushServiceModifier' => $vendorDir . '/drush/drush/lib/Drush/Drupal/DrushServiceModifier.php', - 'Drush\\Drupal\\ExtensionDiscovery' => $vendorDir . '/drush/drush/lib/Drush/Drupal/ExtensionDiscovery.php', - 'Drush\\Drupal\\FindCommandsCompilerPass' => $vendorDir . '/drush/drush/lib/Drush/Drupal/FindCommandsCompilerPass.php', - 'Drush\\Drush' => $vendorDir . '/drush/drush/lib/Drush/Drush.php', - 'Drush\\DrushConfig' => $vendorDir . '/drush/drush/lib/Drush/DrushConfig.php', - 'Drush\\Exceptions\\UserAbortException' => $vendorDir . '/drush/drush/lib/Drush/Exceptions/UserAbortException.php', - 'Drush\\Log\\DrushLog' => $vendorDir . '/drush/drush/lib/Drush/Log/DrushLog.php', - 'Drush\\Log\\LogLevel' => $vendorDir . '/drush/drush/lib/Drush/Log/LogLevel.php', - 'Drush\\Log\\Logger' => $vendorDir . '/drush/drush/lib/Drush/Log/Logger.php', - 'Drush\\Make\\Parser\\ParserIni' => $vendorDir . '/drush/drush/lib/Drush/Make/Parser/ParserIni.php', - 'Drush\\Make\\Parser\\ParserInterface' => $vendorDir . '/drush/drush/lib/Drush/Make/Parser/ParserInterface.php', - 'Drush\\Make\\Parser\\ParserYaml' => $vendorDir . '/drush/drush/lib/Drush/Make/Parser/ParserYaml.php', - 'Drush\\Psysh\\Caster' => $vendorDir . '/drush/drush/lib/Drush/Psysh/Caster.php', - 'Drush\\Psysh\\DrushCommand' => $vendorDir . '/drush/drush/lib/Drush/Psysh/DrushCommand.php', - 'Drush\\Psysh\\DrushHelpCommand' => $vendorDir . '/drush/drush/lib/Drush/Psysh/DrushHelpCommand.php', - 'Drush\\Psysh\\Shell' => $vendorDir . '/drush/drush/lib/Drush/Psysh/Shell.php', - 'Drush\\Queue\\Queue6' => $vendorDir . '/drush/drush/lib/Drush/Queue/Queue6.php', - 'Drush\\Queue\\Queue7' => $vendorDir . '/drush/drush/lib/Drush/Queue/Queue7.php', - 'Drush\\Queue\\Queue8' => $vendorDir . '/drush/drush/lib/Drush/Queue/Queue8.php', - 'Drush\\Queue\\QueueBase' => $vendorDir . '/drush/drush/lib/Drush/Queue/QueueBase.php', - 'Drush\\Queue\\QueueException' => $vendorDir . '/drush/drush/lib/Drush/Queue/QueueException.php', - 'Drush\\Queue\\QueueInterface' => $vendorDir . '/drush/drush/lib/Drush/Queue/QueueInterface.php', - 'Drush\\Role\\Role6' => $vendorDir . '/drush/drush/lib/Drush/Role/Role6.php', - 'Drush\\Role\\Role7' => $vendorDir . '/drush/drush/lib/Drush/Role/Role7.php', - 'Drush\\Role\\Role8' => $vendorDir . '/drush/drush/lib/Drush/Role/Role8.php', - 'Drush\\Role\\RoleBase' => $vendorDir . '/drush/drush/lib/Drush/Role/RoleBase.php', - 'Drush\\Role\\RoleException' => $vendorDir . '/drush/drush/lib/Drush/Role/RoleException.php', - 'Drush\\SiteAlias\\AliasManagerAdapter' => $vendorDir . '/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapter.php', - 'Drush\\SiteAlias\\AliasManagerAdapterInjector' => $vendorDir . '/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapterInjector.php', - 'Drush\\SiteAlias\\ProcessManager' => $vendorDir . '/drush/drush/lib/Drush/SiteAlias/ProcessManager.php', - 'Drush\\SiteAlias\\ProcessManagerInjector' => $vendorDir . '/drush/drush/lib/Drush/SiteAlias/ProcessManagerInjector.php', - 'Drush\\Sql\\Sql6' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sql6.php', - 'Drush\\Sql\\Sql7' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sql7.php', - 'Drush\\Sql\\Sql8' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sql8.php', - 'Drush\\Sql\\SqlBase' => $vendorDir . '/drush/drush/lib/Drush/Sql/SqlBase.php', - 'Drush\\Sql\\SqlException' => $vendorDir . '/drush/drush/lib/Drush/Sql/SqlException.php', - 'Drush\\Sql\\SqlVersion' => $vendorDir . '/drush/drush/lib/Drush/Sql/SqlVersion.php', - 'Drush\\Sql\\Sqlmysql' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sqlmysql.php', - 'Drush\\Sql\\Sqlmysqli' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sqlmysqli.php', - 'Drush\\Sql\\Sqloracle' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sqloracle.php', - 'Drush\\Sql\\Sqlpgsql' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sqlpgsql.php', - 'Drush\\Sql\\Sqlsqlite' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sqlsqlite.php', - 'Drush\\Sql\\Sqlsqlsrv' => $vendorDir . '/drush/drush/lib/Drush/Sql/Sqlsqlsrv.php', + 'Drush\\Application' => $vendorDir . '/drush/drush/src/Application.php', + 'Drush\\Backend\\BackendPathEvaluator' => $vendorDir . '/drush/drush/src/Backend/BackendPathEvaluator.php', + 'Drush\\Backend\\BackendResultSetter' => $vendorDir . '/drush/drush/src/Backend/BackendResultSetter.php', + 'Drush\\Boot\\AutoloaderAwareInterface' => $vendorDir . '/drush/drush/src/Boot/AutoloaderAwareInterface.php', + 'Drush\\Boot\\AutoloaderAwareTrait' => $vendorDir . '/drush/drush/src/Boot/AutoloaderAwareTrait.php', + 'Drush\\Boot\\BaseBoot' => $vendorDir . '/drush/drush/src/Boot/BaseBoot.php', + 'Drush\\Boot\\Boot' => $vendorDir . '/drush/drush/src/Boot/Boot.php', + 'Drush\\Boot\\BootstrapHook' => $vendorDir . '/drush/drush/src/Boot/BootstrapHook.php', + 'Drush\\Boot\\BootstrapManager' => $vendorDir . '/drush/drush/src/Boot/BootstrapManager.php', + 'Drush\\Boot\\DrupalBoot' => $vendorDir . '/drush/drush/src/Boot/DrupalBoot.php', + 'Drush\\Boot\\DrupalBoot8' => $vendorDir . '/drush/drush/src/Boot/DrupalBoot8.php', + 'Drush\\Boot\\EmptyBoot' => $vendorDir . '/drush/drush/src/Boot/EmptyBoot.php', + 'Drush\\Boot\\Kernels' => $vendorDir . '/drush/drush/src/Boot/Kernels.php', + 'Drush\\Cache\\CacheInterface' => $vendorDir . '/drush/drush/src/Cache/CacheInterface.php', + 'Drush\\Cache\\CommandCache' => $vendorDir . '/drush/drush/src/Cache/CommandCache.php', + 'Drush\\Cache\\FileCache' => $vendorDir . '/drush/drush/src/Cache/FileCache.php', + 'Drush\\Cache\\JSONCache' => $vendorDir . '/drush/drush/src/Cache/JSONCache.php', + 'Drush\\Command\\DrushCommandInfoAlterer' => $vendorDir . '/drush/drush/src/Command/DrushCommandInfoAlterer.php', + 'Drush\\Command\\GlobalOptionsEventListener' => $vendorDir . '/drush/drush/src/Command/GlobalOptionsEventListener.php', + 'Drush\\Command\\RemoteCommandProxy' => $vendorDir . '/drush/drush/src/Command/RemoteCommandProxy.php', + 'Drush\\Command\\ServiceCommandlist' => $vendorDir . '/drush/drush/src/Command/ServiceCommandlist.php', + 'Drush\\Commands\\DrushCommands' => $vendorDir . '/drush/drush/src/Commands/DrushCommands.php', + 'Drush\\Commands\\ExampleCommands' => $vendorDir . '/drush/drush/src/Commands/ExampleCommands.php', + 'Drush\\Commands\\LegacyCommands' => $vendorDir . '/drush/drush/src/Commands/LegacyCommands.php', + 'Drush\\Commands\\OptionsCommands' => $vendorDir . '/drush/drush/src/Commands/OptionsCommands.php', + 'Drush\\Commands\\ValidatorsCommands' => $vendorDir . '/drush/drush/src/Commands/ValidatorsCommands.php', + 'Drush\\Commands\\config\\ConfigPullCommands' => $vendorDir . '/drush/drush/src/Commands/config/ConfigPullCommands.php', + 'Drush\\Commands\\core\\BrowseCommands' => $vendorDir . '/drush/drush/src/Commands/core/BrowseCommands.php', + 'Drush\\Commands\\core\\CacheCommands' => $vendorDir . '/drush/drush/src/Commands/core/CacheCommands.php', + 'Drush\\Commands\\core\\CoreCommands' => $vendorDir . '/drush/drush/src/Commands/core/CoreCommands.php', + 'Drush\\Commands\\core\\DocsCommands' => $vendorDir . '/drush/drush/src/Commands/core/DocsCommands.php', + 'Drush\\Commands\\core\\DrupalDirectoryCommands' => $vendorDir . '/drush/drush/src/Commands/core/DrupalDirectoryCommands.php', + 'Drush\\Commands\\core\\DrupliconCommands' => $vendorDir . '/drush/drush/src/Commands/core/DrupliconCommands.php', + 'Drush\\Commands\\core\\EditCommands' => $vendorDir . '/drush/drush/src/Commands/core/EditCommands.php', + 'Drush\\Commands\\core\\InitCommands' => $vendorDir . '/drush/drush/src/Commands/core/InitCommands.php', + 'Drush\\Commands\\core\\LoginCommands' => $vendorDir . '/drush/drush/src/Commands/core/LoginCommands.php', + 'Drush\\Commands\\core\\NotifyCommands' => $vendorDir . '/drush/drush/src/Commands/core/NotifyCommands.php', + 'Drush\\Commands\\core\\PhpCommands' => $vendorDir . '/drush/drush/src/Commands/core/PhpCommands.php', + 'Drush\\Commands\\core\\RsyncCommands' => $vendorDir . '/drush/drush/src/Commands/core/RsyncCommands.php', + 'Drush\\Commands\\core\\RunserverCommands' => $vendorDir . '/drush/drush/src/Commands/core/RunserverCommands.php', + 'Drush\\Commands\\core\\SiteCommands' => $vendorDir . '/drush/drush/src/Commands/core/SiteCommands.php', + 'Drush\\Commands\\core\\SiteInstallCommands' => $vendorDir . '/drush/drush/src/Commands/core/SiteInstallCommands.php', + 'Drush\\Commands\\core\\SshCommands' => $vendorDir . '/drush/drush/src/Commands/core/SshCommands.php', + 'Drush\\Commands\\core\\StatusCommands' => $vendorDir . '/drush/drush/src/Commands/core/StatusCommands.php', + 'Drush\\Commands\\core\\TopicCommands' => $vendorDir . '/drush/drush/src/Commands/core/TopicCommands.php', + 'Drush\\Commands\\core\\UpdateDBCommands' => $vendorDir . '/drush/drush/src/Commands/core/UpdateDBCommands.php', + 'Drush\\Commands\\core\\XhprofCommands' => $vendorDir . '/drush/drush/src/Commands/core/XhprofCommands.php', + 'Drush\\Commands\\generate\\GenerateCommands' => $vendorDir . '/drush/drush/src/Commands/generate/GenerateCommands.php', + 'Drush\\Commands\\generate\\Generators\\Drush\\DrushAliasFile' => $vendorDir . '/drush/drush/src/Commands/generate/Generators/Drush/DrushAliasFile.php', + 'Drush\\Commands\\generate\\Generators\\Drush\\DrushCommandFile' => $vendorDir . '/drush/drush/src/Commands/generate/Generators/Drush/DrushCommandFile.php', + 'Drush\\Commands\\generate\\Generators\\Migrate\\MigrationGenerator' => $vendorDir . '/drush/drush/src/Commands/generate/Generators/Migrate/MigrationGenerator.php', + 'Drush\\Commands\\generate\\Helper\\InputHandler' => $vendorDir . '/drush/drush/src/Commands/generate/Helper/InputHandler.php', + 'Drush\\Commands\\generate\\Helper\\OutputHandler' => $vendorDir . '/drush/drush/src/Commands/generate/Helper/OutputHandler.php', + 'Drush\\Commands\\help\\DrushHelpDocument' => $vendorDir . '/drush/drush/src/Commands/help/DrushHelpDocument.php', + 'Drush\\Commands\\help\\HelpCLIFormatter' => $vendorDir . '/drush/drush/src/Commands/help/HelpCLIFormatter.php', + 'Drush\\Commands\\help\\HelpCommands' => $vendorDir . '/drush/drush/src/Commands/help/HelpCommands.php', + 'Drush\\Commands\\help\\ListCommands' => $vendorDir . '/drush/drush/src/Commands/help/ListCommands.php', + 'Drush\\Commands\\pm\\SecurityUpdateCommands' => $vendorDir . '/drush/drush/src/Commands/pm/SecurityUpdateCommands.php', + 'Drush\\Commands\\sql\\SqlCommands' => $vendorDir . '/drush/drush/src/Commands/sql/SqlCommands.php', + 'Drush\\Commands\\sql\\SqlSyncCommands' => $vendorDir . '/drush/drush/src/Commands/sql/SqlSyncCommands.php', + 'Drush\\Config\\ConfigAwareTrait' => $vendorDir . '/drush/drush/src/Config/ConfigAwareTrait.php', + 'Drush\\Config\\ConfigLocator' => $vendorDir . '/drush/drush/src/Config/ConfigLocator.php', + 'Drush\\Config\\DrushConfig' => $vendorDir . '/drush/drush/src/Config/DrushConfig.php', + 'Drush\\Config\\Environment' => $vendorDir . '/drush/drush/src/Config/Environment.php', + 'Drush\\Config\\Loader\\YamlConfigLoader' => $vendorDir . '/drush/drush/src/Config/Loader/YamlConfigLoader.php', + 'Drush\\Drupal\\Commands\\config\\ConfigCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/config/ConfigCommands.php', + 'Drush\\Drupal\\Commands\\config\\ConfigExportCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php', + 'Drush\\Drupal\\Commands\\config\\ConfigImportCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php', + 'Drush\\Drupal\\Commands\\core\\BatchCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/BatchCommands.php', + 'Drush\\Drupal\\Commands\\core\\CliCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/CliCommands.php', + 'Drush\\Drupal\\Commands\\core\\DrupalCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/DrupalCommands.php', + 'Drush\\Drupal\\Commands\\core\\EntityCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/EntityCommands.php', + 'Drush\\Drupal\\Commands\\core\\ImageCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/ImageCommands.php', + 'Drush\\Drupal\\Commands\\core\\JsonapiCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/JsonapiCommands.php', + 'Drush\\Drupal\\Commands\\core\\LanguageCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/LanguageCommands.php', + 'Drush\\Drupal\\Commands\\core\\LocaleCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/LocaleCommands.php', + 'Drush\\Drupal\\Commands\\core\\MessengerCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/MessengerCommands.php', + 'Drush\\Drupal\\Commands\\core\\QueueCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/QueueCommands.php', + 'Drush\\Drupal\\Commands\\core\\RoleCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/RoleCommands.php', + 'Drush\\Drupal\\Commands\\core\\StateCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/StateCommands.php', + 'Drush\\Drupal\\Commands\\core\\TwigCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/TwigCommands.php', + 'Drush\\Drupal\\Commands\\core\\UserCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/UserCommands.php', + 'Drush\\Drupal\\Commands\\core\\ViewsCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/ViewsCommands.php', + 'Drush\\Drupal\\Commands\\core\\WatchdogCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/core/WatchdogCommands.php', + 'Drush\\Drupal\\Commands\\pm\\PmCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/pm/PmCommands.php', + 'Drush\\Drupal\\Commands\\pm\\ThemeCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/pm/ThemeCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/sql/SanitizeCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeCommentsCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/sql/SanitizeCommentsCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizePluginInterface' => $vendorDir . '/drush/drush/src/Drupal/Commands/sql/SanitizePluginInterface.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeSessionsCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/sql/SanitizeSessionsCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeUserFieldsCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/sql/SanitizeUserFieldsCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeUserTableCommands' => $vendorDir . '/drush/drush/src/Drupal/Commands/sql/SanitizeUserTableCommands.php', + 'Drush\\Drupal\\DrupalKernel' => $vendorDir . '/drush/drush/src/Drupal/DrupalKernel.php', + 'Drush\\Drupal\\DrupalKernelTrait' => $vendorDir . '/drush/drush/src/Drupal/DrupalKernelTrait.php', + 'Drush\\Drupal\\DrupalUtil' => $vendorDir . '/drush/drush/src/Drupal/DrupalUtil.php', + 'Drush\\Drupal\\DrushServiceModifier' => $vendorDir . '/drush/drush/src/Drupal/DrushServiceModifier.php', + 'Drush\\Drupal\\ExtensionDiscovery' => $vendorDir . '/drush/drush/src/Drupal/ExtensionDiscovery.php', + 'Drush\\Drupal\\FindCommandsCompilerPass' => $vendorDir . '/drush/drush/src/Drupal/FindCommandsCompilerPass.php', + 'Drush\\Drupal\\InstallerKernel' => $vendorDir . '/drush/drush/src/Drupal/InstallerKernel.php', + 'Drush\\Drupal\\UpdateKernel' => $vendorDir . '/drush/drush/src/Drupal/UpdateKernel.php', + 'Drush\\Drush' => $vendorDir . '/drush/drush/src/Drush.php', + 'Drush\\Exceptions\\UserAbortException' => $vendorDir . '/drush/drush/src/Exceptions/UserAbortException.php', + 'Drush\\Exec\\ExecTrait' => $vendorDir . '/drush/drush/src/Exec/ExecTrait.php', + 'Drush\\Formatters\\DrushFormatterManager' => $vendorDir . '/drush/drush/src/Formatters/DrushFormatterManager.php', + 'Drush\\Internal\\Config\\Yaml\\Escaper' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Escaper.php', + 'Drush\\Internal\\Config\\Yaml\\Exception\\ExceptionInterface' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Exception/ExceptionInterface.php', + 'Drush\\Internal\\Config\\Yaml\\Exception\\ParseException' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Exception/ParseException.php', + 'Drush\\Internal\\Config\\Yaml\\Exception\\RuntimeException' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Exception/RuntimeException.php', + 'Drush\\Internal\\Config\\Yaml\\Inline' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Inline.php', + 'Drush\\Internal\\Config\\Yaml\\Parser' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Parser.php', + 'Drush\\Internal\\Config\\Yaml\\Tag\\TaggedValue' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Tag/TaggedValue.php', + 'Drush\\Internal\\Config\\Yaml\\Unescaper' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Unescaper.php', + 'Drush\\Internal\\Config\\Yaml\\Yaml' => $vendorDir . '/drush/drush/src/internal-forks/Config/Yaml/Yaml.php', + 'Drush\\Log\\DrushLog' => $vendorDir . '/drush/drush/src/Log/DrushLog.php', + 'Drush\\Log\\LogLevel' => $vendorDir . '/drush/drush/src/Log/LogLevel.php', + 'Drush\\Log\\Logger' => $vendorDir . '/drush/drush/src/Log/Logger.php', + 'Drush\\Preflight\\ArgsPreprocessor' => $vendorDir . '/drush/drush/src/Preflight/ArgsPreprocessor.php', + 'Drush\\Preflight\\ArgsRemapper' => $vendorDir . '/drush/drush/src/Preflight/ArgsRemapper.php', + 'Drush\\Preflight\\LegacyPreflight' => $vendorDir . '/drush/drush/src/Preflight/LegacyPreflight.php', + 'Drush\\Preflight\\Preflight' => $vendorDir . '/drush/drush/src/Preflight/Preflight.php', + 'Drush\\Preflight\\PreflightArgs' => $vendorDir . '/drush/drush/src/Preflight/PreflightArgs.php', + 'Drush\\Preflight\\PreflightArgsInterface' => $vendorDir . '/drush/drush/src/Preflight/PreflightArgsInterface.php', + 'Drush\\Preflight\\PreflightLog' => $vendorDir . '/drush/drush/src/Preflight/PreflightLog.php', + 'Drush\\Preflight\\PreflightSiteLocator' => $vendorDir . '/drush/drush/src/Preflight/PreflightSiteLocator.php', + 'Drush\\Preflight\\PreflightVerify' => $vendorDir . '/drush/drush/src/Preflight/PreflightVerify.php', + 'Drush\\Preflight\\RedispatchToSiteLocal' => $vendorDir . '/drush/drush/src/Preflight/RedispatchToSiteLocal.php', + 'Drush\\Psysh\\Caster' => $vendorDir . '/drush/drush/src/Psysh/Caster.php', + 'Drush\\Psysh\\DrushCommand' => $vendorDir . '/drush/drush/src/Psysh/DrushCommand.php', + 'Drush\\Psysh\\DrushHelpCommand' => $vendorDir . '/drush/drush/src/Psysh/DrushHelpCommand.php', + 'Drush\\Psysh\\Shell' => $vendorDir . '/drush/drush/src/Psysh/Shell.php', + 'Drush\\Runtime\\DependencyInjection' => $vendorDir . '/drush/drush/src/Runtime/DependencyInjection.php', + 'Drush\\Runtime\\ErrorHandler' => $vendorDir . '/drush/drush/src/Runtime/ErrorHandler.php', + 'Drush\\Runtime\\HandlerInterface' => $vendorDir . '/drush/drush/src/Runtime/HandlerInterface.php', + 'Drush\\Runtime\\RedispatchHook' => $vendorDir . '/drush/drush/src/Runtime/RedispatchHook.php', + 'Drush\\Runtime\\Runtime' => $vendorDir . '/drush/drush/src/Runtime/Runtime.php', + 'Drush\\Runtime\\ShutdownHandler' => $vendorDir . '/drush/drush/src/Runtime/ShutdownHandler.php', + 'Drush\\Runtime\\TildeExpansionHook' => $vendorDir . '/drush/drush/src/Runtime/TildeExpansionHook.php', + 'Drush\\SiteAlias\\HostPath' => $vendorDir . '/drush/drush/src/SiteAlias/HostPath.php', + 'Drush\\SiteAlias\\LegacyAliasConverter' => $vendorDir . '/drush/drush/src/SiteAlias/LegacyAliasConverter.php', + 'Drush\\SiteAlias\\ProcessManager' => $vendorDir . '/drush/drush/src/SiteAlias/ProcessManager.php', + 'Drush\\SiteAlias\\SiteAliasFileLoader' => $vendorDir . '/drush/drush/src/SiteAlias/SiteAliasFileLoader.php', + 'Drush\\SiteAlias\\SiteAliasManagerAwareInterface' => $vendorDir . '/drush/drush/src/SiteAlias/SiteAliasManagerAwareInterface.php', + 'Drush\\SiteAlias\\SiteAliasManagerAwareTrait' => $vendorDir . '/drush/drush/src/SiteAlias/SiteAliasManagerAwareTrait.php', + 'Drush\\SiteAlias\\SiteAliasName' => $vendorDir . '/drush/drush/src/SiteAlias/SiteAliasName.php', + 'Drush\\SiteAlias\\SiteSpecParser' => $vendorDir . '/drush/drush/src/SiteAlias/SiteSpecParser.php', + 'Drush\\SiteAlias\\Util\\InternalYamlDataFileLoader' => $vendorDir . '/drush/drush/src/SiteAlias/Util/InternalYamlDataFileLoader.php', + 'Drush\\Sql\\SqlBase' => $vendorDir . '/drush/drush/src/Sql/SqlBase.php', + 'Drush\\Sql\\SqlException' => $vendorDir . '/drush/drush/src/Sql/SqlException.php', + 'Drush\\Sql\\SqlMysql' => $vendorDir . '/drush/drush/src/Sql/SqlMysql.php', + 'Drush\\Sql\\SqlOracle' => $vendorDir . '/drush/drush/src/Sql/SqlOracle.php', + 'Drush\\Sql\\SqlPgsql' => $vendorDir . '/drush/drush/src/Sql/SqlPgsql.php', + 'Drush\\Sql\\SqlSqlite' => $vendorDir . '/drush/drush/src/Sql/SqlSqlite.php', + 'Drush\\Sql\\SqlSqlsrv' => $vendorDir . '/drush/drush/src/Sql/SqlSqlsrv.php', + 'Drush\\Sql\\SqlTableSelectionTrait' => $vendorDir . '/drush/drush/src/Sql/SqlTableSelectionTrait.php', + 'Drush\\Style\\DrushStyle' => $vendorDir . '/drush/drush/src/Style/DrushStyle.php', + 'Drush\\Symfony\\BootstrapCompilerPass' => $vendorDir . '/drush/drush/src/Symfony/BootstrapCompilerPass.php', + 'Drush\\Symfony\\BufferedConsoleOutput' => $vendorDir . '/drush/drush/src/Symfony/BufferedConsoleOutput.php', + 'Drush\\Symfony\\DrushArgvInput' => $vendorDir . '/drush/drush/src/Symfony/DrushArgvInput.php', + 'Drush\\Symfony\\IndiscriminateInputDefinition' => $vendorDir . '/drush/drush/src/Symfony/IndiscriminateInputDefinition.php', + 'Drush\\Symfony\\LessStrictArgvInput' => $vendorDir . '/drush/drush/src/Symfony/LessStrictArgvInput.php', 'Drush\\TestTraits\\CliTestTrait' => $vendorDir . '/drush/drush/src/TestTraits/CliTestTrait.php', 'Drush\\TestTraits\\DrushTestTrait' => $vendorDir . '/drush/drush/src/TestTraits/DrushTestTrait.php', 'Drush\\TestTraits\\OutputUtilsTrait' => $vendorDir . '/drush/drush/src/TestTraits/OutputUtilsTrait.php', - 'Drush\\UpdateService\\Project' => $vendorDir . '/drush/drush/lib/Drush/UpdateService/Project.php', - 'Drush\\UpdateService\\ReleaseInfo' => $vendorDir . '/drush/drush/lib/Drush/UpdateService/ReleaseInfo.php', - 'Drush\\UpdateService\\StatusInfoDrupal6' => $vendorDir . '/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal6.php', - 'Drush\\UpdateService\\StatusInfoDrupal7' => $vendorDir . '/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal7.php', - 'Drush\\UpdateService\\StatusInfoDrupal8' => $vendorDir . '/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal8.php', - 'Drush\\UpdateService\\StatusInfoDrush' => $vendorDir . '/drush/drush/lib/Drush/UpdateService/StatusInfoDrush.php', - 'Drush\\UpdateService\\StatusInfoInterface' => $vendorDir . '/drush/drush/lib/Drush/UpdateService/StatusInfoInterface.php', - 'Drush\\User\\User6' => $vendorDir . '/drush/drush/lib/Drush/User/User6.php', - 'Drush\\User\\User7' => $vendorDir . '/drush/drush/lib/Drush/User/User7.php', - 'Drush\\User\\User8' => $vendorDir . '/drush/drush/lib/Drush/User/User8.php', - 'Drush\\User\\UserList' => $vendorDir . '/drush/drush/lib/Drush/User/UserList.php', - 'Drush\\User\\UserListException' => $vendorDir . '/drush/drush/lib/Drush/User/UserListException.php', - 'Drush\\User\\UserSingle6' => $vendorDir . '/drush/drush/lib/Drush/User/UserSingle6.php', - 'Drush\\User\\UserSingle7' => $vendorDir . '/drush/drush/lib/Drush/User/UserSingle7.php', - 'Drush\\User\\UserSingle8' => $vendorDir . '/drush/drush/lib/Drush/User/UserSingle8.php', - 'Drush\\User\\UserSingleBase' => $vendorDir . '/drush/drush/lib/Drush/User/UserSingleBase.php', - 'Drush\\User\\UserVersion' => $vendorDir . '/drush/drush/lib/Drush/User/UserVersion.php', + 'Drush\\Utils\\FsUtils' => $vendorDir . '/drush/drush/src/Utils/FsUtils.php', + 'Drush\\Utils\\StringUtils' => $vendorDir . '/drush/drush/src/Utils/StringUtils.php', 'EasyRdf_Collection' => $vendorDir . '/easyrdf/easyrdf/lib/EasyRdf/Collection.php', 'EasyRdf_Container' => $vendorDir . '/easyrdf/easyrdf/lib/EasyRdf/Container.php', 'EasyRdf_Exception' => $vendorDir . '/easyrdf/easyrdf/lib/EasyRdf/Exception.php', @@ -2729,6 +3004,10 @@ 'Gettext\\Utils\\ParsedFunction' => $vendorDir . '/gettext/gettext/src/Utils/ParsedFunction.php', 'Gettext\\Utils\\PhpFunctionsScanner' => $vendorDir . '/gettext/gettext/src/Utils/PhpFunctionsScanner.php', 'Gettext\\Utils\\StringReader' => $vendorDir . '/gettext/gettext/src/Utils/StringReader.php', + 'Grasmash\\Expander\\Expander' => $vendorDir . '/grasmash/expander/src/Expander.php', + 'Grasmash\\Expander\\Stringifier' => $vendorDir . '/grasmash/expander/src/Stringifier.php', + 'Grasmash\\Expander\\StringifierInterface' => $vendorDir . '/grasmash/expander/src/StringifierInterface.php', + 'Grasmash\\YamlExpander\\Expander' => $vendorDir . '/grasmash/yaml-expander/src/Expander.php', 'GuzzleHttp\\Client' => $vendorDir . '/guzzlehttp/guzzle/src/Client.php', 'GuzzleHttp\\ClientInterface' => $vendorDir . '/guzzlehttp/guzzle/src/ClientInterface.php', 'GuzzleHttp\\Cookie\\CookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php', @@ -2798,6 +3077,9 @@ 'GuzzleHttp\\RetryMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RetryMiddleware.php', 'GuzzleHttp\\TransferStats' => $vendorDir . '/guzzlehttp/guzzle/src/TransferStats.php', 'GuzzleHttp\\UriTemplate' => $vendorDir . '/guzzlehttp/guzzle/src/UriTemplate.php', + 'Interop\\Container\\ContainerInterface' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php', + 'Interop\\Container\\Exception\\ContainerException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php', + 'Interop\\Container\\Exception\\NotFoundException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php', 'JaimePerez\\TwigConfigurableI18n\\Twig\\Environment' => $vendorDir . '/jaimeperez/twig-configurable-i18n/src/Twig/Environment.php', 'JaimePerez\\TwigConfigurableI18n\\Twig\\Extensions\\Extension\\I18n' => $vendorDir . '/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Extension/I18n.php', 'JaimePerez\\TwigConfigurableI18n\\Twig\\Extensions\\Node\\Trans' => $vendorDir . '/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Node/Trans.php', @@ -2805,6 +3087,36 @@ 'JakubOnderka\\PhpConsoleColor\\ConsoleColor' => $vendorDir . '/jakub-onderka/php-console-color/src/ConsoleColor.php', 'JakubOnderka\\PhpConsoleColor\\InvalidStyleException' => $vendorDir . '/jakub-onderka/php-console-color/src/InvalidStyleException.php', 'JakubOnderka\\PhpConsoleHighlighter\\Highlighter' => $vendorDir . '/jakub-onderka/php-console-highlighter/src/Highlighter.php', + 'League\\Container\\Argument\\ArgumentResolverInterface' => $vendorDir . '/league/container/src/Argument/ArgumentResolverInterface.php', + 'League\\Container\\Argument\\ArgumentResolverTrait' => $vendorDir . '/league/container/src/Argument/ArgumentResolverTrait.php', + 'League\\Container\\Argument\\RawArgument' => $vendorDir . '/league/container/src/Argument/RawArgument.php', + 'League\\Container\\Argument\\RawArgumentInterface' => $vendorDir . '/league/container/src/Argument/RawArgumentInterface.php', + 'League\\Container\\Container' => $vendorDir . '/league/container/src/Container.php', + 'League\\Container\\ContainerAwareInterface' => $vendorDir . '/league/container/src/ContainerAwareInterface.php', + 'League\\Container\\ContainerAwareTrait' => $vendorDir . '/league/container/src/ContainerAwareTrait.php', + 'League\\Container\\ContainerInterface' => $vendorDir . '/league/container/src/ContainerInterface.php', + 'League\\Container\\Definition\\AbstractDefinition' => $vendorDir . '/league/container/src/Definition/AbstractDefinition.php', + 'League\\Container\\Definition\\CallableDefinition' => $vendorDir . '/league/container/src/Definition/CallableDefinition.php', + 'League\\Container\\Definition\\ClassDefinition' => $vendorDir . '/league/container/src/Definition/ClassDefinition.php', + 'League\\Container\\Definition\\ClassDefinitionInterface' => $vendorDir . '/league/container/src/Definition/ClassDefinitionInterface.php', + 'League\\Container\\Definition\\DefinitionFactory' => $vendorDir . '/league/container/src/Definition/DefinitionFactory.php', + 'League\\Container\\Definition\\DefinitionFactoryInterface' => $vendorDir . '/league/container/src/Definition/DefinitionFactoryInterface.php', + 'League\\Container\\Definition\\DefinitionInterface' => $vendorDir . '/league/container/src/Definition/DefinitionInterface.php', + 'League\\Container\\Exception\\NotFoundException' => $vendorDir . '/league/container/src/Exception/NotFoundException.php', + 'League\\Container\\ImmutableContainerAwareInterface' => $vendorDir . '/league/container/src/ImmutableContainerAwareInterface.php', + 'League\\Container\\ImmutableContainerAwareTrait' => $vendorDir . '/league/container/src/ImmutableContainerAwareTrait.php', + 'League\\Container\\ImmutableContainerInterface' => $vendorDir . '/league/container/src/ImmutableContainerInterface.php', + 'League\\Container\\Inflector\\Inflector' => $vendorDir . '/league/container/src/Inflector/Inflector.php', + 'League\\Container\\Inflector\\InflectorAggregate' => $vendorDir . '/league/container/src/Inflector/InflectorAggregate.php', + 'League\\Container\\Inflector\\InflectorAggregateInterface' => $vendorDir . '/league/container/src/Inflector/InflectorAggregateInterface.php', + 'League\\Container\\ReflectionContainer' => $vendorDir . '/league/container/src/ReflectionContainer.php', + 'League\\Container\\ServiceProvider\\AbstractServiceProvider' => $vendorDir . '/league/container/src/ServiceProvider/AbstractServiceProvider.php', + 'League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => $vendorDir . '/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php', + 'League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/BootableServiceProviderInterface.php', + 'League\\Container\\ServiceProvider\\ServiceProviderAggregate' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderAggregate.php', + 'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php', + 'League\\Container\\ServiceProvider\\ServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderInterface.php', + 'League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php', 'Masterminds\\HTML5' => $vendorDir . '/masterminds/html5/src/HTML5.php', 'Masterminds\\HTML5\\Elements' => $vendorDir . '/masterminds/html5/src/HTML5/Elements.php', 'Masterminds\\HTML5\\Entities' => $vendorDir . '/masterminds/html5/src/HTML5/Entities.php', @@ -3214,6 +3526,177 @@ 'RobRichards\\XMLSecLibs\\XMLSecEnc' => $vendorDir . '/robrichards/xmlseclibs/src/XMLSecEnc.php', 'RobRichards\\XMLSecLibs\\XMLSecurityDSig' => $vendorDir . '/robrichards/xmlseclibs/src/XMLSecurityDSig.php', 'RobRichards\\XMLSecLibs\\XMLSecurityKey' => $vendorDir . '/robrichards/xmlseclibs/src/XMLSecurityKey.php', + 'Robo\\Application' => $vendorDir . '/consolidation/robo/src/Application.php', + 'Robo\\ClassDiscovery\\AbstractClassDiscovery' => $vendorDir . '/consolidation/robo/src/ClassDiscovery/AbstractClassDiscovery.php', + 'Robo\\ClassDiscovery\\ClassDiscoveryInterface' => $vendorDir . '/consolidation/robo/src/ClassDiscovery/ClassDiscoveryInterface.php', + 'Robo\\ClassDiscovery\\RelativeNamespaceDiscovery' => $vendorDir . '/consolidation/robo/src/ClassDiscovery/RelativeNamespaceDiscovery.php', + 'Robo\\Collection\\CallableTask' => $vendorDir . '/consolidation/robo/src/Collection/CallableTask.php', + 'Robo\\Collection\\Collection' => $vendorDir . '/consolidation/robo/src/Collection/Collection.php', + 'Robo\\Collection\\CollectionBuilder' => $vendorDir . '/consolidation/robo/src/Collection/CollectionBuilder.php', + 'Robo\\Collection\\CollectionInterface' => $vendorDir . '/consolidation/robo/src/Collection/CollectionInterface.php', + 'Robo\\Collection\\CollectionProcessHook' => $vendorDir . '/consolidation/robo/src/Collection/CollectionProcessHook.php', + 'Robo\\Collection\\CompletionWrapper' => $vendorDir . '/consolidation/robo/src/Collection/CompletionWrapper.php', + 'Robo\\Collection\\Element' => $vendorDir . '/consolidation/robo/src/Collection/Element.php', + 'Robo\\Collection\\NestedCollectionInterface' => $vendorDir . '/consolidation/robo/src/Collection/NestedCollectionInterface.php', + 'Robo\\Collection\\TaskForEach' => $vendorDir . '/consolidation/robo/src/Collection/TaskForEach.php', + 'Robo\\Collection\\Temporary' => $vendorDir . '/consolidation/robo/src/Collection/Temporary.php', + 'Robo\\Collection\\loadTasks' => $vendorDir . '/consolidation/robo/src/Collection/loadTasks.php', + 'Robo\\Common\\BuilderAwareTrait' => $vendorDir . '/consolidation/robo/src/Common/BuilderAwareTrait.php', + 'Robo\\Common\\CommandArguments' => $vendorDir . '/consolidation/robo/src/Common/CommandArguments.php', + 'Robo\\Common\\CommandReceiver' => $vendorDir . '/consolidation/robo/src/Common/CommandReceiver.php', + 'Robo\\Common\\ConfigAwareTrait' => $vendorDir . '/consolidation/robo/src/Common/ConfigAwareTrait.php', + 'Robo\\Common\\DynamicParams' => $vendorDir . '/consolidation/robo/src/Common/DynamicParams.php', + 'Robo\\Common\\ExecCommand' => $vendorDir . '/consolidation/robo/src/Common/ExecCommand.php', + 'Robo\\Common\\ExecOneCommand' => $vendorDir . '/consolidation/robo/src/Common/ExecOneCommand.php', + 'Robo\\Common\\ExecTrait' => $vendorDir . '/consolidation/robo/src/Common/ExecTrait.php', + 'Robo\\Common\\IO' => $vendorDir . '/consolidation/robo/src/Common/IO.php', + 'Robo\\Common\\InflectionTrait' => $vendorDir . '/consolidation/robo/src/Common/InflectionTrait.php', + 'Robo\\Common\\InputAwareTrait' => $vendorDir . '/consolidation/robo/src/Common/InputAwareTrait.php', + 'Robo\\Common\\OutputAdapter' => $vendorDir . '/consolidation/robo/src/Common/OutputAdapter.php', + 'Robo\\Common\\OutputAwareTrait' => $vendorDir . '/consolidation/robo/src/Common/OutputAwareTrait.php', + 'Robo\\Common\\ProcessExecutor' => $vendorDir . '/consolidation/robo/src/Common/ProcessExecutor.php', + 'Robo\\Common\\ProcessUtils' => $vendorDir . '/consolidation/robo/src/Common/ProcessUtils.php', + 'Robo\\Common\\ProgressIndicator' => $vendorDir . '/consolidation/robo/src/Common/ProgressIndicator.php', + 'Robo\\Common\\ProgressIndicatorAwareTrait' => $vendorDir . '/consolidation/robo/src/Common/ProgressIndicatorAwareTrait.php', + 'Robo\\Common\\ResourceExistenceChecker' => $vendorDir . '/consolidation/robo/src/Common/ResourceExistenceChecker.php', + 'Robo\\Common\\TaskIO' => $vendorDir . '/consolidation/robo/src/Common/TaskIO.php', + 'Robo\\Common\\TimeKeeper' => $vendorDir . '/consolidation/robo/src/Common/TimeKeeper.php', + 'Robo\\Common\\Timer' => $vendorDir . '/consolidation/robo/src/Common/Timer.php', + 'Robo\\Common\\VerbosityThresholdTrait' => $vendorDir . '/consolidation/robo/src/Common/VerbosityThresholdTrait.php', + 'Robo\\Config' => $vendorDir . '/consolidation/robo/src/Config.php', + 'Robo\\Config\\Config' => $vendorDir . '/consolidation/robo/src/Config/Config.php', + 'Robo\\Config\\GlobalOptionDefaultValuesInterface' => $vendorDir . '/consolidation/robo/src/Config/GlobalOptionDefaultValuesInterface.php', + 'Robo\\Contract\\BuilderAwareInterface' => $vendorDir . '/consolidation/robo/src/Contract/BuilderAwareInterface.php', + 'Robo\\Contract\\CommandInterface' => $vendorDir . '/consolidation/robo/src/Contract/CommandInterface.php', + 'Robo\\Contract\\CompletionInterface' => $vendorDir . '/consolidation/robo/src/Contract/CompletionInterface.php', + 'Robo\\Contract\\ConfigAwareInterface' => $vendorDir . '/consolidation/robo/src/Contract/ConfigAwareInterface.php', + 'Robo\\Contract\\IOAwareInterface' => $vendorDir . '/consolidation/robo/src/Contract/IOAwareInterface.php', + 'Robo\\Contract\\InflectionInterface' => $vendorDir . '/consolidation/robo/src/Contract/InflectionInterface.php', + 'Robo\\Contract\\OutputAdapterInterface' => $vendorDir . '/consolidation/robo/src/Contract/OutputAdapterInterface.php', + 'Robo\\Contract\\OutputAwareInterface' => $vendorDir . '/consolidation/robo/src/Contract/OutputAwareInterface.php', + 'Robo\\Contract\\PrintedInterface' => $vendorDir . '/consolidation/robo/src/Contract/PrintedInterface.php', + 'Robo\\Contract\\ProgressIndicatorAwareInterface' => $vendorDir . '/consolidation/robo/src/Contract/ProgressIndicatorAwareInterface.php', + 'Robo\\Contract\\ProgressInterface' => $vendorDir . '/consolidation/robo/src/Contract/ProgressInterface.php', + 'Robo\\Contract\\RollbackInterface' => $vendorDir . '/consolidation/robo/src/Contract/RollbackInterface.php', + 'Robo\\Contract\\SimulatedInterface' => $vendorDir . '/consolidation/robo/src/Contract/SimulatedInterface.php', + 'Robo\\Contract\\TaskInterface' => $vendorDir . '/consolidation/robo/src/Contract/TaskInterface.php', + 'Robo\\Contract\\VerbosityThresholdInterface' => $vendorDir . '/consolidation/robo/src/Contract/VerbosityThresholdInterface.php', + 'Robo\\Contract\\WrappedTaskInterface' => $vendorDir . '/consolidation/robo/src/Contract/WrappedTaskInterface.php', + 'Robo\\Exception\\AbortTasksException' => $vendorDir . '/consolidation/robo/src/Exception/AbortTasksException.php', + 'Robo\\Exception\\TaskException' => $vendorDir . '/consolidation/robo/src/Exception/TaskException.php', + 'Robo\\Exception\\TaskExitException' => $vendorDir . '/consolidation/robo/src/Exception/TaskExitException.php', + 'Robo\\GlobalOptionsEventListener' => $vendorDir . '/consolidation/robo/src/GlobalOptionsEventListener.php', + 'Robo\\LoadAllTasks' => $vendorDir . '/consolidation/robo/src/LoadAllTasks.php', + 'Robo\\Log\\ResultPrinter' => $vendorDir . '/consolidation/robo/src/Log/ResultPrinter.php', + 'Robo\\Log\\RoboLogLevel' => $vendorDir . '/consolidation/robo/src/Log/RoboLogLevel.php', + 'Robo\\Log\\RoboLogStyle' => $vendorDir . '/consolidation/robo/src/Log/RoboLogStyle.php', + 'Robo\\Log\\RoboLogger' => $vendorDir . '/consolidation/robo/src/Log/RoboLogger.php', + 'Robo\\Result' => $vendorDir . '/consolidation/robo/src/Result.php', + 'Robo\\ResultData' => $vendorDir . '/consolidation/robo/src/ResultData.php', + 'Robo\\Robo' => $vendorDir . '/consolidation/robo/src/Robo.php', + 'Robo\\Runner' => $vendorDir . '/consolidation/robo/src/Runner.php', + 'Robo\\State\\Consumer' => $vendorDir . '/consolidation/robo/src/State/Consumer.php', + 'Robo\\State\\Data' => $vendorDir . '/consolidation/robo/src/State/Data.php', + 'Robo\\State\\StateAwareInterface' => $vendorDir . '/consolidation/robo/src/State/StateAwareInterface.php', + 'Robo\\State\\StateAwareTrait' => $vendorDir . '/consolidation/robo/src/State/StateAwareTrait.php', + 'Robo\\TaskAccessor' => $vendorDir . '/consolidation/robo/src/TaskAccessor.php', + 'Robo\\TaskInfo' => $vendorDir . '/consolidation/robo/src/TaskInfo.php', + 'Robo\\Task\\ApiGen\\ApiGen' => $vendorDir . '/consolidation/robo/src/Task/ApiGen/ApiGen.php', + 'Robo\\Task\\ApiGen\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/ApiGen/loadTasks.php', + 'Robo\\Task\\Archive\\Extract' => $vendorDir . '/consolidation/robo/src/Task/Archive/Extract.php', + 'Robo\\Task\\Archive\\Pack' => $vendorDir . '/consolidation/robo/src/Task/Archive/Pack.php', + 'Robo\\Task\\Archive\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Archive/loadTasks.php', + 'Robo\\Task\\Assets\\CssPreprocessor' => $vendorDir . '/consolidation/robo/src/Task/Assets/CssPreprocessor.php', + 'Robo\\Task\\Assets\\ImageMinify' => $vendorDir . '/consolidation/robo/src/Task/Assets/ImageMinify.php', + 'Robo\\Task\\Assets\\Less' => $vendorDir . '/consolidation/robo/src/Task/Assets/Less.php', + 'Robo\\Task\\Assets\\Minify' => $vendorDir . '/consolidation/robo/src/Task/Assets/Minify.php', + 'Robo\\Task\\Assets\\Scss' => $vendorDir . '/consolidation/robo/src/Task/Assets/Scss.php', + 'Robo\\Task\\Assets\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Assets/loadTasks.php', + 'Robo\\Task\\BaseTask' => $vendorDir . '/consolidation/robo/src/Task/BaseTask.php', + 'Robo\\Task\\Base\\Exec' => $vendorDir . '/consolidation/robo/src/Task/Base/Exec.php', + 'Robo\\Task\\Base\\ExecStack' => $vendorDir . '/consolidation/robo/src/Task/Base/ExecStack.php', + 'Robo\\Task\\Base\\ParallelExec' => $vendorDir . '/consolidation/robo/src/Task/Base/ParallelExec.php', + 'Robo\\Task\\Base\\SymfonyCommand' => $vendorDir . '/consolidation/robo/src/Task/Base/SymfonyCommand.php', + 'Robo\\Task\\Base\\Watch' => $vendorDir . '/consolidation/robo/src/Task/Base/Watch.php', + 'Robo\\Task\\Base\\loadShortcuts' => $vendorDir . '/consolidation/robo/src/Task/Base/loadShortcuts.php', + 'Robo\\Task\\Base\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Base/loadTasks.php', + 'Robo\\Task\\Bower\\Base' => $vendorDir . '/consolidation/robo/src/Task/Bower/Base.php', + 'Robo\\Task\\Bower\\Install' => $vendorDir . '/consolidation/robo/src/Task/Bower/Install.php', + 'Robo\\Task\\Bower\\Update' => $vendorDir . '/consolidation/robo/src/Task/Bower/Update.php', + 'Robo\\Task\\Bower\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Bower/loadTasks.php', + 'Robo\\Task\\CommandStack' => $vendorDir . '/consolidation/robo/src/Task/CommandStack.php', + 'Robo\\Task\\Composer\\Base' => $vendorDir . '/consolidation/robo/src/Task/Composer/Base.php', + 'Robo\\Task\\Composer\\Config' => $vendorDir . '/consolidation/robo/src/Task/Composer/Config.php', + 'Robo\\Task\\Composer\\CreateProject' => $vendorDir . '/consolidation/robo/src/Task/Composer/CreateProject.php', + 'Robo\\Task\\Composer\\DumpAutoload' => $vendorDir . '/consolidation/robo/src/Task/Composer/DumpAutoload.php', + 'Robo\\Task\\Composer\\Init' => $vendorDir . '/consolidation/robo/src/Task/Composer/Init.php', + 'Robo\\Task\\Composer\\Install' => $vendorDir . '/consolidation/robo/src/Task/Composer/Install.php', + 'Robo\\Task\\Composer\\Remove' => $vendorDir . '/consolidation/robo/src/Task/Composer/Remove.php', + 'Robo\\Task\\Composer\\RequireDependency' => $vendorDir . '/consolidation/robo/src/Task/Composer/RequireDependency.php', + 'Robo\\Task\\Composer\\Update' => $vendorDir . '/consolidation/robo/src/Task/Composer/Update.php', + 'Robo\\Task\\Composer\\Validate' => $vendorDir . '/consolidation/robo/src/Task/Composer/Validate.php', + 'Robo\\Task\\Composer\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Composer/loadTasks.php', + 'Robo\\Task\\Development\\Changelog' => $vendorDir . '/consolidation/robo/src/Task/Development/Changelog.php', + 'Robo\\Task\\Development\\GenerateMarkdownDoc' => $vendorDir . '/consolidation/robo/src/Task/Development/GenerateMarkdownDoc.php', + 'Robo\\Task\\Development\\GenerateTask' => $vendorDir . '/consolidation/robo/src/Task/Development/GenerateTask.php', + 'Robo\\Task\\Development\\GitHub' => $vendorDir . '/consolidation/robo/src/Task/Development/GitHub.php', + 'Robo\\Task\\Development\\GitHubRelease' => $vendorDir . '/consolidation/robo/src/Task/Development/GitHubRelease.php', + 'Robo\\Task\\Development\\OpenBrowser' => $vendorDir . '/consolidation/robo/src/Task/Development/OpenBrowser.php', + 'Robo\\Task\\Development\\PackPhar' => $vendorDir . '/consolidation/robo/src/Task/Development/PackPhar.php', + 'Robo\\Task\\Development\\PhpServer' => $vendorDir . '/consolidation/robo/src/Task/Development/PhpServer.php', + 'Robo\\Task\\Development\\SemVer' => $vendorDir . '/consolidation/robo/src/Task/Development/SemVer.php', + 'Robo\\Task\\Development\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Development/loadTasks.php', + 'Robo\\Task\\Docker\\Base' => $vendorDir . '/consolidation/robo/src/Task/Docker/Base.php', + 'Robo\\Task\\Docker\\Build' => $vendorDir . '/consolidation/robo/src/Task/Docker/Build.php', + 'Robo\\Task\\Docker\\Commit' => $vendorDir . '/consolidation/robo/src/Task/Docker/Commit.php', + 'Robo\\Task\\Docker\\Exec' => $vendorDir . '/consolidation/robo/src/Task/Docker/Exec.php', + 'Robo\\Task\\Docker\\Pull' => $vendorDir . '/consolidation/robo/src/Task/Docker/Pull.php', + 'Robo\\Task\\Docker\\Remove' => $vendorDir . '/consolidation/robo/src/Task/Docker/Remove.php', + 'Robo\\Task\\Docker\\Result' => $vendorDir . '/consolidation/robo/src/Task/Docker/Result.php', + 'Robo\\Task\\Docker\\Run' => $vendorDir . '/consolidation/robo/src/Task/Docker/Run.php', + 'Robo\\Task\\Docker\\Start' => $vendorDir . '/consolidation/robo/src/Task/Docker/Start.php', + 'Robo\\Task\\Docker\\Stop' => $vendorDir . '/consolidation/robo/src/Task/Docker/Stop.php', + 'Robo\\Task\\Docker\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Docker/loadTasks.php', + 'Robo\\Task\\File\\Concat' => $vendorDir . '/consolidation/robo/src/Task/File/Concat.php', + 'Robo\\Task\\File\\Replace' => $vendorDir . '/consolidation/robo/src/Task/File/Replace.php', + 'Robo\\Task\\File\\TmpFile' => $vendorDir . '/consolidation/robo/src/Task/File/TmpFile.php', + 'Robo\\Task\\File\\Write' => $vendorDir . '/consolidation/robo/src/Task/File/Write.php', + 'Robo\\Task\\File\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/File/loadTasks.php', + 'Robo\\Task\\Filesystem\\BaseDir' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/BaseDir.php', + 'Robo\\Task\\Filesystem\\CleanDir' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/CleanDir.php', + 'Robo\\Task\\Filesystem\\CopyDir' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/CopyDir.php', + 'Robo\\Task\\Filesystem\\DeleteDir' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/DeleteDir.php', + 'Robo\\Task\\Filesystem\\FilesystemStack' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/FilesystemStack.php', + 'Robo\\Task\\Filesystem\\FlattenDir' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/FlattenDir.php', + 'Robo\\Task\\Filesystem\\MirrorDir' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/MirrorDir.php', + 'Robo\\Task\\Filesystem\\TmpDir' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/TmpDir.php', + 'Robo\\Task\\Filesystem\\WorkDir' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/WorkDir.php', + 'Robo\\Task\\Filesystem\\loadShortcuts' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/loadShortcuts.php', + 'Robo\\Task\\Filesystem\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Filesystem/loadTasks.php', + 'Robo\\Task\\Gulp\\Base' => $vendorDir . '/consolidation/robo/src/Task/Gulp/Base.php', + 'Robo\\Task\\Gulp\\Run' => $vendorDir . '/consolidation/robo/src/Task/Gulp/Run.php', + 'Robo\\Task\\Gulp\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Gulp/loadTasks.php', + 'Robo\\Task\\Npm\\Base' => $vendorDir . '/consolidation/robo/src/Task/Npm/Base.php', + 'Robo\\Task\\Npm\\Install' => $vendorDir . '/consolidation/robo/src/Task/Npm/Install.php', + 'Robo\\Task\\Npm\\Update' => $vendorDir . '/consolidation/robo/src/Task/Npm/Update.php', + 'Robo\\Task\\Npm\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Npm/loadTasks.php', + 'Robo\\Task\\Remote\\Rsync' => $vendorDir . '/consolidation/robo/src/Task/Remote/Rsync.php', + 'Robo\\Task\\Remote\\Ssh' => $vendorDir . '/consolidation/robo/src/Task/Remote/Ssh.php', + 'Robo\\Task\\Remote\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Remote/loadTasks.php', + 'Robo\\Task\\Simulator' => $vendorDir . '/consolidation/robo/src/Task/Simulator.php', + 'Robo\\Task\\StackBasedTask' => $vendorDir . '/consolidation/robo/src/Task/StackBasedTask.php', + 'Robo\\Task\\Testing\\Atoum' => $vendorDir . '/consolidation/robo/src/Task/Testing/Atoum.php', + 'Robo\\Task\\Testing\\Behat' => $vendorDir . '/consolidation/robo/src/Task/Testing/Behat.php', + 'Robo\\Task\\Testing\\Codecept' => $vendorDir . '/consolidation/robo/src/Task/Testing/Codecept.php', + 'Robo\\Task\\Testing\\PHPUnit' => $vendorDir . '/consolidation/robo/src/Task/Testing/PHPUnit.php', + 'Robo\\Task\\Testing\\Phpspec' => $vendorDir . '/consolidation/robo/src/Task/Testing/Phpspec.php', + 'Robo\\Task\\Testing\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Testing/loadTasks.php', + 'Robo\\Task\\Vcs\\GitStack' => $vendorDir . '/consolidation/robo/src/Task/Vcs/GitStack.php', + 'Robo\\Task\\Vcs\\HgStack' => $vendorDir . '/consolidation/robo/src/Task/Vcs/HgStack.php', + 'Robo\\Task\\Vcs\\SvnStack' => $vendorDir . '/consolidation/robo/src/Task/Vcs/SvnStack.php', + 'Robo\\Task\\Vcs\\loadShortcuts' => $vendorDir . '/consolidation/robo/src/Task/Vcs/loadShortcuts.php', + 'Robo\\Task\\Vcs\\loadTasks' => $vendorDir . '/consolidation/robo/src/Task/Vcs/loadTasks.php', + 'Robo\\Tasks' => $vendorDir . '/consolidation/robo/src/Tasks.php', 'SAML2\\ArtifactResolve' => $vendorDir . '/simplesamlphp/saml2/src/SAML2/ArtifactResolve.php', 'SAML2\\ArtifactResponse' => $vendorDir . '/simplesamlphp/saml2/src/SAML2/ArtifactResponse.php', 'SAML2\\Assertion' => $vendorDir . '/simplesamlphp/saml2/src/SAML2/Assertion.php', @@ -3369,6 +3852,7 @@ 'SAML2\\XML\\saml\\SubjectConfirmationData' => $vendorDir . '/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmationData.php', 'SAML2\\XML\\samlp\\Extensions' => $vendorDir . '/simplesamlphp/saml2/src/SAML2/XML/samlp/Extensions.php', 'SAML2\\XML\\shibmd\\Scope' => $vendorDir . '/simplesamlphp/saml2/src/SAML2/XML/shibmd/Scope.php', + 'SelfUpdate\\SelfUpdateCommand' => $vendorDir . '/consolidation/self-update/src/SelfUpdateCommand.php', 'SessionUpdateTimestampHandlerInterface' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php', 'SimpleSAML\\Auth\\Simple' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Simple.php', 'SimpleSAML\\Auth\\TimeLimitedToken' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/TimeLimitedToken.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index d8af397388e07ac6ec4890ae7315a7c378b71208..2f0a4abde5b0b4119e9615ae8cf5a7d3300b95aa 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -26,6 +26,7 @@ '40360c0b9b437e69bcbb7f1349ce029e' => $vendorDir . '/zendframework/zend-diactoros/src/functions/parse_cookie_header.php', '801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php', '6175f5662c2e26de0149cb048cda7209' => $vendorDir . '/simplesamlphp/saml2/src/_autoload.php', + '952683d815ff0a7bf322b93c0be7e4e4' => $vendorDir . '/chi-teck/drupal-code-generator/src/bootstrap.php', '5a12a5271c58108e0aa33355e6ac54ea' => $vendorDir . '/drupal/console-core/src/functions.php', '5abda994d126976858eb25d2546ee3c9' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/_autoload_modules.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 3c85b1d0b1642b0d19f893cc3539c5a3a980c637..93e9f432ef07aa1d674201692bbae9d20f25ac39 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -12,11 +12,9 @@ 'SAML2\\' => array($vendorDir . '/simplesamlphp/saml2/src'), 'Egulias\\' => array($vendorDir . '/egulias/email-validator/src'), 'EasyRdf_' => array($vendorDir . '/easyrdf/easyrdf/lib'), - 'Drush' => array($vendorDir . '/drush/drush/lib'), 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'), 'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'), 'Dflydev\\PlaceholderResolver' => array($vendorDir . '/dflydev/placeholder-resolver/src'), 'Dflydev\\DotAccessData' => array($vendorDir . '/dflydev/dot-access-data/src'), 'Dflydev\\DotAccessConfiguration' => array($vendorDir . '/dflydev/dot-access-configuration/src'), - 'Consolidation' => array($vendorDir . '/drush/drush/lib'), ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 8495a07e53d7a87c0cfd4b9ea563855c60b16124..1419a4ebb194ed0a763d36fb7bc947ac63a4a657 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -47,6 +47,8 @@ 'Symfony\\Bridge\\PsrHttpMessage\\' => array($vendorDir . '/symfony/psr-http-message-bridge'), 'Stecman\\Component\\Symfony\\Console\\BashCompletion\\' => array($vendorDir . '/stecman/symfony-console-completion/src'), 'SimpleSAML\\' => array($vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML'), + 'SelfUpdate\\' => array($vendorDir . '/consolidation/self-update/src'), + 'Robo\\' => array($vendorDir . '/consolidation/robo/src'), 'RobRichards\\XMLSecLibs\\' => array($vendorDir . '/robrichards/xmlseclibs/src'), 'Psy\\' => array($vendorDir . '/psy/psysh/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), @@ -56,14 +58,19 @@ 'PantheonSystems\\CDNBehatHelpers\\' => array($baseDir . '/web/modules/pantheon_advanced_page_cache/tests/behat/helper_classes'), 'OomphInc\\ComposerInstallersExtender\\' => array($vendorDir . '/oomphinc/composer-installers-extender/src'), 'Masterminds\\' => array($vendorDir . '/masterminds/html5/src'), + 'League\\Container\\' => array($vendorDir . '/league/container/src'), 'JakubOnderka\\PhpConsoleHighlighter\\' => array($vendorDir . '/jakub-onderka/php-console-highlighter/src'), 'JakubOnderka\\PhpConsoleColor\\' => array($vendorDir . '/jakub-onderka/php-console-color/src'), 'JaimePerez\\TwigConfigurableI18n\\' => array($vendorDir . '/jaimeperez/twig-configurable-i18n/src'), + 'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'Grasmash\\YamlExpander\\' => array($vendorDir . '/grasmash/yaml-expander/src'), + 'Grasmash\\Expander\\' => array($vendorDir . '/grasmash/expander/src'), 'Gettext\\Languages\\' => array($vendorDir . '/gettext/languages/src'), 'Gettext\\' => array($vendorDir . '/gettext/gettext/src'), + 'Drush\\Internal\\' => array($vendorDir . '/drush/drush/src/internal-forks'), 'Drush\\' => array($vendorDir . '/drush/drush/src'), 'Drupal\\redis\\' => array($baseDir . '/web/modules/redis/src'), 'Drupal\\Driver\\' => array($baseDir . '/web/drivers/lib/Drupal/Driver'), @@ -73,11 +80,17 @@ 'Drupal\\Console\\' => array($vendorDir . '/drupal/console/src'), 'Drupal\\Component\\' => array($baseDir . '/web/core/lib/Drupal/Component'), 'DrupalComposer\\DrupalScaffold\\' => array($vendorDir . '/drupal-composer/drupal-scaffold/src'), + 'DrupalCodeGenerator\\' => array($vendorDir . '/chi-teck/drupal-code-generator/src'), 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'), 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'), 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'), 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib/Doctrine/Common'), + 'Consolidation\\SiteProcess\\' => array($vendorDir . '/consolidation/site-process/src'), + 'Consolidation\\SiteAlias\\' => array($vendorDir . '/consolidation/site-alias/src'), 'Consolidation\\OutputFormatters\\' => array($vendorDir . '/consolidation/output-formatters/src'), + 'Consolidation\\Log\\' => array($vendorDir . '/consolidation/log/src'), + 'Consolidation\\Filter\\' => array($vendorDir . '/consolidation/filter-via-dot-access-data/src'), + 'Consolidation\\Config\\' => array($vendorDir . '/consolidation/config/src'), 'Consolidation\\AnnotatedCommand\\' => array($vendorDir . '/consolidation/annotated-command/src'), 'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'), 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index d7032e74afecbe3192223bbf3227ee3a82af8ac0..89327cf547f09aad57189e149e4909e7ed2fd06c 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -27,6 +27,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 '40360c0b9b437e69bcbb7f1349ce029e' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/parse_cookie_header.php', '801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php', '6175f5662c2e26de0149cb048cda7209' => __DIR__ . '/..' . '/simplesamlphp/saml2/src/_autoload.php', + '952683d815ff0a7bf322b93c0be7e4e4' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/bootstrap.php', '5a12a5271c58108e0aa33355e6ac54ea' => __DIR__ . '/..' . '/drupal/console-core/src/functions.php', '5abda994d126976858eb25d2546ee3c9' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/_autoload_modules.php', ); @@ -96,9 +97,11 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Symfony\\Bridge\\PsrHttpMessage\\' => 30, 'Stecman\\Component\\Symfony\\Console\\BashCompletion\\' => 49, 'SimpleSAML\\' => 11, + 'SelfUpdate\\' => 11, ), 'R' => array ( + 'Robo\\' => 5, 'RobRichards\\XMLSecLibs\\' => 23, ), 'P' => @@ -118,22 +121,33 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 'Masterminds\\' => 12, ), + 'L' => + array ( + 'League\\Container\\' => 17, + ), 'J' => array ( 'JakubOnderka\\PhpConsoleHighlighter\\' => 35, 'JakubOnderka\\PhpConsoleColor\\' => 29, 'JaimePerez\\TwigConfigurableI18n\\' => 32, ), + 'I' => + array ( + 'Interop\\Container\\' => 18, + ), 'G' => array ( 'GuzzleHttp\\Psr7\\' => 16, 'GuzzleHttp\\Promise\\' => 19, 'GuzzleHttp\\' => 11, + 'Grasmash\\YamlExpander\\' => 22, + 'Grasmash\\Expander\\' => 18, 'Gettext\\Languages\\' => 18, 'Gettext\\' => 8, ), 'D' => array ( + 'Drush\\Internal\\' => 15, 'Drush\\' => 6, 'Drupal\\redis\\' => 13, 'Drupal\\Driver\\' => 14, @@ -143,6 +157,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Drupal\\Console\\' => 15, 'Drupal\\Component\\' => 17, 'DrupalComposer\\DrupalScaffold\\' => 30, + 'DrupalCodeGenerator\\' => 20, 'Doctrine\\Common\\Inflector\\' => 26, 'Doctrine\\Common\\Cache\\' => 22, 'Doctrine\\Common\\Annotations\\' => 28, @@ -150,7 +165,12 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 ), 'C' => array ( + 'Consolidation\\SiteProcess\\' => 26, + 'Consolidation\\SiteAlias\\' => 24, 'Consolidation\\OutputFormatters\\' => 31, + 'Consolidation\\Log\\' => 18, + 'Consolidation\\Filter\\' => 21, + 'Consolidation\\Config\\' => 21, 'Consolidation\\AnnotatedCommand\\' => 31, 'Composer\\Semver\\' => 16, 'Composer\\Installers\\' => 20, @@ -333,6 +353,14 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 0 => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML', ), + 'SelfUpdate\\' => + array ( + 0 => __DIR__ . '/..' . '/consolidation/self-update/src', + ), + 'Robo\\' => + array ( + 0 => __DIR__ . '/..' . '/consolidation/robo/src', + ), 'RobRichards\\XMLSecLibs\\' => array ( 0 => __DIR__ . '/..' . '/robrichards/xmlseclibs/src', @@ -369,6 +397,10 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 0 => __DIR__ . '/..' . '/masterminds/html5/src', ), + 'League\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/league/container/src', + ), 'JakubOnderka\\PhpConsoleHighlighter\\' => array ( 0 => __DIR__ . '/..' . '/jakub-onderka/php-console-highlighter/src', @@ -381,6 +413,10 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 0 => __DIR__ . '/..' . '/jaimeperez/twig-configurable-i18n/src', ), + 'Interop\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container', + ), 'GuzzleHttp\\Psr7\\' => array ( 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', @@ -393,6 +429,14 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', ), + 'Grasmash\\YamlExpander\\' => + array ( + 0 => __DIR__ . '/..' . '/grasmash/yaml-expander/src', + ), + 'Grasmash\\Expander\\' => + array ( + 0 => __DIR__ . '/..' . '/grasmash/expander/src', + ), 'Gettext\\Languages\\' => array ( 0 => __DIR__ . '/..' . '/gettext/languages/src', @@ -401,6 +445,10 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 0 => __DIR__ . '/..' . '/gettext/gettext/src', ), + 'Drush\\Internal\\' => + array ( + 0 => __DIR__ . '/..' . '/drush/drush/src/internal-forks', + ), 'Drush\\' => array ( 0 => __DIR__ . '/..' . '/drush/drush/src', @@ -437,6 +485,10 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 0 => __DIR__ . '/..' . '/drupal-composer/drupal-scaffold/src', ), + 'DrupalCodeGenerator\\' => + array ( + 0 => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src', + ), 'Doctrine\\Common\\Inflector\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector', @@ -453,10 +505,30 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 0 => __DIR__ . '/..' . '/doctrine/common/lib/Doctrine/Common', ), + 'Consolidation\\SiteProcess\\' => + array ( + 0 => __DIR__ . '/..' . '/consolidation/site-process/src', + ), + 'Consolidation\\SiteAlias\\' => + array ( + 0 => __DIR__ . '/..' . '/consolidation/site-alias/src', + ), 'Consolidation\\OutputFormatters\\' => array ( 0 => __DIR__ . '/..' . '/consolidation/output-formatters/src', ), + 'Consolidation\\Log\\' => + array ( + 0 => __DIR__ . '/..' . '/consolidation/log/src', + ), + 'Consolidation\\Filter\\' => + array ( + 0 => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src', + ), + 'Consolidation\\Config\\' => + array ( + 0 => __DIR__ . '/..' . '/consolidation/config/src', + ), 'Consolidation\\AnnotatedCommand\\' => array ( 0 => __DIR__ . '/..' . '/consolidation/annotated-command/src', @@ -527,10 +599,6 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 ), 'D' => array ( - 'Drush' => - array ( - 0 => __DIR__ . '/..' . '/drush/drush/lib', - ), 'Doctrine\\Common\\Lexer\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/lexer/lib', @@ -552,13 +620,6 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 0 => __DIR__ . '/..' . '/dflydev/dot-access-configuration/src', ), ), - 'C' => - array ( - 'Consolidation' => - array ( - 0 => __DIR__ . '/..' . '/drush/drush/lib', - ), - ), ); public static $classMap = array ( @@ -875,6 +936,48 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Consolidation\\AnnotatedCommand\\Parser\\Internal\\FullyQualifiedClassCache' => __DIR__ . '/..' . '/consolidation/annotated-command/src/Parser/Internal/FullyQualifiedClassCache.php', 'Consolidation\\AnnotatedCommand\\Parser\\Internal\\TagFactory' => __DIR__ . '/..' . '/consolidation/annotated-command/src/Parser/Internal/TagFactory.php', 'Consolidation\\AnnotatedCommand\\ResultWriter' => __DIR__ . '/..' . '/consolidation/annotated-command/src/ResultWriter.php', + 'Consolidation\\Config\\Config' => __DIR__ . '/..' . '/consolidation/config/src/Config.php', + 'Consolidation\\Config\\ConfigAwareInterface' => __DIR__ . '/..' . '/consolidation/config/src/ConfigAwareInterface.php', + 'Consolidation\\Config\\ConfigAwareTrait' => __DIR__ . '/..' . '/consolidation/config/src/ConfigAwareTrait.php', + 'Consolidation\\Config\\ConfigInterface' => __DIR__ . '/..' . '/consolidation/config/src/ConfigInterface.php', + 'Consolidation\\Config\\GlobalOptionDefaultValuesInterface' => __DIR__ . '/..' . '/consolidation/config/src/GlobalOptionDefaultValuesInterface.php', + 'Consolidation\\Config\\Inject\\ConfigForCommand' => __DIR__ . '/..' . '/consolidation/config/src/Inject/ConfigForCommand.php', + 'Consolidation\\Config\\Inject\\ConfigForSetters' => __DIR__ . '/..' . '/consolidation/config/src/Inject/ConfigForSetters.php', + 'Consolidation\\Config\\Loader\\ConfigLoader' => __DIR__ . '/..' . '/consolidation/config/src/Loader/ConfigLoader.php', + 'Consolidation\\Config\\Loader\\ConfigLoaderInterface' => __DIR__ . '/..' . '/consolidation/config/src/Loader/ConfigLoaderInterface.php', + 'Consolidation\\Config\\Loader\\ConfigProcessor' => __DIR__ . '/..' . '/consolidation/config/src/Loader/ConfigProcessor.php', + 'Consolidation\\Config\\Loader\\YamlConfigLoader' => __DIR__ . '/..' . '/consolidation/config/src/Loader/YamlConfigLoader.php', + 'Consolidation\\Config\\Util\\ArrayUtil' => __DIR__ . '/..' . '/consolidation/config/src/Util/ArrayUtil.php', + 'Consolidation\\Config\\Util\\ConfigFallback' => __DIR__ . '/..' . '/consolidation/config/src/Util/ConfigFallback.php', + 'Consolidation\\Config\\Util\\ConfigGroup' => __DIR__ . '/..' . '/consolidation/config/src/Util/ConfigGroup.php', + 'Consolidation\\Config\\Util\\ConfigInterpolatorInterface' => __DIR__ . '/..' . '/consolidation/config/src/Util/ConfigInterpolatorInterface.php', + 'Consolidation\\Config\\Util\\ConfigInterpolatorTrait' => __DIR__ . '/..' . '/consolidation/config/src/Util/ConfigInterpolatorTrait.php', + 'Consolidation\\Config\\Util\\ConfigMerge' => __DIR__ . '/..' . '/consolidation/config/src/Util/ConfigMerge.php', + 'Consolidation\\Config\\Util\\ConfigOverlay' => __DIR__ . '/..' . '/consolidation/config/src/Util/ConfigOverlay.php', + 'Consolidation\\Config\\Util\\ConfigRuntimeInterface' => __DIR__ . '/..' . '/consolidation/config/src/Util/ConfigRuntimeInterface.php', + 'Consolidation\\Config\\Util\\EnvConfig' => __DIR__ . '/..' . '/consolidation/config/src/Util/EnvConfig.php', + 'Consolidation\\Config\\Util\\Interpolator' => __DIR__ . '/..' . '/consolidation/config/src/Util/Interpolator.php', + 'Consolidation\\Filter\\Cli\\OpCommands' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/Cli/OpCommands.php', + 'Consolidation\\Filter\\FactoryInterface' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/FactoryInterface.php', + 'Consolidation\\Filter\\FilterOutputData' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/FilterOutputData.php', + 'Consolidation\\Filter\\Hooks\\FilterHooks' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/Hooks/FilterHooks.php', + 'Consolidation\\Filter\\LogicalOpFactory' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/LogicalOpFactory.php', + 'Consolidation\\Filter\\OperatorFactory' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/OperatorFactory.php', + 'Consolidation\\Filter\\OperatorInterface' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/OperatorInterface.php', + 'Consolidation\\Filter\\Operators\\ContainsOp' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/Operators/ContainsOp.php', + 'Consolidation\\Filter\\Operators\\EqualsOp' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/Operators/EqualsOp.php', + 'Consolidation\\Filter\\Operators\\LogicalAndOp' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/Operators/LogicalAndOp.php', + 'Consolidation\\Filter\\Operators\\LogicalOrOp' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/Operators/LogicalOrOp.php', + 'Consolidation\\Filter\\Operators\\NotOp' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/Operators/NotOp.php', + 'Consolidation\\Filter\\Operators\\RegexOp' => __DIR__ . '/..' . '/consolidation/filter-via-dot-access-data/src/Operators/RegexOp.php', + 'Consolidation\\Log\\ConsoleLogLevel' => __DIR__ . '/..' . '/consolidation/log/src/ConsoleLogLevel.php', + 'Consolidation\\Log\\LogOutputStyler' => __DIR__ . '/..' . '/consolidation/log/src/LogOutputStyler.php', + 'Consolidation\\Log\\LogOutputStylerInterface' => __DIR__ . '/..' . '/consolidation/log/src/LogOutputStylerInterface.php', + 'Consolidation\\Log\\Logger' => __DIR__ . '/..' . '/consolidation/log/src/Logger.php', + 'Consolidation\\Log\\LoggerManager' => __DIR__ . '/..' . '/consolidation/log/src/LoggerManager.php', + 'Consolidation\\Log\\StylableLoggerInterface' => __DIR__ . '/..' . '/consolidation/log/src/StylableLoggerInterface.php', + 'Consolidation\\Log\\SymfonyLogOutputStyler' => __DIR__ . '/..' . '/consolidation/log/src/SymfonyLogOutputStyler.php', + 'Consolidation\\Log\\UnstyledLogOutputStyler' => __DIR__ . '/..' . '/consolidation/log/src/UnstyledLogOutputStyler.php', 'Consolidation\\OutputFormatters\\Exception\\AbstractDataFormatException' => __DIR__ . '/..' . '/consolidation/output-formatters/src/Exception/AbstractDataFormatException.php', 'Consolidation\\OutputFormatters\\Exception\\IncompatibleDataException' => __DIR__ . '/..' . '/consolidation/output-formatters/src/Exception/IncompatibleDataException.php', 'Consolidation\\OutputFormatters\\Exception\\InvalidFormatException' => __DIR__ . '/..' . '/consolidation/output-formatters/src/Exception/InvalidFormatException.php', @@ -950,6 +1053,45 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Consolidation\\OutputFormatters\\Validate\\ValidDataTypesInterface' => __DIR__ . '/..' . '/consolidation/output-formatters/src/Validate/ValidDataTypesInterface.php', 'Consolidation\\OutputFormatters\\Validate\\ValidDataTypesTrait' => __DIR__ . '/..' . '/consolidation/output-formatters/src/Validate/ValidDataTypesTrait.php', 'Consolidation\\OutputFormatters\\Validate\\ValidationInterface' => __DIR__ . '/..' . '/consolidation/output-formatters/src/Validate/ValidationInterface.php', + 'Consolidation\\SiteAlias\\Cli\\SiteAliasCommands' => __DIR__ . '/..' . '/consolidation/site-alias/src/Cli/SiteAliasCommands.php', + 'Consolidation\\SiteAlias\\DataFileLoaderInterface' => __DIR__ . '/..' . '/consolidation/site-alias/src/DataFileLoaderInterface.php', + 'Consolidation\\SiteAlias\\HostPath' => __DIR__ . '/..' . '/consolidation/site-alias/src/HostPath.php', + 'Consolidation\\SiteAlias\\SiteAlias' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAlias.php', + 'Consolidation\\SiteAlias\\SiteAliasFileDiscovery' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasFileDiscovery.php', + 'Consolidation\\SiteAlias\\SiteAliasFileLoader' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasFileLoader.php', + 'Consolidation\\SiteAlias\\SiteAliasInterface' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasInterface.php', + 'Consolidation\\SiteAlias\\SiteAliasManager' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasManager.php', + 'Consolidation\\SiteAlias\\SiteAliasManagerAwareInterface' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasManagerAwareInterface.php', + 'Consolidation\\SiteAlias\\SiteAliasManagerAwareTrait' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasManagerAwareTrait.php', + 'Consolidation\\SiteAlias\\SiteAliasManagerInitializationInterface' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasManagerInitializationInterface.php', + 'Consolidation\\SiteAlias\\SiteAliasManagerInterface' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasManagerInterface.php', + 'Consolidation\\SiteAlias\\SiteAliasName' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasName.php', + 'Consolidation\\SiteAlias\\SiteAliasTrait' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasTrait.php', + 'Consolidation\\SiteAlias\\SiteAliasWithConfig' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteAliasWithConfig.php', + 'Consolidation\\SiteAlias\\SiteSpecParser' => __DIR__ . '/..' . '/consolidation/site-alias/src/SiteSpecParser.php', + 'Consolidation\\SiteAlias\\Util\\FsUtils' => __DIR__ . '/..' . '/consolidation/site-alias/src/Util/FsUtils.php', + 'Consolidation\\SiteAlias\\Util\\YamlDataFileLoader' => __DIR__ . '/..' . '/consolidation/site-alias/src/Util/YamlDataFileLoader.php', + 'Consolidation\\SiteProcess\\Factory\\DockerComposeTransportFactory' => __DIR__ . '/..' . '/consolidation/site-process/src/Factory/DockerComposeTransportFactory.php', + 'Consolidation\\SiteProcess\\Factory\\SshTransportFactory' => __DIR__ . '/..' . '/consolidation/site-process/src/Factory/SshTransportFactory.php', + 'Consolidation\\SiteProcess\\Factory\\TransportFactoryInterface' => __DIR__ . '/..' . '/consolidation/site-process/src/Factory/TransportFactoryInterface.php', + 'Consolidation\\SiteProcess\\Factory\\VagrantTransportFactory' => __DIR__ . '/..' . '/consolidation/site-process/src/Factory/VagrantTransportFactory.php', + 'Consolidation\\SiteProcess\\ProcessBase' => __DIR__ . '/..' . '/consolidation/site-process/src/ProcessBase.php', + 'Consolidation\\SiteProcess\\ProcessManager' => __DIR__ . '/..' . '/consolidation/site-process/src/ProcessManager.php', + 'Consolidation\\SiteProcess\\ProcessManagerAwareInterface' => __DIR__ . '/..' . '/consolidation/site-process/src/ProcessManagerAwareInterface.php', + 'Consolidation\\SiteProcess\\ProcessManagerAwareTrait' => __DIR__ . '/..' . '/consolidation/site-process/src/ProcessManagerAwareTrait.php', + 'Consolidation\\SiteProcess\\Remo\\RemoCommands' => __DIR__ . '/..' . '/consolidation/site-process/src/Remo/RemoCommands.php', + 'Consolidation\\SiteProcess\\SiteProcess' => __DIR__ . '/..' . '/consolidation/site-process/src/SiteProcess.php', + 'Consolidation\\SiteProcess\\Transport\\DockerComposeTransport' => __DIR__ . '/..' . '/consolidation/site-process/src/Transport/DockerComposeTransport.php', + 'Consolidation\\SiteProcess\\Transport\\LocalTransport' => __DIR__ . '/..' . '/consolidation/site-process/src/Transport/LocalTransport.php', + 'Consolidation\\SiteProcess\\Transport\\SshTransport' => __DIR__ . '/..' . '/consolidation/site-process/src/Transport/SshTransport.php', + 'Consolidation\\SiteProcess\\Transport\\TransportInterface' => __DIR__ . '/..' . '/consolidation/site-process/src/Transport/TransportInterface.php', + 'Consolidation\\SiteProcess\\Transport\\VagrantTransport' => __DIR__ . '/..' . '/consolidation/site-process/src/Transport/VagrantTransport.php', + 'Consolidation\\SiteProcess\\Util\\ArgumentProcessor' => __DIR__ . '/..' . '/consolidation/site-process/src/Util/ArgumentProcessor.php', + 'Consolidation\\SiteProcess\\Util\\Escape' => __DIR__ . '/..' . '/consolidation/site-process/src/Util/Escape.php', + 'Consolidation\\SiteProcess\\Util\\RealtimeOutputHandler' => __DIR__ . '/..' . '/consolidation/site-process/src/Util/RealtimeOutputHandler.php', + 'Consolidation\\SiteProcess\\Util\\Shell' => __DIR__ . '/..' . '/consolidation/site-process/src/Util/Shell.php', + 'Consolidation\\SiteProcess\\Util\\ShellOperatorInterface' => __DIR__ . '/..' . '/consolidation/site-process/src/Util/ShellOperatorInterface.php', + 'Consolidation\\SiteProcess\\Util\\Tty' => __DIR__ . '/..' . '/consolidation/site-process/src/Util/Tty.php', 'Dflydev\\DotAccessConfiguration\\AbstractConfiguration' => __DIR__ . '/..' . '/dflydev/dot-access-configuration/src/Dflydev/DotAccessConfiguration/AbstractConfiguration.php', 'Dflydev\\DotAccessConfiguration\\AbstractConfigurationBuilder' => __DIR__ . '/..' . '/dflydev/dot-access-configuration/src/Dflydev/DotAccessConfiguration/AbstractConfigurationBuilder.php', 'Dflydev\\DotAccessConfiguration\\AbstractPlaceholderResolverFactory' => __DIR__ . '/..' . '/dflydev/dot-access-configuration/src/Dflydev/DotAccessConfiguration/AbstractPlaceholderResolverFactory.php', @@ -1095,6 +1237,123 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Doctrine\\Common\\Util\\Inflector' => __DIR__ . '/..' . '/doctrine/common/lib/Doctrine/Common/Util/Inflector.php', 'Doctrine\\Common\\Version' => __DIR__ . '/..' . '/doctrine/common/lib/Doctrine/Common/Version.php', 'Drupal' => __DIR__ . '/../..' . '/web/core/lib/Drupal.php', + 'DrupalCodeGenerator\\ApplicationFactory' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/ApplicationFactory.php', + 'DrupalCodeGenerator\\Asset' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Asset.php', + 'DrupalCodeGenerator\\Box\\PhpCompactor' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Box/PhpCompactor.php', + 'DrupalCodeGenerator\\Command\\BaseGenerator' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/BaseGenerator.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\CToolsPlugin\\Access' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Access.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\CToolsPlugin\\BasePlugin' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/BasePlugin.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\CToolsPlugin\\ContentType' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/ContentType.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\CToolsPlugin\\Relationship' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/CToolsPlugin/Relationship.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Hook' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Hook.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\InstallFile' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/InstallFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Javascript' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Javascript.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Module' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Module.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\ModuleFile' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\ModuleInfo' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/ModuleInfo.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Settings' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Settings.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\TemplatePhp' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/TemplatePhp.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Test' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Test.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\Theme' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/Theme.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\ThemeInfo' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/ThemeInfo.php', + 'DrupalCodeGenerator\\Command\\Drupal_7\\ViewsPlugin\\ArgumentDefault' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_7/ViewsPlugin/ArgumentDefault.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Composer' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Composer.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Controller' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Controller.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Field' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Field.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Form\\Config' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Config.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Form\\Confirm' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Confirm.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Form\\RouteInteractionTrait' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/RouteInteractionTrait.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Form\\Simple' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Form/Simple.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Hook' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Hook.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\InstallFile' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/InstallFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Javascript' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Javascript.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Layout' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Layout.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\ModuleFile' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/ModuleFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Module\\ConfigurationEntity' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ConfigurationEntity.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Module\\ContentEntity' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/ContentEntity.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Module\\Standard' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Module/Standard.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\PluginManager' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/PluginManager.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Action' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Action.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Block' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Block.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\CKEditor' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/CKEditor.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Condition' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Condition.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Constraint' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Constraint.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\EntityReferenceSelection' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/EntityReferenceSelection.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Field\\Formatter' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Formatter.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Field\\Type' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Type.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Field\\Widget' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Field/Widget.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Filter' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Filter.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\MenuLink' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/MenuLink.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Migrate\\Destination' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Destination.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Migrate\\Process' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Process.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Migrate\\Source' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Migrate/Source.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\QueueWorker' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/QueueWorker.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\RestResource' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/RestResource.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Views\\ArgumentDefault' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/ArgumentDefault.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Views\\Field' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Field.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Plugin\\Views\\Style' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Style.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Project' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Project.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\RenderElement' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/RenderElement.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\ServiceProvider' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/ServiceProvider.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\AccessChecker' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/AccessChecker.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\BreadcrumbBuilder' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/BreadcrumbBuilder.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\CacheContext' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/CacheContext.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\Custom' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Custom.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\EventSubscriber' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/EventSubscriber.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\Logger' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Logger.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\Middleware' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/Middleware.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\ParamConverter' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ParamConverter.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\PathProcessor' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/PathProcessor.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\RequestPolicy' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RequestPolicy.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\ResponsePolicy' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ResponsePolicy.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\RouteSubscriber' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/RouteSubscriber.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\ThemeNegotiator' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/ThemeNegotiator.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\TwigExtension' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/TwigExtension.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Service\\UninstallValidator' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/UninstallValidator.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\SettingsLocal' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/SettingsLocal.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Template' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Template.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Browser' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Browser.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Kernel' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Kernel.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Nightwatch' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Nightwatch.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Unit' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Unit.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\Web' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/Web.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Test\\WebDriver' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Test/WebDriver.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Theme' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Theme.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\ThemeFile' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeFile.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\ThemeSettings' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/ThemeSettings.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Breakpoints' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Breakpoints.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Links\\Action' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Action.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Links\\Contextual' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Contextual.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Links\\Menu' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Menu.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Links\\Task' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Task.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\ModuleInfo' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleInfo.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\ModuleLibraries' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleLibraries.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Permissions' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Permissions.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Routing' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Routing.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\Services' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Services.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\ThemeInfo' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeInfo.php', + 'DrupalCodeGenerator\\Command\\Drupal_8\\Yml\\ThemeLibraries' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ThemeLibraries.php', + 'DrupalCodeGenerator\\Command\\GeneratorInterface' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/GeneratorInterface.php', + 'DrupalCodeGenerator\\Command\\Navigation' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Navigation.php', + 'DrupalCodeGenerator\\Command\\Other\\ApacheVirtualHost' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Other/ApacheVirtualHost.php', + 'DrupalCodeGenerator\\Command\\Other\\DcgCommand' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Other/DcgCommand.php', + 'DrupalCodeGenerator\\Command\\Other\\DrupalConsoleCommand' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Other/DrupalConsoleCommand.php', + 'DrupalCodeGenerator\\Command\\Other\\DrushCommand' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Other/DrushCommand.php', + 'DrupalCodeGenerator\\Command\\Other\\HtmlPage' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Other/HtmlPage.php', + 'DrupalCodeGenerator\\Command\\Other\\NginxVirtualHost' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Command/Other/NginxVirtualHost.php', + 'DrupalCodeGenerator\\GeneratorDiscovery' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/GeneratorDiscovery.php', + 'DrupalCodeGenerator\\GeneratorTester' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/GeneratorTester.php', + 'DrupalCodeGenerator\\Helper\\Dumper' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Helper/Dumper.php', + 'DrupalCodeGenerator\\Helper\\InputHandler' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Helper/InputHandler.php', + 'DrupalCodeGenerator\\Helper\\OutputHandler' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Helper/OutputHandler.php', + 'DrupalCodeGenerator\\Helper\\QuestionSettersTrait' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Helper/QuestionSettersTrait.php', + 'DrupalCodeGenerator\\Helper\\Renderer' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Helper/Renderer.php', + 'DrupalCodeGenerator\\LegacyUtilsTrait' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/LegacyUtilsTrait.php', + 'DrupalCodeGenerator\\Twig\\Twig1Environment' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Twig/Twig1Environment.php', + 'DrupalCodeGenerator\\Twig\\Twig2Environment' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Twig/Twig2Environment.php', + 'DrupalCodeGenerator\\Twig\\TwigSortSetNode' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Twig/TwigSortSetNode.php', + 'DrupalCodeGenerator\\Twig\\TwigSortTokenParser' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Twig/TwigSortTokenParser.php', + 'DrupalCodeGenerator\\Utils' => __DIR__ . '/..' . '/chi-teck/drupal-code-generator/src/Utils.php', 'DrupalComposer\\DrupalScaffold\\CommandProvider' => __DIR__ . '/..' . '/drupal-composer/drupal-scaffold/src/CommandProvider.php', 'DrupalComposer\\DrupalScaffold\\DrupalScaffoldCommand' => __DIR__ . '/..' . '/drupal-composer/drupal-scaffold/src/DrupalScaffoldCommand.php', 'DrupalComposer\\DrupalScaffold\\FileFetcher' => __DIR__ . '/..' . '/drupal-composer/drupal-scaffold/src/FileFetcher.php', @@ -2528,8 +2787,6 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Drupal\\Core\\Language\\LanguageManager' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Language/LanguageManager.php', 'Drupal\\Core\\Language\\LanguageManagerInterface' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Language/LanguageManagerInterface.php', 'Drupal\\Core\\Layout\\Annotation\\Layout' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/Annotation/Layout.php', - 'Drupal\\Core\\Layout\\Icon\\IconBuilderInterface' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php', - 'Drupal\\Core\\Layout\\Icon\\SvgIconBuilder' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/Icon/SvgIconBuilder.php', 'Drupal\\Core\\Layout\\LayoutDefault' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/LayoutDefault.php', 'Drupal\\Core\\Layout\\LayoutDefinition' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/LayoutDefinition.php', 'Drupal\\Core\\Layout\\LayoutInterface' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/LayoutInterface.php', @@ -3097,92 +3354,171 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Drupal\\redis\\Queue\\ReliableQueueBase' => __DIR__ . '/../..' . '/web/modules/redis/src/Queue/ReliableQueueBase.php', 'Drupal\\redis\\Queue\\ReliableQueueRedisFactory' => __DIR__ . '/../..' . '/web/modules/redis/src/Queue/ReliableQueueRedisFactory.php', 'Drupal\\redis\\RedisPrefixTrait' => __DIR__ . '/../..' . '/web/modules/redis/src/RedisPrefixTrait.php', - 'Drush\\Boot\\BaseBoot' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Boot/BaseBoot.php', - 'Drush\\Boot\\Boot' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Boot/Boot.php', - 'Drush\\Boot\\DrupalBoot' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Boot/DrupalBoot.php', - 'Drush\\Boot\\DrupalBoot6' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Boot/DrupalBoot6.php', - 'Drush\\Boot\\DrupalBoot7' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Boot/DrupalBoot7.php', - 'Drush\\Boot\\DrupalBoot8' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Boot/DrupalBoot8.php', - 'Drush\\Boot\\EmptyBoot' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Boot/EmptyBoot.php', - 'Drush\\Cache\\CacheInterface' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Cache/CacheInterface.php', - 'Drush\\Cache\\FileCache' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Cache/FileCache.php', - 'Drush\\Cache\\JSONCache' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Cache/JSONCache.php', - 'Drush\\CommandFiles\\Core\\BrowseCommands' => __DIR__ . '/..' . '/drush/drush/lib/Drush/CommandFiles/core/browseCommands.php', - 'Drush\\CommandFiles\\ExampleCommandFile' => __DIR__ . '/..' . '/drush/drush/lib/Drush/CommandFiles/ExampleCommandFile.php', - 'Drush\\CommandFiles\\core\\DrupliconCommands' => __DIR__ . '/..' . '/drush/drush/lib/Drush/CommandFiles/core/DrupliconCommands.php', - 'Drush\\Command\\Commandfiles' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Command/Commandfiles.php', - 'Drush\\Command\\CommandfilesInterface' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Command/CommandfilesInterface.php', - 'Drush\\Command\\DrushInputAdapter' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Command/DrushInputAdapter.php', - 'Drush\\Command\\DrushOutputAdapter' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Command/DrushOutputAdapter.php', - 'Drush\\Command\\ServiceCommandlist' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Command/ServiceCommandlist.php', - 'Drush\\Commands\\DrushCommands' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Commands/DrushCommands.php', - 'Drush\\Commands\\core\\SanitizeCommands' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Commands/core/SanitizeCommands.php', - 'Drush\\Commands\\core\\StatusCommands' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Commands/core/StatusCommands.php', - 'Drush\\ConfigAdapter' => __DIR__ . '/..' . '/drush/drush/lib/Drush/ConfigAdapter.php', - 'Drush\\Drupal\\DrupalKernel' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Drupal/DrupalKernel.php', - 'Drush\\Drupal\\DrushServiceModifier' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Drupal/DrushServiceModifier.php', - 'Drush\\Drupal\\ExtensionDiscovery' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Drupal/ExtensionDiscovery.php', - 'Drush\\Drupal\\FindCommandsCompilerPass' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Drupal/FindCommandsCompilerPass.php', - 'Drush\\Drush' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Drush.php', - 'Drush\\DrushConfig' => __DIR__ . '/..' . '/drush/drush/lib/Drush/DrushConfig.php', - 'Drush\\Exceptions\\UserAbortException' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Exceptions/UserAbortException.php', - 'Drush\\Log\\DrushLog' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Log/DrushLog.php', - 'Drush\\Log\\LogLevel' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Log/LogLevel.php', - 'Drush\\Log\\Logger' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Log/Logger.php', - 'Drush\\Make\\Parser\\ParserIni' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Make/Parser/ParserIni.php', - 'Drush\\Make\\Parser\\ParserInterface' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Make/Parser/ParserInterface.php', - 'Drush\\Make\\Parser\\ParserYaml' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Make/Parser/ParserYaml.php', - 'Drush\\Psysh\\Caster' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Psysh/Caster.php', - 'Drush\\Psysh\\DrushCommand' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Psysh/DrushCommand.php', - 'Drush\\Psysh\\DrushHelpCommand' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Psysh/DrushHelpCommand.php', - 'Drush\\Psysh\\Shell' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Psysh/Shell.php', - 'Drush\\Queue\\Queue6' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Queue/Queue6.php', - 'Drush\\Queue\\Queue7' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Queue/Queue7.php', - 'Drush\\Queue\\Queue8' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Queue/Queue8.php', - 'Drush\\Queue\\QueueBase' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Queue/QueueBase.php', - 'Drush\\Queue\\QueueException' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Queue/QueueException.php', - 'Drush\\Queue\\QueueInterface' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Queue/QueueInterface.php', - 'Drush\\Role\\Role6' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Role/Role6.php', - 'Drush\\Role\\Role7' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Role/Role7.php', - 'Drush\\Role\\Role8' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Role/Role8.php', - 'Drush\\Role\\RoleBase' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Role/RoleBase.php', - 'Drush\\Role\\RoleException' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Role/RoleException.php', - 'Drush\\SiteAlias\\AliasManagerAdapter' => __DIR__ . '/..' . '/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapter.php', - 'Drush\\SiteAlias\\AliasManagerAdapterInjector' => __DIR__ . '/..' . '/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapterInjector.php', - 'Drush\\SiteAlias\\ProcessManager' => __DIR__ . '/..' . '/drush/drush/lib/Drush/SiteAlias/ProcessManager.php', - 'Drush\\SiteAlias\\ProcessManagerInjector' => __DIR__ . '/..' . '/drush/drush/lib/Drush/SiteAlias/ProcessManagerInjector.php', - 'Drush\\Sql\\Sql6' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sql6.php', - 'Drush\\Sql\\Sql7' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sql7.php', - 'Drush\\Sql\\Sql8' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sql8.php', - 'Drush\\Sql\\SqlBase' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/SqlBase.php', - 'Drush\\Sql\\SqlException' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/SqlException.php', - 'Drush\\Sql\\SqlVersion' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/SqlVersion.php', - 'Drush\\Sql\\Sqlmysql' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sqlmysql.php', - 'Drush\\Sql\\Sqlmysqli' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sqlmysqli.php', - 'Drush\\Sql\\Sqloracle' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sqloracle.php', - 'Drush\\Sql\\Sqlpgsql' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sqlpgsql.php', - 'Drush\\Sql\\Sqlsqlite' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sqlsqlite.php', - 'Drush\\Sql\\Sqlsqlsrv' => __DIR__ . '/..' . '/drush/drush/lib/Drush/Sql/Sqlsqlsrv.php', + 'Drush\\Application' => __DIR__ . '/..' . '/drush/drush/src/Application.php', + 'Drush\\Backend\\BackendPathEvaluator' => __DIR__ . '/..' . '/drush/drush/src/Backend/BackendPathEvaluator.php', + 'Drush\\Backend\\BackendResultSetter' => __DIR__ . '/..' . '/drush/drush/src/Backend/BackendResultSetter.php', + 'Drush\\Boot\\AutoloaderAwareInterface' => __DIR__ . '/..' . '/drush/drush/src/Boot/AutoloaderAwareInterface.php', + 'Drush\\Boot\\AutoloaderAwareTrait' => __DIR__ . '/..' . '/drush/drush/src/Boot/AutoloaderAwareTrait.php', + 'Drush\\Boot\\BaseBoot' => __DIR__ . '/..' . '/drush/drush/src/Boot/BaseBoot.php', + 'Drush\\Boot\\Boot' => __DIR__ . '/..' . '/drush/drush/src/Boot/Boot.php', + 'Drush\\Boot\\BootstrapHook' => __DIR__ . '/..' . '/drush/drush/src/Boot/BootstrapHook.php', + 'Drush\\Boot\\BootstrapManager' => __DIR__ . '/..' . '/drush/drush/src/Boot/BootstrapManager.php', + 'Drush\\Boot\\DrupalBoot' => __DIR__ . '/..' . '/drush/drush/src/Boot/DrupalBoot.php', + 'Drush\\Boot\\DrupalBoot8' => __DIR__ . '/..' . '/drush/drush/src/Boot/DrupalBoot8.php', + 'Drush\\Boot\\EmptyBoot' => __DIR__ . '/..' . '/drush/drush/src/Boot/EmptyBoot.php', + 'Drush\\Boot\\Kernels' => __DIR__ . '/..' . '/drush/drush/src/Boot/Kernels.php', + 'Drush\\Cache\\CacheInterface' => __DIR__ . '/..' . '/drush/drush/src/Cache/CacheInterface.php', + 'Drush\\Cache\\CommandCache' => __DIR__ . '/..' . '/drush/drush/src/Cache/CommandCache.php', + 'Drush\\Cache\\FileCache' => __DIR__ . '/..' . '/drush/drush/src/Cache/FileCache.php', + 'Drush\\Cache\\JSONCache' => __DIR__ . '/..' . '/drush/drush/src/Cache/JSONCache.php', + 'Drush\\Command\\DrushCommandInfoAlterer' => __DIR__ . '/..' . '/drush/drush/src/Command/DrushCommandInfoAlterer.php', + 'Drush\\Command\\GlobalOptionsEventListener' => __DIR__ . '/..' . '/drush/drush/src/Command/GlobalOptionsEventListener.php', + 'Drush\\Command\\RemoteCommandProxy' => __DIR__ . '/..' . '/drush/drush/src/Command/RemoteCommandProxy.php', + 'Drush\\Command\\ServiceCommandlist' => __DIR__ . '/..' . '/drush/drush/src/Command/ServiceCommandlist.php', + 'Drush\\Commands\\DrushCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/DrushCommands.php', + 'Drush\\Commands\\ExampleCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/ExampleCommands.php', + 'Drush\\Commands\\LegacyCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/LegacyCommands.php', + 'Drush\\Commands\\OptionsCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/OptionsCommands.php', + 'Drush\\Commands\\ValidatorsCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/ValidatorsCommands.php', + 'Drush\\Commands\\config\\ConfigPullCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/config/ConfigPullCommands.php', + 'Drush\\Commands\\core\\BrowseCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/BrowseCommands.php', + 'Drush\\Commands\\core\\CacheCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/CacheCommands.php', + 'Drush\\Commands\\core\\CoreCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/CoreCommands.php', + 'Drush\\Commands\\core\\DocsCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/DocsCommands.php', + 'Drush\\Commands\\core\\DrupalDirectoryCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/DrupalDirectoryCommands.php', + 'Drush\\Commands\\core\\DrupliconCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/DrupliconCommands.php', + 'Drush\\Commands\\core\\EditCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/EditCommands.php', + 'Drush\\Commands\\core\\InitCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/InitCommands.php', + 'Drush\\Commands\\core\\LoginCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/LoginCommands.php', + 'Drush\\Commands\\core\\NotifyCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/NotifyCommands.php', + 'Drush\\Commands\\core\\PhpCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/PhpCommands.php', + 'Drush\\Commands\\core\\RsyncCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/RsyncCommands.php', + 'Drush\\Commands\\core\\RunserverCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/RunserverCommands.php', + 'Drush\\Commands\\core\\SiteCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/SiteCommands.php', + 'Drush\\Commands\\core\\SiteInstallCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/SiteInstallCommands.php', + 'Drush\\Commands\\core\\SshCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/SshCommands.php', + 'Drush\\Commands\\core\\StatusCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/StatusCommands.php', + 'Drush\\Commands\\core\\TopicCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/TopicCommands.php', + 'Drush\\Commands\\core\\UpdateDBCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/UpdateDBCommands.php', + 'Drush\\Commands\\core\\XhprofCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/core/XhprofCommands.php', + 'Drush\\Commands\\generate\\GenerateCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/generate/GenerateCommands.php', + 'Drush\\Commands\\generate\\Generators\\Drush\\DrushAliasFile' => __DIR__ . '/..' . '/drush/drush/src/Commands/generate/Generators/Drush/DrushAliasFile.php', + 'Drush\\Commands\\generate\\Generators\\Drush\\DrushCommandFile' => __DIR__ . '/..' . '/drush/drush/src/Commands/generate/Generators/Drush/DrushCommandFile.php', + 'Drush\\Commands\\generate\\Generators\\Migrate\\MigrationGenerator' => __DIR__ . '/..' . '/drush/drush/src/Commands/generate/Generators/Migrate/MigrationGenerator.php', + 'Drush\\Commands\\generate\\Helper\\InputHandler' => __DIR__ . '/..' . '/drush/drush/src/Commands/generate/Helper/InputHandler.php', + 'Drush\\Commands\\generate\\Helper\\OutputHandler' => __DIR__ . '/..' . '/drush/drush/src/Commands/generate/Helper/OutputHandler.php', + 'Drush\\Commands\\help\\DrushHelpDocument' => __DIR__ . '/..' . '/drush/drush/src/Commands/help/DrushHelpDocument.php', + 'Drush\\Commands\\help\\HelpCLIFormatter' => __DIR__ . '/..' . '/drush/drush/src/Commands/help/HelpCLIFormatter.php', + 'Drush\\Commands\\help\\HelpCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/help/HelpCommands.php', + 'Drush\\Commands\\help\\ListCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/help/ListCommands.php', + 'Drush\\Commands\\pm\\SecurityUpdateCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/pm/SecurityUpdateCommands.php', + 'Drush\\Commands\\sql\\SqlCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/sql/SqlCommands.php', + 'Drush\\Commands\\sql\\SqlSyncCommands' => __DIR__ . '/..' . '/drush/drush/src/Commands/sql/SqlSyncCommands.php', + 'Drush\\Config\\ConfigAwareTrait' => __DIR__ . '/..' . '/drush/drush/src/Config/ConfigAwareTrait.php', + 'Drush\\Config\\ConfigLocator' => __DIR__ . '/..' . '/drush/drush/src/Config/ConfigLocator.php', + 'Drush\\Config\\DrushConfig' => __DIR__ . '/..' . '/drush/drush/src/Config/DrushConfig.php', + 'Drush\\Config\\Environment' => __DIR__ . '/..' . '/drush/drush/src/Config/Environment.php', + 'Drush\\Config\\Loader\\YamlConfigLoader' => __DIR__ . '/..' . '/drush/drush/src/Config/Loader/YamlConfigLoader.php', + 'Drush\\Drupal\\Commands\\config\\ConfigCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/config/ConfigCommands.php', + 'Drush\\Drupal\\Commands\\config\\ConfigExportCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php', + 'Drush\\Drupal\\Commands\\config\\ConfigImportCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php', + 'Drush\\Drupal\\Commands\\core\\BatchCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/BatchCommands.php', + 'Drush\\Drupal\\Commands\\core\\CliCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/CliCommands.php', + 'Drush\\Drupal\\Commands\\core\\DrupalCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/DrupalCommands.php', + 'Drush\\Drupal\\Commands\\core\\EntityCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/EntityCommands.php', + 'Drush\\Drupal\\Commands\\core\\ImageCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/ImageCommands.php', + 'Drush\\Drupal\\Commands\\core\\JsonapiCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/JsonapiCommands.php', + 'Drush\\Drupal\\Commands\\core\\LanguageCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/LanguageCommands.php', + 'Drush\\Drupal\\Commands\\core\\LocaleCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/LocaleCommands.php', + 'Drush\\Drupal\\Commands\\core\\MessengerCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/MessengerCommands.php', + 'Drush\\Drupal\\Commands\\core\\QueueCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/QueueCommands.php', + 'Drush\\Drupal\\Commands\\core\\RoleCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/RoleCommands.php', + 'Drush\\Drupal\\Commands\\core\\StateCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/StateCommands.php', + 'Drush\\Drupal\\Commands\\core\\TwigCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/TwigCommands.php', + 'Drush\\Drupal\\Commands\\core\\UserCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/UserCommands.php', + 'Drush\\Drupal\\Commands\\core\\ViewsCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/ViewsCommands.php', + 'Drush\\Drupal\\Commands\\core\\WatchdogCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/core/WatchdogCommands.php', + 'Drush\\Drupal\\Commands\\pm\\PmCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/pm/PmCommands.php', + 'Drush\\Drupal\\Commands\\pm\\ThemeCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/pm/ThemeCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/sql/SanitizeCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeCommentsCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/sql/SanitizeCommentsCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizePluginInterface' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/sql/SanitizePluginInterface.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeSessionsCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/sql/SanitizeSessionsCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeUserFieldsCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/sql/SanitizeUserFieldsCommands.php', + 'Drush\\Drupal\\Commands\\sql\\SanitizeUserTableCommands' => __DIR__ . '/..' . '/drush/drush/src/Drupal/Commands/sql/SanitizeUserTableCommands.php', + 'Drush\\Drupal\\DrupalKernel' => __DIR__ . '/..' . '/drush/drush/src/Drupal/DrupalKernel.php', + 'Drush\\Drupal\\DrupalKernelTrait' => __DIR__ . '/..' . '/drush/drush/src/Drupal/DrupalKernelTrait.php', + 'Drush\\Drupal\\DrupalUtil' => __DIR__ . '/..' . '/drush/drush/src/Drupal/DrupalUtil.php', + 'Drush\\Drupal\\DrushServiceModifier' => __DIR__ . '/..' . '/drush/drush/src/Drupal/DrushServiceModifier.php', + 'Drush\\Drupal\\ExtensionDiscovery' => __DIR__ . '/..' . '/drush/drush/src/Drupal/ExtensionDiscovery.php', + 'Drush\\Drupal\\FindCommandsCompilerPass' => __DIR__ . '/..' . '/drush/drush/src/Drupal/FindCommandsCompilerPass.php', + 'Drush\\Drupal\\InstallerKernel' => __DIR__ . '/..' . '/drush/drush/src/Drupal/InstallerKernel.php', + 'Drush\\Drupal\\UpdateKernel' => __DIR__ . '/..' . '/drush/drush/src/Drupal/UpdateKernel.php', + 'Drush\\Drush' => __DIR__ . '/..' . '/drush/drush/src/Drush.php', + 'Drush\\Exceptions\\UserAbortException' => __DIR__ . '/..' . '/drush/drush/src/Exceptions/UserAbortException.php', + 'Drush\\Exec\\ExecTrait' => __DIR__ . '/..' . '/drush/drush/src/Exec/ExecTrait.php', + 'Drush\\Formatters\\DrushFormatterManager' => __DIR__ . '/..' . '/drush/drush/src/Formatters/DrushFormatterManager.php', + 'Drush\\Internal\\Config\\Yaml\\Escaper' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Escaper.php', + 'Drush\\Internal\\Config\\Yaml\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Exception/ExceptionInterface.php', + 'Drush\\Internal\\Config\\Yaml\\Exception\\ParseException' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Exception/ParseException.php', + 'Drush\\Internal\\Config\\Yaml\\Exception\\RuntimeException' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Exception/RuntimeException.php', + 'Drush\\Internal\\Config\\Yaml\\Inline' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Inline.php', + 'Drush\\Internal\\Config\\Yaml\\Parser' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Parser.php', + 'Drush\\Internal\\Config\\Yaml\\Tag\\TaggedValue' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Tag/TaggedValue.php', + 'Drush\\Internal\\Config\\Yaml\\Unescaper' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Unescaper.php', + 'Drush\\Internal\\Config\\Yaml\\Yaml' => __DIR__ . '/..' . '/drush/drush/src/internal-forks/Config/Yaml/Yaml.php', + 'Drush\\Log\\DrushLog' => __DIR__ . '/..' . '/drush/drush/src/Log/DrushLog.php', + 'Drush\\Log\\LogLevel' => __DIR__ . '/..' . '/drush/drush/src/Log/LogLevel.php', + 'Drush\\Log\\Logger' => __DIR__ . '/..' . '/drush/drush/src/Log/Logger.php', + 'Drush\\Preflight\\ArgsPreprocessor' => __DIR__ . '/..' . '/drush/drush/src/Preflight/ArgsPreprocessor.php', + 'Drush\\Preflight\\ArgsRemapper' => __DIR__ . '/..' . '/drush/drush/src/Preflight/ArgsRemapper.php', + 'Drush\\Preflight\\LegacyPreflight' => __DIR__ . '/..' . '/drush/drush/src/Preflight/LegacyPreflight.php', + 'Drush\\Preflight\\Preflight' => __DIR__ . '/..' . '/drush/drush/src/Preflight/Preflight.php', + 'Drush\\Preflight\\PreflightArgs' => __DIR__ . '/..' . '/drush/drush/src/Preflight/PreflightArgs.php', + 'Drush\\Preflight\\PreflightArgsInterface' => __DIR__ . '/..' . '/drush/drush/src/Preflight/PreflightArgsInterface.php', + 'Drush\\Preflight\\PreflightLog' => __DIR__ . '/..' . '/drush/drush/src/Preflight/PreflightLog.php', + 'Drush\\Preflight\\PreflightSiteLocator' => __DIR__ . '/..' . '/drush/drush/src/Preflight/PreflightSiteLocator.php', + 'Drush\\Preflight\\PreflightVerify' => __DIR__ . '/..' . '/drush/drush/src/Preflight/PreflightVerify.php', + 'Drush\\Preflight\\RedispatchToSiteLocal' => __DIR__ . '/..' . '/drush/drush/src/Preflight/RedispatchToSiteLocal.php', + 'Drush\\Psysh\\Caster' => __DIR__ . '/..' . '/drush/drush/src/Psysh/Caster.php', + 'Drush\\Psysh\\DrushCommand' => __DIR__ . '/..' . '/drush/drush/src/Psysh/DrushCommand.php', + 'Drush\\Psysh\\DrushHelpCommand' => __DIR__ . '/..' . '/drush/drush/src/Psysh/DrushHelpCommand.php', + 'Drush\\Psysh\\Shell' => __DIR__ . '/..' . '/drush/drush/src/Psysh/Shell.php', + 'Drush\\Runtime\\DependencyInjection' => __DIR__ . '/..' . '/drush/drush/src/Runtime/DependencyInjection.php', + 'Drush\\Runtime\\ErrorHandler' => __DIR__ . '/..' . '/drush/drush/src/Runtime/ErrorHandler.php', + 'Drush\\Runtime\\HandlerInterface' => __DIR__ . '/..' . '/drush/drush/src/Runtime/HandlerInterface.php', + 'Drush\\Runtime\\RedispatchHook' => __DIR__ . '/..' . '/drush/drush/src/Runtime/RedispatchHook.php', + 'Drush\\Runtime\\Runtime' => __DIR__ . '/..' . '/drush/drush/src/Runtime/Runtime.php', + 'Drush\\Runtime\\ShutdownHandler' => __DIR__ . '/..' . '/drush/drush/src/Runtime/ShutdownHandler.php', + 'Drush\\Runtime\\TildeExpansionHook' => __DIR__ . '/..' . '/drush/drush/src/Runtime/TildeExpansionHook.php', + 'Drush\\SiteAlias\\HostPath' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/HostPath.php', + 'Drush\\SiteAlias\\LegacyAliasConverter' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/LegacyAliasConverter.php', + 'Drush\\SiteAlias\\ProcessManager' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/ProcessManager.php', + 'Drush\\SiteAlias\\SiteAliasFileLoader' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/SiteAliasFileLoader.php', + 'Drush\\SiteAlias\\SiteAliasManagerAwareInterface' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/SiteAliasManagerAwareInterface.php', + 'Drush\\SiteAlias\\SiteAliasManagerAwareTrait' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/SiteAliasManagerAwareTrait.php', + 'Drush\\SiteAlias\\SiteAliasName' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/SiteAliasName.php', + 'Drush\\SiteAlias\\SiteSpecParser' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/SiteSpecParser.php', + 'Drush\\SiteAlias\\Util\\InternalYamlDataFileLoader' => __DIR__ . '/..' . '/drush/drush/src/SiteAlias/Util/InternalYamlDataFileLoader.php', + 'Drush\\Sql\\SqlBase' => __DIR__ . '/..' . '/drush/drush/src/Sql/SqlBase.php', + 'Drush\\Sql\\SqlException' => __DIR__ . '/..' . '/drush/drush/src/Sql/SqlException.php', + 'Drush\\Sql\\SqlMysql' => __DIR__ . '/..' . '/drush/drush/src/Sql/SqlMysql.php', + 'Drush\\Sql\\SqlOracle' => __DIR__ . '/..' . '/drush/drush/src/Sql/SqlOracle.php', + 'Drush\\Sql\\SqlPgsql' => __DIR__ . '/..' . '/drush/drush/src/Sql/SqlPgsql.php', + 'Drush\\Sql\\SqlSqlite' => __DIR__ . '/..' . '/drush/drush/src/Sql/SqlSqlite.php', + 'Drush\\Sql\\SqlSqlsrv' => __DIR__ . '/..' . '/drush/drush/src/Sql/SqlSqlsrv.php', + 'Drush\\Sql\\SqlTableSelectionTrait' => __DIR__ . '/..' . '/drush/drush/src/Sql/SqlTableSelectionTrait.php', + 'Drush\\Style\\DrushStyle' => __DIR__ . '/..' . '/drush/drush/src/Style/DrushStyle.php', + 'Drush\\Symfony\\BootstrapCompilerPass' => __DIR__ . '/..' . '/drush/drush/src/Symfony/BootstrapCompilerPass.php', + 'Drush\\Symfony\\BufferedConsoleOutput' => __DIR__ . '/..' . '/drush/drush/src/Symfony/BufferedConsoleOutput.php', + 'Drush\\Symfony\\DrushArgvInput' => __DIR__ . '/..' . '/drush/drush/src/Symfony/DrushArgvInput.php', + 'Drush\\Symfony\\IndiscriminateInputDefinition' => __DIR__ . '/..' . '/drush/drush/src/Symfony/IndiscriminateInputDefinition.php', + 'Drush\\Symfony\\LessStrictArgvInput' => __DIR__ . '/..' . '/drush/drush/src/Symfony/LessStrictArgvInput.php', 'Drush\\TestTraits\\CliTestTrait' => __DIR__ . '/..' . '/drush/drush/src/TestTraits/CliTestTrait.php', 'Drush\\TestTraits\\DrushTestTrait' => __DIR__ . '/..' . '/drush/drush/src/TestTraits/DrushTestTrait.php', 'Drush\\TestTraits\\OutputUtilsTrait' => __DIR__ . '/..' . '/drush/drush/src/TestTraits/OutputUtilsTrait.php', - 'Drush\\UpdateService\\Project' => __DIR__ . '/..' . '/drush/drush/lib/Drush/UpdateService/Project.php', - 'Drush\\UpdateService\\ReleaseInfo' => __DIR__ . '/..' . '/drush/drush/lib/Drush/UpdateService/ReleaseInfo.php', - 'Drush\\UpdateService\\StatusInfoDrupal6' => __DIR__ . '/..' . '/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal6.php', - 'Drush\\UpdateService\\StatusInfoDrupal7' => __DIR__ . '/..' . '/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal7.php', - 'Drush\\UpdateService\\StatusInfoDrupal8' => __DIR__ . '/..' . '/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal8.php', - 'Drush\\UpdateService\\StatusInfoDrush' => __DIR__ . '/..' . '/drush/drush/lib/Drush/UpdateService/StatusInfoDrush.php', - 'Drush\\UpdateService\\StatusInfoInterface' => __DIR__ . '/..' . '/drush/drush/lib/Drush/UpdateService/StatusInfoInterface.php', - 'Drush\\User\\User6' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/User6.php', - 'Drush\\User\\User7' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/User7.php', - 'Drush\\User\\User8' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/User8.php', - 'Drush\\User\\UserList' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/UserList.php', - 'Drush\\User\\UserListException' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/UserListException.php', - 'Drush\\User\\UserSingle6' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/UserSingle6.php', - 'Drush\\User\\UserSingle7' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/UserSingle7.php', - 'Drush\\User\\UserSingle8' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/UserSingle8.php', - 'Drush\\User\\UserSingleBase' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/UserSingleBase.php', - 'Drush\\User\\UserVersion' => __DIR__ . '/..' . '/drush/drush/lib/Drush/User/UserVersion.php', + 'Drush\\Utils\\FsUtils' => __DIR__ . '/..' . '/drush/drush/src/Utils/FsUtils.php', + 'Drush\\Utils\\StringUtils' => __DIR__ . '/..' . '/drush/drush/src/Utils/StringUtils.php', 'EasyRdf_Collection' => __DIR__ . '/..' . '/easyrdf/easyrdf/lib/EasyRdf/Collection.php', 'EasyRdf_Container' => __DIR__ . '/..' . '/easyrdf/easyrdf/lib/EasyRdf/Container.php', 'EasyRdf_Exception' => __DIR__ . '/..' . '/easyrdf/easyrdf/lib/EasyRdf/Exception.php', @@ -3285,6 +3621,10 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Gettext\\Utils\\ParsedFunction' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/ParsedFunction.php', 'Gettext\\Utils\\PhpFunctionsScanner' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/PhpFunctionsScanner.php', 'Gettext\\Utils\\StringReader' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/StringReader.php', + 'Grasmash\\Expander\\Expander' => __DIR__ . '/..' . '/grasmash/expander/src/Expander.php', + 'Grasmash\\Expander\\Stringifier' => __DIR__ . '/..' . '/grasmash/expander/src/Stringifier.php', + 'Grasmash\\Expander\\StringifierInterface' => __DIR__ . '/..' . '/grasmash/expander/src/StringifierInterface.php', + 'Grasmash\\YamlExpander\\Expander' => __DIR__ . '/..' . '/grasmash/yaml-expander/src/Expander.php', 'GuzzleHttp\\Client' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Client.php', 'GuzzleHttp\\ClientInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/ClientInterface.php', 'GuzzleHttp\\Cookie\\CookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php', @@ -3354,6 +3694,9 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'GuzzleHttp\\RetryMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RetryMiddleware.php', 'GuzzleHttp\\TransferStats' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/TransferStats.php', 'GuzzleHttp\\UriTemplate' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/UriTemplate.php', + 'Interop\\Container\\ContainerInterface' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php', + 'Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php', + 'Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php', 'JaimePerez\\TwigConfigurableI18n\\Twig\\Environment' => __DIR__ . '/..' . '/jaimeperez/twig-configurable-i18n/src/Twig/Environment.php', 'JaimePerez\\TwigConfigurableI18n\\Twig\\Extensions\\Extension\\I18n' => __DIR__ . '/..' . '/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Extension/I18n.php', 'JaimePerez\\TwigConfigurableI18n\\Twig\\Extensions\\Node\\Trans' => __DIR__ . '/..' . '/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Node/Trans.php', @@ -3361,6 +3704,36 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'JakubOnderka\\PhpConsoleColor\\ConsoleColor' => __DIR__ . '/..' . '/jakub-onderka/php-console-color/src/ConsoleColor.php', 'JakubOnderka\\PhpConsoleColor\\InvalidStyleException' => __DIR__ . '/..' . '/jakub-onderka/php-console-color/src/InvalidStyleException.php', 'JakubOnderka\\PhpConsoleHighlighter\\Highlighter' => __DIR__ . '/..' . '/jakub-onderka/php-console-highlighter/src/Highlighter.php', + 'League\\Container\\Argument\\ArgumentResolverInterface' => __DIR__ . '/..' . '/league/container/src/Argument/ArgumentResolverInterface.php', + 'League\\Container\\Argument\\ArgumentResolverTrait' => __DIR__ . '/..' . '/league/container/src/Argument/ArgumentResolverTrait.php', + 'League\\Container\\Argument\\RawArgument' => __DIR__ . '/..' . '/league/container/src/Argument/RawArgument.php', + 'League\\Container\\Argument\\RawArgumentInterface' => __DIR__ . '/..' . '/league/container/src/Argument/RawArgumentInterface.php', + 'League\\Container\\Container' => __DIR__ . '/..' . '/league/container/src/Container.php', + 'League\\Container\\ContainerAwareInterface' => __DIR__ . '/..' . '/league/container/src/ContainerAwareInterface.php', + 'League\\Container\\ContainerAwareTrait' => __DIR__ . '/..' . '/league/container/src/ContainerAwareTrait.php', + 'League\\Container\\ContainerInterface' => __DIR__ . '/..' . '/league/container/src/ContainerInterface.php', + 'League\\Container\\Definition\\AbstractDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/AbstractDefinition.php', + 'League\\Container\\Definition\\CallableDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/CallableDefinition.php', + 'League\\Container\\Definition\\ClassDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/ClassDefinition.php', + 'League\\Container\\Definition\\ClassDefinitionInterface' => __DIR__ . '/..' . '/league/container/src/Definition/ClassDefinitionInterface.php', + 'League\\Container\\Definition\\DefinitionFactory' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionFactory.php', + 'League\\Container\\Definition\\DefinitionFactoryInterface' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionFactoryInterface.php', + 'League\\Container\\Definition\\DefinitionInterface' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionInterface.php', + 'League\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/league/container/src/Exception/NotFoundException.php', + 'League\\Container\\ImmutableContainerAwareInterface' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerAwareInterface.php', + 'League\\Container\\ImmutableContainerAwareTrait' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerAwareTrait.php', + 'League\\Container\\ImmutableContainerInterface' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerInterface.php', + 'League\\Container\\Inflector\\Inflector' => __DIR__ . '/..' . '/league/container/src/Inflector/Inflector.php', + 'League\\Container\\Inflector\\InflectorAggregate' => __DIR__ . '/..' . '/league/container/src/Inflector/InflectorAggregate.php', + 'League\\Container\\Inflector\\InflectorAggregateInterface' => __DIR__ . '/..' . '/league/container/src/Inflector/InflectorAggregateInterface.php', + 'League\\Container\\ReflectionContainer' => __DIR__ . '/..' . '/league/container/src/ReflectionContainer.php', + 'League\\Container\\ServiceProvider\\AbstractServiceProvider' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/AbstractServiceProvider.php', + 'League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php', + 'League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/BootableServiceProviderInterface.php', + 'League\\Container\\ServiceProvider\\ServiceProviderAggregate' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderAggregate.php', + 'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php', + 'League\\Container\\ServiceProvider\\ServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderInterface.php', + 'League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php', 'Masterminds\\HTML5' => __DIR__ . '/..' . '/masterminds/html5/src/HTML5.php', 'Masterminds\\HTML5\\Elements' => __DIR__ . '/..' . '/masterminds/html5/src/HTML5/Elements.php', 'Masterminds\\HTML5\\Entities' => __DIR__ . '/..' . '/masterminds/html5/src/HTML5/Entities.php', @@ -3770,6 +4143,177 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'RobRichards\\XMLSecLibs\\XMLSecEnc' => __DIR__ . '/..' . '/robrichards/xmlseclibs/src/XMLSecEnc.php', 'RobRichards\\XMLSecLibs\\XMLSecurityDSig' => __DIR__ . '/..' . '/robrichards/xmlseclibs/src/XMLSecurityDSig.php', 'RobRichards\\XMLSecLibs\\XMLSecurityKey' => __DIR__ . '/..' . '/robrichards/xmlseclibs/src/XMLSecurityKey.php', + 'Robo\\Application' => __DIR__ . '/..' . '/consolidation/robo/src/Application.php', + 'Robo\\ClassDiscovery\\AbstractClassDiscovery' => __DIR__ . '/..' . '/consolidation/robo/src/ClassDiscovery/AbstractClassDiscovery.php', + 'Robo\\ClassDiscovery\\ClassDiscoveryInterface' => __DIR__ . '/..' . '/consolidation/robo/src/ClassDiscovery/ClassDiscoveryInterface.php', + 'Robo\\ClassDiscovery\\RelativeNamespaceDiscovery' => __DIR__ . '/..' . '/consolidation/robo/src/ClassDiscovery/RelativeNamespaceDiscovery.php', + 'Robo\\Collection\\CallableTask' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/CallableTask.php', + 'Robo\\Collection\\Collection' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/Collection.php', + 'Robo\\Collection\\CollectionBuilder' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/CollectionBuilder.php', + 'Robo\\Collection\\CollectionInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/CollectionInterface.php', + 'Robo\\Collection\\CollectionProcessHook' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/CollectionProcessHook.php', + 'Robo\\Collection\\CompletionWrapper' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/CompletionWrapper.php', + 'Robo\\Collection\\Element' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/Element.php', + 'Robo\\Collection\\NestedCollectionInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/NestedCollectionInterface.php', + 'Robo\\Collection\\TaskForEach' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/TaskForEach.php', + 'Robo\\Collection\\Temporary' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/Temporary.php', + 'Robo\\Collection\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Collection/loadTasks.php', + 'Robo\\Common\\BuilderAwareTrait' => __DIR__ . '/..' . '/consolidation/robo/src/Common/BuilderAwareTrait.php', + 'Robo\\Common\\CommandArguments' => __DIR__ . '/..' . '/consolidation/robo/src/Common/CommandArguments.php', + 'Robo\\Common\\CommandReceiver' => __DIR__ . '/..' . '/consolidation/robo/src/Common/CommandReceiver.php', + 'Robo\\Common\\ConfigAwareTrait' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ConfigAwareTrait.php', + 'Robo\\Common\\DynamicParams' => __DIR__ . '/..' . '/consolidation/robo/src/Common/DynamicParams.php', + 'Robo\\Common\\ExecCommand' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ExecCommand.php', + 'Robo\\Common\\ExecOneCommand' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ExecOneCommand.php', + 'Robo\\Common\\ExecTrait' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ExecTrait.php', + 'Robo\\Common\\IO' => __DIR__ . '/..' . '/consolidation/robo/src/Common/IO.php', + 'Robo\\Common\\InflectionTrait' => __DIR__ . '/..' . '/consolidation/robo/src/Common/InflectionTrait.php', + 'Robo\\Common\\InputAwareTrait' => __DIR__ . '/..' . '/consolidation/robo/src/Common/InputAwareTrait.php', + 'Robo\\Common\\OutputAdapter' => __DIR__ . '/..' . '/consolidation/robo/src/Common/OutputAdapter.php', + 'Robo\\Common\\OutputAwareTrait' => __DIR__ . '/..' . '/consolidation/robo/src/Common/OutputAwareTrait.php', + 'Robo\\Common\\ProcessExecutor' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ProcessExecutor.php', + 'Robo\\Common\\ProcessUtils' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ProcessUtils.php', + 'Robo\\Common\\ProgressIndicator' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ProgressIndicator.php', + 'Robo\\Common\\ProgressIndicatorAwareTrait' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ProgressIndicatorAwareTrait.php', + 'Robo\\Common\\ResourceExistenceChecker' => __DIR__ . '/..' . '/consolidation/robo/src/Common/ResourceExistenceChecker.php', + 'Robo\\Common\\TaskIO' => __DIR__ . '/..' . '/consolidation/robo/src/Common/TaskIO.php', + 'Robo\\Common\\TimeKeeper' => __DIR__ . '/..' . '/consolidation/robo/src/Common/TimeKeeper.php', + 'Robo\\Common\\Timer' => __DIR__ . '/..' . '/consolidation/robo/src/Common/Timer.php', + 'Robo\\Common\\VerbosityThresholdTrait' => __DIR__ . '/..' . '/consolidation/robo/src/Common/VerbosityThresholdTrait.php', + 'Robo\\Config' => __DIR__ . '/..' . '/consolidation/robo/src/Config.php', + 'Robo\\Config\\Config' => __DIR__ . '/..' . '/consolidation/robo/src/Config/Config.php', + 'Robo\\Config\\GlobalOptionDefaultValuesInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Config/GlobalOptionDefaultValuesInterface.php', + 'Robo\\Contract\\BuilderAwareInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/BuilderAwareInterface.php', + 'Robo\\Contract\\CommandInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/CommandInterface.php', + 'Robo\\Contract\\CompletionInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/CompletionInterface.php', + 'Robo\\Contract\\ConfigAwareInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/ConfigAwareInterface.php', + 'Robo\\Contract\\IOAwareInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/IOAwareInterface.php', + 'Robo\\Contract\\InflectionInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/InflectionInterface.php', + 'Robo\\Contract\\OutputAdapterInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/OutputAdapterInterface.php', + 'Robo\\Contract\\OutputAwareInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/OutputAwareInterface.php', + 'Robo\\Contract\\PrintedInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/PrintedInterface.php', + 'Robo\\Contract\\ProgressIndicatorAwareInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/ProgressIndicatorAwareInterface.php', + 'Robo\\Contract\\ProgressInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/ProgressInterface.php', + 'Robo\\Contract\\RollbackInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/RollbackInterface.php', + 'Robo\\Contract\\SimulatedInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/SimulatedInterface.php', + 'Robo\\Contract\\TaskInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/TaskInterface.php', + 'Robo\\Contract\\VerbosityThresholdInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/VerbosityThresholdInterface.php', + 'Robo\\Contract\\WrappedTaskInterface' => __DIR__ . '/..' . '/consolidation/robo/src/Contract/WrappedTaskInterface.php', + 'Robo\\Exception\\AbortTasksException' => __DIR__ . '/..' . '/consolidation/robo/src/Exception/AbortTasksException.php', + 'Robo\\Exception\\TaskException' => __DIR__ . '/..' . '/consolidation/robo/src/Exception/TaskException.php', + 'Robo\\Exception\\TaskExitException' => __DIR__ . '/..' . '/consolidation/robo/src/Exception/TaskExitException.php', + 'Robo\\GlobalOptionsEventListener' => __DIR__ . '/..' . '/consolidation/robo/src/GlobalOptionsEventListener.php', + 'Robo\\LoadAllTasks' => __DIR__ . '/..' . '/consolidation/robo/src/LoadAllTasks.php', + 'Robo\\Log\\ResultPrinter' => __DIR__ . '/..' . '/consolidation/robo/src/Log/ResultPrinter.php', + 'Robo\\Log\\RoboLogLevel' => __DIR__ . '/..' . '/consolidation/robo/src/Log/RoboLogLevel.php', + 'Robo\\Log\\RoboLogStyle' => __DIR__ . '/..' . '/consolidation/robo/src/Log/RoboLogStyle.php', + 'Robo\\Log\\RoboLogger' => __DIR__ . '/..' . '/consolidation/robo/src/Log/RoboLogger.php', + 'Robo\\Result' => __DIR__ . '/..' . '/consolidation/robo/src/Result.php', + 'Robo\\ResultData' => __DIR__ . '/..' . '/consolidation/robo/src/ResultData.php', + 'Robo\\Robo' => __DIR__ . '/..' . '/consolidation/robo/src/Robo.php', + 'Robo\\Runner' => __DIR__ . '/..' . '/consolidation/robo/src/Runner.php', + 'Robo\\State\\Consumer' => __DIR__ . '/..' . '/consolidation/robo/src/State/Consumer.php', + 'Robo\\State\\Data' => __DIR__ . '/..' . '/consolidation/robo/src/State/Data.php', + 'Robo\\State\\StateAwareInterface' => __DIR__ . '/..' . '/consolidation/robo/src/State/StateAwareInterface.php', + 'Robo\\State\\StateAwareTrait' => __DIR__ . '/..' . '/consolidation/robo/src/State/StateAwareTrait.php', + 'Robo\\TaskAccessor' => __DIR__ . '/..' . '/consolidation/robo/src/TaskAccessor.php', + 'Robo\\TaskInfo' => __DIR__ . '/..' . '/consolidation/robo/src/TaskInfo.php', + 'Robo\\Task\\ApiGen\\ApiGen' => __DIR__ . '/..' . '/consolidation/robo/src/Task/ApiGen/ApiGen.php', + 'Robo\\Task\\ApiGen\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/ApiGen/loadTasks.php', + 'Robo\\Task\\Archive\\Extract' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Archive/Extract.php', + 'Robo\\Task\\Archive\\Pack' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Archive/Pack.php', + 'Robo\\Task\\Archive\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Archive/loadTasks.php', + 'Robo\\Task\\Assets\\CssPreprocessor' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Assets/CssPreprocessor.php', + 'Robo\\Task\\Assets\\ImageMinify' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Assets/ImageMinify.php', + 'Robo\\Task\\Assets\\Less' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Assets/Less.php', + 'Robo\\Task\\Assets\\Minify' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Assets/Minify.php', + 'Robo\\Task\\Assets\\Scss' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Assets/Scss.php', + 'Robo\\Task\\Assets\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Assets/loadTasks.php', + 'Robo\\Task\\BaseTask' => __DIR__ . '/..' . '/consolidation/robo/src/Task/BaseTask.php', + 'Robo\\Task\\Base\\Exec' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Base/Exec.php', + 'Robo\\Task\\Base\\ExecStack' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Base/ExecStack.php', + 'Robo\\Task\\Base\\ParallelExec' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Base/ParallelExec.php', + 'Robo\\Task\\Base\\SymfonyCommand' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Base/SymfonyCommand.php', + 'Robo\\Task\\Base\\Watch' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Base/Watch.php', + 'Robo\\Task\\Base\\loadShortcuts' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Base/loadShortcuts.php', + 'Robo\\Task\\Base\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Base/loadTasks.php', + 'Robo\\Task\\Bower\\Base' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Bower/Base.php', + 'Robo\\Task\\Bower\\Install' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Bower/Install.php', + 'Robo\\Task\\Bower\\Update' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Bower/Update.php', + 'Robo\\Task\\Bower\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Bower/loadTasks.php', + 'Robo\\Task\\CommandStack' => __DIR__ . '/..' . '/consolidation/robo/src/Task/CommandStack.php', + 'Robo\\Task\\Composer\\Base' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/Base.php', + 'Robo\\Task\\Composer\\Config' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/Config.php', + 'Robo\\Task\\Composer\\CreateProject' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/CreateProject.php', + 'Robo\\Task\\Composer\\DumpAutoload' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/DumpAutoload.php', + 'Robo\\Task\\Composer\\Init' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/Init.php', + 'Robo\\Task\\Composer\\Install' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/Install.php', + 'Robo\\Task\\Composer\\Remove' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/Remove.php', + 'Robo\\Task\\Composer\\RequireDependency' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/RequireDependency.php', + 'Robo\\Task\\Composer\\Update' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/Update.php', + 'Robo\\Task\\Composer\\Validate' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/Validate.php', + 'Robo\\Task\\Composer\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Composer/loadTasks.php', + 'Robo\\Task\\Development\\Changelog' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/Changelog.php', + 'Robo\\Task\\Development\\GenerateMarkdownDoc' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/GenerateMarkdownDoc.php', + 'Robo\\Task\\Development\\GenerateTask' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/GenerateTask.php', + 'Robo\\Task\\Development\\GitHub' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/GitHub.php', + 'Robo\\Task\\Development\\GitHubRelease' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/GitHubRelease.php', + 'Robo\\Task\\Development\\OpenBrowser' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/OpenBrowser.php', + 'Robo\\Task\\Development\\PackPhar' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/PackPhar.php', + 'Robo\\Task\\Development\\PhpServer' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/PhpServer.php', + 'Robo\\Task\\Development\\SemVer' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/SemVer.php', + 'Robo\\Task\\Development\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Development/loadTasks.php', + 'Robo\\Task\\Docker\\Base' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Base.php', + 'Robo\\Task\\Docker\\Build' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Build.php', + 'Robo\\Task\\Docker\\Commit' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Commit.php', + 'Robo\\Task\\Docker\\Exec' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Exec.php', + 'Robo\\Task\\Docker\\Pull' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Pull.php', + 'Robo\\Task\\Docker\\Remove' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Remove.php', + 'Robo\\Task\\Docker\\Result' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Result.php', + 'Robo\\Task\\Docker\\Run' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Run.php', + 'Robo\\Task\\Docker\\Start' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Start.php', + 'Robo\\Task\\Docker\\Stop' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/Stop.php', + 'Robo\\Task\\Docker\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Docker/loadTasks.php', + 'Robo\\Task\\File\\Concat' => __DIR__ . '/..' . '/consolidation/robo/src/Task/File/Concat.php', + 'Robo\\Task\\File\\Replace' => __DIR__ . '/..' . '/consolidation/robo/src/Task/File/Replace.php', + 'Robo\\Task\\File\\TmpFile' => __DIR__ . '/..' . '/consolidation/robo/src/Task/File/TmpFile.php', + 'Robo\\Task\\File\\Write' => __DIR__ . '/..' . '/consolidation/robo/src/Task/File/Write.php', + 'Robo\\Task\\File\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/File/loadTasks.php', + 'Robo\\Task\\Filesystem\\BaseDir' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/BaseDir.php', + 'Robo\\Task\\Filesystem\\CleanDir' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/CleanDir.php', + 'Robo\\Task\\Filesystem\\CopyDir' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/CopyDir.php', + 'Robo\\Task\\Filesystem\\DeleteDir' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/DeleteDir.php', + 'Robo\\Task\\Filesystem\\FilesystemStack' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/FilesystemStack.php', + 'Robo\\Task\\Filesystem\\FlattenDir' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/FlattenDir.php', + 'Robo\\Task\\Filesystem\\MirrorDir' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/MirrorDir.php', + 'Robo\\Task\\Filesystem\\TmpDir' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/TmpDir.php', + 'Robo\\Task\\Filesystem\\WorkDir' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/WorkDir.php', + 'Robo\\Task\\Filesystem\\loadShortcuts' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/loadShortcuts.php', + 'Robo\\Task\\Filesystem\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Filesystem/loadTasks.php', + 'Robo\\Task\\Gulp\\Base' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Gulp/Base.php', + 'Robo\\Task\\Gulp\\Run' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Gulp/Run.php', + 'Robo\\Task\\Gulp\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Gulp/loadTasks.php', + 'Robo\\Task\\Npm\\Base' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Npm/Base.php', + 'Robo\\Task\\Npm\\Install' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Npm/Install.php', + 'Robo\\Task\\Npm\\Update' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Npm/Update.php', + 'Robo\\Task\\Npm\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Npm/loadTasks.php', + 'Robo\\Task\\Remote\\Rsync' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Remote/Rsync.php', + 'Robo\\Task\\Remote\\Ssh' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Remote/Ssh.php', + 'Robo\\Task\\Remote\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Remote/loadTasks.php', + 'Robo\\Task\\Simulator' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Simulator.php', + 'Robo\\Task\\StackBasedTask' => __DIR__ . '/..' . '/consolidation/robo/src/Task/StackBasedTask.php', + 'Robo\\Task\\Testing\\Atoum' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Testing/Atoum.php', + 'Robo\\Task\\Testing\\Behat' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Testing/Behat.php', + 'Robo\\Task\\Testing\\Codecept' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Testing/Codecept.php', + 'Robo\\Task\\Testing\\PHPUnit' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Testing/PHPUnit.php', + 'Robo\\Task\\Testing\\Phpspec' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Testing/Phpspec.php', + 'Robo\\Task\\Testing\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Testing/loadTasks.php', + 'Robo\\Task\\Vcs\\GitStack' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Vcs/GitStack.php', + 'Robo\\Task\\Vcs\\HgStack' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Vcs/HgStack.php', + 'Robo\\Task\\Vcs\\SvnStack' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Vcs/SvnStack.php', + 'Robo\\Task\\Vcs\\loadShortcuts' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Vcs/loadShortcuts.php', + 'Robo\\Task\\Vcs\\loadTasks' => __DIR__ . '/..' . '/consolidation/robo/src/Task/Vcs/loadTasks.php', + 'Robo\\Tasks' => __DIR__ . '/..' . '/consolidation/robo/src/Tasks.php', 'SAML2\\ArtifactResolve' => __DIR__ . '/..' . '/simplesamlphp/saml2/src/SAML2/ArtifactResolve.php', 'SAML2\\ArtifactResponse' => __DIR__ . '/..' . '/simplesamlphp/saml2/src/SAML2/ArtifactResponse.php', 'SAML2\\Assertion' => __DIR__ . '/..' . '/simplesamlphp/saml2/src/SAML2/Assertion.php', @@ -3925,6 +4469,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'SAML2\\XML\\saml\\SubjectConfirmationData' => __DIR__ . '/..' . '/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmationData.php', 'SAML2\\XML\\samlp\\Extensions' => __DIR__ . '/..' . '/simplesamlphp/saml2/src/SAML2/XML/samlp/Extensions.php', 'SAML2\\XML\\shibmd\\Scope' => __DIR__ . '/..' . '/simplesamlphp/saml2/src/SAML2/XML/shibmd/Scope.php', + 'SelfUpdate\\SelfUpdateCommand' => __DIR__ . '/..' . '/consolidation/self-update/src/SelfUpdateCommand.php', 'SessionUpdateTimestampHandlerInterface' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php', 'SimpleSAML\\Auth\\Simple' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Simple.php', 'SimpleSAML\\Auth\\TimeLimitedToken' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/TimeLimitedToken.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 180ab31b548167ef6db5f7f49b58424151f72a3f..2d6e83ef086ff9b53399becbdc579eca3949e46d 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -169,15 +169,60 @@ ], "description": "Backports unserialize options introduced in PHP 7.0 to older PHP versions." }, + { + "name": "chi-teck/drupal-code-generator", + "version": "1.30.3", + "version_normalized": "1.30.3.0", + "source": { + "type": "git", + "url": "https://github.com/Chi-teck/drupal-code-generator.git", + "reference": "1da9f06843b6bf2b0e7d28fea4b6c1d79aead197" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/1da9f06843b6bf2b0e7d28fea4b6c1d79aead197", + "reference": "1da9f06843b6bf2b0e7d28fea4b6c1d79aead197", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.5.9", + "symfony/console": "^3.4 || ^4.0", + "symfony/filesystem": "^2.7 || ^3.4 || ^4.0", + "twig/twig": "^1.38.2 || ^2.10" + }, + "time": "2019-06-29T10:29:45+00:00", + "bin": [ + "bin/dcg" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/bootstrap.php" + ], + "psr-4": { + "DrupalCodeGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Drupal code generator" + }, { "name": "ckeditor/indentblock", "version": "4.8.0", "version_normalized": "4.8.0.0", "dist": { "type": "zip", - "url": "https://download.ckeditor.com/indentblock/releases/indentblock_4.8.0.zip", - "reference": null, - "shasum": null + "url": "https://download.ckeditor.com/indentblock/releases/indentblock_4.8.0.zip" }, "require": { "composer/installers": "~1.0" @@ -545,26 +590,605 @@ }, "phpunit4": { "require-dev": { - "phpunit/phpunit": "^4.8.36" + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods." + }, + { + "name": "consolidation/config", + "version": "1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "time": "2019-03-03T19:37:04+00:00", + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool." + }, + { + "name": "consolidation/filter-via-dot-access-data", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/filter-via-dot-access-data.git", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/filter-via-dot-access-data/zipball/a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4" + }, + "time": "2019-01-18T06:05:07+00:00", + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Consolidation\\Filter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo." + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "time": "2019-01-01T17:30:51+00:00", + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components." + }, + { + "name": "consolidation/output-formatters", + "version": "3.5.0", + "version_normalized": "3.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "99ec998ffb697e0eada5aacf81feebfb13023605" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/99ec998ffb697e0eada5aacf81feebfb13023605", + "reference": "99ec998ffb697e0eada5aacf81feebfb13023605", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5.7.27", + "squizlabs/php_codesniffer": "^2.7", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "time": "2019-05-30T23:16:01+00:00", + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony3": { + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "config": { + "platform": { + "php": "5.6.32" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters." + }, + { + "name": "consolidation/robo", + "version": "1.4.9", + "version_normalized": "1.4.9.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.10.2", + "consolidation/config": "^1.2", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.4", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "time": "2019-03-19T18:07:19+00:00", + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "version_normalized": "1.1.5.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "time": "2018-10-28T01:52:03+00:00", + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications." + }, + { + "name": "consolidation/site-alias", + "version": "3.0.0", + "version_normalized": "3.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-alias.git", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-alias/zipball/8cfd3b6ab6d541086fc970bf850864293b284e6f", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4", + "symfony/yaml": "~2.3|^3" + }, + "time": "2019-03-12T17:31:48+00:00", + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" }, "remove": [ "php-coveralls/php-coveralls" ], "config": { "platform": { - "php": "5.4.8" + "php": "5.6.33" } } } }, "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Consolidation\\AnnotatedCommand\\": "src" + "Consolidation\\SiteAlias\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -572,102 +1196,73 @@ "MIT" ], "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" } ], - "description": "Initialize Symfony Console commands from annotated command class methods." + "description": "Manage alias records for local and remote sites." }, { - "name": "consolidation/output-formatters", - "version": "3.5.0", - "version_normalized": "3.5.0.0", + "name": "consolidation/site-process", + "version": "2.0.3", + "version_normalized": "2.0.3.0", "source": { "type": "git", - "url": "https://github.com/consolidation/output-formatters.git", - "reference": "99ec998ffb697e0eada5aacf81feebfb13023605" + "url": "https://github.com/consolidation/site-process.git", + "reference": "e25265f4a48c13284ebb6f9e0906ecd415d451df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/99ec998ffb697e0eada5aacf81feebfb13023605", - "reference": "99ec998ffb697e0eada5aacf81feebfb13023605", + "url": "https://api.github.com/repos/consolidation/site-process/zipball/e25265f4a48c13284ebb6f9e0906ecd415d451df", + "reference": "e25265f4a48c13284ebb6f9e0906ecd415d451df", "shasum": "" }, "require": { - "dflydev/dot-access-data": "^1.1.0", - "php": ">=5.4.0", - "symfony/console": "^2.8|^3|^4", - "symfony/finder": "^2.5|^3|^4" + "consolidation/config": "^1.2.1", + "consolidation/site-alias": "^3", + "php": ">=5.6.0", + "symfony/process": "^3.4" }, "require-dev": { + "consolidation/robo": "^1.3", "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", "php-coveralls/php-coveralls": "^1", - "phpunit/phpunit": "^5.7.27", - "squizlabs/php_codesniffer": "^2.7", - "symfony/var-dumper": "^2.8|^3|^4", - "victorjonsson/markdowndocs": "^1.3" - }, - "suggest": { - "symfony/var-dumper": "For using the var_dump formatter" + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8" }, - "time": "2019-05-30T23:16:01+00:00", + "time": "2019-06-04T22:23:52+00:00", "type": "library", "extra": { "scenarios": { - "symfony4": { - "require": { - "symfony/console": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^6" - }, - "config": { - "platform": { - "php": "7.1.3" - } - } - }, - "symfony3": { - "require": { - "symfony/console": "^3.4", - "symfony/finder": "^3.4", - "symfony/var-dumper": "^3.4" - }, - "config": { - "platform": { - "php": "5.6.32" - } - } - }, - "symfony2": { - "require": { - "symfony/console": "^2.8" - }, + "phpunit5": { "require-dev": { - "phpunit/phpunit": "^4.8.36" + "phpunit/phpunit": "^5.7.27" }, "remove": [ "php-coveralls/php-coveralls" ], "config": { "platform": { - "php": "5.4.8" + "php": "5.6.33" } - }, - "scenario-options": { - "create-lockfile": "false" } } }, "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "0.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Consolidation\\OutputFormatters\\": "src" + "Consolidation\\SiteProcess\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -675,12 +1270,49 @@ "MIT" ], "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" } ], - "description": "Format text by applying transformations provided by plug-in formatters." + "description": "A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call." + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "time": "2017-02-14T19:40:03+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop" }, { "name": "cweagans/composer-patches", @@ -746,9 +1378,7 @@ "version_normalized": "4.2.0.0", "dist": { "type": "zip", - "url": "https://github.com/desandro/masonry/archive/v4.2.0.zip", - "reference": null, - "shasum": null + "url": "https://github.com/desandro/masonry/archive/v4.2.0.zip" }, "type": "drupal-library", "installation-source": "dist" @@ -7886,68 +8516,112 @@ }, { "name": "drush/drush", - "version": "8.2.3", - "version_normalized": "8.2.3.0", + "version": "9.7.1", + "version_normalized": "9.7.1.0", "source": { "type": "git", "url": "https://github.com/drush-ops/drush.git", - "reference": "bf2b2471b9410e0ff4adc23aee020ee1aff28610" + "reference": "6f9a8d235daec06fd6f47b2d84da675750566479" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drush-ops/drush/zipball/bf2b2471b9410e0ff4adc23aee020ee1aff28610", - "reference": "bf2b2471b9410e0ff4adc23aee020ee1aff28610", + "url": "https://api.github.com/repos/drush-ops/drush/zipball/6f9a8d235daec06fd6f47b2d84da675750566479", + "reference": "6f9a8d235daec06fd6f47b2d84da675750566479", "shasum": "" }, "require": { - "consolidation/annotated-command": "^2.12.0", - "consolidation/output-formatters": "~3", - "pear/console_table": "~1.3.1", - "php": ">=5.4.5", + "chi-teck/drupal-code-generator": "^1.28.1", + "composer/semver": "^1.4", + "consolidation/annotated-command": "^2.12", + "consolidation/config": "^1.2", + "consolidation/filter-via-dot-access-data": "^1", + "consolidation/output-formatters": "^3.3.1", + "consolidation/robo": "^1.4.6", + "consolidation/site-alias": "^3.0.0@stable", + "consolidation/site-process": "^2.0.3", + "ext-dom": "*", + "grasmash/yaml-expander": "^1.1.1", + "league/container": "~2", + "php": ">=5.6.0", "psr/log": "~1.0", "psy/psysh": "~0.6", - "symfony/console": "~2.7|^3", - "symfony/event-dispatcher": "~2.7|^3", - "symfony/finder": "~2.7|^3", - "symfony/var-dumper": "~2.7|^3", - "symfony/yaml": "~2.3|^3", - "webflo/drupal-finder": "^1.1.0", - "webmozart/path-util": "~2" + "symfony/console": "^3.4", + "symfony/event-dispatcher": "^3.4", + "symfony/finder": "^3.4 || ^4.0", + "symfony/process": "^3.4", + "symfony/var-dumper": "^3.4 || ^4.0", + "symfony/yaml": "^3.4", + "webflo/drupal-finder": "^1.1", + "webmozart/path-util": "^2.1.0" }, "require-dev": { - "phpunit/phpunit": "4.*", - "symfony/console": "~2.7", - "symfony/event-dispatcher": "~2.7", - "symfony/finder": "~2.7", - "symfony/process": "2.7.*", - "symfony/var-dumper": "~2.7", - "symfony/yaml": "~2.3" - }, - "suggest": { - "drush/config-extra": "Provides configuration workflow commands, such as config-merge.", - "ext-pcntl": "*" - }, - "time": "2019-04-03T04:20:26+00:00", + "composer/installers": "^1.2", + "cweagans/composer-patches": "~1.0", + "drupal/alinks": "1.0.0", + "drupal/devel": "^2", + "drupal/empty_theme": "1.0", + "g1a/composer-test-scenarios": "^3", + "lox/xhprof": "dev-master", + "phpunit/phpunit": "^4.8.36 || ^6.1", + "squizlabs/php_codesniffer": "^2.7 || ^3", + "vlucas/phpdotenv": "^2.4", + "webflo/drupal-core-require-dev": "8.7.x-dev", + "webflo/drupal-core-strict": "8.7.x-dev" + }, + "time": "2019-06-30T19:46:39+00:00", "bin": [ - "drush", - "drush.launcher", - "drush.php", - "drush.complete.sh" + "drush" ], "type": "library", "extra": { + "installer-paths": { + "sut/core": [ + "type:drupal-core" + ], + "sut/libraries/{$name}": [ + "type:drupal-library" + ], + "sut/modules/unish/{$name}": [ + "drupal/devel" + ], + "sut/themes/unish/{$name}": [ + "drupal/empty_theme" + ], + "sut/modules/contrib/{$name}": [ + "type:drupal-module" + ], + "sut/profiles/contrib/{$name}": [ + "type:drupal-profile" + ], + "sut/themes/contrib/{$name}": [ + "type:drupal-theme" + ], + "sut/drush/contrib/{$name}": [ + "type:drupal-drush" + ] + }, + "scenarios": { + "php5": { + "config": { + "platform": { + "php": "5.6.38" + } + }, + "require-dev": { + "webflo/drupal-core-strict": "8.6.x-dev", + "webflo/drupal-core-require-dev": "8.6.x-dev" + } + } + }, "branch-alias": { - "dev-master": "8.0.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-0": { - "Drush": "lib/", - "Consolidation": "lib/" - }, "psr-4": { - "Drush\\": "src/" + "Drush\\": "src/", + "Drush\\Internal\\": "src/internal-forks" } }, "notification-url": "https://packagist.org/downloads/", @@ -7963,14 +8637,6 @@ "name": "Owen Barton", "email": "drupal@owenbarton.com" }, - { - "name": "Mark Sonnabaum", - "email": "marksonnabaum@gmail.com" - }, - { - "name": "Antoine Beaupré", - "email": "anarcat@koumbit.org" - }, { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" @@ -8292,6 +8958,105 @@ "unicode" ] }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "time": "2017-12-21T22:14:55+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file." + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "version_normalized": "1.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "time": "2017-12-16T16:06:03+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file." + }, { "name": "guzzlehttp/guzzle", "version": "6.3.3", @@ -8671,6 +9436,73 @@ ], "description": "Highlight PHP code in terminal" }, + { + "name": "league/container", + "version": "2.4.1", + "version_normalized": "2.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "time": "2017-05-10T09:20:27+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ] + }, { "name": "masterminds/html5", "version": "2.6.0", diff --git a/vendor/consolidation/config/.editorconfig b/vendor/consolidation/config/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..095771e673c86f27e8c8224b6de6437fbe793e4f --- /dev/null +++ b/vendor/consolidation/config/.editorconfig @@ -0,0 +1,15 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[**.php] +indent_style = space +indent_size = 4 + diff --git a/vendor/consolidation/config/.scenarios.lock/install b/vendor/consolidation/config/.scenarios.lock/install new file mode 100755 index 0000000000000000000000000000000000000000..16c69e107cce7f71e33e04207254d005200f9fd4 --- /dev/null +++ b/vendor/consolidation/config/.scenarios.lock/install @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff --git a/vendor/consolidation/config/.scenarios.lock/symfony2/.gitignore b/vendor/consolidation/config/.scenarios.lock/symfony2/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/config/.scenarios.lock/symfony2/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/config/.scenarios.lock/symfony2/composer.json b/vendor/consolidation/config/.scenarios.lock/symfony2/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..c4b2864f33fa5e28d99b5e804eaae4e702365d8a --- /dev/null +++ b/vendor/consolidation/config/.scenarios.lock/symfony2/composer.json @@ -0,0 +1,64 @@ +{ + "name": "consolidation/config", + "description": "Provide configuration services for a commandline tool.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "../../tests/src" + } + }, + "require": { + "php": ">=5.4.0", + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1" + }, + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36", + "g1a/composer-test-scenarios": "^3", + "symfony/yaml": "^2.8.11|^3|^4", + "squizlabs/php_codesniffer": "2.*" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "config": { + "platform": { + "php": "5.4.8" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "scripts": { + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "SHELL_INTERACTIVE=true phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/consolidation/config/.scenarios.lock/symfony2/composer.lock b/vendor/consolidation/config/.scenarios.lock/symfony2/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..0c54f6c9f5852a815f1090a1c20a001d23ba2974 --- /dev/null +++ b/vendor/consolidation/config/.scenarios.lock/symfony2/composer.lock @@ -0,0 +1,1566 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "c610fc6b429c5dda49f734449f5b3ab3", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + } + ], + "packages-dev": [ + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-22T05:10:20+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "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": "2016-01-25T08:17:30+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "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-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "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.2.2", + "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": "2017-06-21T08:07:12+00:00" + }, + { + "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-02T06:51:40+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "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": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "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": "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": "2016-06-17T09:04:28+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "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": "2016-10-03T07:41:43+00:00" + }, + { + "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-21T13:59:46+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "48ed63767c4add573fb3e9e127d3426db27f78e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/48ed63767c4add573fb3e9e127d3426db27f78e8", + "reference": "48ed63767c4add573fb3e9e127d3426db27f78e8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T14:26:34+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "6a198c52b662fa825382f5e65c0c4a56bdaca98e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/6a198c52b662fa825382f5e65c0c4a56bdaca98e", + "reference": "6a198c52b662fa825382f5e65c0c4a56bdaca98e", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:24:01+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/76494bc38ff38d90d01913d23b5271acd4d78dd3", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-20T23:16:31+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "0e16589861f192dbffb19b06683ce3ef58f7f99d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0e16589861f192dbffb19b06683ce3ef58f7f99d", + "reference": "0e16589861f192dbffb19b06683ce3ef58f7f99d", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:27:16+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.4.8" + } +} diff --git a/vendor/consolidation/config/.scenarios.lock/symfony4/.gitignore b/vendor/consolidation/config/.scenarios.lock/symfony4/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/config/.scenarios.lock/symfony4/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/config/.scenarios.lock/symfony4/composer.json b/vendor/consolidation/config/.scenarios.lock/symfony4/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..769a3acffcafa3f5e47641f688122ae941e31060 --- /dev/null +++ b/vendor/consolidation/config/.scenarios.lock/symfony4/composer.json @@ -0,0 +1,64 @@ +{ + "name": "consolidation/config", + "description": "Provide configuration services for a commandline tool.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "../../tests/src" + } + }, + "require": { + "php": ">=5.4.0", + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1" + }, + "require-dev": { + "symfony/console": "^4.0", + "phpunit/phpunit": "^5", + "g1a/composer-test-scenarios": "^3", + "symfony/yaml": "^2.8.11|^3|^4", + "php-coveralls/php-coveralls": "^1", + "squizlabs/php_codesniffer": "2.*" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "config": { + "platform": { + "php": "7.1.3" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "scripts": { + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "SHELL_INTERACTIVE=true phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/consolidation/config/.scenarios.lock/symfony4/composer.lock b/vendor/consolidation/config/.scenarios.lock/symfony4/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..ae47af296eeef3d496d32c0e11664b450ebcafa1 --- /dev/null +++ b/vendor/consolidation/config/.scenarios.lock/symfony4/composer.lock @@ -0,0 +1,2200 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "3b90d6f10626d08a41ef4e9fd4ad6e38", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.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": "2017-07-22T11:58:36+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-22T05:10:20+00:00" + }, + { + "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" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "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" + ], + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:09:42+00:00" + }, + { + "name": "symfony/console", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:30:44+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/76494bc38ff38d90d01913d23b5271acd4d78dd3", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-20T23:16:31+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T13:18:25+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "5bfc064125b73ff81229e19381ce1c34d3416f4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5bfc064125b73ff81229e19381ce1c34d3416f4b", + "reference": "5bfc064125b73ff81229e19381ce1c34d3416f4b", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:40:59+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:36:10+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.1.3" + } +} diff --git a/vendor/consolidation/config/CHANGELOG.md b/vendor/consolidation/config/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..508118d92f2268f79f0d8b6bb916ad5da3d464f6 --- /dev/null +++ b/vendor/consolidation/config/CHANGELOG.md @@ -0,0 +1,68 @@ +# Changelog + +### 1.2.1 2019-03-03 + +* Add ConfigRuntimeInterface, and implement it in ConfigOverlay (#27) +* Add ConfigOverlay::exportAll() + +### 1.2.0 2019-02-15 + +* Add ConfigAwareInterface / ConfigAwareTrait + +### 1.1.1 2018-10-24 + +* Add interpolation to Config objects (#23) + +### 1.1.0 2018-08-07 + +* Selective distinct/combine merge strategy. (#22) + +### 1.0.11 2018-05-26 + +* BUGFIX: Ensure that duplicate keys added to different contexts in a config overlay only appear once in the final export. (#21) + +### 1.0.10 2018-05-25 + +* Rename g-1-a/composer-test-scenarios to g1a/composer-test-scenarios (#20) + +### 1.0.9 2017-12-22 + +* Make yaml component optional. (#17) + +### 1.0.8 2017-12-16 + +* Use test scenarios to test multiple versions of Symfony. (#14) & (#15) +* Fix defaults to work with DotAccessData by thomscode (#13) + +### 1.0.7 2017-10-24 + +* Deprecate Config::import(); recommand Config::replace() instead. + +### 1.0.6 10/17/2017 + +* Add a 'Config::combine()' method for importing without overwriting. +* Factor out ArrayUtil as a reusable utility class. + +### 1.0.4 10/16/2017 + +* BUGFIX: Go back to injecting boolean options only if their value is 'true'. + +### 1.0.3 10/04/2017 + +* Add an EnvConfig utility class. +* BUGFIX: Fix bug in envKey calculation: it was missing its prefix. +* BUGFIX: Export must always return something. +* BUGFIX: Pass reference array through to Expander class. + +### 1.0.2 09/16/2017 + +* BUGFIX: Allow global boolean options to have either `true` or `false` initial values. + +### 1.0.1 07/28/2017 + +* Inject default values into InputOption objects when 'help' command executed. + +### 1.0.0 06/28/2017 + +* Initial release + diff --git a/vendor/consolidation/config/CONTRIBUTING.md b/vendor/consolidation/config/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..006062d505965d536b2823fc3441c75420d7c2c3 --- /dev/null +++ b/vendor/consolidation/config/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing to Consolidation + +Thank you for your interest in contributing to the Consolidation effort! Consolidation aims to provide reusable, loosely-coupled components useful for building command-line tools. Consolidation is built on top of Symfony Console, but aims to separate the tool from the implementation details of Symfony. + +Here are some of the guidelines you should follow to make the most of your efforts: + +## Code Style Guidelines + +Consolidation adheres to the [PSR-2 Coding Style Guide](http://www.php-fig.org/psr/psr-2/) for PHP code. + +## Pull Request Guidelines + +Every pull request is run through: + + - phpcs -n --standard=PSR2 src + - phpunit + - [Scrutinizer](https://scrutinizer-ci.com/g/consolidation/config/) + +It is easy to run the unit tests and code sniffer locally; just run: + + - composer cs + +To run the code beautifier, which will fix many of the problems reported by phpcs: + + - composer cbf + +These two commands (`composer cs` and `composer cbf`) are defined in the `scripts` section of [composer.json](composer.json). + +After submitting a pull request, please examine the Scrutinizer report. It is not required to fix all Scrutinizer issues; you may ignore recommendations that you disagree with. The spacing patches produced by Scrutinizer do not conform to PSR2 standards, and therefore should never be applied. DocBlock patches may be applied at your discression. Things that Scrutinizer identifies as a bug nearly always need to be addressed. + +Pull requests must pass phpcs and phpunit in order to be merged; ideally, new functionality will also include new unit tests. diff --git a/vendor/consolidation/config/LICENSE b/vendor/consolidation/config/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..530581f6e53097fa9efabe9884e140ee0705ff46 --- /dev/null +++ b/vendor/consolidation/config/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2017-2018 Consolidation Developers + + +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. + +DEPENDENCY LICENSES: + +Name Version License +dflydev/dot-access-data v1.1.0 MIT +grasmash/expander 1.0.0 MIT \ No newline at end of file diff --git a/vendor/consolidation/config/README.md b/vendor/consolidation/config/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7108cd6ec02fb76b813bf2e874a8b073f15faeb7 --- /dev/null +++ b/vendor/consolidation/config/README.md @@ -0,0 +1,224 @@ +# Consolidation\Config + +Manage configuration for a commandline tool. + +[](https://travis-ci.org/consolidation/config) +[](https://scrutinizer-ci.com/g/consolidation/config/?branch=master) +[](https://coveralls.io/github/consolidation/config?branch=master) +[](https://packagist.org/packages/consolidation/config) + +This component is designed to provide the components needed to manage configuration options from different sources, including: + +- Commandline options +- Configuration files +- Alias files (special configuration files that identify a specific target site) +- Default values (provided by command) + +Symfony Console is used to provide the framework for the commandline tool, and the Symfony Configuration component is used to load and merge configuration files. This project provides the glue that binds the components together in an easy-to-use package. + +If your goal is to be able to quickly write configurable commandline tools, you might want to consider using [Robo as a Framework](https://robo.li/framework), as the work for setting up this component is already done in that project. Consolidation/Config may be used with any Symfony Console application, though. + +## Component Status + +In use in Robo (1.x), Terminus (1.x) and Drush (9.x). + +## Motivation + +Provide a simple Config class that can be injected where needed to provide configuration values in non-command classes, and make configuration settings a no-op for command classes by automatically initializing the Input object from configuration as needed. + +## Configuration File Usage + +Configuration files are simple hierarchical yaml files. + +### Providing Command Options + +Command options are defined by creating an entry for each command name under the `command:` section of the configuration file. The options for the command should be defined within an `options:` section. For example, to set a configuration value `red` for the option `--color` in the `example` command: +``` +command: + example: + options: + color: red +``` +If a command name contains a `:`, then each section of the command name defines another level of heirarchy in the command option configuration. For example, to set a configuration value `George` for the option `--name` of the command `my:foo`: +``` +command: + my: + foo: + options: + name: George +``` +Furthermore, every level of the command name heirarchy may contain options. For example, to define a configuration value for the option `--dir` for any command that begins with `my:`: +``` +command: + my: + options: + dir: '/base/path' + foo: + options: + name: George + bar: + options: + priority: high +``` + +### Providing Global Options + +If your Symfony Console application defines global options, like so (from a method in an extension of the Application class): +``` +$this->getDefinition() + ->addOption( + new InputOption('--simulate', null, InputOption::VALUE_NONE, 'Run in simulated mode (show what would have happened).') + ); +``` +Default values for global options can then be declared in the global options section: +``` +options: + simulate: false +``` +If this is done, then global option values set on the command line will be used to alter the value of the configuration item at runtime. For example, `$config->get('options.simulate')` will return `false` when the `--simulate` global option is not used, and will return `true` when it is. + +See the section "Set Up Command Option Configuration Injection", below, for instructions on how to enable this setup. + +### Configuration Value Substitution + +It is possible to define values in a configuration file that will be substituted in wherever used. For example: +``` +common: + path: '/shared/path' +command: + my: + options: + dir: '${common.path}' + foo: + options: + name: George +``` + +[grasmash/yaml-expander](https://github.com/grasmash/expander) is used to provide this capability. + +## API Usage + +The easiest way to utilize the capabilities of this project is to use [Robo as a framework](https://robo.li/framework) to create your commandline tools. Using Robo is optional, though, as this project will work with any Symfony Console application. + +### Load Configuration Files with Provided Loader + +Consolidation/config includes a built-in yaml loader / processor. To use it directly, use a YamlConfigLoader to load each of your configuration files, and a ConfigProcessor to merge them together. Then, export the result from the configuration processor, and import it into a Config object. +``` +use Consolidation\Config\Config; +use Consolidation\Config\YamlConfigLoader; +use Consolidation\Config\ConfigProcessor; + +$config = new Config(); +$loader = new YamlConfigLoader(); +$processor = new ConfigProcessor(); +$processor->extend($loader->load('defaults.yml')); +$processor->extend($loader->load('myconf.yml')); +$config->import($processor->export()); +``` + +### Set Up Command Option Configuration Injection + +The command option configuration feature described above in the section `Providing Command Options` is provided via a configuration injection class. All that you need to do to use this feature as attach this object to your Symfony Console application's event dispatcher: +``` +$application = new Symfony\Component\Console\Application($name, $version); +$configInjector = new \Consolidation\Config\Inject\ConfigForCommand($config); +$configInjector->setApplication($application); + +$eventDispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher(); +$eventDispatcher->addSubscriber($configInjector); +$application->setDispatcher($eventDispatcher); +``` + + +### Get Configuration Values + +If you have a configuration file that looks like this: +``` +a: + b: + c: foo +``` +Then you can fetch the value of the configuration option `c` via: +``` +$value = $config->get('a.b.c'); +``` +[dflydev/dot-access-data](https://github.com/dflydev/dot-access-data) is leveraged to provide this capability. + +### Interpolation + +Interpolation allows configuration values to be injected into a string with tokens. The tokens are used as keys that are looked up in the config object; the resulting configuration values will be used to replace the tokens in the provided string. + +For example, using the same configuration file shown above: +``` +$result = $config->interpolate('The value is: {{a.b.c}}') +``` +In this example, the `$result` string would be: +``` +The value is: foo +``` + +### Configuration Overlays + +Optionally, you may use the ConfigOverlay class to combine multiple configuration objects implamenting ConfigInterface into a single, prioritized configuration object. It is not necessary to use a configuration overlay; if your only goal is to merge configuration from multiple files, you may follow the example above to extend a processor with multiple configuration files, and then import the result into a single configuration object. This will cause newer configuration items to overwrite any existing values stored under the same key. + +A configuration overlay can achieve the same end result without overwriting any config values. The advantage of doing this is that different configuration overlays could be used to create separate "views" on different collections of configuration. A configuration overlay is also useful if you wish to temporarily override some configuration values, and then put things back the way they were by removing the overlay. +``` +use Consolidation\Config\Config; +use Consolidation\Config\YamlConfigLoader; +use Consolidation\Config\ConfigProcessor; +use Consolidation\Config\Util\ConfigOverlay; + +$config1 = new Config(); +$config2 = new Config(); +$loader = new YamlConfigLoader(); +$processor = new ConfigProcessor(); +$processor->extend($loader->load('c1.yml')); +$config1->import($processor->export()); +$processor = new ConfigProcessor(); +$processor->extend($loader->load('c2.yml')); +$config2->import($processor->export()); + +$configOverlay = (new ConfigOverlay()) + ->addContext('one', $config1) + ->addContext('two', $config2); + +$value = $configOverlay->get('key'); + +$configOverlay->removeContext('two'); + +$value = $configOverlay->get('key'); +``` +The first call to `$configOverlay->get('key')`, above, will return the value from `key` in `$config2`, if it exists, or from `$config1` otherwise. The second call to the same function, after `$config2` is removed, will only consider configuration values stored in `$config1`. + +## External Examples + +### Load Configuration Files with Symfony/Config + +The [Symfony Config](http://symfony.com/doc/current/components/config.html) component provides the capability to locate configuration file, load them from either YAML or XML sources, and validate that they match a certain defined schema. Classes to find configuration files are also available. + +If these features are needed, the results from `Symfony\Component\Config\Definition\Processor::processConfiguration()` may be provided directly to the `Consolidation\Config\Config::import()` method. + +### Use Configuration to Call Setter Methods + +[Robo](https://robo.li) provides a facility for configuration files to [define default values for task setter methods](http://robo.li/getting-started/#configuration-for-task-settings). This is done via the `ConfigForSetters::apply()` method. +``` +$taskClass = static::configClassIdentifier($taskClass); +$configurationApplier = new \Consolidation\Config\Inject\ConfigForSetters($this->getConfig(), $taskClass, 'task.'); +$configurationApplier->apply($task, 'settings'); +``` +The `configClassIdentifier` method converts `\`-separated class and namespace names into `.`-separated identifiers; it is provided by ConfigAwareTrait: +``` +protected static function configClassIdentifier($classname) +{ + $configIdentifier = strtr($classname, '\\', '.'); + $configIdentifier = preg_replace('#^(.*\.Task\.|\.)#', '', $configIdentifier); + + return $configIdentifier; +} +``` +A similar pattern may be used in other applications that may wish to inject values into objects using their setter methods. + +## Comparison to Existing Solutions + +Drush has an existing procedural mechanism for loading configuration values from multiple files, and overlaying the results in priority order. Command-specific options from configuration files and site aliases may also be applied. + diff --git a/vendor/consolidation/config/composer.json b/vendor/consolidation/config/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..f9060cc09e8c40c179136a3f8dd2c4ade012bd77 --- /dev/null +++ b/vendor/consolidation/config/composer.json @@ -0,0 +1,90 @@ +{ + "name": "consolidation/config", + "description": "Provide configuration services for a commandline tool.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload":{ + "psr-4":{ + "Consolidation\\Config\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "tests/src" + } + }, + "require": { + "php": ">=5.4.0", + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1" + }, + "require-dev": { + "phpunit/phpunit": "^5", + "g1a/composer-test-scenarios": "^3", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4", + "php-coveralls/php-coveralls": "^1", + "squizlabs/php_codesniffer": "2.*" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "5.6" + } + }, + "scripts": { + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "SHELL_INTERACTIVE=true phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/consolidation/config/composer.lock b/vendor/consolidation/config/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..54bed5098fa07e51f6f18c7b7c73843d57bc7b8a --- /dev/null +++ b/vendor/consolidation/config/composer.lock @@ -0,0 +1,2249 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "eba4b5babe691a0c98541db821af432c", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + } + ], + "packages-dev": [ + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-22T05:10:20+00:00" + }, + { + "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" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-10T14:09:06+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "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" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "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" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/76494bc38ff38d90d01913d23b5271acd4d78dd3", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-20T23:16:31+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.6" + } +} diff --git a/vendor/consolidation/config/phpunit.xml.dist b/vendor/consolidation/config/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..90be6e2e665fb8e52d8136d0fa3a0a77bf6f8903 --- /dev/null +++ b/vendor/consolidation/config/phpunit.xml.dist @@ -0,0 +1,19 @@ +<phpunit bootstrap="vendor/autoload.php" colors="true"> + <testsuites> + <testsuite name="config"> + <directory prefix="" suffix="Test.php">tests</directory> + </testsuite> + </testsuites> + <logging> + <!-- + <log type="coverage-html" target="build/logs/coverage" lowUpperBound="35" + highLowerBound="70"/> + --> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">src</directory> + </whitelist> + </filter> +</phpunit> diff --git a/vendor/consolidation/config/src/Config.php b/vendor/consolidation/config/src/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..3b9827f5799eadd7792c34725a606a5d0d63a50b --- /dev/null +++ b/vendor/consolidation/config/src/Config.php @@ -0,0 +1,160 @@ +<?php + +namespace Consolidation\Config; + +use Dflydev\DotAccessData\Data; +use Consolidation\Config\Util\ConfigInterpolatorInterface; +use Consolidation\Config\Util\ConfigInterpolatorTrait; + +class Config implements ConfigInterface, ConfigInterpolatorInterface +{ + use ConfigInterpolatorTrait; + + /** + * @var Data + */ + protected $config; + + /** + * TODO: make this private in 2.0 to prevent being saved as an array + * Making private now breaks backward compatibility + * + * @var Data + */ + protected $defaults; + + /** + * Create a new configuration object, and initialize it with + * the provided nested array containing configuration data. + * + * @param array $data - Config data to store + */ + public function __construct(array $data = null) + { + $this->config = new Data($data); + $this->setDefaults(new Data()); + } + + /** + * {@inheritdoc} + */ + public function has($key) + { + return ($this->config->has($key)); + } + + /** + * {@inheritdoc} + */ + public function get($key, $defaultFallback = null) + { + if ($this->has($key)) { + return $this->config->get($key); + } + return $this->getDefault($key, $defaultFallback); + } + + /** + * {@inheritdoc} + */ + public function set($key, $value) + { + $this->config->set($key, $value); + return $this; + } + + /** + * {@inheritdoc} + */ + public function import($data) + { + return $this->replace($data); + } + + /** + * {@inheritdoc} + */ + public function replace($data) + { + $this->config = new Data($data); + return $this; + } + + /** + * {@inheritdoc} + */ + public function combine($data) + { + if (!empty($data)) { + $this->config->import($data, true); + } + return $this; + } + + /** + * {@inheritdoc} + */ + public function export() + { + return $this->config->export(); + } + + /** + * {@inheritdoc} + */ + public function hasDefault($key) + { + return $this->getDefaults()->has($key); + } + + /** + * {@inheritdoc} + */ + public function getDefault($key, $defaultFallback = null) + { + return $this->hasDefault($key) ? $this->getDefaults()->get($key) : $defaultFallback; + } + + /** + * {@inheritdoc} + */ + public function setDefault($key, $value) + { + $this->getDefaults()->set($key, $value); + return $this; + } + + /** + * Return the class $defaults property and ensure it's a Data object + * TODO: remove Data object validation in 2.0 + * + * @return Data + */ + protected function getDefaults() + { + // Ensure $this->defaults is a Data object (not an array) + if (!$this->defaults instanceof Data) { + $this->setDefaults($this->defaults); + } + return $this->defaults; + } + + /** + * Sets the $defaults class parameter + * TODO: remove support for array in 2.0 as this would currently break backward compatibility + * + * @param Data|array $defaults + * + * @throws \Exception + */ + protected function setDefaults($defaults) + { + if (is_array($defaults)) { + $this->defaults = new Data($defaults); + } elseif ($defaults instanceof Data) { + $this->defaults = $defaults; + } else { + throw new \Exception("Unknown type provided for \$defaults"); + } + } +} diff --git a/vendor/consolidation/config/src/ConfigAwareInterface.php b/vendor/consolidation/config/src/ConfigAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..96e6a78de9113a14dbda7fbd33f804dd790c16d8 --- /dev/null +++ b/vendor/consolidation/config/src/ConfigAwareInterface.php @@ -0,0 +1,22 @@ +<?php + +namespace Consolidation\Config; + +interface ConfigAwareInterface +{ + /** + * Set the config reference + * + * @param ConfigInterface $config + * + * @return $this + */ + public function setConfig(ConfigInterface $config); + + /** + * Get the config reference + * + * @return ConfigInterface + */ + public function getConfig(); +} diff --git a/vendor/consolidation/config/src/ConfigAwareTrait.php b/vendor/consolidation/config/src/ConfigAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..c577af4f9e863fbbaaabf74054b33e40dbf9f80a --- /dev/null +++ b/vendor/consolidation/config/src/ConfigAwareTrait.php @@ -0,0 +1,35 @@ +<?php + +namespace Consolidation\Config; + +trait ConfigAwareTrait +{ + /** + * @var ConfigInterface + */ + protected $config; + + /** + * Set the config management object. + * + * @param ConfigInterface $config + * + * @return $this + */ + public function setConfig(ConfigInterface $config) + { + $this->config = $config; + + return $this; + } + + /** + * Get the config management object. + * + * @return ConfigInterface + */ + public function getConfig() + { + return $this->config; + } +} diff --git a/vendor/consolidation/config/src/ConfigInterface.php b/vendor/consolidation/config/src/ConfigInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..5124ea1fcb211ceb645a770f38def6731cf4cbdf --- /dev/null +++ b/vendor/consolidation/config/src/ConfigInterface.php @@ -0,0 +1,105 @@ +<?php +namespace Consolidation\Config; + +interface ConfigInterface +{ + /** + * Determine if a non-default config value exists. + */ + public function has($key); + + /** + * Fetch a configuration value + * + * @param string $key Which config item to look up + * @param string|null $defaultFallback Fallback default value to use when + * configuration object has neither a value nor a default. Use is + * discouraged; use default context in ConfigOverlay, or provide defaults + * using a config processor. + * + * @return mixed + */ + public function get($key, $defaultFallback = null); + + /** + * Set a config value + * + * @param string $key + * @param mixed $value + * + * @return $this + */ + public function set($key, $value); + + /** + * Import configuration from the provided nexted array, replacing whatever + * was here previously. No processing is done on the provided data. + * + * @deprecated Use 'replace'. Dflydev\DotAccessData\Data::import() merges, which is confusing, since this method replaces. + * + * @param array $data + * @return Config + */ + public function import($data); + + /** + * Load configuration from the provided nexted array, replacing whatever + * was here previously. No processing is done on the provided data. + * + * TODO: This will become a required method in version 2.0. Adding now + * would break clients that implement ConfigInterface. + * + * @param array $data + * @return Config + */ + // public function replace($data); + + /** + * Import configuration from the provided nexted array, merging with whatever + * was here previously. No processing is done on the provided data. + * Any data provided to the combine() method will overwrite existing data + * with the same key. + * + * TODO: This will become a required method in version 2.0. Adding now + * would break clients that implement ConfigInterface. + * + * @param array $data + * @return Config + */ + // public function combine($data); + + /** + * Export all configuration as a nested array. + */ + public function export(); + + /** + * Return the default value for a given configuration item. + * + * @param string $key + * + * @return mixed + */ + public function hasDefault($key); + + /** + * Return the default value for a given configuration item. + * + * @param string $key + * @param mixed $defaultFallback + * + * @return mixed + */ + public function getDefault($key, $defaultFallback = null); + + /** + * Set the default value for a configuration setting. This allows us to + * set defaults either before or after more specific configuration values + * are loaded. Keeping defaults separate from current settings also + * allows us to determine when a setting has been overridden. + * + * @param string $key + * @param string $value + */ + public function setDefault($key, $value); +} diff --git a/vendor/consolidation/config/src/GlobalOptionDefaultValuesInterface.php b/vendor/consolidation/config/src/GlobalOptionDefaultValuesInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..d27958aa156368d6db43767b6c4bf18b0cad984a --- /dev/null +++ b/vendor/consolidation/config/src/GlobalOptionDefaultValuesInterface.php @@ -0,0 +1,10 @@ +<?php +namespace Consolidation\Config; + +interface GlobalOptionDefaultValuesInterface +{ + /** + * Return an associative array of option-key => default-value + */ + public function getGlobalOptionDefaultValues(); +} diff --git a/vendor/consolidation/config/src/Inject/ConfigForCommand.php b/vendor/consolidation/config/src/Inject/ConfigForCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..ce2646e1bf83d539d273444125b5b6feef94cd6f --- /dev/null +++ b/vendor/consolidation/config/src/Inject/ConfigForCommand.php @@ -0,0 +1,127 @@ +<?php +namespace Consolidation\Config\Inject; + +use Consolidation\Config\ConfigInterface; +use Consolidation\Config\Util\ConfigFallback; + +use Symfony\Component\Console\ConsoleEvents; +use Symfony\Component\Console\Event\ConsoleCommandEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Input\InputOption; + +class ConfigForCommand implements EventSubscriberInterface +{ + protected $config; + protected $application; + + public function __construct(ConfigInterface $config) + { + $this->config = $config; + } + + public function setApplication(Application $application) + { + $this->application = $application; + } + + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() + { + return [ConsoleEvents::COMMAND => 'injectConfiguration']; + } + + /** + * Before a Console command runs, inject configuration settings + * for this command into the default value of the options of + * this command. + * + * @param \Symfony\Component\Console\Event\ConsoleCommandEvent $event + */ + public function injectConfiguration(ConsoleCommandEvent $event) + { + $command = $event->getCommand(); + $this->injectConfigurationForGlobalOptions($event->getInput()); + $this->injectConfigurationForCommand($command, $event->getInput()); + + $targetOfHelpCommand = $this->getHelpCommandTarget($command, $event->getInput()); + if ($targetOfHelpCommand) { + $this->injectConfigurationForCommand($targetOfHelpCommand, $event->getInput()); + } + } + + protected function injectConfigurationForGlobalOptions($input) + { + if (!$this->application) { + return; + } + + $configGroup = new ConfigFallback($this->config, 'options'); + + $definition = $this->application->getDefinition(); + $options = $definition->getOptions(); + + return $this->injectConfigGroupIntoOptions($configGroup, $options, $input); + } + + protected function injectConfigurationForCommand($command, $input) + { + $commandName = $command->getName(); + $commandName = str_replace(':', '.', $commandName); + $configGroup = new ConfigFallback($this->config, $commandName, 'command.', '.options.'); + + $definition = $command->getDefinition(); + $options = $definition->getOptions(); + + return $this->injectConfigGroupIntoOptions($configGroup, $options, $input); + } + + protected function injectConfigGroupIntoOptions($configGroup, $options, $input) + { + foreach ($options as $option => $inputOption) { + $key = str_replace('.', '-', $option); + $value = $configGroup->get($key); + if ($value !== null) { + if (is_bool($value) && ($value == true)) { + $input->setOption($key, $value); + } elseif ($inputOption->acceptValue()) { + $inputOption->setDefault($value); + } + } + } + } + + protected function getHelpCommandTarget($command, $input) + { + if (($command->getName() != 'help') || (!isset($this->application))) { + return false; + } + + $this->fixInputForSymfony2($command, $input); + + // Symfony Console helpfully swaps 'command_name' and 'command' + // depending on whether the user entered `help foo` or `--help foo`. + // One of these is always `help`, and the other is the command we + // are actually interested in. + $nameOfCommandToDescribe = $input->getArgument('command_name'); + if ($nameOfCommandToDescribe == 'help') { + $nameOfCommandToDescribe = $input->getArgument('command'); + } + return $this->application->find($nameOfCommandToDescribe); + } + + protected function fixInputForSymfony2($command, $input) + { + // Symfony 3.x prepares $input for us; Symfony 2.x, on the other + // hand, passes it in prior to binding with the command definition, + // so we have to go to a little extra work. It may be inadvisable + // to do these steps for commands other than 'help'. + if (!$input->hasArgument('command_name')) { + $command->ignoreValidationErrors(); + $command->mergeApplicationDefinition(); + $input->bind($command->getDefinition()); + } + } +} diff --git a/vendor/consolidation/config/src/Inject/ConfigForSetters.php b/vendor/consolidation/config/src/Inject/ConfigForSetters.php new file mode 100644 index 0000000000000000000000000000000000000000..5ec87042919feea7f8be47de0bbd1a874509f1c4 --- /dev/null +++ b/vendor/consolidation/config/src/Inject/ConfigForSetters.php @@ -0,0 +1,47 @@ +<?php +namespace Consolidation\Config\Inject; + +use Consolidation\Config\Util\ConfigMerge; + +/** + * Given an object that contains configuration methods, inject any + * configuration found in the configuration file. + * + * The proper use for this method is to call setter methods of the + * provided object. Using configuration to call methods that do work + * is an abuse of this mechanism. + */ +class ConfigForSetters +{ + protected $config; + + public function __construct($config, $group, $prefix = '', $postfix = '') + { + if (!empty($group) && empty($postfix)) { + $postfix = '.'; + } + + $this->config = new ConfigMerge($config, $group, $prefix, $postfix); + } + + public function apply($object, $configurationKey) + { + $settings = $this->config->get($configurationKey); + foreach ($settings as $setterMethod => $args) { + $fn = [$object, $setterMethod]; + if (is_callable($fn)) { + $result = call_user_func_array($fn, (array)$args); + + // We require that $fn must only be used with setter methods. + // Setter methods are required to always return $this so that + // they may be chained. We will therefore throw an exception + // for any setter that returns something else. + if ($result != $object) { + $methodDescription = get_class($object) . "::$setterMethod"; + $propertyDescription = $this->config->describe($configurationKey); + throw new \Exception("$methodDescription did not return '\$this' when processing $propertyDescription."); + } + } + } + } +} diff --git a/vendor/consolidation/config/src/Loader/ConfigLoader.php b/vendor/consolidation/config/src/Loader/ConfigLoader.php new file mode 100644 index 0000000000000000000000000000000000000000..ecc6f64f2afd8c280408898f61b6e1e3663db81f --- /dev/null +++ b/vendor/consolidation/config/src/Loader/ConfigLoader.php @@ -0,0 +1,35 @@ +<?php + +namespace Consolidation\Config\Loader; + +/** + * Load configuration files. + */ +abstract class ConfigLoader implements ConfigLoaderInterface +{ + protected $config = []; + protected $source = ''; + + public function getSourceName() + { + return $this->source; + } + + protected function setSourceName($source) + { + $this->source = $source; + return $this; + } + + public function export() + { + return $this->config; + } + + public function keys() + { + return array_keys($this->config); + } + + abstract public function load($path); +} diff --git a/vendor/consolidation/config/src/Loader/ConfigLoaderInterface.php b/vendor/consolidation/config/src/Loader/ConfigLoaderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..9b155c1b949389954e7774e5cecec78db78bdc46 --- /dev/null +++ b/vendor/consolidation/config/src/Loader/ConfigLoaderInterface.php @@ -0,0 +1,29 @@ +<?php + +namespace Consolidation\Config\Loader; + +/** + * Load configuration files, and fill in any property values that + * need to be expanded. + */ +interface ConfigLoaderInterface +{ + /** + * Convert loaded configuration into a simple php nested array. + * + * @return array + */ + public function export(); + + /** + * Return the top-level keys in the exported data. + * + * @return array + */ + public function keys(); + + /** + * Return a symbolic name for this configuration loader instance. + */ + public function getSourceName(); +} diff --git a/vendor/consolidation/config/src/Loader/ConfigProcessor.php b/vendor/consolidation/config/src/Loader/ConfigProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..be05289477725819437ebe2dd3918c8f86befed3 --- /dev/null +++ b/vendor/consolidation/config/src/Loader/ConfigProcessor.php @@ -0,0 +1,184 @@ +<?php + +namespace Consolidation\Config\Loader; + +use Grasmash\Expander\Expander; +use Consolidation\Config\Util\ArrayUtil; + +/** + * The config processor combines multiple configuration + * files together, and processes them as necessary. + */ +class ConfigProcessor +{ + protected $processedConfig = []; + protected $unprocessedConfig = []; + protected $nameOfItemsToMerge = []; + protected $expander; + + public function __construct($expander = null) + { + $this->expander = $expander ?: new Expander(); + } + + /** + * By default, string config items always REPLACE, not MERGE when added + * from different sources. This method will allow applications to alter + * this behavior for specific items so that strings from multiple sources + * will be merged together into an array instead. + */ + public function useMergeStrategyForKeys($itemName) + { + if (is_array($itemName)) { + $this->nameOfItemsToMerge = array_merge($this->nameOfItemsToMerge, $itemName); + return $this; + } + $this->nameOfItemsToMerge[] = $itemName; + return $this; + } + + /** + * Extend the configuration to be processed with the + * configuration provided by the specified loader. + * + * @param ConfigLoaderInterface $loader + */ + public function extend(ConfigLoaderInterface $loader) + { + return $this->addFromSource($loader->export(), $loader->getSourceName()); + } + + /** + * Extend the configuration to be processed with + * the provided nested array. + * + * @param array $data + */ + public function add($data) + { + $this->unprocessedConfig[] = $data; + return $this; + } + + /** + * Extend the configuration to be processed with + * the provided nested array. Also record the name + * of the data source, if applicable. + * + * @param array $data + * @param string $source + */ + protected function addFromSource($data, $source = '') + { + if (empty($source)) { + return $this->add($data); + } + $this->unprocessedConfig[$source] = $data; + return $this; + } + + /** + * Process all of the configuration that has been collected, + * and return a nested array. + * + * @return array + */ + public function export($referenceArray = []) + { + if (!empty($this->unprocessedConfig)) { + $this->processedConfig = $this->process( + $this->processedConfig, + $this->fetchUnprocessed(), + $referenceArray + ); + } + return $this->processedConfig; + } + + /** + * To aid in debugging: return the source of each configuration item. + * n.b. Must call this function *before* export and save the result + * if persistence is desired. + */ + public function sources() + { + $sources = []; + foreach ($this->unprocessedConfig as $sourceName => $config) { + if (!empty($sourceName)) { + $configSources = ArrayUtil::fillRecursive($config, $sourceName); + $sources = ArrayUtil::mergeRecursiveDistinct($sources, $configSources); + } + } + return $sources; + } + + /** + * Get the configuration to be processed, and clear out the + * 'unprocessed' list. + * + * @return array + */ + protected function fetchUnprocessed() + { + $toBeProcessed = $this->unprocessedConfig; + $this->unprocessedConfig = []; + return $toBeProcessed; + } + + /** + * Use a map-reduce to evaluate the items to be processed, + * and merge them into the processed array. + * + * @param array $processed + * @param array $toBeProcessed + * @return array + */ + protected function process(array $processed, array $toBeProcessed, $referenceArray = []) + { + $toBeReduced = array_map([$this, 'preprocess'], $toBeProcessed); + $reduced = array_reduce($toBeReduced, [$this, 'reduceOne'], $processed); + return $this->evaluate($reduced, $referenceArray); + } + + /** + * Process a single configuration file from the 'to be processed' + * list. By default this is a no-op. Override this method to + * provide any desired configuration preprocessing, e.g. dot-notation + * expansion of the configuration keys, etc. + * + * @param array $config + * @return array + */ + protected function preprocess(array $config) + { + return $config; + } + + /** + * Evaluate one item in the 'to be evaluated' list, and then + * merge it into the processed configuration (the 'carry'). + * + * @param array $processed + * @param array $config + * @return array + */ + protected function reduceOne(array $processed, array $config) + { + return ArrayUtil::mergeRecursiveSelect($processed, $config, $this->nameOfItemsToMerge); + } + + /** + * Evaluate one configuration item. + * + * @param array $processed + * @param array $config + * @return array + */ + protected function evaluate(array $config, $referenceArray = []) + { + return $this->expander->expandArrayProperties( + $config, + $referenceArray + ); + } +} diff --git a/vendor/consolidation/config/src/Loader/YamlConfigLoader.php b/vendor/consolidation/config/src/Loader/YamlConfigLoader.php new file mode 100644 index 0000000000000000000000000000000000000000..4570566278735042f0d353cb6bd9adbd220beff2 --- /dev/null +++ b/vendor/consolidation/config/src/Loader/YamlConfigLoader.php @@ -0,0 +1,26 @@ +<?php + +namespace Consolidation\Config\Loader; + +use Symfony\Component\Yaml\Yaml; + +/** + * Load configuration files, and fill in any property values that + * need to be expanded. + */ +class YamlConfigLoader extends ConfigLoader +{ + public function load($path) + { + $this->setSourceName($path); + + // We silently skip any nonexistent config files, so that + // clients may simply `load` all of their candidates. + if (!file_exists($path)) { + $this->config = []; + return $this; + } + $this->config = (array) Yaml::parse(file_get_contents($path)); + return $this; + } +} diff --git a/vendor/consolidation/config/src/Util/ArrayUtil.php b/vendor/consolidation/config/src/Util/ArrayUtil.php new file mode 100644 index 0000000000000000000000000000000000000000..d5748a7a2a88ca5dd03b663af93315f9cdc464fe --- /dev/null +++ b/vendor/consolidation/config/src/Util/ArrayUtil.php @@ -0,0 +1,122 @@ +<?php +namespace Consolidation\Config\Util; + +/** + * Useful array utilities. + */ +class ArrayUtil +{ + /** + * Merges arrays recursively while preserving. + * + * @param array $array1 + * @param array $array2 + * + * @return array + * + * @see http://php.net/manual/en/function.array-merge-recursive.php#92195 + * @see https://github.com/grasmash/bolt/blob/robo-rebase/src/Robo/Common/ArrayManipulator.php#L22 + */ + public static function mergeRecursiveDistinct( + array &$array1, + array &$array2 + ) { + $merged = $array1; + foreach ($array2 as $key => &$value) { + $merged[$key] = self::mergeRecursiveValue($merged, $key, $value); + } + return $merged; + } + + /** + * Process the value in an mergeRecursiveDistinct - make a recursive + * call if needed. + */ + protected static function mergeRecursiveValue(&$merged, $key, $value) + { + if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { + return self::mergeRecursiveDistinct($merged[$key], $value); + } + return $value; + } + + + /** + * Merges arrays recursively while preserving. + * + * @param array $array1 + * @param array $array2 + * + * @return array + * + * @see http://php.net/manual/en/function.array-merge-recursive.php#92195 + * @see https://github.com/grasmash/bolt/blob/robo-rebase/src/Robo/Common/ArrayManipulator.php#L22 + */ + public static function mergeRecursiveSelect( + array &$array1, + array &$array2, + array $selectionList, + $keyPrefix = '' + ) { + $merged = $array1; + foreach ($array2 as $key => &$value) { + $merged[$key] = self::mergeRecursiveSelectValue($merged, $key, $value, $selectionList, $keyPrefix); + } + return $merged; + } + + /** + * Process the value in an mergeRecursiveDistinct - make a recursive + * call if needed. + */ + protected static function mergeRecursiveSelectValue(&$merged, $key, $value, $selectionList, $keyPrefix) + { + if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { + if (self::selectMerge($keyPrefix, $key, $selectionList)) { + return array_merge_recursive($merged[$key], $value); + } else { + return self::mergeRecursiveSelect($merged[$key], $value, $selectionList, "${keyPrefix}${key}."); + } + } + return $value; + } + + protected static function selectMerge($keyPrefix, $key, $selectionList) + { + return in_array("${keyPrefix}${key}", $selectionList); + } + + + /** + * Fills all of the leaf-node values of a nested array with the + * provided replacement value. + */ + public static function fillRecursive(array $data, $fill) + { + $result = []; + foreach ($data as $key => $value) { + $result[$key] = $fill; + if (self::isAssociative($value)) { + $result[$key] = self::fillRecursive($value, $fill); + } + } + return $result; + } + + /** + * Return true if the provided parameter is an array, and at least + * one key is non-numeric. + */ + public static function isAssociative($testArray) + { + if (!is_array($testArray)) { + return false; + } + foreach (array_keys($testArray) as $key) { + if (!is_numeric($key)) { + return true; + } + } + return false; + } +} diff --git a/vendor/consolidation/config/src/Util/ConfigFallback.php b/vendor/consolidation/config/src/Util/ConfigFallback.php new file mode 100644 index 0000000000000000000000000000000000000000..9f9972f6064eec4d88ceb9e7839c9374529aaaec --- /dev/null +++ b/vendor/consolidation/config/src/Util/ConfigFallback.php @@ -0,0 +1,51 @@ +<?php +namespace Consolidation\Config\Util; + +/** + * Fetch a configuration value from a configuration group. If the + * desired configuration value is not found in the most specific + * group named, keep stepping up to the next parent group until a + * value is located. + * + * Given the following constructor inputs: + * - $prefix = "command." + * - $group = "foo.bar.baz" + * - $postfix = ".options." + * Then the `get` method will then consider, in order: + * - command.foo.bar.baz.options + * - command.foo.bar.options + * - command.foo.options + * If any of these contain an option for "$key", then return its value. + */ +class ConfigFallback extends ConfigGroup +{ + /** + * @inheritdoc + */ + public function get($key) + { + return $this->getWithFallback($key, $this->group, $this->prefix, $this->postfix); + } + + /** + * Fetch an option value from a given key, or, if that specific key does + * not contain a value, then consult various fallback options until a + * value is found. + * + */ + protected function getWithFallback($key, $group, $prefix = '', $postfix = '.') + { + $configKey = "{$prefix}{$group}${postfix}{$key}"; + if ($this->config->has($configKey)) { + return $this->config->get($configKey); + } + if ($this->config->hasDefault($configKey)) { + return $this->config->getDefault($configKey); + } + $moreGeneralGroupname = $this->moreGeneralGroupName($group); + if ($moreGeneralGroupname) { + return $this->getWithFallback($key, $moreGeneralGroupname, $prefix, $postfix); + } + return null; + } +} diff --git a/vendor/consolidation/config/src/Util/ConfigGroup.php b/vendor/consolidation/config/src/Util/ConfigGroup.php new file mode 100644 index 0000000000000000000000000000000000000000..24b29dd8ec88e4ed76bc975de89525dc6b8b2a67 --- /dev/null +++ b/vendor/consolidation/config/src/Util/ConfigGroup.php @@ -0,0 +1,61 @@ +<?php +namespace Consolidation\Config\Util; + +/** + * Fetch a configuration value from a configuration group. If the + * desired configuration value is not found in the most specific + * group named, keep stepping up to the next parent group until a + * value is located. + * + * Given the following constructor inputs: + * - $prefix = "command." + * - $group = "foo.bar.baz" + * - $postfix = ".options." + * Then the `get` method will then consider, in order: + * - command.foo.bar.baz.options + * - command.foo.bar.options + * - command.foo.options + * If any of these contain an option for "$key", then return its value. + */ +abstract class ConfigGroup +{ + protected $config; + protected $group; + protected $prefix; + protected $postfix; + + public function __construct($config, $group, $prefix = '', $postfix = '.') + { + $this->config = $config; + $this->group = $group; + $this->prefix = $prefix; + $this->postfix = $postfix; + } + + /** + * Return a description of the configuration group (with prefix and postfix). + */ + public function describe($property) + { + return $this->prefix . $this->group . $this->postfix . $property; + } + + /** + * Get the requested configuration key from the most specific configuration + * group that contains it. + */ + abstract public function get($key); + + /** + * Given a group name, such as "foo.bar.baz", return the next configuration + * group in the fallback hierarchy, e.g. "foo.bar". + */ + protected function moreGeneralGroupName($group) + { + $result = preg_replace('#\.[^.]*$#', '', $group); + if ($result != $group) { + return $result; + } + return false; + } +} diff --git a/vendor/consolidation/config/src/Util/ConfigInterpolatorInterface.php b/vendor/consolidation/config/src/Util/ConfigInterpolatorInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..dd2f88b52552d5e53a52567a28255191a527c832 --- /dev/null +++ b/vendor/consolidation/config/src/Util/ConfigInterpolatorInterface.php @@ -0,0 +1,37 @@ +<?php +namespace Consolidation\Config\Util; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; + +/** + * Provides configuration objects with an 'interpolate' method + * that may be used to inject config values into tokens embedded + * in strings. + */ +interface ConfigInterpolatorInterface extends ConfigInterface +{ + /** + * interpolate replaces tokens in a string with the correspnding + * value from this config object. Tokens are surrounded by double + * curley braces, e.g. "{{key}}". + * + * Example: + * If the message is 'Hello, {{user.name}}', then the key user.name + * is fetched from the config object, and the token {{user.name}} is + * replaced with the result. + * + * @param string $message Message containing tokens to be replaced + * @param string|bool $default The value to substitute for tokens that + * are not found in the configuration. If `false`, then missing + * tokens are not replaced. + * @return string + */ + public function interpolate($message, $default = ''); + + /** + * mustInterpolate works exactly like interpolate, save for the fact + * that an exception is thrown is any of the tokens are not replaced. + */ + public function mustInterpolate($message); +} diff --git a/vendor/consolidation/config/src/Util/ConfigInterpolatorTrait.php b/vendor/consolidation/config/src/Util/ConfigInterpolatorTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..9e7c95b866936ca1ed45a295636c0aba4855dc9b --- /dev/null +++ b/vendor/consolidation/config/src/Util/ConfigInterpolatorTrait.php @@ -0,0 +1,38 @@ +<?php +namespace Consolidation\Config\Util; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; + +/** + * Provides configuration objects with an 'interpolate' method + * that may be used to inject config values into tokens embedded + * in strings.. + */ +trait ConfigInterpolatorTrait +{ + protected $interpolator; + + protected function getInterpolator() + { + if (!isset($this->interpolator)) { + $this->interpolator = new Interpolator(); + } + return $this->interpolator; + } + /** + * @inheritdoc + */ + public function interpolate($message, $default = '') + { + return $this->getInterpolator()->interpolate($this, $message, $default); + } + + /** + * @inheritdoc + */ + public function mustInterpolate($message) + { + return $this->getInterpolator()->mustInterpolate($this, $message); + } +} diff --git a/vendor/consolidation/config/src/Util/ConfigMerge.php b/vendor/consolidation/config/src/Util/ConfigMerge.php new file mode 100644 index 0000000000000000000000000000000000000000..65fccf72abcba951c1f889bd425795822f63e42d --- /dev/null +++ b/vendor/consolidation/config/src/Util/ConfigMerge.php @@ -0,0 +1,34 @@ +<?php +namespace Consolidation\Config\Util; + +/** + * Works like 'getWithFallback', but merges results from all applicable + * groups. Settings from most specific group take precedence. + */ +class ConfigMerge extends ConfigGroup +{ + /** + * @inheritdoc + */ + public function get($key) + { + return $this->getWithMerge($key, $this->group, $this->prefix, $this->postfix); + } + + /** + * Merge available configuration from each configuration group. + */ + public function getWithMerge($key, $group, $prefix = '', $postfix = '.') + { + $configKey = "{$prefix}{$group}${postfix}{$key}"; + $result = $this->config->get($configKey, []); + if (!is_array($result)) { + throw new \UnexpectedValueException($configKey . ' must be a list of settings to apply.'); + } + $moreGeneralGroupname = $this->moreGeneralGroupName($group); + if ($moreGeneralGroupname) { + $result += $this->getWithMerge($key, $moreGeneralGroupname, $prefix, $postfix); + } + return $result; + } +} diff --git a/vendor/consolidation/config/src/Util/ConfigOverlay.php b/vendor/consolidation/config/src/Util/ConfigOverlay.php new file mode 100644 index 0000000000000000000000000000000000000000..d264cb20fb4fd68afb128ebafdebd1a336f17dc8 --- /dev/null +++ b/vendor/consolidation/config/src/Util/ConfigOverlay.php @@ -0,0 +1,249 @@ +<?php +namespace Consolidation\Config\Util; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; +use Consolidation\Config\Util\ArrayUtil; +use Consolidation\Config\Util\ConfigInterpolatorInterface; +use Consolidation\Config\Util\ConfigInterpolatorTrait; + +/** + * Overlay different configuration objects that implement ConfigInterface + * to make a priority-based, merged configuration object. + * + * Note that using a ConfigOverlay hides the defaults stored in each + * individual configuration context. When using overlays, always call + * getDefault / setDefault on the ConfigOverlay object itself. + */ +class ConfigOverlay implements ConfigInterface, ConfigInterpolatorInterface, ConfigRuntimeInterface +{ + use ConfigInterpolatorTrait; + protected $contexts = []; + + const DEFAULT_CONTEXT = 'default'; + const PROCESS_CONTEXT = 'process'; + + public function __construct() + { + $this->contexts[self::DEFAULT_CONTEXT] = new Config(); + $this->contexts[self::PROCESS_CONTEXT] = new Config(); + } + + /** + * Add a named configuration object to the configuration overlay. + * Configuration objects added LAST have HIGHEST priority, with the + * exception of the fact that the process context always has the + * highest priority. + * + * If a context has already been added, its priority will not change. + */ + public function addContext($name, ConfigInterface $config) + { + $process = $this->contexts[self::PROCESS_CONTEXT]; + unset($this->contexts[self::PROCESS_CONTEXT]); + $this->contexts[$name] = $config; + $this->contexts[self::PROCESS_CONTEXT] = $process; + + return $this; + } + + /** + * Add a placeholder context that will be prioritized higher than + * existing contexts. This is done to ensure that contexts added + * later will maintain a higher priority if the placeholder context + * is later relaced with a different configuration set via addContext(). + * + * @param string $name + * @return $this + */ + public function addPlaceholder($name) + { + return $this->addContext($name, new Config()); + } + + /** + * Increase the priority of the named context such that it is higher + * in priority than any existing context except for the 'process' + * context. + * + * @param string $name + * @return $this + */ + public function increasePriority($name) + { + $config = $this->getContext($name); + unset($this->contexts[$name]); + return $this->addContext($name, $config); + } + + public function hasContext($name) + { + return isset($this->contexts[$name]); + } + + public function getContext($name) + { + if ($this->hasContext($name)) { + return $this->contexts[$name]; + } + return new Config(); + } + + public function runtimeConfig() + { + return $this->getContext(self::PROCESS_CONTEXT); + } + + public function removeContext($name) + { + unset($this->contexts[$name]); + } + + /** + * Determine if a non-default config value exists. + */ + public function findContext($key) + { + foreach (array_reverse($this->contexts) as $name => $config) { + if ($config->has($key)) { + return $config; + } + } + return false; + } + + /** + * @inheritdoc + */ + public function has($key) + { + return $this->findContext($key) != false; + } + + /** + * @inheritdoc + */ + public function get($key, $default = null) + { + if (is_array($default)) { + return $this->getUnion($key); + } + return $this->getSingle($key, $default); + } + + public function getSingle($key, $default = null) + { + $context = $this->findContext($key); + if ($context) { + return $context->get($key, $default); + } + return $default; + } + + public function getUnion($key) + { + $result = []; + foreach (array_reverse($this->contexts) as $name => $config) { + $item = (array) $config->get($key, []); + if ($item !== null) { + $result = array_merge($result, $item); + } + } + return $result; + } + + /** + * @inheritdoc + */ + public function set($key, $value) + { + $this->contexts[self::PROCESS_CONTEXT]->set($key, $value); + return $this; + } + + /** + * @inheritdoc + */ + public function import($data) + { + $this->unsupported(__FUNCTION__); + } + + /** + * @inheritdoc + */ + public function replace($data) + { + $this->unsupported(__FUNCTION__); + } + + /** + * @inheritdoc + */ + public function combine($data) + { + $this->unsupported(__FUNCTION__); + } + + /** + * @inheritdoc + */ + protected function unsupported($fn) + { + throw new \Exception("The method '$fn' is not supported for the ConfigOverlay class."); + } + + /** + * @inheritdoc + */ + public function export() + { + $export = []; + foreach ($this->contexts as $name => $config) { + $exportToMerge = $config->export(); + $export = \array_replace_recursive($export, $exportToMerge); + } + return $export; + } + + /** + * exportAll returns the export of all contexts, separated into + * separate buckets keyed by context name. + * + * @return array + */ + public function exportAll() + { + $export = []; + foreach ($this->contexts as $name => $config) { + $exportToInsert = $config->export(); + $export[$name] = $exportToInsert; + } + return $export; + } + + /** + * @inheritdoc + */ + public function hasDefault($key) + { + return $this->contexts[self::DEFAULT_CONTEXT]->has($key); + } + + /** + * @inheritdoc + */ + public function getDefault($key, $default = null) + { + return $this->contexts[self::DEFAULT_CONTEXT]->get($key, $default); + } + + /** + * @inheritdoc + */ + public function setDefault($key, $value) + { + $this->contexts[self::DEFAULT_CONTEXT]->set($key, $value); + return $this; + } +} diff --git a/vendor/consolidation/config/src/Util/ConfigRuntimeInterface.php b/vendor/consolidation/config/src/Util/ConfigRuntimeInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..42c6bae6d19b0a43b4504f59052582748d65643c --- /dev/null +++ b/vendor/consolidation/config/src/Util/ConfigRuntimeInterface.php @@ -0,0 +1,21 @@ +<?php +namespace Consolidation\Config\Util; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; + +/** + * ConfigRutimeInterface provides a method that returns those elements + * of the configuration that were set at runtime, e.g. via commandline + * options rather than being loaded from a file. + */ +interface ConfigRuntimeInterface +{ + /** + * runtimeConfig returns those elements of the configuration not + * loaded from a file. + * + * @return ConfigInterface + */ + public function runtimeConfig(); +} diff --git a/vendor/consolidation/config/src/Util/EnvConfig.php b/vendor/consolidation/config/src/Util/EnvConfig.php new file mode 100644 index 0000000000000000000000000000000000000000..05f8d2a828b1eb1f086fced31bab98906585855e --- /dev/null +++ b/vendor/consolidation/config/src/Util/EnvConfig.php @@ -0,0 +1,96 @@ +<?php +namespace Consolidation\Config\Util; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; + +/** + * Provide a configuration object that fetches values from environment + * variables. + */ +class EnvConfig implements ConfigInterface +{ + /** @var string */ + protected $prefix; + + /** + * EnvConfig constructor + * + * @param $prefix The string to appear before every environment + * variable key. For example, if the prefix is 'MYAPP_', then + * the key 'foo.bar' will be fetched from the environment variable + * MYAPP_FOO_BAR. + */ + public function __construct($prefix) + { + // Ensure that the prefix is always uppercase, and always + // ends with a '_', regardless of the form the caller provided. + $this->prefix = strtoupper(rtrim($prefix, '_')) . '_'; + } + + /** + * @inheritdoc + */ + public function has($key) + { + return $this->get($key) !== null; + } + + /** + * @inheritdoc + */ + public function get($key, $defaultFallback = null) + { + $envKey = $this->prefix . strtoupper(strtr($key, '.-', '__')); + $envKey = str_replace($this->prefix . $this->prefix, $this->prefix, $envKey); + return getenv($envKey) ?: $defaultFallback; + } + + /** + * @inheritdoc + */ + public function set($key, $value) + { + throw new \Exception('Cannot call "set" on environmental configuration.'); + } + + /** + * @inheritdoc + */ + public function import($data) + { + // no-op + } + + /** + * @inheritdoc + */ + public function export() + { + return []; + } + + /** + * @inheritdoc + */ + public function hasDefault($key) + { + return false; + } + + /** + * @inheritdoc + */ + public function getDefault($key, $defaultFallback = null) + { + return $defaultFallback; + } + + /** + * @inheritdoc + */ + public function setDefault($key, $value) + { + throw new \Exception('Cannot call "setDefault" on environmental configuration.'); + } +} diff --git a/vendor/consolidation/config/src/Util/Interpolator.php b/vendor/consolidation/config/src/Util/Interpolator.php new file mode 100644 index 0000000000000000000000000000000000000000..38ce4525793e658d8214441046d6e8006751a01b --- /dev/null +++ b/vendor/consolidation/config/src/Util/Interpolator.php @@ -0,0 +1,97 @@ +<?php +namespace Consolidation\Config\Util; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; + +/** + * Provides configuration objects with an 'interpolate' method + * that may be used to inject config values into tokens embedded + * in strings.. + */ +class Interpolator +{ + /** + * interpolate replaces tokens in a string with the correspnding + * value from this config object. Tokens are surrounded by double + * curley braces, e.g. "{{key}}". + * + * Example: + * If the message is 'Hello, {{user.name}}', then the key user.name + * is fetched from the config object, and the token {{user.name}} is + * replaced with the result. + * + * @param string $message Message containing tokens to be replaced + * @param string|bool $default The value to substitute for tokens that + * are not found in the configuration. If `false`, then missing + * tokens are not replaced. + * @return string + */ + public function interpolate($data, $message, $default = '') + { + $replacements = $this->replacements($data, $message, $default); + return strtr($message, $replacements); + } + + /** + * @inheritdoc + */ + public function mustInterpolate($data, $message) + { + $result = $this->interpolate($data, $message, false); + $tokens = $this->findTokens($result); + if (!empty($tokens)) { + throw new \Exception('The following required keys were not found in configuration: ' . implode(',', $tokens)); + } + return $result; + } + + /** + * findTokens finds all of the tokens in the provided message + * + * @param string $message String with tokens + * @return string[] map of token to key, e.g. {{key}} => key + */ + public function findTokens($message) + { + if (!preg_match_all('#{{([a-zA-Z0-9._-]+)}}#', $message, $matches, PREG_SET_ORDER)) { + return []; + } + $tokens = []; + foreach ($matches as $matchSet) { + list($sourceText, $key) = $matchSet; + $tokens[$sourceText] = $key; + } + return $tokens; + } + + /** + * Replacements looks up all of the replacements in the configuration + * object, given the token keys from the provided message. Keys that + * do not exist in the configuration are replaced with the default value. + */ + public function replacements($data, $message, $default = '') + { + $tokens = $this->findTokens($message); + + $replacements = []; + foreach ($tokens as $sourceText => $key) { + $replacementText = $this->get($data, $key, $default); + if ($replacementText !== false) { + $replacements[$sourceText] = $replacementText; + } + } + return $replacements; + } + + protected function get($data, $key, $default) + { + if (is_array($data)) { + return array_key_exists($key, $data) ? $data[$key] : $default; + } + if ($data instanceof ConfigInterface) { + return $data->get($key, $default); + } + throw new \Exception('Bad data type provided to Interpolator'); + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/.editorconfig b/vendor/consolidation/filter-via-dot-access-data/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..0c29908ffd5949e44dd7118463f38123a0017b67 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.editorconfig @@ -0,0 +1,17 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[**.php] +indent_style = space +indent_size = 4 + +[{composer.json,composer.lock}] +indent_size = 4 diff --git a/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/bug_report_or_support_request.md b/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/bug_report_or_support_request.md new file mode 100644 index 0000000000000000000000000000000000000000..e5ed016a43c3e437e216ac29ed9c3927375f46b6 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/bug_report_or_support_request.md @@ -0,0 +1,31 @@ +--- +name: Bug report or support request +about: Report a bug or ask a question about expected behavior. + +--- + +**Describe the bug or behavior** +A clear and concise description of the behavior you are seeing. + +**To Reproduce** +What did you do? + +**Expected behavior** +What did you expect would happen? + +**Actual behavior** +What happened instead? + +**Workaround** +Is there another way to do the desired action? + +### System Configuration +| Q | A +| --------------- | --- +| Drush version? | 9.x/8.x (please be specific, and try latest dev build) +| Drupal version? | 7.x/8.x +| PHP version | 5.6/7.1 +| OS? | Mac/Linux/Windows + +**Additional information** +Add any other context about the problem here. diff --git a/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/documentation_request.md b/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/documentation_request.md new file mode 100644 index 0000000000000000000000000000000000000000..4a5da8b3a2f6dcfca55466a10016aa9506f14be6 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/documentation_request.md @@ -0,0 +1,19 @@ +--- +name: Documentation request +about: If you know what the documentation change should be, please consider submitting + a pull request instead. If you do know where the documentation you need is, please + submit a support request first. + +--- + +**Existing document** +Please provide a link to the existing document that is unclear or incomplete. + +**What are you attempting to do** +Please explain the task you are attempting to accomplish. + +**In what way is the existing documentation unclear or incomplete** +Please explain any confusion or ambiguities in the existing documentation. + +**What should the documentation say instead?** +To the best of your ability, explain what additional information would allow you to complete your task. If you already know what the documentation should say, please consider submitting a documentation pull request instead. diff --git a/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/feature_request.md b/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000000000000000000000000000000000..066b2d920a28db73b4ba3a0b35e6905eeeef5772 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/vendor/consolidation/filter-via-dot-access-data/.github/pull_request_template.md b/vendor/consolidation/filter-via-dot-access-data/.github/pull_request_template.md new file mode 100644 index 0000000000000000000000000000000000000000..42ec292461f2be8f2c6b52f54af5104541c823f9 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.github/pull_request_template.md @@ -0,0 +1,16 @@ +### Overview +This pull request: + +| Q | A +| ------------- | --- +| Bug fix? | yes/no +| New feature? | yes/no <!-- don't forget to update CHANGELOG.md files --> +| Has tests? | yes/no +| BC breaks? | no +| Deprecations? | yes/no + +### Summary +Short overview of what changed. + +### Description +Any additional information. diff --git a/vendor/consolidation/filter-via-dot-access-data/.gitignore b/vendor/consolidation/filter-via-dot-access-data/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a08c23d7e2006e89af9b303aa5428d10ef6ec0b1 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.gitignore @@ -0,0 +1,5 @@ +.idea/ +box.phar +build +example.phar +vendor/ diff --git a/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/install b/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/install new file mode 100755 index 0000000000000000000000000000000000000000..16c69e107cce7f71e33e04207254d005200f9fd4 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/install @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff --git a/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/.gitignore b/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/composer.json b/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..9c2802c92470694c0f727cc6dfe317c17c2ef16f --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/composer.json @@ -0,0 +1,69 @@ +{ + "name": "consolidation/filter-via-dot-access-data", + "description": "This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\Filter\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\Filter\\": "../../tests/src" + } + }, + "require": { + "php": ">=5.5.0", + "dflydev/dot-access-data": "^1.1.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27", + "consolidation/Robo": "^1.2.3", + "symfony/console": "^2.8|^3|^4", + "knplabs/github-api": "^2.7", + "php-http/guzzle6-adapter": "^1.1", + "g1a/composer-test-scenarios": "^3", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "phar:install-tools": [ + "gem install mime-types -v 2.6.2", + "curl -LSs https://box-project.github.io/box2/installer.php | php" + ], + "phar:build": "box build", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "release": [ + "release VERSION" + ] + }, + "config": { + "platform": { + "php": "5.6.33" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/composer.lock b/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..3a207710b58ae9d56b9c392be733d45cac20ff63 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.scenarios.lock/phpunit5/composer.lock @@ -0,0 +1,3559 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "c84b5d3d8e52a02fcc828a617ec883e7", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/stream-filter", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/php-stream-filter.git", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "time": "2017-08-18T09:54:01+00:00" + }, + { + "name": "consolidation/annotated-command", + "version": "2.10.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "8e7d1a05230dc1159c751809e98b74f2b7f71873" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/8e7d1a05230dc1159c751809e98b74f2b7f71873", + "reference": "8e7d1a05230dc1159c751809e98b74f2b7f71873", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.0", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^6", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2018-11-15T01:46:18+00:00" + }, + { + "name": "consolidation/config", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "925231dfff32f05b787e1fddb265e789b939cf4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/925231dfff32f05b787e1fddb265e789b939cf4c", + "reference": "925231dfff32f05b787e1fddb265e789b939cf4c", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^1", + "phpunit/phpunit": "^5", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2018-10-24T17:55:35+00:00" + }, + { + "name": "consolidation/log", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "dfd8189a771fe047bf3cd669111b2de5f1c79395" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/dfd8189a771fe047bf3cd669111b2de5f1c79395", + "reference": "dfd8189a771fe047bf3cd669111b2de5f1c79395", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "psr/log": "~1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^1", + "phpunit/phpunit": "4.*", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2018-05-25T18:14:39+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^5.7.27", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "3.2.3", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2018-10-19T22:35:38+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "a9bd9ecf00751aa92754903c0d17612c4e840ce8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/a9bd9ecf00751aa92754903c0d17612c4e840ce8", + "reference": "a9bd9ecf00751aa92754903c0d17612c4e840ce8", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.8.2", + "consolidation/config": "^1.0.10", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.2", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2018-11-22T05:43:44+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-22T05:10:20+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "knplabs/github-api", + "version": "2.10.1", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/493423ae7ad1fa9075924cdfb98537828b9e80b5", + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "php-http/cache-plugin": "^1.4", + "php-http/client-common": "^1.6", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.0", + "php-http/httplug": "^1.1", + "psr/cache": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "cache/array-adapter": "^0.4", + "guzzlehttp/psr7": "^1.2", + "php-http/guzzle6-adapter": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^5.5 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.10.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": "2018-09-05T19:12:14+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "php-http/cache-plugin", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/c573ac6ea9b4e33fad567f875b844229d18000b9", + "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/client-common": "^1.1", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "time": "2017-11-29T20:45:41+00:00" + }, + { + "name": "php-http/client-common", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "0b9ce659aa46aee106f8c66597ea0c070fcd9dff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/0b9ce659aa46aee106f8c66597ea0c070fcd9dff", + "reference": "0b9ce659aa46aee106f8c66597ea0c070fcd9dff", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/httplug": "^1.1", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.4", + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" + }, + "suggest": { + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "time": "2018-10-09T06:46:29+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", + "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^2.0.2", + "php-http/httplug": "^1.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^2.4", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", + "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "time": "2018-02-06T10:55:24+00:00" + }, + { + "name": "php-http/guzzle6-adapter", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle6-adapter.git", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "php-http/httplug": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "php-http/adapter-integration-tests": "^0.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle6\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Guzzle 6 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "time": "2016-05-10T06:13:32+00:00" + }, + { + "name": "php-http/httplug", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "php-http/promise": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "time": "2016-08-31T08:30:17+00:00" + }, + { + "name": "php-http/message", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/b159ffe570dffd335e22ef0b91a946eacb182fa1", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^1.0", + "coduo/phpspec-data-provider-extension": "^1.0", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4", + "slim/slim": "^3.0", + "zendframework/zend-diactoros": "^1.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation", + "zendframework/zend-diactoros": "Used with Diactoros Factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "time": "2018-11-01T09:32:41+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "shasum": "" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "time": "2016-01-26T13:27:02+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-10T14:09:06+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "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" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-10-03T08:46:40+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2018-09-17T17:29:18+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2018-10-14T17:33:21+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.6.33" + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/.scrutinizer.yml b/vendor/consolidation/filter-via-dot-access-data/.scrutinizer.yml new file mode 100644 index 0000000000000000000000000000000000000000..8528e06fba99b912e12a39d5f3f9cf8112397e58 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.scrutinizer.yml @@ -0,0 +1,11 @@ +checks: + php: true +filter: + excluded_paths: + - customize/* + - tests/* +tools: + php_sim: true + php_pdepend: true + php_analyzer: true + php_cs_fixer: false diff --git a/vendor/consolidation/filter-via-dot-access-data/.travis.yml b/vendor/consolidation/filter-via-dot-access-data/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..fbd21d5ce7472f70e85649cc9ca561565fef18f4 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/.travis.yml @@ -0,0 +1,41 @@ +dist: trusty +language: php +branches: + only: + - master + - "/^[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+.*$/" +matrix: + fast_finish: true + include: + - php: 7.2 + env: DEPENCENCIES=highest + - php: 7.2 + - php: 7.1 + - php: 7.0.11 + - php: 5.6 + env: SCENARIO=phpunit5 + - php: 5.6 + env: SCENARIO=phpunit5 DEPENDENCIES=lowest +sudo: false +cache: + directories: + - "$HOME/.composer/cache" +install: +- .scenarios.lock/install "${SCENARIO}" "${DEPENDENCIES}" +script: +- composer test +after_success: +- travis_retry php vendor/bin/php-coveralls -v +before_deploy: +- composer phar:install-tools +- composer install --prefer-dist --no-dev --no-interaction +- php box.phar build +deploy: + provider: releases + api_key: + secure: Ygn+dt902El+EckT1cVKMfFf3TaN/I58MU5YlTRVx6zJYcgLGUteuGiIBBBGrQgoipg1U0AGLWQHLdxsKrLh/eWcO8e1DV6JdJlJZWyF4+dk2lkJhwIHe4ws0Ab/geMKVlzStpZAWq2fWHo/Ckiz/OcIBSzk8N6qW7M3nX0O52/tRECDy3R2bElYNUQLFGdzLYQN+c/3XDDEIsneQ92LpOlKFzmomxtzrsjDu6TNquHCUKOYLEQRRDVXJ2Bkc4C5nr2OkDfY3FZYEaPEGX6NXRRw+mNZzpm+iO3FuAeQsvYqpQ5fXmhw2Ru9JB6UqURNCNX6cr4tgfwW64F942TNZDeW/SizBYTibAxBHWbhspOAu/q8KladeMLnCfj6hs8kH94CLbptwQWYA/mEZkDiWCWlkuQY0h74wDDX5BXdHvCktNqawO7kCcak5VR99o5FGYPFC3on1t2TH0aojnVb47jghSmt1NlwwrbrtwEZNgHVgm75wWZfYmwQrF79HXEU41bM8dYaEvo2Y82vzI1+rXmLhY1GgcMCtRkmh20UunFCdQh0m/dm602Uri4OMPtPK7hgYCCi/D16a/czffSspVOeF2woGHjXrMuzNwOjQucsEzQXVMNDalFaGpZ3ui2BdN5w3g6j2pRL7Niv/IX5PzQrGdQUEGcnbHk28Kz0Zaw= + file: dot-project.phar + skip_cleanup: true + on: + tags: true + repo: consolidation/filter-via-dot-access-data diff --git a/vendor/consolidation/filter-via-dot-access-data/CHANGELOG.md b/vendor/consolidation/filter-via-dot-access-data/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..2aa6ad8e64e07bc3b194586eaefe3f3d94c0d26e --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +### 1.0.0 - 2019/Jan/17 + +Initial release diff --git a/vendor/consolidation/filter-via-dot-access-data/CONTRIBUTING.md b/vendor/consolidation/filter-via-dot-access-data/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..3aff3e788b2fa7a4b16c4f18c5c6365d24c51c39 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# Contributing to FilterViaDotAccessData + +Thank you for your interest in contributing to FilterViaDotAccessData! Here are some of the guidelines you should follow to make the most of your efforts: + +## Code Style Guidelines + +This project adheres to the [PSR-2 Coding Style Guide](http://www.php-fig.org/psr/psr-2/) for PHP code. An `.editorconfig` file is included with the repository to help you get up and running quickly. Most modern editors support this standard, but if yours does not or you would like to configure your editor manually, follow the guidelines in the document linked above. + +You can run the PHP Codesniffer on your work using a convenient command provided as a composer script: +``` +composer cs +``` +The above will run the PHP Codesniffer on the project sources. To automatically clean up code style violations, run: +``` +composer cbf +``` +Please ensure all contributions are compliant _before_ submitting a pull request. + +## Code of Conduct + +### Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +### Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +### Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +### Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [INSERT EMAIL ADDRESS]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +### Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/consolidation/filter-via-dot-access-data/LICENSE b/vendor/consolidation/filter-via-dot-access-data/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..801c1bd298092aa11dc618c3dc72c40068a51385 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/LICENSE @@ -0,0 +1,25 @@ +The MIT License (MIT) + +Copyright (c) 2018 Greg Anderson + +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. + +DEPENDENCY LICENSES: + +Name Version License +dflydev/dot-access-data v1.1.0 MIT \ No newline at end of file diff --git a/vendor/consolidation/filter-via-dot-access-data/README.md b/vendor/consolidation/filter-via-dot-access-data/README.md new file mode 100644 index 0000000000000000000000000000000000000000..926ff0974cb8b024be6d9fd05faad03a06822bd1 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/README.md @@ -0,0 +1,121 @@ +# FilterViaDotAccessData + +This project uses [dflydev/dot-access-data](https://github.com/dflydev/dot-access-data) to provide simple output filtering for applications built with [annotated-command](https://github.com/consolidation/annotated-command) / [Robo](https://github.com/consolidation/robo). + +[](https://travis-ci.org/consolidation/filter-via-dot-access-data) +[](https://ci.appveyor.com/project/greg-1-anderson/filter-via-dot-access-data) +[](https://scrutinizer-ci.com/g/consolidation/filter-via-dot-access-data/?branch=master) +[](https://coveralls.io/github/consolidation/filter-via-dot-access-data?branch=master) +[](LICENSE) + +## Overview + +This project provides a simple logic expression evaluator which can be used in conjunction with [dflydev/dot-access-data](https://github.com/dflydev/dot-access-data) to filter out results of the sort that you might return as a RowsOfFields object, or a nested yaml/json array. + +### API + +To use this filter in your annotated-commands-aware application (see [g1a/starter](https://github.com/g1a/starter)), ensure that the filter hooks are registered with +``` +$commandClasses = [ + \Consolidation\Filter\Hooks\FilterHooks::class, // Filter hooks + \MyApp\Commands\MyCommands::class, // Commandfiles for your application +]; +$runner = new \Robo\Runner($commandClasses); +``` +Then, any command that returns RowsOfFields data (see [consolidation/output-formatters](https://github.com/consolidation/output-formatters)) or an array may utilize the output filter feature simply by annotating its command method with `@filter-output`. +``` + /** + * Convert a command from one format to another, potentially with filtering. + * + * @command example + * @filter-output + * @return array + */ + public function example(array $parameters, $options = ['format' => 'yaml']) + { + return $this->doSomething($parameters); + } +``` +Annotating a command in this way will automaitically attach a `--filter[=FILTER]` option to the command. The output of the command may then be filtered by providing a simple expression: +``` +$ mycmd example p1 p2 --filter='color=red' +``` +A `contains` comparison may be done via the `*=` operator: +``` +$ mycmd example p1 p2 --filter='color*=red' +``` +And, finally, regex compares are also available via `~=`: +``` +$ mycmd example p1 p2 --filter='color~=#^red.*#' +``` +The filter decides whether to include or exclude each **top-level element** based on the result of evaluating the provided expression on each element. + +- Nested data elements may be tested, e.g. via `attributes.color=red` +- Simple boolean logic may be used, e.g. `color=red&&shape=round` + +Parenthesis are not supported. + +### Commandline Tool + +This project is bundled with a simple commandline tool, `dot-process`. It is similar to a simple version of `jq`. It is intended for demonstration purposes only. +``` +# Write out composer.json in yaml format +$ dot-process.phar edit composer.json --format=yaml +``` +This demo tool will become more functional over time. It is only intended to be a demo, though, not a supported utility. + +## Getting Started + +To build this project locally, follow the steps below. + +### Prerequisites + +Install dependencies: + +``` +composer install +``` + +If you wish to build the phar for this project, install the `box` phar builder via: + +``` +composer phar:install-tools +``` + +## Running the tests + +The test suite may be run locally by way of some simple composer scripts: + +| Test | Command +| ---------------- | --- +| Run all tests | `composer test` +| PHPUnit tests | `composer unit` +| PHP linter | `composer lint` +| Code style | `composer cs` +| Fix style errors | `composer cbf` + + +## Deployment + +Deploy by the following procedure: + +- Edit the `VERSION` file to contain the version to release, and commit the change. +- Run `composer release` + +## Contributing + +Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for submitting pull requests to us. + +## Versioning + +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases](https://github.com/consolidation/filter-via-dot-access-data/releases) page. + +## Authors + +* [Greg Anderson](https://github.com/greg-1-anderson) + +See also the list of [contributors](https://github.com/consolidation/filter-via-dot-access-data/contributors) who participated in this project. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details diff --git a/vendor/consolidation/filter-via-dot-access-data/VERSION b/vendor/consolidation/filter-via-dot-access-data/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..3eefcb9dd5b38e2c1dc061052455dd97bcd51e6c --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/VERSION @@ -0,0 +1 @@ +1.0.0 diff --git a/vendor/consolidation/filter-via-dot-access-data/appveyor.yml b/vendor/consolidation/filter-via-dot-access-data/appveyor.yml new file mode 100644 index 0000000000000000000000000000000000000000..c4368821dff293ee90d524315a40b8e1440a0723 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/appveyor.yml @@ -0,0 +1,63 @@ +build: false +shallow_clone: false +platform: 'x86' +clone_folder: C:\projects\work +branches: + only: + - master + +## Cache composer bits +cache: + - '%LOCALAPPDATA%\Composer\files -> composer.lock' + +init: + #https://github.com/composer/composer/blob/master/appveyor.yml + #- SET ANSICON=121x90 (121x90) + +# Inspired by https://github.com/Codeception/base/blob/master/appveyor.yml and https://github.com/phpmd/phpmd/blob/master/appveyor.yml +install: + - cinst -y curl + - SET PATH=C:\Program Files\curl;%PATH% + #which is only needed by the test suite. + - cinst -y which + - SET PATH=C:\Program Files\which;%PATH% + - git clone -q https://github.com/acquia/DevDesktopCommon.git #For tar, cksum, ... + - SET PATH=%APPVEYOR_BUILD_FOLDER%/DevDesktopCommon/bintools-win/msys/bin;%PATH% + - SET PATH=C:\Program Files\MySql\MySQL Server 5.7\bin\;%PATH% + #Install PHP per https://blog.wyrihaximus.net/2016/11/running-php-unit-tests-on-windows-using-appveyor-and-chocolatey/ + - ps: appveyor-retry cinst --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','') + - cd c:\tools\php70 + - copy php.ini-production php.ini + + - echo extension_dir=ext >> php.ini + - echo extension=php_openssl.dll >> php.ini + - echo date.timezone="UTC" >> php.ini + - echo variables_order="EGPCS" >> php.ini #May be unneeded. + - echo mbstring.http_input=pass >> php.ini + - echo mbstring.http_output=pass >> php.ini + - echo sendmail_path=nul >> php.ini + - echo extension=php_mbstring.dll >> php.ini + - echo extension=php_curl.dll >> php.ini + - echo extension=php_pdo_mysql.dll >> php.ini + - echo extension=php_pdo_pgsql.dll >> php.ini + - echo extension=php_pdo_sqlite.dll >> php.ini + - echo extension=php_pgsql.dll >> php.ini + - echo extension=php_gd2.dll >> php.ini + - SET PATH=C:\tools\php70;%PATH% + #Install Composer + - cd %APPVEYOR_BUILD_FOLDER% + #- appveyor DownloadFile https://getcomposer.org/composer.phar + - php -r "readfile('http://getcomposer.org/installer');" | php + #Install dependencies via Composer + - php composer.phar -q install --prefer-dist -n + - SET PATH=%APPVEYOR_BUILD_FOLDER%;%APPVEYOR_BUILD_FOLDER%/vendor/bin;%PATH% + #Create a sandbox for testing. Don't think we need this. + - mkdir c:\test_temp + +test_script: + - php composer.phar test + +# environment variables +environment: + global: + php_ver_target: 7.0 diff --git a/vendor/consolidation/filter-via-dot-access-data/box.json.dist b/vendor/consolidation/filter-via-dot-access-data/box.json.dist new file mode 100644 index 0000000000000000000000000000000000000000..a5a5c046b60a150d33c4a8618078aae93d24fff0 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/box.json.dist @@ -0,0 +1,25 @@ +{ + "alias": "dot-process.phar", + "chmod": "0755", + "compactors": [], + "directories": ["src"], + "files": ["dot-process", "README.md", "VERSION"], + "finder": [ + { + "name": "*.php", + "exclude": [ + "test", + "tests", + "Test", + "Tests", + "Tester" + ], + "in": "vendor" + } + ], + "git-commit": "git-commit", + "git-version": "git-version", + "output": "dot-process.phar", + "main": "dot-process", + "stub": true +} diff --git a/vendor/consolidation/filter-via-dot-access-data/composer.json b/vendor/consolidation/filter-via-dot-access-data/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..8fbe4e46a0b8e1fe3d2e202410d737ff6e19a3bc --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/composer.json @@ -0,0 +1,84 @@ +{ + "name": "consolidation/filter-via-dot-access-data", + "description": "This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\Filter\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\Filter\\": "tests/src" + } + }, + "require": { + "php": ">=5.5.0", + "dflydev/dot-access-data": "^1.1.0" + }, + "require-dev": { + "consolidation/Robo": "^1.2.3", + "symfony/console": "^2.8|^3|^4", + "knplabs/github-api": "^2.7", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^5", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "phar:install-tools": [ + "gem install mime-types -v 2.6.2", + "curl -LSs https://box-project.github.io/box2/installer.php | php" + ], + "phar:build": "box build", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "release": [ + "release VERSION" + ] + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "7.0.8" + } + }, + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/composer.lock b/vendor/consolidation/filter-via-dot-access-data/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..df2bf5ebe5e7b2067b493eb41a72b194a22fe3c2 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/composer.lock @@ -0,0 +1,3832 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "11717aba3e9ff48b702ea83d1c3dd856", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/stream-filter", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/php-stream-filter.git", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "time": "2017-08-18T09:54:01+00:00" + }, + { + "name": "consolidation/annotated-command", + "version": "2.10.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "8e7d1a05230dc1159c751809e98b74f2b7f71873" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/8e7d1a05230dc1159c751809e98b74f2b7f71873", + "reference": "8e7d1a05230dc1159c751809e98b74f2b7f71873", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.0", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^6", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2018-11-15T01:46:18+00:00" + }, + { + "name": "consolidation/config", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "925231dfff32f05b787e1fddb265e789b939cf4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/925231dfff32f05b787e1fddb265e789b939cf4c", + "reference": "925231dfff32f05b787e1fddb265e789b939cf4c", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^1", + "phpunit/phpunit": "^5", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2018-10-24T17:55:35+00:00" + }, + { + "name": "consolidation/log", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "dfd8189a771fe047bf3cd669111b2de5f1c79395" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/dfd8189a771fe047bf3cd669111b2de5f1c79395", + "reference": "dfd8189a771fe047bf3cd669111b2de5f1c79395", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "psr/log": "~1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^1", + "phpunit/phpunit": "4.*", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2018-05-25T18:14:39+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^5.7.27", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "3.2.3", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2018-10-19T22:35:38+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "a9bd9ecf00751aa92754903c0d17612c4e840ce8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/a9bd9ecf00751aa92754903c0d17612c4e840ce8", + "reference": "a9bd9ecf00751aa92754903c0d17612c4e840ce8", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.8.2", + "consolidation/config": "^1.0.10", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.2", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2018-11-22T05:43:44+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-22T05:10:20+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "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": "*", + "monolog/monolog": "1.*", + "phpunit/phpunit": "3.7.*", + "psr/log": "1.0.*", + "symfony/class-loader": "*", + "zendframework/zend-cache": "<2.3", + "zendframework/zend-log": "<2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.8-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": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2014-01-28T22:29:15+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "knplabs/github-api", + "version": "2.10.1", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/493423ae7ad1fa9075924cdfb98537828b9e80b5", + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "php-http/cache-plugin": "^1.4", + "php-http/client-common": "^1.6", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.0", + "php-http/httplug": "^1.1", + "psr/cache": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "cache/array-adapter": "^0.4", + "guzzlehttp/psr7": "^1.2", + "php-http/guzzle6-adapter": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^5.5 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.10.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": "2018-09-05T19:12:14+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "php-http/cache-plugin", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/c573ac6ea9b4e33fad567f875b844229d18000b9", + "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/client-common": "^1.1", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "time": "2017-11-29T20:45:41+00:00" + }, + { + "name": "php-http/client-common", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "0b9ce659aa46aee106f8c66597ea0c070fcd9dff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/0b9ce659aa46aee106f8c66597ea0c070fcd9dff", + "reference": "0b9ce659aa46aee106f8c66597ea0c070fcd9dff", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/httplug": "^1.1", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.4", + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" + }, + "suggest": { + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "time": "2018-10-09T06:46:29+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", + "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^2.0.2", + "php-http/httplug": "^1.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^2.4", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", + "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "time": "2018-02-06T10:55:24+00:00" + }, + { + "name": "php-http/guzzle6-adapter", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle6-adapter.git", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "php-http/httplug": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "php-http/adapter-integration-tests": "^0.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle6\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Guzzle 6 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "time": "2016-05-10T06:13:32+00:00" + }, + { + "name": "php-http/httplug", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "php-http/promise": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "time": "2016-08-31T08:30:17+00:00" + }, + { + "name": "php-http/message", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/b159ffe570dffd335e22ef0b91a946eacb182fa1", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^1.0", + "coduo/phpspec-data-provider-extension": "^1.0", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4", + "slim/slim": "^3.0", + "zendframework/zend-diactoros": "^1.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation", + "zendframework/zend-diactoros": "Used with Diactoros Factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "time": "2018-11-01T09:32:41+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "shasum": "" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "time": "2016-01-26T13:27:02+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "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" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "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" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-10-03T08:46:40+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2018-09-17T17:29:18+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2018-10-14T17:33:21+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.0.8" + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/dependencies.yml b/vendor/consolidation/filter-via-dot-access-data/dependencies.yml new file mode 100644 index 0000000000000000000000000000000000000000..c381f99f8458aa9d0f655118cf1b6359af43ee92 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/dependencies.yml @@ -0,0 +1,8 @@ +version: 2 +dependencies: +- type: php + path: / + manifest_updates: + filters: + - name: ".*" + versions: "L.Y.Y" diff --git a/vendor/consolidation/filter-via-dot-access-data/dot-process b/vendor/consolidation/filter-via-dot-access-data/dot-process new file mode 100755 index 0000000000000000000000000000000000000000..a9543a4e4eb636a6e4d402ac274279c8108ac65b --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/dot-process @@ -0,0 +1,45 @@ +#!/usr/bin/env php +<?php + +/** + * Example commandline front controller + * + * The commandline tool is useful for providing ad-hoc access to our class implementations + */ + +// If we're running from phar load the phar autoload file. +$pharPath = \Phar::running(true); +if ($pharPath) { + $autoloaderPath = "$pharPath/vendor/autoload.php"; +} else { + if (file_exists(__DIR__.'/vendor/autoload.php')) { + $autoloaderPath = __DIR__.'/vendor/autoload.php'; + } elseif (file_exists(__DIR__.'/../../autoload.php')) { + $autoloaderPath = __DIR__ . '/../../autoload.php'; + } else { + die("Could not find autoloader. Run 'composer install'."); + } +} +$classLoader = require $autoloaderPath; + +// Customization variables +$argv = $_SERVER['argv']; +$appName = "Dot-Process"; +$appVersion = trim(file_get_contents(__DIR__ . '/VERSION')); +$commandClasses = [ \Consolidation\Filter\Cli\OpCommands::class, \Consolidation\Filter\Hooks\FilterHooks::class ]; +$selfUpdateRepository = 'consolidation/filter-via-dot-access-data'; +$configPrefix = 'DOTPROCESS'; +$configFilePath = getenv($configPrefix . '_CONFIG') ?: getenv('HOME') . '/.filter-via-dot-access-data/filter-via-dot-access-data.yml'; + +// Define our Runner, and pass it the command classes we provide. +$runner = new \Robo\Runner($commandClasses); +$runner + ->setSelfUpdateRepository($selfUpdateRepository) + ->setConfigurationFilename($configFilePath) + ->setEnvConfigPrefix($configPrefix) + ->setClassLoader($classLoader); + +// Execute the command and return the result. +$output = new \Symfony\Component\Console\Output\ConsoleOutput(); +$statusCode = $runner->execute($argv, $appName, $appVersion, $output); +exit($statusCode); diff --git a/vendor/consolidation/filter-via-dot-access-data/phpunit.xml.dist b/vendor/consolidation/filter-via-dot-access-data/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..79802560855c3a52e09b0cf5acb0b4282660ff05 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/phpunit.xml.dist @@ -0,0 +1,19 @@ +<phpunit bootstrap="vendor/autoload.php" colors="true"> + <testsuites> + <testsuite name="filter-via-dot-access-data"> + <directory prefix="" suffix="Test.php">tests</directory> + </testsuite> + </testsuites> + <logging> + <!-- + <log type="coverage-html" target="build/logs/coverage" lowUpperBound="35" + highLowerBound="70"/> + --> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">src</directory> + </whitelist> + </filter> +</phpunit> diff --git a/vendor/consolidation/filter-via-dot-access-data/src/Cli/OpCommands.php b/vendor/consolidation/filter-via-dot-access-data/src/Cli/OpCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..76922f4c59f94ebddd8002b20f97d0fa1f62c57a --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/Cli/OpCommands.php @@ -0,0 +1,100 @@ +<?php + +namespace Consolidation\Filter\Cli; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\Filter\LogicalOpFactory; +use Consolidation\Filter\FilterOutputData; +use Symfony\Component\Yaml\Yaml; + +class OpCommands extends \Robo\Tasks +{ + /** + * Test the expression parser + * + * @command parse + * @return array + */ + public function parse($expr, $options = ['format' => 'yaml', 'dump' => false]) + { + $factory = LogicalOpFactory::get(); + $op = $factory->evaluate($expr); + + $result = (string)$op; + + if ($options['dump']) { + $result = var_export($op, true) . "\n$result"; + } + + return $result; + } + + /** + * Convert a command from one format to another, potentially with filtering. + * + * @command edit + * @aliases ed + * @filter-default-field color + * @filter-output + * @return array + */ + public function edit($data, $options = ['format' => 'yaml', 'in' => 'auto']) + { + return $this->read($data, $options['in']); + } + + /** + * Read the data provided to this command. + */ + protected function read($data, $in) + { + // If our input spec is '-' then read from stdin + if ($data == '-') { + $data = 'php://stdin'; + } + // If our input spec is a file or a url then read it. Otherwise + // we'll presume the data was provided directly on the command line. + if (file_exists($data) || preg_match('#^[a-z]*://#', $data)) { + $data = file_get_contents($data); + } + + return $this->parseData($data, $in); + } + + /** + * Convert our provided input data to a php array. + */ + protected function parseData($data, $in) + { + $in = $this->inferInputFormat($data, $in); + + switch ($in) { + case 'json': + return json_decode($data, true); + + case 'yaml': + default: + return (array) Yaml::parse($data); + } + } + + /** + * If the data type is 'auto', then try to infer what data type + * we should parse as based on the contents of the data. + */ + protected function inferInputFormat($data, $in) + { + // If the user explicitly set the data type then use that + if ($in != 'auto') { + return $in; + } + + // If data begins with '{' then presume it is json + if ($data[0] == '{') { + return 'json'; + } + + // We don't know what the data type should be. + return $in; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/FactoryInterface.php b/vendor/consolidation/filter-via-dot-access-data/src/FactoryInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..220f55ebed7ad977f293682df8c37cef7e58fbe5 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/FactoryInterface.php @@ -0,0 +1,21 @@ +<?php +namespace Consolidation\Filter; + +use Dflydev\DotAccessData\Data; + +use Consolidation\Filter\Operators\LogicalAndOp; +use Consolidation\Filter\Operators\LogicalOrOp; + +/** + * Convert an expression with logical operators into an Operator. + */ +interface FactoryInterface +{ + /** + * Create an operator from an expression. + * + * @param string $expression + * @return OperatorInterface + */ + public function evaluate($expression, $defaultField = false); +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/FilterOutputData.php b/vendor/consolidation/filter-via-dot-access-data/src/FilterOutputData.php new file mode 100644 index 0000000000000000000000000000000000000000..35e45e1c119279cdb790f27269bb89cfe4646140 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/FilterOutputData.php @@ -0,0 +1,37 @@ +<?php +namespace Consolidation\Filter; + +use Dflydev\DotAccessData\Data; + +/** + * Remove output result rows that do not match filter criteria. + * + * Only usable with nested arrays, e.g. as you might provide to RowsOfFields + */ +class FilterOutputData +{ + public function __construct() + { + } + + /** + * Filter the provided data. + */ + public function filter($data, OperatorInterface $op) + { + $result = []; + + foreach ($data as $id => $value) { + $row = new Data($value); + if (!isset($value['id'])) { + $row->set('id', $id); + } + + if ($op->test($row)) { + $result[$id] = $value; + } + } + + return $result; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/Hooks/FilterHooks.php b/vendor/consolidation/filter-via-dot-access-data/src/Hooks/FilterHooks.php new file mode 100644 index 0000000000000000000000000000000000000000..abd77b60889f8607ebeb04fea8bc4d246047f87b --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/Hooks/FilterHooks.php @@ -0,0 +1,44 @@ +<?php + +namespace Consolidation\Filter\Hooks; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\Filter\LogicalOpFactory; +use Consolidation\Filter\FilterOutputData; +use Symfony\Component\Yaml\Yaml; + +class FilterHooks +{ + /** + * @hook alter @filter-output + * @option $filter Filter output based on provided expression + * @default $filter '' + */ + public function filterOutput($result, CommandData $commandData) + { + $expr = $commandData->input()->getOption('filter'); + $default_field = $commandData->annotationData()->get('filter-default-field'); + if (!empty($expr)) { + $factory = LogicalOpFactory::get(); + $op = $factory->evaluate($expr, $default_field); + $filter = new FilterOutputData(); + $result = $this->wrapFilteredResult($filter->filter($result, $op), $result); + } + + return $result; + } + + /** + * If the source data was wrapped in a marker class such + * as RowsOfFields, then re-apply the wrapper. + */ + protected function wrapFilteredResult($data, $source) + { + if (!$source instanceof \ArrayObject) { + return $data; + } + $sourceClass = get_class($source); + + return new $sourceClass($data); + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/LogicalOpFactory.php b/vendor/consolidation/filter-via-dot-access-data/src/LogicalOpFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..7a90f5b72117acd869429e0e842d75b3c7dd70c2 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/LogicalOpFactory.php @@ -0,0 +1,147 @@ +<?php +namespace Consolidation\Filter; + +use Dflydev\DotAccessData\Data; + +use Consolidation\Filter\Operators\LogicalAndOp; +use Consolidation\Filter\Operators\LogicalOrOp; + +/** + * Convert an expression with logical operators into an Operator. + */ +class LogicalOpFactory implements FactoryInterface +{ + protected $factory; + + /** + * Factory constructor + * @param FactoryInterface|null $factory + * @return FactoryInterface + */ + public function __construct($factory = null) + { + $this->factory = $factory ?: new OperatorFactory(); + } + + /** + * Factory factory + * @return FactoryInterface + */ + public static function get() + { + return new self(); + } + + /** + * Create an operator or a set of operators from the expression. + * + * @param string $expression + * @return OperatorInterface + */ + public function evaluate($expression, $default_field = false) + { + $exprSet = $this->splitByLogicOp($expression); + $result = false; + + foreach ($exprSet as $exprWithLogicOp) { + $logicOp = $exprWithLogicOp[1]; + $expr = $exprWithLogicOp[2]; + $rhs = $this->factory->evaluate($expr, $default_field); + $result = $this->combineUsingLogicalOp($result, $logicOp, $rhs); + } + + return $result; + } + + /** + * Given an expression in a form similar to 'a=b&c=d|x=y', + * produce a result as : + * + * [ + * [ + * 0 => 'a=b', + * 1 => '', + * 2 => 'a=b', + * ], + * [ + * 0 => '&&c=d', + * 1 => '&&', + * 2 => 'c=d', + * ], + * [ + * 0 => '||x=y', + * 1 => '||', + * 2 => 'x=y', + * ], + * ] + * + * This is the data structure returned by the former preg_match_all call + * used, which was: + * + * preg_match_all('#([&|]*)([^&|]+)#', $expression, $exprSet, PREG_SET_ORDER) + * + * The new algorithm splices the expressions together manually, as it was + * difficult to get preg_match_all to match && and || reliably. + * + * @param string $expression + * @return array + */ + protected function splitByLogicOp($expression) + { + if (!preg_match_all('#(&&|\|\|)#', $expression, $matches, PREG_OFFSET_CAPTURE)) { + return [ [$expression, '', $expression] ]; + } + $exprSet = []; + $i = 0; + foreach ($matches as $opWithOffset) { + list($op, $offset) = $opWithOffset[0]; + $expr = substr($expression, $i, $i + $offset); + $i = $i + $offset + strlen($op); + $exprSet[] = [ "$op$expr", $op, $expr, ]; + } + return $exprSet; + } + + /** + * Given the left-hand-side operator, a logical operator, and a + * string expression, create the right-hand-side operator and combine + * it with the provided lhs operator. + * + * @param Operator|false $lhs Left-hand-side operator + * @param string $logicOp '&' or '|' + * @param OperatorInterface $rhs Right-hand-side operator + * @return Operator + */ + protected function combineUsingLogicalOp($lhs, $logicOp, OperatorInterface $rhs) + { + // If this is the first term, just return the $rhs. + // At this point, $logicOp is always empty. + if (!$lhs || empty($logicOp)) { + return $rhs; + } + + // At this point, $logicOp is never empty. + return $this->createLogicalOp($lhs, $logicOp, $rhs); + } + + /** + * Given the left-hand-side operator, a logical operator, and a + * string expression, create the right-hand-side operator and combine + * it with the provided lhs operator. + * + * @param Operator|false $lhs Left-hand-side operator + * @param string $logicOp '&' or '|' + * @param OperatorInterface $rhs Right-hand-side operator + * @return Operator + */ + protected function createLogicalOp(OperatorInterface $lhs, $logicOp, OperatorInterface $rhs) + { + switch ($logicOp) { + case '&&': + return new LogicalAndOp($lhs, $rhs); + case '||': + return new LogicalOrOp($lhs, $rhs); + } + throw new \Exception('Impossible logicOp received: ' . $logicOp); + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/OperatorFactory.php b/vendor/consolidation/filter-via-dot-access-data/src/OperatorFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..1cedfdd36d3747483348b981f7457230cb6476e0 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/OperatorFactory.php @@ -0,0 +1,96 @@ +<?php +namespace Consolidation\Filter; + +use Dflydev\DotAccessData\Data; + +use Consolidation\Filter\Operators\ContainsOp; +use Consolidation\Filter\Operators\EqualsOp; +use Consolidation\Filter\Operators\RegexOp; +use Consolidation\Filter\Operators\NotOp; + +/** + * Convert a simple operator expression into an Operator. + * + * The supported operators include: + * + * key=value Equals + * key*=value Contains value + * key~=#regex# Regular expression match + * + * It is also possible to negate the result of an operator by + * adding a logical-not operator either before the entire expression, + * e.g. !key=value, or before the operator, e.g. key!=value. + * + */ +class OperatorFactory implements FactoryInterface +{ + public function __construct() + { + } + + /** + * Create an operator or a set of operators from the expression. + * + * @param string $expression + * @return OperatorInterface + */ + public function evaluate($expression, $defaultField = false) + { + if ($expression[0] == '!') { + $op = $this->evaluateNonNegated(substr($expression, 1), $defaultField); + return new NotOp($op); + } + return $this->evaluateNonNegated($expression, $defaultField); + } + + protected function evaluateNonNegated($expression, $defaultField = false) + { + list($key, $op, $comparitor) = $this->splitOnOperator($expression, $defaultField); + if (empty($key) || empty($op)) { + throw new \Exception('Could not parse expression ' . $expression); + } + + if ($op[0] == '!') { + $op = $this->instantiate($key, substr($op, 1), $comparitor); + return new NotOp($op); + } + return $this->instantiate($key, $op, $comparitor); + } + + protected function instantiate($key, $op, $comparitor) + { + switch ($op) { + case '=': + return new EqualsOp($key, $comparitor); + case '*=': + return new ContainsOp($key, $comparitor); + case '~=': + return new RegexOp($key, $comparitor); + } + + throw new \Exception('Unrecognized operator ' . $op); + } + + /** + * Given an expression in the form 'key=comparitor', return a list + * containing the key, the operator, and the comparitor. The operator + * can be any of: =, *=, ~=, !=, !*= or !~=. + * + * @param string @expression + * @return array + */ + protected function splitOnOperator($expression, $defaultField = false) + { + // If there is a default field, then any expression that is missing + // an operator will be interpreted as "default field contains value". + if (preg_match('#^[a-zA-Z0-9 _.:-]+$#', $expression) && ($defaultField !== false)) { + return [$defaultField, '*=', $expression]; + } + if (!preg_match('#([^!~*=]*)(!?~?\*?=)(.*)#', $expression, $matches)) { + return ['', '', '']; + } + + array_shift($matches); + return $matches; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/OperatorInterface.php b/vendor/consolidation/filter-via-dot-access-data/src/OperatorInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..af264ed31825c9d5413d8f364ec4bcf29cd610ff --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/OperatorInterface.php @@ -0,0 +1,24 @@ +<?php +namespace Consolidation\Filter; + +use Dflydev\DotAccessData\Data; + +/** + * Operators perform simple logic on provided values. + * + * Example operators: + * + * key? Has key + * op&op Logical AND + * op|op Logical OR + */ +interface OperatorInterface +{ + /** + * Test the provided value to see if it matches our criteria. + * + * @param mixed $value + * @return bool + */ + public function test(Data $row); +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/Operators/ContainsOp.php b/vendor/consolidation/filter-via-dot-access-data/src/Operators/ContainsOp.php new file mode 100644 index 0000000000000000000000000000000000000000..4575a1684053a3f6b9cec492de8fec30dee30ab8 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/Operators/ContainsOp.php @@ -0,0 +1,43 @@ +<?php +namespace Consolidation\Filter\Operators; + +use Consolidation\Filter\OperatorInterface; +use Dflydev\DotAccessData\Data; + +/** + * Test for equality + */ +class ContainsOp implements OperatorInterface +{ + protected $key; + protected $comparitor; + + public function __construct($key, $comparitor) + { + $this->key = $key; + $this->comparitor = $comparitor; + } + + /** + * Test the provided value to see if it matches our criteria. + * + * @param mixed $value + * @return bool + */ + public function test(Data $row) + { + $value = $row->get($this->key); + if (is_array($value)) { + return in_array($this->comparitor, $value); + } + return stripos($value, $this->comparitor) !== false; + } + + /** + * Return a string representation of this operator + */ + public function __toString() + { + return "{$this->key}*={$this->comparitor}"; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/Operators/EqualsOp.php b/vendor/consolidation/filter-via-dot-access-data/src/Operators/EqualsOp.php new file mode 100644 index 0000000000000000000000000000000000000000..a324b98227bfe0a7ebb3545407a70b78c65218ec --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/Operators/EqualsOp.php @@ -0,0 +1,40 @@ +<?php +namespace Consolidation\Filter\Operators; + +use Consolidation\Filter\OperatorInterface; +use Dflydev\DotAccessData\Data; + +/** + * Test for equality + */ +class EqualsOp implements OperatorInterface +{ + protected $key; + protected $comparitor; + + public function __construct($key, $comparitor) + { + $this->key = $key; + $this->comparitor = $comparitor; + } + + /** + * Test the provided value to see if it matches our criteria. + * + * @param mixed $value + * @return bool + */ + public function test(Data $row) + { + $value = $row->get($this->key); + return strcasecmp($this->comparitor, $value) == 0; + } + + /** + * Return a string representation of this operator + */ + public function __toString() + { + return "{$this->key}={$this->comparitor}"; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/Operators/LogicalAndOp.php b/vendor/consolidation/filter-via-dot-access-data/src/Operators/LogicalAndOp.php new file mode 100644 index 0000000000000000000000000000000000000000..102388618442f500e7d6df368b74c265d0325607 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/Operators/LogicalAndOp.php @@ -0,0 +1,39 @@ +<?php +namespace Consolidation\Filter\Operators; + +use Consolidation\Filter\OperatorInterface; +use Dflydev\DotAccessData\Data; + +/** + * Test for equality + */ +class LogicalAndOp implements OperatorInterface +{ + protected $lhs; + protected $rhs; + + public function __construct($lhs, $rhs) + { + $this->lhs = $lhs; + $this->rhs = $rhs; + } + + /** + * Test the provided value to see if it matches our criteria. + * + * @param mixed $value + * @return bool + */ + public function test(Data $row) + { + return $this->lhs->test($row) && $this->rhs->test($row); + } + + /** + * Return a string representation of this operator + */ + public function __toString() + { + return "{$this->lhs}&&{$this->rhs}"; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/Operators/LogicalOrOp.php b/vendor/consolidation/filter-via-dot-access-data/src/Operators/LogicalOrOp.php new file mode 100644 index 0000000000000000000000000000000000000000..8c1d79c62b9cdec983cad58fd18e028def45a6bd --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/Operators/LogicalOrOp.php @@ -0,0 +1,39 @@ +<?php +namespace Consolidation\Filter\Operators; + +use Consolidation\Filter\OperatorInterface; +use Dflydev\DotAccessData\Data; + +/** + * Test for equality + */ +class LogicalOrOp implements OperatorInterface +{ + protected $lhs; + protected $rhs; + + public function __construct($lhs, $rhs) + { + $this->lhs = $lhs; + $this->rhs = $rhs; + } + + /** + * Test the provided value to see if it matches our criteria. + * + * @param mixed $value + * @return bool + */ + public function test(Data $row) + { + return $this->lhs->test($row) || $this->rhs->test($row); + } + + /** + * Return a string representation of this operator + */ + public function __toString() + { + return "{$this->lhs}||{$this->rhs}"; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/Operators/NotOp.php b/vendor/consolidation/filter-via-dot-access-data/src/Operators/NotOp.php new file mode 100644 index 0000000000000000000000000000000000000000..da3d64440d645eda03be9452726ab2ba0e3ac9b9 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/Operators/NotOp.php @@ -0,0 +1,37 @@ +<?php +namespace Consolidation\Filter\Operators; + +use Consolidation\Filter\OperatorInterface; +use Dflydev\DotAccessData\Data; + +/** + * Test for equality + */ +class NotOp implements OperatorInterface +{ + protected $op; + + public function __construct($op) + { + $this->op = $op; + } + + /** + * Test the provided value to see if it matches our criteria. + * + * @param mixed $value + * @return bool + */ + public function test(Data $row) + { + return !$this->op->test($row); + } + + /** + * Return a string representation of this operator + */ + public function __toString() + { + return "!{$this->op}"; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/src/Operators/RegexOp.php b/vendor/consolidation/filter-via-dot-access-data/src/Operators/RegexOp.php new file mode 100644 index 0000000000000000000000000000000000000000..3db9672c8dd877de7f206d881bbb3969416d4f3a --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/src/Operators/RegexOp.php @@ -0,0 +1,40 @@ +<?php +namespace Consolidation\Filter\Operators; + +use Consolidation\Filter\OperatorInterface; +use Dflydev\DotAccessData\Data; + +/** + * Test for equality + */ +class RegexOp implements OperatorInterface +{ + protected $key; + protected $comparitor; + + public function __construct($key, $comparitor) + { + $this->key = $key; + $this->comparitor = $comparitor; + } + + /** + * Test the provided value to see if it matches our criteria. + * + * @param mixed $value + * @return bool + */ + public function test(Data $row) + { + $value = $row->get($this->key); + return preg_match($this->comparitor, $value); + } + + /** + * Return a string representation of this operator + */ + public function __toString() + { + return "{$this->key}~={$this->comparitor}"; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/tests/FactoryTest.php b/vendor/consolidation/filter-via-dot-access-data/tests/FactoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f1dd42f009e129fd65ace922331afe16e9e54609 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/tests/FactoryTest.php @@ -0,0 +1,134 @@ +<?php + +namespace Consolidation\Filter; + +use PHPUnit\Framework\TestCase; +use Dflydev\DotAccessData\Data; + +class FactoryTest extends TestCase +{ + protected $factory; + + public function setUp() + { + $this->factory = LogicalOpFactory::get(); + } + + /** + * Data provider for testFactoryParsing. + * + * Return an array of arrays, each of which contains the parameter + * values to be used in one invocation of the testExample test function. + */ + public function testFactoryParsingValues() + { + return [ + ['a=b',], + ['a*=b',], + ['a~=#b#',], + ['!a=b',], + ['!a*=b',], + ['!a~=#b#',], + ['a!=b', '!a=b',], + ['a!*=b', '!a*=b',], + ['a!~=#b#', '!a~=#b#',], + + ['a=b&&c=d',], + ['a*=b||c=d',], + ['a~=#b#&&c~=d',], + ['!a=b||!c=d',], + ['!a*=b&&c*=d',], + ['!a~=#b#&&c=d',], + ['a!=b&&c!=d', '!a=b&&!c=d',], + ['a!*=b||c!*=d', '!a*=b||!c*=d',], + ['a!~=#b#&&c!~=#d#', '!a~=#b#&&!c~=#d#',], + + ['a=b&&c=d&&e=f',], + ['a=b||c=d&&e=f',], + ['a=b||c=d||e=f',], + + ]; + } + + /** + * Test our example class. Each time this function is called, it will + * be passed data from the data provider function idendified by the + * dataProvider annotation. + * + * @dataProvider testFactoryParsingValues + */ + public function testFactoryParsing($expr, $expected = false) + { + // The expected value is often the source value + if ($expected === false) { + $expected = $expr; + } + $op = $this->factory->evaluate($expr); + $this->assertEquals($expected, (string)$op); + } + + /** + * Data provider for testFactoryEvaluation. + * + * Return an array of arrays, each of which contains the parameter + * values to be used in one invocation of the testExample test function. + */ + public function testFactoryEvaluationValues() + { + return [ + ['a=b', ['a' => 'b'], true,], + ['a=b', ['a' => 'abc'], false,], + ['a=b', ['b' => 'b'], false,], + + ['a*=b', ['a' => 'b'], true,], + ['a*=b', ['a' => 'abc'], true,], + ['a*=b', ['b' => 'b'], false,], + + ['a~=#b#', ['a' => 'b'], true,], + ['a~=#b#', ['a' => 'abc'], true,], + ['a~=#b#', ['b' => 'b'], false,], + + ['a.b=c', ['a' => ['b' => 'c']], true,], + ['a.b=c', ['a' => ['b' => 'abcd']], false,], + ['a.b=c', ['b' => ['b' => 'c']], false,], + + ['a.b*=c', ['a' => ['b' => 'c']], true,], + ['a.b*=c', ['a' => ['b' => 'abcd']], true,], + ['a.b*=c', ['b' => ['b' => 'c']], false,], + + ['a.b~=#c#', ['a' => ['b' => 'c']], true,], + ['a.b~=#c#', ['a' => ['b' => 'abcd']], true,], + ['a.b~=#c#', ['b' => ['b' => 'c']], false,], + + ['a=b&&c=d', ['a' => 'b', 'c' => 'd'], true,], + ['a=b&&c=d', ['a' => 'b', 'c' => 'xd'], false,], + ['a=b||c=d', ['a' => 'b', 'c' => 'xd'], true,], + + ['a*=b&&c*=d', ['a' => 'b', 'c' => 'd'], true,], + ['a*=b&&c*=d', ['a' => 'b', 'c' => 'xd'], true,], + ['a*=b&&c*=d', ['a' => 'b', 'c' => 'xy'], false,], + ['a*=b||c*=d', ['a' => 'b', 'c' => 'xd'], true,], + ['a*=b||c*=d', ['a' => 'xb', 'c' => 'xd'], true,], + ['a*=b||c*=d', ['a' => 'xy', 'c' => 'xy'], false,], + + ['a!=b', ['a' => 'b'], false,], + ['a!=b', ['a' => 'abc'], true,], + ['!a=b', ['b' => 'b'], true,], + + ]; + } + + /** + * Test our example class. Each time this function is called, it will + * be passed data from the data provider function idendified by the + * dataProvider annotation. + * + * @dataProvider testFactoryEvaluationValues + */ + public function testFactoryEvaluation($expr, $source, $expected) + { + $op = $this->factory->evaluate($expr); + $data = new Data($source); + $this->assertEquals($expected, $op->test($data)); + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/tests/FilterOutputDataTest.php b/vendor/consolidation/filter-via-dot-access-data/tests/FilterOutputDataTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5ad683e7d11d9c05f01c50efc988296d4bf7cd09 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/tests/FilterOutputDataTest.php @@ -0,0 +1,53 @@ +<?php + +namespace Consolidation\Filter; + +use PHPUnit\Framework\TestCase; +use Dflydev\DotAccessData\Data; + +class FilterOutputDataTest extends TestCase +{ + protected $factory; + protected $filter; + + public function setUp() + { + $this->factory = LogicalOpFactory::get(); + $this->filter = new FilterOutputData(); + } + + /** + * Data provider for testFilterData. + * + * Return an array of arrays, each of which contains the parameter + * values to be used in one invocation of the testExample test function. + */ + public function testFilterDataValues() + { + $source = [ + 'a' => ['color' => 'red', 'shape' => 'round', ], + 'b' => ['color' => 'blue', 'shape' => 'square', ], + 'c' => ['color' => 'green', 'shape' => 'triangular', ], + ]; + + return [ + [$source, 'color=red', 'a', ], + [$source, 'color=blue||shape=triangular', 'b,c', ], + [$source, 'color=red&&shape=square', '', ], + ]; + } + + /** + * Test our example class. Each time this function is called, it will + * be passed data from the data provider function idendified by the + * dataProvider annotation. + * + * @dataProvider testFilterDataValues + */ + public function testFilterData($source, $expr, $expected) + { + $op = $this->factory->evaluate($expr); + $actual = $this->filter->filter($source, $op); + $this->assertEquals($expected, implode(',', array_keys($actual))); + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/tests/OpCommandsTest.php b/vendor/consolidation/filter-via-dot-access-data/tests/OpCommandsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a0731c8eeefc1b6d1fe63c4301b4f41ea97dd323 --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/tests/OpCommandsTest.php @@ -0,0 +1,131 @@ +<?php + +namespace Consolidation\Filter; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Output\BufferedOutput; + +class OpCommandsTest extends TestCase +{ + /** @var string[] */ + protected $commandClasses; + + /** @var string */ + protected $appName; + + /** @var string */ + protected $appVersion; + + const STATUS_OK = 0; + const STATUS_ERROR = 1; + + /** + * Instantiate a new runner + */ + public function setUp() + { + // Store the command classes we are going to test + $this->commandClasses = [ \Consolidation\Filter\Cli\OpCommands::class, \Consolidation\Filter\Hooks\FilterHooks::class ]; + + // Define our invariants for our test + $this->appName = 'DotProcessFixtureApp'; + $this->appVersion = '1.0.1'; + } + + /** + * Data provider for testExample. + * + * Return an array of arrays, each of which contains the parameter + * values to be used in one invocation of the testExample test function. + */ + public function exampleTestCommandParameters() + { + return [ + + [ + 'a=b', self::STATUS_OK, + 'parse', 'a=b', + ], + + [ + '!a=b', self::STATUS_OK, + 'parse', 'a!=b', + ], + + [ + 'a=b&&c=d||x=y', self::STATUS_OK, + 'parse', 'a=b&&c=d||x=y', + ], + + [ + 'Could not parse expression a', self::STATUS_ERROR, + 'parse', 'a&&b', + ], + + [ + 'a: + color: red + shape: round', self::STATUS_OK, + 'edit', 'tests/fixtures/data.yml', '--filter=color=red', + ], + + [ + 'b: + color: blue + shape: square', self::STATUS_OK, + 'edit', 'tests/fixtures/data.yml', '--filter=blue', + ], + + ]; + } + + /** + * Test our example class. Each time this function is called, it will + * be passed data from the data provider function idendified by the + * dataProvider annotation. + * + * @dataProvider exampleTestCommandParameters + */ + public function testExampleCommands($expectedOutput, $expectedStatus, $variable_args) + { + // Create our argv array and run the command + $argv = $this->argv(func_get_args()); + list($actualOutput, $statusCode) = $this->execute($argv); + + // Confirm that our output and status code match expectations + $this->assertContains($expectedOutput, $actualOutput); + $this->assertEquals($expectedStatus, $statusCode); + } + + /** + * Prepare our $argv array; put the app name in $argv[0] followed by + * the command name and all command arguments and options. + */ + protected function argv($functionParameters) + { + $argv = $functionParameters; + array_shift($argv); + array_shift($argv); + array_unshift($argv, $this->appName); + + return $argv; + } + + /** + * Simulated front controller + */ + protected function execute($argv) + { + // Define a global output object to capture the test results + $output = new BufferedOutput(); + + // We can only call `Runner::execute()` once; then we need to tear down. + $runner = new \Robo\Runner($this->commandClasses); + $statusCode = $runner->execute($argv, $this->appName, $this->appVersion, $output); + \Robo\Robo::unsetContainer(); + + // Return the output and status code. + $actualOutput = trim($output->fetch()); + return [$actualOutput, $statusCode]; + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/tests/OpTest.php b/vendor/consolidation/filter-via-dot-access-data/tests/OpTest.php new file mode 100644 index 0000000000000000000000000000000000000000..86a58aab1dfb42d1239399328325d800ad022d2a --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/tests/OpTest.php @@ -0,0 +1,87 @@ +<?php + +namespace Consolidation\Filter; + +use PHPUnit\Framework\TestCase; +use Dflydev\DotAccessData\Data; + +class OpTest extends TestCase +{ + /** + * Data provider for testOpsParsing. + * + * Return an array of arrays, each of which contains the parameter + * values to be used in one invocation of the testExample test function. + */ + public function testOpsParsingValues() + { + return [ + [\Consolidation\Filter\Operators\EqualsOp::class, 'a', 'b', 'a=b',], + [\Consolidation\Filter\Operators\ContainsOp::class, 'a', 'b', 'a*=b',], + [\Consolidation\Filter\Operators\RegexOp::class, 'a', '#b#', 'a~=#b#',], + ]; + } + + /** + * Test our example class. Each time this function is called, it will + * be passed data from the data provider function idendified by the + * dataProvider annotation. + * + * @dataProvider testOpsParsingValues + */ + public function testOpsParsing($opName, $key, $comparitor, $expected) + { + $op = new $opName($key, $comparitor); + $this->assertEquals($expected, (string)$op); + } + + /** + * Data provider for testOpsEvaluation. + * + * Return an array of arrays, each of which contains the parameter + * values to be used in one invocation of the testExample test function. + */ + public function testOpsEvaluationValues() + { + return [ + [\Consolidation\Filter\Operators\EqualsOp::class, 'a', 'b', ['a' => 'b'], true,], + [\Consolidation\Filter\Operators\EqualsOp::class, 'a', 'b', ['a' => 'abc'], false,], + [\Consolidation\Filter\Operators\EqualsOp::class, 'a', 'b', ['b' => 'b'], false,], + + [\Consolidation\Filter\Operators\ContainsOp::class, 'a', 'b', ['a' => 'b'], true,], + [\Consolidation\Filter\Operators\ContainsOp::class, 'a', 'b', ['a' => 'abc'], true,], + [\Consolidation\Filter\Operators\ContainsOp::class, 'a', 'b', ['b' => 'b'], false,], + + [\Consolidation\Filter\Operators\RegexOp::class, 'a', '#b#', ['a' => 'b'], true,], + [\Consolidation\Filter\Operators\RegexOp::class, 'a', '#b#', ['a' => 'abc'], true,], + [\Consolidation\Filter\Operators\RegexOp::class, 'a', '#b#', ['b' => 'b'], false,], + + [\Consolidation\Filter\Operators\EqualsOp::class, 'a.b', 'c', ['a' => ['b' => 'c']], true,], + [\Consolidation\Filter\Operators\EqualsOp::class, 'a.b', 'c', ['a' => ['b' => 'abcd']], false,], + [\Consolidation\Filter\Operators\EqualsOp::class, 'a.b', 'c', ['b' => ['b' => 'c']], false,], + + [\Consolidation\Filter\Operators\ContainsOp::class, 'a.b', 'c', ['a' => ['b' => 'c']], true,], + [\Consolidation\Filter\Operators\ContainsOp::class, 'a.b', 'c', ['a' => ['b' => 'abcd']], true,], + [\Consolidation\Filter\Operators\ContainsOp::class, 'a.b', 'c', ['b' => ['b' => 'c']], false,], + + [\Consolidation\Filter\Operators\RegexOp::class, 'a.b', '#c#', ['a' => ['b' => 'c']], true,], + [\Consolidation\Filter\Operators\RegexOp::class, 'a.b', '#c#', ['a' => ['b' => 'abcd']], true,], + [\Consolidation\Filter\Operators\RegexOp::class, 'a.b', '#c#', ['b' => ['b' => 'c']], false,], + + ]; + } + + /** + * Test our example class. Each time this function is called, it will + * be passed data from the data provider function idendified by the + * dataProvider annotation. + * + * @dataProvider testOpsEvaluationValues + */ + public function testOpsEvaluation($opName, $key, $comparitor, $source, $expected) + { + $op = new $opName($key, $comparitor); + $data = new Data($source); + $this->assertEquals($expected, $op->test($data)); + } +} diff --git a/vendor/consolidation/filter-via-dot-access-data/tests/fixtures/data.yml b/vendor/consolidation/filter-via-dot-access-data/tests/fixtures/data.yml new file mode 100644 index 0000000000000000000000000000000000000000..4e5301f3399e887ed72b91d35c556e20bfa2e6ba --- /dev/null +++ b/vendor/consolidation/filter-via-dot-access-data/tests/fixtures/data.yml @@ -0,0 +1,9 @@ +a: + color: red + shape: round +b: + color: blue + shape: square +c: + color: green + shape: triangular diff --git a/vendor/consolidation/log/.editorconfig b/vendor/consolidation/log/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..095771e673c86f27e8c8224b6de6437fbe793e4f --- /dev/null +++ b/vendor/consolidation/log/.editorconfig @@ -0,0 +1,15 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[**.php] +indent_style = space +indent_size = 4 + diff --git a/vendor/consolidation/log/.gitignore b/vendor/consolidation/log/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8d609f1910e6393ba80a6016c813dca10ac31ffa --- /dev/null +++ b/vendor/consolidation/log/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +vendor +build +dependencies/*/vendor diff --git a/vendor/consolidation/log/.scenarios.lock/install b/vendor/consolidation/log/.scenarios.lock/install new file mode 100755 index 0000000000000000000000000000000000000000..16c69e107cce7f71e33e04207254d005200f9fd4 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/install @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff --git a/vendor/consolidation/log/.scenarios.lock/phpunit4/.gitignore b/vendor/consolidation/log/.scenarios.lock/phpunit4/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/phpunit4/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/log/.scenarios.lock/phpunit4/composer.json b/vendor/consolidation/log/.scenarios.lock/phpunit4/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..36656fdbee9a0a01f40106c68d21e45d0cfd3089 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/phpunit4/composer.json @@ -0,0 +1,59 @@ +{ + "name": "consolidation/log", + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "../../tests/src" + } + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36", + "g1a/composer-test-scenarios": "^3", + "squizlabs/php_codesniffer": "^2" + }, + "minimum-stability": "stable", + "scripts": { + "cs": "phpcs -n --standard=PSR2 src", + "cbf": "phpcbf -n --standard=PSR2 src", + "unit": "phpunit", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "config": { + "platform": { + "php": "5.4.8" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + } +} diff --git a/vendor/consolidation/log/.scenarios.lock/phpunit4/composer.lock b/vendor/consolidation/log/.scenarios.lock/phpunit4/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..906c62553d48a849428ffdd98e405b66ad8143ff --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/phpunit4/composer.lock @@ -0,0 +1,1400 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "97e24b2269f52d961357d35073057c1d", + "packages": [ + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.49", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-11-20T15:55:20+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.49", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + } + ], + "packages-dev": [ + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "224531e20d13a07942a989a70759f726cd2df9a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/224531e20d13a07942a989a70759f726cd2df9a1", + "reference": "224531e20d13a07942a989a70759f726cd2df9a1", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-27T05:58:39+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "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": "2016-01-25T08:17:30+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "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-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "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.2.2", + "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": "2017-06-21T08:07:12+00:00" + }, + { + "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-02T06:51:40+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "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": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "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": "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": "2016-06-17T09:04:28+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "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": "2016-10-03T07:41:43+00:00" + }, + { + "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-21T13:59:46+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.49", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b", + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T11:18:13+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.5" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.4.8" + } +} diff --git a/vendor/consolidation/log/.scenarios.lock/symfony2/.gitignore b/vendor/consolidation/log/.scenarios.lock/symfony2/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony2/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/log/.scenarios.lock/symfony2/composer.json b/vendor/consolidation/log/.scenarios.lock/symfony2/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..798de23b6686690181466c15b303b11a856594f9 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony2/composer.json @@ -0,0 +1,59 @@ +{ + "name": "consolidation/log", + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "../../tests/src" + } + }, + "require": { + "symfony/console": "^2.8", + "php": ">=5.4.5", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36", + "g1a/composer-test-scenarios": "^3", + "squizlabs/php_codesniffer": "^2" + }, + "minimum-stability": "stable", + "scripts": { + "cs": "phpcs -n --standard=PSR2 src", + "cbf": "phpcbf -n --standard=PSR2 src", + "unit": "phpunit", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "config": { + "platform": { + "php": "5.4.8" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + } +} diff --git a/vendor/consolidation/log/.scenarios.lock/symfony2/composer.lock b/vendor/consolidation/log/.scenarios.lock/symfony2/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..2880c843414ff886b55cb0980d1f1f4b3ca25edb --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony2/composer.lock @@ -0,0 +1,1400 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "37f310dc1c6bdc40e1048349aef71467", + "packages": [ + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.49", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-11-20T15:55:20+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.49", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + } + ], + "packages-dev": [ + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "224531e20d13a07942a989a70759f726cd2df9a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/224531e20d13a07942a989a70759f726cd2df9a1", + "reference": "224531e20d13a07942a989a70759f726cd2df9a1", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-27T05:58:39+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "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": "2016-01-25T08:17:30+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "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-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "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.2.2", + "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": "2017-06-21T08:07:12+00:00" + }, + { + "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-02T06:51:40+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "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": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "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": "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": "2016-06-17T09:04:28+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "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": "2016-10-03T07:41:43+00:00" + }, + { + "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-21T13:59:46+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.49", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b", + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T11:18:13+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.5" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.4.8" + } +} diff --git a/vendor/consolidation/log/.scenarios.lock/symfony2/src b/vendor/consolidation/log/.scenarios.lock/symfony2/src new file mode 120000 index 0000000000000000000000000000000000000000..929cb3dc9ba04d657e86ebde2d29661b78bdd85c --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony2/src @@ -0,0 +1 @@ +../../src \ No newline at end of file diff --git a/vendor/consolidation/log/.scenarios.lock/symfony2/tests b/vendor/consolidation/log/.scenarios.lock/symfony2/tests new file mode 120000 index 0000000000000000000000000000000000000000..c2ebfe530b4e16023832427b3134004e19542bd6 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony2/tests @@ -0,0 +1 @@ +../../tests \ No newline at end of file diff --git a/vendor/consolidation/log/.scenarios.lock/symfony4/.gitignore b/vendor/consolidation/log/.scenarios.lock/symfony4/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony4/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/log/.scenarios.lock/symfony4/composer.json b/vendor/consolidation/log/.scenarios.lock/symfony4/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..aaa666985adc27b346f4ff4ce14d0e5e86460d69 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony4/composer.json @@ -0,0 +1,60 @@ +{ + "name": "consolidation/log", + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "../../tests/src" + } + }, + "require": { + "symfony/console": "^4.0", + "php": ">=5.4.5", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^6", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "squizlabs/php_codesniffer": "^2" + }, + "minimum-stability": "stable", + "scripts": { + "cs": "phpcs -n --standard=PSR2 src", + "cbf": "phpcbf -n --standard=PSR2 src", + "unit": "phpunit", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "config": { + "platform": { + "php": "7.1.3" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + } +} diff --git a/vendor/consolidation/log/.scenarios.lock/symfony4/composer.lock b/vendor/consolidation/log/.scenarios.lock/symfony4/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..76d6632544bdfc52e259be2fbf05e2ce93fe67b0 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony4/composer.lock @@ -0,0 +1,2355 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "5643ded858bacea7c5860071008675f9", + "packages": [ + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "symfony/console", + "version": "v4.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/4dff24e5d01e713818805c1862d2e3f901ee7dd0", + "reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-11-27T07:40:44+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "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": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.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": "2017-07-22T11:58:36+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "224531e20d13a07942a989a70759f726cd2df9a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/224531e20d13a07942a989a70759f726cd2df9a1", + "reference": "224531e20d13a07942a989a70759f726cd2df9a1", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-27T05:58:39+00:00" + }, + { + "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" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "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" + ], + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "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": "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)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.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", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.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": "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": "2018-04-06T15:36:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.13", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.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": "2018-09-08T15:10:43+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.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": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "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" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "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": "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": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "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": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "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/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "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/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "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": "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": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v4.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "005d9a083d03f588677d15391a716b1ac9b887c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/005d9a083d03f588677d15391a716b1ac9b887c0", + "reference": "005d9a083d03f588677d15391a716b1ac9b887c0", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-11-30T22:21:14+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.49", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-11-21T14:20:20+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710", + "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T19:52:12+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "ec076716412274e51f8a7ea675d9515e5c311123" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/ec076716412274e51f8a7ea675d9515e5c311123", + "reference": "ec076716412274e51f8a7ea675d9515e5c311123", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T19:52:12+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "c41175c801e3edfda90f32e292619d10c27103d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c41175c801e3edfda90f32e292619d10c27103d7", + "reference": "c41175c801e3edfda90f32e292619d10c27103d7", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T19:52:12+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.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", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.5" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.1.3" + } +} diff --git a/vendor/consolidation/log/.scenarios.lock/symfony4/src b/vendor/consolidation/log/.scenarios.lock/symfony4/src new file mode 120000 index 0000000000000000000000000000000000000000..929cb3dc9ba04d657e86ebde2d29661b78bdd85c --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony4/src @@ -0,0 +1 @@ +../../src \ No newline at end of file diff --git a/vendor/consolidation/log/.scenarios.lock/symfony4/tests b/vendor/consolidation/log/.scenarios.lock/symfony4/tests new file mode 120000 index 0000000000000000000000000000000000000000..c2ebfe530b4e16023832427b3134004e19542bd6 --- /dev/null +++ b/vendor/consolidation/log/.scenarios.lock/symfony4/tests @@ -0,0 +1 @@ +../../tests \ No newline at end of file diff --git a/vendor/consolidation/log/.travis.yml b/vendor/consolidation/log/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..1459fa5dcd9c2928be6f0802ebc720be6d397338 --- /dev/null +++ b/vendor/consolidation/log/.travis.yml @@ -0,0 +1,39 @@ +language: php + +branches: + # Only test the master branch and SemVer tags. + only: + - master + - /^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+.*$/ + +matrix: + include: + - php: 7.2 + env: 'SCENARIO=symfony4 DEPENDENCIES=highest' + - php: 7.1 + env: 'SCENARIO=symfony4' + - php: 7.0 + env: 'DEPENDENCIES=highest' + - php: 7.0 + - php: 5.6 + env: 'SCENARIO=phpunit4' + - php: 5.5 + env: 'SCENARIO=phpunit4' + - php: 5.4 + env: 'SCENARIO=symfony2 DEPENDENCIES=lowest' + +sudo: false + +cache: + directories: + - vendor + - $HOME/.composer/cache + +install: + - '.scenarios.lock/install "${SCENARIO}" "${DEPENDENCIES}"' + +script: + - composer test + +after_success: + - 'travis_retry php vendor/bin/php-coveralls -v' diff --git a/vendor/consolidation/log/CHANGELOG.md b/vendor/consolidation/log/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..f247ace873283b2be3338b81bb483c941138d86a --- /dev/null +++ b/vendor/consolidation/log/CHANGELOG.md @@ -0,0 +1,35 @@ +# Change Log + +### 1.1.1: 2019-1-1 + +- Allow logger manager to manage a global style for loggers (#12) + +### 1.1.0: 2018-12-29 + +- Add a logger manager (#11) +- Update to Composer Test Scenarios 3 (#10) + +### 1.0.6: 2018-05-25 + +- Use g1a/composer-test-scenarios (#9) + +### 1.0.5: 2017-11-28 + +- Test Symfony version 2, 3 and 4 with different versions of php. (#5) + +### 1.0.4: 2017-11-18 + +- Support for Symfony 4 by Tobias Nyholm (#4) + +### 1.0.3: 2016-03-23 + +- Split up the log() method a bit. +- Run code sniffer prior to running tests to ensure PSR-2 compliance. + +### 1.0.2: 2016-03-22 + +- Remove unused components accidentally left in composer.json. + +### 1.0.1: 2016-03-19 + +- Add a license file. diff --git a/vendor/consolidation/log/CONTRIBUTING.md b/vendor/consolidation/log/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..1bbf57361043aa03b4f3dd5221f5e8b6aa78b58d --- /dev/null +++ b/vendor/consolidation/log/CONTRIBUTING.md @@ -0,0 +1,25 @@ +# Contributing to Consolidation + +Thank you for your interest in contributing to the Consolidation effort! Consolidation aims to provide reusable, loosely-coupled components useful for building command-line tools. Consolidation is built on top of Symfony Console, but aims to separate the tool from the implementation details of Symfony. + +Here are some of the guidelines you should follow to make the most of your efforts: + +## Code Style Guidelines + +Consolidation adheres to the [PSR-2 Coding Style Guide](http://www.php-fig.org/psr/psr-2/) for PHP code. + +## Pull Request Guidelines + +Every pull request is run through: + + - phpcs -n --standard=PSR2 src + - phpunit + - [Scrutinizer](https://scrutinizer-ci.com/g/consolidation-org/log/) + +It is easy to run the unit tests and code sniffer locally; simply ensure that `./vendor/bin` is in your `$PATH`, cd to the root of the project directory, and run `phpcs` and `phpunit` as shown above. To automatically fix coding standard errors, run: + + - phpcbf --standard=PSR2 src + +After submitting a pull request, please examine the Scrutinizer report. It is not required to fix all Scrutinizer issues; you may ignore recommendations that you disagree with. The spacing patches produced by Scrutinizer do not conform to PSR2 standards, and therefore should never be applied. DocBlock patches may be applied at your discression. Things that Scrutinizer identifies as a bug nearly always needs to be addressed. + +Pull requests must pass phpcs and phpunit in order to be merged; ideally, new functionality will also include new unit tests. diff --git a/vendor/consolidation/log/LICENSE b/vendor/consolidation/log/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..dfcef0282e43cdd89d582eba951b9b957a77561d --- /dev/null +++ b/vendor/consolidation/log/LICENSE @@ -0,0 +1,16 @@ +Copyright (c) 2016-2018 Consolidation Org Developers + + +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. + +DEPENDENCY LICENSES: + +Name Version License +psr/log 1.1.0 MIT +symfony/console v2.8.49 MIT +symfony/debug v2.8.49 MIT +symfony/polyfill-mbstring v1.10.0 MIT \ No newline at end of file diff --git a/vendor/consolidation/log/README.md b/vendor/consolidation/log/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ecc8cf3499d9786a40cd6c1a3613aea8320d278a --- /dev/null +++ b/vendor/consolidation/log/README.md @@ -0,0 +1,42 @@ +# Consolidation\Log + +Improved [PSR-3](http://www.php-fig.org/psr/psr-3/) [Psr\Log](https://github.com/php-fig/log) logger based on Symfony Console components. + +[](https://travis-ci.org/consolidation/log) [](https://scrutinizer-ci.com/g/consolidation/log/?branch=master) [](https://coveralls.io/github/consolidation/log?branch=master) [](https://packagist.org/packages/consolidation/log) + +## Component Status + +In use in [Robo](https://github.com/Codegyre/Robo). + +## Motivation + +Consolidation\Log provides a PSR-3 compatible logger that provides styled log output to the standard error (stderr) stream. By default, styling is provided by the SymfonyStyle class from the Symfony Console component; however, alternative stylers may be provided if desired. + +## Usage +``` +$logger = new \Consolidation\Log\Logger($output); +$logger->setLogOutputStyler(new LogOutputStyler()); // optional +$logger->warning('The file {name} does not exist.', ['name' => $filename]); +``` +String interpolation -- that is, the substitution of replacements, such as `{name}` in the example above, is not required by PSR-3, and is not implemented by default in the Psr\Log project. However, it is recommended by PRS-3, and is often done, e.g. in the Symfony Console logger. + +Consolidation\Log supports string interpolation. + +A logger manager can be used to delegate all log messages to one or more loggers. +``` +$logger = new \Consolidation\Log\LoggerManager(); +$logger->add('default', new \Consolidation\Log\Logger($output)); +``` +This is useful if, for example, you need to inject a logger into application objects early (e.g. into a dependency injection container), but the output object to log to will not be available until later. + +## Comparison to Existing Solutions + +Many Symfony Console compoenents use SymfonyStyle to format their output messages. This helper class has methods named things like `success` and `warning`, making it seem like a natural choice for reporting status. + +However, in practice it is much more convenient to use an actual Psr-3 logger for logging. Doing this allows a Symfony Console component to call an external library that may not need to depend on Symfony Style. Having the Psr\Log\LoggerInterface serve as the only shared IO-related interface in common between the console tool and the libraries it depends on promots loose coupling, allowing said libraries to be re-used in other contexts which may wish to log in different ways. + +Symfony Console provides the ConsoleLogger to fill this need; however, ConsoleLogger does not provide any facility for styling output, leaving SymfonyStyle as the preferred logging mechanism for style-conscienscious console coders. + +Consolidation\Log provides the benefits of both classes, allowing for code that both behaved technically correctly (redirecting to stderr) without sacrificing on style. + +Monlog also provides a full-featured Console logger that might be applicable for some use cases. diff --git a/vendor/consolidation/log/composer.json b/vendor/consolidation/log/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..708e6d97bf877da055ed8c8c01f828c016d6cb25 --- /dev/null +++ b/vendor/consolidation/log/composer.json @@ -0,0 +1,100 @@ +{ + "name": "consolidation/log", + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload":{ + "psr-4":{ + "Consolidation\\Log\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "tests/src" + } + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "phpunit/phpunit": "^6", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "squizlabs/php_codesniffer": "^2" + }, + "minimum-stability": "stable", + "scripts": { + "cs": "phpcs -n --standard=PSR2 src", + "cbf": "phpcbf -n --standard=PSR2 src", + "unit": "phpunit", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "7.0.8" + } + } +} diff --git a/vendor/consolidation/log/composer.lock b/vendor/consolidation/log/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..45b0a32d9577ce6a5a740846ec4e6548a4995fcb --- /dev/null +++ b/vendor/consolidation/log/composer.lock @@ -0,0 +1,2340 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "c49e4b63e4960c38c6bf13a0929eff93", + "packages": [ + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb", + "reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "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" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-11-26T12:48:07+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "a2233f555ddf55e5600f386fba7781cea1cb82d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/a2233f555ddf55e5600f386fba7781cea1cb82d3", + "reference": "a2233f555ddf55e5600f386fba7781cea1cb82d3", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-11-27T12:43:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + } + ], + "packages-dev": [ + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "224531e20d13a07942a989a70759f726cd2df9a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/224531e20d13a07942a989a70759f726cd2df9a1", + "reference": "224531e20d13a07942a989a70759f726cd2df9a1", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-27T05:58:39+00:00" + }, + { + "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" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "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": "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)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.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", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.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": "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": "2018-04-06T15:36:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.13", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.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": "2018-09-08T15:10:43+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.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": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "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" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "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": "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": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "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": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "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/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "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/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "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": "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": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "8a660daeb65dedbe0b099529f65e61866c055081" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/8a660daeb65dedbe0b099529f65e61866c055081", + "reference": "8a660daeb65dedbe0b099529f65e61866c055081", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "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" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-11-26T10:17:44+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.49", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-11-21T14:20:20+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b49b1ca166bd109900e6a1683d9bb1115727ef2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b49b1ca166bd109900e6a1683d9bb1115727ef2d", + "reference": "b49b1ca166bd109900e6a1683d9bb1115727ef2d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T19:48:54+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v3.4.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "0f43969ab2718de55c1c1158dce046668079788d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/0f43969ab2718de55c1c1158dce046668079788d", + "reference": "0f43969ab2718de55c1c1158dce046668079788d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T19:48:54+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "291e13d808bec481eab83f301f7bff3e699ef603" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/291e13d808bec481eab83f301f7bff3e699ef603", + "reference": "291e13d808bec481eab83f301f7bff3e699ef603", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T19:48:54+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.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", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.5" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.0.8" + } +} diff --git a/vendor/consolidation/log/phpunit.xml.dist b/vendor/consolidation/log/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..2820535a6602b17a4b421c701be2587d94078f9d --- /dev/null +++ b/vendor/consolidation/log/phpunit.xml.dist @@ -0,0 +1,15 @@ +<phpunit bootstrap="vendor/autoload.php" colors="true"> + <testsuites> + <testsuite name="log"> + <directory suffix="Tests.php">tests</directory> + </testsuite> + </testsuites> + <logging> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">src</directory> + </whitelist> + </filter> +</phpunit> diff --git a/vendor/consolidation/log/src/ConsoleLogLevel.php b/vendor/consolidation/log/src/ConsoleLogLevel.php new file mode 100644 index 0000000000000000000000000000000000000000..013e9737b9494e9d0d515065cff0017704ca5e62 --- /dev/null +++ b/vendor/consolidation/log/src/ConsoleLogLevel.php @@ -0,0 +1,25 @@ +<?php +namespace Consolidation\Log; + +/** + * Additional log levels for use in Console applications. + * + * ConsoleLogLevels may be used by methods of Symfony Command + * in applications where it is known that the Consolidation logger + * is in use. These log levels provide access to the 'success' + * styled output method. Code in reusable libraries that may + * be used with a standard Psr-3 logger should aviod using these + * log levels. + * + * All ConsoleLogLevels should be interpreted as LogLevel\NOTICE. + * + * @author Greg Anderson <greg.1.anderson@greenknowe.org> + */ +class ConsoleLogLevel extends \Psr\Log\LogLevel +{ + /** + * Command successfully completed some operation. + * Displayed at VERBOSITY_NORMAL. + */ + const SUCCESS = 'success'; +} diff --git a/vendor/consolidation/log/src/LogOutputStyler.php b/vendor/consolidation/log/src/LogOutputStyler.php new file mode 100644 index 0000000000000000000000000000000000000000..5788215b572b2d3c73f1f5359b654f75840d5c69 --- /dev/null +++ b/vendor/consolidation/log/src/LogOutputStyler.php @@ -0,0 +1,115 @@ +<?php +namespace Consolidation\Log; + +use Psr\Log\LogLevel; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\OutputStyle; + +/** + * Styles log output based on format mappings provided in the constructor. + * + * Override for greater control. + */ +class LogOutputStyler extends UnstyledLogOutputStyler +{ + const TASK_STYLE_INFO = 'fg=white;bg=cyan;options=bold'; + const TASK_STYLE_SUCCESS = 'fg=white;bg=green;options=bold'; + const TASK_STYLE_WARNING = 'fg=black;bg=yellow;options=bold;'; + const TASK_STYLE_ERROR = 'fg=white;bg=red;options=bold'; + + protected $defaultStyles = [ + '*' => LogLevel::INFO, + ]; + protected $labelStyles = [ + LogLevel::EMERGENCY => self::TASK_STYLE_ERROR, + LogLevel::ALERT => self::TASK_STYLE_ERROR, + LogLevel::CRITICAL => self::TASK_STYLE_ERROR, + LogLevel::ERROR => self::TASK_STYLE_ERROR, + LogLevel::WARNING => self::TASK_STYLE_WARNING, + LogLevel::NOTICE => self::TASK_STYLE_INFO, + LogLevel::INFO => self::TASK_STYLE_INFO, + LogLevel::DEBUG => self::TASK_STYLE_INFO, + ConsoleLogLevel::SUCCESS => self::TASK_STYLE_SUCCESS, + ]; + protected $messageStyles = [ + LogLevel::EMERGENCY => self::TASK_STYLE_ERROR, + LogLevel::ALERT => self::TASK_STYLE_ERROR, + LogLevel::CRITICAL => self::TASK_STYLE_ERROR, + LogLevel::ERROR => self::TASK_STYLE_ERROR, + LogLevel::WARNING => '', + LogLevel::NOTICE => '', + LogLevel::INFO => '', + LogLevel::DEBUG => '', + ConsoleLogLevel::SUCCESS => '', + ]; + + public function __construct($labelStyles = [], $messageStyles = []) + { + $this->labelStyles = $labelStyles + $this->labelStyles; + $this->messageStyles = $messageStyles + $this->messageStyles; + } + + /** + * {@inheritdoc} + */ + public function defaultStyles() + { + return $this->defaultStyles; + } + + /** + * {@inheritdoc} + */ + public function style($context) + { + $context += ['_style' => []]; + $context['_style'] += $this->defaultStyles(); + foreach ($context as $key => $value) { + $styleKey = $key; + if (!isset($context['_style'][$styleKey])) { + $styleKey = '*'; + } + if (is_string($value) && isset($context['_style'][$styleKey])) { + $style = $context['_style'][$styleKey]; + $context[$key] = $this->wrapFormatString($context[$key], $style); + } + } + return $context; + } + + /** + * Wrap a string in a format element. + */ + protected function wrapFormatString($string, $style) + { + if ($style) { + return "<{$style}>$string</>"; + } + return $string; + } + + /** + * Look up the label and message styles for the specified log level, + * and use the log level as the label for the log message. + */ + protected function formatMessageByLevel($level, $message, $context) + { + $label = $level; + return $this->formatMessage($label, $message, $context, $this->labelStyles[$level], $this->messageStyles[$level]); + } + + /** + * Apply styling with the provided label and message styles. + */ + protected function formatMessage($label, $message, $context, $labelStyle, $messageStyle = '') + { + if (!empty($messageStyle)) { + $message = $this->wrapFormatString(" $message ", $messageStyle); + } + if (!empty($label)) { + $message = ' ' . $this->wrapFormatString("[$label]", $labelStyle) . ' ' . $message; + } + + return $message; + } +} diff --git a/vendor/consolidation/log/src/LogOutputStylerInterface.php b/vendor/consolidation/log/src/LogOutputStylerInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..ff2e420f082610495ddbec578f6911eca3828a34 --- /dev/null +++ b/vendor/consolidation/log/src/LogOutputStylerInterface.php @@ -0,0 +1,105 @@ +<?php +namespace Consolidation\Log; + +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Allow a log message to by styled. + * + * Styling happens in two phases: + * + * 1. Prior to message interpolation, context variables are styled + * via the 'style()' method, using styles provided in the context + * under the '_style' key, and also using styles provided by the + * 'defaultStyles()' method. + * + * @see Symfony\Component\Console\Logger\ConsoleLogger::interpolate() + * + * 2. After message interpolation, an appropriate method based on the + * log level will be called. StyledConsoleLogger::$formatFunctionMap + * is used to map the LogLevel to a LogOutputStylerInterface method to call. + * + * It is possible to select the exact class to use as the log styler + * in the constructor of StyledConsoleLogger, and the mapping from + * LogLevel to format function can also be extended. It is possible to + * add new format methods not defined here, if desired, so long as + * any method named in the format function map is implemented by the + * selected log styler class. + */ +interface LogOutputStylerInterface +{ + const STYLE_CONTEXT_KEY = '_style'; + + /** + * Return an array of default styles to use in an application. + * The key of the style is the variable name that the style + * should be applied to (or '*' to match all variables that have + * no specific style set), and the value is the contents of the + * Symfony style tag to wrap around the variable value. + * + * Example: + * message: 'Running {command}' + * context: ['command' => 'pwd'] + * default styles: ['*' => 'info'] + * result: 'Running <info>pwd</>' + */ + public function defaultStyles(); + + /** + * Apply styles specified in the STYLE_CONTEXT_KEY context variable to + * the other named variables stored in the context. The styles from + * the context are unioned with the default styles. + */ + public function style($context); + + /** + * Create a wrapper object for the output stream. If this styler + * does not require an output wrapper, it should just return + * its $output parameter. + */ + public function createOutputWrapper(OutputInterface $output); + + /** + * Print an ordinary log message, usually unstyled. + */ + public function log($output, $level, $message, $context); + + /** + * Print a success message. + */ + public function success($output, $level, $message, $context); + + /** + * Print an error message. Used when log level is: + * - LogLevel::EMERGENCY + * - LogLevel::ALERT + * - LogLevel::CRITICAL + * - LogLevel::ERROR + */ + public function error($output, $level, $message, $context); + + /** + * Print a warning message. Used when log level is: + * - LogLevel::WARNING + */ + public function warning($output, $level, $message, $context); + + /** + * Print a note. Similar to 'text', but may contain additional + * styling (e.g. the task name). Used when log level is: + * - LogLevel::NOTICE + * - LogLevel::INFO + * - LogLevel::DEBUG + * + * IMPORTANT: Symfony loggers only display LogLevel::NOTICE when the + * the verbosity level is VERBOSITY_VERBOSE, unless overridden in the + * constructor. Robo\Common\Logger emits LogLevel::NOTICE at + * VERBOSITY_NORMAL so that these messages will always be displayed. + */ + public function note($output, $level, $message, $context); + + /** + * Print an error message. Not used by default by StyledConsoleLogger. + */ + public function caution($output, $level, $message, $context); +} diff --git a/vendor/consolidation/log/src/Logger.php b/vendor/consolidation/log/src/Logger.php new file mode 100644 index 0000000000000000000000000000000000000000..9d3cf5affc87d5032270cb8d3bbb01ae85ce3c0c --- /dev/null +++ b/vendor/consolidation/log/src/Logger.php @@ -0,0 +1,268 @@ +<?php +namespace Consolidation\Log; + +use Psr\Log\AbstractLogger; +use Psr\Log\InvalidArgumentException; +use Psr\Log\LogLevel; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; + +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Console\Input\StringInput; + +/** + * Replacement for Symfony\Component\Console\Logger\ConsoleLogger. + * Each of the different log level messages are routed through the + * corresponding SymfonyStyle formatting method. Log messages are + * always sent to stderr if the provided output object implements + * ConsoleOutputInterface. + * + * Note that this class could extend ConsoleLogger if some methods + * of that class were declared 'protected' instead of 'private'. + * + * @author Greg Anderson <greg.1.anderson@greenknowe.org> + */ +class Logger extends AbstractLogger implements StylableLoggerInterface // extends ConsoleLogger +{ + /** + * @var OutputInterface + */ + protected $output; + /** + * @var OutputInterface + */ + protected $error; + /** + * @var LogOutputStylerInterface + */ + protected $outputStyler; + /** + * @var OutputInterface|SymfonyStyle|other + */ + protected $outputStreamWrapper; + protected $errorStreamWrapper; + + protected $formatFunctionMap = [ + LogLevel::EMERGENCY => 'error', + LogLevel::ALERT => 'error', + LogLevel::CRITICAL => 'error', + LogLevel::ERROR => 'error', + LogLevel::WARNING => 'warning', + LogLevel::NOTICE => 'note', + LogLevel::INFO => 'note', + LogLevel::DEBUG => 'note', + ConsoleLogLevel::SUCCESS => 'success', + ]; + + /** + * @param OutputInterface $output + * @param array $verbosityLevelMap + * @param array $formatLevelMap + * @param array $formatFunctionMap + */ + public function __construct(OutputInterface $output, array $verbosityLevelMap = array(), array $formatLevelMap = array(), array $formatFunctionMap = array()) + { + $this->output = $output; + + $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; + $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap; + $this->formatFunctionMap = $formatFunctionMap + $this->formatFunctionMap; + } + + public function setLogOutputStyler(LogOutputStylerInterface $outputStyler, array $formatFunctionMap = array()) + { + $this->outputStyler = $outputStyler; + $this->formatFunctionMap = $formatFunctionMap + $this->formatFunctionMap; + $this->outputStreamWrapper = null; + $this->errorStreamWrapper = null; + } + + public function getLogOutputStyler() + { + if (!isset($this->outputStyler)) { + $this->outputStyler = new SymfonyLogOutputStyler(); + } + return $this->outputStyler; + } + + protected function getOutputStream() + { + return $this->output; + } + + protected function getErrorStream() + { + if (!isset($this->error)) { + $output = $this->getOutputStream(); + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + $this->error = $output; + } + return $this->error; + } + + public function setOutputStream($output) + { + $this->output = $output; + $this->outputStreamWrapper = null; + } + + public function setErrorStream($error) + { + $this->error = $error; + $this->errorStreamWrapper = null; + } + + protected function getOutputStreamWrapper() + { + if (!isset($this->outputStreamWrapper)) { + $this->outputStreamWrapper = $this->getLogOutputStyler()->createOutputWrapper($this->getOutputStream()); + } + return $this->outputStreamWrapper; + } + + protected function getErrorStreamWrapper() + { + if (!isset($this->errorStreamWrapper)) { + $this->errorStreamWrapper = $this->getLogOutputStyler()->createOutputWrapper($this->getErrorStream()); + } + return $this->errorStreamWrapper; + } + + protected function getOutputStreamForLogLevel($level) + { + // Write to the error output if necessary and available. + // Usually, loggers that log to a terminal should send + // all log messages to stderr. + if (array_key_exists($level, $this->formatLevelMap) && ($this->formatLevelMap[$level] !== self::ERROR)) { + return $this->getOutputStreamWrapper(); + } + return $this->getErrorStreamWrapper(); + } + + /** + * {@inheritdoc} + */ + public function log($level, $message, array $context = array()) + { + // We use the '_level' context variable to allow log messages + // to be logged at one level (e.g. NOTICE) and formatted at another + // level (e.g. SUCCESS). This helps in instances where we want + // to style log messages at a custom log level that might not + // be available in all loggers. If the logger does not recognize + // the log level, then it is treated like the original log level. + if (array_key_exists('_level', $context) && array_key_exists($context['_level'], $this->verbosityLevelMap)) { + $level = $context['_level']; + } + // It is a runtime error if someone logs at a log level that + // we do not recognize. + if (!isset($this->verbosityLevelMap[$level])) { + throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); + } + + // Write to the error output if necessary and available. + // Usually, loggers that log to a terminal should send + // all log messages to stderr. + $outputStreamWrapper = $this->getOutputStreamForLogLevel($level); + + // Ignore messages that are not at the right verbosity level + if ($this->getOutputStream()->getVerbosity() >= $this->verbosityLevelMap[$level]) { + $this->doLog($outputStreamWrapper, $level, $message, $context); + } + } + + /** + * Interpolate and style the message, and then send it to the log. + */ + protected function doLog($outputStreamWrapper, $level, $message, $context) + { + $formatFunction = 'log'; + if (array_key_exists($level, $this->formatFunctionMap)) { + $formatFunction = $this->formatFunctionMap[$level]; + } + $interpolated = $this->interpolate( + $message, + $this->getLogOutputStyler()->style($context) + ); + $this->getLogOutputStyler()->$formatFunction( + $outputStreamWrapper, + $level, + $interpolated, + $context + ); + } + + public function success($message, array $context = array()) + { + $this->log(ConsoleLogLevel::SUCCESS, $message, $context); + } + + // The functions below could be eliminated if made `protected` intead + // of `private` in ConsoleLogger + + const INFO = 'info'; + const ERROR = 'error'; + + /** + * @var OutputInterface + */ + //private $output; + /** + * @var array + */ + private $verbosityLevelMap = [ + LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, + LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, + LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, + LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, + LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, + LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, + LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, + LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, + ConsoleLogLevel::SUCCESS => OutputInterface::VERBOSITY_NORMAL, + ]; + + /** + * @var array + * + * Send all log messages to stderr. Symfony should have the same default. + * See: https://en.wikipedia.org/wiki/Standard_streams + * "Standard error was added to Unix after several wasted phototypesetting runs ended with error messages being typeset instead of displayed on the user's terminal." + */ + private $formatLevelMap = [ + LogLevel::EMERGENCY => self::ERROR, + LogLevel::ALERT => self::ERROR, + LogLevel::CRITICAL => self::ERROR, + LogLevel::ERROR => self::ERROR, + LogLevel::WARNING => self::ERROR, + LogLevel::NOTICE => self::ERROR, + LogLevel::INFO => self::ERROR, + LogLevel::DEBUG => self::ERROR, + ConsoleLogLevel::SUCCESS => self::ERROR, + ]; + + /** + * Interpolates context values into the message placeholders. + * + * @author PHP Framework Interoperability Group + * + * @param string $message + * @param array $context + * + * @return string + */ + private function interpolate($message, array $context) + { + // build a replacement array with braces around the context keys + $replace = array(); + foreach ($context as $key => $val) { + if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { + $replace[sprintf('{%s}', $key)] = $val; + } + } + + // interpolate replacement values into the message and return + return strtr($message, $replace); + } +} diff --git a/vendor/consolidation/log/src/LoggerManager.php b/vendor/consolidation/log/src/LoggerManager.php new file mode 100644 index 0000000000000000000000000000000000000000..9202064303649ea9025b53fa58a2b89b129734e9 --- /dev/null +++ b/vendor/consolidation/log/src/LoggerManager.php @@ -0,0 +1,121 @@ +<?php +namespace Consolidation\Log; + +use Psr\Log\AbstractLogger; +use Psr\Log\LoggerInterface; +use Psr\Log\InvalidArgumentException; +use Psr\Log\LogLevel; + +/** + * LoggerManager is a PSR-3 logger that can delegate + * log messages to other loggers. This is ideal if + * you need to inject a logger into various objects + * in your application, but need to change the way that + * the application logs later. + * + * @author Greg Anderson <greg.1.anderson@greenknowe.org> + */ +class LoggerManager extends AbstractLogger implements StylableLoggerInterface +{ + /** @var LoggerInterface[] */ + protected $loggers = []; + /** @var LoggerInterface */ + protected $fallbackLogger = null; + /** @var LogOutputStylerInterface */ + protected $outputStyler; + /** @var array */ + protected $formatFunctionMap = []; + + /** + * reset removes all loggers from the manager. + */ + public function reset() + { + $this->loggers = []; + return $this; + } + + /** + * setLogOutputStyler will remember a style that + * should be applied to every stylable logger + * added to this manager. + */ + public function setLogOutputStyler(LogOutputStylerInterface $outputStyler, array $formatFunctionMap = array()) + { + $this->outputStyler = $outputStyler; + $this->formatFunctionMap = $this->formatFunctionMap; + } + + /** + * add adds a named logger to the manager, + * replacing any logger of the same name. + * + * @param string $name Name of logger to add + * @param LoggerInterface $logger Logger to send messages to + */ + public function add($name, LoggerInterface $logger) + { + // If this manager has been given a log style, + // and the logger being added accepts a log + // style, then copy our style to the logger + // being added. + if ($this->outputStyler && $logger instanceof StylableLoggerInterface) { + $logger->setLogOutputStyler($this->outputStyler, $this->formatFunctionMap); + } + $this->loggers[$name] = $logger; + return $this; + } + + /** + * remove a named logger from the manager. + * + * @param string $name Name of the logger to remove. + */ + public function remove($name) + { + unset($this->loggers[$name]); + return $this; + } + + /** + * fallbackLogger provides a logger that will + * be used only in instances where someone logs + * to the logger manager at a time when there + * are no other loggers registered. If there is + * no fallback logger, then the log messages + * are simply dropped. + * + * @param LoggerInterface $logger Logger to use as the fallback logger + */ + public function fallbackLogger(LoggerInterface $logger) + { + $this->fallbackLogger = $logger; + return $this; + } + + /** + * {@inheritdoc} + */ + public function log($level, $message, array $context = array()) + { + foreach ($this->getLoggers() as $logger) { + $logger->log($level, $message, $context); + } + } + + /** + * Return either the list of registered loggers, + * or a single-element list containing only the + * fallback logger. + */ + protected function getLoggers() + { + if (!empty($this->loggers)) { + return $this->loggers; + } + if (isset($this->fallbackLogger)) { + return [ $this->fallbackLogger ]; + } + return []; + } +} diff --git a/vendor/consolidation/log/src/StylableLoggerInterface.php b/vendor/consolidation/log/src/StylableLoggerInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..9b872846d5b70e42d71aa7274a3559e3e409c6ed --- /dev/null +++ b/vendor/consolidation/log/src/StylableLoggerInterface.php @@ -0,0 +1,16 @@ +<?php +namespace Consolidation\Log; + +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Console\Input\StringInput; + +/** + * StylableLoggerInterface indicates that a logger + * can receive a LogOutputStyler. + * + * @author Greg Anderson <greg.1.anderson@greenknowe.org> + */ +interface StylableLoggerInterface +{ + public function setLogOutputStyler(LogOutputStylerInterface $outputStyler, array $formatFunctionMap = array()); +} diff --git a/vendor/consolidation/log/src/SymfonyLogOutputStyler.php b/vendor/consolidation/log/src/SymfonyLogOutputStyler.php new file mode 100644 index 0000000000000000000000000000000000000000..12ce49f3f71867fc90703bb7cb4551cef7f7c688 --- /dev/null +++ b/vendor/consolidation/log/src/SymfonyLogOutputStyler.php @@ -0,0 +1,65 @@ +<?php +namespace Consolidation\Log; + +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Console\Input\StringInput; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Style log messages with Symfony\Component\Console\Style\SymfonyStyle. + * No context variable styling is done. + * + * This is the appropriate styler to use if your desire is to replace + * the use of SymfonyStyle with a Psr-3 logger without changing the + * appearance of your application's output. + */ +class SymfonyLogOutputStyler implements LogOutputStylerInterface +{ + public function defaultStyles() + { + return []; + } + + public function style($context) + { + return $context; + } + + public function createOutputWrapper(OutputInterface $output) + { + // SymfonyStyle & c. contain both input and output functions, + // but we only need the output methods here. Create a stand-in + // input object to satisfy the SymfonyStyle constructor. + return new SymfonyStyle(new StringInput(''), $output); + } + + public function log($symfonyStyle, $level, $message, $context) + { + $symfonyStyle->text($message); + } + + public function success($symfonyStyle, $level, $message, $context) + { + $symfonyStyle->success($message); + } + + public function error($symfonyStyle, $level, $message, $context) + { + $symfonyStyle->error($message); + } + + public function warning($symfonyStyle, $level, $message, $context) + { + $symfonyStyle->warning($message); + } + + public function note($symfonyStyle, $level, $message, $context) + { + $symfonyStyle->note($message); + } + + public function caution($symfonyStyle, $level, $message, $context) + { + $symfonyStyle->caution($message); + } +} diff --git a/vendor/consolidation/log/src/UnstyledLogOutputStyler.php b/vendor/consolidation/log/src/UnstyledLogOutputStyler.php new file mode 100644 index 0000000000000000000000000000000000000000..6513ce340927ceb1ec60abea2f015cd990368a8a --- /dev/null +++ b/vendor/consolidation/log/src/UnstyledLogOutputStyler.php @@ -0,0 +1,97 @@ +<?php +namespace Consolidation\Log; + +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\OutputStyle; + +/** + * Base class that provides basic unstyled output. + */ +class UnstyledLogOutputStyler implements LogOutputStylerInterface +{ + public function createOutputWrapper(OutputInterface $output) + { + return $output; + } + + /** + * {@inheritdoc} + */ + public function defaultStyles() + { + return []; + } + + /** + * {@inheritdoc} + */ + public function style($context) + { + return $context; + } + + /** + * {@inheritdoc} + */ + protected function write($output, $message, $context) + { + $output->writeln($message); + } + + /** + * {@inheritdoc} + */ + public function log($output, $level, $message, $context) + { + return $this->write($output, $this->formatMessageByLevel($level, $message, $context), $context); + } + + /** + * {@inheritdoc} + */ + public function success($output, $level, $message, $context) + { + return $this->write($output, $this->formatMessageByLevel($level, $message, $context), $context); + } + + /** + * {@inheritdoc} + */ + public function error($output, $level, $message, $context) + { + return $this->write($output, $this->formatMessageByLevel($level, $message, $context), $context); + } + + /** + * {@inheritdoc} + */ + public function warning($output, $level, $message, $context) + { + return $this->write($output, $this->formatMessageByLevel($level, $message, $context), $context); + } + + /** + * {@inheritdoc} + */ + public function note($output, $level, $message, $context) + { + return $this->write($output, $this->formatMessageByLevel($level, $message, $context), $context); + } + + /** + * {@inheritdoc} + */ + public function caution($output, $level, $message, $context) + { + return $this->write($output, $this->formatMessageByLevel($level, $message, $context), $context); + } + + /** + * Look up the label and message styles for the specified log level, + * and use the log level as the label for the log message. + */ + protected function formatMessageByLevel($level, $message, $context) + { + return " [$level] $message"; + } +} diff --git a/vendor/consolidation/log/tests/LogMethodTests.php b/vendor/consolidation/log/tests/LogMethodTests.php new file mode 100644 index 0000000000000000000000000000000000000000..40df315b9ef3c7bcacc6fcbd90e344fcba9e9862 --- /dev/null +++ b/vendor/consolidation/log/tests/LogMethodTests.php @@ -0,0 +1,55 @@ +<?php +namespace Consolidation\Log; + +use Symfony\Component\Console\Output\BufferedOutput; +use Symfony\Component\Console\Output\OutputInterface; +use PHPUnit\Framework\TestCase; + +class LogMethodTests extends TestCase +{ + protected $output; + protected $logger; + + function setup() { + $this->output = new BufferedOutput(); + $this->output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + $this->logger = new Logger($this->output); + $this->logger->setLogOutputStyler(new UnstyledLogOutputStyler()); + } + + function testError() { + $this->logger->error('Do not enter - wrong way.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [error] Do not enter - wrong way.', $outputText); + } + + function testWarning() { + $this->logger->warning('Steep grade.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [warning] Steep grade.', $outputText); + } + + function testNotice() { + $this->logger->notice('No loitering.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [notice] No loitering.', $outputText); + } + + function testInfo() { + $this->logger->info('Scenic route.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [info] Scenic route.', $outputText); + } + + function testDebug() { + $this->logger->debug('Counter incremented.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [debug] Counter incremented.', $outputText); + } + + function testSuccess() { + $this->logger->success('It worked!'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [success] It worked!', $outputText); + } +} diff --git a/vendor/consolidation/log/tests/LoggerManagerTests.php b/vendor/consolidation/log/tests/LoggerManagerTests.php new file mode 100644 index 0000000000000000000000000000000000000000..fa2efabfe0e80c246feea2a0534b6a23e797d00b --- /dev/null +++ b/vendor/consolidation/log/tests/LoggerManagerTests.php @@ -0,0 +1,69 @@ +<?php +namespace Consolidation\Log; + +use Symfony\Component\Console\Output\BufferedOutput; +use Symfony\Component\Console\Output\OutputInterface; +use PHPUnit\Framework\TestCase; + +class LoggerManagerTests extends TestCase +{ + protected $output; + protected $logger; + + function testLoggerManager() + { + $fallbackOutput = new BufferedOutput(); + $fallbackOutput->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + $fallbackLogger = new Logger($fallbackOutput); + $fallbackLogger->notice('This is the fallback logger'); + + $primaryOutput = new BufferedOutput(); + $primaryOutput->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + $primaryLogger = new Logger($primaryOutput); + $primaryLogger->notice('This is the primary logger'); + + $replacementOutput = new BufferedOutput(); + $replacementOutput->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + $replacementLogger = new Logger($replacementOutput); + $replacementLogger->notice('This is the replacement logger'); + + $logger = new LoggerManager(); + + $logger->notice('Uninitialized logger.'); + $logger->fallbackLogger($fallbackLogger); + $logger->notice('Logger with fallback.'); + $logger->add('default', $primaryLogger); + $logger->notice('Primary logger'); + $logger->add('default', $replacementLogger); + $logger->notice('Replaced logger'); + $logger->reset(); + $logger->notice('Reset loggers'); + + $fallbackActual = rtrim($fallbackOutput->fetch()); + $primaryActual = rtrim($primaryOutput->fetch()); + $replacementActual = rtrim($replacementOutput->fetch()); + + $actual = "Fallback:\n====\n$fallbackActual\nPrimary:\n====\n$primaryActual\nReplacement:\n====\n$replacementActual"; + + $actual = preg_replace('# *$#ms', '', $actual); + $actual = preg_replace('#^ *$\n#ms', '', $actual); + + $expected = <<< __EOT__ +Fallback: +==== + ! [NOTE] This is the fallback logger + ! [NOTE] Logger with fallback. + ! [NOTE] Reset loggers +Primary: +==== + ! [NOTE] This is the primary logger + ! [NOTE] Primary logger +Replacement: +==== + ! [NOTE] This is the replacement logger + ! [NOTE] Replaced logger +__EOT__; + + $this->assertEquals($expected, $actual); + } +} diff --git a/vendor/consolidation/log/tests/LoggerVerbosityAndStyleTests.php b/vendor/consolidation/log/tests/LoggerVerbosityAndStyleTests.php new file mode 100644 index 0000000000000000000000000000000000000000..1a96c2a89f96af23a4795617fd004fe6daaf7dc7 --- /dev/null +++ b/vendor/consolidation/log/tests/LoggerVerbosityAndStyleTests.php @@ -0,0 +1,165 @@ +<?php +namespace Consolidation\Log; + +use Psr\Log\LogLevel; +use Symfony\Component\Console\Output\BufferedOutput; +use Symfony\Component\Console\Output\OutputInterface; +use PHPUnit\Framework\TestCase; + +use Consolidation\TestUtils\TestDataPermuter; + +class LoggerVerbosityAndStyleTests extends TestCase +{ + protected $output; + protected $logger; + + function setup() { + $this->output = new BufferedOutput(); + //$this->output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); + $this->logger = new Logger($this->output); + } + + public static function logTestValues() + { + /** + * Use TEST_ALL_LOG_LEVELS to ensure that output is the same + * in instances where the output does not vary by log level. + */ + $TEST_ALL_LOG_LEVELS = [ + OutputInterface::VERBOSITY_DEBUG, + OutputInterface::VERBOSITY_VERY_VERBOSE, + OutputInterface::VERBOSITY_VERBOSE, + OutputInterface::VERBOSITY_NORMAL + ]; + + // Tests that return the same value for multiple inputs + // may use the expandProviderDataArrays method, and list + // repeated scalars as array values. All permutations of + // all array items will be calculated, and one test will + // be generated for each one. + return TestDataPermuter::expandProviderDataArrays([ + [ + '\Consolidation\Log\UnstyledLogOutputStyler', + $TEST_ALL_LOG_LEVELS, + LogLevel::ERROR, + 'Do not enter - wrong way.', + ' [error] Do not enter - wrong way.', + ], + [ + '\Consolidation\Log\UnstyledLogOutputStyler', + $TEST_ALL_LOG_LEVELS, + LogLevel::WARNING, + 'Steep grade.', + ' [warning] Steep grade.', + ], + [ + '\Consolidation\Log\UnstyledLogOutputStyler', + [ + OutputInterface::VERBOSITY_DEBUG, + OutputInterface::VERBOSITY_VERY_VERBOSE, + OutputInterface::VERBOSITY_VERBOSE, + ], + LogLevel::NOTICE, + 'No loitering.', + ' [notice] No loitering.', + ], + [ + '\Consolidation\Log\UnstyledLogOutputStyler', + OutputInterface::VERBOSITY_NORMAL, + LogLevel::NOTICE, + 'No loitering.', + '', + ], + [ + '\Consolidation\Log\UnstyledLogOutputStyler', + OutputInterface::VERBOSITY_DEBUG, + LogLevel::INFO, + 'Scenic route.', + ' [info] Scenic route.', + ], + [ + '\Consolidation\Log\UnstyledLogOutputStyler', + OutputInterface::VERBOSITY_DEBUG, + LogLevel::DEBUG, + 'Counter incremented.', + ' [debug] Counter incremented.', + ], + [ + '\Consolidation\Log\UnstyledLogOutputStyler', + [ + OutputInterface::VERBOSITY_VERY_VERBOSE, + OutputInterface::VERBOSITY_VERBOSE, + OutputInterface::VERBOSITY_NORMAL + ], + LogLevel::DEBUG, + 'Counter incremented.', + '', + ], + [ + '\Consolidation\Log\UnstyledLogOutputStyler', + $TEST_ALL_LOG_LEVELS, + ConsoleLogLevel::SUCCESS, + 'It worked!', + ' [success] It worked!', + ], + [ + '\Consolidation\Log\LogOutputStyler', + OutputInterface::VERBOSITY_NORMAL, + ConsoleLogLevel::SUCCESS, + 'It worked!', + ' [success] It worked!', + ], + [ + '\Consolidation\Log\SymfonyLogOutputStyler', + OutputInterface::VERBOSITY_DEBUG, + LogLevel::WARNING, + 'Steep grade.', + "\n [WARNING] Steep grade.", + ], + [ + '\Consolidation\Log\SymfonyLogOutputStyler', + OutputInterface::VERBOSITY_DEBUG, + LogLevel::NOTICE, + 'No loitering.', + "\n ! [NOTE] No loitering.", + ], + [ + '\Consolidation\Log\SymfonyLogOutputStyler', + OutputInterface::VERBOSITY_DEBUG, + LogLevel::INFO, + 'Scenic route.', + "\n ! [NOTE] Scenic route.", + ], + [ + '\Consolidation\Log\SymfonyLogOutputStyler', + OutputInterface::VERBOSITY_DEBUG, + LogLevel::DEBUG, + 'Counter incremented.', + "\n ! [NOTE] Counter incremented.", + ], + [ + '\Consolidation\Log\SymfonyLogOutputStyler', + OutputInterface::VERBOSITY_NORMAL, + ConsoleLogLevel::SUCCESS, + 'It worked!', + "\n [OK] It worked!", + ], + ]); + } + + /** + * This is our only test method. It accepts all of the + * permuted data from the data provider, and runs one + * test on each one. + * + * @dataProvider logTestValues + */ + function testLogging($styleClass, $verbocity, $level, $message, $expected) { + $logStyler = new $styleClass; + $this->logger->setLogOutputStyler($logStyler); + $this->output->setVerbosity($verbocity); + $this->logger->log($level, $message); + $outputText = rtrim($this->output->fetch(), "\n\r\t "); + $this->assertEquals($expected, $outputText); + } +} diff --git a/vendor/consolidation/log/tests/src/TestDataPermuter.php b/vendor/consolidation/log/tests/src/TestDataPermuter.php new file mode 100644 index 0000000000000000000000000000000000000000..c44ef53abc908b2888f41e2e5718e5da9acdb146 --- /dev/null +++ b/vendor/consolidation/log/tests/src/TestDataPermuter.php @@ -0,0 +1,81 @@ +<?php +namespace Consolidation\TestUtils; + +class TestDataPermuter +{ + /** + * Given an array of test data, where each element is + * data to pass to a unit test AND each unit test requires + * only scalar or object test value, find each array + * in each test, and build all of the permutations for all + * of the data provided in arrays. + */ + public static function expandProviderDataArrays($tests) + { + $result = []; + + foreach($tests as $test) { + $subsitutionIndex = 1; + $permutationData = []; + $replacements = []; + + foreach($test as $testValue) { + if (is_array($testValue)) { + $key = "{SUB$subsitutionIndex}"; + $replacements[$key] = $testValue; + $permutationData[] = $key; + } + else { + $permutationData[] = $testValue; + } + } + + $permuted = static::expandDataMatrix([$permutationData], $replacements); + $result = array_merge($result, $permuted); + } + + return $result; + } + + /** + * Given an array of test data, where each element is + * data to pass to a unit test, expand all of the + * permutations of $replacements, where each key + * holds the placeholder value, and the value holds + * an array of replacement values. + */ + public static function expandDataMatrix($tests, $replacements) + { + foreach($replacements as $substitute => $values) { + $tests = static::expandOneValue($tests, $substitute, $values); + } + return $tests; + } + + /** + * Given an array of test data, where each element is + * data to pass to a unit test, find any element in any + * one test item whose value is exactly $substitute. + * Make a new test item for every item in $values, using + * each as the substitution for $substitute. + */ + public static function expandOneValue($tests, $substitute, $values) + { + $result = []; + + foreach($tests as $test) { + $position = array_search($substitute, $test); + if ($position === FALSE) { + $result[] = $test; + } + else { + foreach($values as $replacement) { + $test[$position] = $replacement; + $result[] = $test; + } + } + } + + return $result; + } +} diff --git a/vendor/consolidation/robo/.editorconfig b/vendor/consolidation/robo/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..095771e673c86f27e8c8224b6de6437fbe793e4f --- /dev/null +++ b/vendor/consolidation/robo/.editorconfig @@ -0,0 +1,15 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[**.php] +indent_style = space +indent_size = 4 + diff --git a/vendor/consolidation/robo/.scenarios.lock/install b/vendor/consolidation/robo/.scenarios.lock/install new file mode 100755 index 0000000000000000000000000000000000000000..16c69e107cce7f71e33e04207254d005200f9fd4 --- /dev/null +++ b/vendor/consolidation/robo/.scenarios.lock/install @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff --git a/vendor/consolidation/robo/.scenarios.lock/symfony2/.gitignore b/vendor/consolidation/robo/.scenarios.lock/symfony2/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..88e99d50df0e92a0e79a150231f75a363c9f1baf --- /dev/null +++ b/vendor/consolidation/robo/.scenarios.lock/symfony2/.gitignore @@ -0,0 +1,2 @@ +vendor +composer.lock \ No newline at end of file diff --git a/vendor/consolidation/robo/.scenarios.lock/symfony2/composer.json b/vendor/consolidation/robo/.scenarios.lock/symfony2/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..d11ea0fadcf7baa9d8d3736be067c4c6fac118eb --- /dev/null +++ b/vendor/consolidation/robo/.scenarios.lock/symfony2/composer.json @@ -0,0 +1,92 @@ +{ + "name": "consolidation/robo", + "description": "Modern task runner", + "license": "MIT", + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "autoload": { + "psr-4": { + "Robo\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Robo\\": "../../tests/src", + "RoboExample\\": "../../examples/src" + } + }, + "bin": [ + "robo" + ], + "require": { + "symfony/console": "^2.8", + "php": ">=5.5.0", + "league/container": "^2.2", + "consolidation/log": "~1", + "consolidation/config": "^1.2", + "consolidation/annotated-command": "^2.10.2", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "patchwork/jsqueeze": "~2", + "natxet/CssMin": "3.0.4", + "pear/archive_tar": "^1.4.4", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "codeception/aspect-mock": "^1|^2.1.1", + "goaop/parser-reflection": "^1.1.0", + "nikic/php-parser": "^3.1.5", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "cs": "./robo sniff", + "unit": "./robo test --coverage", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "pre-install-cmd": [ + "Robo\\composer\\ScriptHandler::checkDependencies" + ] + }, + "config": { + "platform": { + "php": "5.5.9" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "suggest": { + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively.", + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "natxet/CssMin": "For minifying CSS files in taskMinify" + }, + "replace": { + "codegyre/robo": "< 1.0" + } +} diff --git a/vendor/consolidation/robo/.scenarios.lock/symfony4/.gitignore b/vendor/consolidation/robo/.scenarios.lock/symfony4/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/robo/.scenarios.lock/symfony4/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/robo/.scenarios.lock/symfony4/composer.json b/vendor/consolidation/robo/.scenarios.lock/symfony4/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..e09d66c9c3a0e4ef9871b14949bb863998d3e479 --- /dev/null +++ b/vendor/consolidation/robo/.scenarios.lock/symfony4/composer.json @@ -0,0 +1,93 @@ +{ + "name": "consolidation/robo", + "description": "Modern task runner", + "license": "MIT", + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "autoload": { + "psr-4": { + "Robo\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Robo\\": "../../tests/src", + "RoboExample\\": "../../examples/src" + } + }, + "bin": [ + "robo" + ], + "require": { + "symfony/console": "^4", + "php": ">=5.5.0", + "league/container": "^2.2", + "consolidation/log": "~1", + "consolidation/config": "^1.2", + "consolidation/annotated-command": "^2.10.2", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "patchwork/jsqueeze": "~2", + "natxet/CssMin": "3.0.4", + "pear/archive_tar": "^1.4.4", + "codeception/base": "^2.3.7", + "goaop/framework": "~2.1.2", + "codeception/verify": "^0.3.2", + "codeception/aspect-mock": "^1|^2.1.1", + "goaop/parser-reflection": "^1.1.0", + "nikic/php-parser": "^3.1.5", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "cs": "./robo sniff", + "unit": "./robo test --coverage", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "pre-install-cmd": [ + "Robo\\composer\\ScriptHandler::checkDependencies" + ] + }, + "config": { + "platform": { + "php": "7.1.3" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "suggest": { + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively.", + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "natxet/CssMin": "For minifying CSS files in taskMinify" + }, + "replace": { + "codegyre/robo": "< 1.0" + } +} diff --git a/vendor/consolidation/robo/.scenarios.lock/symfony4/composer.lock b/vendor/consolidation/robo/.scenarios.lock/symfony4/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..1e19800b3f8de9dd2c650eee7b623fb9d4fffa4c --- /dev/null +++ b/vendor/consolidation/robo/.scenarios.lock/symfony4/composer.lock @@ -0,0 +1,4215 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "1a613bb086d612b492b42f2bc2a3b56a", + "packages": [ + { + "name": "consolidation/annotated-command", + "version": "2.11.2", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "004af26391cd7d1cd04b0ac736dc1324d1b4f572" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/004af26391cd7d1cd04b0ac736dc1324d1b4f572", + "reference": "004af26391cd7d1cd04b0ac736dc1324d1b4f572", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.5", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2019-02-02T02:29:53+00:00" + }, + { + "name": "consolidation/config", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "11ab7ecd19131ce084390171b9c070eedecf7dab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/11ab7ecd19131ce084390171b9c070eedecf7dab", + "reference": "11ab7ecd19131ce084390171b9c070eedecf7dab", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2019-02-16T01:18:47+00:00" + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^5.7.27", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "3.2.3", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2018-10-19T22:35:38+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "symfony/console", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1f0ad51dfde4da8a6070f06adc58b4e37cbb37a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1f0ad51dfde4da8a6070f06adc58b4e37cbb37a4", + "reference": "1f0ad51dfde4da8a6070f06adc58b4e37cbb37a4", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2019-01-25T14:35:16+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "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": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "bd09ad265cd50b2b9d09d65ce6aba2d29bc81fe1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bd09ad265cd50b2b9d09d65ce6aba2d29bc81fe1", + "reference": "bd09ad265cd50b2b9d09d65ce6aba2d29bc81fe1", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:35:37+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "7c16ebc2629827d4ec915a52ac809768d060a4ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7c16ebc2629827d4ec915a52ac809768d060a4ee", + "reference": "7c16ebc2629827d4ec915a52ac809768d060a4ee", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:35:37+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "7c0c627220308928e958a87c293108e5891cde1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/7c0c627220308928e958a87c293108e5891cde1d", + "reference": "7c0c627220308928e958a87c293108e5891cde1d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:43:35+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/process", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "6c05edb11fbeff9e2b324b4270ecb17911a8b7ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/6c05edb11fbeff9e2b324b4270ecb17911a8b7ad", + "reference": "6c05edb11fbeff9e2b324b4270ecb17911a8b7ad", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-01-24T22:05:03+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "d461670ee145092b7e2a56c1da7118f19cadadb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d461670ee145092b7e2a56c1da7118f19cadadb0", + "reference": "d461670ee145092b7e2a56c1da7118f19cadadb0", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:35:37+00:00" + } + ], + "packages-dev": [ + { + "name": "behat/gherkin", + "version": "v4.6.0", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/ab0a02ea14893860bca00f225f5621d351a3ad07", + "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.5|~5", + "symfony/phpunit-bridge": "~2.7|~3|~4", + "symfony/yaml": "~2.3|~3|~4" + }, + "suggest": { + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Cucumber", + "DSL", + "gherkin", + "parser" + ], + "time": "2019-01-16T14:22:17+00:00" + }, + { + "name": "codeception/aspect-mock", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/Codeception/AspectMock.git", + "reference": "bf3c000599c0dc75ecb52e19dee2b8ed294cf7ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/AspectMock/zipball/bf3c000599c0dc75ecb52e19dee2b8ed294cf7ba", + "reference": "bf3c000599c0dc75ecb52e19dee2b8ed294cf7ba", + "shasum": "" + }, + "require": { + "goaop/framework": "^2.0.0", + "php": ">=5.6.0", + "symfony/finder": "~2.4|~3.0" + }, + "require-dev": { + "codeception/base": "~2.1", + "codeception/specify": "~0.3", + "codeception/verify": "~0.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "AspectMock": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@codeception.com" + } + ], + "description": "Experimental Mocking Framework powered by Aspects", + "time": "2017-10-24T10:20:17+00:00" + }, + { + "name": "codeception/base", + "version": "2.5.3", + "source": { + "type": "git", + "url": "https://github.com/Codeception/base.git", + "reference": "ceff0b4fee4846b6bd8b5a37abbbb1acd6e78f58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/base/zipball/ceff0b4fee4846b6bd8b5a37abbbb1acd6e78f58", + "reference": "ceff0b4fee4846b6bd8b5a37abbbb1acd6e78f58", + "shasum": "" + }, + "require": { + "behat/gherkin": "^4.4.0", + "codeception/phpunit-wrapper": "^6.0.9|^7.0.6", + "codeception/stub": "^2.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/psr7": "~1.0", + "php": ">=5.6.0 <8.0", + "symfony/browser-kit": ">=2.7 <5.0", + "symfony/console": ">=2.7 <5.0", + "symfony/css-selector": ">=2.7 <5.0", + "symfony/dom-crawler": ">=2.7 <5.0", + "symfony/event-dispatcher": ">=2.7 <5.0", + "symfony/finder": ">=2.7 <5.0", + "symfony/yaml": ">=2.7 <5.0" + }, + "require-dev": { + "codeception/specify": "~0.3", + "facebook/graph-sdk": "~5.3", + "flow/jsonpath": "~0.2", + "monolog/monolog": "~1.8", + "pda/pheanstalk": "~3.0", + "php-amqplib/php-amqplib": "~2.4", + "predis/predis": "^1.0", + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": ">=2.7 <5.0", + "vlucas/phpdotenv": "^3.0" + }, + "suggest": { + "aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module", + "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests", + "codeception/specify": "BDD-style code blocks", + "codeception/verify": "BDD-style assertions", + "flow/jsonpath": "For using JSONPath in REST module", + "league/factory-muffin": "For DataFactory module", + "league/factory-muffin-faker": "For Faker support in DataFactory module", + "phpseclib/phpseclib": "for SFTP option in FTP Module", + "stecman/symfony-console-completion": "For BASH autocompletion", + "symfony/phpunit-bridge": "For phpunit-bridge support" + }, + "bin": [ + "codecept" + ], + "type": "library", + "extra": { + "branch-alias": [] + }, + "autoload": { + "psr-4": { + "Codeception\\": "src/Codeception", + "Codeception\\Extension\\": "ext" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@mail.ua", + "homepage": "http://codegyre.com" + } + ], + "description": "BDD-style testing framework", + "homepage": "http://codeception.com/", + "keywords": [ + "BDD", + "TDD", + "acceptance testing", + "functional testing", + "unit testing" + ], + "time": "2019-02-02T16:29:38+00:00" + }, + { + "name": "codeception/phpunit-wrapper", + "version": "6.0.14", + "source": { + "type": "git", + "url": "https://github.com/Codeception/phpunit-wrapper.git", + "reference": "3b64beb0af3e63145af982e64718ab80d2417739" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/3b64beb0af3e63145af982e64718ab80d2417739", + "reference": "3b64beb0af3e63145af982e64718ab80d2417739", + "shasum": "" + }, + "require": { + "phpunit/php-code-coverage": ">=4.0.4 <6.0", + "phpunit/phpunit": ">=5.7.27 <6.5.13", + "sebastian/comparator": ">=1.2.4 <3.0", + "sebastian/diff": ">=1.4 <4.0" + }, + "replace": { + "codeception/phpunit-wrapper": "*" + }, + "require-dev": { + "codeception/specify": "*", + "vlucas/phpdotenv": "^2.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Codeception\\PHPUnit\\": "src\\" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "PHPUnit classes used by Codeception", + "time": "2019-01-13T10:35:17+00:00" + }, + { + "name": "codeception/stub", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Stub.git", + "reference": "f50bc271f392a2836ff80690ce0c058efe1ae03e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Stub/zipball/f50bc271f392a2836ff80690ce0c058efe1ae03e", + "reference": "f50bc271f392a2836ff80690ce0c058efe1ae03e", + "shasum": "" + }, + "require": { + "phpunit/phpunit": ">=4.8 <8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Codeception\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", + "time": "2018-07-26T11:55:37+00:00" + }, + { + "name": "codeception/verify", + "version": "0.3.3", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Verify.git", + "reference": "5d649dda453cd814dadc4bb053060cd2c6bb4b4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Verify/zipball/5d649dda453cd814dadc4bb053060cd2c6bb4b4c", + "reference": "5d649dda453cd814dadc4bb053060cd2c6bb4b4c", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/Codeception/function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert.php@mailican.com" + } + ], + "description": "BDD assertion library for PHPUnit", + "time": "2017-01-09T10:58:51+00:00" + }, + { + "name": "doctrine/annotations", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2017-12-06T07:11:42+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.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": "2017-07-22T11:58:36+00:00" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/28f932580981e912ab8f01d15788f1dee06550c8", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2019-02-11T20:22:44+00:00" + }, + { + "name": "goaop/framework", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/goaop/framework.git", + "reference": "6e2a0fe13c1943db02a67588cfd27692bddaffa5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/goaop/framework/zipball/6e2a0fe13c1943db02a67588cfd27692bddaffa5", + "reference": "6e2a0fe13c1943db02a67588cfd27692bddaffa5", + "shasum": "" + }, + "require": { + "doctrine/annotations": "~1.0", + "goaop/parser-reflection": "~1.2", + "jakubledl/dissect": "~1.0", + "php": ">=5.6.0" + }, + "require-dev": { + "adlawson/vfs": "^0.12", + "doctrine/orm": "^2.5", + "phpunit/phpunit": "^4.8", + "symfony/console": "^2.7|^3.0" + }, + "suggest": { + "symfony/console": "Enables the usage of the command-line tool." + }, + "bin": [ + "bin/aspect" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Go\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lisachenko Alexander", + "homepage": "https://github.com/lisachenko" + } + ], + "description": "Framework for aspect-oriented programming in PHP.", + "homepage": "http://go.aopphp.com/", + "keywords": [ + "aop", + "aspect", + "library", + "php" + ], + "time": "2017-07-12T11:46:25+00:00" + }, + { + "name": "goaop/parser-reflection", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/goaop/parser-reflection.git", + "reference": "d9c1dcc7ce4a5284fe3530e011faf9c9c10e1166" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/goaop/parser-reflection/zipball/d9c1dcc7ce4a5284fe3530e011faf9c9c10e1166", + "reference": "d9c1dcc7ce4a5284fe3530e011faf9c9c10e1166", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^1.2|^2.0|^3.0", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Go\\ParserReflection\\": "src" + }, + "files": [ + "src/bootstrap.php" + ], + "exclude-from-classmap": [ + "/tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander Lisachenko", + "email": "lisachenko.it@gmail.com" + } + ], + "description": "Provides reflection information, based on raw source", + "time": "2018-03-19T15:57:41+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "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": "*", + "monolog/monolog": "1.*", + "phpunit/phpunit": "3.7.*", + "psr/log": "1.0.*", + "symfony/class-loader": "*", + "zendframework/zend-cache": "<2.3", + "zendframework/zend-log": "<2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.8-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": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2014-01-28T22:29:15+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-04T20:46:45+00:00" + }, + { + "name": "jakubledl/dissect", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/jakubledl/dissect.git", + "reference": "d3a391de31e45a247e95cef6cf58a91c05af67c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jakubledl/dissect/zipball/d3a391de31e45a247e95cef6cf58a91c05af67c4", + "reference": "d3a391de31e45a247e95cef6cf58a91c05af67c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/console": "~2.1" + }, + "suggest": { + "symfony/console": "for the command-line tool" + }, + "bin": [ + "bin/dissect.php", + "bin/dissect" + ], + "type": "library", + "autoload": { + "psr-0": { + "Dissect": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "unlicense" + ], + "authors": [ + { + "name": "Jakub Lédl", + "email": "jakubledl@gmail.com" + } + ], + "description": "Lexing and parsing in pure PHP", + "homepage": "https://github.com/jakubledl/dissect", + "keywords": [ + "ast", + "lexing", + "parser", + "parsing" + ], + "time": "2013-01-29T21:29:14+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "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" + ], + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "natxet/CssMin", + "version": "v3.0.4", + "source": { + "type": "git", + "url": "https://github.com/natxet/CssMin.git", + "reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/natxet/CssMin/zipball/92de3fe3ccb4f8298d31952490ef7d5395855c39", + "reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39", + "shasum": "" + }, + "require": { + "php": ">=5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joe Scylla", + "email": "joe.scylla@gmail.com", + "homepage": "https://profiles.google.com/joe.scylla" + } + ], + "description": "Minifying CSS", + "homepage": "http://code.google.com/p/cssmin/", + "keywords": [ + "css", + "minify" + ], + "time": "2015-09-25T11:13:11+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "patchwork/jsqueeze", + "version": "v2.0.5", + "source": { + "type": "git", + "url": "https://github.com/tchwork/jsqueeze.git", + "reference": "693d64850eab2ce6a7c8f7cf547e1ab46e69d542" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tchwork/jsqueeze/zipball/693d64850eab2ce6a7c8f7cf547e1ab46e69d542", + "reference": "693d64850eab2ce6a7c8f7cf547e1ab46e69d542", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Patchwork\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "(Apache-2.0 or GPL-2.0)" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + } + ], + "description": "Efficient JavaScript minification in PHP", + "homepage": "https://github.com/tchwork/jsqueeze", + "keywords": [ + "compression", + "javascript", + "minification" + ], + "time": "2016-04-19T09:28:22+00:00" + }, + { + "name": "pear/archive_tar", + "version": "1.4.6", + "source": { + "type": "git", + "url": "https://github.com/pear/Archive_Tar.git", + "reference": "b8e33f9063a7cd1d20f079014f8382b3a7aee47e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/b8e33f9063a7cd1d20f079014f8382b3a7aee47e", + "reference": "b8e33f9063a7cd1d20f079014f8382b3a7aee47e", + "shasum": "" + }, + "require": { + "pear/pear-core-minimal": "^1.10.0alpha2", + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-bz2": "Bz2 compression support.", + "ext-xz": "Lzma2 compression support.", + "ext-zlib": "Gzip compression support." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Archive_Tar": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Vincent Blavet", + "email": "vincent@phpconcept.net" + }, + { + "name": "Greg Beaver", + "email": "greg@chiaraquartet.net" + }, + { + "name": "Michiel Rook", + "email": "mrook@php.net" + } + ], + "description": "Tar file management class with compression support (gzip, bzip2, lzma2)", + "homepage": "https://github.com/pear/Archive_Tar", + "keywords": [ + "archive", + "tar" + ], + "time": "2019-02-01T11:10:38+00:00" + }, + { + "name": "pear/console_getopt", + "version": "v1.4.2", + "source": { + "type": "git", + "url": "https://github.com/pear/Console_Getopt.git", + "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/6c77aeb625b32bd752e89ee17972d103588b90c0", + "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Console": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Greg Beaver", + "email": "cellog@php.net", + "role": "Helper" + }, + { + "name": "Andrei Zmievski", + "email": "andrei@php.net", + "role": "Lead" + }, + { + "name": "Stig Bakken", + "email": "stig@php.net", + "role": "Developer" + } + ], + "description": "More info available on: http://pear.php.net/package/Console_Getopt", + "time": "2019-02-06T16:52:33+00:00" + }, + { + "name": "pear/pear-core-minimal", + "version": "v1.10.7", + "source": { + "type": "git", + "url": "https://github.com/pear/pear-core-minimal.git", + "reference": "19a3e0fcd50492c4357372f623f55f1b144346da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/19a3e0fcd50492c4357372f623f55f1b144346da", + "reference": "19a3e0fcd50492c4357372f623f55f1b144346da", + "shasum": "" + }, + "require": { + "pear/console_getopt": "~1.4", + "pear/pear_exception": "~1.0" + }, + "replace": { + "rsky/pear-core-min": "self.version" + }, + "type": "library", + "autoload": { + "psr-0": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "src/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@php.net", + "role": "Lead" + } + ], + "description": "Minimal set of PEAR core files to be used as composer dependency", + "time": "2018-12-05T20:03:52+00:00" + }, + { + "name": "pear/pear_exception", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/pear/PEAR_Exception.git", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b", + "shasum": "" + }, + "require": { + "php": ">=4.4.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "class", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "PEAR": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "." + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Helgi Thormar", + "email": "dufuz@php.net" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net" + } + ], + "description": "The PEAR Exception base class.", + "homepage": "https://github.com/pear/PEAR_Exception", + "keywords": [ + "exception" + ], + "time": "2015-02-10T20:07:52+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/browser-kit", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "ee4462581eb54bf34b746e4a5d522a4f21620160" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/ee4462581eb54bf34b746e4a5d522a4f21620160", + "reference": "ee4462581eb54bf34b746e4a5d522a4f21620160", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/dom-crawler": "~3.4|~4.0" + }, + "require-dev": { + "symfony/css-selector": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T21:31:25+00:00" + }, + { + "name": "symfony/config", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "25a2e7abe0d97e70282537292e3df45cf6da7b98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/25a2e7abe0d97e70282537292e3df45cf6da7b98", + "reference": "25a2e7abe0d97e70282537292e3df45cf6da7b98", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2019-01-30T11:44:30+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "48eddf66950fa57996e1be4a55916d65c10c604a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/48eddf66950fa57996e1be4a55916d65c10c604a", + "reference": "48eddf66950fa57996e1be4a55916d65c10c604a", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:31:39+00:00" + }, + { + "name": "symfony/dom-crawler", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "d8476760b04cdf7b499c8718aa437c20a9155103" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d8476760b04cdf7b499c8718aa437c20a9155103", + "reference": "d8476760b04cdf7b499c8718aa437c20a9155103", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~3.4|~4.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:35:37+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:31:39+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.1.3" + } +} diff --git a/vendor/consolidation/robo/CHANGELOG.md b/vendor/consolidation/robo/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..9352dddef498e3826bedd107ff289aa3fc2c73cf --- /dev/null +++ b/vendor/consolidation/robo/CHANGELOG.md @@ -0,0 +1,383 @@ +# Changelog + +### 1.4.7 - 1.4.8 2/19/2019 + +* Re-release 1.4.6 to remove artifacts inadvertantly added to tagged release. + +### 1.4.6 2/16/2019 + +* Simplify ConfigAwareTrait to avoid probem with downstream clients. + +### 1.4.5 2/15/2019 + +* Extend ConfigAwareTrait from consolidation config (#838) + +### 1.4.4 2/8/2019 + +* Add stderr() convenience method to Robo\Common\OutputAwareTrait. + +### 1.4.0 - 1.4.3 1/2/2019 + +* BUGFIX: Back out 1.3.5, which contained breaking changes. Create a 1.x branch for continuation of compatible versions, and move breaking code to 2.x development (on master branch). + +### 1.3.4 12/20/2018 + +* Allow for aborting completions or rollbacks by James Sansbury (#815) +* BUGFIX: Allow commands to declare '@param InputInterface' to satisfy code style checks + +### 1.3.3 12/13/2018 + +* Add StdinHandler to the standard Robo DI container (#814) +* BUGFIX: Add test to ensure rollback order is in reverse by James Sansbury (#812) +* BUGFIX: Fix the main Robo script entrypoint to work as a phar. (#811) + +### 1.3.2 11/21/2018 + +* Update to Composer Test Scenarios 3 (#803) +* Support Windows line endings in ".semver" file by Cédric Belin (#788) +* Ensure that environment variables are preserved in Exec by James Sansbury (#769) +* Correct Doxygen in \Robo\Task\Composer\loadTasks. (#772) + +### 1.3.1 8/17/2018 + +* Move self:update command to consolidation/self-update project. +* Fix overzealous shebang function (#759) +* Actualize RoboFile of Codeception project link url in RADME.php by Valerij Ivashchenko (#756) +* Workaround - Move g1a/composer-test-scenarios from require-dev to require. +* Add --no-progress --no-suggest back in. +* Tell dependencies.io to use --no-dev when determining if a PR should be made. +* Omit --no-dev when the PR is actually being composed. +* Add `Events` as third parameter in watch function (#751) + +### 1.3.0 5/26/2018 + +* Add EnvConfig to Robo: set configuration values via environment variables (#737) + +### 1.2.4 5/25/2018 + +* Update 'Robo as a Framework' documentation to recommend https://github.com/g1a/starter +* Allow CommandStack to exec other tasks by Scott Falkingham (#726) +* Fix double escape when specifying a remoteShell with rsync by Rob Peck (#715) + +### 1.2.3 4/5/2018 + +* Hide progress indicator prior to 'exec'. (#707) +* Dependencies.io config for version 2 preview by Dave Gaeddert (#699) +* Fix path to test script in try:para +* Correctly parameterize the app name in the self:update command help text. +* Refuse to start 'release' script if phar.readonly is set. + +### 1.2.2 2/27/2018 + +* Experimental robo plugin mechanism (backwards compatibility not yet guarenteed) +* Allow traits to be documented +* Do not export scenarios directory +* *Breaking* Typo in `\Robo\Runner:errorCondtion()` fixed as `\Robo\Runner:errorCondition()`. + +### 1.2.1 12/28/2017 + +* Fixes to tests / build only. + +### 1.2.0 12/12/2017 + +* Support Symfony 4 Components (#651) +* Test multiple composer dependency permutations with https://github.com/greg-1-anderson/composer-test-scenarios + +### 1.1.5 10/25/2017 + +* Load option default values from $input for all options defined in the Application's input definition (#642) +* BUGFIX: Store global options in 'options' namespace rather than at the top level of config. + +### 1.1.4 10/16/2017 + +* Update order of command event hooks so that the option settings are injected prior to configuration being injected, so that dynamic options are available for config injection. (#636) +* Add shallow clone method to GithubStack task. by Stefan Lange (#633) +* Make Changelog task more flexible. by Matthew Grasmick(#631) +* Adding accessToken() to GitHub task. by Matthew Grasmick (#630) + +### 1.1.3 09/23/2017 + +* Add self:update command to update Robo phar distributions to the latest available version on GitHub. by Alexander Menk +* Fix Robo\Task\Docker\Base to implement CommandInterface. by Alexei Gorobet (#625) +* Add overwrite argument to Robo\Task\Filesystem\loadShortcuts.php::_rename by Alexei Gorobets (#624) +* Add failGroup() method for Codeception run command. by Max Gorovenko (#622) +* Set up composer-lock-updater on cron. (#618) +* Fix robo.yml loader by exporting processor instead of loader. By thomscode (#612) + +### 1.1.2 07/28/2017 + +* Inject option default values in help (#607) +* Add noRebuild() method for Codeception run command. By Max Gorovenko (#603) + +### 1.1.1 07/07/2017 + +* Add an option to wait an interval of time between parallel processes. By Gemma Pou #601 +* Do not print dire messages about Robo bootstrap problems when a valid command (e.g. help, list, init, --version) runs. #502 + +### 1.1.0 06/29/2017 + +* Configuration for multiple commands or multiple tasks may now be shared by attaching the configuration values to the task namespace or the command group. #597 +* *Breaking* Task configuration taken from property `task.PARTIAL_NAMESPACE.CLASSNAME.settings` instead of `task.CLASSNAME.settings`. Breaks backwards compatibility only with experimental configuration features introduced in version 1.0.6. Config is now stable, as of this release; there will be no more breaking config changes until Robo 2.0. #596 + +### 1.0.8 06/02/2017 + +* Fix regression in 1.0.7: Allow tasks to return results of types other than \Robo\Result. #585 +* Allow Copydir exclude method to specify subfolders by Alex Skrypnyk #590 +* Add composer init task, and general rounding out of composer tasks. #586 +* Enhance SemVer task so that it can be used with files or strings. #589 + +#### 1.0.7 05/30/2017 + +* Add a state system for collections to allow tasks to pass state to later tasks. +* Ensure that task results are returned when in stopOnFail() mode. +* Make rawArg() and detectInteractive chainable. By Matthew Grasmick #553 #558 +* [CopyDir] Use Symfony Filesystem. By malikkotob #555 +* [Composer] Implement CommandInterface. By Ivan Borzenkov #561 + +#### 1.0.6 03/31/2017 + +* Add configuration features to inject values into commandline option and task setter methods. Experimental; incompatible changes may be introduced prior to the stable release of configuration in version 1.1.0. + +#### 1.0.5 11/23/2016 + +* Incorporate word-wrapping from output-formatters 3.1.5 +* Incorporate custom event handlers from annotated-command 2.2.0 + +#### 1.0.4 11/15/2016 + +* Updated to latest changes in `master` branch. Phar and tag issues. + +#### 1.0.0 10/10/2016 + +* [Collection] Add tasks to a collection, and implement them as a group with rollback + * Tasks may be added to a collection via `$collection->add($task);` + * `$collection->run();` runs all tasks in the collection + * `$collection->addCode(function () { ... } );` to add arbitrary code to a collection + * `$collection->progressMessage(...);` will log a message + * `$collection->rollback($task);` and `$collection->rollbackCode($callable);` add a rollback function to clean up after a failed task + * `$collection->completion($task);` and `$collection->completionCode($callable);` add a function that is called once the collection completes or rolls back. + * `$collection->before();` and `$collection->after();` can be used to add a task or function that runs before or after (respectively) the specified named task. To use this feature, tasks must be given names via an optional `$taskName` parameter when they are added. + * Collections may be added to collections, if desired. +* [CollectionBuilder] Create tasks and add them to a collection in a single operation. + * `$this->collectionBuilder()->taskExec('pwd')->taskExec('ls')->run()` +* Add output formatters + * If a Robo command returns a string, or a `Result` object with a `$message`, then it will be printed + * Commands may be annotated to describe output formats that may be used + * Structured arrays returned from function results may be converted into different formats, such as a table, yml, json, etc. + * Tasks must `use TaskIO` for output methods. It is no longer possible to `use IO` from a task. For direct access use `Robo::output()` (not recommended). +* Use league/container to do Dependency Injection + * *Breaking* Tasks' loadTasks traits must use `$this->task(TaskClass::class);` instead of `new TaskClass();` + * *Breaking* Tasks that use other tasks must use `$this->collectionBuilder()->taskName();` instead of `new TaskClass();` when creating task objects to call. Implement `Robo\Contract\BuilderAwareInterface` and use `Robo\Contract\BuilderAwareTrait` to add the `collectionBuilder()` method to your task class. +* *Breaking* The `arg()`, `args()` and `option()` methods in CommandArguments now escape the values passed in to them. There is now a `rawArg()` method if you need to add just one argument that has already been escaped. +* *Breaking* taskWrite is now called taskWriteToFile +* [Extract] task added +* [Pack] task added +* [TmpDir], [WorkDir] and [TmpFile] tasks added +* Support Robo scripts that allows scripts starting with `#!/usr/bin/env robo` to define multiple robo commands. Use `#!/usr/bin/env robo run` to define a single robo command implemented by the `run()` method. +* Provide ProgresIndicatorAwareInterface and ProgressIndicatorAwareTrait that make it easy to add progress indicators to tasks +* Add --simulate mode that causes tasks to print what they would have done, but make no changes +* Add `robo generate:task` code-generator to make new stack-based task wrappers around existing classes +* Add `robo sniff` by @dustinleblanc. Runs the PHP code sniffer followed by the code beautifier, if needed. +* Implement ArrayInterface for Result class, so result data may be accessed like an array +* Defer execution of operations in taskWriteToFile until the run() method +* Add Write::textIfMatch() for taskWriteToFile +* ResourceExistenceChecker used for error checking in DeleteDir, CopyDir, CleanDir and Concat tasks by @burzum +* Provide ResultData base class for Result; ResultData may be used in instances where a specific `$task` instance is not available (e.g. in a Robo command) +* ArgvInput now available via $this->getInput() in RoboFile by Thomas Spigel +* Add optional message to git tag task by Tim Tegeler +* Rename 'FileSystem' to 'Filesystem' wherever it occurs. +* Current directory is changed with `chdir` only if specified via the `--load-from` option (RC2) + +#### 0.6.0 10/30/2015 + +* Added `--load-from` option to make Robo start RoboFiles from other directories. Use it like `robo --load-from /path/to/where/RobFile/located`. +* Robo will not ask to create RoboFile if it does not exist, `init` command should be used. +* [ImageMinify] task added by @gabor-udvari +* [OpenBrowser] task added by @oscarotero +* [FlattenDir] task added by @gabor-udvari +* Robo Runner can easily extended for custom runner by passing RoboClass and RoboFile parameters to constructor. By @rdeutz See #232 + +#### 0.5.4 08/31/2015 + +* [WriteToFile] Fixed by @gabor-udvari: always writing to file regardless whether any changes were made or not. This can bring the taskrunner into an inifinite loop if a replaced file is being watched. +* [Scss] task added, requires `leafo/scssphp` library to compile by @gabor-udvari +* [PhpSpec] TAP formatter added by @orls +* [Less] Added ability to set import dir for less compilers by @MAXakaWIZARD +* [Less] fixed passing closure as compiler by @pr0nbaer +* [Sass] task added by *2015-08-31* + +#### 0.5.3 07/15/2015 + + * [Rsync] Ability to use remote shell with identity file by @Mihailoff + * [Less] Task added by @burzum + * [PHPUnit] allow to test specific files with `files` parameter by @burzum. + * [GitStack] `tag` added by @SebSept + * [Concat] Fixing concat, it breaks some files if there is no new line. @burzum *2015-03-03-13* + * [Minify] BC fix to support Jsqueeze 1.x and 2.x @burzum *2015-03-12* + * [PHPUnit] Replace log-xml with log-junit @vkunz *2015-03-06* + * [Minify] Making it possible to pass options to the JS minification @burzum *2015-03-05* + * [CopyDir] Create destination recursively @boedah *2015-02-28* + +#### 0.5.2 02/24/2015 + +* [Phar] do not compress phar if more than 1000 files included (causes internal PHP error) *2015-02-24* +* _copyDir and _mirrorDir shortcuts fixed by @boedah *2015-02-24* +* [File\Write] methods replace() and regexReplace() added by @asterixcapri *2015-02-24* +* [Codecept] Allow to set custom name of coverage file raw name by @raistlin *2015-02-24* +* [Ssh] Added property `remoteDir` by @boedah *2015-02-24* +* [PhpServer] fixed passing arguments to server *2015-02-24* + + +#### 0.5.1 01/27/2015 + +* [Exec] fixed execution of background jobs, processes persist till the end of PHP script *2015-01-27* +* [Ssh] Fixed SSH task by @Butochnikov *2015-01-27* +* [CopyDir] fixed shortcut usage by @boedah *2015-01-27* +* Added default value options for Configuration trait by @TamasBarta *2015-01-27* + +#### 0.5.0 01/22/2015 + +Refactored core + +* All traits moved to `Robo\Common` namespace +* Interfaces moved to `Robo\Contract` namespace +* All task extend `Robo\Task\BaseTask` to use common IO. +* All classes follow PSR-4 standard +* Tasks are loaded into RoboFile with `loadTasks` trait +* One-line tasks are available as shortcuts loaded by `loadShortucts` and used like `$this->_exec('ls')` +* Robo runner is less coupled. Output can be set by `\Robo\Config::setOutput`, `RoboFile` can be changed to any provided class. +* Tasks can be used outside of Robo runner (inside a project) +* Timer for long-running tasks added +* Tasks can be globally configured (WIP) via `Robo\Config` class. +* Updated to Symfony >= 2.5 +* IO methods added `askHidden`, `askDefault`, `confirm` +* TaskIO methods added `printTaskError`, `printTaskSuccess` with different formatting. +* [Docker] Tasks added +* [Gulp] Task added by @schorsch3000 + +#### 0.4.7 12/26/2014 + +* [Minify] Task added by @Rarst. Requires additional dependencies installed *2014-12-26* +* [Help command is populated from annotation](https://github.com/consolidation-org/Robo/pull/71) by @jonsa *2014-12-26* +* Allow empty values as defaults to optional options by @jonsa *2014-12-26* +* `PHP_WINDOWS_VERSION_BUILD` constant is used to check for Windows in tasks by @boedah *2014-12-26* +* [Copy][EmptyDir] Fixed infinite loop by @boedah *2014-12-26* +* [ApiGen] Task added by @drobert *2014-12-26* +* [FileSystem] Equalized `copy` and `chmod` argument to defaults by @Rarst (BC break) *2014-12-26* +* [FileSystem] Added missing umask argument to chmod() method of FileSystemStack by @Rarst +* [SemVer] Fixed file read and exit code +* [Codeception] fixed codeception coverageHtml option by @gunfrank *2014-12-26* +* [phpspec] Task added by @SebSept *2014-12-26* +* Shortcut options: if option name is like foo|f, assign f as shortcut by @jschnare *2014-12-26* +* [Rsync] Shell escape rsync exclude pattern by @boedah. Fixes #77 (BC break) *2014-12-26* +* [Npm] Task added by @AAlakkad *2014-12-26* + +#### 0.4.6 10/17/2014 + +* [Exec] Output from buffer is not spoiled by special chars *2014-10-17* +* [PHPUnit] detect PHPUnit on Windows or when is globally installed with Composer *2014-10-17* +* Output: added methods askDefault and confirm by @bkawakami *2014-10-17* +* [Svn] Task added by @anvi *2014-08-13* +* [Stack] added dir and printed options *2014-08-12* +* [ExecTask] now uses Executable trait with printed, dir, arg, option methods added *2014-08-12* + + +#### 0.4.5 08/05/2014 + +* [Watch] bugfix: Watch only tracks last file if given array of files #46 *2014-08-05* +* All executable tasks can configure working directory with `dir` option +* If no value for an option is provided, assume it's a VALUE_NONE option. #47 by @pfaocle +* [Changelog] changed style *2014-06-27* +* [GenMarkDown] fixed formatting annotations *2014-06-27* + +#### 0.4.4 06/05/2014 + +* Output can be disabled in all executable tasks by ->printed(false) +* disabled timeouts by default in ParallelExec +* better descriptions for Result output +* changed ParallelTask to display failed process in list +* Changed Output to be stored globally in Robo\Runner class +* Added **SshTask** by @boedah +* Added **RsyncTask** by @boedah +* false option added to proceess* callbacks in GenMarkDownTask to skip processing + + +#### 0.4.3 05/21/2014 + +* added `SemVer` task by **@jadb** +* `yell` output method added +* task `FileSystemStack` added +* `MirrorDirTask` added by **@devster** +* switched to Symfony Filesystem component +* options can be used to commands +* array arguments can be used in commands + +#### 0.4.2 05/09/2014 + +* ask can now hide answers +* Trait Executable added to provide standard way for passing arguments and options +* added ComposerDumpAutoload task by **@pmcjury** +* added FileSystem task by **@jadb** +* added CommonStack metatsk to have similar interface for all stacked tasks by **@jadb** +* arguments and options can be passed into variable and used in exec task +* passing options into commands + + +#### 0.4.1 05/05/2014 + +* [BC] `taskGit` task renamed to `taskGitStack` for compatibility +* unit and functional tests added +* all command tasks now use Symfony\Process to execute them +* enabled Bower and Concat tasks +* added `printed` param to Exec task +* codeception `suite` method now returns `$this` +* timeout options added to Exec task + + +#### 0.4.0 04/27/2014 + +* Codeception task added +* PHPUnit task improved +* Bower task added by @jadb +* ParallelExec task added +* Symfony Process component used for execution +* Task descriptions taken from first line of annotations +* `CommandInterface` added to use tasks as parameters + +#### 0.3.3 02/25/2014 + +* PHPUnit basic task +* fixed doc generation + +#### 0.3.5 02/21/2014 + +* changed generated init template + + +#### 0.3.4 02/21/2014 + +* [PackPhar] ->executable command will remove hashbang when generated stub file +* [Git][Exec] stopOnFail option for Git and Exec stack +* [ExecStack] shortcut for executing bash commands in stack + +#### 0.3.2 02/20/2014 + +* release process now includes phar +* phar executable method added +* git checkout added +* phar pack created + + +#### 0.3.0 02/11/2014 + +* Dynamic configuration via magic methods +* added WriteToFile task +* Result class for managing exit codes and error messages + +#### 0.2.0 01/29/2014 + +* Merged Tasks and Traits to same file +* Added Watcher task +* Added GitHubRelease task +* Added Changelog task +* Added ReplaceInFile task diff --git a/vendor/consolidation/robo/CONTRIBUTING.md b/vendor/consolidation/robo/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..438681469fd2929757732912e54032dc5b06e6d5 --- /dev/null +++ b/vendor/consolidation/robo/CONTRIBUTING.md @@ -0,0 +1,15 @@ +# Contributing to Robo + +Thank you for your interest in contributing to Robo! Here are some of the guidelines you should follow to make the most of your efforts: + +## Code Style Guidelines + +Robo adheres to the [PSR-2 Coding Style Guide](http://www.php-fig.org/psr/psr-2/) for PHP code. An `.editorconfig` file is included with the repository to help you get up and running quickly. Most modern editors support this standard, but if yours does not or you would like to configure your editor manually, follow the guidelines in the document linked above. + +You can run the PHP Codesniffer on your work using a convenient command built into this project's own `RoboFile.php`: +``` +robo sniff src/Foo.php --autofix +``` +The above will run the PHP Codesniffer on the `src/Foo.php` file and automatically correct variances from the PSR-2 standard. Please ensure all contributions are compliant _before_ submitting a pull request. + + diff --git a/vendor/consolidation/robo/LICENSE b/vendor/consolidation/robo/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d1fc34655aaf78ab3e51ef5f35bad0613c730614 --- /dev/null +++ b/vendor/consolidation/robo/LICENSE @@ -0,0 +1,44 @@ +The MIT License (MIT) + +Copyright (c) 2014-2019 Codegyre Developers Team, Consolidation Team + +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. + +DEPENDENCY LICENSES: + +Name Version License +consolidation/annotated-command 2.11.2 MIT +consolidation/config 1.2.0 MIT +consolidation/log 1.1.1 MIT +consolidation/output-formatters 3.4.0 MIT +consolidation/self-update 1.1.5 MIT +container-interop/container-interop 1.2.0 MIT +dflydev/dot-access-data v1.1.0 MIT +grasmash/expander 1.0.0 MIT +grasmash/yaml-expander 1.4.0 MIT +league/container 2.4.1 MIT +psr/container 1.0.0 MIT +psr/log 1.1.0 MIT +symfony/console v4.2.3 MIT +symfony/event-dispatcher v4.2.3 MIT +symfony/filesystem v4.2.3 MIT +symfony/finder v3.4.22 MIT +symfony/polyfill-ctype v1.10.0 MIT +symfony/polyfill-mbstring v1.10.0 MIT +symfony/process v4.2.3 MIT +symfony/yaml v4.2.3 MIT \ No newline at end of file diff --git a/vendor/consolidation/robo/README.md b/vendor/consolidation/robo/README.md new file mode 100644 index 0000000000000000000000000000000000000000..73a8feb22bff49c9e173b5b8bcb5e2398f069245 --- /dev/null +++ b/vendor/consolidation/robo/README.md @@ -0,0 +1,182 @@ +# RoboTask + +_This is the 1.x (stable) branch of the Robo task runner. Development for Robo 2.x (future) is happening on the [master](https://github.com/consolidation/Robo/tree/master) branch._ + +**Modern and simple PHP task runner** inspired by Gulp and Rake aimed to automate common tasks: + +[](https://gitter.im/consolidation/Robo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[](https://packagist.org/packages/consolidation/robo) +[](https://packagist.org/packages/consolidation/robo) +[](https://packagist.org/packages/consolidation/robo) +[](https://travis-ci.org/consolidation/Robo) +[](https://www.versioneye.com/user/projects/57c4a6fe968d64004d97620a?child=57c4a6fe968d64004d97620a#tab-licenses) + +[](https://travis-ci.org/consolidation/Robo) +[](https://ci.appveyor.com/project/greg-1-anderson/robo) +[](https://scrutinizer-ci.com/g/consolidation/Robo/?branch=master) +[](https://www.versioneye.com/user/projects/57c4a6fe968d64004d97620a) + +* writing cross-platform scripts +* processing assets (less, sass, minification) +* running tests +* executing daemons (and workers) +* watching filesystem changes +* deployment with sftp/ssh/docker + +## Installing + +### Phar + +[Download robo.phar >](http://robo.li/robo.phar) + +``` +wget http://robo.li/robo.phar +``` + +To install globally put `robo.phar` in `/usr/bin`. (`/usr/local/bin/` in OSX 10.11+) + +``` +chmod +x robo.phar && sudo mv robo.phar /usr/bin/robo +``` + +OSX 10.11+ +``` +chmod +x robo.phar && sudo mv robo.phar /usr/local/bin/robo +``` + +Now you can use it just like `robo`. + +### Composer + +* Run `composer require consolidation/robo:~1` +* Use `vendor/bin/robo` to execute Robo tasks. + +## Usage + +All tasks are defined as **public methods** in `RoboFile.php`. It can be created by running `robo`. +All protected methods in traits that start with `task` prefix are tasks and can be configured and executed in your tasks. + +## Examples + +The best way to learn Robo by example is to take a look into [its own RoboFile](https://github.com/consolidation/Robo/blob/master/RoboFile.php) + or [RoboFile of Codeception project](https://github.com/Codeception/Codeception/blob/2.4/RoboFile.php). There are also some basic example commands in examples/RoboFile.php. + +Here are some snippets from them: + +--- + +Run acceptance test with local server and selenium server started. + + +``` php +<?php +class RoboFile extends \Robo\Tasks +{ + + function testAcceptance($seleniumPath = '~/selenium-server-standalone-2.39.0.jar') + { + // launches PHP server on port 8000 for web dir + // server will be executed in background and stopped in the end + $this->taskServer(8000) + ->background() + ->dir('web') + ->run(); + + // running Selenium server in background + $this->taskExec('java -jar ' . $seleniumPath) + ->background() + ->run(); + + // loading Symfony Command and running with passed argument + $this->taskSymfonyCommand(new \Codeception\Command\Run('run')) + ->arg('suite','acceptance') + ->run(); + } +} +``` + +If you execute `robo` you will see this task added to list of available task with name: `test:acceptance`. +To execute it you should run `robo test:acceptance`. You may change path to selenium server by passing new path as a argument: + +``` +robo test:acceptance "C:\Downloads\selenium.jar" +``` + +Using `watch` task so you can use it for running tests or building assets. + +``` php +<?php +class RoboFile extends \Robo\Tasks { + + function watchComposer() + { + // when composer.json changes `composer update` will be executed + $this->taskWatch()->monitor('composer.json', function() { + $this->taskComposerUpdate()->run(); + })->run(); + } +} +``` + +--- + +Cleaning logs and cache + +``` php +<?php +class RoboFile extends \Robo\Tasks +{ + public function clean() + { + $this->taskCleanDir([ + 'app/cache', + 'app/logs' + ])->run(); + + $this->taskDeleteDir([ + 'web/assets/tmp_uploads', + ])->run(); + } +} +``` + +This task cleans `app/cache` and `app/logs` dirs (ignoring .gitignore and .gitkeep files) +Can be executed by running: + +``` +robo clean +``` + +---- + +Creating Phar archive + +``` php +function buildPhar() +{ + $files = Finder::create()->ignoreVCS(true)->files()->name('*.php')->in(__DIR__); + $packer = $this->taskPackPhar('robo.phar'); + foreach ($files as $file) { + $packer->addFile($file->getRelativePathname(), $file->getRealPath()); + } + $packer->addFile('robo','robo') + ->executable('robo') + ->run(); +} +``` + +--- + +## We need more tasks! + +Create your own tasks and send them as Pull Requests or create packages [with `"type": "robo-tasks"` in `composer.json` on Packagist](https://packagist.org/?type=robo-tasks). + +## Credits + +Follow [@robo_php](http://twitter.com/robo_php) for updates. + +Brought to you by [Consolidation Team](https://github.com/orgs/consolidation/people) and our [awesome contributors](https://github.com/consolidation/Robo/graphs/contributors). + +## License + +[MIT](https://github.com/consolidation/Robo/blob/master/LICENSE) diff --git a/vendor/consolidation/robo/RoboFile.php b/vendor/consolidation/robo/RoboFile.php new file mode 100644 index 0000000000000000000000000000000000000000..2dcb09cd146b82de685c728c42802ca2e85cf664 --- /dev/null +++ b/vendor/consolidation/robo/RoboFile.php @@ -0,0 +1,470 @@ +<?php +use Symfony\Component\Finder\Finder; + +class RoboFile extends \Robo\Tasks +{ + /** + * Run the Robo unit tests. + */ + public function test(array $args, $options = + [ + 'coverage-html' => false, + 'coverage' => false + ]) + { + $taskCodecept = $this->taskCodecept() + ->args($args); + + if ($options['coverage']) { + $taskCodecept->coverageXml('../../build/logs/clover.xml'); + } + if ($options['coverage-html']) { + $taskCodecept->coverageHtml('../../build/logs/coverage'); + } + + return $taskCodecept->run(); + } + + /** + * Code sniffer. + * + * Run the PHP Codesniffer on a file or directory. + * + * @param string $file + * A file or directory to analyze. + * @option $autofix Whether to run the automatic fixer or not. + * @option $strict Show warnings as well as errors. + * Default is to show only errors. + */ + public function sniff( + $file = 'src/', + $options = [ + 'autofix' => false, + 'strict' => false, + ] + ) { + $strict = $options['strict'] ? '' : '-n'; + $result = $this->taskExec("./vendor/bin/phpcs --standard=PSR2 --exclude=Squiz.Classes.ValidClassName {$strict} {$file}")->run(); + if (!$result->wasSuccessful()) { + if (!$options['autofix']) { + $options['autofix'] = $this->confirm('Would you like to run phpcbf to fix the reported errors?'); + } + if ($options['autofix']) { + $result = $this->taskExec("./vendor/bin/phpcbf --standard=PSR2 --exclude=Squiz.Classes.ValidClassName {$file}")->run(); + } + } + return $result; + } + + /** + * Generate a new Robo task that wraps an existing utility class. + * + * @param $className The name of the existing utility class to wrap. + * @param $wrapperClassName The name of the wrapper class to create. Optional. + * @usage generate:task 'Symfony\Component\Filesystem\Filesystem' FilesystemStack + */ + public function generateTask($className, $wrapperClassName = "") + { + return $this->taskGenTask($className, $wrapperClassName)->run(); + } + + /** + * Release Robo. + */ + public function release($opts = ['beta' => false]) + { + $this->checkPharReadonly(); + + $version = \Robo\Robo::VERSION; + $stable = !$opts['beta']; + if ($stable) { + $version = preg_replace('/-.*/', '', $version); + } + else { + $version = $this->incrementVersion($version, 'beta'); + } + $this->writeVersion($version); + $this->yell("Releasing Robo $version"); + + $this->docs(); + $this->taskGitStack() + ->add('-A') + ->commit("Robo release $version") + ->pull() + ->push() + ->run(); + + $this->publish(); + $this->taskGitStack() + ->tag($version) + ->push('origin 1.x --tags') + ->run(); + + if ($stable) { + $this->pharPublish(); + $version = $this->incrementVersion($version) . '-dev'; + $this->writeVersion($version); + + $this->taskGitStack() + ->add('-A') + ->commit("Prepare for $version") + ->push() + ->run(); + } + } + + /** + * Update changelog. + * + * Add an entry to the Robo CHANGELOG.md file. + * + * @param string $addition The text to add to the change log. + */ + public function changed($addition) + { + $version = preg_replace('/-.*/', '', \Robo\Robo::VERSION); + return $this->taskChangelog() + ->version($version) + ->change($addition) + ->run(); + } + + /** + * Update the version of Robo. + * + * @param string $version The new verison for Robo. + * Defaults to the next minor (bugfix) version after the current relelase. + * @option stage The version stage: dev, alpha, beta or rc. Use empty for stable. + */ + public function versionBump($version = '', $options = ['stage' => '']) + { + // If the user did not specify a version, then update the current version. + if (empty($version)) { + $version = $this->incrementVersion(\Robo\Robo::VERSION, $options['stage']); + } + return $this->writeVersion($version); + } + + /** + * Write the specified version string back into the Robo.php file. + * @param string $version + */ + protected function writeVersion($version) + { + // Write the result to a file. + return $this->taskReplaceInFile(__DIR__.'/src/Robo.php') + ->regex("#VERSION = '[^']*'#") + ->to("VERSION = '".$version."'") + ->run(); + } + + /** + * Advance to the next SemVer version. + * + * The behavior depends on the parameter $stage. + * - If $stage is empty, then the patch or minor version of $version is incremented + * - If $stage matches the current stage in the current version, then add one + * to the stage (e.g. alpha3 -> alpha4) + * - If $stage does not match the current stage in the current version, then + * reset to '1' (e.g. alpha4 -> beta1) + * + * @param string $version A SemVer version + * @param string $stage dev, alpha, beta, rc or an empty string for stable. + * @return string + */ + protected function incrementVersion($version, $stage = '') + { + $stable = empty($stage); + $versionStageNumber = '0'; + preg_match('/-([a-zA-Z]*)([0-9]*)/', $version, $match); + $match += ['', '', '']; + $versionStage = $match[1]; + $versionStageNumber = $match[2]; + if ($versionStage != $stage) { + $versionStageNumber = 0; + } + $version = preg_replace('/-.*/', '', $version); + $versionParts = explode('.', $version); + if ($stable) { + $versionParts[count($versionParts)-1]++; + } + $version = implode('.', $versionParts); + if (!$stable) { + $version .= '-' . $stage; + if ($stage != 'dev') { + $versionStageNumber++; + $version .= $versionStageNumber; + } + } + return $version; + } + + /** + * Generate the Robo documentation files. + */ + public function docs() + { + $collection = $this->collectionBuilder(); + $collection->progressMessage('Generate documentation from source code.'); + $files = Finder::create()->files()->name('*.php')->in('src/Task'); + $docs = []; + foreach ($files as $file) { + if ($file->getFileName() == 'loadTasks.php') { + continue; + } + if ($file->getFileName() == 'loadShortcuts.php') { + continue; + } + $ns = $file->getRelativePath(); + if (!$ns) { + continue; + } + $class = basename(substr($file, 0, -4)); + class_exists($class = "Robo\\Task\\$ns\\$class"); + $docs[$ns][] = $class; + } + ksort($docs); + + foreach ($docs as $ns => $tasks) { + $taskGenerator = $collection->taskGenDoc("docs/tasks/$ns.md"); + $taskGenerator->filterClasses(function (\ReflectionClass $r) { + return !($r->isAbstract() || $r->isTrait()) && $r->implementsInterface('Robo\Contract\TaskInterface'); + })->prepend("# $ns Tasks"); + sort($tasks); + foreach ($tasks as $class) { + $taskGenerator->docClass($class); + } + + $taskGenerator->filterMethods( + function (\ReflectionMethod $m) { + if ($m->isConstructor() || $m->isDestructor() || $m->isStatic()) { + return false; + } + $undocumentedMethods = + [ + '', + 'run', + '__call', + 'inflect', + 'injectDependencies', + 'getCommand', + 'getPrinted', + 'getConfig', + 'setConfig', + 'logger', + 'setLogger', + 'setProgressIndicator', + 'progressIndicatorSteps', + 'setBuilder', + 'getBuilder', + 'collectionBuilder', + 'setVerbosityThreshold', + 'verbosityThreshold', + 'setOutputAdapter', + 'outputAdapter', + 'hasOutputAdapter', + 'verbosityMeetsThreshold', + 'writeMessage', + 'detectInteractive', + 'background', + 'timeout', + 'idleTimeout', + 'env', + 'envVars', + 'setInput', + 'interactive', + 'silent', + 'printed', + 'printOutput', + 'printMetadata', + ]; + return !in_array($m->name, $undocumentedMethods) && $m->isPublic(); // methods are not documented + } + )->processClassSignature( + function ($c) { + return "## " . preg_replace('~Task$~', '', $c->getShortName()) . "\n"; + } + )->processClassDocBlock( + function (\ReflectionClass $c, $doc) { + $doc = preg_replace('~@method .*?(.*?)\)~', '* `$1)` ', $doc); + $doc = str_replace('\\'.$c->name, '', $doc); + return $doc; + } + )->processMethodSignature( + function (\ReflectionMethod $m, $text) { + return str_replace('#### *public* ', '* `', $text) . '`'; + } + )->processMethodDocBlock( + function (\ReflectionMethod $m, $text) { + + return $text ? ' ' . trim(strtok($text, "\n"), "\n") : ''; + } + ); + } + $collection->progressMessage('Documentation generation complete.'); + return $collection->run(); + } + + /** + * Publish Robo. + * + * Builds a site in gh-pages branch. Uses mkdocs + */ + public function publish() + { + $current_branch = exec('git rev-parse --abbrev-ref HEAD'); + + return $this->collectionBuilder() + ->taskGitStack() + ->checkout('site') + ->merge('1.x') + ->completion($this->taskGitStack()->checkout($current_branch)) + ->taskFilesystemStack() + ->copy('CHANGELOG.md', 'docs/changelog.md') + ->completion($this->taskFilesystemStack()->remove('docs/changelog.md')) + ->taskExec('mkdocs gh-deploy') + ->run(); + } + + /** + * Build the Robo phar executable. + */ + public function pharBuild() + { + $this->checkPharReadonly(); + + // Create a collection builder to hold the temporary + // directory until the pack phar task runs. + $collection = $this->collectionBuilder(); + + $workDir = $collection->tmpDir(); + $roboBuildDir = "$workDir/robo"; + + // Before we run `composer install`, we will remove the dev + // dependencies that we only use in the unit tests. Any dev dependency + // that is in the 'suggested' section is used by a core task; + // we will include all of those in the phar. + $devProjectsToRemove = $this->devDependenciesToRemoveFromPhar(); + + // We need to create our work dir and run `composer install` + // before we prepare the pack phar task, so create a separate + // collection builder to do this step in. + $prepTasks = $this->collectionBuilder(); + + $preparationResult = $prepTasks + ->taskFilesystemStack() + ->mkdir($workDir) + ->taskRsync() + ->fromPath( + [ + __DIR__ . '/composer.json', + __DIR__ . '/scripts', + __DIR__ . '/src', + __DIR__ . '/data' + ] + ) + ->toPath($roboBuildDir) + ->recursive() + ->progress() + ->stats() + ->taskComposerRemove() + ->dir($roboBuildDir) + ->dev() + ->noUpdate() + ->args($devProjectsToRemove) + ->taskComposerInstall() + ->dir($roboBuildDir) + ->noScripts() + ->printed(true) + ->run(); + + // Exit if the preparation step failed + if (!$preparationResult->wasSuccessful()) { + return $preparationResult; + } + + // Decide which files we're going to pack + $files = Finder::create()->ignoreVCS(true) + ->files() + ->name('*.php') + ->name('*.exe') // for 1symfony/console/Resources/bin/hiddeninput.exe + ->name('GeneratedWrapper.tmpl') + ->path('src') + ->path('vendor') + ->notPath('docs') + ->notPath('/vendor\/.*\/[Tt]est/') + ->in(is_dir($roboBuildDir) ? $roboBuildDir : __DIR__); + + // Build the phar + return $collection + ->taskPackPhar('robo.phar') + ->addFiles($files) + ->addFile('robo', 'robo') + ->executable('robo') + ->taskFilesystemStack() + ->chmod('robo.phar', 0777) + ->run(); + } + + protected function checkPharReadonly() + { + if (ini_get('phar.readonly')) { + throw new \Exception('Must set "phar.readonly = Off" in php.ini to build phars.'); + } + } + + /** + * The phar:build command removes the project requirements from the + * 'require-dev' section that are not in the 'suggest' section. + * + * @return array + */ + protected function devDependenciesToRemoveFromPhar() + { + $composerInfo = (array) json_decode(file_get_contents(__DIR__ . '/composer.json')); + + $devDependencies = array_keys((array)$composerInfo['require-dev']); + $suggestedProjects = array_keys((array)$composerInfo['suggest']); + + return array_diff($devDependencies, $suggestedProjects); + } + + /** + * Install Robo phar. + * + * Installs the Robo phar executable in /usr/bin. Uses 'sudo'. + */ + public function pharInstall() + { + return $this->taskExec('sudo cp') + ->arg('robo.phar') + ->arg('/usr/bin/robo') + ->run(); + } + + /** + * Publish Robo phar. + * + * Commits the phar executable to Robo's GitHub pages site. + */ + public function pharPublish() + { + $this->pharBuild(); + + $this->collectionBuilder() + ->taskFilesystemStack() + ->rename('robo.phar', 'robo-release.phar') + ->taskGitStack() + ->checkout('site') + ->pull('origin site') + ->taskFilesystemStack() + ->remove('robotheme/robo.phar') + ->rename('robo-release.phar', 'robotheme/robo.phar') + ->taskGitStack() + ->add('robotheme/robo.phar') + ->commit('Update robo.phar to ' . \Robo\Robo::VERSION) + ->push('origin site') + ->checkout('1.x') + ->run(); + } +} diff --git a/vendor/consolidation/robo/codeception.yml b/vendor/consolidation/robo/codeception.yml new file mode 100644 index 0000000000000000000000000000000000000000..09763ea714360ce3ea0ab0e6d7b7152498fb1bac --- /dev/null +++ b/vendor/consolidation/robo/codeception.yml @@ -0,0 +1,21 @@ +actor: Guy +paths: + tests: tests + log: tests/_log + data: tests/_data + helpers: tests/_helpers +settings: + bootstrap: _bootstrap.php + colors: true + memory_limit: 1024M +modules: + config: + Db: + dsn: '' + user: '' + password: '' + dump: tests/_data/dump.sql +coverage: + enabled: true + include: + - src/* diff --git a/vendor/consolidation/robo/composer.json b/vendor/consolidation/robo/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..8ff652444574768c02c302cbd8a3848a1ecc1113 --- /dev/null +++ b/vendor/consolidation/robo/composer.json @@ -0,0 +1,118 @@ +{ + "name": "consolidation/robo", + "description": "Modern task runner", + "license": "MIT", + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "autoload":{ + "psr-4":{ + "Robo\\":"src" + } + }, + "autoload-dev":{ + "psr-4":{ + "Robo\\":"tests/src", + "RoboExample\\":"examples/src" + } + }, + "bin":["robo"], + "require": { + "php": ">=5.5.0", + "league/container": "^2.2", + "consolidation/log": "~1", + "consolidation/config": "^1.2", + "consolidation/annotated-command": "^2.10.2", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "symfony/finder": "^2.5|^3|^4", + "symfony/console": "^2.8|^3|^4", + "symfony/process": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "patchwork/jsqueeze": "~2", + "natxet/CssMin": "3.0.4", + "pear/archive_tar": "^1.4.4", + "codeception/base": "^2.3.7", + "goaop/framework": "~2.1.2", + "codeception/verify": "^0.3.2", + "codeception/aspect-mock": "^1|^2.1.1", + "goaop/parser-reflection": "^1.1.0", + "nikic/php-parser": "^3.1.5", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "cs": "./robo sniff", + "unit": "./robo test --coverage", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "pre-install-cmd": [ + "Robo\\composer\\ScriptHandler::checkDependencies" + ] + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "5.6.3" + } + }, + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "suggest": { + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively.", + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "natxet/CssMin": "For minifying CSS files in taskMinify" + }, + "replace": { + "codegyre/robo": "< 1.0" + } +} diff --git a/vendor/consolidation/robo/composer.lock b/vendor/consolidation/robo/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..3a709f76bb4fb9e686f6682b1071e1a7583c226c --- /dev/null +++ b/vendor/consolidation/robo/composer.lock @@ -0,0 +1,4193 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "90d835cb3183287ad1fb46b4c4b32c7b", + "packages": [ + { + "name": "consolidation/annotated-command", + "version": "2.11.2", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "004af26391cd7d1cd04b0ac736dc1324d1b4f572" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/004af26391cd7d1cd04b0ac736dc1324d1b4f572", + "reference": "004af26391cd7d1cd04b0ac736dc1324d1b4f572", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.5", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2019-02-02T02:29:53+00:00" + }, + { + "name": "consolidation/config", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "11ab7ecd19131ce084390171b9c070eedecf7dab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/11ab7ecd19131ce084390171b9c070eedecf7dab", + "reference": "11ab7ecd19131ce084390171b9c070eedecf7dab", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2019-02-16T01:18:47+00:00" + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^5.7.27", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "3.2.3", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2018-10-19T22:35:38+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/069bf3f0e8f871a2169a06e43d9f3f03f355e9be", + "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.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" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2019-01-25T10:42:12+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", + "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2019-01-25T10:19:25+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ed5be1663fa66623b3a7004d5d51a14c4045399b", + "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:27:11+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b52454ec66fe5082b7a66a491339d1f1da9a5a0d", + "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:27:11+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "7c0c627220308928e958a87c293108e5891cde1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/7c0c627220308928e958a87c293108e5891cde1d", + "reference": "7c0c627220308928e958a87c293108e5891cde1d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:43:35+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:27:11+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T10:59:17+00:00" + } + ], + "packages-dev": [ + { + "name": "behat/gherkin", + "version": "v4.6.0", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/ab0a02ea14893860bca00f225f5621d351a3ad07", + "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.5|~5", + "symfony/phpunit-bridge": "~2.7|~3|~4", + "symfony/yaml": "~2.3|~3|~4" + }, + "suggest": { + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Cucumber", + "DSL", + "gherkin", + "parser" + ], + "time": "2019-01-16T14:22:17+00:00" + }, + { + "name": "codeception/aspect-mock", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/Codeception/AspectMock.git", + "reference": "bf3c000599c0dc75ecb52e19dee2b8ed294cf7ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/AspectMock/zipball/bf3c000599c0dc75ecb52e19dee2b8ed294cf7ba", + "reference": "bf3c000599c0dc75ecb52e19dee2b8ed294cf7ba", + "shasum": "" + }, + "require": { + "goaop/framework": "^2.0.0", + "php": ">=5.6.0", + "symfony/finder": "~2.4|~3.0" + }, + "require-dev": { + "codeception/base": "~2.1", + "codeception/specify": "~0.3", + "codeception/verify": "~0.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "AspectMock": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@codeception.com" + } + ], + "description": "Experimental Mocking Framework powered by Aspects", + "time": "2017-10-24T10:20:17+00:00" + }, + { + "name": "codeception/base", + "version": "2.5.3", + "source": { + "type": "git", + "url": "https://github.com/Codeception/base.git", + "reference": "ceff0b4fee4846b6bd8b5a37abbbb1acd6e78f58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/base/zipball/ceff0b4fee4846b6bd8b5a37abbbb1acd6e78f58", + "reference": "ceff0b4fee4846b6bd8b5a37abbbb1acd6e78f58", + "shasum": "" + }, + "require": { + "behat/gherkin": "^4.4.0", + "codeception/phpunit-wrapper": "^6.0.9|^7.0.6", + "codeception/stub": "^2.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/psr7": "~1.0", + "php": ">=5.6.0 <8.0", + "symfony/browser-kit": ">=2.7 <5.0", + "symfony/console": ">=2.7 <5.0", + "symfony/css-selector": ">=2.7 <5.0", + "symfony/dom-crawler": ">=2.7 <5.0", + "symfony/event-dispatcher": ">=2.7 <5.0", + "symfony/finder": ">=2.7 <5.0", + "symfony/yaml": ">=2.7 <5.0" + }, + "require-dev": { + "codeception/specify": "~0.3", + "facebook/graph-sdk": "~5.3", + "flow/jsonpath": "~0.2", + "monolog/monolog": "~1.8", + "pda/pheanstalk": "~3.0", + "php-amqplib/php-amqplib": "~2.4", + "predis/predis": "^1.0", + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": ">=2.7 <5.0", + "vlucas/phpdotenv": "^3.0" + }, + "suggest": { + "aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module", + "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests", + "codeception/specify": "BDD-style code blocks", + "codeception/verify": "BDD-style assertions", + "flow/jsonpath": "For using JSONPath in REST module", + "league/factory-muffin": "For DataFactory module", + "league/factory-muffin-faker": "For Faker support in DataFactory module", + "phpseclib/phpseclib": "for SFTP option in FTP Module", + "stecman/symfony-console-completion": "For BASH autocompletion", + "symfony/phpunit-bridge": "For phpunit-bridge support" + }, + "bin": [ + "codecept" + ], + "type": "library", + "extra": { + "branch-alias": [] + }, + "autoload": { + "psr-4": { + "Codeception\\": "src/Codeception", + "Codeception\\Extension\\": "ext" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@mail.ua", + "homepage": "http://codegyre.com" + } + ], + "description": "BDD-style testing framework", + "homepage": "http://codeception.com/", + "keywords": [ + "BDD", + "TDD", + "acceptance testing", + "functional testing", + "unit testing" + ], + "time": "2019-02-02T16:29:38+00:00" + }, + { + "name": "codeception/phpunit-wrapper", + "version": "6.0.14", + "source": { + "type": "git", + "url": "https://github.com/Codeception/phpunit-wrapper.git", + "reference": "3b64beb0af3e63145af982e64718ab80d2417739" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/3b64beb0af3e63145af982e64718ab80d2417739", + "reference": "3b64beb0af3e63145af982e64718ab80d2417739", + "shasum": "" + }, + "require": { + "phpunit/php-code-coverage": ">=4.0.4 <6.0", + "phpunit/phpunit": ">=5.7.27 <6.5.13", + "sebastian/comparator": ">=1.2.4 <3.0", + "sebastian/diff": ">=1.4 <4.0" + }, + "replace": { + "codeception/phpunit-wrapper": "*" + }, + "require-dev": { + "codeception/specify": "*", + "vlucas/phpdotenv": "^2.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Codeception\\PHPUnit\\": "src\\" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "PHPUnit classes used by Codeception", + "time": "2019-01-13T10:35:17+00:00" + }, + { + "name": "codeception/stub", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Stub.git", + "reference": "f50bc271f392a2836ff80690ce0c058efe1ae03e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Stub/zipball/f50bc271f392a2836ff80690ce0c058efe1ae03e", + "reference": "f50bc271f392a2836ff80690ce0c058efe1ae03e", + "shasum": "" + }, + "require": { + "phpunit/phpunit": ">=4.8 <8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Codeception\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", + "time": "2018-07-26T11:55:37+00:00" + }, + { + "name": "codeception/verify", + "version": "0.3.3", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Verify.git", + "reference": "5d649dda453cd814dadc4bb053060cd2c6bb4b4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Verify/zipball/5d649dda453cd814dadc4bb053060cd2c6bb4b4c", + "reference": "5d649dda453cd814dadc4bb053060cd2c6bb4b4c", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/Codeception/function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert.php@mailican.com" + } + ], + "description": "BDD assertion library for PHPUnit", + "time": "2017-01-09T10:58:51+00:00" + }, + { + "name": "doctrine/annotations", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2017-02-24T16:22:25+00:00" + }, + { + "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-14T21:17:01+00:00" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/28f932580981e912ab8f01d15788f1dee06550c8", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2019-02-11T20:22:44+00:00" + }, + { + "name": "goaop/framework", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/goaop/framework.git", + "reference": "6e2a0fe13c1943db02a67588cfd27692bddaffa5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/goaop/framework/zipball/6e2a0fe13c1943db02a67588cfd27692bddaffa5", + "reference": "6e2a0fe13c1943db02a67588cfd27692bddaffa5", + "shasum": "" + }, + "require": { + "doctrine/annotations": "~1.0", + "goaop/parser-reflection": "~1.2", + "jakubledl/dissect": "~1.0", + "php": ">=5.6.0" + }, + "require-dev": { + "adlawson/vfs": "^0.12", + "doctrine/orm": "^2.5", + "phpunit/phpunit": "^4.8", + "symfony/console": "^2.7|^3.0" + }, + "suggest": { + "symfony/console": "Enables the usage of the command-line tool." + }, + "bin": [ + "bin/aspect" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Go\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lisachenko Alexander", + "homepage": "https://github.com/lisachenko" + } + ], + "description": "Framework for aspect-oriented programming in PHP.", + "homepage": "http://go.aopphp.com/", + "keywords": [ + "aop", + "aspect", + "library", + "php" + ], + "time": "2017-07-12T11:46:25+00:00" + }, + { + "name": "goaop/parser-reflection", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/goaop/parser-reflection.git", + "reference": "d9c1dcc7ce4a5284fe3530e011faf9c9c10e1166" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/goaop/parser-reflection/zipball/d9c1dcc7ce4a5284fe3530e011faf9c9c10e1166", + "reference": "d9c1dcc7ce4a5284fe3530e011faf9c9c10e1166", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^1.2|^2.0|^3.0", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Go\\ParserReflection\\": "src" + }, + "files": [ + "src/bootstrap.php" + ], + "exclude-from-classmap": [ + "/tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander Lisachenko", + "email": "lisachenko.it@gmail.com" + } + ], + "description": "Provides reflection information, based on raw source", + "time": "2018-03-19T15:57:41+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "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": "*", + "monolog/monolog": "1.*", + "phpunit/phpunit": "3.7.*", + "psr/log": "1.0.*", + "symfony/class-loader": "*", + "zendframework/zend-cache": "<2.3", + "zendframework/zend-log": "<2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.8-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": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2014-01-28T22:29:15+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-04T20:46:45+00:00" + }, + { + "name": "jakubledl/dissect", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/jakubledl/dissect.git", + "reference": "d3a391de31e45a247e95cef6cf58a91c05af67c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jakubledl/dissect/zipball/d3a391de31e45a247e95cef6cf58a91c05af67c4", + "reference": "d3a391de31e45a247e95cef6cf58a91c05af67c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/console": "~2.1" + }, + "suggest": { + "symfony/console": "for the command-line tool" + }, + "bin": [ + "bin/dissect.php", + "bin/dissect" + ], + "type": "library", + "autoload": { + "psr-0": { + "Dissect": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "unlicense" + ], + "authors": [ + { + "name": "Jakub Lédl", + "email": "jakubledl@gmail.com" + } + ], + "description": "Lexing and parsing in pure PHP", + "homepage": "https://github.com/jakubledl/dissect", + "keywords": [ + "ast", + "lexing", + "parser", + "parsing" + ], + "time": "2013-01-29T21:29:14+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "natxet/CssMin", + "version": "v3.0.4", + "source": { + "type": "git", + "url": "https://github.com/natxet/CssMin.git", + "reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/natxet/CssMin/zipball/92de3fe3ccb4f8298d31952490ef7d5395855c39", + "reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39", + "shasum": "" + }, + "require": { + "php": ">=5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joe Scylla", + "email": "joe.scylla@gmail.com", + "homepage": "https://profiles.google.com/joe.scylla" + } + ], + "description": "Minifying CSS", + "homepage": "http://code.google.com/p/cssmin/", + "keywords": [ + "css", + "minify" + ], + "time": "2015-09-25T11:13:11+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "patchwork/jsqueeze", + "version": "v2.0.5", + "source": { + "type": "git", + "url": "https://github.com/tchwork/jsqueeze.git", + "reference": "693d64850eab2ce6a7c8f7cf547e1ab46e69d542" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tchwork/jsqueeze/zipball/693d64850eab2ce6a7c8f7cf547e1ab46e69d542", + "reference": "693d64850eab2ce6a7c8f7cf547e1ab46e69d542", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Patchwork\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "(Apache-2.0 or GPL-2.0)" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + } + ], + "description": "Efficient JavaScript minification in PHP", + "homepage": "https://github.com/tchwork/jsqueeze", + "keywords": [ + "compression", + "javascript", + "minification" + ], + "time": "2016-04-19T09:28:22+00:00" + }, + { + "name": "pear/archive_tar", + "version": "1.4.6", + "source": { + "type": "git", + "url": "https://github.com/pear/Archive_Tar.git", + "reference": "b8e33f9063a7cd1d20f079014f8382b3a7aee47e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/b8e33f9063a7cd1d20f079014f8382b3a7aee47e", + "reference": "b8e33f9063a7cd1d20f079014f8382b3a7aee47e", + "shasum": "" + }, + "require": { + "pear/pear-core-minimal": "^1.10.0alpha2", + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-bz2": "Bz2 compression support.", + "ext-xz": "Lzma2 compression support.", + "ext-zlib": "Gzip compression support." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Archive_Tar": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Vincent Blavet", + "email": "vincent@phpconcept.net" + }, + { + "name": "Greg Beaver", + "email": "greg@chiaraquartet.net" + }, + { + "name": "Michiel Rook", + "email": "mrook@php.net" + } + ], + "description": "Tar file management class with compression support (gzip, bzip2, lzma2)", + "homepage": "https://github.com/pear/Archive_Tar", + "keywords": [ + "archive", + "tar" + ], + "time": "2019-02-01T11:10:38+00:00" + }, + { + "name": "pear/console_getopt", + "version": "v1.4.2", + "source": { + "type": "git", + "url": "https://github.com/pear/Console_Getopt.git", + "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/6c77aeb625b32bd752e89ee17972d103588b90c0", + "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Console": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Greg Beaver", + "email": "cellog@php.net", + "role": "Helper" + }, + { + "name": "Andrei Zmievski", + "email": "andrei@php.net", + "role": "Lead" + }, + { + "name": "Stig Bakken", + "email": "stig@php.net", + "role": "Developer" + } + ], + "description": "More info available on: http://pear.php.net/package/Console_Getopt", + "time": "2019-02-06T16:52:33+00:00" + }, + { + "name": "pear/pear-core-minimal", + "version": "v1.10.7", + "source": { + "type": "git", + "url": "https://github.com/pear/pear-core-minimal.git", + "reference": "19a3e0fcd50492c4357372f623f55f1b144346da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/19a3e0fcd50492c4357372f623f55f1b144346da", + "reference": "19a3e0fcd50492c4357372f623f55f1b144346da", + "shasum": "" + }, + "require": { + "pear/console_getopt": "~1.4", + "pear/pear_exception": "~1.0" + }, + "replace": { + "rsky/pear-core-min": "self.version" + }, + "type": "library", + "autoload": { + "psr-0": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "src/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@php.net", + "role": "Lead" + } + ], + "description": "Minimal set of PEAR core files to be used as composer dependency", + "time": "2018-12-05T20:03:52+00:00" + }, + { + "name": "pear/pear_exception", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/pear/PEAR_Exception.git", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b", + "shasum": "" + }, + "require": { + "php": ">=4.4.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "class", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "PEAR": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "." + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Helgi Thormar", + "email": "dufuz@php.net" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net" + } + ], + "description": "The PEAR Exception base class.", + "homepage": "https://github.com/pear/PEAR_Exception", + "keywords": [ + "exception" + ], + "time": "2015-02-10T20:07:52+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-10T14:09:06+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/browser-kit", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "884689e5d29fc3c48498a0038e96d60e4f91b471" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/884689e5d29fc3c48498a0038e96d60e4f91b471", + "reference": "884689e5d29fc3c48498a0038e96d60e4f91b471", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/dom-crawler": "~2.8|~3.0|~4.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T09:39:14+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "c9bc510c217075d42d4a927e285917d0c2001cf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/c9bc510c217075d42d4a927e285917d0c2001cf4", + "reference": "c9bc510c217075d42d4a927e285917d0c2001cf4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "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" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2019-01-30T11:33:42+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "8ca29297c29b64fb3a1a135e71cb25f67f9fdccf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/8ca29297c29b64fb3a1a135e71cb25f67f9fdccf", + "reference": "8ca29297c29b64fb3a1a135e71cb25f67f9fdccf", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T09:39:14+00:00" + }, + { + "name": "symfony/dom-crawler", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "32cb577c07bd900ee883a9d4b55d4098aa02e422" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/32cb577c07bd900ee883a9d4b55d4098aa02e422", + "reference": "32cb577c07bd900ee883a9d4b55d4098aa02e422", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:27:11+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "2a651c2645c10bbedd21170771f122d935e0dd58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2a651c2645c10bbedd21170771f122d935e0dd58", + "reference": "2a651c2645c10bbedd21170771f122d935e0dd58", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T09:39:14+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.6.3" + } +} diff --git a/vendor/consolidation/robo/data/Task/Development/GeneratedWrapper.tmpl b/vendor/consolidation/robo/data/Task/Development/GeneratedWrapper.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..6682748f06112fc11ec666ebe0593f9a962efe68 --- /dev/null +++ b/vendor/consolidation/robo/data/Task/Development/GeneratedWrapper.tmpl @@ -0,0 +1,39 @@ +<?php +namespace Robo\Task\{delegateNamespace}; + +use Robo\Result; +use Robo\Task\StackBasedTask; +use {delegateNamespace}\{delegate}; + +/** + * Wrapper for {delegate} Component. + * Comands are executed in stack and can be stopped on first fail with `stopOnFail` option. + * + * ``` php + * <?php + * $this->task{wrapperClassName}() + * ... + * ->run(); + * + * // one line + * ... + * + * ?> + * ``` + * +{methodList} + */ +class {wrapperClassName} extends StackBasedTask +{ + protected $delegate; + + public function __construct() + { + $this->delegate = new {delegate}(); + } + + protected function getDelegate() + { + return $this->delegate; + }{immediateMethods}{methodImplementations} +} diff --git a/vendor/consolidation/robo/dependencies.yml b/vendor/consolidation/robo/dependencies.yml new file mode 100644 index 0000000000000000000000000000000000000000..f70d8c36ed29c4249d0e6a56ab53f2983b942cfa --- /dev/null +++ b/vendor/consolidation/robo/dependencies.yml @@ -0,0 +1,14 @@ +version: 2 +dependencies: +- type: php + settings: + composer_options: "--no-dev" # used in "collection", overriden when actually making updates + lockfile_updates: + settings: + composer_options: "" + manifest_updates: + settings: + composer_options: "" + filters: + - name: ".*" + versions: "L.Y.Y" diff --git a/vendor/consolidation/robo/phpunit.xml b/vendor/consolidation/robo/phpunit.xml new file mode 100644 index 0000000000000000000000000000000000000000..b2d8394aa3230e3e7f2e7a09ee08b562629ee753 --- /dev/null +++ b/vendor/consolidation/robo/phpunit.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" + backupGlobals="false" + backupStaticAttributes="false" + beStrictAboutChangesToGlobalState="true" + beStrictAboutOutputDuringTests="true" + beStrictAboutTestsThatDoNotTestAnything="true" + bootstrap="vendor/autoload.php" + colors="true" + columns="max" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + stopOnError="false" + stopOnFailure="false" + stopOnRisky="false" + verbose="true" +> + <php> + <ini name="error_reporting" value="E_ALL" /> + </php> + + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">./src</directory> + </whitelist> + </filter> + + <logging> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> +</phpunit> diff --git a/vendor/consolidation/robo/robo b/vendor/consolidation/robo/robo new file mode 100755 index 0000000000000000000000000000000000000000..b6707d27f9b86f2ce94d14537e041a87b40bc0c7 --- /dev/null +++ b/vendor/consolidation/robo/robo @@ -0,0 +1,49 @@ +#!/usr/bin/env php +<?php +/** + * If we're running from phar load the phar autoload, + * else let the script 'robo' search for the autoloader. + */ + +// Hack: \Phar::running() cannot be used reliably here to determine +// if we are running as a phar or not (works when phar is built with +// box, but does not work when phar is built with the Robo phar task.) +// We will use __FILE__ to determine our phar path; however, we cannot +// distinguish whether a __FILE__ of "/path/robo" is this file, or a +// 'robo.phar' that has been renamed to 'robo'. We will use the file +// size to differentiate. +// Recommendation: Use box to build your phar. See https://github.com/g1a/starter +$isPhar = (filesize(__FILE__) > 500000); + +// Non-phar autoloader paths +$candidates = [ + __DIR__.'/vendor/autoload.php', + __DIR__.'/../../autoload.php', +]; + +// Use our phar alias path +if ($isPhar) { + array_unshift($candidates, 'phar://robo.phar/vendor/autoload.php'); +} + +$autoloaderPath = false; +foreach ($candidates as $candidate) { + if (file_exists($candidate)) { + $autoloaderPath = $candidate; + break; + } +} +if (!$autoloaderPath) { + die("Could not find autoloader. Run 'composer install'."); +} +$classLoader = require $autoloaderPath; +$configFilePath = getenv('ROBO_CONFIG') ?: getenv('HOME') . '/.robo/robo.yml'; +$runner = new \Robo\Runner(); +$runner + ->setRelativePluginNamespace('Robo\Plugin') + ->setSelfUpdateRepository('consolidation/robo') + ->setConfigurationFilename($configFilePath) + ->setEnvConfigPrefix('ROBO') + ->setClassLoader($classLoader); +$statusCode = $runner->execute($_SERVER['argv']); +exit($statusCode); diff --git a/vendor/consolidation/robo/robo.yml b/vendor/consolidation/robo/robo.yml new file mode 100644 index 0000000000000000000000000000000000000000..a0675093d6ddad252c94ebddbb207db74b024df4 --- /dev/null +++ b/vendor/consolidation/robo/robo.yml @@ -0,0 +1,8 @@ +options: + progress-delay: 2 + simulate: null +command: + try: + config: + options: + opt: wow diff --git a/vendor/consolidation/robo/scripts/composer/ScriptHandler.php b/vendor/consolidation/robo/scripts/composer/ScriptHandler.php new file mode 100644 index 0000000000000000000000000000000000000000..ddf1111f281816a390fabb1d371dcc8a3de5a46d --- /dev/null +++ b/vendor/consolidation/robo/scripts/composer/ScriptHandler.php @@ -0,0 +1,58 @@ +<?php + +/** + * @file + * Contains \Robo\composer\ScriptHandler. + */ + +namespace Robo\composer; + +use Composer\Script\Event; +use Symfony\Component\Filesystem\Filesystem; + +class ScriptHandler +{ + + /** + * Run prior to `composer installl` when a composer.lock is present. + * @param Event $event + */ + public static function checkDependencies(Event $event) + { + if (version_compare(PHP_VERSION, '5.6.0') < 0) { + static::checkDependenciesFor55(); + } + } + + /** + * Check to see if the dependencies in composer.lock are compatible + * with php 5.5. + */ + protected static function checkDependenciesFor55() + { + $fs = new Filesystem(); + if (!$fs->exists('composer.lock')) { + return; + } + + $composerLockContents = file_get_contents('composer.lock'); + if (preg_match('#"php":.*(5\.6)#', $composerLockContents)) { + static::fixDependenciesFor55(); + } + } + + protected static function fixDependenciesFor55() + { + $fs = new Filesystem(); + $status = 0; + + $fs->remove('composer.lock'); + + // Composer has already read our composer.json file, so we will + // need to run in a new process to fix things up. + passthru('composer install --ansi', $status); + + // Don't continue with the initial 'composer install' command + exit($status); + } +} diff --git a/vendor/consolidation/robo/src/Application.php b/vendor/consolidation/robo/src/Application.php new file mode 100644 index 0000000000000000000000000000000000000000..6e9bc0dcd8ad7ced9bca6b0124a0717fe6d5b80b --- /dev/null +++ b/vendor/consolidation/robo/src/Application.php @@ -0,0 +1,74 @@ +<?php +namespace Robo; + +use SelfUpdate\SelfUpdateCommand; +use Symfony\Component\Console\Application as SymfonyApplication; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputOption; + +class Application extends SymfonyApplication +{ + /** + * @param string $name + * @param string $version + */ + public function __construct($name, $version) + { + parent::__construct($name, $version); + + $this->getDefinition() + ->addOption( + new InputOption('--simulate', null, InputOption::VALUE_NONE, 'Run in simulated mode (show what would have happened).') + ); + $this->getDefinition() + ->addOption( + new InputOption('--progress-delay', null, InputOption::VALUE_REQUIRED, 'Number of seconds before progress bar is displayed in long-running task collections. Default: 2s.', Config::DEFAULT_PROGRESS_DELAY) + ); + + $this->getDefinition() + ->addOption( + new InputOption('--define', '-D', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Define a configuration item value.', []) + ); + } + + /** + * @param string $roboFile + * @param string $roboClass + */ + public function addInitRoboFileCommand($roboFile, $roboClass) + { + $createRoboFile = new Command('init'); + $createRoboFile->setDescription("Intitalizes basic RoboFile in current dir"); + $createRoboFile->setCode(function () use ($roboClass, $roboFile) { + $output = Robo::output(); + $output->writeln("<comment> ~~~ Welcome to Robo! ~~~~ </comment>"); + $output->writeln("<comment> ". basename($roboFile) ." will be created in the current directory </comment>"); + file_put_contents( + $roboFile, + '<?php' + . "\n/**" + . "\n * This is project's console commands configuration for Robo task runner." + . "\n *" + . "\n * @see http://robo.li/" + . "\n */" + . "\nclass " . $roboClass . " extends \\Robo\\Tasks\n{\n // define public methods as commands\n}" + ); + $output->writeln("<comment> Edit this file to add your commands! </comment>"); + }); + $this->add($createRoboFile); + } + + /** + * Add self update command, do nothing if null is provided + * + * @param string $repository GitHub Repository for self update + */ + public function addSelfUpdateCommand($repository = null) + { + if (!$repository || empty(\Phar::running())) { + return; + } + $selfUpdateCommand = new SelfUpdateCommand($this->getName(), $this->getVersion(), $repository); + $this->add($selfUpdateCommand); + } +} diff --git a/vendor/consolidation/robo/src/ClassDiscovery/AbstractClassDiscovery.php b/vendor/consolidation/robo/src/ClassDiscovery/AbstractClassDiscovery.php new file mode 100644 index 0000000000000000000000000000000000000000..319543a54da273279b3a35768f68b2140881d41d --- /dev/null +++ b/vendor/consolidation/robo/src/ClassDiscovery/AbstractClassDiscovery.php @@ -0,0 +1,26 @@ +<?php + +namespace Robo\ClassDiscovery; + +/** + * Class AbstractClassDiscovery + * + * @package Robo\ClassDiscovery + */ +abstract class AbstractClassDiscovery implements ClassDiscoveryInterface +{ + /** + * @var string + */ + protected $searchPattern = '*.php'; + + /** + * {@inheritdoc} + */ + public function setSearchPattern($searchPattern) + { + $this->searchPattern = $searchPattern; + + return $this; + } +} diff --git a/vendor/consolidation/robo/src/ClassDiscovery/ClassDiscoveryInterface.php b/vendor/consolidation/robo/src/ClassDiscovery/ClassDiscoveryInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..ebbb6727287349d0e36859faed8661b6beb34e77 --- /dev/null +++ b/vendor/consolidation/robo/src/ClassDiscovery/ClassDiscoveryInterface.php @@ -0,0 +1,30 @@ +<?php + +namespace Robo\ClassDiscovery; + +/** + * Interface ClassDiscoveryInterface + * + * @package Robo\Plugin\ClassDiscovery + */ +interface ClassDiscoveryInterface +{ + /** + * @param $searchPattern + * + * @return $this + */ + public function setSearchPattern($searchPattern); + + /** + * @return string[] + */ + public function getClasses(); + + /** + * @param $class + * + * @return string|null + */ + public function getFile($class); +} diff --git a/vendor/consolidation/robo/src/ClassDiscovery/RelativeNamespaceDiscovery.php b/vendor/consolidation/robo/src/ClassDiscovery/RelativeNamespaceDiscovery.php new file mode 100644 index 0000000000000000000000000000000000000000..766de3a4d7c5365fae8d201b44fe729be9619846 --- /dev/null +++ b/vendor/consolidation/robo/src/ClassDiscovery/RelativeNamespaceDiscovery.php @@ -0,0 +1,112 @@ +<?php + +namespace Robo\ClassDiscovery; + +use Symfony\Component\Finder\Finder; +use Composer\Autoload\ClassLoader; + +/** + * Class RelativeNamespaceDiscovery + * + * @package Robo\Plugin\ClassDiscovery + */ +class RelativeNamespaceDiscovery extends AbstractClassDiscovery +{ + /** + * @var \Composer\Autoload\ClassLoader + */ + protected $classLoader; + + /** + * @var string + */ + protected $relativeNamespace = ''; + + /** + * RelativeNamespaceDiscovery constructor. + * + * @param \Composer\Autoload\ClassLoader $classLoader + */ + public function __construct(ClassLoader $classLoader) + { + $this->classLoader = $classLoader; + } + + /** + * @param string $relativeNamespace + * + * @return RelativeNamespaceDiscovery + */ + public function setRelativeNamespace($relativeNamespace) + { + $this->relativeNamespace = $relativeNamespace; + + return $this; + } + + /** + * @inheritDoc + */ + public function getClasses() + { + $classes = []; + $relativePath = $this->convertNamespaceToPath($this->relativeNamespace); + + foreach ($this->classLoader->getPrefixesPsr4() as $baseNamespace => $directories) { + $directories = array_filter(array_map(function ($directory) use ($relativePath) { + return $directory.$relativePath; + }, $directories), 'is_dir'); + + if ($directories) { + foreach ($this->search($directories, $this->searchPattern) as $file) { + $relativePathName = $file->getRelativePathname(); + $classes[] = $baseNamespace.$this->convertPathToNamespace($relativePath.'/'.$relativePathName); + } + } + } + + return $classes; + } + + /** + * {@inheritdoc} + */ + public function getFile($class) + { + return $this->classLoader->findFile($class); + } + + /** + * @param $directories + * @param $pattern + * + * @return \Symfony\Component\Finder\Finder + */ + protected function search($directories, $pattern) + { + $finder = new Finder(); + $finder->files() + ->name($pattern) + ->in($directories); + + return $finder; + } + + /** + * @param $path + * + * @return mixed + */ + protected function convertPathToNamespace($path) + { + return str_replace(['/', '.php'], ['\\', ''], trim($path, '/')); + } + + /** + * @return string + */ + public function convertNamespaceToPath($namespace) + { + return '/'.str_replace("\\", '/', trim($namespace, '\\')); + } +} diff --git a/vendor/consolidation/robo/src/Collection/CallableTask.php b/vendor/consolidation/robo/src/Collection/CallableTask.php new file mode 100644 index 0000000000000000000000000000000000000000..ae9c54fc517d380d73ae79ecdb00713abdfe9af7 --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/CallableTask.php @@ -0,0 +1,62 @@ +<?php +namespace Robo\Collection; + +use Robo\Result; +use Robo\Contract\TaskInterface; +use Robo\State\StateAwareInterface; +use Robo\State\Data; + +/** + * Creates a task wrapper that converts any Callable into an + * object that can be used directly with a task collection. + * + * It is not necessary to use this class directly; Collection will + * automatically wrap Callables when they are added. + */ +class CallableTask implements TaskInterface +{ + /** + * @var callable + */ + protected $fn; + + /** + * @var \Robo\Contract\TaskInterface + */ + protected $reference; + + public function __construct(callable $fn, TaskInterface $reference) + { + $this->fn = $fn; + $this->reference = $reference; + } + + /** + * @return \Robo\Result + */ + public function run() + { + $result = call_user_func($this->fn, $this->getState()); + // If the function returns no result, then count it + // as a success. + if (!isset($result)) { + $result = Result::success($this->reference); + } + // If the function returns a result, it must either return + // a \Robo\Result or an exit code. In the later case, we + // convert it to a \Robo\Result. + if (!$result instanceof Result) { + $result = new Result($this->reference, $result); + } + + return $result; + } + + public function getState() + { + if ($this->reference instanceof StateAwareInterface) { + return $this->reference->getState(); + } + return new Data(); + } +} diff --git a/vendor/consolidation/robo/src/Collection/Collection.php b/vendor/consolidation/robo/src/Collection/Collection.php new file mode 100644 index 0000000000000000000000000000000000000000..e3e34796b9c6f85f7377ea7248c7d68b62831876 --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/Collection.php @@ -0,0 +1,782 @@ +<?php +namespace Robo\Collection; + +use Robo\Exception\AbortTasksException; +use Robo\Result; +use Robo\State\Data; +use Psr\Log\LogLevel; +use Robo\Contract\TaskInterface; +use Robo\Task\StackBasedTask; +use Robo\Task\BaseTask; +use Robo\TaskInfo; +use Robo\Contract\WrappedTaskInterface; +use Robo\Exception\TaskException; +use Robo\Exception\TaskExitException; +use Robo\Contract\CommandInterface; + +use Robo\Contract\InflectionInterface; +use Robo\State\StateAwareInterface; +use Robo\State\StateAwareTrait; + +/** + * Group tasks into a collection that run together. Supports + * rollback operations for handling error conditions. + * + * This is an internal class. Clients should use a CollectionBuilder + * rather than direct use of the Collection class. @see CollectionBuilder. + * + * Below, the example FilesystemStack task is added to a collection, + * and associated with a rollback task. If any of the operations in + * the FilesystemStack, or if any of the other tasks also added to + * the task collection should fail, then the rollback function is + * called. Here, taskDeleteDir is used to remove partial results + * of an unfinished task. + */ +class Collection extends BaseTask implements CollectionInterface, CommandInterface, StateAwareInterface +{ + use StateAwareTrait; + + /** + * @var \Robo\Collection\Element[] + */ + protected $taskList = []; + + /** + * @var TaskInterface[] + */ + protected $rollbackStack = []; + + /** + * @var TaskInterface[] + */ + protected $completionStack = []; + + /** + * @var CollectionInterface + */ + protected $parentCollection; + + /** + * @var callable[] + */ + protected $deferredCallbacks = []; + + /** + * @var string[] + */ + protected $messageStoreKeys = []; + + /** + * Constructor. + */ + public function __construct() + { + $this->resetState(); + } + + public function setProgressBarAutoDisplayInterval($interval) + { + if (!$this->progressIndicator) { + return; + } + return $this->progressIndicator->setProgressBarAutoDisplayInterval($interval); + } + + /** + * {@inheritdoc} + */ + public function add(TaskInterface $task, $name = self::UNNAMEDTASK) + { + $task = new CompletionWrapper($this, $task); + $this->addToTaskList($name, $task); + return $this; + } + + /** + * {@inheritdoc} + */ + public function addCode(callable $code, $name = self::UNNAMEDTASK) + { + return $this->add(new CallableTask($code, $this), $name); + } + + /** + * {@inheritdoc} + */ + public function addIterable($iterable, callable $code) + { + $callbackTask = (new IterationTask($iterable, $code, $this))->inflect($this); + return $this->add($callbackTask); + } + + /** + * {@inheritdoc} + */ + public function rollback(TaskInterface $rollbackTask) + { + // Rollback tasks always try as hard as they can, and never report failures. + $rollbackTask = $this->ignoreErrorsTaskWrapper($rollbackTask); + return $this->wrapAndRegisterRollback($rollbackTask); + } + + /** + * {@inheritdoc} + */ + public function rollbackCode(callable $rollbackCode) + { + // Rollback tasks always try as hard as they can, and never report failures. + $rollbackTask = $this->ignoreErrorsCodeWrapper($rollbackCode); + return $this->wrapAndRegisterRollback($rollbackTask); + } + + /** + * {@inheritdoc} + */ + public function completion(TaskInterface $completionTask) + { + $collection = $this; + $completionRegistrationTask = new CallableTask( + function () use ($collection, $completionTask) { + + $collection->registerCompletion($completionTask); + }, + $this + ); + $this->addToTaskList(self::UNNAMEDTASK, $completionRegistrationTask); + return $this; + } + + /** + * {@inheritdoc} + */ + public function completionCode(callable $completionTask) + { + $completionTask = new CallableTask($completionTask, $this); + return $this->completion($completionTask); + } + + /** + * {@inheritdoc} + */ + public function before($name, $task, $nameOfTaskToAdd = self::UNNAMEDTASK) + { + return $this->addBeforeOrAfter(__FUNCTION__, $name, $task, $nameOfTaskToAdd); + } + + /** + * {@inheritdoc} + */ + public function after($name, $task, $nameOfTaskToAdd = self::UNNAMEDTASK) + { + return $this->addBeforeOrAfter(__FUNCTION__, $name, $task, $nameOfTaskToAdd); + } + + /** + * {@inheritdoc} + */ + public function progressMessage($text, $context = [], $level = LogLevel::NOTICE) + { + $context += ['name' => 'Progress']; + $context += TaskInfo::getTaskContext($this); + return $this->addCode( + function () use ($level, $text, $context) { + $context += $this->getState()->getData(); + $this->printTaskOutput($level, $text, $context); + } + ); + } + + /** + * @param \Robo\Contract\TaskInterface $rollbackTask + * + * @return $this + */ + protected function wrapAndRegisterRollback(TaskInterface $rollbackTask) + { + $collection = $this; + $rollbackRegistrationTask = new CallableTask( + function () use ($collection, $rollbackTask) { + $collection->registerRollback($rollbackTask); + }, + $this + ); + $this->addToTaskList(self::UNNAMEDTASK, $rollbackRegistrationTask); + return $this; + } + + /** + * Add either a 'before' or 'after' function or task. + * + * @param string $method + * @param string $name + * @param callable|TaskInterface $task + * @param string $nameOfTaskToAdd + * + * @return $this + */ + protected function addBeforeOrAfter($method, $name, $task, $nameOfTaskToAdd) + { + if (is_callable($task)) { + $task = new CallableTask($task, $this); + } + $existingTask = $this->namedTask($name); + $fn = [$existingTask, $method]; + call_user_func($fn, $task, $nameOfTaskToAdd); + return $this; + } + + /** + * Wrap the provided task in a wrapper that will ignore + * any errors or exceptions that may be produced. This + * is useful, for example, in adding optional cleanup tasks + * at the beginning of a task collection, to remove previous + * results which may or may not exist. + * + * TODO: Provide some way to specify which sort of errors + * are ignored, so that 'file not found' may be ignored, + * but 'permission denied' reported? + * + * @param \Robo\Contract\TaskInterface $task + * + * @return \Robo\Collection\CallableTask + */ + public function ignoreErrorsTaskWrapper(TaskInterface $task) + { + // If the task is a stack-based task, then tell it + // to try to run all of its operations, even if some + // of them fail. + if ($task instanceof StackBasedTask) { + $task->stopOnFail(false); + } + $ignoreErrorsInTask = function () use ($task) { + $data = []; + try { + $result = $this->runSubtask($task); + $message = $result->getMessage(); + $data = $result->getData(); + $data['exitcode'] = $result->getExitCode(); + } catch (AbortTasksException $abortTasksException) { + throw $abortTasksException; + } catch (\Exception $e) { + $message = $e->getMessage(); + } + + return Result::success($task, $message, $data); + }; + // Wrap our ignore errors callable in a task. + return new CallableTask($ignoreErrorsInTask, $this); + } + + /** + * @param callable $task + * + * @return \Robo\Collection\CallableTask + */ + public function ignoreErrorsCodeWrapper(callable $task) + { + return $this->ignoreErrorsTaskWrapper(new CallableTask($task, $this)); + } + + /** + * Return the list of task names added to this collection. + * + * @return array + */ + public function taskNames() + { + return array_keys($this->taskList); + } + + /** + * Test to see if a specified task name exists. + * n.b. before() and after() require that the named + * task exist; use this function to test first, if + * unsure. + * + * @param string $name + * + * @return bool + */ + public function hasTask($name) + { + return array_key_exists($name, $this->taskList); + } + + /** + * Find an existing named task. + * + * @param string $name + * The name of the task to insert before. The named task MUST exist. + * + * @return Element + * The task group for the named task. Generally this is only + * used to call 'before()' and 'after()'. + */ + protected function namedTask($name) + { + if (!$this->hasTask($name)) { + throw new \RuntimeException("Could not find task named $name"); + } + return $this->taskList[$name]; + } + + /** + * Add a list of tasks to our task collection. + * + * @param TaskInterface[] $tasks + * An array of tasks to run with rollback protection + * + * @return $this + */ + public function addTaskList(array $tasks) + { + foreach ($tasks as $name => $task) { + $this->add($task, $name); + } + return $this; + } + + /** + * Add the provided task to our task list. + * + * @param string $name + * @param \Robo\Contract\TaskInterface $task + * + * @return \Robo\Collection\Collection + */ + protected function addToTaskList($name, TaskInterface $task) + { + // All tasks are stored in a task group so that we have a place + // to hang 'before' and 'after' tasks. + $taskGroup = new Element($task); + return $this->addCollectionElementToTaskList($name, $taskGroup); + } + + /** + * @param int|string $name + * @param \Robo\Collection\Element $taskGroup + * + * @return $this + */ + protected function addCollectionElementToTaskList($name, Element $taskGroup) + { + // If a task name is not provided, then we'll let php pick + // the array index. + if (Result::isUnnamed($name)) { + $this->taskList[] = $taskGroup; + return $this; + } + // If we are replacing an existing task with the + // same name, ensure that our new task is added to + // the end. + $this->taskList[$name] = $taskGroup; + return $this; + } + + /** + * Set the parent collection. This is necessary so that nested + * collections' rollback and completion tasks can be added to the + * top-level collection, ensuring that the rollbacks for a collection + * will run if any later task fails. + * + * @param \Robo\Collection\NestedCollectionInterface $parentCollection + * + * @return $this + */ + public function setParentCollection(NestedCollectionInterface $parentCollection) + { + $this->parentCollection = $parentCollection; + return $this; + } + + /** + * Get the appropriate parent collection to use + * + * @return CollectionInterface + */ + public function getParentCollection() + { + return $this->parentCollection ? $this->parentCollection : $this; + } + + /** + * Register a rollback task to run if there is any failure. + * + * Clients are free to add tasks to the rollback stack as + * desired; however, usually it is preferable to call + * Collection::rollback() instead. With that function, + * the rollback function will only be called if all of the + * tasks added before it complete successfully, AND some later + * task fails. + * + * One example of a good use-case for registering a callback + * function directly is to add a task that sends notification + * when a task fails. + * + * @param TaskInterface $rollbackTask + * The rollback task to run on failure. + */ + public function registerRollback(TaskInterface $rollbackTask) + { + if ($this->parentCollection) { + return $this->parentCollection->registerRollback($rollbackTask); + } + if ($rollbackTask) { + array_unshift($this->rollbackStack, $rollbackTask); + } + } + + /** + * Register a completion task to run once all other tasks finish. + * Completion tasks run whether or not a rollback operation was + * triggered. They do not trigger rollbacks if they fail. + * + * The typical use-case for a completion function is to clean up + * temporary objects (e.g. temporary folders). The preferred + * way to do that, though, is to use Temporary::wrap(). + * + * On failures, completion tasks will run after all rollback tasks. + * If one task collection is nested inside another task collection, + * then the nested collection's completion tasks will run as soon as + * the nested task completes; they are not deferred to the end of + * the containing collection's execution. + * + * @param TaskInterface $completionTask + * The completion task to run at the end of all other operations. + */ + public function registerCompletion(TaskInterface $completionTask) + { + if ($this->parentCollection) { + return $this->parentCollection->registerCompletion($completionTask); + } + if ($completionTask) { + // Completion tasks always try as hard as they can, and never report failures. + $completionTask = $this->ignoreErrorsTaskWrapper($completionTask); + $this->completionStack[] = $completionTask; + } + } + + /** + * Return the count of steps in this collection + * + * @return int + */ + public function progressIndicatorSteps() + { + $steps = 0; + foreach ($this->taskList as $name => $taskGroup) { + $steps += $taskGroup->progressIndicatorSteps(); + } + return $steps; + } + + /** + * A Collection of tasks can provide a command via `getCommand()` + * if it contains a single task, and that task implements CommandInterface. + * + * @return string + * + * @throws \Robo\Exception\TaskException + */ + public function getCommand() + { + if (empty($this->taskList)) { + return ''; + } + + if (count($this->taskList) > 1) { + // TODO: We could potentially iterate over the items in the collection + // and concatenate the result of getCommand() from each one, and fail + // only if we encounter a command that is not a CommandInterface. + throw new TaskException($this, "getCommand() does not work on arbitrary collections of tasks."); + } + + $taskElement = reset($this->taskList); + $task = $taskElement->getTask(); + $task = ($task instanceof WrappedTaskInterface) ? $task->original() : $task; + if ($task instanceof CommandInterface) { + return $task->getCommand(); + } + + throw new TaskException($task, get_class($task) . " does not implement CommandInterface, so can't be used to provide a command"); + } + + /** + * Run our tasks, and roll back if necessary. + * + * @return \Robo\Result + */ + public function run() + { + $result = $this->runWithoutCompletion(); + $this->complete(); + return $result; + } + + /** + * @return \Robo\Result + */ + private function runWithoutCompletion() + { + $result = Result::success($this); + + if (empty($this->taskList)) { + return $result; + } + + $this->startProgressIndicator(); + if ($result->wasSuccessful()) { + foreach ($this->taskList as $name => $taskGroup) { + $taskList = $taskGroup->getTaskList(); + $result = $this->runTaskList($name, $taskList, $result); + if (!$result->wasSuccessful()) { + $this->fail(); + return $result; + } + } + $this->taskList = []; + } + $this->stopProgressIndicator(); + $result['time'] = $this->getExecutionTime(); + + return $result; + } + + /** + * Run every task in a list, but only up to the first failure. + * Return the failing result, or success if all tasks run. + * + * @param string $name + * @param TaskInterface[] $taskList + * @param \Robo\Result $result + * + * @return \Robo\Result + * + * @throws \Robo\Exception\TaskExitException + */ + private function runTaskList($name, array $taskList, Result $result) + { + try { + foreach ($taskList as $taskName => $task) { + $taskResult = $this->runSubtask($task); + $this->advanceProgressIndicator(); + // If the current task returns an error code, then stop + // execution and signal a rollback. + if (!$taskResult->wasSuccessful()) { + return $taskResult; + } + // We accumulate our results into a field so that tasks that + // have a reference to the collection may examine and modify + // the incremental results, if they wish. + $key = Result::isUnnamed($taskName) ? $name : $taskName; + $result->accumulate($key, $taskResult); + // The result message will be the message of the last task executed. + $result->setMessage($taskResult->getMessage()); + } + } catch (TaskExitException $exitException) { + $this->fail(); + throw $exitException; + } catch (\Exception $e) { + // Tasks typically should not throw, but if one does, we will + // convert it into an error and roll back. + return Result::fromException($task, $e, $result->getData()); + } + return $result; + } + + /** + * Force the rollback functions to run + * + * @return $this + */ + public function fail() + { + $this->disableProgressIndicator(); + $this->runRollbackTasks(); + $this->complete(); + return $this; + } + + /** + * Force the completion functions to run + * + * @return $this + */ + public function complete() + { + $this->detatchProgressIndicator(); + $this->runTaskListIgnoringFailures($this->completionStack); + $this->reset(); + return $this; + } + + /** + * Reset this collection, removing all tasks. + * + * @return $this + */ + public function reset() + { + $this->taskList = []; + $this->completionStack = []; + $this->rollbackStack = []; + return $this; + } + + /** + * Run all of our rollback tasks. + * + * Note that Collection does not implement RollbackInterface, but + * it may still be used as a task inside another task collection + * (i.e. you can nest task collections, if desired). + */ + protected function runRollbackTasks() + { + $this->runTaskListIgnoringFailures($this->rollbackStack); + // Erase our rollback stack once we have finished rolling + // everything back. This will allow us to potentially use + // a command collection more than once (e.g. to retry a + // failed operation after doing some error recovery). + $this->rollbackStack = []; + } + + /** + * @param TaskInterface|NestedCollectionInterface|WrappedTaskInterface $task + * + * @return \Robo\Result + */ + protected function runSubtask($task) + { + $original = ($task instanceof WrappedTaskInterface) ? $task->original() : $task; + $this->setParentCollectionForTask($original, $this->getParentCollection()); + if ($original instanceof InflectionInterface) { + $original->inflect($this); + } + if ($original instanceof StateAwareInterface) { + $original->setState($this->getState()); + } + $this->doDeferredInitialization($original); + $taskResult = $task->run(); + $taskResult = Result::ensureResult($task, $taskResult); + $this->doStateUpdates($original, $taskResult); + return $taskResult; + } + + protected function doStateUpdates($task, Data $taskResult) + { + $this->updateState($taskResult); + $key = spl_object_hash($task); + if (array_key_exists($key, $this->messageStoreKeys)) { + $state = $this->getState(); + list($stateKey, $sourceKey) = $this->messageStoreKeys[$key]; + $value = empty($sourceKey) ? $taskResult->getMessage() : $taskResult[$sourceKey]; + $state[$stateKey] = $value; + } + } + + public function storeState($task, $key, $source = '') + { + $this->messageStoreKeys[spl_object_hash($task)] = [$key, $source]; + + return $this; + } + + public function deferTaskConfiguration($task, $functionName, $stateKey) + { + return $this->defer( + $task, + function ($task, $state) use ($functionName, $stateKey) { + $fn = [$task, $functionName]; + $value = $state[$stateKey]; + $fn($value); + } + ); + } + + /** + * Defer execution of a callback function until just before a task + * runs. Use this time to provide more settings for the task, e.g. from + * the collection's shared state, which is populated with the results + * of previous test runs. + */ + public function defer($task, $callback) + { + $this->deferredCallbacks[spl_object_hash($task)][] = $callback; + + return $this; + } + + protected function doDeferredInitialization($task) + { + // If the task is a state consumer, then call its receiveState method + if ($task instanceof \Robo\State\Consumer) { + $task->receiveState($this->getState()); + } + + // Check and see if there are any deferred callbacks for this task. + $key = spl_object_hash($task); + if (!array_key_exists($key, $this->deferredCallbacks)) { + return; + } + + // Call all of the deferred callbacks + foreach ($this->deferredCallbacks[$key] as $fn) { + $fn($task, $this->getState()); + } + } + + /** + * @param TaskInterface|NestedCollectionInterface|WrappedTaskInterface $task + * @param $parentCollection + */ + protected function setParentCollectionForTask($task, $parentCollection) + { + if ($task instanceof NestedCollectionInterface) { + $task->setParentCollection($parentCollection); + } + } + + /** + * Run all of the tasks in a provided list, ignoring failures. + * + * You may force a failure by throwing a ForcedException in your rollback or + * completion task or callback. + * + * This is used to roll back or complete. + * + * @param TaskInterface[] $taskList + */ + protected function runTaskListIgnoringFailures(array $taskList) + { + foreach ($taskList as $task) { + try { + $this->runSubtask($task); + } catch (AbortTasksException $abortTasksException) { + // If there's a forced exception, end the loop of tasks. + if ($message = $abortTasksException->getMessage()) { + $this->logger()->notice($message); + } + break; + } catch (\Exception $e) { + // Ignore rollback failures. + } + } + } + + /** + * Give all of our tasks to the provided collection builder. + * + * @param CollectionBuilder $builder + */ + public function transferTasks($builder) + { + foreach ($this->taskList as $name => $taskGroup) { + // TODO: We are abandoning all of our before and after tasks here. + // At the moment, transferTasks is only called under conditions where + // there will be none of these, but care should be taken if that changes. + $task = $taskGroup->getTask(); + $builder->addTaskToCollection($task); + } + $this->reset(); + } +} diff --git a/vendor/consolidation/robo/src/Collection/CollectionBuilder.php b/vendor/consolidation/robo/src/Collection/CollectionBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..3e037b01e98cf5473d1c7360631c19a4460e9bea --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/CollectionBuilder.php @@ -0,0 +1,571 @@ +<?php +namespace Robo\Collection; + +use Consolidation\Config\Inject\ConfigForSetters; +use Robo\Config\Config; +use Psr\Log\LogLevel; +use Robo\Contract\InflectionInterface; +use Robo\Contract\TaskInterface; +use Robo\Contract\CompletionInterface; +use Robo\Contract\WrappedTaskInterface; +use Robo\Task\Simulator; +use ReflectionClass; +use Robo\Task\BaseTask; +use Robo\Contract\BuilderAwareInterface; +use Robo\Contract\CommandInterface; +use Robo\Contract\VerbosityThresholdInterface; +use Robo\State\StateAwareInterface; +use Robo\State\StateAwareTrait; +use Robo\Result; + +/** + * Creates a collection, and adds tasks to it. The collection builder + * offers a streamlined chained-initialization mechanism for easily + * creating task groups. Facilities for creating working and temporary + * directories are also provided. + * + * ``` php + * <?php + * $result = $this->collectionBuilder() + * ->taskFilesystemStack() + * ->mkdir('g') + * ->touch('g/g.txt') + * ->rollback( + * $this->taskDeleteDir('g') + * ) + * ->taskFilesystemStack() + * ->mkdir('g/h') + * ->touch('g/h/h.txt') + * ->taskFilesystemStack() + * ->mkdir('g/h/i/c') + * ->touch('g/h/i/i.txt') + * ->run() + * ?> + * + * In the example above, the `taskDeleteDir` will be called if + * ``` + */ +class CollectionBuilder extends BaseTask implements NestedCollectionInterface, WrappedTaskInterface, CommandInterface, StateAwareInterface +{ + use StateAwareTrait; + + /** + * @var \Robo\Tasks + */ + protected $commandFile; + + /** + * @var CollectionInterface + */ + protected $collection; + + /** + * @var TaskInterface + */ + protected $currentTask; + + /** + * @var bool + */ + protected $simulated; + + /** + * @param \Robo\Tasks $commandFile + */ + public function __construct($commandFile) + { + $this->commandFile = $commandFile; + $this->resetState(); + } + + public static function create($container, $commandFile) + { + $builder = new self($commandFile); + + $builder->setLogger($container->get('logger')); + $builder->setProgressIndicator($container->get('progressIndicator')); + $builder->setConfig($container->get('config')); + $builder->setOutputAdapter($container->get('outputAdapter')); + + return $builder; + } + + /** + * @param bool $simulated + * + * @return $this + */ + public function simulated($simulated = true) + { + $this->simulated = $simulated; + return $this; + } + + /** + * @return bool + */ + public function isSimulated() + { + if (!isset($this->simulated)) { + $this->simulated = $this->getConfig()->get(Config::SIMULATE); + } + return $this->simulated; + } + + /** + * Create a temporary directory to work in. When the collection + * completes or rolls back, the temporary directory will be deleted. + * Returns the path to the location where the directory will be + * created. + * + * @param string $prefix + * @param string $base + * @param bool $includeRandomPart + * + * @return string + */ + public function tmpDir($prefix = 'tmp', $base = '', $includeRandomPart = true) + { + // n.b. Any task that the builder is asked to create is + // automatically added to the builder's collection, and + // wrapped in the builder object. Therefore, the result + // of any call to `taskFoo()` from within the builder will + // always be `$this`. + return $this->taskTmpDir($prefix, $base, $includeRandomPart)->getPath(); + } + + /** + * Create a working directory to hold results. A temporary directory + * is first created to hold the intermediate results. After the + * builder finishes, the work directory is moved into its final location; + * any results already in place will be moved out of the way and + * then deleted. + * + * @param string $finalDestination The path where the working directory + * will be moved once the task collection completes. + * + * @return string + */ + public function workDir($finalDestination) + { + // Creating the work dir task in this context adds it to our task collection. + return $this->taskWorkDir($finalDestination)->getPath(); + } + + public function addTask(TaskInterface $task) + { + $this->getCollection()->add($task); + return $this; + } + + /** + * Add arbitrary code to execute as a task. + * + * @see \Robo\Collection\CollectionInterface::addCode + * + * @param callable $code + * @param int|string $name + * @return $this + */ + public function addCode(callable $code, $name = \Robo\Collection\CollectionInterface::UNNAMEDTASK) + { + $this->getCollection()->addCode($code, $name); + return $this; + } + + /** + * Add a list of tasks to our task collection. + * + * @param TaskInterface[] $tasks + * An array of tasks to run with rollback protection + * + * @return $this + */ + public function addTaskList(array $tasks) + { + $this->getCollection()->addTaskList($tasks); + return $this; + } + + public function rollback(TaskInterface $task) + { + // Ensure that we have a collection if we are going to add + // a rollback function. + $this->getCollection()->rollback($task); + return $this; + } + + public function rollbackCode(callable $rollbackCode) + { + $this->getCollection()->rollbackCode($rollbackCode); + return $this; + } + + public function completion(TaskInterface $task) + { + $this->getCollection()->completion($task); + return $this; + } + + public function completionCode(callable $completionCode) + { + $this->getCollection()->completionCode($completionCode); + return $this; + } + + /** + * @param string $text + * @param array $context + * @param string $level + * + * @return $this + */ + public function progressMessage($text, $context = [], $level = LogLevel::NOTICE) + { + $this->getCollection()->progressMessage($text, $context, $level); + return $this; + } + + /** + * @param \Robo\Collection\NestedCollectionInterface $parentCollection + * + * @return $this + */ + public function setParentCollection(NestedCollectionInterface $parentCollection) + { + $this->getCollection()->setParentCollection($parentCollection); + return $this; + } + + /** + * Called by the factory method of each task; adds the current + * task to the task builder. + * + * TODO: protected + * + * @param TaskInterface $task + * + * @return $this + */ + public function addTaskToCollection($task) + { + // Postpone creation of the collection until the second time + // we are called. At that time, $this->currentTask will already + // be populated. We call 'getCollection()' so that it will + // create the collection and add the current task to it. + // Note, however, that if our only tasks implements NestedCollectionInterface, + // then we should force this builder to use a collection. + if (!$this->collection && (isset($this->currentTask) || ($task instanceof NestedCollectionInterface))) { + $this->getCollection(); + } + $this->currentTask = $task; + if ($this->collection) { + $this->collection->add($task); + } + return $this; + } + + public function getState() + { + $collection = $this->getCollection(); + return $collection->getState(); + } + + public function storeState($key, $source = '') + { + return $this->callCollectionStateFuntion(__FUNCTION__, func_get_args()); + } + + public function deferTaskConfiguration($functionName, $stateKey) + { + return $this->callCollectionStateFuntion(__FUNCTION__, func_get_args()); + } + + public function defer($callback) + { + return $this->callCollectionStateFuntion(__FUNCTION__, func_get_args()); + } + + protected function callCollectionStateFuntion($functionName, $args) + { + $currentTask = ($this->currentTask instanceof WrappedTaskInterface) ? $this->currentTask->original() : $this->currentTask; + + array_unshift($args, $currentTask); + $collection = $this->getCollection(); + $fn = [$collection, $functionName]; + + call_user_func_array($fn, $args); + return $this; + } + + public function setVerbosityThreshold($verbosityThreshold) + { + $currentTask = ($this->currentTask instanceof WrappedTaskInterface) ? $this->currentTask->original() : $this->currentTask; + if ($currentTask) { + $currentTask->setVerbosityThreshold($verbosityThreshold); + return $this; + } + parent::setVerbosityThreshold($verbosityThreshold); + return $this; + } + + + /** + * Return the current task for this collection builder. + * TODO: Not needed? + * + * @return \Robo\Contract\TaskInterface + */ + public function getCollectionBuilderCurrentTask() + { + return $this->currentTask; + } + + /** + * Create a new builder with its own task collection + * + * @return CollectionBuilder + */ + public function newBuilder() + { + $collectionBuilder = new self($this->commandFile); + $collectionBuilder->inflect($this); + $collectionBuilder->simulated($this->isSimulated()); + $collectionBuilder->setVerbosityThreshold($this->verbosityThreshold()); + $collectionBuilder->setState($this->getState()); + + return $collectionBuilder; + } + + /** + * Calling the task builder with methods of the current + * task calls through to that method of the task. + * + * There is extra complexity in this function that could be + * simplified if we attached the 'LoadAllTasks' and custom tasks + * to the collection builder instead of the RoboFile. While that + * change would be a better design overall, it would require that + * the user do a lot more work to set up and use custom tasks. + * We therefore take on some additional complexity here in order + * to allow users to maintain their tasks in their RoboFile, which + * is much more convenient. + * + * Calls to $this->collectionBuilder()->taskFoo() cannot be made + * directly because all of the task methods are protected. These + * calls will therefore end up here. If the method name begins + * with 'task', then it is eligible to be used with the builder. + * + * When we call getBuiltTask, below, it will use the builder attached + * to the commandfile to build the task. However, this is not what we + * want: the task needs to be built from THIS collection builder, so that + * it will be affected by whatever state is active in this builder. + * To do this, we have two choices: 1) save and restore the builder + * in the commandfile, or 2) clone the commandfile and set this builder + * on the copy. 1) is vulnerable to failure in multithreaded environments + * (currently not supported), while 2) might cause confusion if there + * is shared state maintained in the commandfile, which is in the + * domain of the user. + * + * Note that even though we are setting up the commandFile to + * use this builder, getBuiltTask always creates a new builder + * (which is constructed using all of the settings from the + * commandFile's builder), and the new task is added to that. + * We therefore need to transfer the newly built task into this + * builder. The temporary builder is discarded. + * + * @param string $fn + * @param array $args + * + * @return $this|mixed + */ + public function __call($fn, $args) + { + if (preg_match('#^task[A-Z]#', $fn) && (method_exists($this->commandFile, 'getBuiltTask'))) { + $saveBuilder = $this->commandFile->getBuilder(); + $this->commandFile->setBuilder($this); + $temporaryBuilder = $this->commandFile->getBuiltTask($fn, $args); + $this->commandFile->setBuilder($saveBuilder); + if (!$temporaryBuilder) { + throw new \BadMethodCallException("No such method $fn: task does not exist in " . get_class($this->commandFile)); + } + $temporaryBuilder->getCollection()->transferTasks($this); + return $this; + } + if (!isset($this->currentTask)) { + throw new \BadMethodCallException("No such method $fn: current task undefined in collection builder."); + } + // If the method called is a method of the current task, + // then call through to the current task's setter method. + $result = call_user_func_array([$this->currentTask, $fn], $args); + + // If something other than a setter method is called, then return its result. + $currentTask = ($this->currentTask instanceof WrappedTaskInterface) ? $this->currentTask->original() : $this->currentTask; + if (isset($result) && ($result !== $currentTask)) { + return $result; + } + + return $this; + } + + /** + * Construct the desired task and add it to this builder. + * + * @param string|object $name + * @param array $args + * + * @return \Robo\Collection\CollectionBuilder + */ + public function build($name, $args) + { + $reflection = new ReflectionClass($name); + $task = $reflection->newInstanceArgs($args); + if (!$task) { + throw new RuntimeException("Can not construct task $name"); + } + $task = $this->fixTask($task, $args); + $this->configureTask($name, $task); + return $this->addTaskToCollection($task); + } + + /** + * @param InflectionInterface $task + * @param array $args + * + * @return \Robo\Collection\CompletionWrapper|\Robo\Task\Simulator + */ + protected function fixTask($task, $args) + { + if ($task instanceof InflectionInterface) { + $task->inflect($this); + } + if ($task instanceof BuilderAwareInterface) { + $task->setBuilder($this); + } + if ($task instanceof VerbosityThresholdInterface) { + $task->setVerbosityThreshold($this->verbosityThreshold()); + } + + // Do not wrap our wrappers. + if ($task instanceof CompletionWrapper || $task instanceof Simulator) { + return $task; + } + + // Remember whether or not this is a task before + // it gets wrapped in any decorator. + $isTask = $task instanceof TaskInterface; + $isCollection = $task instanceof NestedCollectionInterface; + + // If the task implements CompletionInterface, ensure + // that its 'complete' method is called when the application + // terminates -- but only if its 'run' method is called + // first. If the task is added to a collection, then the + // task will be unwrapped via its `original` method, and + // it will be re-wrapped with a new completion wrapper for + // its new collection. + if ($task instanceof CompletionInterface) { + $task = new CompletionWrapper(Temporary::getCollection(), $task); + } + + // If we are in simulated mode, then wrap any task in + // a TaskSimulator. + if ($isTask && !$isCollection && ($this->isSimulated())) { + $task = new \Robo\Task\Simulator($task, $args); + $task->inflect($this); + } + + return $task; + } + + /** + * Check to see if there are any setter methods defined in configuration + * for this task. + */ + protected function configureTask($taskClass, $task) + { + $taskClass = static::configClassIdentifier($taskClass); + $configurationApplier = new ConfigForSetters($this->getConfig(), $taskClass, 'task.'); + $configurationApplier->apply($task, 'settings'); + + // TODO: If we counted each instance of $taskClass that was called from + // this builder, then we could also apply configuration from + // "task.{$taskClass}[$N].settings" + + // TODO: If the builder knew what the current command name was, + // then we could also search for task configuration under + // command-specific keys such as "command.{$commandname}.task.{$taskClass}.settings". + } + + /** + * When we run the collection builder, run everything in the collection. + * + * @return \Robo\Result + */ + public function run() + { + $this->startTimer(); + $result = $this->runTasks(); + $this->stopTimer(); + $result['time'] = $this->getExecutionTime(); + $result->mergeData($this->getState()->getData()); + return $result; + } + + /** + * If there is a single task, run it; if there is a collection, run + * all of its tasks. + * + * @return \Robo\Result + */ + protected function runTasks() + { + if (!$this->collection && $this->currentTask) { + $result = $this->currentTask->run(); + return Result::ensureResult($this->currentTask, $result); + } + return $this->getCollection()->run(); + } + + /** + * @return string + */ + public function getCommand() + { + if (!$this->collection && $this->currentTask) { + $task = $this->currentTask; + $task = ($task instanceof WrappedTaskInterface) ? $task->original() : $task; + if ($task instanceof CommandInterface) { + return $task->getCommand(); + } + } + + return $this->getCollection()->getCommand(); + } + + /** + * @return \Robo\Collection\Collection + */ + public function original() + { + return $this->getCollection(); + } + + /** + * Return the collection of tasks associated with this builder. + * + * @return CollectionInterface + */ + public function getCollection() + { + if (!isset($this->collection)) { + $this->collection = new Collection(); + $this->collection->inflect($this); + $this->collection->setState($this->getState()); + $this->collection->setProgressBarAutoDisplayInterval($this->getConfig()->get(Config::PROGRESS_BAR_AUTO_DISPLAY_INTERVAL)); + + if (isset($this->currentTask)) { + $this->collection->add($this->currentTask); + } + } + return $this->collection; + } +} diff --git a/vendor/consolidation/robo/src/Collection/CollectionInterface.php b/vendor/consolidation/robo/src/Collection/CollectionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..173ca169cc7d52b588349011e2ce834d6718789e --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/CollectionInterface.php @@ -0,0 +1,151 @@ +<?php +namespace Robo\Collection; + +use Psr\Log\LogLevel; +use Robo\Contract\TaskInterface; + +interface CollectionInterface extends NestedCollectionInterface +{ + /** + * Unnamed tasks are assigned an arbitrary numeric index + * in the task list. Any numeric value may be used, but the + * UNNAMEDTASK constant is recommended for clarity. + * + * @var int + */ + const UNNAMEDTASK = 0; + + /** + * Add a task or a list of tasks to our task collection. Each task + * will run via its 'run()' method once (and if) all of the tasks + * added before it complete successfully. If the task also implements + * RollbackInterface, then it will be rolled back via its 'rollback()' + * method ONLY if its 'run()' method completes successfully, and some + * task added after it fails. + * + * @param TaskInterface $task + * The task to add to our collection. + * @param int|string $name + * An optional name for the task -- missing or UNNAMEDTASK for unnamed tasks. + * Names are used for positioning before and after tasks. + * + * @return CollectionInterface + */ + public function add(TaskInterface $task, $name = self::UNNAMEDTASK); + + /** + * Add arbitrary code to execute as a task. + * + * @param callable $code Code to execute as a task + * @param int|string $name + * An optional name for the task -- missing or UNNAMEDTASK for unnamed tasks. + * Names are used for positioning before and after tasks. + * + * @return $this + */ + public function addCode(callable $code, $name = self::UNNAMEDTASK); + + /** + * Add arbitrary code that will be called once for every item in the + * provided array or iterable object. If the function result of the + * provided callback is a TaskInterface or Collection, then it will be + * executed. + * + * @param CollectionInterface|array $iterable A collection of things to iterate + * @param $code $code A callback function to call for each item in the collection. + * + * @return $this + */ + public function addIterable($iterable, callable $code); + + /** + * Add a rollback task to our task collection. A rollback task + * will execute ONLY if all of the tasks added before it complete + * successfully, AND some task added after it fails. + * + * @param TaskInterface $rollbackTask + * The rollback task to add. Note that the 'run()' method of the + * task executes, not its 'rollback()' method. To use the 'rollback()' + * method, add the task via 'Collection::add()' instead. + * + * @return $this + */ + public function rollback(TaskInterface $rollbackTask); + + /** + * Add arbitrary code to execute as a rollback. + * + * @param callable $rollbackTask Code to execute during rollback processing + * + * @return $this + */ + public function rollbackCode(callable $rollbackTask); + + /** + * Add a completion task to our task collection. A completion task + * will execute EITHER after all tasks succeed, OR immediatley after + * any task fails. Completion tasks never cause errors to be returned + * from Collection::run(), even if they fail. + * + * @param TaskInterface $completionTask + * The completion task to add. Note that the 'run()' method of the + * task executes, just as if the task was added normally. + * + * @return $this + */ + public function completion(TaskInterface $completionTask); + + /** + * Add arbitrary code to execute as a completion. + * + * @param callable $completionTask Code to execute after collection completes + * + * @return $this + */ + public function completionCode(callable $completionTask); + + /** + * Add a task before an existing named task. + * + * @param string $name + * The name of the task to insert before. The named task MUST exist. + * @param callable|TaskInterface $task + * The task to add. + * @param int|string $nameOfTaskToAdd + * The name of the task to add. If not provided, will be associated + * with the named task it was added before. + * + * @return $this + */ + public function before($name, $task, $nameOfTaskToAdd = self::UNNAMEDTASK); + + /** + * Add a task after an existing named task. + * + * @param string $name + * The name of the task to insert before. The named task MUST exist. + * @param callable|TaskInterface $task + * The task to add. + * @param int|string $nameOfTaskToAdd + * The name of the task to add. If not provided, will be associated + * with the named task it was added after. + * + * @return $this + */ + public function after($name, $task, $nameOfTaskToAdd = self::UNNAMEDTASK); + + /** + * Print a progress message after Collection::run() has executed + * all of the tasks that were added prior to the point when this + * method was called. If one of the previous tasks fail, then this + * message will not be printed. + * + * @param string $text Message to print. + * @param array $context Extra context data for use by the logger. Note + * that the data from the collection state is merged with the provided context. + * @param \Psr\Log\LogLevel|string $level The log level to print the information at. Default is NOTICE. + * + * @return $this + */ + public function progressMessage($text, $context = [], $level = LogLevel::NOTICE); +} diff --git a/vendor/consolidation/robo/src/Collection/CollectionProcessHook.php b/vendor/consolidation/robo/src/Collection/CollectionProcessHook.php new file mode 100644 index 0000000000000000000000000000000000000000..91efde747163d42c4cc384e1dbbc875ce7747585 --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/CollectionProcessHook.php @@ -0,0 +1,35 @@ +<?php +namespace Robo\Collection; + +use Consolidation\AnnotatedCommand\Hooks\ProcessResultInterface; +use Consolidation\AnnotatedCommand\CommandData; +use Robo\Contract\TaskInterface; +use Robo\Result; + +/** + * The collection process hook is added to the annotation command + * hook manager in Runner::configureContainer(). This hook will be + * called every time a command runs. If the command result is a + * \Robo\Contract\TaskInterface (in particular, \Robo\Collection\Collection), + * then we run the collection, and return the result. We ignore results + * of any other type. + */ +class CollectionProcessHook implements ProcessResultInterface +{ + /** + * @param \Robo\Result|\Robo\Contract\TaskInterface $result + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * + * @return null|\Robo\Result + */ + public function process($result, CommandData $commandData) + { + if ($result instanceof TaskInterface) { + try { + return $result->run(); + } catch (\Exception $e) { + return Result::fromException($result, $e); + } + } + } +} diff --git a/vendor/consolidation/robo/src/Collection/CompletionWrapper.php b/vendor/consolidation/robo/src/Collection/CompletionWrapper.php new file mode 100644 index 0000000000000000000000000000000000000000..3e81bd91cb723d69f322098372168ee9568caae1 --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/CompletionWrapper.php @@ -0,0 +1,106 @@ +<?php + +namespace Robo\Collection; + +use Robo\Task\BaseTask; +use Robo\Contract\TaskInterface; +use Robo\Contract\RollbackInterface; +use Robo\Contract\CompletionInterface; +use Robo\Contract\WrappedTaskInterface; + +/** + * Creates a task wrapper that will manage rollback and collection + * management to a task when it runs. Tasks are automatically + * wrapped in a CompletionWrapper when added to a task collection. + * + * Clients may need to wrap their task in a CompletionWrapper if it + * creates temporary objects. + * + * @see \Robo\Task\Filesystem\loadTasks::taskTmpDir + */ +class CompletionWrapper extends BaseTask implements WrappedTaskInterface +{ + /** + * @var \Robo\Collection\Collection + */ + private $collection; + + /** + * @var \Robo\Contract\TaskInterface + */ + private $task; + + /** + * @var NULL|\Robo\Contract\TaskInterface + */ + private $rollbackTask; + + /** + * Create a CompletionWrapper. + * + * Temporary tasks are always wrapped in a CompletionWrapper, as are + * any tasks that are added to a collection. If a temporary task + * is added to a collection, then it is first unwrapped from its + * CompletionWrapper (via its original() method), and then added to a + * new CompletionWrapper for the collection it is added to. + * + * In this way, when the CompletionWrapper is finally executed, the + * task's rollback and completion handlers will be registered on + * whichever collection it was registered on. + * + * @todo Why not CollectionInterface the type of the $collection argument? + * + * @param \Robo\Collection\Collection $collection + * @param \Robo\Contract\TaskInterface $task + * @param \Robo\Contract\TaskInterface|NULL $rollbackTask + */ + public function __construct(Collection $collection, TaskInterface $task, TaskInterface $rollbackTask = null) + { + $this->collection = $collection; + $this->task = ($task instanceof WrappedTaskInterface) ? $task->original() : $task; + $this->rollbackTask = $rollbackTask; + } + + /** + * {@inheritdoc} + */ + public function original() + { + return $this->task; + } + + /** + * Before running this task, register its rollback and completion + * handlers on its collection. The reason this class exists is to + * defer registration of rollback and completion tasks until 'run()' time. + * + * @return \Robo\Result + */ + public function run() + { + if ($this->rollbackTask) { + $this->collection->registerRollback($this->rollbackTask); + } + if ($this->task instanceof RollbackInterface) { + $this->collection->registerRollback(new CallableTask([$this->task, 'rollback'], $this->task)); + } + if ($this->task instanceof CompletionInterface) { + $this->collection->registerCompletion(new CallableTask([$this->task, 'complete'], $this->task)); + } + + return $this->task->run(); + } + + /** + * Make this wrapper object act like the class it wraps. + * + * @param string $function + * @param array $args + * + * @return mixed + */ + public function __call($function, $args) + { + return call_user_func_array(array($this->task, $function), $args); + } +} diff --git a/vendor/consolidation/robo/src/Collection/Element.php b/vendor/consolidation/robo/src/Collection/Element.php new file mode 100644 index 0000000000000000000000000000000000000000..b67b56bbd087585b247f8a4226c6a68492ba0306 --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/Element.php @@ -0,0 +1,116 @@ +<?php + +namespace Robo\Collection; + +use Robo\Contract\TaskInterface; +use Robo\Contract\WrappedTaskInterface; +use Robo\Contract\ProgressIndicatorAwareInterface; + +/** + * One element in a collection. Each element consists of a task + * all of its before tasks, and all of its after tasks. + * + * This class is internal to Collection; it should not be used directly. + */ +class Element +{ + /** + * @var \Robo\Contract\TaskInterface + */ + protected $task; + + /** + * @var array + */ + protected $before = []; + + /** + * @var array + */ + protected $after = []; + + public function __construct(TaskInterface $task) + { + $this->task = $task; + } + + /** + * @param mixed $before + * @param string $name + */ + public function before($before, $name) + { + if ($name) { + $this->before[$name] = $before; + } else { + $this->before[] = $before; + } + } + + /** + * @param mixed $after + * @param string $name + */ + public function after($after, $name) + { + if ($name) { + $this->after[$name] = $after; + } else { + $this->after[] = $after; + } + } + + /** + * @return array + */ + public function getBefore() + { + return $this->before; + } + + /** + * @return array + */ + public function getAfter() + { + return $this->after; + } + + /** + * @return \Robo\Contract\TaskInterface + */ + public function getTask() + { + return $this->task; + } + + /** + * @return array + */ + public function getTaskList() + { + return array_merge($this->getBefore(), [$this->getTask()], $this->getAfter()); + } + + /** + * @return int + */ + public function progressIndicatorSteps() + { + $steps = 0; + foreach ($this->getTaskList() as $task) { + if ($task instanceof WrappedTaskInterface) { + $task = $task->original(); + } + // If the task is a ProgressIndicatorAwareInterface, then it + // will advance the progress indicator a number of times. + if ($task instanceof ProgressIndicatorAwareInterface) { + $steps += $task->progressIndicatorSteps(); + } + // We also advance the progress indicator once regardless + // of whether it is progress-indicator aware or not. + $steps++; + } + return $steps; + } +} diff --git a/vendor/consolidation/robo/src/Collection/NestedCollectionInterface.php b/vendor/consolidation/robo/src/Collection/NestedCollectionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..5e32cf37ab63bc5bb29f8d55bafa7d0dc1feb1ea --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/NestedCollectionInterface.php @@ -0,0 +1,12 @@ +<?php +namespace Robo\Collection; + +interface NestedCollectionInterface +{ + /** + * @param \Robo\Collection\NestedCollectionInterface $parentCollection + * + * @return $this + */ + public function setParentCollection(NestedCollectionInterface $parentCollection); +} diff --git a/vendor/consolidation/robo/src/Collection/TaskForEach.php b/vendor/consolidation/robo/src/Collection/TaskForEach.php new file mode 100644 index 0000000000000000000000000000000000000000..030e50890baff7f4b36266472d9c6a9165997545 --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/TaskForEach.php @@ -0,0 +1,214 @@ +<?php +namespace Robo\Collection; + +use Robo\Result; +use Robo\TaskInfo; +use Robo\Task\BaseTask; +use Robo\Contract\BuilderAwareInterface; +use Robo\Common\BuilderAwareTrait; + +/** + * Creates a task wrapper that converts any Callable into an + * object that will execute the callback once for each item in the + * provided collection. + * + * It is not necessary to use this class directly; Collection::addIterable + * will automatically create one when it is called. + */ +class TaskForEach extends BaseTask implements NestedCollectionInterface, BuilderAwareInterface +{ + use BuilderAwareTrait; + + /** + * @var callable[] + */ + protected $functionStack = []; + + /** + * @var callable[] + */ + protected $countingStack = []; + + /** + * @var string + */ + protected $message; + + /** + * @var array + */ + protected $context = []; + + /** + * @var array $iterable + */ + protected $iterable = []; + + /** + * @var \Robo\Collection\NestedCollectionInterface + */ + protected $parentCollection; + + /** + * @var array $iterable + */ + public function __construct($iterable = []) + { + $this->setIterable($iterable); + } + + /** + * @param array $iterable + * + * @return $this + */ + public function setIterable($iterable) + { + $this->iterable = $iterable; + + return $this; + } + + /** + * @param string $message + * @param array $context + * + * @return $this + */ + public function iterationMessage($message, $context = []) + { + $this->message = $message; + $this->context = $context + ['name' => 'Progress']; + return $this; + } + + /** + * @param int|string $key + * @param mixed $value + */ + protected function showIterationMessage($key, $value) + { + if ($this->message) { + $context = ['key' => $key, 'value' => $value]; + $context += $this->context; + $context += TaskInfo::getTaskContext($this); + $this->printTaskInfo($this->message, $context); + } + } + + /** + * @param callable $fn + * + * @return $this + */ + public function withEachKeyValueCall(callable $fn) + { + $this->functionStack[] = $fn; + return $this; + } + + /** + * @param callable $fn + * + * @return \Robo\Collection\TaskForEach + */ + public function call(callable $fn) + { + return $this->withEachKeyValueCall( + function ($key, $value) use ($fn) { + return call_user_func($fn, $value); + } + ); + } + + /** + * @param callable $fn + * + * @return \Robo\Collection\TaskForEach + */ + public function withBuilder(callable $fn) + { + $this->countingStack[] = + function ($key, $value) use ($fn) { + // Create a new builder for every iteration + $builder = $this->collectionBuilder(); + // The user function should build task operations using + // the $key / $value parameters; we will call run() on + // the builder thus constructed. + call_user_func($fn, $builder, $key, $value); + return $builder->getCollection()->progressIndicatorSteps(); + }; + return $this->withEachKeyValueCall( + function ($key, $value) use ($fn) { + // Create a new builder for every iteration + $builder = $this->collectionBuilder() + ->setParentCollection($this->parentCollection); + // The user function should build task operations using + // the $key / $value parameters; we will call run() on + // the builder thus constructed. + call_user_func($fn, $builder, $key, $value); + return $builder->run(); + } + ); + } + + /** + * {@inheritdoc} + */ + public function setParentCollection(NestedCollectionInterface $parentCollection) + { + $this->parentCollection = $parentCollection; + return $this; + } + + /** + * {@inheritdoc} + */ + public function progressIndicatorSteps() + { + $multiplier = count($this->functionStack); + if (!empty($this->countingStack) && count($this->iterable)) { + $value = reset($this->iterable); + $key = key($this->iterable); + foreach ($this->countingStack as $fn) { + $multiplier += call_user_func($fn, $key, $value); + } + } + return count($this->iterable) * $multiplier; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $finalResult = Result::success($this); + $this->startProgressIndicator(); + foreach ($this->iterable as $key => $value) { + $this->showIterationMessage($key, $value); + try { + foreach ($this->functionStack as $fn) { + $result = call_user_func($fn, $key, $value); + $this->advanceProgressIndicator(); + if (!isset($result)) { + $result = Result::success($this); + } + // If the function returns a result, it must either return + // a \Robo\Result or an exit code. In the later case, we + // convert it to a \Robo\Result. + if (!$result instanceof Result) { + $result = new Result($this, $result); + } + if (!$result->wasSuccessful()) { + return $result; + } + $finalResult = $result->merge($finalResult); + } + } catch (\Exception $e) { + return Result::fromException($result, $e); + } + } + $this->stopProgressIndicator(); + return $finalResult; + } +} diff --git a/vendor/consolidation/robo/src/Collection/Temporary.php b/vendor/consolidation/robo/src/Collection/Temporary.php new file mode 100644 index 0000000000000000000000000000000000000000..dad25e34cedc3d6718b4eefdb76e01f915cea4b5 --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/Temporary.php @@ -0,0 +1,57 @@ +<?php + +namespace Robo\Collection; + +/** + * The temporary collection keeps track of the global collection of + * temporary cleanup tasks in instances where temporary-generating + * tasks are executed directly via their run() method, rather than + * as part of a collection. + * + * In general, temporary-generating tasks should always be run in + * a collection, as the cleanup functions registered with the + * Temporary collection will not run until requested. + * + * Since the results could be undefined if cleanup functions were called + * at arbitrary times during a program's execution, cleanup should only + * be done immeidately prior to program termination, when there is no + * danger of cleaning up after some unrelated task. + * + * An application need never use Temporary directly, save to + * call Temporary::wrap() inside loadTasks or loadShortcuts, and + * to call Temporary::complete() immediately prior to terminating. + * This is recommended, but not required; this function will be + * registered as a shutdown function, and called on termination. + */ +class Temporary +{ + private static $collection; + + /** + * Provides direct access to the collection of temporaries, if necessary. + */ + public static function getCollection() + { + if (!static::$collection) { + static::$collection = \Robo\Robo::getContainer()->get('collection'); + register_shutdown_function(function () { + static::complete(); + }); + } + + return static::$collection; + } + + /** + * Call the complete method of all of the registered objects. + */ + public static function complete() + { + // Run the collection of tasks. This will also run the + // completion tasks. + $collection = static::getCollection(); + $collection->run(); + // Make sure that our completion functions do not run twice. + $collection->reset(); + } +} diff --git a/vendor/consolidation/robo/src/Collection/loadTasks.php b/vendor/consolidation/robo/src/Collection/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..63a872990e7266676df0fe9403bec897f1289d51 --- /dev/null +++ b/vendor/consolidation/robo/src/Collection/loadTasks.php @@ -0,0 +1,17 @@ +<?php +namespace Robo\Collection; + +trait loadTasks +{ + /** + * Run a callback function on each item in a collection + * + * @param array $collection + * + * @return \Robo\Collection\TaskForEach|\Robo\Collection\CollectionBuilder + */ + protected function taskForEach($collection = []) + { + return $this->task(TaskForEach::class, $collection); + } +} diff --git a/vendor/consolidation/robo/src/Common/BuilderAwareTrait.php b/vendor/consolidation/robo/src/Common/BuilderAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..915ff008da29e04aac44f3af83fcc25757894c93 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/BuilderAwareTrait.php @@ -0,0 +1,45 @@ +<?php + +namespace Robo\Common; + +use Robo\Collection\CollectionBuilder; + +trait BuilderAwareTrait +{ + /** + * @var \Robo\Collection\CollectionBuilder + */ + protected $builder; + + /** + * @see \Robo\Contract\BuilderAwareInterface::setBuilder() + * + * @param \Robo\Collection\CollectionBuilder $builder + * + * @return $this + */ + public function setBuilder(CollectionBuilder $builder) + { + $this->builder = $builder; + + return $this; + } + + /** + * @see \Robo\Contract\BuilderAwareInterface::getBuilder() + * + * @return \Robo\Collection\CollectionBuilder + */ + public function getBuilder() + { + return $this->builder; + } + + /** + * @return \Robo\Collection\CollectionBuilder + */ + protected function collectionBuilder() + { + return $this->getBuilder()->newBuilder(); + } +} diff --git a/vendor/consolidation/robo/src/Common/CommandArguments.php b/vendor/consolidation/robo/src/Common/CommandArguments.php new file mode 100644 index 0000000000000000000000000000000000000000..12c2e89fd2badf9ba0c653e3694be2663d2116c5 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/CommandArguments.php @@ -0,0 +1,130 @@ +<?php +namespace Robo\Common; + +use Robo\Common\ProcessUtils; + +/** + * Use this to add arguments and options to the $arguments property. + */ +trait CommandArguments +{ + /** + * @var string + */ + protected $arguments = ''; + + /** + * Pass argument to executable. Its value will be automatically escaped. + * + * @param string $arg + * + * @return $this + */ + public function arg($arg) + { + return $this->args($arg); + } + + /** + * Pass methods parameters as arguments to executable. Argument values + * are automatically escaped. + * + * @param string|string[] $args + * + * @return $this + */ + public function args($args) + { + if (!is_array($args)) { + $args = func_get_args(); + } + $this->arguments .= ' ' . implode(' ', array_map('static::escape', $args)); + return $this; + } + + /** + * Pass the provided string in its raw (as provided) form as an argument to executable. + * + * @param string $arg + * + * @return $this + */ + public function rawArg($arg) + { + $this->arguments .= " $arg"; + + return $this; + } + + /** + * Escape the provided value, unless it contains only alphanumeric + * plus a few other basic characters. + * + * @param string $value + * + * @return string + */ + public static function escape($value) + { + if (preg_match('/^[a-zA-Z0-9\/\.@~_-]+$/', $value)) { + return $value; + } + return ProcessUtils::escapeArgument($value); + } + + /** + * Pass option to executable. Options are prefixed with `--` , value can be provided in second parameter. + * Option values are automatically escaped. + * + * @param string $option + * @param string $value + * @param string $separator + * + * @return $this + */ + public function option($option, $value = null, $separator = ' ') + { + if ($option !== null and strpos($option, '-') !== 0) { + $option = "--$option"; + } + $this->arguments .= null == $option ? '' : " " . $option; + $this->arguments .= null == $value ? '' : $separator . static::escape($value); + return $this; + } + + /** + * Pass multiple options to executable. The associative array contains + * the key:value pairs that become `--key value`, for each item in the array. + * Values are automatically escaped. + */ + public function options(array $options, $separator = ' ') + { + foreach ($options as $option => $value) { + $this->option($option, $value, $separator); + } + return $this; + } + + /** + * Pass an option with multiple values to executable. Value can be a string or array. + * Option values are automatically escaped. + * + * @param string $option + * @param string|array $value + * @param string $separator + * + * @return $this + */ + public function optionList($option, $value = array(), $separator = ' ') + { + if (is_array($value)) { + foreach ($value as $item) { + $this->optionList($option, $item, $separator); + } + } else { + $this->option($option, $value, $separator); + } + + return $this; + } +} diff --git a/vendor/consolidation/robo/src/Common/CommandReceiver.php b/vendor/consolidation/robo/src/Common/CommandReceiver.php new file mode 100644 index 0000000000000000000000000000000000000000..03b20fced191d4224bcaf62cd5e324d7a838130a --- /dev/null +++ b/vendor/consolidation/robo/src/Common/CommandReceiver.php @@ -0,0 +1,30 @@ +<?php +namespace Robo\Common; + +use Robo\Contract\CommandInterface; +use Robo\Exception\TaskException; + +/** + * This task can receive commands from task implementing CommandInterface. + */ +trait CommandReceiver +{ + /** + * @param string|\Robo\Contract\CommandInterface $command + * + * @return string + * + * @throws \Robo\Exception\TaskException + */ + protected function receiveCommand($command) + { + if (!is_object($command)) { + return $command; + } + if ($command instanceof CommandInterface) { + return $command->getCommand(); + } else { + throw new TaskException($this, get_class($command) . " does not implement CommandInterface, so can't be passed into this task"); + } + } +} diff --git a/vendor/consolidation/robo/src/Common/ConfigAwareTrait.php b/vendor/consolidation/robo/src/Common/ConfigAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..74b48f073b73e8228e18c642fd97476e576d68ea --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ConfigAwareTrait.php @@ -0,0 +1,105 @@ +<?php + +namespace Robo\Common; + +use Robo\Robo; +use Consolidation\Config\ConfigInterface; + +trait ConfigAwareTrait +{ + /** + * @var ConfigInterface + */ + protected $config; + + /** + * Set the config management object. + * + * @param ConfigInterface $config + * + * @return $this + */ + public function setConfig(ConfigInterface $config) + { + $this->config = $config; + + return $this; + } + + /** + * Get the config management object. + * + * @return \Robo\Config\Config + */ + public function getConfig() + { + return $this->config; + } + + /** + * Any class that uses ConfigAwareTrait SHOULD override this method + * , and define a prefix for its configuration items. This is usually + * done in a base class. When used, this method should return a string + * that ends with a "."; see BaseTask::configPrefix(). + * + * @return string + */ + protected static function configPrefix() + { + return ''; + } + + protected static function configClassIdentifier($classname) + { + $configIdentifier = strtr($classname, '\\', '.'); + $configIdentifier = preg_replace('#^(.*\.Task\.|\.)#', '', $configIdentifier); + + return $configIdentifier; + } + + protected static function configPostfix() + { + return ''; + } + + /** + * @param string $key + * + * @return string + */ + private static function getClassKey($key) + { + $configPrefix = static::configPrefix(); // task. + $configClass = static::configClassIdentifier(get_called_class()); // PARTIAL_NAMESPACE.CLASSNAME + $configPostFix = static::configPostfix(); // .settings + + return sprintf('%s%s%s.%s', $configPrefix, $configClass, $configPostFix, $key); + } + + /** + * @param string $key + * @param mixed $value + * @param Config|null $config + */ + public static function configure($key, $value, $config = null) + { + if (!$config) { + $config = Robo::config(); + } + $config->setDefault(static::getClassKey($key), $value); + } + + /** + * @param string $key + * @param mixed|null $default + * + * @return mixed|null + */ + protected function getConfigValue($key, $default = null) + { + if (!$this->getConfig()) { + return $default; + } + return $this->getConfig()->get(static::getClassKey($key), $default); + } +} diff --git a/vendor/consolidation/robo/src/Common/DynamicParams.php b/vendor/consolidation/robo/src/Common/DynamicParams.php new file mode 100644 index 0000000000000000000000000000000000000000..28a1d150f9320b1403969d72ab243cca39a4b113 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/DynamicParams.php @@ -0,0 +1,45 @@ +<?php +namespace Robo\Common; + +/** + * Simplifies generating of configuration chanined methods. + * You can only define configuration properties and use magic methods to set them. + * Methods will be named the same way as properties. + * * Boolean properties are switched on/off if no values is provided. + * * Array properties can accept non-array values, in this case value will be appended to array. + * You should also define phpdoc for methods. + */ +trait DynamicParams +{ + /** + * @param string $property + * @param array $args + * + * @return $this + */ + public function __call($property, $args) + { + if (!property_exists($this, $property)) { + throw new \RuntimeException("Property $property in task ".get_class($this).' does not exists'); + } + + // toggle boolean values + if (!isset($args[0]) and (is_bool($this->$property))) { + $this->$property = !$this->$property; + return $this; + } + + // append item to array + if (is_array($this->$property)) { + if (is_array($args[0])) { + $this->$property = $args[0]; + } else { + array_push($this->$property, $args[0]); + } + return $this; + } + + $this->$property = $args[0]; + return $this; + } +} diff --git a/vendor/consolidation/robo/src/Common/ExecCommand.php b/vendor/consolidation/robo/src/Common/ExecCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..c3e6c3af636c77db54884ae85d66b3f5583139ea --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ExecCommand.php @@ -0,0 +1,148 @@ +<?php +namespace Robo\Common; + +use Robo\Result; +use Symfony\Component\Process\ExecutableFinder; +use Symfony\Component\Process\Process; + +/** + * This task is supposed to be executed as shell command. + * You can specify working directory and if output is printed. + */ +trait ExecCommand +{ + use ExecTrait; + + /** + * @var \Robo\Common\TimeKeeper + */ + protected $execTimer; + + /** + * @return \Robo\Common\TimeKeeper + */ + protected function getExecTimer() + { + if (!isset($this->execTimer)) { + $this->execTimer = new TimeKeeper(); + } + return $this->execTimer; + } + + /** + * Look for a "{$cmd}.phar" in the current working + * directory; return a string to exec it if it is + * found. Otherwise, look for an executable command + * of the same name via findExecutable. + * + * @param string $cmd + * + * @return bool|string + */ + protected function findExecutablePhar($cmd) + { + if (file_exists("{$cmd}.phar")) { + return "php {$cmd}.phar"; + } + return $this->findExecutable($cmd); + } + + /** + * Return the best path to the executable program + * with the provided name. Favor vendor/bin in the + * current project. If not found there, use + * whatever is on the $PATH. + * + * @param string $cmd + * + * @return bool|string + */ + protected function findExecutable($cmd) + { + $pathToCmd = $this->searchForExecutable($cmd); + if ($pathToCmd) { + return $this->useCallOnWindows($pathToCmd); + } + return false; + } + + /** + * @param string $cmd + * + * @return string + */ + private function searchForExecutable($cmd) + { + $projectBin = $this->findProjectBin(); + + $localComposerInstallation = $projectBin . DIRECTORY_SEPARATOR . $cmd; + if (file_exists($localComposerInstallation)) { + return $localComposerInstallation; + } + $finder = new ExecutableFinder(); + return $finder->find($cmd, null, []); + } + + /** + * @return bool|string + */ + protected function findProjectBin() + { + $cwd = getcwd(); + $candidates = [ __DIR__ . '/../../vendor/bin', __DIR__ . '/../../bin', $cwd . '/vendor/bin' ]; + + // If this project is inside a vendor directory, give highest priority + // to that directory. + $vendorDirContainingUs = realpath(__DIR__ . '/../../../..'); + if (is_dir($vendorDirContainingUs) && (basename($vendorDirContainingUs) == 'vendor')) { + array_unshift($candidates, $vendorDirContainingUs . '/bin'); + } + + foreach ($candidates as $dir) { + if (is_dir("$dir")) { + return realpath($dir); + } + } + return false; + } + + /** + * Wrap Windows executables in 'call' per 7a88757d + * + * @param string $cmd + * + * @return string + */ + protected function useCallOnWindows($cmd) + { + if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if (file_exists("{$cmd}.bat")) { + $cmd = "{$cmd}.bat"; + } + return "call $cmd"; + } + return $cmd; + } + + protected function getCommandDescription() + { + return $this->process->getCommandLine(); + } + + /** + * @param string $command + * + * @return \Robo\Result + */ + protected function executeCommand($command) + { + // TODO: Symfony 4 requires that we supply the working directory. + $result_data = $this->execute(new Process($command, getcwd())); + return new Result( + $this, + $result_data->getExitCode(), + $result_data->getMessage(), + $result_data->getData() + ); + } +} diff --git a/vendor/consolidation/robo/src/Common/ExecOneCommand.php b/vendor/consolidation/robo/src/Common/ExecOneCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..601375149772c93e13addc143a1673a97eb21163 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ExecOneCommand.php @@ -0,0 +1,12 @@ +<?php +namespace Robo\Common; + +/** + * This task specifies exactly one shell command. + * It can take additional arguments and options as config parameters. + */ +trait ExecOneCommand +{ + use ExecCommand; + use CommandArguments; +} diff --git a/vendor/consolidation/robo/src/Common/ExecTrait.php b/vendor/consolidation/robo/src/Common/ExecTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..85a9f4c9d503c1aaa6df639641c2eba9228c48d1 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ExecTrait.php @@ -0,0 +1,413 @@ +<?php + +namespace Robo\Common; + +use Robo\ResultData; +use Symfony\Component\Process\Process; + +/** + * Class ExecTrait + * @package Robo\Common + */ +trait ExecTrait +{ + /** + * @var bool + */ + protected $background = false; + + /** + * @var null|int + */ + protected $timeout = null; + + /** + * @var null|int + */ + protected $idleTimeout = null; + + /** + * @var null|array + */ + protected $env = null; + + /** + * @var Process + */ + protected $process; + + /** + * @var resource|string + */ + protected $input; + + /** + * @var boolean + */ + protected $interactive = null; + + /** + * @var bool + */ + protected $isPrinted = true; + + /** + * @var bool + */ + protected $isMetadataPrinted = true; + + /** + * @var string + */ + protected $workingDirectory; + + /** + * @return string + */ + abstract public function getCommandDescription(); + + /** Typically provided by Timer trait via ProgressIndicatorAwareTrait. */ + abstract public function startTimer(); + abstract public function stopTimer(); + abstract public function getExecutionTime(); + + /** + * Typically provided by TaskIO Trait. + */ + abstract public function hideTaskProgress(); + abstract public function showTaskProgress($inProgress); + abstract public function printTaskInfo($text, $context = null); + + /** + * Typically provided by VerbosityThresholdTrait. + */ + abstract public function verbosityMeetsThreshold(); + abstract public function writeMessage($message); + + /** + * Sets $this->interactive() based on posix_isatty(). + * + * @return $this + */ + public function detectInteractive() + { + // If the caller did not explicity set the 'interactive' mode, + // and output should be produced by this task (verbosityMeetsThreshold), + // then we will automatically set interactive mode based on whether + // or not output was redirected when robo was executed. + if (!isset($this->interactive) && function_exists('posix_isatty') && $this->verbosityMeetsThreshold()) { + $this->interactive = posix_isatty(STDOUT); + } + + return $this; + } + + /** + * Executes command in background mode (asynchronously) + * + * @return $this + */ + public function background($arg = true) + { + $this->background = $arg; + return $this; + } + + /** + * Stop command if it runs longer then $timeout in seconds + * + * @param int $timeout + * + * @return $this + */ + public function timeout($timeout) + { + $this->timeout = $timeout; + return $this; + } + + /** + * Stops command if it does not output something for a while + * + * @param int $timeout + * + * @return $this + */ + public function idleTimeout($timeout) + { + $this->idleTimeout = $timeout; + return $this; + } + + /** + * Set a single environment variable, or multiple. + */ + public function env($env, $value = null) + { + if (!is_array($env)) { + $env = [$env => ($value ? $value : true)]; + } + return $this->envVars($env); + } + + /** + * Sets the environment variables for the command + * + * @param array $env + * + * @return $this + */ + public function envVars(array $env) + { + $this->env = $this->env ? $env + $this->env : $env; + return $this; + } + + /** + * Pass an input to the process. Can be resource created with fopen() or string + * + * @param resource|string $input + * + * @return $this + */ + public function setInput($input) + { + $this->input = $input; + return $this; + } + + /** + * Attach tty to process for interactive input + * + * @param $interactive bool + * + * @return $this + */ + public function interactive($interactive = true) + { + $this->interactive = $interactive; + return $this; + } + + + /** + * Is command printing its output to screen + * + * @return bool + */ + public function getPrinted() + { + return $this->isPrinted; + } + + /** + * Changes working directory of command + * + * @param string $dir + * + * @return $this + */ + public function dir($dir) + { + $this->workingDirectory = $dir; + return $this; + } + + /** + * Shortcut for setting isPrinted() and isMetadataPrinted() to false. + * + * @param bool $arg + * + * @return $this + */ + public function silent($arg) + { + if (is_bool($arg)) { + $this->isPrinted = !$arg; + $this->isMetadataPrinted = !$arg; + } + return $this; + } + + /** + * Should command output be printed + * + * @param bool $arg + * + * @return $this + * + * @deprecated + */ + public function printed($arg) + { + $this->logger->warning("printed() is deprecated. Please use printOutput()."); + return $this->printOutput($arg); + } + + /** + * Should command output be printed + * + * @param bool $arg + * + * @return $this + */ + public function printOutput($arg) + { + if (is_bool($arg)) { + $this->isPrinted = $arg; + } + return $this; + } + + /** + * Should command metadata be printed. I,e., command and timer. + * + * @param bool $arg + * + * @return $this + */ + public function printMetadata($arg) + { + if (is_bool($arg)) { + $this->isMetadataPrinted = $arg; + } + return $this; + } + + /** + * @param Process $process + * @param callable $output_callback + * + * @return \Robo\ResultData + */ + protected function execute($process, $output_callback = null) + { + $this->process = $process; + + if (!$output_callback) { + $output_callback = function ($type, $buffer) { + $progressWasVisible = $this->hideTaskProgress(); + $this->writeMessage($buffer); + $this->showTaskProgress($progressWasVisible); + }; + } + + $this->detectInteractive(); + + if ($this->isMetadataPrinted) { + $this->printAction(); + } + $this->process->setTimeout($this->timeout); + $this->process->setIdleTimeout($this->idleTimeout); + if ($this->workingDirectory) { + $this->process->setWorkingDirectory($this->workingDirectory); + } + if ($this->input) { + $this->process->setInput($this->input); + } + + if ($this->interactive && $this->isPrinted) { + $this->process->setTty(true); + } + + if (isset($this->env)) { + // Symfony 4 will inherit environment variables by default, but until + // then, manually ensure they are inherited. + if (method_exists($this->process, 'inheritEnvironmentVariables')) { + $this->process->inheritEnvironmentVariables(); + } + $this->process->setEnv($this->env); + } + + if (!$this->background && !$this->isPrinted) { + $this->startTimer(); + $this->process->run(); + $this->stopTimer(); + $output = rtrim($this->process->getOutput()); + return new ResultData( + $this->process->getExitCode(), + $output, + $this->getResultData() + ); + } + + if (!$this->background && $this->isPrinted) { + $this->startTimer(); + $this->process->run($output_callback); + $this->stopTimer(); + return new ResultData( + $this->process->getExitCode(), + $this->process->getOutput(), + $this->getResultData() + ); + } + + try { + $this->process->start(); + } catch (\Exception $e) { + return new ResultData( + $this->process->getExitCode(), + $e->getMessage(), + $this->getResultData() + ); + } + return new ResultData($this->process->getExitCode()); + } + + /** + * + */ + protected function stop() + { + if ($this->background && isset($this->process) && $this->process->isRunning()) { + $this->process->stop(); + $this->printTaskInfo( + "Stopped {command}", + ['command' => $this->getCommandDescription()] + ); + } + } + + /** + * @param array $context + */ + protected function printAction($context = []) + { + $command = $this->getCommandDescription(); + $formatted_command = $this->formatCommandDisplay($command); + + $dir = $this->workingDirectory ? " in {dir}" : ""; + $this->printTaskInfo("Running {command}$dir", [ + 'command' => $formatted_command, + 'dir' => $this->workingDirectory + ] + $context); + } + + /** + * @param $command + * + * @return mixed + */ + protected function formatCommandDisplay($command) + { + $formatted_command = str_replace("&&", "&&\n", $command); + $formatted_command = str_replace("||", "||\n", $formatted_command); + + return $formatted_command; + } + + /** + * Gets the data array to be passed to Result(). + * + * @return array + * The data array passed to Result(). + */ + protected function getResultData() + { + if ($this->isMetadataPrinted) { + return ['time' => $this->getExecutionTime()]; + } + + return []; + } +} diff --git a/vendor/consolidation/robo/src/Common/IO.php b/vendor/consolidation/robo/src/Common/IO.php new file mode 100644 index 0000000000000000000000000000000000000000..d6c77bff8dd3f0ccf50c6cd7a40ec979f89d3c62 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/IO.php @@ -0,0 +1,171 @@ +<?php +namespace Robo\Common; + +use Symfony\Component\Console\Helper\QuestionHelper; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; +use Symfony\Component\Console\Style\SymfonyStyle; + +trait IO +{ + use InputAwareTrait; + use OutputAwareTrait; + + /** + * @var \Symfony\Component\Console\Style\SymfonyStyle + */ + protected $io; + + /** + * Provide access to SymfonyStyle object. + * + * @return SymfonyStyle + * + * @see http://symfony.com/blog/new-in-symfony-2-8-console-style-guide + */ + protected function io() + { + if (!$this->io) { + $this->io = new SymfonyStyle($this->input(), $this->output()); + } + return $this->io; + } + + /** + * @param string $nonDecorated + * @param string $decorated + * + * @return string + */ + protected function decorationCharacter($nonDecorated, $decorated) + { + if (!$this->output()->isDecorated() || (strncasecmp(PHP_OS, 'WIN', 3) == 0)) { + return $nonDecorated; + } + return $decorated; + } + + /** + * @param string $text + */ + protected function say($text) + { + $char = $this->decorationCharacter('>', '➜'); + $this->writeln("$char $text"); + } + + /** + * @param string $text + * @param int $length + * @param string $color + */ + protected function yell($text, $length = 40, $color = 'green') + { + $char = $this->decorationCharacter(' ', '➜'); + $format = "$char <fg=white;bg=$color;options=bold>%s</fg=white;bg=$color;options=bold>"; + $this->formattedOutput($text, $length, $format); + } + + /** + * @param string $text + * @param int $length + * @param string $format + */ + protected function formattedOutput($text, $length, $format) + { + $lines = explode("\n", trim($text, "\n")); + $maxLineLength = array_reduce(array_map('strlen', $lines), 'max'); + $length = max($length, $maxLineLength); + $len = $length + 2; + $space = str_repeat(' ', $len); + $this->writeln(sprintf($format, $space)); + foreach ($lines as $line) { + $line = str_pad($line, $length, ' ', STR_PAD_BOTH); + $this->writeln(sprintf($format, " $line ")); + } + $this->writeln(sprintf($format, $space)); + } + + /** + * @param string $question + * @param bool $hideAnswer + * + * @return string + */ + protected function ask($question, $hideAnswer = false) + { + if ($hideAnswer) { + return $this->askHidden($question); + } + return $this->doAsk(new Question($this->formatQuestion($question))); + } + + /** + * @param string $question + * + * @return string + */ + protected function askHidden($question) + { + $question = new Question($this->formatQuestion($question)); + $question->setHidden(true); + return $this->doAsk($question); + } + + /** + * @param string $question + * @param string $default + * + * @return string + */ + protected function askDefault($question, $default) + { + return $this->doAsk(new Question($this->formatQuestion("$question [$default]"), $default)); + } + + /** + * @param string $question + * + * @return string + */ + protected function confirm($question) + { + return $this->doAsk(new ConfirmationQuestion($this->formatQuestion($question . ' (y/n)'), false)); + } + + /** + * @param \Symfony\Component\Console\Question\Question $question + * + * @return string + */ + protected function doAsk(Question $question) + { + return $this->getDialog()->ask($this->input(), $this->output(), $question); + } + + /** + * @param string $message + * + * @return string + */ + protected function formatQuestion($message) + { + return "<question>? $message</question> "; + } + + /** + * @return \Symfony\Component\Console\Helper\QuestionHelper + */ + protected function getDialog() + { + return new QuestionHelper(); + } + + /** + * @param $text + */ + protected function writeln($text) + { + $this->output()->writeln($text); + } +} diff --git a/vendor/consolidation/robo/src/Common/InflectionTrait.php b/vendor/consolidation/robo/src/Common/InflectionTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..8bc4e831c3178def48b4248d01132135a513612c --- /dev/null +++ b/vendor/consolidation/robo/src/Common/InflectionTrait.php @@ -0,0 +1,21 @@ +<?php +namespace Robo\Common; + +use Robo\Contract\InflectionInterface; + +trait InflectionTrait +{ + /** + * Ask the provided parent class to inject all of the dependencies + * that it has and we need. + * + * @param \Robo\Contract\InflectionInterface $parent + * + * @return $this + */ + public function inflect(InflectionInterface $parent) + { + $parent->injectDependencies($this); + return $this; + } +} diff --git a/vendor/consolidation/robo/src/Common/InputAwareTrait.php b/vendor/consolidation/robo/src/Common/InputAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..bae58c171c0c8c35c7bbfe022469e9ac6f791449 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/InputAwareTrait.php @@ -0,0 +1,51 @@ +<?php + +namespace Robo\Common; + +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\InputInterface; + +trait InputAwareTrait +{ + /** + * @var \Symfony\Component\Console\Input\InputInterface + */ + protected $input; + + /** + * @param \Symfony\Component\Console\Input\InputInterface $input + * + * @return $this + * + * @see \Symfony\Component\Console\Input\InputAwareInterface::setInput() + */ + public function setInput(InputInterface $input) + { + $this->input = $input; + + return $this; + } + + /** + * @return \Symfony\Component\Console\Input\InputInterface + */ + protected function input() + { + if (!isset($this->input)) { + $this->setInput(new ArgvInput()); + } + return $this->input; + } + + /** + * Backwards compatibility. + * + * @return \Symfony\Component\Console\Input\InputInterface + * + * @deprecated + */ + protected function getInput() + { + return $this->input(); + } +} diff --git a/vendor/consolidation/robo/src/Common/OutputAdapter.php b/vendor/consolidation/robo/src/Common/OutputAdapter.php new file mode 100644 index 0000000000000000000000000000000000000000..b8e795f23cb48d1d449ba547383b1199fcf05317 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/OutputAdapter.php @@ -0,0 +1,38 @@ +<?php +namespace Robo\Common; + +use Robo\Contract\OutputAdapterInterface; +use Robo\Contract\OutputAwareInterface; +use Robo\Contract\VerbosityThresholdInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Adapt OutputInterface or other output function to the VerbosityThresholdInterface. + */ +class OutputAdapter implements OutputAdapterInterface, OutputAwareInterface +{ + use OutputAwareTrait; + + protected $verbosityMap = [ + VerbosityThresholdInterface::VERBOSITY_NORMAL => OutputInterface::VERBOSITY_NORMAL, + VerbosityThresholdInterface::VERBOSITY_VERBOSE => OutputInterface::VERBOSITY_VERBOSE, + VerbosityThresholdInterface::VERBOSITY_VERY_VERBOSE => OutputInterface::VERBOSITY_VERY_VERBOSE, + VerbosityThresholdInterface::VERBOSITY_DEBUG => OutputInterface::VERBOSITY_DEBUG, + ]; + + public function verbosityMeetsThreshold($verbosityThreshold) + { + if (!isset($this->verbosityMap[$verbosityThreshold])) { + return true; + } + $verbosityThreshold = $this->verbosityMap[$verbosityThreshold]; + $verbosity = $this->output()->getVerbosity(); + + return $verbosity >= $verbosityThreshold; + } + + public function writeMessage($message) + { + $this->output()->write($message); + } +} diff --git a/vendor/consolidation/robo/src/Common/OutputAwareTrait.php b/vendor/consolidation/robo/src/Common/OutputAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..b454f234972c93aab525f7efa567411eb9591db8 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/OutputAwareTrait.php @@ -0,0 +1,64 @@ +<?php + +namespace Robo\Common; + +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\NullOutput; +use Symfony\Component\Console\Output\OutputInterface; + +trait OutputAwareTrait +{ + /** + * @var \Symfony\Component\Console\Output\OutputInterface + */ + protected $output; + + /** + * @param \Symfony\Component\Console\Output\OutputInterface $output + * + * @return $this + * + * @see \Robo\Contract\OutputAwareInterface::setOutput() + */ + public function setOutput(OutputInterface $output) + { + $this->output = $output; + + return $this; + } + + /** + * @return \Symfony\Component\Console\Output\OutputInterface + */ + protected function output() + { + if (!isset($this->output)) { + $this->setOutput(new NullOutput()); + } + return $this->output; + } + + /** + * @return \Symfony\Component\Console\Output\OutputInterface + */ + protected function stderr() + { + $output = $this->output(); + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + return $output; + } + + /** + * Backwards compatibility + * + * @return \Symfony\Component\Console\Output\OutputInterface + * + * @deprecated + */ + protected function getOutput() + { + return $this->output(); + } +} diff --git a/vendor/consolidation/robo/src/Common/ProcessExecutor.php b/vendor/consolidation/robo/src/Common/ProcessExecutor.php new file mode 100644 index 0000000000000000000000000000000000000000..f78a477521dcf4a3881b640222581f33aa28b5cb --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ProcessExecutor.php @@ -0,0 +1,51 @@ +<?php + +namespace Robo\Common; + +use Psr\Log\LoggerAwareInterface; +use Robo\Contract\ConfigAwareInterface; +use Robo\Contract\OutputAwareInterface; +use Robo\Contract\VerbosityThresholdInterface; +use Symfony\Component\Process\Process; + +class ProcessExecutor implements ConfigAwareInterface, LoggerAwareInterface, OutputAwareInterface, VerbosityThresholdInterface +{ + use ExecTrait; + use TaskIO; // uses LoggerAwareTrait and ConfigAwareTrait + use ProgressIndicatorAwareTrait; + use OutputAwareTrait; + + /** + * @param Process $process + * @return type + */ + public function __construct(Process $process) + { + $this->process = $process; + } + + public static function create($container, $process) + { + $processExecutor = new self($process); + + $processExecutor->setLogger($container->get('logger')); + $processExecutor->setProgressIndicator($container->get('progressIndicator')); + $processExecutor->setConfig($container->get('config')); + $processExecutor->setOutputAdapter($container->get('outputAdapter')); + + return $processExecutor; + } + + /** + * @return string + */ + protected function getCommandDescription() + { + return $this->process->getCommandLine(); + } + + public function run() + { + return $this->execute($this->process); + } +} diff --git a/vendor/consolidation/robo/src/Common/ProcessUtils.php b/vendor/consolidation/robo/src/Common/ProcessUtils.php new file mode 100644 index 0000000000000000000000000000000000000000..7dc4e55317a1a2d1a49b3c9ab6740a92ec7ec11d --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ProcessUtils.php @@ -0,0 +1,79 @@ +<?php + +/* + * This file is derived from part of the Symfony package, which is + * (c) Fabien Potencier <fabien@symfony.com> + */ + +namespace Robo\Common; + +use Symfony\Component\Process\Exception\InvalidArgumentException; + +/** + * ProcessUtils is a bunch of utility methods. We want to allow Robo 1.x + * to work with Symfony 4.x while remaining backwards compatibility. This + * requires us to replace some deprecated functionality removed in Symfony. + */ +class ProcessUtils +{ + /** + * This class should not be instantiated. + */ + private function __construct() + { + } + + /** + * Escapes a string to be used as a shell argument. + * + * @param string $argument The argument that will be escaped + * + * @return string The escaped argument + * + * @deprecated since version 3.3, to be removed in 4.0. Use a command line array or give env vars to the `Process::start/run()` method instead. + */ + public static function escapeArgument($argument) + { + @trigger_error('The '.__METHOD__.'() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0.', E_USER_DEPRECATED); + + //Fix for PHP bug #43784 escapeshellarg removes % from given string + //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows + //@see https://bugs.php.net/bug.php?id=43784 + //@see https://bugs.php.net/bug.php?id=49446 + if ('\\' === DIRECTORY_SEPARATOR) { + if ('' === $argument) { + return escapeshellarg($argument); + } + + $escapedArgument = ''; + $quote = false; + foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { + if ('"' === $part) { + $escapedArgument .= '\\"'; + } elseif (self::isSurroundedBy($part, '%')) { + // Avoid environment variable expansion + $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; + } else { + // escape trailing backslash + if ('\\' === substr($part, -1)) { + $part .= '\\'; + } + $quote = true; + $escapedArgument .= $part; + } + } + if ($quote) { + $escapedArgument = '"'.$escapedArgument.'"'; + } + + return $escapedArgument; + } + + return "'".str_replace("'", "'\\''", $argument)."'"; + } + + private static function isSurroundedBy($arg, $char) + { + return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; + } +} diff --git a/vendor/consolidation/robo/src/Common/ProgressIndicator.php b/vendor/consolidation/robo/src/Common/ProgressIndicator.php new file mode 100644 index 0000000000000000000000000000000000000000..fe6c9298ee91f21ead6707fb8c15b7a10e73c394 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ProgressIndicator.php @@ -0,0 +1,201 @@ +<?php +namespace Robo\Common; + +/** + * Wrapper around \Symfony\Component\Console\Helper\ProgressBar + */ +class ProgressIndicator +{ + use Timer; + + /** + * @var \Symfony\Component\Console\Helper\ProgressBar + */ + protected $progressBar; + + /** + * @var \Symfony\Component\Console\Output\OutputInterface + */ + protected $output; + + /** + * @var bool + */ + protected $progressIndicatorRunning = false; + + /** + * @var int + */ + protected $autoDisplayInterval = 0; + + /** + * @var int + */ + protected $cachedSteps = 0; + + /** + * @var int + */ + protected $totalSteps = 0; + + /** + * @var bool + */ + protected $progressBarDisplayed = false; + + /** + * @var \Robo\Contract\TaskInterface + */ + protected $owner; + + /** + * @param \Symfony\Component\Console\Helper\ProgressBar $progressBar + * @param \Symfony\Component\Console\Output\OutputInterface $output + */ + public function __construct($progressBar, \Symfony\Component\Console\Output\OutputInterface $output) + { + $this->progressBar = $progressBar; + $this->output = $output; + } + + /** + * @param int $interval + */ + public function setProgressBarAutoDisplayInterval($interval) + { + if ($this->progressIndicatorRunning) { + return; + } + $this->autoDisplayInterval = $interval; + } + + /** + * @return bool + */ + public function hideProgressIndicator() + { + $result = $this->progressBarDisplayed; + if ($this->progressIndicatorRunning && $this->progressBarDisplayed) { + $this->progressBar->clear(); + // Hack: progress indicator does not reset cursor to beginning of line on 'clear' + $this->output->write("\x0D"); + $this->progressBarDisplayed = false; + } + return $result; + } + + public function showProgressIndicator() + { + if ($this->progressIndicatorRunning && !$this->progressBarDisplayed && isset($this->progressBar)) { + $this->progressBar->display(); + $this->progressBarDisplayed = true; + $this->advanceProgressIndicatorCachedSteps(); + } + } + + /** + * @param bool $visible + */ + public function restoreProgressIndicator($visible) + { + if ($visible) { + $this->showProgressIndicator(); + } + } + + /** + * @param int $totalSteps + * @param \Robo\Contract\TaskInterface $owner + */ + public function startProgressIndicator($totalSteps, $owner) + { + if (!isset($this->progressBar)) { + return; + } + + $this->progressIndicatorRunning = true; + if (!isset($this->owner)) { + $this->owner = $owner; + $this->startTimer(); + $this->totalSteps = $totalSteps; + $this->autoShowProgressIndicator(); + } + } + + public function autoShowProgressIndicator() + { + if (($this->autoDisplayInterval < 0) || !isset($this->progressBar) || !$this->output->isDecorated()) { + return; + } + if ($this->autoDisplayInterval <= $this->getExecutionTime()) { + $this->autoDisplayInterval = -1; + $this->progressBar->start($this->totalSteps); + $this->showProgressIndicator(); + } + } + + /** + * @return bool + */ + public function inProgress() + { + return $this->progressIndicatorRunning; + } + + /** + * @param \Robo\Contract\TaskInterface $owner + */ + public function stopProgressIndicator($owner) + { + if ($this->progressIndicatorRunning && ($this->owner === $owner)) { + $this->cleanup(); + } + } + + protected function cleanup() + { + $this->progressIndicatorRunning = false; + $this->owner = null; + if ($this->progressBarDisplayed) { + $this->progressBar->finish(); + // Hack: progress indicator does not always finish cleanly + $this->output->writeln(''); + $this->progressBarDisplayed = false; + } + $this->stopTimer(); + } + + /** + * Erase progress indicator and ensure it never returns. Used + * only during error handlers or to permanently remove the progress bar. + */ + public function disableProgressIndicator() + { + $this->cleanup(); + // ProgressIndicator is shared, so this permanently removes + // the program's ability to display progress bars. + $this->progressBar = null; + } + + /** + * @param int $steps + */ + public function advanceProgressIndicator($steps = 1) + { + $this->cachedSteps += $steps; + if ($this->progressIndicatorRunning) { + $this->autoShowProgressIndicator(); + // We only want to call `advance` if the progress bar is visible, + // because it always displays itself when it is advanced. + if ($this->progressBarDisplayed) { + return $this->advanceProgressIndicatorCachedSteps(); + } + } + } + + protected function advanceProgressIndicatorCachedSteps() + { + $this->progressBar->advance($this->cachedSteps); + $this->cachedSteps = 0; + } +} diff --git a/vendor/consolidation/robo/src/Common/ProgressIndicatorAwareTrait.php b/vendor/consolidation/robo/src/Common/ProgressIndicatorAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..060e039a18440e15d6d1b237f68898a928ec63b2 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ProgressIndicatorAwareTrait.php @@ -0,0 +1,135 @@ +<?php +namespace Robo\Common; + +use Robo\Contract\ProgressIndicatorAwareInterface; +use Robo\Contract\VerbosityThresholdInterface; + +trait ProgressIndicatorAwareTrait +{ + use Timer; + + /** + * @var null|\Robo\Common\ProgressIndicator + */ + protected $progressIndicator; + + /** + * @return int + */ + public function progressIndicatorSteps() + { + return 0; + } + + /** + * @param null|\Robo\Common\ProgressIndicator $progressIndicator + * + * @return ProgressIndicatorAwareInterface + */ + public function setProgressIndicator($progressIndicator) + { + $this->progressIndicator = $progressIndicator; + + return $this; + } + + /** + * @return null|bool + */ + protected function hideProgressIndicator() + { + if (!$this->progressIndicator) { + return; + } + return $this->progressIndicator->hideProgressIndicator(); + } + + protected function showProgressIndicator() + { + if (!$this->progressIndicator) { + return; + } + $this->progressIndicator->showProgressIndicator(); + } + + /** + * @param bool $visible + */ + protected function restoreProgressIndicator($visible) + { + if (!$this->progressIndicator) { + return; + } + $this->progressIndicator->restoreProgressIndicator($visible); + } + + /** + * @return int + */ + protected function getTotalExecutionTime() + { + if (!$this->progressIndicator) { + return 0; + } + return $this->progressIndicator->getExecutionTime(); + } + + protected function startProgressIndicator() + { + $this->startTimer(); + if ($this instanceof VerbosityThresholdInterface + && !$this->verbosityMeetsThreshold()) { + return; + } + if (!$this->progressIndicator) { + return; + } + $totalSteps = $this->progressIndicatorSteps(); + $this->progressIndicator->startProgressIndicator($totalSteps, $this); + } + + /** + * @return bool + */ + protected function inProgress() + { + if (!$this->progressIndicator) { + return false; + } + return $this->progressIndicator->inProgress(); + } + + protected function stopProgressIndicator() + { + $this->stopTimer(); + if (!$this->progressIndicator) { + return; + } + $this->progressIndicator->stopProgressIndicator($this); + } + + protected function disableProgressIndicator() + { + $this->stopTimer(); + if (!$this->progressIndicator) { + return; + } + $this->progressIndicator->disableProgressIndicator(); + } + + protected function detatchProgressIndicator() + { + $this->setProgressIndicator(null); + } + + /** + * @param int $steps + */ + protected function advanceProgressIndicator($steps = 1) + { + if (!$this->progressIndicator) { + return; + } + $this->progressIndicator->advanceProgressIndicator($steps); + } +} diff --git a/vendor/consolidation/robo/src/Common/ResourceExistenceChecker.php b/vendor/consolidation/robo/src/Common/ResourceExistenceChecker.php new file mode 100644 index 0000000000000000000000000000000000000000..233f90a9b7e0304307a0a834fb3bcaf79fa73f29 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/ResourceExistenceChecker.php @@ -0,0 +1,116 @@ +<?php +namespace Robo\Common; + +trait ResourceExistenceChecker +{ + /** + * Checks if the given input is a file or folder. + * + * @param string|string[] $resources + * @param string $type "file", "dir", "fileAndDir" + * + * @return bool True if no errors were encountered otherwise false. + */ + protected function checkResources($resources, $type = 'fileAndDir') + { + if (!in_array($type, ['file', 'dir', 'fileAndDir'])) { + throw new \InvalidArgumentException(sprintf('Invalid resource check of type "%s" used!', $type)); + } + if (is_string($resources)) { + $resources = [$resources]; + } + $success = true; + foreach ($resources as $resource) { + $glob = glob($resource); + if ($glob === false) { + $this->printTaskError(sprintf('Invalid glob "%s"!', $resource), $this); + $success = false; + continue; + } + foreach ($glob as $resource) { + if (!$this->checkResource($resource, $type)) { + $success = false; + } + } + } + return $success; + } + + /** + * Checks a single resource, file or directory. + * + * It will print an error as well on the console. + * + * @param string $resource File or folder. + * @param string $type "file", "dir", "fileAndDir" + * + * @return bool + */ + protected function checkResource($resource, $type) + { + switch ($type) { + case 'file': + if (!$this->isFile($resource)) { + $this->printTaskError(sprintf('File "%s" does not exist!', $resource), $this); + return false; + } + return true; + case 'dir': + if (!$this->isDir($resource)) { + $this->printTaskError(sprintf('Directory "%s" does not exist!', $resource), $this); + return false; + } + return true; + case 'fileAndDir': + if (!$this->isDir($resource) && !$this->isFile($resource)) { + $this->printTaskError(sprintf('File or directory "%s" does not exist!', $resource), $this); + return false; + } + return true; + } + } + + /** + * Convenience method to check the often uses "source => target" file / folder arrays. + * + * @param string|array $resources + */ + protected function checkSourceAndTargetResource($resources) + { + if (is_string($resources)) { + $resources = [$resources]; + } + $sources = []; + $targets = []; + foreach ($resources as $source => $target) { + $sources[] = $source; + $target[] = $target; + } + $this->checkResources($sources); + $this->checkResources($targets); + } + + /** + * Wrapper method around phps is_dir() + * + * @param string $directory + * + * @return bool + */ + protected function isDir($directory) + { + return is_dir($directory); + } + + /** + * Wrapper method around phps file_exists() + * + * @param string $file + * + * @return bool + */ + protected function isFile($file) + { + return file_exists($file); + } +} diff --git a/vendor/consolidation/robo/src/Common/TaskIO.php b/vendor/consolidation/robo/src/Common/TaskIO.php new file mode 100644 index 0000000000000000000000000000000000000000..49b5ccd86c4a1c999115f5f0eb013d3351d89566 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/TaskIO.php @@ -0,0 +1,237 @@ +<?php +namespace Robo\Common; + +use Robo\Robo; +use Robo\TaskInfo; +use Consolidation\Log\ConsoleLogLevel; +use Psr\Log\LoggerAwareTrait; +use Psr\Log\LogLevel; +use Robo\Contract\ProgressIndicatorAwareInterface; + +/** + * Task input/output methods. TaskIO is 'used' in BaseTask, so any + * task that extends this class has access to all of the methods here. + * printTaskInfo, printTaskSuccess, and printTaskError are the three + * primary output methods that tasks are encouraged to use. Tasks should + * avoid using the IO trait output methods. + */ +trait TaskIO +{ + use LoggerAwareTrait; + use ConfigAwareTrait; + use VerbosityThresholdTrait; + + /** + * @return mixed|null|\Psr\Log\LoggerInterface + */ + public function logger() + { + // $this->logger should always be set in Robo core tasks. + if ($this->logger) { + return $this->logger; + } + + // TODO: Remove call to Robo::logger() once maintaining backwards + // compatibility with legacy external Robo tasks is no longer desired. + if (!Robo::logger()) { + return null; + } + + static $gaveDeprecationWarning = false; + if (!$gaveDeprecationWarning) { + trigger_error('No logger set for ' . get_class($this) . '. Use $this->task(Foo::class) rather than new Foo() in loadTasks to ensure the builder can initialize task the task, or use $this->collectionBuilder()->taskFoo() if creating one task from within another.', E_USER_DEPRECATED); + $gaveDeprecationWarning = true; + } + return Robo::logger(); + } + + /** + * Print information about a task in progress. + * + * With the Symfony Console logger, NOTICE is displayed at VERBOSITY_VERBOSE + * and INFO is displayed at VERBOSITY_VERY_VERBOSE. + * + * Robo overrides the default such that NOTICE is displayed at + * VERBOSITY_NORMAL and INFO is displayed at VERBOSITY_VERBOSE. + * + * n.b. We should probably have printTaskNotice for our ordinary + * output, and use printTaskInfo for less interesting messages. + * + * @param string $text + * @param null|array $context + */ + protected function printTaskInfo($text, $context = null) + { + // The 'note' style is used for both 'notice' and 'info' log levels; + // However, 'notice' is printed at VERBOSITY_NORMAL, whereas 'info' + // is only printed at VERBOSITY_VERBOSE. + $this->printTaskOutput(LogLevel::NOTICE, $text, $this->getTaskContext($context)); + } + + /** + * Provide notification that some part of the task succeeded. + * + * With the Symfony Console logger, success messages are remapped to NOTICE, + * and displayed in VERBOSITY_VERBOSE. When used with the Robo logger, + * success messages are displayed at VERBOSITY_NORMAL. + * + * @param string $text + * @param null|array $context + */ + protected function printTaskSuccess($text, $context = null) + { + // Not all loggers will recognize ConsoleLogLevel::SUCCESS. + // We therefore log as LogLevel::NOTICE, and apply a '_level' + // override in the context so that this message will be + // logged as SUCCESS if that log level is recognized. + $context['_level'] = ConsoleLogLevel::SUCCESS; + $this->printTaskOutput(LogLevel::NOTICE, $text, $this->getTaskContext($context)); + } + + /** + * Provide notification that there is something wrong, but + * execution can continue. + * + * Warning messages are displayed at VERBOSITY_NORMAL. + * + * @param string $text + * @param null|array $context + */ + protected function printTaskWarning($text, $context = null) + { + $this->printTaskOutput(LogLevel::WARNING, $text, $this->getTaskContext($context)); + } + + /** + * Provide notification that some operation in the task failed, + * and the task cannot continue. + * + * Error messages are displayed at VERBOSITY_NORMAL. + * + * @param string $text + * @param null|array $context + */ + protected function printTaskError($text, $context = null) + { + $this->printTaskOutput(LogLevel::ERROR, $text, $this->getTaskContext($context)); + } + + /** + * Provide debugging notification. These messages are only + * displayed if the log level is VERBOSITY_DEBUG. + * + * @param string$text + * @param null|array $context + */ + protected function printTaskDebug($text, $context = null) + { + $this->printTaskOutput(LogLevel::DEBUG, $text, $this->getTaskContext($context)); + } + + /** + * @param string $level + * One of the \Psr\Log\LogLevel constant + * @param string $text + * @param null|array $context + */ + protected function printTaskOutput($level, $text, $context) + { + if (!$this->verbosityMeetsThreshold()) { + return; + } + $logger = $this->logger(); + if (!$logger) { + return; + } + // Hide the progress indicator, if it is visible. + $inProgress = $this->hideTaskProgress(); + $logger->log($level, $text, $this->getTaskContext($context)); + // After we have printed our log message, redraw the progress indicator. + $this->showTaskProgress($inProgress); + } + + /** + * @return bool + */ + protected function hideTaskProgress() + { + $inProgress = false; + if ($this instanceof ProgressIndicatorAwareInterface) { + $inProgress = $this->inProgress(); + } + + // If a progress indicator is running on this task, then we mush + // hide it before we print anything, or its display will be overwritten. + if ($inProgress) { + $inProgress = $this->hideProgressIndicator(); + } + return $inProgress; + } + + /** + * @param $inProgress + */ + protected function showTaskProgress($inProgress) + { + if ($inProgress) { + $this->restoreProgressIndicator($inProgress); + } + } + + /** + * Format a quantity of bytes. + * + * @param int $size + * @param int $precision + * + * @return string + */ + protected function formatBytes($size, $precision = 2) + { + if ($size === 0) { + return 0; + } + $base = log($size, 1024); + $suffixes = array('', 'k', 'M', 'G', 'T'); + return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)]; + } + + /** + * Get the formatted task name for use in task output. + * This is placed in the task context under 'name', and + * used as the log label by Robo\Common\RoboLogStyle, + * which is inserted at the head of log messages by + * Robo\Common\CustomLogStyle::formatMessage(). + * + * @param null|object $task + * + * @return string + */ + protected function getPrintedTaskName($task = null) + { + if (!$task) { + $task = $this; + } + return TaskInfo::formatTaskName($task); + } + + /** + * @param null|array $context + * + * @return array with context information + */ + protected function getTaskContext($context = null) + { + if (!$context) { + $context = []; + } + if (!is_array($context)) { + $context = ['task' => $context]; + } + if (!array_key_exists('task', $context)) { + $context['task'] = $this; + } + + return $context + TaskInfo::getTaskContext($context['task']); + } +} diff --git a/vendor/consolidation/robo/src/Common/TimeKeeper.php b/vendor/consolidation/robo/src/Common/TimeKeeper.php new file mode 100644 index 0000000000000000000000000000000000000000..1cd3e33444efed089098dec32b46dcc7c580cc16 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/TimeKeeper.php @@ -0,0 +1,69 @@ +<?php +namespace Robo\Common; + +class TimeKeeper +{ + const MINUTE = 60; + const HOUR = 3600; + const DAY = 86400; + + /** + * @var float + */ + protected $startedAt; + + /** + * @var float + */ + protected $finishedAt; + + public function start() + { + if ($this->startedAt) { + return; + } + // Get time in seconds as a float, accurate to the microsecond. + $this->startedAt = microtime(true); + } + + public function stop() + { + $this->finishedAt = microtime(true); + } + + /** + * @return float|null + */ + public function elapsed() + { + $finished = $this->finishedAt ? $this->finishedAt : microtime(true); + if ($finished - $this->startedAt <= 0) { + return null; + } + return $finished - $this->startedAt; + } + + /** + * Format a duration into a human-readable time + * + * @param float $duration Duration in seconds, with fractional component + * + * @return string + */ + public static function formatDuration($duration) + { + if ($duration >= self::DAY * 2) { + return gmdate('z \d\a\y\s H:i:s', $duration); + } + if ($duration > self::DAY) { + return gmdate('\1 \d\a\y H:i:s', $duration); + } + if ($duration > self::HOUR) { + return gmdate("H:i:s", $duration); + } + if ($duration > self::MINUTE) { + return gmdate("i:s", $duration); + } + return round($duration, 3).'s'; + } +} diff --git a/vendor/consolidation/robo/src/Common/Timer.php b/vendor/consolidation/robo/src/Common/Timer.php new file mode 100644 index 0000000000000000000000000000000000000000..955eb5bb3bfb2af0b9f1870e6fdabf8914ac9d72 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/Timer.php @@ -0,0 +1,37 @@ +<?php +namespace Robo\Common; + +trait Timer +{ + /** + * @var \Robo\Common\TimeKeeper + */ + protected $timer; + + protected function startTimer() + { + if (!isset($this->timer)) { + $this->timer = new TimeKeeper(); + } + $this->timer->start(); + } + + protected function stopTimer() + { + if (!isset($this->timer)) { + return; + } + $this->timer->stop(); + } + + /** + * @return float|null + */ + protected function getExecutionTime() + { + if (!isset($this->timer)) { + return null; + } + return $this->timer->elapsed(); + } +} diff --git a/vendor/consolidation/robo/src/Common/VerbosityThresholdTrait.php b/vendor/consolidation/robo/src/Common/VerbosityThresholdTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..2fc51c22b7097ca68832d72240aff8b34d05c525 --- /dev/null +++ b/vendor/consolidation/robo/src/Common/VerbosityThresholdTrait.php @@ -0,0 +1,79 @@ +<?php +namespace Robo\Common; + +use Robo\Robo; +use Robo\TaskInfo; +use Robo\Contract\OutputAdapterInterface; +use Robo\Contract\VerbosityThresholdInterface; +use Consolidation\Log\ConsoleLogLevel; +use Psr\Log\LoggerAwareTrait; +use Psr\Log\LogLevel; +use Robo\Contract\ProgressIndicatorAwareInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Task input/output methods. TaskIO is 'used' in BaseTask, so any + * task that extends this class has access to all of the methods here. + * printTaskInfo, printTaskSuccess, and printTaskError are the three + * primary output methods that tasks are encouraged to use. Tasks should + * avoid using the IO trait output methods. + */ +trait VerbosityThresholdTrait +{ + /** var OutputAdapterInterface */ + protected $outputAdapter; + protected $verbosityThreshold = 0; + + /** + * Required verbocity level before any TaskIO output will be produced. + * e.g. OutputInterface::VERBOSITY_VERBOSE + */ + public function setVerbosityThreshold($verbosityThreshold) + { + $this->verbosityThreshold = $verbosityThreshold; + return $this; + } + + public function verbosityThreshold() + { + return $this->verbosityThreshold; + } + + public function setOutputAdapter(OutputAdapterInterface $outputAdapter) + { + $this->outputAdapter = $outputAdapter; + } + + /** + * @return OutputAdapterInterface + */ + public function outputAdapter() + { + return $this->outputAdapter; + } + + public function hasOutputAdapter() + { + return isset($this->outputAdapter); + } + + public function verbosityMeetsThreshold() + { + if ($this->hasOutputAdapter()) { + return $this->outputAdapter()->verbosityMeetsThreshold($this->verbosityThreshold()); + } + return true; + } + + /** + * Print a message if the selected verbosity level is over this task's + * verbosity threshhold. + */ + public function writeMessage($message) + { + if (!$this->verbosityMeetsThreshold()) { + return; + } + $this->outputAdapter()->writeMessage($message); + } +} diff --git a/vendor/consolidation/robo/src/Config.php b/vendor/consolidation/robo/src/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..9e9370d8117fd470c3e425d4aea9d1a50ac9859e --- /dev/null +++ b/vendor/consolidation/robo/src/Config.php @@ -0,0 +1,9 @@ +<?php +namespace Robo; + +/** + * @deprecated Use \Robo\Config\Config + */ +class Config extends \Robo\Config\Config +{ +} diff --git a/vendor/consolidation/robo/src/Config/Config.php b/vendor/consolidation/robo/src/Config/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..78b135a32a5ffa26e2dd451c51a2db1f614a1883 --- /dev/null +++ b/vendor/consolidation/robo/src/Config/Config.php @@ -0,0 +1,161 @@ +<?php +namespace Robo\Config; + +use Consolidation\Config\Util\ConfigOverlay; +use Consolidation\Config\ConfigInterface; + +class Config extends ConfigOverlay implements GlobalOptionDefaultValuesInterface +{ + const PROGRESS_BAR_AUTO_DISPLAY_INTERVAL = 'options.progress-delay'; + const DEFAULT_PROGRESS_DELAY = 2; + const SIMULATE = 'options.simulate'; + + // Read-only configuration properties; changing these has no effect. + const INTERACTIVE = 'options.interactive'; + const DECORATED = 'options.decorated'; + + /** + * Create a new configuration object, and initialize it with + * the provided nested array containing configuration data. + */ + public function __construct(array $data = null) + { + parent::__construct(); + + $this->import($data); + $this->defaults = $this->getGlobalOptionDefaultValues(); + } + + /** + * {@inheritdoc} + */ + public function import($data) + { + return $this->replace($data); + } + + /** + * {@inheritdoc} + */ + public function replace($data) + { + $this->getContext(ConfigOverlay::DEFAULT_CONTEXT)->replace($data); + return $this; + } + + /** + * {@inheritdoc} + */ + public function combine($data) + { + $this->getContext(ConfigOverlay::DEFAULT_CONTEXT)->combine($data); + return $this; + } + + /** + * Return an associative array containing all of the global configuration + * options and their default values. + * + * @return array + */ + public function getGlobalOptionDefaultValues() + { + $globalOptions = + [ + self::PROGRESS_BAR_AUTO_DISPLAY_INTERVAL => self::DEFAULT_PROGRESS_DELAY, + self::SIMULATE => false, + ]; + return $this->trimPrefixFromGlobalOptions($globalOptions); + } + + /** + * Remove the 'options.' prefix from the global options list. + */ + protected function trimPrefixFromGlobalOptions($globalOptions) + { + $result = []; + foreach ($globalOptions as $option => $value) { + $option = str_replace('options.', '', $option); + $result[$option] = $value; + } + return $result; + } + + /** + * @deprecated Use $config->get(Config::SIMULATE) + * + * @return bool + */ + public function isSimulated() + { + return $this->get(self::SIMULATE); + } + + /** + * @deprecated Use $config->set(Config::SIMULATE, true) + * + * @param bool $simulated + * + * @return $this + */ + public function setSimulated($simulated = true) + { + return $this->set(self::SIMULATE, $simulated); + } + + /** + * @deprecated Use $config->get(Config::INTERACTIVE) + * + * @return bool + */ + public function isInteractive() + { + return $this->get(self::INTERACTIVE); + } + + /** + * @deprecated Use $config->set(Config::INTERACTIVE, true) + * + * @param bool $interactive + * + * @return $this + */ + public function setInteractive($interactive = true) + { + return $this->set(self::INTERACTIVE, $interactive); + } + + /** + * @deprecated Use $config->get(Config::DECORATED) + * + * @return bool + */ + public function isDecorated() + { + return $this->get(self::DECORATED); + } + + /** + * @deprecated Use $config->set(Config::DECORATED, true) + * + * @param bool $decorated + * + * @return $this + */ + public function setDecorated($decorated = true) + { + return $this->set(self::DECORATED, $decorated); + } + + /** + * @deprecated Use $config->set(Config::PROGRESS_BAR_AUTO_DISPLAY_INTERVAL, $interval) + * + * @param int $interval + * + * @return $this + */ + public function setProgressBarAutoDisplayInterval($interval) + { + return $this->set(self::PROGRESS_BAR_AUTO_DISPLAY_INTERVAL, $interval); + } +} diff --git a/vendor/consolidation/robo/src/Config/GlobalOptionDefaultValuesInterface.php b/vendor/consolidation/robo/src/Config/GlobalOptionDefaultValuesInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..f76394554814d232d6eb9cc490e4b581d0988ba9 --- /dev/null +++ b/vendor/consolidation/robo/src/Config/GlobalOptionDefaultValuesInterface.php @@ -0,0 +1,17 @@ +<?php +namespace Robo\Config; + +/** + * @deprecated Use robo.yml instead + * + * robo.yml: + * + * options: + * simulated: false + * progress-delay: 2 + * + * etc. + */ +interface GlobalOptionDefaultValuesInterface extends \Consolidation\Config\GlobalOptionDefaultValuesInterface +{ +} diff --git a/vendor/consolidation/robo/src/Contract/BuilderAwareInterface.php b/vendor/consolidation/robo/src/Contract/BuilderAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..d67796fe10fc2c71e2f947756ebec4dafb8c6164 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/BuilderAwareInterface.php @@ -0,0 +1,22 @@ +<?php + +namespace Robo\Contract; + +use Robo\Collection\CollectionBuilder; + +interface BuilderAwareInterface +{ + /** + * Set the builder reference + * + * @param \Robo\Collection\CollectionBuilder $builder + */ + public function setBuilder(CollectionBuilder $builder); + + /** + * Get the builder reference + * + * @return \Robo\Collection\CollectionBuilder + */ + public function getBuilder(); +} diff --git a/vendor/consolidation/robo/src/Contract/CommandInterface.php b/vendor/consolidation/robo/src/Contract/CommandInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..e5099b043c729693b4f721fc51ea761504b11c1c --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/CommandInterface.php @@ -0,0 +1,20 @@ +<?php +namespace Robo\Contract; + +/** + * Task that implements this interface can be injected as a parameter for other task. + * This task can be represented as executable command. + * + * @package Robo\Contract + */ +interface CommandInterface +{ + + /** + * Returns command that can be executed. + * This method is used to pass generated command from one task to another. + * + * @return string + */ + public function getCommand(); +} diff --git a/vendor/consolidation/robo/src/Contract/CompletionInterface.php b/vendor/consolidation/robo/src/Contract/CompletionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..a3b1c4e8da7a67513692ee090f7986fddffe4db3 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/CompletionInterface.php @@ -0,0 +1,18 @@ +<?php +namespace Robo\Contract; + +/** + * Any Robo tasks that implements this interface will + * be called when the task collection it is added to + * completes. + * + * Interface CompletionInterface + * @package Robo\Contract + */ +interface CompletionInterface extends TaskInterface +{ + /** + * Revert an operation that can be rolled back + */ + public function complete(); +} diff --git a/vendor/consolidation/robo/src/Contract/ConfigAwareInterface.php b/vendor/consolidation/robo/src/Contract/ConfigAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..b66f459eeeb50c44f1b78ee0c01d3a03df9f7b50 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/ConfigAwareInterface.php @@ -0,0 +1,7 @@ +<?php + +namespace Robo\Contract; + +interface ConfigAwareInterface extends \Consolidation\Config\ConfigAwareInterface +{ +} diff --git a/vendor/consolidation/robo/src/Contract/IOAwareInterface.php b/vendor/consolidation/robo/src/Contract/IOAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..2daa5fb64cdf74a3303bff2e7f9a56bf54a46c55 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/IOAwareInterface.php @@ -0,0 +1,13 @@ +<?php + +/** + * Marker interface for tasks that use the IO trait + */ + +namespace Robo\Contract; + +use \Symfony\Component\Console\Input\InputAwareInterface; + +interface IOAwareInterface extends OutputAwareInterface, InputAwareInterface +{ +} diff --git a/vendor/consolidation/robo/src/Contract/InflectionInterface.php b/vendor/consolidation/robo/src/Contract/InflectionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..449cecfecb901c28b03a69842768021ea8fd67ab --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/InflectionInterface.php @@ -0,0 +1,52 @@ +<?php +namespace Robo\Contract; + +interface InflectionInterface +{ + /** + * Based on league/container inflection: http://container.thephpleague.com/inflectors/ + * + * This allows us to run: + * + * (new SomeTask($args)) + * ->inflect($this) + * ->initializer() + * ->... + * + * Instead of: + * + * (new SomeTask($args)) + * ->setLogger($this->logger) + * ->initializer() + * ->... + * + * The reason `inflect` is better than the more explicit alternative is + * that subclasses of BaseTask that implement a new FooAwareInterface + * can override injectDependencies() as explained below, and add more + * dependencies that can be injected as needed. + * + * @param \Robo\Contract\InflectionInterface $parent + */ + public function inflect(InflectionInterface $parent); + + /** + * Take all dependencies availble to this task and inject any that are + * needed into the provided task. The general pattern is that, for every + * FooAwareInterface that this class implements, it should test to see + * if the child also implements the same interface, and if so, should call + * $child->setFoo($this->foo). + * + * The benefits of this are pretty large. Any time an object that implements + * InflectionInterface is created, just call `$child->inflect($this)`, and + * any available optional dependencies will be hooked up via setter injection. + * + * The required dependencies of an object should be provided via constructor + * injection, not inflection. + * + * @param InflectionInterface $child An object created by this class that + * should have its dependencies injected. + * + * @see https://mwop.net/blog/2016-04-26-on-locators.html + */ + public function injectDependencies(InflectionInterface $child); +} diff --git a/vendor/consolidation/robo/src/Contract/OutputAdapterInterface.php b/vendor/consolidation/robo/src/Contract/OutputAdapterInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..948d384cba8e1dfcdf272b449aa270785a5fa67d --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/OutputAdapterInterface.php @@ -0,0 +1,11 @@ +<?php +namespace Robo\Contract; + +/** + * Adapt OutputInterface or other output function to the VerbosityThresholdInterface. + */ +interface OutputAdapterInterface +{ + public function verbosityMeetsThreshold($verbosityThreshold); + public function writeMessage($message); +} diff --git a/vendor/consolidation/robo/src/Contract/OutputAwareInterface.php b/vendor/consolidation/robo/src/Contract/OutputAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..570afed2bed8768150b62b576762f67b3d70dc21 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/OutputAwareInterface.php @@ -0,0 +1,19 @@ +<?php + +/** + * Provide OutputAwareInterface, not present in Symfony Console + */ + +namespace Robo\Contract; + +use Symfony\Component\Console\Output\OutputInterface; + +interface OutputAwareInterface +{ + /** + * Sets the Console Output. + * + * @param \Symfony\Component\Console\Output\OutputInterface $output + */ + public function setOutput(OutputInterface $output); +} diff --git a/vendor/consolidation/robo/src/Contract/PrintedInterface.php b/vendor/consolidation/robo/src/Contract/PrintedInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..d380643ba15705a4a2c41b3a92e44241cae3aba2 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/PrintedInterface.php @@ -0,0 +1,16 @@ +<?php +namespace Robo\Contract; + +/** + * If task prints anything to console + * + * Interface PrintedInterface + * @package Robo\Contract + */ +interface PrintedInterface +{ + /** + * @return bool + */ + public function getPrinted(); +} diff --git a/vendor/consolidation/robo/src/Contract/ProgressIndicatorAwareInterface.php b/vendor/consolidation/robo/src/Contract/ProgressIndicatorAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..47cede9ce0f4aa2a2a0a4a6cc9814b97c6bf5c46 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/ProgressIndicatorAwareInterface.php @@ -0,0 +1,24 @@ +<?php +namespace Robo\Contract; + +/** + * Any Robo task that uses the Timer trait and + * implements ProgressIndicatorAwareInterface will + * display a progress bar while the timer is running. + * Call advanceProgressIndicator to advance the indicator. + * + * Interface ProgressIndicatorAwareInterface + * @package Robo\Contract + */ +interface ProgressIndicatorAwareInterface +{ + /** + * @return int + */ + public function progressIndicatorSteps(); + + /** + * @param \Robo\Common\ProgressIndicator $progressIndicator + */ + public function setProgressIndicator($progressIndicator); +} diff --git a/vendor/consolidation/robo/src/Contract/ProgressInterface.php b/vendor/consolidation/robo/src/Contract/ProgressInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..0c99343caeca8be802eb6910bd75c519ed646046 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/ProgressInterface.php @@ -0,0 +1,19 @@ +<?php + +namespace Robo\Contract; + +/** + * Robo tasks that take multiple steps to complete should + * implement this interface. + * + * Interface ProgressInterface + * @package Robo\Contract + */ +interface ProgressInterface +{ + /** + * + * @return int + */ + public function progressSteps(); +} diff --git a/vendor/consolidation/robo/src/Contract/RollbackInterface.php b/vendor/consolidation/robo/src/Contract/RollbackInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..394822cd45a213065548b11b2241ff868f06a0e3 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/RollbackInterface.php @@ -0,0 +1,18 @@ +<?php +namespace Robo\Contract; + +/** + * Any Robo tasks that implements this interface will + * be called when the task collection it is added to + * fails, and runs its rollback operation. + * + * Interface RollbackInterface + * @package Robo\Contract + */ +interface RollbackInterface extends TaskInterface +{ + /** + * Revert an operation that can be rolled back + */ + public function rollback(); +} diff --git a/vendor/consolidation/robo/src/Contract/SimulatedInterface.php b/vendor/consolidation/robo/src/Contract/SimulatedInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..826f4b96c2118567b562b6c3e46913b9f60f11db --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/SimulatedInterface.php @@ -0,0 +1,18 @@ +<?php +namespace Robo\Contract; + +/** + * Task that implements this interface can be injected as a parameter for other task. + * This task can be represented as executable command. + * + * @package Robo\Contract + */ +interface SimulatedInterface extends TaskInterface +{ + /** + * Called in place of `run()` for simulated tasks. + * + * @param null|array $context + */ + public function simulate($context); +} diff --git a/vendor/consolidation/robo/src/Contract/TaskInterface.php b/vendor/consolidation/robo/src/Contract/TaskInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..c477d16cfa8a0846e6a300bec450ca3a48128e05 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/TaskInterface.php @@ -0,0 +1,17 @@ +<?php +namespace Robo\Contract; + +/** + * All Robo tasks should implement this interface. + * Task should be configured by chained methods. + * + * Interface TaskInterface + * @package Robo\Contract + */ +interface TaskInterface +{ + /** + * @return \Robo\Result + */ + public function run(); +} diff --git a/vendor/consolidation/robo/src/Contract/VerbosityThresholdInterface.php b/vendor/consolidation/robo/src/Contract/VerbosityThresholdInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..e63a1f7044b0eeadf3e22b756c269c79ea259ab9 --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/VerbosityThresholdInterface.php @@ -0,0 +1,24 @@ +<?php +namespace Robo\Contract; + +use Robo\Contract\OutputAdapterInterface; + +/** + * Record and determine whether the current verbosity level exceeds the + * desired threshold level to produce output. + */ +interface VerbosityThresholdInterface +{ + const VERBOSITY_NORMAL = 1; + const VERBOSITY_VERBOSE = 2; + const VERBOSITY_VERY_VERBOSE = 3; + const VERBOSITY_DEBUG = 4; + + public function setVerbosityThreshold($verbosityThreshold); + public function verbosityThreshold(); + public function setOutputAdapter(OutputAdapterInterface $outputAdapter); + public function outputAdapter(); + public function hasOutputAdapter(); + public function verbosityMeetsThreshold(); + public function writeMessage($message); +} diff --git a/vendor/consolidation/robo/src/Contract/WrappedTaskInterface.php b/vendor/consolidation/robo/src/Contract/WrappedTaskInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..65028769fa00d1ddd495dfa2b9e7b008ff7822fb --- /dev/null +++ b/vendor/consolidation/robo/src/Contract/WrappedTaskInterface.php @@ -0,0 +1,10 @@ +<?php +namespace Robo\Contract; + +interface WrappedTaskInterface extends TaskInterface +{ + /** + * @return \Robo\Contract\TaskInterface + */ + public function original(); +} diff --git a/vendor/consolidation/robo/src/Exception/AbortTasksException.php b/vendor/consolidation/robo/src/Exception/AbortTasksException.php new file mode 100644 index 0000000000000000000000000000000000000000..120451f0aeee68913ea652367bdb7eef050dcac8 --- /dev/null +++ b/vendor/consolidation/robo/src/Exception/AbortTasksException.php @@ -0,0 +1,13 @@ +<?php +namespace Robo\Exception; + +/** + * By default, rollbacks and completions tasks or callbacks continue even if + * errors occur. If you would like to explicitly cancel or abort the rollback or + * completion, you may throw this exception to abort the subsequent tasks in the + * rollback or completion task list. + */ +class AbortTasksException extends \Exception +{ + +} diff --git a/vendor/consolidation/robo/src/Exception/TaskException.php b/vendor/consolidation/robo/src/Exception/TaskException.php new file mode 100644 index 0000000000000000000000000000000000000000..fdc84a5e4b62864b87015f7555566d1e7072cd48 --- /dev/null +++ b/vendor/consolidation/robo/src/Exception/TaskException.php @@ -0,0 +1,13 @@ +<?php +namespace Robo\Exception; + +class TaskException extends \Exception +{ + public function __construct($class, $message) + { + if (is_object($class)) { + $class = get_class($class); + } + parent::__construct(" in task $class \n\n $message"); + } +} diff --git a/vendor/consolidation/robo/src/Exception/TaskExitException.php b/vendor/consolidation/robo/src/Exception/TaskExitException.php new file mode 100644 index 0000000000000000000000000000000000000000..9db5329ab6081d83705ebba247251b0100fdf773 --- /dev/null +++ b/vendor/consolidation/robo/src/Exception/TaskExitException.php @@ -0,0 +1,13 @@ +<?php +namespace Robo\Exception; + +class TaskExitException extends \Exception +{ + public function __construct($class, $message, $status) + { + if (is_object($class)) { + $class = get_class($class); + } + parent::__construct(" in task $class \n\n $message", $status); + } +} diff --git a/vendor/consolidation/robo/src/GlobalOptionsEventListener.php b/vendor/consolidation/robo/src/GlobalOptionsEventListener.php new file mode 100644 index 0000000000000000000000000000000000000000..b26d10cd0eea6b7452122d4d267d529b25926089 --- /dev/null +++ b/vendor/consolidation/robo/src/GlobalOptionsEventListener.php @@ -0,0 +1,146 @@ +<?php +namespace Robo; + +use Symfony\Component\Console\ConsoleEvents; +use Symfony\Component\Console\Event\ConsoleCommandEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Robo\Contract\ConfigAwareInterface; +use Robo\Common\ConfigAwareTrait; +use Robo\Config\GlobalOptionDefaultValuesInterface; + +class GlobalOptionsEventListener implements EventSubscriberInterface, ConfigAwareInterface +{ + use ConfigAwareTrait; + + /** @var Application */ + protected $application; + + /** @var string */ + protected $prefix; + + /** + * GlobalOptionsEventListener listener + */ + public function __construct() + { + $this->prefix = 'options'; + } + + /** + * Add a reference to the Symfony Console application object. + */ + public function setApplication($application) + { + $this->application = $application; + return $this; + } + + /** + * Stipulate the prefix to use for option injection. + * @param string $prefix + */ + public function setGlobalOptionsPrefix($prefix) + { + $this->prefix = $prefix; + return $this; + } + + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() + { + return [ConsoleEvents::COMMAND => 'handleCommandEvent']; + } + + /** + * Run all of our individual operations when a command event is received. + */ + public function handleCommandEvent(ConsoleCommandEvent $event) + { + $this->setGlobalOptions($event); + $this->setConfigurationValues($event); + } + + /** + * Before a Console command runs, examine the global + * commandline options from the event Input, and set + * configuration values as appropriate. + * + * @param \Symfony\Component\Console\Event\ConsoleCommandEvent $event + */ + public function setGlobalOptions(ConsoleCommandEvent $event) + { + $config = $this->getConfig(); + $input = $event->getInput(); + + $globalOptions = $config->get($this->prefix, []); + if ($config instanceof \Consolidation\Config\GlobalOptionDefaultValuesInterface) { + $globalOptions += $config->getGlobalOptionDefaultValues(); + } + + $globalOptions += $this->applicationOptionDefaultValues(); + + // Set any config value that has a defined global option (e.g. --simulate) + foreach ($globalOptions as $option => $default) { + $value = $input->hasOption($option) ? $input->getOption($option) : null; + // Unfortunately, the `?:` operator does not differentate between `0` and `null` + if (!isset($value)) { + $value = $default; + } + $config->set($this->prefix . '.' . $option, $value); + } + } + + /** + * Examine the commandline --define / -D options, and apply the provided + * values to the active configuration. + * + * @param \Symfony\Component\Console\Event\ConsoleCommandEvent $event + */ + public function setConfigurationValues(ConsoleCommandEvent $event) + { + $config = $this->getConfig(); + $input = $event->getInput(); + + // Also set any `-Dconfig.key=value` options from the commandline. + if ($input->hasOption('define')) { + $configDefinitions = $input->getOption('define'); + foreach ($configDefinitions as $value) { + list($key, $value) = $this->splitConfigKeyValue($value); + $config->set($key, $value); + } + } + } + + /** + * Split up the key=value config setting into its component parts. If + * the input string contains no '=' character, then the value will be 'true'. + * + * @param string $value + * @return array + */ + protected function splitConfigKeyValue($value) + { + $parts = explode('=', $value, 2); + $parts[] = true; + return $parts; + } + + /** + * Get default option values from the Symfony Console application, if + * it is available. + */ + protected function applicationOptionDefaultValues() + { + if (!$this->application) { + return []; + } + + $result = []; + foreach ($this->application->getDefinition()->getOptions() as $key => $option) { + $result[$key] = $option->acceptValue() ? $option->getDefault() : null; + } + return $result; + } +} diff --git a/vendor/consolidation/robo/src/LoadAllTasks.php b/vendor/consolidation/robo/src/LoadAllTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..3183d5b6a3f46af06fe0916dd1cce32f95e17e4d --- /dev/null +++ b/vendor/consolidation/robo/src/LoadAllTasks.php @@ -0,0 +1,39 @@ +<?php +namespace Robo; + +trait LoadAllTasks +{ + use TaskAccessor; + + use Collection\loadTasks; + + // standard tasks + use Task\Base\loadTasks; + use Task\Development\loadTasks; + use Task\Filesystem\loadTasks; + use Task\File\loadTasks; + use Task\Archive\loadTasks; + use Task\Vcs\loadTasks; + + // package managers + use Task\Composer\loadTasks; + use Task\Bower\loadTasks; + use Task\Npm\loadTasks; + + // assets + use Task\Assets\loadTasks; + + // 3rd-party tools + use Task\Remote\loadTasks; + use Task\Testing\loadTasks; + use Task\ApiGen\loadTasks; + use Task\Docker\loadTasks; + + // task runners + use Task\Gulp\loadTasks; + + // shortcuts + use Task\Base\loadShortcuts; + use Task\Filesystem\loadShortcuts; + use Task\Vcs\loadShortcuts; +} diff --git a/vendor/consolidation/robo/src/Log/ResultPrinter.php b/vendor/consolidation/robo/src/Log/ResultPrinter.php new file mode 100644 index 0000000000000000000000000000000000000000..a6f166a0936ad651f6edc733e3c7feca5d08bb9d --- /dev/null +++ b/vendor/consolidation/robo/src/Log/ResultPrinter.php @@ -0,0 +1,112 @@ +<?php +namespace Robo\Log; + +use Robo\Result; +use Robo\Contract\PrintedInterface; +use Robo\Contract\ProgressIndicatorAwareInterface; +use Robo\Contract\VerbosityThresholdInterface; +use Robo\Common\ProgressIndicatorAwareTrait; + +use Psr\Log\LogLevel; +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; +use Consolidation\Log\ConsoleLogLevel; + +/** + * Log the creation of Result objects. + */ +class ResultPrinter implements LoggerAwareInterface, ProgressIndicatorAwareInterface +{ + use LoggerAwareTrait; + use ProgressIndicatorAwareTrait; + + /** + * Log the result of a Robo task. + * + * Returns 'true' if the message is printed, or false if it isn't. + * + * @param \Robo\Result $result + * + * @return bool + */ + public function printResult(Result $result) + { + $task = $result->getTask(); + if ($task instanceof VerbosityThresholdInterface && !$task->verbosityMeetsThreshold()) { + return; + } + if (!$result->wasSuccessful()) { + return $this->printError($result); + } else { + return $this->printSuccess($result); + } + } + + /** + * Log that we are about to abort due to an error being encountered + * in 'stop on fail' mode. + * + * @param \Robo\Result $result + */ + public function printStopOnFail($result) + { + $this->printMessage(LogLevel::NOTICE, 'Stopping on fail. Exiting....'); + $this->printMessage(LogLevel::ERROR, 'Exit Code: {code}', ['code' => $result->getExitCode()]); + } + + /** + * Log the result of a Robo task that returned an error. + * + * @param \Robo\Result $result + * + * @return bool + */ + protected function printError(Result $result) + { + $task = $result->getTask(); + $context = $result->getContext() + ['timer-label' => 'Time', '_style' => []]; + $context['_style']['message'] = ''; + + $printOutput = true; + if ($task instanceof PrintedInterface) { + $printOutput = !$task->getPrinted(); + } + if ($printOutput) { + $this->printMessage(LogLevel::ERROR, "{message}", $context); + } + $this->printMessage(LogLevel::ERROR, 'Exit code {code}', $context); + return true; + } + + /** + * Log the result of a Robo task that was successful. + * + * @param \Robo\Result $result + * + * @return bool + */ + protected function printSuccess(Result $result) + { + $task = $result->getTask(); + $context = $result->getContext() + ['timer-label' => 'in']; + $time = $result->getExecutionTime(); + if ($time) { + $this->printMessage(ConsoleLogLevel::SUCCESS, 'Done', $context); + } + return false; + } + + /** + * @param string $level + * @param string $message + * @param array $context + */ + protected function printMessage($level, $message, $context = []) + { + $inProgress = $this->hideProgressIndicator(); + $this->logger->log($level, $message, $context); + if ($inProgress) { + $this->restoreProgressIndicator($inProgress); + } + } +} diff --git a/vendor/consolidation/robo/src/Log/RoboLogLevel.php b/vendor/consolidation/robo/src/Log/RoboLogLevel.php new file mode 100644 index 0000000000000000000000000000000000000000..d7d5eb0a6e09fa459ba3e3e77a2deba2b17c0110 --- /dev/null +++ b/vendor/consolidation/robo/src/Log/RoboLogLevel.php @@ -0,0 +1,11 @@ +<?php +namespace Robo\Log; + +class RoboLogLevel extends \Consolidation\Log\ConsoleLogLevel +{ + /** + * Command did something in simulated mode. + * Displayed at VERBOSITY_NORMAL. + */ + const SIMULATED_ACTION = 'simulated'; +} diff --git a/vendor/consolidation/robo/src/Log/RoboLogStyle.php b/vendor/consolidation/robo/src/Log/RoboLogStyle.php new file mode 100644 index 0000000000000000000000000000000000000000..e4999a8793121bd257fd7cf04bdc480026cbe6a8 --- /dev/null +++ b/vendor/consolidation/robo/src/Log/RoboLogStyle.php @@ -0,0 +1,74 @@ +<?php +namespace Robo\Log; + +use Robo\Common\TimeKeeper; +use Consolidation\Log\LogOutputStyler; + +/** + * Robo Log Styler. + */ +class RoboLogStyle extends LogOutputStyler +{ + const TASK_STYLE_SIMULATED = 'options=reverse;bold'; + + /** + * RoboLogStyle constructor. + * + * @param array $labelStyles + * @param array $messageStyles + */ + public function __construct($labelStyles = [], $messageStyles = []) + { + parent::__construct($labelStyles, $messageStyles); + + $this->labelStyles += [ + RoboLogLevel::SIMULATED_ACTION => self::TASK_STYLE_SIMULATED, + ]; + $this->messageStyles += [ + RoboLogLevel::SIMULATED_ACTION => '', + ]; + } + + /** + * Log style customization for Robo: replace the log level with + * the task name. + * + * @param string $level + * @param string $message + * @param array $context + * + * @return string + */ + protected function formatMessageByLevel($level, $message, $context) + { + $label = $level; + if (array_key_exists('name', $context)) { + $label = $context['name']; + } + return $this->formatMessage($label, $message, $context, $this->labelStyles[$level], $this->messageStyles[$level]); + } + + /** + * Log style customization for Robo: add the time indicator to the + * end of the log message if it exists in the context. + * + * @param string $label + * @param string $message + * @param array $context + * @param string $taskNameStyle + * @param string $messageStyle + * + * @return string + */ + protected function formatMessage($label, $message, $context, $taskNameStyle, $messageStyle = '') + { + $message = parent::formatMessage($label, $message, $context, $taskNameStyle, $messageStyle); + + if (array_key_exists('time', $context) && !empty($context['time']) && array_key_exists('timer-label', $context)) { + $duration = TimeKeeper::formatDuration($context['time']); + $message .= ' ' . $context['timer-label'] . ' ' . $this->wrapFormatString($duration, 'fg=yellow'); + } + + return $message; + } +} diff --git a/vendor/consolidation/robo/src/Log/RoboLogger.php b/vendor/consolidation/robo/src/Log/RoboLogger.php new file mode 100644 index 0000000000000000000000000000000000000000..75cf23f7ccba486101a75ad1b4e1e63f76acb0d8 --- /dev/null +++ b/vendor/consolidation/robo/src/Log/RoboLogger.php @@ -0,0 +1,29 @@ +<?php +namespace Robo\Log; + +use Consolidation\Log\Logger; + +use Psr\Log\LogLevel; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Robo's default logger + */ +class RoboLogger extends Logger +{ + /** + * @param \Symfony\Component\Console\Output\OutputInterface $output + */ + public function __construct(OutputInterface $output) + { + // In Robo, we use log level 'notice' for messages that appear all + // the time, and 'info' for messages that appear only during verbose + // output. We have no 'very verbose' (-vv) level. 'Debug' is -vvv, as usual. + $roboVerbosityOverrides = [ + RoboLogLevel::SIMULATED_ACTION => OutputInterface::VERBOSITY_NORMAL, // Default is "verbose" + LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL, // Default is "verbose" + LogLevel::INFO => OutputInterface::VERBOSITY_VERBOSE, // Default is "very verbose" + ]; + parent::__construct($output, $roboVerbosityOverrides); + } +} diff --git a/vendor/consolidation/robo/src/Result.php b/vendor/consolidation/robo/src/Result.php new file mode 100644 index 0000000000000000000000000000000000000000..7d77935209251cb0f0a1395e211f75930ad49a79 --- /dev/null +++ b/vendor/consolidation/robo/src/Result.php @@ -0,0 +1,258 @@ +<?php +namespace Robo; + +use Robo\Contract\TaskInterface; +use Robo\Exception\TaskExitException; +use Robo\State\Data; + +class Result extends ResultData +{ + /** + * @var bool + */ + public static $stopOnFail = false; + + /** + * @var \Robo\Contract\TaskInterface + */ + protected $task; + + /** + * @param \Robo\Contract\TaskInterface $task + * @param string $exitCode + * @param string $message + * @param array $data + */ + public function __construct(TaskInterface $task, $exitCode, $message = '', $data = []) + { + parent::__construct($exitCode, $message, $data); + $this->task = $task; + $this->printResult(); + + if (self::$stopOnFail) { + $this->stopOnFail(); + } + } + + /** + * Tasks should always return a Result. However, they are also + * allowed to return NULL or an array to indicate success. + */ + public static function ensureResult($task, $result) + { + if ($result instanceof Result) { + return $result; + } + if (!isset($result)) { + return static::success($task); + } + if ($result instanceof Data) { + return static::success($task, $result->getMessage(), $result->getData()); + } + if ($result instanceof ResultData) { + return new Result($task, $result->getExitCode(), $result->getMessage(), $result->getData()); + } + if (is_array($result)) { + return static::success($task, '', $result); + } + throw new \Exception(sprintf('Task %s returned a %s instead of a \Robo\Result.', get_class($task), get_class($result))); + } + + protected function printResult() + { + // For historic reasons, the Result constructor is responsible + // for printing task results. + // TODO: Make IO the responsibility of some other class. Maintaining + // existing behavior for backwards compatibility. This is undesirable + // in the long run, though, as it can result in unwanted repeated input + // in task collections et. al. + $resultPrinter = Robo::resultPrinter(); + if ($resultPrinter) { + if ($resultPrinter->printResult($this)) { + $this->alreadyPrinted(); + } + } + } + + /** + * @param \Robo\Contract\TaskInterface $task + * @param string $extension + * @param string $service + * + * @return \Robo\Result + */ + public static function errorMissingExtension(TaskInterface $task, $extension, $service) + { + $messageTpl = 'PHP extension required for %s. Please enable %s'; + $message = sprintf($messageTpl, $service, $extension); + + return self::error($task, $message); + } + + /** + * @param \Robo\Contract\TaskInterface $task + * @param string $class + * @param string $package + * + * @return \Robo\Result + */ + public static function errorMissingPackage(TaskInterface $task, $class, $package) + { + $messageTpl = 'Class %s not found. Please install %s Composer package'; + $message = sprintf($messageTpl, $class, $package); + + return self::error($task, $message); + } + + /** + * @param \Robo\Contract\TaskInterface $task + * @param string $message + * @param array $data + * + * @return \Robo\Result + */ + public static function error(TaskInterface $task, $message, $data = []) + { + return new self($task, self::EXITCODE_ERROR, $message, $data); + } + + /** + * @param \Robo\Contract\TaskInterface $task + * @param \Exception $e + * @param array $data + * + * @return \Robo\Result + */ + public static function fromException(TaskInterface $task, \Exception $e, $data = []) + { + $exitCode = $e->getCode(); + if (!$exitCode) { + $exitCode = self::EXITCODE_ERROR; + } + return new self($task, $exitCode, $e->getMessage(), $data); + } + + /** + * @param \Robo\Contract\TaskInterface $task + * @param string $message + * @param array $data + * + * @return \Robo\Result + */ + public static function success(TaskInterface $task, $message = '', $data = []) + { + return new self($task, self::EXITCODE_OK, $message, $data); + } + + /** + * Return a context useful for logging messages. + * + * @return array + */ + public function getContext() + { + $task = $this->getTask(); + + return TaskInfo::getTaskContext($task) + [ + 'code' => $this->getExitCode(), + 'data' => $this->getArrayCopy(), + 'time' => $this->getExecutionTime(), + 'message' => $this->getMessage(), + ]; + } + + /** + * Add the results from the most recent task to the accumulated + * results from all tasks that have run so far, merging data + * as necessary. + * + * @param int|string $key + * @param \Robo\Result $taskResult + */ + public function accumulate($key, Result $taskResult) + { + // If the task is unnamed, then all of its data elements + // just get merged in at the top-level of the final Result object. + if (static::isUnnamed($key)) { + $this->merge($taskResult); + } elseif (isset($this[$key])) { + // There can only be one task with a given name; however, if + // there are tasks added 'before' or 'after' the named task, + // then the results from these will be stored under the same + // name unless they are given a name of their own when added. + $current = $this[$key]; + $this[$key] = $taskResult->merge($current); + } else { + $this[$key] = $taskResult; + } + } + + /** + * We assume that named values (e.g. for associative array keys) + * are non-numeric; numeric keys are presumed to simply be the + * index of an array, and therefore insignificant. + * + * @param int|string $key + * + * @return bool + */ + public static function isUnnamed($key) + { + return is_numeric($key); + } + + /** + * @return \Robo\Contract\TaskInterface + */ + public function getTask() + { + return $this->task; + } + + /** + * @return \Robo\Contract\TaskInterface + */ + public function cloneTask() + { + $reflect = new \ReflectionClass(get_class($this->task)); + return $reflect->newInstanceArgs(func_get_args()); + } + + /** + * @return bool + * + * @deprecated since 1.0. + * + * @see wasSuccessful() + */ + public function __invoke() + { + trigger_error(__METHOD__ . ' is deprecated: use wasSuccessful() instead.', E_USER_DEPRECATED); + return $this->wasSuccessful(); + } + + /** + * @return $this + */ + public function stopOnFail() + { + if (!$this->wasSuccessful()) { + $resultPrinter = Robo::resultPrinter(); + if ($resultPrinter) { + $resultPrinter->printStopOnFail($this); + } + $this->exitEarly($this->getExitCode()); + } + return $this; + } + + /** + * @param int $status + * + * @throws \Robo\Exception\TaskExitException + */ + private function exitEarly($status) + { + throw new TaskExitException($this->getTask(), $this->getMessage(), $status); + } +} diff --git a/vendor/consolidation/robo/src/ResultData.php b/vendor/consolidation/robo/src/ResultData.php new file mode 100644 index 0000000000000000000000000000000000000000..90baf6e9243e299291de8b2687ce2eca1026bf73 --- /dev/null +++ b/vendor/consolidation/robo/src/ResultData.php @@ -0,0 +1,110 @@ +<?php +namespace Robo; + +use Consolidation\AnnotatedCommand\ExitCodeInterface; +use Consolidation\AnnotatedCommand\OutputDataInterface; +use Robo\State\Data; + +class ResultData extends Data implements ExitCodeInterface, OutputDataInterface +{ + /** + * @var int + */ + protected $exitCode; + + const EXITCODE_OK = 0; + const EXITCODE_ERROR = 1; + /** Symfony Console handles these conditions; Robo returns the status + code selected by Symfony. These are here for documentation purposes. */ + const EXITCODE_MISSING_OPTIONS = 2; + const EXITCODE_COMMAND_NOT_FOUND = 127; + + /** The command was aborted because the user chose to cancel it at some prompt. + This exit code is arbitrarily the same as EX_TEMPFAIL in sysexits.h, although + note that shell error codes are distinct from C exit codes, so this alignment + not particularly meaningful. */ + const EXITCODE_USER_CANCEL = 75; + + /** + * @param int $exitCode + * @param string $message + * @param array $data + */ + public function __construct($exitCode = self::EXITCODE_OK, $message = '', $data = []) + { + $this->exitCode = $exitCode; + parent::__construct($message, $data); + } + + /** + * @param string $message + * @param array $data + * + * @return \Robo\ResultData + */ + public static function message($message, $data = []) + { + return new self(self::EXITCODE_OK, $message, $data); + } + + /** + * @param string $message + * @param array $data + * + * @return \Robo\ResultData + */ + public static function cancelled($message = '', $data = []) + { + return new ResultData(self::EXITCODE_USER_CANCEL, $message, $data); + } + + /** + * @return int + */ + public function getExitCode() + { + return $this->exitCode; + } + + /** + * @return null|string + */ + public function getOutputData() + { + if (!empty($this->message) && !isset($this['already-printed']) && isset($this['provide-outputdata'])) { + return $this->message; + } + } + + /** + * Indicate that the message in this data has already been displayed. + */ + public function alreadyPrinted() + { + $this['already-printed'] = true; + } + + /** + * Opt-in to providing the result message as the output data + */ + public function provideOutputdata() + { + $this['provide-outputdata'] = true; + } + + /** + * @return bool + */ + public function wasSuccessful() + { + return $this->exitCode === self::EXITCODE_OK; + } + + /** + * @return bool + */ + public function wasCancelled() + { + return $this->exitCode == self::EXITCODE_USER_CANCEL; + } +} diff --git a/vendor/consolidation/robo/src/Robo.php b/vendor/consolidation/robo/src/Robo.php new file mode 100644 index 0000000000000000000000000000000000000000..0b39a0794d89fb6e616ab2cb95a145b3b2ae1044 --- /dev/null +++ b/vendor/consolidation/robo/src/Robo.php @@ -0,0 +1,406 @@ +<?php +namespace Robo; + +use Composer\Autoload\ClassLoader; +use League\Container\Container; +use League\Container\ContainerInterface; +use Robo\Common\ProcessExecutor; +use Consolidation\Config\ConfigInterface; +use Consolidation\Config\Loader\ConfigProcessor; +use Consolidation\Config\Loader\YamlConfigLoader; +use Symfony\Component\Console\Input\StringInput; +use Symfony\Component\Console\Application as SymfonyApplication; +use Symfony\Component\Process\Process; + +/** + * Manages the container reference and other static data. Favor + * using dependency injection wherever possible. Avoid using + * this class directly, unless setting up a custom DI container. + */ +class Robo +{ + const APPLICATION_NAME = 'Robo'; + const VERSION = '1.4.9'; + + /** + * The currently active container object, or NULL if not initialized yet. + * + * @var ContainerInterface|null + */ + protected static $container; + + /** + * Entrypoint for standalone Robo-based tools. See docs/framework.md. + * + * @param string[] $argv + * @param string $commandClasses + * @param null|string $appName + * @param null|string $appVersion + * @param null|\Symfony\Component\Console\Output\OutputInterface $output + * + * @return int + */ + public static function run($argv, $commandClasses, $appName = null, $appVersion = null, $output = null, $repository = null) + { + $runner = new \Robo\Runner($commandClasses); + $runner->setSelfUpdateRepository($repository); + $statusCode = $runner->execute($argv, $appName, $appVersion, $output); + return $statusCode; + } + + /** + * Sets a new global container. + * + * @param ContainerInterface $container + * A new container instance to replace the current. + */ + public static function setContainer(ContainerInterface $container) + { + static::$container = $container; + } + + /** + * Unsets the global container. + */ + public static function unsetContainer() + { + static::$container = null; + } + + /** + * Returns the currently active global container. + * + * @return \League\Container\ContainerInterface + * + * @throws \RuntimeException + */ + public static function getContainer() + { + if (static::$container === null) { + throw new \RuntimeException('container is not initialized yet. \Robo\Robo::setContainer() must be called with a real container.'); + } + return static::$container; + } + + /** + * Returns TRUE if the container has been initialized, FALSE otherwise. + * + * @return bool + */ + public static function hasContainer() + { + return static::$container !== null; + } + + /** + * Create a config object and load it from the provided paths. + */ + public static function createConfiguration($paths) + { + $config = new \Robo\Config\Config(); + static::loadConfiguration($paths, $config); + return $config; + } + + /** + * Use a simple config loader to load configuration values from specified paths + */ + public static function loadConfiguration($paths, $config = null) + { + if ($config == null) { + $config = static::config(); + } + $loader = new YamlConfigLoader(); + $processor = new ConfigProcessor(); + $processor->add($config->export()); + foreach ($paths as $path) { + $processor->extend($loader->load($path)); + } + $config->import($processor->export()); + } + + /** + * Create a container and initiailze it. If you wish to *change* + * anything defined in the container, then you should call + * \Robo::configureContainer() instead of this function. + * + * @param null|\Symfony\Component\Console\Input\InputInterface $input + * @param null|\Symfony\Component\Console\Output\OutputInterface $output + * @param null|\Robo\Application $app + * @param null|ConfigInterface $config + * @param null|\Composer\Autoload\ClassLoader $classLoader + * + * @return \League\Container\Container|\League\Container\ContainerInterface + */ + public static function createDefaultContainer($input = null, $output = null, $app = null, $config = null, $classLoader = null) + { + // Do not allow this function to be called more than once. + if (static::hasContainer()) { + return static::getContainer(); + } + + if (!$app) { + $app = static::createDefaultApplication(); + } + + if (!$config) { + $config = new \Robo\Config\Config(); + } + + // Set up our dependency injection container. + $container = new Container(); + static::configureContainer($container, $app, $config, $input, $output, $classLoader); + + // Set the application dispatcher + $app->setDispatcher($container->get('eventDispatcher')); + + return $container; + } + + /** + * Initialize a container with all of the default Robo services. + * IMPORTANT: after calling this method, clients MUST call: + * + * $dispatcher = $container->get('eventDispatcher'); + * $app->setDispatcher($dispatcher); + * + * Any modification to the container should be done prior to fetching + * objects from it. + * + * It is recommended to use \Robo::createDefaultContainer() + * instead, which does all required setup for the caller, but has + * the limitation that the container it creates can only be + * extended, not modified. + * + * @param \League\Container\ContainerInterface $container + * @param \Symfony\Component\Console\Application $app + * @param ConfigInterface $config + * @param null|\Symfony\Component\Console\Input\InputInterface $input + * @param null|\Symfony\Component\Console\Output\OutputInterface $output + * @param null|\Composer\Autoload\ClassLoader $classLoader + */ + public static function configureContainer(ContainerInterface $container, SymfonyApplication $app, ConfigInterface $config, $input = null, $output = null, $classLoader = null) + { + // Self-referential container refernce for the inflector + $container->add('container', $container); + static::setContainer($container); + + // Create default input and output objects if they were not provided + if (!$input) { + $input = new StringInput(''); + } + if (!$output) { + $output = new \Symfony\Component\Console\Output\ConsoleOutput(); + } + if (!$classLoader) { + $classLoader = new ClassLoader(); + } + $config->set(Config::DECORATED, $output->isDecorated()); + $config->set(Config::INTERACTIVE, $input->isInteractive()); + + $container->share('application', $app); + $container->share('config', $config); + $container->share('input', $input); + $container->share('output', $output); + $container->share('outputAdapter', \Robo\Common\OutputAdapter::class); + $container->share('classLoader', $classLoader); + + // Register logging and related services. + $container->share('logStyler', \Robo\Log\RoboLogStyle::class); + $container->share('logger', \Robo\Log\RoboLogger::class) + ->withArgument('output') + ->withMethodCall('setLogOutputStyler', ['logStyler']); + $container->add('progressBar', \Symfony\Component\Console\Helper\ProgressBar::class) + ->withArgument('output'); + $container->share('progressIndicator', \Robo\Common\ProgressIndicator::class) + ->withArgument('progressBar') + ->withArgument('output'); + $container->share('resultPrinter', \Robo\Log\ResultPrinter::class); + $container->add('simulator', \Robo\Task\Simulator::class); + $container->share('globalOptionsEventListener', \Robo\GlobalOptionsEventListener::class) + ->withMethodCall('setApplication', ['application']); + $container->share('injectConfigEventListener', \Consolidation\Config\Inject\ConfigForCommand::class) + ->withArgument('config') + ->withMethodCall('setApplication', ['application']); + $container->share('collectionProcessHook', \Robo\Collection\CollectionProcessHook::class); + $container->share('alterOptionsCommandEvent', \Consolidation\AnnotatedCommand\Options\AlterOptionsCommandEvent::class) + ->withArgument('application'); + $container->share('hookManager', \Consolidation\AnnotatedCommand\Hooks\HookManager::class) + ->withMethodCall('addCommandEvent', ['alterOptionsCommandEvent']) + ->withMethodCall('addCommandEvent', ['injectConfigEventListener']) + ->withMethodCall('addCommandEvent', ['globalOptionsEventListener']) + ->withMethodCall('addResultProcessor', ['collectionProcessHook', '*']); + $container->share('eventDispatcher', \Symfony\Component\EventDispatcher\EventDispatcher::class) + ->withMethodCall('addSubscriber', ['hookManager']); + $container->share('formatterManager', \Consolidation\OutputFormatters\FormatterManager::class) + ->withMethodCall('addDefaultFormatters', []) + ->withMethodCall('addDefaultSimplifiers', []); + $container->share('prepareTerminalWidthOption', \Consolidation\AnnotatedCommand\Options\PrepareTerminalWidthOption::class) + ->withMethodCall('setApplication', ['application']); + $container->share('commandProcessor', \Consolidation\AnnotatedCommand\CommandProcessor::class) + ->withArgument('hookManager') + ->withMethodCall('setFormatterManager', ['formatterManager']) + ->withMethodCall('addPrepareFormatter', ['prepareTerminalWidthOption']) + ->withMethodCall( + 'setDisplayErrorFunction', + [ + function ($output, $message) use ($container) { + $logger = $container->get('logger'); + $logger->error($message); + } + ] + ); + $container->share('stdinHandler', \Consolidation\AnnotatedCommand\Input\StdinHandler::class); + $container->share('commandFactory', \Consolidation\AnnotatedCommand\AnnotatedCommandFactory::class) + ->withMethodCall('setCommandProcessor', ['commandProcessor']); + $container->share('relativeNamespaceDiscovery', \Robo\ClassDiscovery\RelativeNamespaceDiscovery::class) + ->withArgument('classLoader'); + + // Deprecated: favor using collection builders to direct use of collections. + $container->add('collection', \Robo\Collection\Collection::class); + // Deprecated: use CollectionBuilder::create() instead -- or, better + // yet, BuilderAwareInterface::collectionBuilder() if available. + $container->add('collectionBuilder', \Robo\Collection\CollectionBuilder::class); + + static::addInflectors($container); + + // Make sure the application is appropriately initialized. + $app->setAutoExit(false); + } + + /** + * @param null|string $appName + * @param null|string $appVersion + * + * @return \Robo\Application + */ + public static function createDefaultApplication($appName = null, $appVersion = null) + { + $appName = $appName ?: self::APPLICATION_NAME; + $appVersion = $appVersion ?: self::VERSION; + + $app = new \Robo\Application($appName, $appVersion); + $app->setAutoExit(false); + return $app; + } + + /** + * Add the Robo League\Container inflectors to the container + * + * @param \League\Container\ContainerInterface $container + */ + public static function addInflectors($container) + { + // Register our various inflectors. + $container->inflector(\Robo\Contract\ConfigAwareInterface::class) + ->invokeMethod('setConfig', ['config']); + $container->inflector(\Psr\Log\LoggerAwareInterface::class) + ->invokeMethod('setLogger', ['logger']); + $container->inflector(\League\Container\ContainerAwareInterface::class) + ->invokeMethod('setContainer', ['container']); + $container->inflector(\Symfony\Component\Console\Input\InputAwareInterface::class) + ->invokeMethod('setInput', ['input']); + $container->inflector(\Robo\Contract\OutputAwareInterface::class) + ->invokeMethod('setOutput', ['output']); + $container->inflector(\Robo\Contract\ProgressIndicatorAwareInterface::class) + ->invokeMethod('setProgressIndicator', ['progressIndicator']); + $container->inflector(\Consolidation\AnnotatedCommand\Events\CustomEventAwareInterface::class) + ->invokeMethod('setHookManager', ['hookManager']); + $container->inflector(\Robo\Contract\VerbosityThresholdInterface::class) + ->invokeMethod('setOutputAdapter', ['outputAdapter']); + $container->inflector(\Consolidation\AnnotatedCommand\Input\StdinAwareInterface::class) + ->invokeMethod('setStdinHandler', ['stdinHandler']); + } + + /** + * Retrieves a service from the container. + * + * Use this method if the desired service is not one of those with a dedicated + * accessor method below. If it is listed below, those methods are preferred + * as they can return useful type hints. + * + * @param string $id + * The ID of the service to retrieve. + * + * @return mixed + * The specified service. + */ + public static function service($id) + { + return static::getContainer()->get($id); + } + + /** + * Indicates if a service is defined in the container. + * + * @param string $id + * The ID of the service to check. + * + * @return bool + * TRUE if the specified service exists, FALSE otherwise. + */ + public static function hasService($id) + { + // Check hasContainer() first in order to always return a Boolean. + return static::hasContainer() && static::getContainer()->has($id); + } + + /** + * Return the result printer object. + * + * @return \Robo\Log\ResultPrinter + */ + public static function resultPrinter() + { + return static::service('resultPrinter'); + } + + /** + * @return ConfigInterface + */ + public static function config() + { + return static::service('config'); + } + + /** + * @return \Consolidation\Log\Logger + */ + public static function logger() + { + return static::service('logger'); + } + + /** + * @return \Robo\Application + */ + public static function application() + { + return static::service('application'); + } + + /** + * Return the output object. + * + * @return \Symfony\Component\Console\Output\OutputInterface + */ + public static function output() + { + return static::service('output'); + } + + /** + * Return the input object. + * + * @return \Symfony\Component\Console\Input\InputInterface + */ + public static function input() + { + return static::service('input'); + } + + public static function process(Process $process) + { + return ProcessExecutor::create(static::getContainer(), $process); + } +} diff --git a/vendor/consolidation/robo/src/Runner.php b/vendor/consolidation/robo/src/Runner.php new file mode 100644 index 0000000000000000000000000000000000000000..026ac871bc8c60ffb55e9e08e806abff78e9c0e2 --- /dev/null +++ b/vendor/consolidation/robo/src/Runner.php @@ -0,0 +1,575 @@ +<?php +namespace Robo; + +use Composer\Autoload\ClassLoader; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\StringInput; +use Robo\Contract\BuilderAwareInterface; +use Robo\Collection\CollectionBuilder; +use Robo\Common\IO; +use Robo\Exception\TaskExitException; +use League\Container\ContainerAwareInterface; +use League\Container\ContainerAwareTrait; +use Consolidation\Config\Util\EnvConfig; + +class Runner implements ContainerAwareInterface +{ + const ROBOCLASS = 'RoboFile'; + const ROBOFILE = 'RoboFile.php'; + + use IO; + use ContainerAwareTrait; + + /** + * @var string + */ + protected $roboClass; + + /** + * @var string + */ + protected $roboFile; + + /** + * @var string working dir of Robo + */ + protected $dir; + + /** + * @var string[] + */ + protected $errorConditions = []; + + /** + * @var string GitHub Repo for SelfUpdate + */ + protected $selfUpdateRepository = null; + + /** + * @var string filename to load configuration from (set to 'robo.yml' for RoboFiles) + */ + protected $configFilename = 'conf.yml'; + + /** + * @var string prefix for environment variable configuration overrides + */ + protected $envConfigPrefix = false; + + /** + * @var \Composer\Autoload\ClassLoader + */ + protected $classLoader = null; + + /** + * @var string + */ + protected $relativePluginNamespace; + + /** + * Class Constructor + * + * @param null|string $roboClass + * @param null|string $roboFile + */ + public function __construct($roboClass = null, $roboFile = null) + { + // set the const as class properties to allow overwriting in child classes + $this->roboClass = $roboClass ? $roboClass : self::ROBOCLASS ; + $this->roboFile = $roboFile ? $roboFile : self::ROBOFILE; + $this->dir = getcwd(); + } + + protected function errorCondition($msg, $errorType) + { + $this->errorConditions[$msg] = $errorType; + } + + /** + * @param \Symfony\Component\Console\Output\OutputInterface $output + * + * @return bool + */ + protected function loadRoboFile($output) + { + // If we have not been provided an output object, make a temporary one. + if (!$output) { + $output = new \Symfony\Component\Console\Output\ConsoleOutput(); + } + + // If $this->roboClass is a single class that has not already + // been loaded, then we will try to obtain it from $this->roboFile. + // If $this->roboClass is an array, we presume all classes requested + // are available via the autoloader. + if (is_array($this->roboClass) || class_exists($this->roboClass)) { + return true; + } + if (!file_exists($this->dir)) { + $this->errorCondition("Path `{$this->dir}` is invalid; please provide a valid absolute path to the Robofile to load.", 'red'); + return false; + } + + $realDir = realpath($this->dir); + + $roboFilePath = $realDir . DIRECTORY_SEPARATOR . $this->roboFile; + if (!file_exists($roboFilePath)) { + $requestedRoboFilePath = $this->dir . DIRECTORY_SEPARATOR . $this->roboFile; + $this->errorCondition("Requested RoboFile `$requestedRoboFilePath` is invalid, please provide valid absolute path to load Robofile.", 'red'); + return false; + } + require_once $roboFilePath; + + if (!class_exists($this->roboClass)) { + $this->errorCondition("Class {$this->roboClass} was not loaded.", 'red'); + return false; + } + return true; + } + + /** + * @param array $argv + * @param null|string $appName + * @param null|string $appVersion + * @param null|\Symfony\Component\Console\Output\OutputInterface $output + * + * @return int + */ + public function execute($argv, $appName = null, $appVersion = null, $output = null) + { + $argv = $this->shebang($argv); + $argv = $this->processRoboOptions($argv); + $app = null; + if ($appName && $appVersion) { + $app = Robo::createDefaultApplication($appName, $appVersion); + } + $commandFiles = $this->getRoboFileCommands($output); + return $this->run($argv, $output, $app, $commandFiles, $this->classLoader); + } + + /** + * Get a list of locations where config files may be loaded + * @return string[] + */ + protected function getConfigFilePaths($userConfig) + { + $roboAppConfig = dirname(__DIR__) . '/' . basename($userConfig); + $configFiles = [$userConfig, $roboAppConfig]; + if (dirname($userConfig) != '.') { + array_unshift($configFiles, basename($userConfig)); + } + return $configFiles; + } + /** + * @param null|\Symfony\Component\Console\Input\InputInterface $input + * @param null|\Symfony\Component\Console\Output\OutputInterface $output + * @param null|\Robo\Application $app + * @param array[] $commandFiles + * @param null|ClassLoader $classLoader + * + * @return int + */ + public function run($input = null, $output = null, $app = null, $commandFiles = [], $classLoader = null) + { + // Create default input and output objects if they were not provided + if (!$input) { + $input = new StringInput(''); + } + if (is_array($input)) { + $input = new ArgvInput($input); + } + if (!$output) { + $output = new \Symfony\Component\Console\Output\ConsoleOutput(); + } + $this->setInput($input); + $this->setOutput($output); + + // If we were not provided a container, then create one + if (!$this->getContainer()) { + $configFiles = $this->getConfigFilePaths($this->configFilename); + $config = Robo::createConfiguration($configFiles); + if ($this->envConfigPrefix) { + $envConfig = new EnvConfig($this->envConfigPrefix); + $config->addContext('env', $envConfig); + } + $container = Robo::createDefaultContainer($input, $output, $app, $config, $classLoader); + $this->setContainer($container); + // Automatically register a shutdown function and + // an error handler when we provide the container. + $this->installRoboHandlers(); + } + + if (!$app) { + $app = Robo::application(); + } + if ($app instanceof \Robo\Application) { + $app->addSelfUpdateCommand($this->getSelfUpdateRepository()); + if (!isset($commandFiles)) { + $this->errorCondition("Robo is not initialized here. Please run `robo init` to create a new RoboFile.", 'yellow'); + $app->addInitRoboFileCommand($this->roboFile, $this->roboClass); + $commandFiles = []; + } + } + + if (!empty($this->relativePluginNamespace)) { + $commandClasses = $this->discoverCommandClasses($this->relativePluginNamespace); + $commandFiles = array_merge((array)$commandFiles, $commandClasses); + } + + $this->registerCommandClasses($app, $commandFiles); + + try { + $statusCode = $app->run($input, $output); + } catch (TaskExitException $e) { + $statusCode = $e->getCode() ?: 1; + } + + // If there were any error conditions in bootstrapping Robo, + // print them only if the requested command did not complete + // successfully. + if ($statusCode) { + foreach ($this->errorConditions as $msg => $color) { + $this->yell($msg, 40, $color); + } + } + return $statusCode; + } + + /** + * @param \Symfony\Component\Console\Output\OutputInterface $output + * + * @return null|string + */ + protected function getRoboFileCommands($output) + { + if (!$this->loadRoboFile($output)) { + return; + } + return $this->roboClass; + } + + /** + * @param \Robo\Application $app + * @param array $commandClasses + */ + public function registerCommandClasses($app, $commandClasses) + { + foreach ((array)$commandClasses as $commandClass) { + $this->registerCommandClass($app, $commandClass); + } + } + + /** + * @param $relativeNamespace + * + * @return array|string[] + */ + protected function discoverCommandClasses($relativeNamespace) + { + /** @var \Robo\ClassDiscovery\RelativeNamespaceDiscovery $discovery */ + $discovery = Robo::service('relativeNamespaceDiscovery'); + $discovery->setRelativeNamespace($relativeNamespace.'\Commands') + ->setSearchPattern('*Commands.php'); + return $discovery->getClasses(); + } + + /** + * @param \Robo\Application $app + * @param string|BuilderAwareInterface|ContainerAwareInterface $commandClass + * + * @return mixed|void + */ + public function registerCommandClass($app, $commandClass) + { + $container = Robo::getContainer(); + $roboCommandFileInstance = $this->instantiateCommandClass($commandClass); + if (!$roboCommandFileInstance) { + return; + } + + // Register commands for all of the public methods in the RoboFile. + $commandFactory = $container->get('commandFactory'); + $commandList = $commandFactory->createCommandsFromClass($roboCommandFileInstance); + foreach ($commandList as $command) { + $app->add($command); + } + return $roboCommandFileInstance; + } + + /** + * @param string|BuilderAwareInterface|ContainerAwareInterface $commandClass + * + * @return null|object + */ + protected function instantiateCommandClass($commandClass) + { + $container = Robo::getContainer(); + + // Register the RoboFile with the container and then immediately + // fetch it; this ensures that all of the inflectors will run. + // If the command class is already an instantiated object, then + // just use it exactly as it was provided to us. + if (is_string($commandClass)) { + if (!class_exists($commandClass)) { + return; + } + $reflectionClass = new \ReflectionClass($commandClass); + if ($reflectionClass->isAbstract()) { + return; + } + + $commandFileName = "{$commandClass}Commands"; + $container->share($commandFileName, $commandClass); + $commandClass = $container->get($commandFileName); + } + // If the command class is a Builder Aware Interface, then + // ensure that it has a builder. Every command class needs + // its own collection builder, as they have references to each other. + if ($commandClass instanceof BuilderAwareInterface) { + $builder = CollectionBuilder::create($container, $commandClass); + $commandClass->setBuilder($builder); + } + if ($commandClass instanceof ContainerAwareInterface) { + $commandClass->setContainer($container); + } + return $commandClass; + } + + public function installRoboHandlers() + { + register_shutdown_function(array($this, 'shutdown')); + set_error_handler(array($this, 'handleError')); + } + + /** + * Process a shebang script, if one was used to launch this Runner. + * + * @param array $args + * + * @return array $args with shebang script removed + */ + protected function shebang($args) + { + // Option 1: Shebang line names Robo, but includes no parameters. + // #!/bin/env robo + // The robo class may contain multiple commands; the user may + // select which one to run, or even get a list of commands or + // run 'help' on any of the available commands as usual. + if ((count($args) > 1) && $this->isShebangFile($args[1])) { + return array_merge([$args[0]], array_slice($args, 2)); + } + // Option 2: Shebang line stipulates which command to run. + // #!/bin/env robo mycommand + // The robo class must contain a public method named 'mycommand'. + // This command will be executed every time. Arguments and options + // may be provided on the commandline as usual. + if ((count($args) > 2) && $this->isShebangFile($args[2])) { + return array_merge([$args[0]], explode(' ', $args[1]), array_slice($args, 3)); + } + return $args; + } + + /** + * Determine if the specified argument is a path to a shebang script. + * If so, load it. + * + * @param string $filepath file to check + * + * @return bool Returns TRUE if shebang script was processed + */ + protected function isShebangFile($filepath) + { + // Avoid trying to call $filepath on remote URLs + if ((strpos($filepath, '://') !== false) && (substr($filepath, 0, 7) != 'file://')) { + return false; + } + if (!is_file($filepath)) { + return false; + } + $fp = fopen($filepath, "r"); + if ($fp === false) { + return false; + } + $line = fgets($fp); + $result = $this->isShebangLine($line); + if ($result) { + while ($line = fgets($fp)) { + $line = trim($line); + if ($line == '<?php') { + $script = stream_get_contents($fp); + if (preg_match('#^class *([^ ]+)#m', $script, $matches)) { + $this->roboClass = $matches[1]; + eval($script); + $result = true; + } + } + } + } + fclose($fp); + + return $result; + } + + /** + * Test to see if the provided line is a robo 'shebang' line. + * + * @param string $line + * + * @return bool + */ + protected function isShebangLine($line) + { + return ((substr($line, 0, 2) == '#!') && (strstr($line, 'robo') !== false)); + } + + /** + * Check for Robo-specific arguments such as --load-from, process them, + * and remove them from the array. We have to process --load-from before + * we set up Symfony Console. + * + * @param array $argv + * + * @return array + */ + protected function processRoboOptions($argv) + { + // loading from other directory + $pos = $this->arraySearchBeginsWith('--load-from', $argv) ?: array_search('-f', $argv); + if ($pos === false) { + return $argv; + } + + $passThru = array_search('--', $argv); + if (($passThru !== false) && ($passThru < $pos)) { + return $argv; + } + + if (substr($argv[$pos], 0, 12) == '--load-from=') { + $this->dir = substr($argv[$pos], 12); + } elseif (isset($argv[$pos +1])) { + $this->dir = $argv[$pos +1]; + unset($argv[$pos +1]); + } + unset($argv[$pos]); + // Make adjustments if '--load-from' points at a file. + if (is_file($this->dir) || (substr($this->dir, -4) == '.php')) { + $this->roboFile = basename($this->dir); + $this->dir = dirname($this->dir); + $className = basename($this->roboFile, '.php'); + if ($className != $this->roboFile) { + $this->roboClass = $className; + } + } + // Convert directory to a real path, but only if the + // path exists. We do not want to lose the original + // directory if the user supplied a bad value. + $realDir = realpath($this->dir); + if ($realDir) { + chdir($realDir); + $this->dir = $realDir; + } + + return $argv; + } + + /** + * @param string $needle + * @param string[] $haystack + * + * @return bool|int + */ + protected function arraySearchBeginsWith($needle, $haystack) + { + for ($i = 0; $i < count($haystack); ++$i) { + if (substr($haystack[$i], 0, strlen($needle)) == $needle) { + return $i; + } + } + return false; + } + + public function shutdown() + { + $error = error_get_last(); + if (!is_array($error)) { + return; + } + $this->writeln(sprintf("<error>ERROR: %s \nin %s:%d\n</error>", $error['message'], $error['file'], $error['line'])); + } + + /** + * This is just a proxy error handler that checks the current error_reporting level. + * In case error_reporting is disabled the error is marked as handled, otherwise + * the normal internal error handling resumes. + * + * @return bool + */ + public function handleError() + { + if (error_reporting() === 0) { + return true; + } + return false; + } + + /** + * @return string + */ + public function getSelfUpdateRepository() + { + return $this->selfUpdateRepository; + } + + /** + * @param $selfUpdateRepository + * + * @return $this + */ + public function setSelfUpdateRepository($selfUpdateRepository) + { + $this->selfUpdateRepository = $selfUpdateRepository; + return $this; + } + + /** + * @param string $configFilename + * + * @return $this + */ + public function setConfigurationFilename($configFilename) + { + $this->configFilename = $configFilename; + return $this; + } + + /** + * @param string $envConfigPrefix + * + * @return $this + */ + public function setEnvConfigPrefix($envConfigPrefix) + { + $this->envConfigPrefix = $envConfigPrefix; + return $this; + } + + /** + * @param \Composer\Autoload\ClassLoader $classLoader + * + * @return $this + */ + public function setClassLoader(ClassLoader $classLoader) + { + $this->classLoader = $classLoader; + return $this; + } + + /** + * @param string $relativeNamespace + * + * @return $this + */ + public function setRelativePluginNamespace($relativeNamespace) + { + $this->relativePluginNamespace = $relativeNamespace; + return $this; + } +} diff --git a/vendor/consolidation/robo/src/State/Consumer.php b/vendor/consolidation/robo/src/State/Consumer.php new file mode 100644 index 0000000000000000000000000000000000000000..ab9c0e27781f54bd5c9222fb6c20f0990bf8184d --- /dev/null +++ b/vendor/consolidation/robo/src/State/Consumer.php @@ -0,0 +1,12 @@ +<?php +namespace Robo\State; + +use Robo\State\Data; + +interface Consumer +{ + /** + * @return Data + */ + public function receiveState(Data $state); +} diff --git a/vendor/consolidation/robo/src/State/Data.php b/vendor/consolidation/robo/src/State/Data.php new file mode 100644 index 0000000000000000000000000000000000000000..34cb5c761a9ac606d17be0f12e7bf95217bcd613 --- /dev/null +++ b/vendor/consolidation/robo/src/State/Data.php @@ -0,0 +1,148 @@ +<?php +namespace Robo\State; + +/** + * A State\Data object contains a "message" (the primary result) and a + * data array (the persistent state). The message is transient, and does + * not move into the persistent state unless explicitly copied there. + */ +class Data extends \ArrayObject +{ + /** + * @var string + */ + protected $message; + + /** + * @param string $message + * @param array $data + */ + public function __construct($message = '', $data = []) + { + $this->message = $message; + parent::__construct($data); + } + + /** + * @return array + */ + public function getData() + { + return $this->getArrayCopy(); + } + + /** + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * @param string message + */ + public function setMessage($message) + { + $this->message = $message; + } + + /** + * Merge another result into this result. Data already + * existing in this result takes precedence over the + * data in the Result being merged. + * + * @param \Robo\ResultData $result + * + * @return $this + */ + public function merge(Data $result) + { + $mergedData = $this->getArrayCopy() + $result->getArrayCopy(); + $this->exchangeArray($mergedData); + return $this; + } + + /** + * Update the current data with the data provided in the parameter. + * Provided data takes precedence. + * + * @param \ArrayObject $update + * + * @return $this + */ + public function update(\ArrayObject $update) + { + $iterator = $update->getIterator(); + + while ($iterator->valid()) { + $this[$iterator->key()] = $iterator->current(); + $iterator->next(); + } + + return $this; + } + + /** + * Merge another result into this result. Data already + * existing in this result takes precedence over the + * data in the Result being merged. + * + * $data['message'] is handled specially, and is appended + * to $this->message if set. + * + * @param array $data + * + * @return array + */ + public function mergeData(array $data) + { + $mergedData = $this->getArrayCopy() + $data; + $this->exchangeArray($mergedData); + return $mergedData; + } + + /** + * @return bool + */ + public function hasExecutionTime() + { + return isset($this['time']); + } + + /** + * @return null|float + */ + public function getExecutionTime() + { + if (!$this->hasExecutionTime()) { + return null; + } + return $this['time']; + } + + /** + * Accumulate execution time + */ + public function accumulateExecutionTime($duration) + { + // Convert data arrays to scalar + if (is_array($duration)) { + $duration = isset($duration['time']) ? $duration['time'] : 0; + } + $this['time'] = $this->getExecutionTime() + $duration; + return $this->getExecutionTime(); + } + + /** + * Accumulate the message. + */ + public function accumulateMessage($message) + { + if (!empty($this->message)) { + $this->message .= "\n"; + } + $this->message .= $message; + return $this->getMessage(); + } +} diff --git a/vendor/consolidation/robo/src/State/StateAwareInterface.php b/vendor/consolidation/robo/src/State/StateAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..f86bccb87fe3e61649cded81b65894e49ec067eb --- /dev/null +++ b/vendor/consolidation/robo/src/State/StateAwareInterface.php @@ -0,0 +1,30 @@ +<?php +namespace Robo\State; + +use Robo\State\Data; + +interface StateAwareInterface +{ + /** + * @return Data + */ + public function getState(); + + /** + * @param Data state + */ + public function setState(Data $state); + + /** + * @param $key + * @param value + */ + public function setStateValue($key, $value); + + /** + * @param Data update state takes precedence over current state. + */ + public function updateState(Data $update); + + public function resetState(); +} diff --git a/vendor/consolidation/robo/src/State/StateAwareTrait.php b/vendor/consolidation/robo/src/State/StateAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..a1de1f15c610fa7d292116aeb8df752c1acd6026 --- /dev/null +++ b/vendor/consolidation/robo/src/State/StateAwareTrait.php @@ -0,0 +1,49 @@ +<?php +namespace Robo\State; + +use Robo\State\Data; + +trait StateAwareTrait +{ + protected $state; + + /** + * {@inheritdoc} + */ + public function getState() + { + return $this->state; + } + + /** + * {@inheritdoc} + */ + public function setState(Data $state) + { + $this->state = $state; + } + + /** + * {@inheritdoc} + */ + public function setStateValue($key, $value) + { + $this->state[$key] = $value; + } + + /** + * {@inheritdoc} + */ + public function updateState(Data $update) + { + $this->state->update($update); + } + + /** + * {@inheritdoc} + */ + public function resetState() + { + $this->state = new Data(); + } +} diff --git a/vendor/consolidation/robo/src/Task/ApiGen/ApiGen.php b/vendor/consolidation/robo/src/Task/ApiGen/ApiGen.php new file mode 100644 index 0000000000000000000000000000000000000000..11ff764c21aa090e09794f68015676095e6b0a62 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/ApiGen/ApiGen.php @@ -0,0 +1,518 @@ +<?php +namespace Robo\Task\ApiGen; + +use Robo\Contract\CommandInterface; +use Robo\Exception\TaskException; +use Robo\Task\BaseTask; +use Traversable; + +/** + * Executes ApiGen command to generate documentation + * + * ``` php + * <?php + * // ApiGen Command + * $this->taskApiGen('./vendor/apigen/apigen.phar') + * ->config('./apigen.neon') + * ->templateConfig('vendor/apigen/apigen/templates/bootstrap/config.neon') + * ->wipeout(true) + * ->run(); + * ?> + * ``` + */ +class ApiGen extends BaseTask implements CommandInterface +{ + use \Robo\Common\ExecOneCommand; + + const BOOL_NO = 'no'; + const BOOL_YES = 'yes'; + + /** + * @var string + */ + protected $command; + protected $operation = 'generate'; + + /** + * @param null|string $pathToApiGen + * + * @throws \Robo\Exception\TaskException + */ + public function __construct($pathToApiGen = null) + { + $this->command = $pathToApiGen; + $command_parts = []; + preg_match('/((?:.+)?apigen(?:\.phar)?) ?( \w+)? ?(.+)?/', $this->command, $command_parts); + if (count($command_parts) === 3) { + list(, $this->command, $this->operation) = $command_parts; + } + if (count($command_parts) === 4) { + list(, $this->command, $this->operation, $arg) = $command_parts; + $this->arg($arg); + } + if (!$this->command) { + $this->command = $this->findExecutablePhar('apigen'); + } + if (!$this->command) { + throw new TaskException(__CLASS__, "No apigen installation found"); + } + } + + /** + * Pass methods parameters as arguments to executable. Argument values + * are automatically escaped. + * + * @param string|string[] $args + * + * @return $this + */ + public function args($args) + { + if (!is_array($args)) { + $args = func_get_args(); + } + $args = array_map(function ($arg) { + if (preg_match('/^\w+$/', trim($arg)) === 1) { + $this->operation = $arg; + return null; + } + return $arg; + }, $args); + $args = array_filter($args); + $this->arguments .= ' ' . implode(' ', array_map('static::escape', $args)); + return $this; + } + + /** + * @param array|Traversable|string $arg a single object or something traversable + * + * @return array|Traversable the provided argument if it was already traversable, or the given + * argument returned as a one-element array + */ + protected static function forceTraversable($arg) + { + $traversable = $arg; + if (!is_array($traversable) && !($traversable instanceof \Traversable)) { + $traversable = array($traversable); + } + return $traversable; + } + + /** + * @param array|string $arg a single argument or an array of multiple string values + * + * @return string a comma-separated string of all of the provided arguments, suitable + * as a command-line "list" type argument for ApiGen + */ + protected static function asList($arg) + { + $normalized = is_array($arg) ? $arg : array($arg); + return implode(',', $normalized); + } + + /** + * @param bool|string $val an argument to be normalized + * @param string $default one of self::BOOL_YES or self::BOOK_NO if the provided + * value could not deterministically be converted to a + * yes or no value + * + * @return string the given value as a command-line "yes|no" type of argument for ApiGen, + * or the default value if none could be determined + */ + protected static function asTextBool($val, $default) + { + if ($val === self::BOOL_YES || $val === self::BOOL_NO) { + return $val; + } + if (!$val) { + return self::BOOL_NO; + } + if ($val === true) { + return self::BOOL_YES; + } + if (is_numeric($val) && $val != 0) { + return self::BOOL_YES; + } + if (strcasecmp($val[0], 'y') === 0) { + return self::BOOL_YES; + } + if (strcasecmp($val[0], 'n') === 0) { + return self::BOOL_NO; + } + // meh, good enough, let apigen sort it out + return $default; + } + + /** + * @param string $config + * + * @return $this + */ + public function config($config) + { + $this->option('config', $config); + return $this; + } + + /** + * @param array|string|Traversable $src one or more source values + * + * @return $this + */ + public function source($src) + { + foreach (self::forceTraversable($src) as $source) { + $this->option('source', $source); + } + return $this; + } + + /** + * @param string $dest + * + * @return $this + */ + public function destination($dest) + { + $this->option('destination', $dest); + return $this; + } + + /** + * @param array|string $exts one or more extensions + * + * @return $this + */ + public function extensions($exts) + { + $this->option('extensions', self::asList($exts)); + return $this; + } + + /** + * @param array|string $exclude one or more exclusions + * + * @return $this + */ + public function exclude($exclude) + { + foreach (self::forceTraversable($exclude) as $excl) { + $this->option('exclude', $excl); + } + return $this; + } + + /** + * @param array|string|Traversable $path one or more skip-doc-path values + * + * @return $this + */ + public function skipDocPath($path) + { + foreach (self::forceTraversable($path) as $skip) { + $this->option('skip-doc-path', $skip); + } + return $this; + } + + /** + * @param array|string|Traversable $prefix one or more skip-doc-prefix values + * + * @return $this + */ + public function skipDocPrefix($prefix) + { + foreach (self::forceTraversable($prefix) as $skip) { + $this->option('skip-doc-prefix', $skip); + } + return $this; + } + + /** + * @param array|string $charset one or more charsets + * + * @return $this + */ + public function charset($charset) + { + $this->option('charset', self::asList($charset)); + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function mainProjectNamePrefix($name) + { + $this->option('main', $name); + return $this; + } + + /** + * @param string $title + * + * @return $this + */ + public function title($title) + { + $this->option('title', $title); + return $this; + } + + /** + * @param string $baseUrl + * + * @return $this + */ + public function baseUrl($baseUrl) + { + $this->option('base-url', $baseUrl); + return $this; + } + + /** + * @param string $id + * + * @return $this + */ + public function googleCseId($id) + { + $this->option('google-cse-id', $id); + return $this; + } + + /** + * @param string $trackingCode + * + * @return $this + */ + public function googleAnalytics($trackingCode) + { + $this->option('google-analytics', $trackingCode); + return $this; + } + + /** + * @param mixed $templateConfig + * + * @return $this + */ + public function templateConfig($templateConfig) + { + $this->option('template-config', $templateConfig); + return $this; + } + + /** + * @param array|string $tags one or more supported html tags + * + * @return $this + */ + public function allowedHtml($tags) + { + $this->option('allowed-html', self::asList($tags)); + return $this; + } + + /** + * @param string $groups + * + * @return $this + */ + public function groups($groups) + { + $this->option('groups', $groups); + return $this; + } + + /** + * @param array|string $types or more supported autocomplete types + * + * @return $this + */ + public function autocomplete($types) + { + $this->option('autocomplete', self::asList($types)); + return $this; + } + + /** + * @param array|string $levels one or more access levels + * + * @return $this + */ + public function accessLevels($levels) + { + $this->option('access-levels', self::asList($levels)); + return $this; + } + + /** + * @param boolean|string $internal 'yes' or true if internal, 'no' or false if not + * + * @return $this + */ + public function internal($internal) + { + $this->option('internal', self::asTextBool($internal, self::BOOL_NO)); + return $this; + } + + /** + * @param boolean|string $php 'yes' or true to generate documentation for internal php classes, + * 'no' or false otherwise + * + * @return $this + */ + public function php($php) + { + $this->option('php', self::asTextBool($php, self::BOOL_YES)); + return $this; + } + + /** + * @param bool|string $tree 'yes' or true to generate a tree view of classes, 'no' or false otherwise + * + * @return $this + */ + public function tree($tree) + { + $this->option('tree', self::asTextBool($tree, self::BOOL_YES)); + return $this; + } + + /** + * @param bool|string $dep 'yes' or true to generate documentation for deprecated classes, 'no' or false otherwise + * + * @return $this + */ + public function deprecated($dep) + { + $this->option('deprecated', self::asTextBool($dep, self::BOOL_NO)); + return $this; + } + + /** + * @param bool|string $todo 'yes' or true to document tasks, 'no' or false otherwise + * + * @return $this + */ + public function todo($todo) + { + $this->option('todo', self::asTextBool($todo, self::BOOL_NO)); + return $this; + } + + /** + * @param bool|string $src 'yes' or true to generate highlighted source code, 'no' or false otherwise + * + * @return $this + */ + public function sourceCode($src) + { + $this->option('source-code', self::asTextBool($src, self::BOOL_YES)); + return $this; + } + + /** + * @param bool|string $zipped 'yes' or true to generate downloadable documentation, 'no' or false otherwise + * + * @return $this + */ + public function download($zipped) + { + $this->option('download', self::asTextBool($zipped, self::BOOL_NO)); + return $this; + } + + public function report($path) + { + $this->option('report', $path); + return $this; + } + + /** + * @param bool|string $wipeout 'yes' or true to clear out the destination directory, 'no' or false otherwise + * + * @return $this + */ + public function wipeout($wipeout) + { + $this->option('wipeout', self::asTextBool($wipeout, self::BOOL_YES)); + return $this; + } + + /** + * @param bool|string $quiet 'yes' or true for quiet, 'no' or false otherwise + * + * @return $this + */ + public function quiet($quiet) + { + $this->option('quiet', self::asTextBool($quiet, self::BOOL_NO)); + return $this; + } + + /** + * @param bool|string $bar 'yes' or true to display a progress bar, 'no' or false otherwise + * + * @return $this + */ + public function progressbar($bar) + { + $this->option('progressbar', self::asTextBool($bar, self::BOOL_YES)); + return $this; + } + + /** + * @param bool|string $colors 'yes' or true colorize the output, 'no' or false otherwise + * + * @return $this + */ + public function colors($colors) + { + $this->option('colors', self::asTextBool($colors, self::BOOL_YES)); + return $this; + } + + /** + * @param bool|string $check 'yes' or true to check for updates, 'no' or false otherwise + * + * @return $this + */ + public function updateCheck($check) + { + $this->option('update-check', self::asTextBool($check, self::BOOL_YES)); + return $this; + } + + /** + * @param bool|string $debug 'yes' or true to enable debug mode, 'no' or false otherwise + * + * @return $this + */ + public function debug($debug) + { + $this->option('debug', self::asTextBool($debug, self::BOOL_NO)); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return "$this->command $this->operation$this->arguments"; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Running ApiGen {args}', ['args' => $this->arguments]); + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/ApiGen/loadTasks.php b/vendor/consolidation/robo/src/Task/ApiGen/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..e8cd372af357cf21eebe6d31516cf43f3b364d33 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/ApiGen/loadTasks.php @@ -0,0 +1,15 @@ +<?php +namespace Robo\Task\ApiGen; + +trait loadTasks +{ + /** + * @param null|string $pathToApiGen + * + * @return \Robo\Task\ApiGen\ApiGen + */ + protected function taskApiGen($pathToApiGen = null) + { + return $this->task(ApiGen::class, $pathToApiGen); + } +} diff --git a/vendor/consolidation/robo/src/Task/Archive/Extract.php b/vendor/consolidation/robo/src/Task/Archive/Extract.php new file mode 100644 index 0000000000000000000000000000000000000000..a00a0baf86bc4a000064afa21556d06e01a8d6b9 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Archive/Extract.php @@ -0,0 +1,279 @@ +<?php + +namespace Robo\Task\Archive; + +use Robo\Result; +use Robo\Task\BaseTask; +use Robo\Task\Filesystem\FilesystemStack; +use Robo\Task\Filesystem\DeleteDir; +use Robo\Contract\BuilderAwareInterface; +use Robo\Common\BuilderAwareTrait; + +/** + * Extracts an archive. + * + * Note that often, distributions are packaged in tar or zip archives + * where the topmost folder may contain variable information, such as + * the release date, or the version of the package. This information + * is very useful when unpacking by hand, but arbitrarily-named directories + * are much less useful to scripts. Therefore, by default, Extract will + * remove the top-level directory, and instead store all extracted files + * into the directory specified by $archivePath. + * + * To keep the top-level directory when extracting, use + * `preserveTopDirectory(true)`. + * + * ``` php + * <?php + * $this->taskExtract($archivePath) + * ->to($destination) + * ->preserveTopDirectory(false) // the default + * ->run(); + * ?> + * ``` + */ +class Extract extends BaseTask implements BuilderAwareInterface +{ + use BuilderAwareTrait; + + /** + * @var string + */ + protected $filename; + + /** + * @var string + */ + protected $to; + + /** + * @var bool + */ + private $preserveTopDirectory = false; + + /** + * @param string $filename + */ + public function __construct($filename) + { + $this->filename = $filename; + } + + /** + * Location to store extracted files. + * + * @param string $to + * + * @return $this + */ + public function to($to) + { + $this->to = $to; + return $this; + } + + /** + * @param bool $preserve + * + * @return $this + */ + public function preserveTopDirectory($preserve = true) + { + $this->preserveTopDirectory = $preserve; + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + if (!file_exists($this->filename)) { + $this->printTaskError("File {filename} does not exist", ['filename' => $this->filename]); + + return false; + } + if (!($mimetype = static::archiveType($this->filename))) { + $this->printTaskError("Could not determine type of archive for {filename}", ['filename' => $this->filename]); + + return false; + } + + // We will first extract to $extractLocation and then move to $this->to + $extractLocation = static::getTmpDir(); + @mkdir($extractLocation); + @mkdir(dirname($this->to)); + + $this->startTimer(); + + $this->printTaskInfo("Extracting {filename}", ['filename' => $this->filename]); + + $result = $this->extractAppropriateType($mimetype, $extractLocation); + if ($result->wasSuccessful()) { + $this->printTaskInfo("{filename} extracted", ['filename' => $this->filename]); + // Now, we want to move the extracted files to $this->to. There + // are two possibilities that we must consider: + // + // (1) Archived files were encapsulated in a folder with an arbitrary name + // (2) There was no encapsulating folder, and all the files in the archive + // were extracted into $extractLocation + // + // In the case of (1), we want to move and rename the encapsulating folder + // to $this->to. + // + // In the case of (2), we will just move and rename $extractLocation. + $filesInExtractLocation = glob("$extractLocation/*"); + $hasEncapsulatingFolder = ((count($filesInExtractLocation) == 1) && is_dir($filesInExtractLocation[0])); + if ($hasEncapsulatingFolder && !$this->preserveTopDirectory) { + $result = (new FilesystemStack()) + ->inflect($this) + ->rename($filesInExtractLocation[0], $this->to) + ->run(); + (new DeleteDir($extractLocation)) + ->inflect($this) + ->run(); + } else { + $result = (new FilesystemStack()) + ->inflect($this) + ->rename($extractLocation, $this->to) + ->run(); + } + } + $this->stopTimer(); + $result['time'] = $this->getExecutionTime(); + + return $result; + } + + /** + * @param string $mimetype + * @param string $extractLocation + * + * @return \Robo\Result + */ + protected function extractAppropriateType($mimetype, $extractLocation) + { + // Perform the extraction of a zip file. + if (($mimetype == 'application/zip') || ($mimetype == 'application/x-zip')) { + return $this->extractZip($extractLocation); + } + return $this->extractTar($extractLocation); + } + + /** + * @param string $extractLocation + * + * @return \Robo\Result + */ + protected function extractZip($extractLocation) + { + if (!extension_loaded('zlib')) { + return Result::errorMissingExtension($this, 'zlib', 'zip extracting'); + } + + $zip = new \ZipArchive(); + if (($status = $zip->open($this->filename)) !== true) { + return Result::error($this, "Could not open zip archive {$this->filename}"); + } + if (!$zip->extractTo($extractLocation)) { + return Result::error($this, "Could not extract zip archive {$this->filename}"); + } + $zip->close(); + + return Result::success($this); + } + + /** + * @param string $extractLocation + * + * @return \Robo\Result + */ + protected function extractTar($extractLocation) + { + if (!class_exists('Archive_Tar')) { + return Result::errorMissingPackage($this, 'Archive_Tar', 'pear/archive_tar'); + } + $tar_object = new \Archive_Tar($this->filename); + if (!$tar_object->extract($extractLocation)) { + return Result::error($this, "Could not extract tar archive {$this->filename}"); + } + + return Result::success($this); + } + + /** + * @param string $filename + * + * @return bool|string + */ + protected static function archiveType($filename) + { + $content_type = false; + if (class_exists('finfo')) { + $finfo = new \finfo(FILEINFO_MIME_TYPE); + $content_type = $finfo->file($filename); + // If finfo cannot determine the content type, then we will try other methods + if ($content_type == 'application/octet-stream') { + $content_type = false; + } + } + // Examing the file's magic header bytes. + if (!$content_type) { + if ($file = fopen($filename, 'rb')) { + $first = fread($file, 2); + fclose($file); + if ($first !== false) { + // Interpret the two bytes as a little endian 16-bit unsigned int. + $data = unpack('v', $first); + switch ($data[1]) { + case 0x8b1f: + // First two bytes of gzip files are 0x1f, 0x8b (little-endian). + // See http://www.gzip.org/zlib/rfc-gzip.html#header-trailer + $content_type = 'application/x-gzip'; + break; + + case 0x4b50: + // First two bytes of zip files are 0x50, 0x4b ('PK') (little-endian). + // See http://en.wikipedia.org/wiki/Zip_(file_format)#File_headers + $content_type = 'application/zip'; + break; + + case 0x5a42: + // First two bytes of bzip2 files are 0x5a, 0x42 ('BZ') (big-endian). + // See http://en.wikipedia.org/wiki/Bzip2#File_format + $content_type = 'application/x-bzip2'; + break; + } + } + } + } + // 3. Lastly if above methods didn't work, try to guess the mime type from + // the file extension. This is useful if the file has no identificable magic + // header bytes (for example tarballs). + if (!$content_type) { + // Remove querystring from the filename, if present. + $filename = basename(current(explode('?', $filename, 2))); + $extension_mimetype = array( + '.tar.gz' => 'application/x-gzip', + '.tgz' => 'application/x-gzip', + '.tar' => 'application/x-tar', + ); + foreach ($extension_mimetype as $extension => $ct) { + if (substr($filename, -strlen($extension)) === $extension) { + $content_type = $ct; + break; + } + } + } + + return $content_type; + } + + /** + * @return string + */ + protected static function getTmpDir() + { + return getcwd().'/tmp'.rand().time(); + } +} diff --git a/vendor/consolidation/robo/src/Task/Archive/Pack.php b/vendor/consolidation/robo/src/Task/Archive/Pack.php new file mode 100644 index 0000000000000000000000000000000000000000..0970f8e88e81272a352026318bbd1c40d4bf43ea --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Archive/Pack.php @@ -0,0 +1,257 @@ +<?php + +namespace Robo\Task\Archive; + +use Robo\Contract\PrintedInterface; +use Robo\Result; +use Robo\Task\BaseTask; +use Symfony\Component\Finder\Finder; + +/** + * Creates a zip or tar archive. + * + * ``` php + * <?php + * $this->taskPack( + * <archiveFile>) + * ->add('README') // Puts file 'README' in archive at the root + * ->add('project') // Puts entire contents of directory 'project' in archinve inside 'project' + * ->addFile('dir/file.txt', 'file.txt') // Takes 'file.txt' from cwd and puts it in archive inside 'dir'. + * ->run(); + * ?> + * ``` + */ +class Pack extends BaseTask implements PrintedInterface +{ + /** + * The list of items to be packed into the archive. + * + * @var array + */ + private $items = []; + + /** + * The full path to the archive to be created. + * + * @var string + */ + private $archiveFile; + + /** + * Construct the class. + * + * @param string $archiveFile The full path and name of the archive file to create. + * + * @since 1.0 + */ + public function __construct($archiveFile) + { + $this->archiveFile = $archiveFile; + } + + /** + * Satisfy the parent requirement. + * + * @return bool Always returns true. + * + * @since 1.0 + */ + public function getPrinted() + { + return true; + } + + /** + * @param string $archiveFile + * + * @return $this + */ + public function archiveFile($archiveFile) + { + $this->archiveFile = $archiveFile; + return $this; + } + + /** + * Add an item to the archive. Like file_exists(), the parameter + * may be a file or a directory. + * + * @var string + * Relative path and name of item to store in archive + * @var string + * Absolute or relative path to file or directory's location in filesystem + * + * @return $this + */ + public function addFile($placementLocation, $filesystemLocation) + { + $this->items[$placementLocation] = $filesystemLocation; + + return $this; + } + + /** + * Alias for addFile, in case anyone has angst about using + * addFile with a directory. + * + * @var string + * Relative path and name of directory to store in archive + * @var string + * Absolute or relative path to directory or directory's location in filesystem + * + * @return $this + */ + public function addDir($placementLocation, $filesystemLocation) + { + $this->addFile($placementLocation, $filesystemLocation); + + return $this; + } + + /** + * Add a file or directory, or list of same to the archive. + * + * @var string|array + * If given a string, should contain the relative filesystem path to the + * the item to store in archive; this will also be used as the item's + * path in the archive, so absolute paths should not be used here. + * If given an array, the key of each item should be the path to store + * in the archive, and the value should be the filesystem path to the + * item to store. + * @return $this + */ + public function add($item) + { + if (is_array($item)) { + $this->items = array_merge($this->items, $item); + } else { + $this->addFile($item, $item); + } + + return $this; + } + + /** + * Create a zip archive for distribution. + * + * @return \Robo\Result + * + * @since 1.0 + */ + public function run() + { + $this->startTimer(); + + // Use the file extension to determine what kind of archive to create. + $fileInfo = new \SplFileInfo($this->archiveFile); + $extension = strtolower($fileInfo->getExtension()); + if (empty($extension)) { + return Result::error($this, "Archive filename must use an extension (e.g. '.zip') to specify the kind of archive to create."); + } + + try { + // Inform the user which archive we are creating + $this->printTaskInfo("Creating archive {filename}", ['filename' => $this->archiveFile]); + if ($extension == 'zip') { + $result = $this->archiveZip($this->archiveFile, $this->items); + } else { + $result = $this->archiveTar($this->archiveFile, $this->items); + } + $this->printTaskSuccess("{filename} created.", ['filename' => $this->archiveFile]); + } catch (\Exception $e) { + $this->printTaskError("Could not create {filename}. {exception}", ['filename' => $this->archiveFile, 'exception' => $e->getMessage(), '_style' => ['exception' => '']]); + $result = Result::error($this, sprintf('Could not create %s. %s', $this->archiveFile, $e->getMessage())); + } + $this->stopTimer(); + $result['time'] = $this->getExecutionTime(); + + return $result; + } + + /** + * @param string $archiveFile + * @param array $items + * + * @return \Robo\Result + */ + protected function archiveTar($archiveFile, $items) + { + if (!class_exists('Archive_Tar')) { + return Result::errorMissingPackage($this, 'Archive_Tar', 'pear/archive_tar'); + } + + $tar_object = new \Archive_Tar($archiveFile); + foreach ($items as $placementLocation => $filesystemLocation) { + $p_remove_dir = $filesystemLocation; + $p_add_dir = $placementLocation; + if (is_file($filesystemLocation)) { + $p_remove_dir = dirname($filesystemLocation); + $p_add_dir = dirname($placementLocation); + if (basename($filesystemLocation) != basename($placementLocation)) { + return Result::error($this, "Tar archiver does not support renaming files during extraction; could not add $filesystemLocation as $placementLocation."); + } + } + + if (!$tar_object->addModify([$filesystemLocation], $p_add_dir, $p_remove_dir)) { + return Result::error($this, "Could not add $filesystemLocation to the archive."); + } + } + + return Result::success($this); + } + + /** + * @param string $archiveFile + * @param array $items + * + * @return \Robo\Result + */ + protected function archiveZip($archiveFile, $items) + { + if (!extension_loaded('zlib')) { + return Result::errorMissingExtension($this, 'zlib', 'zip packing'); + } + + $zip = new \ZipArchive($archiveFile, \ZipArchive::CREATE); + if (!$zip->open($archiveFile, \ZipArchive::CREATE)) { + return Result::error($this, "Could not create zip archive {$archiveFile}"); + } + $result = $this->addItemsToZip($zip, $items); + $zip->close(); + + return $result; + } + + /** + * @param \ZipArchive $zip + * @param array $items + * + * @return \Robo\Result + */ + protected function addItemsToZip($zip, $items) + { + foreach ($items as $placementLocation => $filesystemLocation) { + if (is_dir($filesystemLocation)) { + $finder = new Finder(); + $finder->files()->in($filesystemLocation)->ignoreDotFiles(false); + + foreach ($finder as $file) { + // Replace Windows slashes or resulting zip will have issues on *nixes. + $relativePathname = str_replace('\\', '/', $file->getRelativePathname()); + + if (!$zip->addFile($file->getRealpath(), "{$placementLocation}/{$relativePathname}")) { + return Result::error($this, "Could not add directory $filesystemLocation to the archive; error adding {$file->getRealpath()}."); + } + } + } elseif (is_file($filesystemLocation)) { + if (!$zip->addFile($filesystemLocation, $placementLocation)) { + return Result::error($this, "Could not add file $filesystemLocation to the archive."); + } + } else { + return Result::error($this, "Could not find $filesystemLocation for the archive."); + } + } + + return Result::success($this); + } +} diff --git a/vendor/consolidation/robo/src/Task/Archive/loadTasks.php b/vendor/consolidation/robo/src/Task/Archive/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..cf846fdf82adb30315738124e0f9b0bccf90c0be --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Archive/loadTasks.php @@ -0,0 +1,25 @@ +<?php +namespace Robo\Task\Archive; + +trait loadTasks +{ + /** + * @param $filename + * + * @return Pack + */ + protected function taskPack($filename) + { + return $this->task(Pack::class, $filename); + } + + /** + * @param $filename + * + * @return Extract + */ + protected function taskExtract($filename) + { + return $this->task(Extract::class, $filename); + } +} diff --git a/vendor/consolidation/robo/src/Task/Assets/CssPreprocessor.php b/vendor/consolidation/robo/src/Task/Assets/CssPreprocessor.php new file mode 100644 index 0000000000000000000000000000000000000000..a15d20784ec9a91b01816e8578ff34520ba762b9 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Assets/CssPreprocessor.php @@ -0,0 +1,214 @@ +<?php + +namespace Robo\Task\Assets; + +use Robo\Result; +use Robo\Task\BaseTask; + +abstract class CssPreprocessor extends BaseTask +{ + const FORMAT_NAME = ''; + + /** + * Default compiler to use. + * + * @var string + */ + protected $compiler; + + /** + * Available compilers list + * + * @var string[] + */ + protected $compilers = []; + + /** + * Compiler options. + * + * @var array + */ + protected $compilerOptions = []; + + /** + * @var array + */ + protected $files = []; + + /** + * Constructor. Accepts array of file paths. + * + * @param array $input + */ + public function __construct(array $input) + { + $this->files = $input; + + $this->setDefaultCompiler(); + } + + protected function setDefaultCompiler() + { + if (isset($this->compilers[0])) { + //set first compiler as default + $this->compiler = $this->compilers[0]; + } + } + + /** + * Sets import directories + * Alias for setImportPaths + * @see CssPreprocessor::setImportPaths + * + * @param array|string $dirs + * + * @return $this + */ + public function importDir($dirs) + { + return $this->setImportPaths($dirs); + } + + /** + * Adds import directory + * + * @param string $dir + * + * @return $this + */ + public function addImportPath($dir) + { + if (!isset($this->compilerOptions['importDirs'])) { + $this->compilerOptions['importDirs'] = []; + } + + if (!in_array($dir, $this->compilerOptions['importDirs'], true)) { + $this->compilerOptions['importDirs'][] = $dir; + } + + return $this; + } + + /** + * Sets import directories + * + * @param array|string $dirs + * + * @return $this + */ + public function setImportPaths($dirs) + { + if (!is_array($dirs)) { + $dirs = [$dirs]; + } + + $this->compilerOptions['importDirs'] = $dirs; + + return $this; + } + + /** + * @param string $formatterName + * + * @return $this + */ + public function setFormatter($formatterName) + { + $this->compilerOptions['formatter'] = $formatterName; + + return $this; + } + + /** + * Sets the compiler. + * + * @param string $compiler + * @param array $options + * + * @return $this + */ + public function compiler($compiler, array $options = []) + { + $this->compiler = $compiler; + $this->compilerOptions = array_merge($this->compilerOptions, $options); + + return $this; + } + + /** + * Compiles file + * + * @param $file + * + * @return bool|mixed + */ + protected function compile($file) + { + if (is_callable($this->compiler)) { + return call_user_func($this->compiler, $file, $this->compilerOptions); + } + + if (method_exists($this, $this->compiler)) { + return $this->{$this->compiler}($file); + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function run() + { + if (!in_array($this->compiler, $this->compilers, true) + && !is_callable($this->compiler) + ) { + $message = sprintf('Invalid ' . static::FORMAT_NAME . ' compiler %s!', $this->compiler); + + return Result::error($this, $message); + } + + foreach ($this->files as $in => $out) { + if (!file_exists($in)) { + $message = sprintf('File %s not found.', $in); + + return Result::error($this, $message); + } + if (file_exists($out) && !is_writable($out)) { + return Result::error($this, 'Destination already exists and cannot be overwritten.'); + } + } + + foreach ($this->files as $in => $out) { + $css = $this->compile($in); + + if ($css instanceof Result) { + return $css; + } elseif (false === $css) { + $message = sprintf( + ucfirst(static::FORMAT_NAME) . ' compilation failed for %s.', + $in + ); + + return Result::error($this, $message); + } + + $dst = $out . '.part'; + $write_result = file_put_contents($dst, $css); + + if (false === $write_result) { + $message = sprintf('File write failed: %s', $out); + + @unlink($dst); + return Result::error($this, $message); + } + + // Cannot be cross-volume: should always succeed + @rename($dst, $out); + + $this->printTaskSuccess('Wrote CSS to {filename}', ['filename' => $out]); + } + + return Result::success($this, 'All ' . static::FORMAT_NAME . ' files compiled.'); + } +} diff --git a/vendor/consolidation/robo/src/Task/Assets/ImageMinify.php b/vendor/consolidation/robo/src/Task/Assets/ImageMinify.php new file mode 100644 index 0000000000000000000000000000000000000000..1aa625932fcdbb53280af20923f9e1ccac9f3df4 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Assets/ImageMinify.php @@ -0,0 +1,716 @@ +<?php + +namespace Robo\Task\Assets; + +use Robo\Result; +use Robo\Exception\TaskException; +use Robo\Task\BaseTask; +use Robo\Task\Base\Exec; +use Symfony\Component\Finder\Finder; +use Symfony\Component\Filesystem\Filesystem as sfFilesystem; + +/** + * Minifies images. When the required minifier is not installed on the system + * the task will try to download it from the [imagemin](https://github.com/imagemin) repository. + * + * When the task is run without any specified minifier it will compress the images + * based on the extension. + * + * ```php + * $this->taskImageMinify('assets/images/*') + * ->to('dist/images/') + * ->run(); + * ``` + * + * This will use the following minifiers: + * + * - PNG: optipng + * - GIF: gifsicle + * - JPG, JPEG: jpegtran + * - SVG: svgo + * + * When the minifier is specified the task will use that for all the input files. In that case + * it is useful to filter the files with the extension: + * + * ```php + * $this->taskImageMinify('assets/images/*.png') + * ->to('dist/images/') + * ->minifier('pngcrush'); + * ->run(); + * ``` + * + * The task supports the following minifiers: + * + * - optipng + * - pngquant + * - advpng + * - pngout + * - zopflipng + * - pngcrush + * - gifsicle + * - jpegoptim + * - jpeg-recompress + * - jpegtran + * - svgo (only minification, no downloading) + * + * You can also specifiy extra options for the minifiers: + * + * ```php + * $this->taskImageMinify('assets/images/*.jpg') + * ->to('dist/images/') + * ->minifier('jpegtran', ['-progressive' => null, '-copy' => 'none']) + * ->run(); + * ``` + * + * This will execute as: + * `jpegtran -copy none -progressive -optimize -outfile "dist/images/test.jpg" "/var/www/test/assets/images/test.jpg"` + */ +class ImageMinify extends BaseTask +{ + /** + * Destination directory for the minified images. + * + * @var string + */ + protected $to; + + /** + * Array of the source files. + * + * @var array + */ + protected $dirs = []; + + /** + * Symfony 2 filesystem. + * + * @var sfFilesystem + */ + protected $fs; + + /** + * Target directory for the downloaded binary executables. + * + * @var string + */ + protected $executableTargetDir; + + /** + * Array for the downloaded binary executables. + * + * @var array + */ + protected $executablePaths = []; + + /** + * Array for the individual results of all the files. + * + * @var array + */ + protected $results = []; + + /** + * Default minifier to use. + * + * @var string + */ + protected $minifier; + + /** + * Array for minifier options. + * + * @var array + */ + protected $minifierOptions = []; + + /** + * Supported minifiers. + * + * @var array + */ + protected $minifiers = [ + // Default 4 + 'optipng', + 'gifsicle', + 'jpegtran', + 'svgo', + // PNG + 'pngquant', + 'advpng', + 'pngout', + 'zopflipng', + 'pngcrush', + // JPG + 'jpegoptim', + 'jpeg-recompress', + ]; + + /** + * Binary repositories of Imagemin. + * + * @link https://github.com/imagemin + * + * @var array + */ + protected $imageminRepos = [ + // PNG + 'optipng' => 'https://github.com/imagemin/optipng-bin', + 'pngquant' => 'https://github.com/imagemin/pngquant-bin', + 'advpng' => 'https://github.com/imagemin/advpng-bin', + 'pngout' => 'https://github.com/imagemin/pngout-bin', + 'zopflipng' => 'https://github.com/imagemin/zopflipng-bin', + 'pngcrush' => 'https://github.com/imagemin/pngcrush-bin', + // Gif + 'gifsicle' => 'https://github.com/imagemin/gifsicle-bin', + // JPG + 'jpegtran' => 'https://github.com/imagemin/jpegtran-bin', + 'jpegoptim' => 'https://github.com/imagemin/jpegoptim-bin', + 'cjpeg' => 'https://github.com/imagemin/mozjpeg-bin', // note: we do not support this minifier because it creates JPG from non-JPG files + 'jpeg-recompress' => 'https://github.com/imagemin/jpeg-recompress-bin', + // WebP + 'cwebp' => 'https://github.com/imagemin/cwebp-bin', // note: we do not support this minifier because it creates WebP from non-WebP files + ]; + + public function __construct($dirs) + { + is_array($dirs) + ? $this->dirs = $dirs + : $this->dirs[] = $dirs; + + $this->fs = new sfFilesystem(); + + // guess the best path for the executables based on __DIR__ + if (($pos = strpos(__DIR__, 'consolidation/robo')) !== false) { + // the executables should be stored in vendor/bin + $this->executableTargetDir = substr(__DIR__, 0, $pos).'bin'; + } + + // check if the executables are already available + foreach ($this->imageminRepos as $exec => $url) { + $path = $this->executableTargetDir.'/'.$exec; + // if this is Windows add a .exe extension + if (substr($this->getOS(), 0, 3) == 'win') { + $path .= '.exe'; + } + if (is_file($path)) { + $this->executablePaths[$exec] = $path; + } + } + } + + /** + * {@inheritdoc} + */ + public function run() + { + // find the files + $files = $this->findFiles($this->dirs); + + // minify the files + $result = $this->minify($files); + // check if there was an error + if ($result instanceof Result) { + return $result; + } + + $amount = (count($files) == 1 ? 'image' : 'images'); + $message = "Minified {filecount} out of {filetotal} $amount into {destination}"; + $context = ['filecount' => count($this->results['success']), 'filetotal' => count($files), 'destination' => $this->to]; + + if (count($this->results['success']) == count($files)) { + $this->printTaskSuccess($message, $context); + + return Result::success($this, $message, $context); + } else { + return Result::error($this, $message, $context); + } + } + + /** + * Sets the target directory where the files will be copied to. + * + * @param string $target + * + * @return $this + */ + public function to($target) + { + $this->to = rtrim($target, '/'); + + return $this; + } + + /** + * Sets the minifier. + * + * @param string $minifier + * @param array $options + * + * @return $this + */ + public function minifier($minifier, array $options = []) + { + $this->minifier = $minifier; + $this->minifierOptions = array_merge($this->minifierOptions, $options); + + return $this; + } + + /** + * @param array $dirs + * + * @return array|\Robo\Result + * + * @throws \Robo\Exception\TaskException + */ + protected function findFiles($dirs) + { + $files = array(); + + // find the files + foreach ($dirs as $k => $v) { + // reset finder + $finder = new Finder(); + + $dir = $k; + $to = $v; + // check if target was given with the to() method instead of key/value pairs + if (is_int($k)) { + $dir = $v; + if (isset($this->to)) { + $to = $this->to; + } else { + throw new TaskException($this, 'target directory is not defined'); + } + } + + try { + $finder->files()->in($dir); + } catch (\InvalidArgumentException $e) { + // if finder cannot handle it, try with in()->name() + if (strpos($dir, '/') === false) { + $dir = './'.$dir; + } + $parts = explode('/', $dir); + $new_dir = implode('/', array_slice($parts, 0, -1)); + try { + $finder->files()->in($new_dir)->name(array_pop($parts)); + } catch (\InvalidArgumentException $e) { + return Result::fromException($this, $e); + } + } + + foreach ($finder as $file) { + // store the absolute path as key and target as value in the files array + $files[$file->getRealpath()] = $this->getTarget($file->getRealPath(), $to); + } + $fileNoun = count($finder) == 1 ? ' file' : ' files'; + $this->printTaskInfo("Found {filecount} $fileNoun in {dir}", ['filecount' => count($finder), 'dir' => $dir]); + } + + return $files; + } + + /** + * @param string $file + * @param string $to + * + * @return string + */ + protected function getTarget($file, $to) + { + $target = $to.'/'.basename($file); + + return $target; + } + + /** + * @param array $files + * + * @return \Robo\Result + */ + protected function minify($files) + { + // store the individual results into the results array + $this->results = [ + 'success' => [], + 'error' => [], + ]; + + // loop through the files + foreach ($files as $from => $to) { + if (!isset($this->minifier)) { + // check filetype based on the extension + $extension = strtolower(pathinfo($from, PATHINFO_EXTENSION)); + + // set the default minifiers based on the extension + switch ($extension) { + case 'png': + $minifier = 'optipng'; + break; + case 'jpg': + case 'jpeg': + $minifier = 'jpegtran'; + break; + case 'gif': + $minifier = 'gifsicle'; + break; + case 'svg': + $minifier = 'svgo'; + break; + } + } else { + if (!in_array($this->minifier, $this->minifiers, true) + && !is_callable(strtr($this->minifier, '-', '_')) + ) { + $message = sprintf('Invalid minifier %s!', $this->minifier); + + return Result::error($this, $message); + } + $minifier = $this->minifier; + } + + // Convert minifier name to camelCase (e.g. jpeg-recompress) + $funcMinifier = $this->camelCase($minifier); + + // call the minifier method which prepares the command + if (is_callable($funcMinifier)) { + $command = call_user_func($funcMinifier, $from, $to, $this->minifierOptions); + } elseif (method_exists($this, $funcMinifier)) { + $command = $this->{$funcMinifier}($from, $to); + } else { + $message = sprintf('Minifier method <info>%s</info> cannot be found!', $funcMinifier); + + return Result::error($this, $message); + } + + // launch the command + $this->printTaskInfo('Minifying {filepath} with {minifier}', ['filepath' => $from, 'minifier' => $minifier]); + $result = $this->executeCommand($command); + + // check the return code + if ($result->getExitCode() == 127) { + $this->printTaskError('The {minifier} executable cannot be found', ['minifier' => $minifier]); + // try to install from imagemin repository + if (array_key_exists($minifier, $this->imageminRepos)) { + $result = $this->installFromImagemin($minifier); + if ($result instanceof Result) { + if ($result->wasSuccessful()) { + $this->printTaskSuccess($result->getMessage()); + // retry the conversion with the downloaded executable + if (is_callable($minifier)) { + $command = call_user_func($minifier, $from, $to, $minifierOptions); + } elseif (method_exists($this, $minifier)) { + $command = $this->{$minifier}($from, $to); + } + // launch the command + $this->printTaskInfo('Minifying {filepath} with {minifier}', ['filepath' => $from, 'minifier' => $minifier]); + $result = $this->executeCommand($command); + } else { + $this->printTaskError($result->getMessage()); + // the download was not successful + return $result; + } + } + } else { + return $result; + } + } + + // check the success of the conversion + if ($result->getExitCode() !== 0) { + $this->results['error'][] = $from; + } else { + $this->results['success'][] = $from; + } + } + } + + /** + * @return string + */ + protected function getOS() + { + $os = php_uname('s'); + $os .= '/'.php_uname('m'); + // replace x86_64 to x64, because the imagemin repo uses that + $os = str_replace('x86_64', 'x64', $os); + // replace i386, i686, etc to x86, because of imagemin + $os = preg_replace('/i[0-9]86/', 'x86', $os); + // turn info to lowercase, because of imagemin + $os = strtolower($os); + + return $os; + } + + /** + * @param string $command + * + * @return \Robo\Result + */ + protected function executeCommand($command) + { + // insert the options into the command + $a = explode(' ', $command); + $executable = array_shift($a); + foreach ($this->minifierOptions as $key => $value) { + // first prepend the value + if (!empty($value)) { + array_unshift($a, $value); + } + // then add the key + if (!is_numeric($key)) { + array_unshift($a, $key); + } + } + // check if the executable can be replaced with the downloaded one + if (array_key_exists($executable, $this->executablePaths)) { + $executable = $this->executablePaths[$executable]; + } + array_unshift($a, $executable); + $command = implode(' ', $a); + + // execute the command + $exec = new Exec($command); + + return $exec->inflect($this)->printed(false)->run(); + } + + /** + * @param string $executable + * + * @return \Robo\Result + */ + protected function installFromImagemin($executable) + { + // check if there is an url defined for the executable + if (!array_key_exists($executable, $this->imageminRepos)) { + $message = sprintf('The executable %s cannot be found in the defined imagemin repositories', $executable); + + return Result::error($this, $message); + } + $this->printTaskInfo('Downloading the {executable} executable from the imagemin repository', ['executable' => $executable]); + + $os = $this->getOS(); + $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'?raw=true'; + if (substr($os, 0, 3) == 'win') { + // if it is win, add a .exe extension + $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'.exe?raw=true'; + } + $data = @file_get_contents($url, false, null); + if ($data === false) { + // there is something wrong with the url, try it without the version info + $url = preg_replace('/x[68][64]\//', '', $url); + $data = @file_get_contents($url, false, null); + if ($data === false) { + // there is still something wrong with the url if it is win, try with win32 + if (substr($os, 0, 3) == 'win') { + $url = preg_replace('win/', 'win32/', $url); + $data = @file_get_contents($url, false, null); + if ($data === false) { + // there is nothing more we can do + $message = sprintf('Could not download the executable <info>%s</info>', $executable); + + return Result::error($this, $message); + } + } + // if it is not windows there is nothing we can do + $message = sprintf('Could not download the executable <info>%s</info>', $executable); + + return Result::error($this, $message); + } + } + // check if target directory exists + if (!is_dir($this->executableTargetDir)) { + mkdir($this->executableTargetDir); + } + // save the executable into the target dir + $path = $this->executableTargetDir.'/'.$executable; + if (substr($os, 0, 3) == 'win') { + // if it is win, add a .exe extension + $path = $this->executableTargetDir.'/'.$executable.'.exe'; + } + $result = file_put_contents($path, $data); + if ($result === false) { + $message = sprintf('Could not copy the executable <info>%s</info> to %s', $executable, $target_dir); + + return Result::error($this, $message); + } + // set the binary to executable + chmod($path, 0755); + + // if everything successful, store the executable path + $this->executablePaths[$executable] = $this->executableTargetDir.'/'.$executable; + // if it is win, add a .exe extension + if (substr($os, 0, 3) == 'win') { + $this->executablePaths[$executable] .= '.exe'; + } + + $message = sprintf('Executable <info>%s</info> successfully downloaded', $executable); + + return Result::success($this, $message); + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function optipng($from, $to) + { + $command = sprintf('optipng -quiet -out "%s" -- "%s"', $to, $from); + if ($from != $to && is_file($to)) { + // earlier versions of optipng do not overwrite the target without a backup + // http://sourceforge.net/p/optipng/bugs/37/ + unlink($to); + } + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function jpegtran($from, $to) + { + $command = sprintf('jpegtran -optimize -outfile "%s" "%s"', $to, $from); + + return $command; + } + + protected function gifsicle($from, $to) + { + $command = sprintf('gifsicle -o "%s" "%s"', $to, $from); + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function svgo($from, $to) + { + $command = sprintf('svgo "%s" "%s"', $from, $to); + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function pngquant($from, $to) + { + $command = sprintf('pngquant --force --output "%s" "%s"', $to, $from); + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function advpng($from, $to) + { + // advpng does not have any output parameters, copy the file and then compress the copy + $command = sprintf('advpng --recompress --quiet "%s"', $to); + $this->fs->copy($from, $to, true); + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function pngout($from, $to) + { + $command = sprintf('pngout -y -q "%s" "%s"', $from, $to); + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function zopflipng($from, $to) + { + $command = sprintf('zopflipng -y "%s" "%s"', $from, $to); + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function pngcrush($from, $to) + { + $command = sprintf('pngcrush -q -ow "%s" "%s"', $from, $to); + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function jpegoptim($from, $to) + { + // jpegoptim only takes the destination directory as an argument + $command = sprintf('jpegoptim --quiet -o --dest "%s" "%s"', dirname($to), $from); + + return $command; + } + + /** + * @param string $from + * @param string $to + * + * @return string + */ + protected function jpegRecompress($from, $to) + { + $command = sprintf('jpeg-recompress --quiet "%s" "%s"', $from, $to); + + return $command; + } + + /** + * @param string $text + * + * @return string + */ + public static function camelCase($text) + { + // non-alpha and non-numeric characters become spaces + $text = preg_replace('/[^a-z0-9]+/i', ' ', $text); + $text = trim($text); + // uppercase the first character of each word + $text = ucwords($text); + $text = str_replace(" ", "", $text); + $text = lcfirst($text); + + return $text; + } +} diff --git a/vendor/consolidation/robo/src/Task/Assets/Less.php b/vendor/consolidation/robo/src/Task/Assets/Less.php new file mode 100644 index 0000000000000000000000000000000000000000..4cfa097802c68fb2f0453cb4050312b209440293 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Assets/Less.php @@ -0,0 +1,108 @@ +<?php +namespace Robo\Task\Assets; + +use Robo\Result; + +/** + * Compiles less files. + * + * ```php + * <?php + * $this->taskLess([ + * 'less/default.less' => 'css/default.css' + * ]) + * ->run(); + * ?> + * ``` + * + * Use one of both less compilers in your project: + * + * ``` + * "leafo/lessphp": "~0.5", + * "oyejorge/less.php": "~1.5" + * ``` + * + * Specify directory (string or array) for less imports lookup: + * + * ```php + * <?php + * $this->taskLess([ + * 'less/default.less' => 'css/default.css' + * ]) + * ->importDir('less') + * ->compiler('lessphp') + * ->run(); + * ?> + * ``` + * + * You can implement additional compilers by extending this task and adding a + * method named after them and overloading the lessCompilers() method to + * inject the name there. + */ +class Less extends CssPreprocessor +{ + const FORMAT_NAME = 'less'; + + /** + * @var string[] + */ + protected $compilers = [ + 'less', // https://github.com/oyejorge/less.php + 'lessphp', //https://github.com/leafo/lessphp + ]; + + /** + * lessphp compiler + * @link https://github.com/leafo/lessphp + * + * @param string $file + * + * @return string + */ + protected function lessphp($file) + { + if (!class_exists('\lessc')) { + return Result::errorMissingPackage($this, 'lessc', 'leafo/lessphp'); + } + + $lessCode = file_get_contents($file); + + $less = new \lessc(); + if (isset($this->compilerOptions['importDirs'])) { + $less->setImportDir($this->compilerOptions['importDirs']); + } + + return $less->compile($lessCode); + } + + /** + * less compiler + * @link https://github.com/oyejorge/less.php + * + * @param string $file + * + * @return string + */ + protected function less($file) + { + if (!class_exists('\Less_Parser')) { + return Result::errorMissingPackage($this, 'Less_Parser', 'oyejorge/less.php'); + } + + $lessCode = file_get_contents($file); + + $parser = new \Less_Parser(); + $parser->SetOptions($this->compilerOptions); + if (isset($this->compilerOptions['importDirs'])) { + $importDirs = []; + foreach ($this->compilerOptions['importDirs'] as $dir) { + $importDirs[$dir] = $dir; + } + $parser->SetImportDirs($importDirs); + } + + $parser->parse($lessCode); + + return $parser->getCss(); + } +} diff --git a/vendor/consolidation/robo/src/Task/Assets/Minify.php b/vendor/consolidation/robo/src/Task/Assets/Minify.php new file mode 100644 index 0000000000000000000000000000000000000000..3187714ecc02c867ace50db3b6713b7fec00b74f --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Assets/Minify.php @@ -0,0 +1,297 @@ +<?php +namespace Robo\Task\Assets; + +use Robo\Result; +use Robo\Task\BaseTask; + +/** + * Minifies asset file (CSS or JS). + * + * ``` php + * <?php + * $this->taskMinify( 'web/assets/theme.css' ) + * ->run() + * ?> + * ``` + * Please install additional dependencies to use: + * + * ``` + * "patchwork/jsqueeze": "~1.0", + * "natxet/CssMin": "~3.0" + * ``` + */ +class Minify extends BaseTask +{ + /** + * @var array + */ + protected $types = ['css', 'js']; + + /** + * @var string + */ + protected $text; + + /** + * @var string + */ + protected $dst; + + /** + * @var string + */ + protected $type; + + /** + * @var array + */ + protected $squeezeOptions = [ + 'singleLine' => true, + 'keepImportantComments' => true, + 'specialVarRx' => false, + ]; + + /** + * Constructor. Accepts asset file path or string source. + * + * @param string $input + */ + public function __construct($input) + { + if (file_exists($input)) { + $this->fromFile($input); + return; + } + + $this->fromText($input); + } + + /** + * Sets destination. Tries to guess type from it. + * + * @param string $dst + * + * @return $this + */ + public function to($dst) + { + $this->dst = $dst; + + if (!empty($this->dst) && empty($this->type)) { + $this->type($this->getExtension($this->dst)); + } + + return $this; + } + + /** + * Sets type with validation. + * + * @param string $type css|js + * + * @return $this + */ + public function type($type) + { + $type = strtolower($type); + + if (in_array($type, $this->types)) { + $this->type = $type; + } + + return $this; + } + + /** + * Sets text from string source. + * + * @param string $text + * + * @return $this + */ + protected function fromText($text) + { + $this->text = (string)$text; + unset($this->type); + + return $this; + } + + /** + * Sets text from asset file path. Tries to guess type and set default destination. + * + * @param string $path + * + * @return $this + */ + protected function fromFile($path) + { + $this->text = file_get_contents($path); + + unset($this->type); + $this->type($this->getExtension($path)); + + if (empty($this->dst) && !empty($this->type)) { + $ext_length = strlen($this->type) + 1; + $this->dst = substr($path, 0, -$ext_length) . '.min.' . $this->type; + } + + return $this; + } + + /** + * Gets file extension from path. + * + * @param string $path + * + * @return string + */ + protected function getExtension($path) + { + return pathinfo($path, PATHINFO_EXTENSION); + } + + /** + * Minifies and returns text. + * + * @return string|bool + */ + protected function getMinifiedText() + { + switch ($this->type) { + case 'css': + if (!class_exists('\CssMin')) { + return Result::errorMissingPackage($this, 'CssMin', 'natxet/CssMin'); + } + + return \CssMin::minify($this->text); + break; + + case 'js': + if (!class_exists('\JSqueeze') && !class_exists('\Patchwork\JSqueeze')) { + return Result::errorMissingPackage($this, 'Patchwork\JSqueeze', 'patchwork/jsqueeze'); + } + + if (class_exists('\JSqueeze')) { + $jsqueeze = new \JSqueeze(); + } else { + $jsqueeze = new \Patchwork\JSqueeze(); + } + + return $jsqueeze->squeeze( + $this->text, + $this->squeezeOptions['singleLine'], + $this->squeezeOptions['keepImportantComments'], + $this->squeezeOptions['specialVarRx'] + ); + break; + } + + return false; + } + + /** + * Single line option for the JS minimisation. + * + * @param bool $singleLine + * + * @return $this + */ + public function singleLine($singleLine) + { + $this->squeezeOptions['singleLine'] = (bool)$singleLine; + return $this; + } + + /** + * keepImportantComments option for the JS minimisation. + * + * @param bool $keepImportantComments + * + * @return $this + */ + public function keepImportantComments($keepImportantComments) + { + $this->squeezeOptions['keepImportantComments'] = (bool)$keepImportantComments; + return $this; + } + + /** + * specialVarRx option for the JS minimisation. + * + * @param bool $specialVarRx + * + * @return $this ; + */ + public function specialVarRx($specialVarRx) + { + $this->squeezeOptions['specialVarRx'] = (bool)$specialVarRx; + return $this; + } + + /** + * @return string + */ + public function __toString() + { + return (string) $this->getMinifiedText(); + } + + /** + * {@inheritdoc} + */ + public function run() + { + if (empty($this->type)) { + return Result::error($this, 'Unknown asset type.'); + } + + if (empty($this->dst)) { + return Result::error($this, 'Unknown file destination.'); + } + + if (file_exists($this->dst) && !is_writable($this->dst)) { + return Result::error($this, 'Destination already exists and cannot be overwritten.'); + } + + $size_before = strlen($this->text); + $minified = $this->getMinifiedText(); + + if ($minified instanceof Result) { + return $minified; + } elseif (false === $minified) { + return Result::error($this, 'Minification failed.'); + } + + $size_after = strlen($minified); + + // Minification did not reduce file size, so use original file. + if ($size_after > $size_before) { + $minified = $this->text; + $size_after = $size_before; + } + + $dst = $this->dst . '.part'; + $write_result = file_put_contents($dst, $minified); + + if (false === $write_result) { + @unlink($dst); + return Result::error($this, 'File write failed.'); + } + // Cannot be cross-volume; should always succeed. + @rename($dst, $this->dst); + if ($size_before === 0) { + $minified_percent = 0; + } else { + $minified_percent = number_format(100 - ($size_after / $size_before * 100), 1); + } + $this->printTaskSuccess('Wrote {filepath}', ['filepath' => $this->dst]); + $context = [ + 'bytes' => $this->formatBytes($size_after), + 'reduction' => $this->formatBytes(($size_before - $size_after)), + 'percentage' => $minified_percent, + ]; + $this->printTaskSuccess('Wrote {bytes} (reduced by {reduction} / {percentage})', $context); + return Result::success($this, 'Asset minified.'); + } +} diff --git a/vendor/consolidation/robo/src/Task/Assets/Scss.php b/vendor/consolidation/robo/src/Task/Assets/Scss.php new file mode 100644 index 0000000000000000000000000000000000000000..ffd39345a05966c6b8a25a72f865db2fc1c35de1 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Assets/Scss.php @@ -0,0 +1,93 @@ +<?php +namespace Robo\Task\Assets; + +use Robo\Result; + +/** + * Compiles scss files. + * + * ```php + * <?php + * $this->taskScss([ + * 'scss/default.scss' => 'css/default.css' + * ]) + * ->importDir('assets/styles') + * ->run(); + * ?> + * ``` + * + * Use the following scss compiler in your project: + * + * ``` + * "leafo/scssphp": "~0.1", + * ``` + * + * You can implement additional compilers by extending this task and adding a + * method named after them and overloading the scssCompilers() method to + * inject the name there. + */ +class Scss extends CssPreprocessor +{ + const FORMAT_NAME = 'scss'; + + /** + * @var string[] + */ + protected $compilers = [ + 'scssphp', // https://github.com/leafo/scssphp + ]; + + /** + * scssphp compiler + * @link https://github.com/leafo/scssphp + * + * @param string $file + * + * @return string + */ + protected function scssphp($file) + { + if (!class_exists('\Leafo\ScssPhp\Compiler')) { + return Result::errorMissingPackage($this, 'scssphp', 'leafo/scssphp'); + } + + $scssCode = file_get_contents($file); + $scss = new \Leafo\ScssPhp\Compiler(); + + // set options for the scssphp compiler + if (isset($this->compilerOptions['importDirs'])) { + $scss->setImportPaths($this->compilerOptions['importDirs']); + } + + if (isset($this->compilerOptions['formatter'])) { + $scss->setFormatter($this->compilerOptions['formatter']); + } + + return $scss->compile($scssCode); + } + + /** + * Sets the formatter for scssphp + * + * The method setFormatter($formatterName) sets the current formatter to $formatterName, + * the name of a class as a string that implements the formatting interface. See the source + * for Leafo\ScssPhp\Formatter\Expanded for an example. + * + * Five formatters are included with leafo/scssphp: + * - Leafo\ScssPhp\Formatter\Expanded + * - Leafo\ScssPhp\Formatter\Nested (default) + * - Leafo\ScssPhp\Formatter\Compressed + * - Leafo\ScssPhp\Formatter\Compact + * - Leafo\ScssPhp\Formatter\Crunched + * + * @link http://leafo.github.io/scssphp/docs/#output-formatting + * + * @param string $formatterName + * + * @return $this + */ + public function setFormatter($formatterName) + { + return parent::setFormatter($formatterName); + } +} diff --git a/vendor/consolidation/robo/src/Task/Assets/loadTasks.php b/vendor/consolidation/robo/src/Task/Assets/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..12192dd804cdc6fbc3a9c3decd03e06d41e34a8d --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Assets/loadTasks.php @@ -0,0 +1,45 @@ +<?php +namespace Robo\Task\Assets; + +trait loadTasks +{ + /** + * @param string $input + * + * @return \Robo\Task\Assets\Minify + */ + protected function taskMinify($input) + { + return $this->task(Minify::class, $input); + } + + /** + * @param string|string[] $input + * + * @return \Robo\Task\Assets\ImageMinify + */ + protected function taskImageMinify($input) + { + return $this->task(ImageMinify::class, $input); + } + + /** + * @param array $input + * + * @return \Robo\Task\Assets\Less + */ + protected function taskLess($input) + { + return $this->task(Less::class, $input); + } + + /** + * @param array $input + * + * @return \Robo\Task\Assets\Scss + */ + protected function taskScss($input) + { + return $this->task(Scss::class, $input); + } +} diff --git a/vendor/consolidation/robo/src/Task/Base/Exec.php b/vendor/consolidation/robo/src/Task/Base/Exec.php new file mode 100644 index 0000000000000000000000000000000000000000..057c86a9bd280eef40b1f2101a7c7bb6f26729a3 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Base/Exec.php @@ -0,0 +1,127 @@ +<?php +namespace Robo\Task\Base; + +use Robo\Common\ExecTrait; +use Robo\Contract\CommandInterface; +use Robo\Contract\PrintedInterface; +use Robo\Contract\SimulatedInterface; +use Robo\Task\BaseTask; +use Symfony\Component\Process\Process; +use Robo\Result; + +/** + * Executes shell script. Closes it when running in background mode. + * + * ``` php + * <?php + * $this->taskExec('compass')->arg('watch')->run(); + * // or use shortcut + * $this->_exec('compass watch'); + * + * $this->taskExec('compass watch')->background()->run(); + * + * if ($this->taskExec('phpunit .')->run()->wasSuccessful()) { + * $this->say('tests passed'); + * } + * + * ?> + * ``` + */ +class Exec extends BaseTask implements CommandInterface, PrintedInterface, SimulatedInterface +{ + use \Robo\Common\CommandReceiver; + use \Robo\Common\ExecOneCommand; + + /** + * @var static[] + */ + protected static $instances = []; + + /** + * @var string|\Robo\Contract\CommandInterface + */ + protected $command; + + /** + * @param string|\Robo\Contract\CommandInterface $command + */ + public function __construct($command) + { + $this->command = $this->receiveCommand($command); + } + + /** + * + */ + public function __destruct() + { + $this->stop(); + } + + /** + * Executes command in background mode (asynchronously) + * + * @return $this + */ + public function background($arg = true) + { + self::$instances[] = $this; + $this->background = $arg; + return $this; + } + + /** + * {@inheritdoc} + */ + protected function getCommandDescription() + { + return $this->getCommand(); + } + /** + * {@inheritdoc} + */ + public function getCommand() + { + return trim($this->command . $this->arguments); + } + + /** + * {@inheritdoc} + */ + public function simulate($context) + { + $this->printAction($context); + } + + public static function stopRunningJobs() + { + foreach (self::$instances as $instance) { + if ($instance) { + unset($instance); + } + } + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->hideProgressIndicator(); + // TODO: Symfony 4 requires that we supply the working directory. + $result_data = $this->execute(new Process($this->getCommand(), getcwd())); + return new Result( + $this, + $result_data->getExitCode(), + $result_data->getMessage(), + $result_data->getData() + ); + $this->showProgressIndicator(); + } +} + +if (function_exists('pcntl_signal')) { + pcntl_signal(SIGTERM, ['Robo\Task\Base\Exec', 'stopRunningJobs']); +} + +register_shutdown_function(['Robo\Task\Base\Exec', 'stopRunningJobs']); diff --git a/vendor/consolidation/robo/src/Task/Base/ExecStack.php b/vendor/consolidation/robo/src/Task/Base/ExecStack.php new file mode 100644 index 0000000000000000000000000000000000000000..51b39ef1d3db13cf3dbdf8c8b607b37e04aba5da --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Base/ExecStack.php @@ -0,0 +1,23 @@ +<?php +namespace Robo\Task\Base; + +use Robo\Task\CommandStack; + +/** + * Execute commands one by one in stack. + * Stack can be stopped on first fail if you call `stopOnFail()`. + * + * ```php + * <?php + * $this->taskExecStack() + * ->stopOnFail() + * ->exec('mkdir site') + * ->exec('cd site') + * ->run(); + * + * ?> + * ``` + */ +class ExecStack extends CommandStack +{ +} diff --git a/vendor/consolidation/robo/src/Task/Base/ParallelExec.php b/vendor/consolidation/robo/src/Task/Base/ParallelExec.php new file mode 100644 index 0000000000000000000000000000000000000000..c98b784196b7552ab2c34c1fbde50ccc313f0e56 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Base/ParallelExec.php @@ -0,0 +1,199 @@ +<?php +namespace Robo\Task\Base; + +use Robo\Contract\CommandInterface; +use Robo\Contract\PrintedInterface; +use Robo\Result; +use Robo\Task\BaseTask; +use Symfony\Component\Process\Exception\ProcessTimedOutException; +use Symfony\Component\Process\Process; + +/** + * Class ParallelExecTask + * + * ``` php + * <?php + * $this->taskParallelExec() + * ->process('php ~/demos/script.php hey') + * ->process('php ~/demos/script.php hoy') + * ->process('php ~/demos/script.php gou') + * ->run(); + * ?> + * ``` + */ +class ParallelExec extends BaseTask implements CommandInterface, PrintedInterface +{ + use \Robo\Common\CommandReceiver; + + /** + * @var Process[] + */ + protected $processes = []; + + /** + * @var null|int + */ + protected $timeout = null; + + /** + * @var null|int + */ + protected $idleTimeout = null; + + /** + * @var null|int + */ + protected $waitInterval = 0; + + /** + * @var bool + */ + protected $isPrinted = false; + + /** + * {@inheritdoc} + */ + public function getPrinted() + { + return $this->isPrinted; + } + + /** + * @param bool $isPrinted + * + * @return $this + */ + public function printed($isPrinted = true) + { + $this->isPrinted = $isPrinted; + return $this; + } + + /** + * @param string|\Robo\Contract\CommandInterface $command + * + * @return $this + */ + public function process($command) + { + // TODO: Symfony 4 requires that we supply the working directory. + $this->processes[] = new Process($this->receiveCommand($command), getcwd()); + return $this; + } + + /** + * Stops process if it runs longer then `$timeout` (seconds). + * + * @param int $timeout + * + * @return $this + */ + public function timeout($timeout) + { + $this->timeout = $timeout; + return $this; + } + + /** + * Stops process if it does not output for time longer then `$timeout` (seconds). + * + * @param int $idleTimeout + * + * @return $this + */ + public function idleTimeout($idleTimeout) + { + $this->idleTimeout = $idleTimeout; + return $this; + } + + /** + * Parallel processing will wait `$waitInterval` seconds after launching each process and before + * the next one. + * + * @param int $waitInterval + * + * @return $this + */ + public function waitInterval($waitInterval) + { + $this->waitInterval = $waitInterval; + return $this; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return implode(' && ', $this->processes); + } + + /** + * @return int + */ + public function progressIndicatorSteps() + { + return count($this->processes); + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->startProgressIndicator(); + $running = []; + $queue = $this->processes; + $nextTime = time(); + while (true) { + if (($nextTime <= time()) && !empty($queue)) { + $process = array_shift($queue); + $process->setIdleTimeout($this->idleTimeout); + $process->setTimeout($this->timeout); + $process->start(); + $this->printTaskInfo($process->getCommandLine()); + $running[] = $process; + $nextTime = time() + $this->waitInterval; + } + foreach ($running as $k => $process) { + try { + $process->checkTimeout(); + } catch (ProcessTimedOutException $e) { + $this->printTaskWarning("Process timed out for {command}", ['command' => $process->getCommandLine(), '_style' => ['command' => 'fg=white;bg=magenta']]); + } + if (!$process->isRunning()) { + $this->advanceProgressIndicator(); + if ($this->isPrinted) { + $this->printTaskInfo("Output for {command}:\n\n{output}", ['command' => $process->getCommandLine(), 'output' => $process->getOutput(), '_style' => ['command' => 'fg=white;bg=magenta']]); + $errorOutput = $process->getErrorOutput(); + if ($errorOutput) { + $this->printTaskError(rtrim($errorOutput)); + } + } + unset($running[$k]); + } + } + if (empty($running) && empty($queue)) { + break; + } + usleep(1000); + } + $this->stopProgressIndicator(); + + $errorMessage = ''; + $exitCode = 0; + foreach ($this->processes as $p) { + if ($p->getExitCode() === 0) { + continue; + } + $errorMessage .= "'" . $p->getCommandLine() . "' exited with code ". $p->getExitCode()." \n"; + $exitCode = max($exitCode, $p->getExitCode()); + } + if (!$errorMessage) { + $this->printTaskSuccess('{process-count} processes finished running', ['process-count' => count($this->processes)]); + } + + return new Result($this, $exitCode, $errorMessage, ['time' => $this->getExecutionTime()]); + } +} diff --git a/vendor/consolidation/robo/src/Task/Base/SymfonyCommand.php b/vendor/consolidation/robo/src/Task/Base/SymfonyCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..708ea84512bf1bd88b3a5445d81616de1d00187c --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Base/SymfonyCommand.php @@ -0,0 +1,75 @@ +<?php +namespace Robo\Task\Base; + +use Robo\Robo; +use Robo\Result; +use Robo\Task\BaseTask; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\ArrayInput; + +/** + * Executes Symfony Command + * + * ``` php + * <?php + * // Symfony Command + * $this->taskSymfonyCommand(new \Codeception\Command\Run('run')) + * ->arg('suite','acceptance') + * ->opt('debug') + * ->run(); + * + * // Artisan Command + * $this->taskSymfonyCommand(new ModelGeneratorCommand()) + * ->arg('name', 'User') + * ->run(); + * ?> + * ``` + */ +class SymfonyCommand extends BaseTask +{ + /** + * @var \Symfony\Component\Console\Command\Command + */ + protected $command; + + /** + * @var string[] + */ + protected $input; + + public function __construct(Command $command) + { + $this->command = $command; + $this->input = []; + } + + /** + * @param string $arg + * @param string $value + * + * @return $this + */ + public function arg($arg, $value) + { + $this->input[$arg] = $value; + return $this; + } + + public function opt($option, $value = null) + { + $this->input["--$option"] = $value; + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Running command {command}', ['command' => $this->command->getName()]); + return new Result( + $this, + $this->command->run(new ArrayInput($this->input), Robo::output()) + ); + } +} diff --git a/vendor/consolidation/robo/src/Task/Base/Watch.php b/vendor/consolidation/robo/src/Task/Base/Watch.php new file mode 100644 index 0000000000000000000000000000000000000000..3b2152d96fe48a94ebe7f19c3ec4b87e7c24ba34 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Base/Watch.php @@ -0,0 +1,106 @@ +<?php +namespace Robo\Task\Base; + +use Lurker\ResourceWatcher; +use Robo\Result; +use Robo\Task\BaseTask; + +/** + * Runs task when specified file or dir was changed. + * Uses Lurker library. + * Monitor third parameter takes Lurker filesystem events types to watch. + * By default its set to MODIFY event. + * + * ``` php + * <?php + * $this->taskWatch() + * ->monitor( + * 'composer.json', + * function() { + * $this->taskComposerUpdate()->run(); + * } + * )->monitor( + * 'src', + * function() { + * $this->taskExec('phpunit')->run(); + * }, + * \Lurker\Event\FilesystemEvent::ALL + * )->monitor( + * 'migrations', + * function() { + * //do something + * }, + * [ + * \Lurker\Event\FilesystemEvent::CREATE, + * \Lurker\Event\FilesystemEvent::DELETE + * ] + * )->run(); + * ?> + * ``` + */ +class Watch extends BaseTask +{ + /** + * @var \Closure + */ + protected $closure; + + /** + * @var array + */ + protected $monitor = []; + + /** + * @var object + */ + protected $bindTo; + + /** + * @param $bindTo + */ + public function __construct($bindTo) + { + $this->bindTo = $bindTo; + } + + /** + * @param string|string[] $paths + * @param \Closure $callable + * @param int|int[] $events + * + * @return $this + */ + public function monitor($paths, \Closure $callable, $events = 2) + { + $this->monitor[] = [(array)$paths, $callable, (array)$events]; + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + if (!class_exists('Lurker\\ResourceWatcher')) { + return Result::errorMissingPackage($this, 'ResourceWatcher', 'henrikbjorn/lurker'); + } + + $watcher = new ResourceWatcher(); + + foreach ($this->monitor as $k => $monitor) { + /** @var \Closure $closure */ + $closure = $monitor[1]; + $closure->bindTo($this->bindTo); + foreach ($monitor[0] as $i => $dir) { + foreach ($monitor[2] as $j => $event) { + $watcher->track("fs.$k.$i.$j", $dir, $event); + $watcher->addListener("fs.$k.$i.$j", $closure); + } + $this->printTaskInfo('Watching {dir} for changes...', ['dir' => $dir]); + } + } + + $watcher->start(); + return Result::success($this); + } +} diff --git a/vendor/consolidation/robo/src/Task/Base/loadShortcuts.php b/vendor/consolidation/robo/src/Task/Base/loadShortcuts.php new file mode 100644 index 0000000000000000000000000000000000000000..dba0af6610f58ea36acf0589df7b8dfdf4fc7556 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Base/loadShortcuts.php @@ -0,0 +1,17 @@ +<?php +namespace Robo\Task\Base; + +trait loadShortcuts +{ + /** + * Executes shell command + * + * @param string|\Robo\Contract\CommandInterface $command + * + * @return \Robo\Result + */ + protected function _exec($command) + { + return $this->taskExec($command)->run(); + } +} diff --git a/vendor/consolidation/robo/src/Task/Base/loadTasks.php b/vendor/consolidation/robo/src/Task/Base/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..ab5301bbe98124e3e901c37e57b2ff6a6a175fe5 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Base/loadTasks.php @@ -0,0 +1,48 @@ +<?php +namespace Robo\Task\Base; + +trait loadTasks +{ + /** + * @param string|\Robo\Contract\CommandInterface $command + * + * @return Exec + */ + protected function taskExec($command) + { + return $this->task(Exec::class, $command); + } + + /** + * @return ExecStack + */ + protected function taskExecStack() + { + return $this->task(ExecStack::class); + } + + /** + * @return ParallelExec + */ + protected function taskParallelExec() + { + return $this->task(ParallelExec::class); + } + + /** + * @param $command + * @return SymfonyCommand + */ + protected function taskSymfonyCommand($command) + { + return $this->task(SymfonyCommand::class, $command); + } + + /** + * @return Watch + */ + protected function taskWatch() + { + return $this->task(Watch::class, $this); + } +} diff --git a/vendor/consolidation/robo/src/Task/BaseTask.php b/vendor/consolidation/robo/src/Task/BaseTask.php new file mode 100644 index 0000000000000000000000000000000000000000..66155c0932a78299747e3a66a17555733ec5523f --- /dev/null +++ b/vendor/consolidation/robo/src/Task/BaseTask.php @@ -0,0 +1,60 @@ +<?php +namespace Robo\Task; + +use Robo\Common\InflectionTrait; +use Robo\Contract\InflectionInterface; + +use Robo\Common\TaskIO; +use Robo\Contract\TaskInterface; +use Robo\Contract\ProgressIndicatorAwareInterface; +use Robo\Contract\VerbosityThresholdInterface; +use Robo\Common\ProgressIndicatorAwareTrait; +use Robo\Contract\ConfigAwareInterface; +use Psr\Log\LoggerAwareInterface; +use Robo\Contract\OutputAwareInterface; + +abstract class BaseTask implements TaskInterface, LoggerAwareInterface, VerbosityThresholdInterface, ConfigAwareInterface, ProgressIndicatorAwareInterface, InflectionInterface +{ + use TaskIO; // uses LoggerAwareTrait, VerbosityThresholdTrait and ConfigAwareTrait + use ProgressIndicatorAwareTrait; + use InflectionTrait; + + /** + * ConfigAwareInterface uses this to decide where configuration + * items come from. Default is this prefix + class name + key, + * e.g. `task.Remote.Ssh.remoteDir`. + */ + protected static function configPrefix() + { + return 'task.'; + } + + /** + * ConfigAwareInterface uses this to decide where configuration + * items come from. Default is this prefix + class name + key, + * e.g. `task.Ssh.remoteDir`. + */ + protected static function configPostfix() + { + return '.settings'; + } + + /** + * {@inheritdoc} + */ + public function injectDependencies(InflectionInterface $child) + { + if ($child instanceof LoggerAwareInterface && $this->logger) { + $child->setLogger($this->logger); + } + if ($child instanceof ProgressIndicatorAwareInterface && $this->progressIndicator) { + $child->setProgressIndicator($this->progressIndicator); + } + if ($child instanceof ConfigAwareInterface && $this->getConfig()) { + $child->setConfig($this->getConfig()); + } + if ($child instanceof VerbosityThresholdInterface && $this->outputAdapter()) { + $child->setOutputAdapter($this->outputAdapter()); + } + } +} diff --git a/vendor/consolidation/robo/src/Task/Bower/Base.php b/vendor/consolidation/robo/src/Task/Bower/Base.php new file mode 100644 index 0000000000000000000000000000000000000000..9bc614c6321de88de6d98a1d6d50cb299b685343 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Bower/Base.php @@ -0,0 +1,88 @@ +<?php +namespace Robo\Task\Bower; + +use Robo\Task\BaseTask; +use Robo\Exception\TaskException; + +abstract class Base extends BaseTask +{ + use \Robo\Common\ExecOneCommand; + + protected $opts = []; + protected $action = ''; + + /** + * @var string + */ + protected $command = ''; + + /** + * adds `allow-root` option to bower + * + * @return $this + */ + public function allowRoot() + { + $this->option('allow-root'); + return $this; + } + + /** + * adds `force-latest` option to bower + * + * @return $this + */ + public function forceLatest() + { + $this->option('force-latest'); + return $this; + } + + /** + * adds `production` option to bower + * + * @return $this + */ + public function noDev() + { + $this->option('production'); + return $this; + } + + /** + * adds `offline` option to bower + * + * @return $this + */ + public function offline() + { + $this->option('offline'); + return $this; + } + + /** + * Base constructor. + * + * @param null|string $pathToBower + * + * @throws \Robo\Exception\TaskException + */ + public function __construct($pathToBower = null) + { + $this->command = $pathToBower; + if (!$this->command) { + $this->command = $this->findExecutable('bower'); + } + if (!$this->command) { + throw new TaskException(__CLASS__, "Bower executable not found."); + } + } + + /** + * @return string + */ + public function getCommand() + { + return "{$this->command} {$this->action}{$this->arguments}"; + } +} diff --git a/vendor/consolidation/robo/src/Task/Bower/Install.php b/vendor/consolidation/robo/src/Task/Bower/Install.php new file mode 100644 index 0000000000000000000000000000000000000000..c3c0ce7559715554679a730393c1da922c16005e --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Bower/Install.php @@ -0,0 +1,36 @@ +<?php +namespace Robo\Task\Bower; + +use Robo\Contract\CommandInterface; + +/** + * Bower Install + * + * ``` php + * <?php + * // simple execution + * $this->taskBowerInstall()->run(); + * + * // prefer dist with custom path + * $this->taskBowerInstall('path/to/my/bower') + * ->noDev() + * ->run(); + * ?> + * ``` + */ +class Install extends Base implements CommandInterface +{ + /** + * {@inheritdoc} + */ + protected $action = 'install'; + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Install Bower packages: {arguments}', ['arguments' => $this->arguments]); + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Bower/Update.php b/vendor/consolidation/robo/src/Task/Bower/Update.php new file mode 100644 index 0000000000000000000000000000000000000000..f0dfa94e354a8f324ad4096becafb000988fb41e --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Bower/Update.php @@ -0,0 +1,34 @@ +<?php +namespace Robo\Task\Bower; + +/** + * Bower Update + * + * ``` php + * <?php + * // simple execution + * $this->taskBowerUpdate->run(); + * + * // prefer dist with custom path + * $this->taskBowerUpdate('path/to/my/bower') + * ->noDev() + * ->run(); + * ?> + * ``` + */ +class Update extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'update'; + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Update Bower packages: {arguments}', ['arguments' => $this->arguments]); + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Bower/loadTasks.php b/vendor/consolidation/robo/src/Task/Bower/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..6e33f8acf9b1adcb8968693db5734e4bd41baf6b --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Bower/loadTasks.php @@ -0,0 +1,25 @@ +<?php +namespace Robo\Task\Bower; + +trait loadTasks +{ + /** + * @param null|string $pathToBower + * + * @return Install + */ + protected function taskBowerInstall($pathToBower = null) + { + return $this->task(Install::class, $pathToBower); + } + + /** + * @param null|string $pathToBower + * + * @return Update + */ + protected function taskBowerUpdate($pathToBower = null) + { + return $this->task(Update::class, $pathToBower); + } +} diff --git a/vendor/consolidation/robo/src/Task/CommandStack.php b/vendor/consolidation/robo/src/Task/CommandStack.php new file mode 100644 index 0000000000000000000000000000000000000000..43fbd7ccfe02a9750b26cb21d104af346ffa8893 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/CommandStack.php @@ -0,0 +1,145 @@ +<?php + +namespace Robo\Task; + +use Robo\Common\ExecCommand; +use Robo\Contract\PrintedInterface; +use Robo\Result; +use Robo\Contract\CommandInterface; +use Robo\Exception\TaskException; + +abstract class CommandStack extends BaseTask implements CommandInterface, PrintedInterface +{ + use ExecCommand; + use \Robo\Common\CommandReceiver; + + /** + * @var string + */ + protected $executable; + + protected $result; + + /** + * @var string[] + */ + protected $exec = []; + + /** + * @var bool + */ + protected $stopOnFail = false; + + /** + * {@inheritdoc} + */ + public function getCommand() + { + $commands = []; + foreach ($this->exec as $command) { + $commands[] = $this->receiveCommand($command); + } + + return implode(' && ', $commands); + } + + /** + * @param string $executable + * + * @return $this + */ + public function executable($executable) + { + $this->executable = $executable; + return $this; + } + + /** + * @param string|string[]|CommandInterface $command + * + * @return $this + */ + public function exec($command) + { + if (is_array($command)) { + $command = implode(' ', array_filter($command)); + } + + if (is_string($command)) { + $command = $this->executable . ' ' . $this->stripExecutableFromCommand($command); + $command = trim($command); + } + + $this->exec[] = $command; + + return $this; + } + + /** + * @param bool $stopOnFail + * + * @return $this + */ + public function stopOnFail($stopOnFail = true) + { + $this->stopOnFail = $stopOnFail; + return $this; + } + + public function result($result) + { + $this->result = $result; + return $this; + } + + /** + * @param string $command + * + * @return string + */ + protected function stripExecutableFromCommand($command) + { + $command = trim($command); + $executable = $this->executable . ' '; + if (strpos($command, $executable) === 0) { + $command = substr($command, strlen($executable)); + } + return $command; + } + + /** + * {@inheritdoc} + */ + public function run() + { + if (empty($this->exec)) { + throw new TaskException($this, 'You must add at least one command'); + } + // If 'stopOnFail' is not set, or if there is only one command to run, + // then execute the single command to run. + if (!$this->stopOnFail || (count($this->exec) == 1)) { + $this->printTaskInfo('{command}', ['command' => $this->getCommand()]); + return $this->executeCommand($this->getCommand()); + } + + // When executing multiple commands in 'stopOnFail' mode, run them + // one at a time so that the result will have the exact command + // that failed available to the caller. This is at the expense of + // losing the output from all successful commands. + $data = []; + $message = ''; + $result = null; + foreach ($this->exec as $command) { + $this->printTaskInfo("Executing {command}", ['command' => $command]); + $result = $this->executeCommand($command); + $result->accumulateExecutionTime($data); + $message = $result->accumulateMessage($message); + $data = $result->mergeData($data); + if (!$result->wasSuccessful()) { + return $result; + } + } + + return $result; + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/Base.php b/vendor/consolidation/robo/src/Task/Composer/Base.php new file mode 100644 index 0000000000000000000000000000000000000000..de3fe2174c0d7b8338794acde1643ed640a4433d --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/Base.php @@ -0,0 +1,248 @@ +<?php +namespace Robo\Task\Composer; + +use Robo\Contract\CommandInterface; +use Robo\Exception\TaskException; +use Robo\Task\BaseTask; + +abstract class Base extends BaseTask implements CommandInterface +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command = ''; + + /** + * @var boolena + */ + protected $built = false; + + /** + * @var string + */ + protected $prefer; + + /** + * @var string + */ + protected $dev; + + /** + * @var string + */ + protected $ansi; + + /** + * @var string + */ + protected $nointeraction; + + /** + * Action to use + * + * @var string + */ + protected $action = ''; + + /** + * @param null|string $pathToComposer + * + * @throws \Robo\Exception\TaskException + */ + public function __construct($pathToComposer = null) + { + $this->command = $pathToComposer; + if (!$this->command) { + $this->command = $this->findExecutablePhar('composer'); + } + if (!$this->command) { + throw new TaskException(__CLASS__, "Neither local composer.phar nor global composer installation could be found."); + } + } + + /** + * adds `prefer-dist` option to composer + * + * @return $this + */ + public function preferDist($preferDist = true) + { + if (!$preferDist) { + return $this->preferSource(); + } + $this->prefer = '--prefer-dist'; + return $this; + } + + /** + * adds `prefer-source` option to composer + * + * @return $this + */ + public function preferSource() + { + $this->prefer = '--prefer-source'; + return $this; + } + + /** + * adds `dev` option to composer + * + * @return $this + */ + public function dev($dev = true) + { + if (!$dev) { + return $this->noDev(); + } + $this->dev = '--dev'; + return $this; + } + + /** + * adds `no-dev` option to composer + * + * @return $this + */ + public function noDev() + { + $this->dev = '--no-dev'; + return $this; + } + + /** + * adds `ansi` option to composer + * + * @return $this + */ + public function ansi($ansi = true) + { + if (!$ansi) { + return $this->noAnsi(); + } + $this->ansi = '--ansi'; + return $this; + } + + /** + * adds `no-ansi` option to composer + * + * @return $this + */ + public function noAnsi() + { + $this->ansi = '--no-ansi'; + return $this; + } + + public function interaction($interaction = true) + { + if (!$interaction) { + return $this->noInteraction(); + } + return $this; + } + + /** + * adds `no-interaction` option to composer + * + * @return $this + */ + public function noInteraction() + { + $this->nointeraction = '--no-interaction'; + return $this; + } + + /** + * adds `optimize-autoloader` option to composer + * + * @return $this + */ + public function optimizeAutoloader($optimize = true) + { + if ($optimize) { + $this->option('--optimize-autoloader'); + } + return $this; + } + + /** + * adds `ignore-platform-reqs` option to composer + * + * @return $this + */ + public function ignorePlatformRequirements($ignore = true) + { + $this->option('--ignore-platform-reqs'); + return $this; + } + + /** + * disable plugins + * + * @return $this + */ + public function disablePlugins($disable = true) + { + if ($disable) { + $this->option('--no-plugins'); + } + return $this; + } + + /** + * skip scripts + * + * @return $this + */ + public function noScripts($disable = true) + { + if ($disable) { + $this->option('--no-scripts'); + } + return $this; + } + + /** + * adds `--working-dir $dir` option to composer + * + * @return $this + */ + public function workingDir($dir) + { + $this->option("--working-dir", $dir); + return $this; + } + + /** + * Copy class fields into command options as directed. + */ + public function buildCommand() + { + if (!isset($this->ansi) && $this->getConfig()->get(\Robo\Config\Config::DECORATED)) { + $this->ansi(); + } + if (!isset($this->nointeraction) && !$this->getConfig()->get(\Robo\Config\Config::INTERACTIVE)) { + $this->noInteraction(); + } + $this->option($this->prefer) + ->option($this->dev) + ->option($this->nointeraction) + ->option($this->ansi); + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + if (!$this->built) { + $this->buildCommand(); + $this->built = true; + } + return "{$this->command} {$this->action}{$this->arguments}"; + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/Config.php b/vendor/consolidation/robo/src/Task/Composer/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..b5a6bbff977ce8ab60a7dec9fa7c84c10a608759 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/Config.php @@ -0,0 +1,93 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer Config + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerConfig()->set('bin-dir', 'bin/')->run(); + * ?> + * ``` + */ +class Config extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'config'; + + /** + * Set a configuration value + * @return $this + */ + public function set($key, $value) + { + $this->arg($key); + $this->arg($value); + return $this; + } + + /** + * Operate on the global repository + * @return $this + */ + public function useGlobal($useGlobal = true) + { + if ($useGlobal) { + $this->option('global'); + } + return $this; + } + + /** + * @return $this + */ + public function repository($id, $uri, $repoType = 'vcs') + { + $this->arg("repositories.$id"); + $this->arg($repoType); + $this->arg($uri); + return $this; + } + + /** + * @return $this + */ + public function removeRepository($id) + { + $this->option('unset', "repositories.$id"); + return $this; + } + + /** + * @return $this + */ + public function disableRepository($id) + { + $this->arg("repositories.$id"); + $this->arg('false'); + return $this; + } + + /** + * @return $this + */ + public function enableRepository($id) + { + $this->arg("repositories.$id"); + $this->arg('true'); + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Configuring composer.json: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/CreateProject.php b/vendor/consolidation/robo/src/Task/Composer/CreateProject.php new file mode 100644 index 0000000000000000000000000000000000000000..5f979a646ca378ce71d82f09dc23a84b2fd2dc6a --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/CreateProject.php @@ -0,0 +1,112 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer CreateProject + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerCreateProject()->source('foo/bar')->target('myBar')->run(); + * ?> + * ``` + */ +class CreateProject extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'create-project'; + + protected $source; + protected $target = ''; + protected $version = ''; + + /** + * @return $this + */ + public function source($source) + { + $this->source = $source; + return $this; + } + + /** + * @return $this + */ + public function target($target) + { + $this->target = $target; + return $this; + } + + /** + * @return $this + */ + public function version($version) + { + $this->version = $version; + return $this; + } + + public function keepVcs($keep = true) + { + if ($keep) { + $this->option('--keep-vcs'); + } + return $this; + } + + public function noInstall($noInstall = true) + { + if ($noInstall) { + $this->option('--no-install'); + } + return $this; + } + + /** + * @return $this + */ + public function repository($repository) + { + if (!empty($repository)) { + $this->option('repository', $repository); + } + return $this; + } + + /** + * @return $this + */ + public function stability($stability) + { + if (!empty($stability)) { + $this->option('stability', $stability); + } + return $this; + } + + public function buildCommand() + { + $this->arg($this->source); + if (!empty($this->target)) { + $this->arg($this->target); + } + if (!empty($this->version)) { + $this->arg($this->version); + } + + return parent::buildCommand(); + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Creating project: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/DumpAutoload.php b/vendor/consolidation/robo/src/Task/Composer/DumpAutoload.php new file mode 100644 index 0000000000000000000000000000000000000000..55b1ea00e4fa237d70fa87ce3fbf41e6d5ff8e07 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/DumpAutoload.php @@ -0,0 +1,62 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer Dump Autoload + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerDumpAutoload()->run(); + * + * // dump auto loader with custom path + * $this->taskComposerDumpAutoload('path/to/my/composer.phar') + * ->preferDist() + * ->run(); + * + * // optimize autoloader dump with custom path + * $this->taskComposerDumpAutoload('path/to/my/composer.phar') + * ->optimize() + * ->run(); + * + * // optimize autoloader dump with custom path and no dev + * $this->taskComposerDumpAutoload('path/to/my/composer.phar') + * ->optimize() + * ->noDev() + * ->run(); + * ?> + * ``` + */ +class DumpAutoload extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'dump-autoload'; + + /** + * @var string + */ + protected $optimize; + + /** + * @return $this + */ + public function optimize($optimize = true) + { + if ($optimize) { + $this->option("--optimize"); + } + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Dumping Autoloader: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/Init.php b/vendor/consolidation/robo/src/Task/Composer/Init.php new file mode 100644 index 0000000000000000000000000000000000000000..c841299ddbefe210cc6d2c7a74757cd00553ac28 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/Init.php @@ -0,0 +1,115 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer Init + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerInit()->run(); + * ?> + * ``` + */ +class Init extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'init'; + + /** + * @return $this + */ + public function projectName($projectName) + { + $this->option('name', $projectName); + return $this; + } + + /** + * @return $this + */ + public function description($description) + { + $this->option('description', $description); + return $this; + } + + /** + * @return $this + */ + public function author($author) + { + $this->option('author', $author); + return $this; + } + + /** + * @return $this + */ + public function projectType($type) + { + $this->option('type', $type); + return $this; + } + + /** + * @return $this + */ + public function homepage($homepage) + { + $this->option('homepage', $homepage); + return $this; + } + + /** + * 'require' is a keyword, so it cannot be a method name. + * @return $this + */ + public function dependency($project, $version = null) + { + if (isset($version)) { + $project .= ":$version"; + } + $this->option('require', $project); + return $this; + } + + /** + * @return $this + */ + public function stability($stability) + { + $this->option('stability', $stability); + return $this; + } + + /** + * @return $this + */ + public function license($license) + { + $this->option('license', $license); + return $this; + } + + /** + * @return $this + */ + public function repository($repository) + { + $this->option('repository', $repository); + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Creating composer.json: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/Install.php b/vendor/consolidation/robo/src/Task/Composer/Install.php new file mode 100644 index 0000000000000000000000000000000000000000..76cb9861f63b0a02e28043d13f6e4b02cd902aa7 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/Install.php @@ -0,0 +1,40 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer Install + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerInstall()->run(); + * + * // prefer dist with custom path + * $this->taskComposerInstall('path/to/my/composer.phar') + * ->preferDist() + * ->run(); + * + * // optimize autoloader with custom path + * $this->taskComposerInstall('path/to/my/composer.phar') + * ->optimizeAutoloader() + * ->run(); + * ?> + * ``` + */ +class Install extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'install'; + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Installing Packages: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/Remove.php b/vendor/consolidation/robo/src/Task/Composer/Remove.php new file mode 100644 index 0000000000000000000000000000000000000000..b0316f0514e2a5f8245b0dd7d5dca98dbc46fb9d --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/Remove.php @@ -0,0 +1,85 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer Remove + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerRemove()->run(); + * ?> + * ``` + */ +class Remove extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'remove'; + + /** + * @return $this + */ + public function dev($dev = true) + { + if ($dev) { + $this->option('--dev'); + } + return $this; + } + + /** + * @return $this + */ + public function noProgress($noProgress = true) + { + if ($noProgress) { + $this->option('--no-progress'); + } + return $this; + } + + /** + * @return $this + */ + public function noUpdate($noUpdate = true) + { + if ($noUpdate) { + $this->option('--no-update'); + } + return $this; + } + + /** + * @return $this + */ + public function updateNoDev($updateNoDev = true) + { + if ($updateNoDev) { + $this->option('--update-no-dev'); + } + return $this; + } + + /** + * @return $this + */ + public function noUpdateWithDependencies($updateWithDependencies = true) + { + if ($updateWithDependencies) { + $this->option('--no-update-with-dependencies'); + } + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Removing packages: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/RequireDependency.php b/vendor/consolidation/robo/src/Task/Composer/RequireDependency.php new file mode 100644 index 0000000000000000000000000000000000000000..6cdbf61391f9109e9e97cb9d135a9b248805c96b --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/RequireDependency.php @@ -0,0 +1,50 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer Require + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerRequire()->dependency('foo/bar', '^.2.4.8')->run(); + * ?> + * ``` + */ +class RequireDependency extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'require'; + + /** + * 'require' is a keyword, so it cannot be a method name. + * @return $this + */ + public function dependency($project, $version = null) + { + $project = (array)$project; + + if (isset($version)) { + $project = array_map( + function ($item) use ($version) { + return "$item:$version"; + }, + $project + ); + } + $this->args($project); + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Requiring packages: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/Update.php b/vendor/consolidation/robo/src/Task/Composer/Update.php new file mode 100644 index 0000000000000000000000000000000000000000..3a0a64afcbc9baae75e5d17bd80bfe3352ff5f1d --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/Update.php @@ -0,0 +1,40 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer Update + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerUpdate()->run(); + * + * // prefer dist with custom path + * $this->taskComposerUpdate('path/to/my/composer.phar') + * ->preferDist() + * ->run(); + * + * // optimize autoloader with custom path + * $this->taskComposerUpdate('path/to/my/composer.phar') + * ->optimizeAutoloader() + * ->run(); + * ?> + * ``` + */ +class Update extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'update'; + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Updating Packages: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/Validate.php b/vendor/consolidation/robo/src/Task/Composer/Validate.php new file mode 100644 index 0000000000000000000000000000000000000000..adb1585430ea85d26297c6565018705ad72db23e --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/Validate.php @@ -0,0 +1,85 @@ +<?php +namespace Robo\Task\Composer; + +/** + * Composer Validate + * + * ``` php + * <?php + * // simple execution + * $this->taskComposerValidate()->run(); + * ?> + * ``` + */ +class Validate extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'validate'; + + /** + * @return $this + */ + public function noCheckAll($noCheckAll = true) + { + if ($noCheckAll) { + $this->option('--no-check-all'); + } + return $this; + } + + /** + * @return $this + */ + public function noCheckLock($noCheckLock = true) + { + if ($noCheckLock) { + $this->option('--no-check-lock'); + } + return $this; + } + + /** + * @return $this + */ + public function noCheckPublish($noCheckPublish = true) + { + if ($noCheckPublish) { + $this->option('--no-check-publish'); + } + return $this; + } + + /** + * @return $this + */ + public function withDependencies($withDependencies = true) + { + if ($withDependencies) { + $this->option('--with-dependencies'); + } + return $this; + } + + /** + * @return $this + */ + public function strict($strict = true) + { + if ($strict) { + $this->option('--strict'); + } + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Validating composer.json: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Composer/loadTasks.php b/vendor/consolidation/robo/src/Task/Composer/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..a7149f8a2d45bedaf9da32737201b836d437e891 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/loadTasks.php @@ -0,0 +1,95 @@ +<?php +namespace Robo\Task\Composer; + +trait loadTasks +{ + /** + * @param null|string $pathToComposer + * + * @return Install + */ + protected function taskComposerInstall($pathToComposer = null) + { + return $this->task(Install::class, $pathToComposer); + } + + /** + * @param null|string $pathToComposer + * + * @return Update + */ + protected function taskComposerUpdate($pathToComposer = null) + { + return $this->task(Update::class, $pathToComposer); + } + + /** + * @param null|string $pathToComposer + * + * @return DumpAutoload + */ + protected function taskComposerDumpAutoload($pathToComposer = null) + { + return $this->task(DumpAutoload::class, $pathToComposer); + } + + /** + * @param null|string $pathToComposer + * + * @return Init + */ + protected function taskComposerInit($pathToComposer = null) + { + return $this->task(Init::class, $pathToComposer); + } + + /** + * @param null|string $pathToComposer + * + * @return Config + */ + protected function taskComposerConfig($pathToComposer = null) + { + return $this->task(Config::class, $pathToComposer); + } + + /** + * @param null|string $pathToComposer + * + * @return Validate + */ + protected function taskComposerValidate($pathToComposer = null) + { + return $this->task(Validate::class, $pathToComposer); + } + + /** + * @param null|string $pathToComposer + * + * @return Remove + */ + protected function taskComposerRemove($pathToComposer = null) + { + return $this->task(Remove::class, $pathToComposer); + } + + /** + * @param null|string $pathToComposer + * + * @return RequireDependency + */ + protected function taskComposerRequire($pathToComposer = null) + { + return $this->task(RequireDependency::class, $pathToComposer); + } + + /** + * @param null|string $pathToComposer + * + * @return CreateProject + */ + protected function taskComposerCreateProject($pathToComposer = null) + { + return $this->task(CreateProject::class, $pathToComposer); + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/Changelog.php b/vendor/consolidation/robo/src/Task/Development/Changelog.php new file mode 100644 index 0000000000000000000000000000000000000000..44af6d82024468987c3abacdea484076f2aadf01 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/Changelog.php @@ -0,0 +1,246 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Task\BaseTask; +use Robo\Result; +use Robo\Contract\BuilderAwareInterface; +use Robo\Common\BuilderAwareTrait; + +/** + * Helps to manage changelog file. + * Creates or updates `changelog.md` file with recent changes in current version. + * + * ``` php + * <?php + * $version = "0.1.0"; + * $this->taskChangelog() + * ->version($version) + * ->change("released to github") + * ->run(); + * ?> + * ``` + * + * Changes can be asked from Console + * + * ``` php + * <?php + * $this->taskChangelog() + * ->version($version) + * ->askForChanges() + * ->run(); + * ?> + * ``` + */ +class Changelog extends BaseTask implements BuilderAwareInterface +{ + use BuilderAwareTrait; + + /** + * @var string + */ + protected $filename; + + /** + * @var array + */ + protected $log = []; + + /** + * @var string + */ + protected $anchor = "# Changelog"; + + /** + * @var string + */ + protected $version = ""; + + /** + * @var string + */ + protected $body = ""; + + /** + * @var string + */ + protected $header = ""; + + /** + * @param string $filename + * + * @return $this + */ + public function filename($filename) + { + $this->filename = $filename; + return $this; + } + + /** + * Sets the changelog body text. + * + * This method permits the raw changelog text to be set directly If this is set, $this->log changes will be ignored. + * + * @param string $body + * + * @return $this + */ + public function setBody($body) + { + $this->body = $body; + return $this; + } + + /** + * @param string $header + * + * @return $this + */ + public function setHeader($header) + { + $this->header = $header; + return $this; + } + + /** + * @param string $item + * + * @return $this + */ + public function log($item) + { + $this->log[] = $item; + return $this; + } + + /** + * @param string $anchor + * + * @return $this + */ + public function anchor($anchor) + { + $this->anchor = $anchor; + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function version($version) + { + $this->version = $version; + return $this; + } + + /** + * @param string $filename + */ + public function __construct($filename) + { + $this->filename = $filename; + } + + /** + * @param array $data + * + * @return $this + */ + public function changes(array $data) + { + $this->log = array_merge($this->log, $data); + return $this; + } + + /** + * @param string $change + * + * @return $this + */ + public function change($change) + { + $this->log[] = $change; + return $this; + } + + /** + * @return array + */ + public function getChanges() + { + return $this->log; + } + + /** + * {@inheritdoc} + */ + public function run() + { + if (empty($this->body)) { + if (empty($this->log)) { + return Result::error($this, "Changelog is empty"); + } + $this->body = $this->generateBody(); + } + if (empty($this->header)) { + $this->header = $this->generateHeader(); + } + + $text = $this->header . $this->body; + + if (!file_exists($this->filename)) { + $this->printTaskInfo('Creating {filename}', ['filename' => $this->filename]); + $res = file_put_contents($this->filename, $this->anchor); + if ($res === false) { + return Result::error($this, "File {filename} cant be created", ['filename' => $this->filename]); + } + } + + /** @var \Robo\Result $result */ + // trying to append to changelog for today + $result = $this->collectionBuilder()->taskReplaceInFile($this->filename) + ->from($this->header) + ->to($text) + ->run(); + + if (!isset($result['replaced']) || !$result['replaced']) { + $result = $this->collectionBuilder()->taskReplaceInFile($this->filename) + ->from($this->anchor) + ->to($this->anchor . "\n\n" . $text) + ->run(); + } + + return new Result($this, $result->getExitCode(), $result->getMessage(), $this->log); + } + + /** + * @return \Robo\Result|string + */ + protected function generateBody() + { + $text = implode("\n", array_map([$this, 'processLogRow'], $this->log)); + $text .= "\n"; + + return $text; + } + + /** + * @return string + */ + protected function generateHeader() + { + return "#### {$this->version}\n\n"; + } + + /** + * @param $i + * + * @return string + */ + public function processLogRow($i) + { + return "* $i *" . date('Y-m-d') . "*"; + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/GenerateMarkdownDoc.php b/vendor/consolidation/robo/src/Task/Development/GenerateMarkdownDoc.php new file mode 100644 index 0000000000000000000000000000000000000000..490aef31fe453683780a4794135fbd0a5a346a17 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/GenerateMarkdownDoc.php @@ -0,0 +1,782 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Task\BaseTask; +use Robo\Result; +use Robo\Contract\BuilderAwareInterface; +use Robo\Common\BuilderAwareTrait; + +/** + * Simple documentation generator from source files. + * Takes classes, properties and methods with their docblocks and writes down a markdown file. + * + * ``` php + * <?php + * $this->taskGenDoc('models.md') + * ->docClass('Model\User') // take class Model\User + * ->docClass('Model\Post') // take class Model\Post + * ->filterMethods(function(\ReflectionMethod $r) { + * return $r->isPublic() or $r->isProtected(); // process public and protected methods + * })->processClass(function(\ReflectionClass $r, $text) { + * return "Class ".$r->getName()."\n\n$text\n\n###Methods\n"; + * })->run(); + * ``` + * + * By default this task generates a documentation for each public method of a class, interface or trait. + * It combines method signature with a docblock. Both can be post-processed. + * + * ``` php + * <?php + * $this->taskGenDoc('models.md') + * ->docClass('Model\User') + * ->processClassSignature(false) // false can be passed to not include class signature + * ->processClassDocBlock(function(\ReflectionClass $r, $text) { + * return "[This is part of application model]\n" . $text; + * })->processMethodSignature(function(\ReflectionMethod $r, $text) { + * return "#### {$r->name}()"; + * })->processMethodDocBlock(function(\ReflectionMethod $r, $text) { + * return strpos($r->name, 'save')===0 ? "[Saves to the database]\n" . $text : $text; + * })->run(); + * ``` + */ +class GenerateMarkdownDoc extends BaseTask implements BuilderAwareInterface +{ + use BuilderAwareTrait; + + /** + * @var string[] + */ + protected $docClass = []; + + /** + * @var callable + */ + protected $filterMethods; + + /** + * @var callable + */ + protected $filterClasses; + + /** + * @var callable + */ + protected $filterProperties; + + /** + * @var callable + */ + protected $processClass; + + /** + * @var callable|false + */ + protected $processClassSignature; + + /** + * @var callable|false + */ + protected $processClassDocBlock; + + /** + * @var callable|false + */ + protected $processMethod; + + /** + * @var callable|false + */ + protected $processMethodSignature; + + /** + * @var callable|false + */ + protected $processMethodDocBlock; + + /** + * @var callable|false + */ + protected $processProperty; + + /** + * @var callable|false + */ + protected $processPropertySignature; + + /** + * @var callable|false + */ + protected $processPropertyDocBlock; + + /** + * @var callable + */ + protected $reorder; + + /** + * @var callable + */ + protected $reorderMethods; + + /** + * @todo Unused property. + * + * @var callable + */ + protected $reorderProperties; + + /** + * @var string + */ + protected $filename; + + /** + * @var string + */ + protected $prepend = ""; + + /** + * @var string + */ + protected $append = ""; + + /** + * @var string + */ + protected $text; + + /** + * @var string[] + */ + protected $textForClass = []; + + /** + * @param string $filename + * + * @return static + */ + public static function init($filename) + { + return new static($filename); + } + + /** + * @param string $filename + */ + public function __construct($filename) + { + $this->filename = $filename; + } + + /** + * Put a class you want to be documented. + * + * @param string $item + * + * @return $this + */ + public function docClass($item) + { + $this->docClass[] = $item; + return $this; + } + + /** + * Using a callback function filter out methods that won't be documented. + * + * @param callable $filterMethods + * + * @return $this + */ + public function filterMethods($filterMethods) + { + $this->filterMethods = $filterMethods; + return $this; + } + + /** + * Using a callback function filter out classes that won't be documented. + * + * @param callable $filterClasses + * + * @return $this + */ + public function filterClasses($filterClasses) + { + $this->filterClasses = $filterClasses; + return $this; + } + + /** + * Using a callback function filter out properties that won't be documented. + * + * @param callable $filterProperties + * + * @return $this + */ + public function filterProperties($filterProperties) + { + $this->filterProperties = $filterProperties; + return $this; + } + + /** + * Post-process class documentation. + * + * @param callable $processClass + * + * @return $this + */ + public function processClass($processClass) + { + $this->processClass = $processClass; + return $this; + } + + /** + * Post-process class signature. Provide *false* to skip. + * + * @param callable|false $processClassSignature + * + * @return $this + */ + public function processClassSignature($processClassSignature) + { + $this->processClassSignature = $processClassSignature; + return $this; + } + + /** + * Post-process class docblock contents. Provide *false* to skip. + * + * @param callable|false $processClassDocBlock + * + * @return $this + */ + public function processClassDocBlock($processClassDocBlock) + { + $this->processClassDocBlock = $processClassDocBlock; + return $this; + } + + /** + * Post-process method documentation. Provide *false* to skip. + * + * @param callable|false $processMethod + * + * @return $this + */ + public function processMethod($processMethod) + { + $this->processMethod = $processMethod; + return $this; + } + + /** + * Post-process method signature. Provide *false* to skip. + * + * @param callable|false $processMethodSignature + * + * @return $this + */ + public function processMethodSignature($processMethodSignature) + { + $this->processMethodSignature = $processMethodSignature; + return $this; + } + + /** + * Post-process method docblock contents. Provide *false* to skip. + * + * @param callable|false $processMethodDocBlock + * + * @return $this + */ + public function processMethodDocBlock($processMethodDocBlock) + { + $this->processMethodDocBlock = $processMethodDocBlock; + return $this; + } + + /** + * Post-process property documentation. Provide *false* to skip. + * + * @param callable|false $processProperty + * + * @return $this + */ + public function processProperty($processProperty) + { + $this->processProperty = $processProperty; + return $this; + } + + /** + * Post-process property signature. Provide *false* to skip. + * + * @param callable|false $processPropertySignature + * + * @return $this + */ + public function processPropertySignature($processPropertySignature) + { + $this->processPropertySignature = $processPropertySignature; + return $this; + } + + /** + * Post-process property docblock contents. Provide *false* to skip. + * + * @param callable|false $processPropertyDocBlock + * + * @return $this + */ + public function processPropertyDocBlock($processPropertyDocBlock) + { + $this->processPropertyDocBlock = $processPropertyDocBlock; + return $this; + } + + /** + * Use a function to reorder classes. + * + * @param callable $reorder + * + * @return $this + */ + public function reorder($reorder) + { + $this->reorder = $reorder; + return $this; + } + + /** + * Use a function to reorder methods in class. + * + * @param callable $reorderMethods + * + * @return $this + */ + public function reorderMethods($reorderMethods) + { + $this->reorderMethods = $reorderMethods; + return $this; + } + + /** + * @param callable $reorderProperties + * + * @return $this + */ + public function reorderProperties($reorderProperties) + { + $this->reorderProperties = $reorderProperties; + return $this; + } + + /** + * @param string $filename + * + * @return $this + */ + public function filename($filename) + { + $this->filename = $filename; + return $this; + } + + /** + * Inserts text at the beginning of markdown file. + * + * @param string $prepend + * + * @return $this + */ + public function prepend($prepend) + { + $this->prepend = $prepend; + return $this; + } + + /** + * Inserts text at the end of markdown file. + * + * @param string $append + * + * @return $this + */ + public function append($append) + { + $this->append = $append; + return $this; + } + + /** + * @param string $text + * + * @return $this + */ + public function text($text) + { + $this->text = $text; + return $this; + } + + /** + * @param string $item + * + * @return $this + */ + public function textForClass($item) + { + $this->textForClass[] = $item; + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + foreach ($this->docClass as $class) { + $this->printTaskInfo("Processing {class}", ['class' => $class]); + $this->textForClass[$class] = $this->documentClass($class); + } + + if (is_callable($this->reorder)) { + $this->printTaskInfo("Applying reorder function"); + call_user_func_array($this->reorder, [$this->textForClass]); + } + + $this->text = implode("\n", $this->textForClass); + + /** @var \Robo\Result $result */ + $result = $this->collectionBuilder()->taskWriteToFile($this->filename) + ->line($this->prepend) + ->text($this->text) + ->line($this->append) + ->run(); + + $this->printTaskSuccess('{filename} created. {class-count} classes documented', ['filename' => $this->filename, 'class-count' => count($this->docClass)]); + + return new Result($this, $result->getExitCode(), $result->getMessage(), $this->textForClass); + } + + /** + * @param string $class + * + * @return null|string + */ + protected function documentClass($class) + { + if (!class_exists($class) && !trait_exists($class)) { + return ""; + } + $refl = new \ReflectionClass($class); + + if (is_callable($this->filterClasses)) { + $ret = call_user_func($this->filterClasses, $refl); + if (!$ret) { + return; + } + } + $doc = $this->documentClassSignature($refl); + $doc .= "\n" . $this->documentClassDocBlock($refl); + $doc .= "\n"; + + if (is_callable($this->processClass)) { + $doc = call_user_func($this->processClass, $refl, $doc); + } + + $properties = []; + foreach ($refl->getProperties() as $reflProperty) { + $properties[] = $this->documentProperty($reflProperty); + } + + $properties = array_filter($properties); + $doc .= implode("\n", $properties); + + $methods = []; + foreach ($refl->getMethods() as $reflMethod) { + $methods[$reflMethod->name] = $this->documentMethod($reflMethod); + } + if (is_callable($this->reorderMethods)) { + call_user_func_array($this->reorderMethods, [&$methods]); + } + + $methods = array_filter($methods); + + $doc .= implode("\n", $methods)."\n"; + + return $doc; + } + + /** + * @param \ReflectionClass $reflectionClass + * + * @return string + */ + protected function documentClassSignature(\ReflectionClass $reflectionClass) + { + if ($this->processClassSignature === false) { + return ""; + } + + $signature = "## {$reflectionClass->name}\n\n"; + + if ($parent = $reflectionClass->getParentClass()) { + $signature .= "* *Extends* `{$parent->name}`"; + } + $interfaces = $reflectionClass->getInterfaceNames(); + if (count($interfaces)) { + $signature .= "\n* *Implements* `" . implode('`, `', $interfaces) . '`'; + } + $traits = $reflectionClass->getTraitNames(); + if (count($traits)) { + $signature .= "\n* *Uses* `" . implode('`, `', $traits) . '`'; + } + if (is_callable($this->processClassSignature)) { + $signature = call_user_func($this->processClassSignature, $reflectionClass, $signature); + } + + return $signature; + } + + /** + * @param \ReflectionClass $reflectionClass + * + * @return string + */ + protected function documentClassDocBlock(\ReflectionClass $reflectionClass) + { + if ($this->processClassDocBlock === false) { + return ""; + } + $doc = self::indentDoc($reflectionClass->getDocComment()); + if (is_callable($this->processClassDocBlock)) { + $doc = call_user_func($this->processClassDocBlock, $reflectionClass, $doc); + } + return $doc; + } + + /** + * @param \ReflectionMethod $reflectedMethod + * + * @return string + */ + protected function documentMethod(\ReflectionMethod $reflectedMethod) + { + if ($this->processMethod === false) { + return ""; + } + if (is_callable($this->filterMethods)) { + $ret = call_user_func($this->filterMethods, $reflectedMethod); + if (!$ret) { + return ""; + } + } else { + if (!$reflectedMethod->isPublic()) { + return ""; + } + } + + $signature = $this->documentMethodSignature($reflectedMethod); + $docblock = $this->documentMethodDocBlock($reflectedMethod); + $methodDoc = "$signature $docblock"; + if (is_callable($this->processMethod)) { + $methodDoc = call_user_func($this->processMethod, $reflectedMethod, $methodDoc); + } + return $methodDoc; + } + + /** + * @param \ReflectionProperty $reflectedProperty + * + * @return string + */ + protected function documentProperty(\ReflectionProperty $reflectedProperty) + { + if ($this->processProperty === false) { + return ""; + } + if (is_callable($this->filterProperties)) { + $ret = call_user_func($this->filterProperties, $reflectedProperty); + if (!$ret) { + return ""; + } + } else { + if (!$reflectedProperty->isPublic()) { + return ""; + } + } + $signature = $this->documentPropertySignature($reflectedProperty); + $docblock = $this->documentPropertyDocBlock($reflectedProperty); + $propertyDoc = $signature . $docblock; + if (is_callable($this->processProperty)) { + $propertyDoc = call_user_func($this->processProperty, $reflectedProperty, $propertyDoc); + } + return $propertyDoc; + } + + /** + * @param \ReflectionProperty $reflectedProperty + * + * @return string + */ + protected function documentPropertySignature(\ReflectionProperty $reflectedProperty) + { + if ($this->processPropertySignature === false) { + return ""; + } + $modifiers = implode(' ', \Reflection::getModifierNames($reflectedProperty->getModifiers())); + $signature = "#### *$modifiers* {$reflectedProperty->name}"; + if (is_callable($this->processPropertySignature)) { + $signature = call_user_func($this->processPropertySignature, $reflectedProperty, $signature); + } + return $signature; + } + + /** + * @param \ReflectionProperty $reflectedProperty + * + * @return string + */ + protected function documentPropertyDocBlock(\ReflectionProperty $reflectedProperty) + { + if ($this->processPropertyDocBlock === false) { + return ""; + } + $propertyDoc = $reflectedProperty->getDocComment(); + // take from parent + if (!$propertyDoc) { + $parent = $reflectedProperty->getDeclaringClass(); + while ($parent = $parent->getParentClass()) { + if ($parent->hasProperty($reflectedProperty->name)) { + $propertyDoc = $parent->getProperty($reflectedProperty->name)->getDocComment(); + } + } + } + $propertyDoc = self::indentDoc($propertyDoc, 7); + $propertyDoc = preg_replace("~^@(.*?)([$\s])~", ' * `$1` $2', $propertyDoc); // format annotations + if (is_callable($this->processPropertyDocBlock)) { + $propertyDoc = call_user_func($this->processPropertyDocBlock, $reflectedProperty, $propertyDoc); + } + return ltrim($propertyDoc); + } + + /** + * @param \ReflectionParameter $param + * + * @return string + */ + protected function documentParam(\ReflectionParameter $param) + { + $text = ""; + if ($param->isArray()) { + $text .= 'array '; + } + if ($param->isCallable()) { + $text .= 'callable '; + } + $text .= '$' . $param->name; + if ($param->isDefaultValueAvailable()) { + if ($param->allowsNull()) { + $text .= ' = null'; + } else { + $text .= ' = ' . str_replace("\n", ' ', print_r($param->getDefaultValue(), true)); + } + } + + return $text; + } + + /** + * @param string $doc + * @param int $indent + * + * @return string + */ + public static function indentDoc($doc, $indent = 3) + { + if (!$doc) { + return $doc; + } + return implode( + "\n", + array_map( + function ($line) use ($indent) { + return substr($line, $indent); + }, + explode("\n", $doc) + ) + ); + } + + /** + * @param \ReflectionMethod $reflectedMethod + * + * @return string + */ + protected function documentMethodSignature(\ReflectionMethod $reflectedMethod) + { + if ($this->processMethodSignature === false) { + return ""; + } + $modifiers = implode(' ', \Reflection::getModifierNames($reflectedMethod->getModifiers())); + $params = implode( + ', ', + array_map( + function ($p) { + return $this->documentParam($p); + }, + $reflectedMethod->getParameters() + ) + ); + $signature = "#### *$modifiers* {$reflectedMethod->name}($params)"; + if (is_callable($this->processMethodSignature)) { + $signature = call_user_func($this->processMethodSignature, $reflectedMethod, $signature); + } + return $signature; + } + + /** + * @param \ReflectionMethod $reflectedMethod + * + * @return string + */ + protected function documentMethodDocBlock(\ReflectionMethod $reflectedMethod) + { + if ($this->processMethodDocBlock === false) { + return ""; + } + $methodDoc = $reflectedMethod->getDocComment(); + // take from parent + if (!$methodDoc) { + $parent = $reflectedMethod->getDeclaringClass(); + while ($parent = $parent->getParentClass()) { + if ($parent->hasMethod($reflectedMethod->name)) { + $methodDoc = $parent->getMethod($reflectedMethod->name)->getDocComment(); + } + } + } + // take from interface + if (!$methodDoc) { + $interfaces = $reflectedMethod->getDeclaringClass()->getInterfaces(); + foreach ($interfaces as $interface) { + $i = new \ReflectionClass($interface->name); + if ($i->hasMethod($reflectedMethod->name)) { + $methodDoc = $i->getMethod($reflectedMethod->name)->getDocComment(); + break; + } + } + } + + $methodDoc = self::indentDoc($methodDoc, 7); + $methodDoc = preg_replace("~^@(.*?) ([$\s])~m", ' * `$1` $2', $methodDoc); // format annotations + if (is_callable($this->processMethodDocBlock)) { + $methodDoc = call_user_func($this->processMethodDocBlock, $reflectedMethod, $methodDoc); + } + + return $methodDoc; + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/GenerateTask.php b/vendor/consolidation/robo/src/Task/Development/GenerateTask.php new file mode 100644 index 0000000000000000000000000000000000000000..9d7a698e9ca159b5f6e4ad7ef86b2d517eb0739a --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/GenerateTask.php @@ -0,0 +1,107 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Task\BaseTask; +use Robo\Result; + +/** + * Generate a Robo Task that is a wrapper around an existing class. + * + * ``` php + * <?php + * $this->taskGenerateTask('Symfony\Component\Filesystem\Filesystem', 'FilesystemStack') + * ->run(); + * ``` + */ +class GenerateTask extends BaseTask +{ + /** + * @var string + */ + protected $className; + + /** + * @var string + */ + protected $wrapperClassName; + + /** + * @param string $className + * @param string $wrapperClassName + */ + public function __construct($className, $wrapperClassName = '') + { + $this->className = $className; + $this->wrapperClassName = $wrapperClassName; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $delegate = new \ReflectionClass($this->className); + $replacements = []; + + $leadingCommentChars = " * "; + $methodDescriptions = []; + $methodImplementations = []; + $immediateMethods = []; + foreach ($delegate->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { + $methodName = $method->name; + $getter = preg_match('/^(get|has|is)/', $methodName); + $setter = preg_match('/^(set|unset)/', $methodName); + $argPrototypeList = []; + $argNameList = []; + $needsImplementation = false; + foreach ($method->getParameters() as $arg) { + $argDescription = '$' . $arg->name; + $argNameList[] = $argDescription; + if ($arg->isOptional()) { + $argDescription = $argDescription . ' = ' . str_replace("\n", "", var_export($arg->getDefaultValue(), true)); + // We will create wrapper methods for any method that + // has default parameters. + $needsImplementation = true; + } + $argPrototypeList[] = $argDescription; + } + $argPrototypeString = implode(', ', $argPrototypeList); + $argNameListString = implode(', ', $argNameList); + + if ($methodName[0] != '_') { + $methodDescriptions[] = "@method $methodName($argPrototypeString)"; + + if ($getter) { + $immediateMethods[] = " public function $methodName($argPrototypeString)\n {\n return \$this->delegate->$methodName($argNameListString);\n }"; + } elseif ($setter) { + $immediateMethods[] = " public function $methodName($argPrototypeString)\n {\n \$this->delegate->$methodName($argNameListString);\n return \$this;\n }"; + } elseif ($needsImplementation) { + // Include an implementation for the wrapper method if necessary + $methodImplementations[] = " protected function _$methodName($argPrototypeString)\n {\n \$this->delegate->$methodName($argNameListString);\n }"; + } + } + } + + $classNameParts = explode('\\', $this->className); + $delegate = array_pop($classNameParts); + $delegateNamespace = implode('\\', $classNameParts); + + if (empty($this->wrapperClassName)) { + $this->wrapperClassName = $delegate; + } + + $replacements['{delegateNamespace}'] = $delegateNamespace; + $replacements['{delegate}'] = $delegate; + $replacements['{wrapperClassName}'] = $this->wrapperClassName; + $replacements['{taskname}'] = "task$delegate"; + $replacements['{methodList}'] = $leadingCommentChars . implode("\n$leadingCommentChars", $methodDescriptions); + $replacements['{immediateMethods}'] = "\n\n" . implode("\n\n", $immediateMethods); + $replacements['{methodImplementations}'] = "\n\n" . implode("\n\n", $methodImplementations); + + $template = file_get_contents(__DIR__ . '/../../../data/Task/Development/GeneratedWrapper.tmpl'); + $template = str_replace(array_keys($replacements), array_values($replacements), $template); + + // Returning data in the $message will cause it to be printed. + return Result::success($this, $template); + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/GitHub.php b/vendor/consolidation/robo/src/Task/Development/GitHub.php new file mode 100644 index 0000000000000000000000000000000000000000..9fc9909d4293fb968fda88553b0cb2e6dafa9bac --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/GitHub.php @@ -0,0 +1,157 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Exception\TaskException; +use Robo\Task\BaseTask; + +abstract class GitHub extends BaseTask +{ + const GITHUB_URL = 'https://api.github.com'; + + /** + * @var string + */ + protected $user = ''; + + /** + * @var string + */ + protected $password = ''; + + /** + * @var string + */ + protected $repo; + + /** + * @var string + */ + protected $owner; + + /** + * @var string + */ + protected $accessToken; + + /** + * @param string $repo + * + * @return $this + */ + public function repo($repo) + { + $this->repo = $repo; + return $this; + } + + /** + * @param string $owner + * + * @return $this + */ + public function owner($owner) + { + $this->owner = $owner; + return $this; + } + + /** + * @param string $uri + * + * @return $this + */ + public function uri($uri) + { + list($this->owner, $this->repo) = explode('/', $uri); + return $this; + } + + /** + * @return string + */ + protected function getUri() + { + return $this->owner . '/' . $this->repo; + } + + /** + * @param string $user + * + * @return $this + */ + public function user($user) + { + $this->user = $user; + return $this; + } + + /** + * @param $password + * + * @return $this + */ + public function password($password) + { + $this->password = $password; + return $this; + } + + /** + * @param $accessToken + * + * @return $this + */ + public function accessToken($token) + { + $this->accessToken = $token; + return $this; + } + + /** + * @param string $uri + * @param array $params + * @param string $method + * + * @return array + * + * @throws \Robo\Exception\TaskException + */ + protected function sendRequest($uri, $params = [], $method = 'POST') + { + if (!$this->owner or !$this->repo) { + throw new TaskException($this, 'Repo URI is not set'); + } + + $ch = curl_init(); + $url = sprintf('%s/repos/%s/%s', self::GITHUB_URL, $this->getUri(), $uri); + $this->printTaskInfo($url); + $this->printTaskInfo('{method} {url}', ['method' => $method, 'url' => $url]); + + if (!empty($this->user)) { + curl_setopt($ch, CURLOPT_USERPWD, $this->user . ':' . $this->password); + } + + if (!empty($this->accessToken)) { + $url .= "?access_token=" . $this->accessToken; + } + + curl_setopt_array( + $ch, + array( + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POST => $method != 'GET', + CURLOPT_POSTFIELDS => json_encode($params), + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_USERAGENT => "Robo" + ) + ); + + $output = curl_exec($ch); + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $response = json_decode($output); + + $this->printTaskInfo($output); + return [$code, $response]; + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/GitHubRelease.php b/vendor/consolidation/robo/src/Task/Development/GitHubRelease.php new file mode 100644 index 0000000000000000000000000000000000000000..bf7a4889e548ff41e690a43660450028d8ea9537 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/GitHubRelease.php @@ -0,0 +1,208 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Result; + +/** + * Publishes new GitHub release. + * + * ``` php + * <?php + * $this->taskGitHubRelease('0.1.0') + * ->uri('consolidation-org/Robo') + * ->description('Add stuff people need.') + * ->change('Fix #123') + * ->change('Add frobulation method to all widgets') + * ->run(); + * ?> + * ``` + */ +class GitHubRelease extends GitHub +{ + /** + * @var string + */ + protected $tag; + + /** + * @var string + */ + protected $name; + + /** + * @var string + */ + protected $description = ''; + + /** + * @var string[] + */ + protected $changes = []; + + /** + * @var bool + */ + protected $draft = false; + + /** + * @var bool + */ + protected $prerelease = false; + + /** + * @var string + */ + protected $comittish = 'master'; + + /** + * @param string $tag + */ + public function __construct($tag) + { + $this->tag = $tag; + } + + /** + * @param string $tag + * + * @return $this + */ + public function tag($tag) + { + $this->tag = $tag; + return $this; + } + + /** + * @param bool $draft + * + * @return $this + */ + public function draft($draft) + { + $this->draft = $draft; + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function name($name) + { + $this->name = $name; + return $this; + } + + /** + * @param string $description + * + * @return $this + */ + public function description($description) + { + $this->description = $description; + return $this; + } + + /** + * @param bool $prerelease + * + * @return $this + */ + public function prerelease($prerelease) + { + $this->prerelease = $prerelease; + return $this; + } + + /** + * @param string $comittish + * + * @return $this + */ + public function comittish($comittish) + { + $this->comittish = $comittish; + return $this; + } + + /** + * @param string $description + * + * @return $this + */ + public function appendDescription($description) + { + if (!empty($this->description)) { + $this->description .= "\n\n"; + } + $this->description .= $description; + return $this; + } + + public function changes(array $changes) + { + $this->changes = array_merge($this->changes, $changes); + return $this; + } + + /** + * @param string $change + * + * @return $this + */ + public function change($change) + { + $this->changes[] = $change; + return $this; + } + + /** + * @return string + */ + protected function getBody() + { + $body = $this->description; + if (!empty($this->changes)) { + $changes = array_map( + function ($line) { + return "* $line"; + }, + $this->changes + ); + $changesText = implode("\n", $changes); + $body .= "### Changelog \n\n$changesText"; + } + return $body; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Releasing {tag}', ['tag' => $this->tag]); + $this->startTimer(); + list($code, $data) = $this->sendRequest( + 'releases', + [ + "tag_name" => $this->tag, + "target_commitish" => $this->comittish, + "name" => $this->name, + "body" => $this->getBody(), + "draft" => $this->draft, + "prerelease" => $this->prerelease + ] + ); + $this->stopTimer(); + + return new Result( + $this, + in_array($code, [200, 201]) ? 0 : 1, + isset($data->message) ? $data->message : '', + ['response' => $data, 'time' => $this->getExecutionTime()] + ); + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/OpenBrowser.php b/vendor/consolidation/robo/src/Task/Development/OpenBrowser.php new file mode 100644 index 0000000000000000000000000000000000000000..ea01b326d846604d1c2715f282e57e9dcdafd3f6 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/OpenBrowser.php @@ -0,0 +1,80 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Task\BaseTask; +use Robo\Common\ProcessUtils; +use Robo\Result; + +/** + * Opens the default's user browser + * code inspired from openBrowser() function in https://github.com/composer/composer/blob/master/src/Composer/Command/HomeCommand.php + * + * ``` php + * <?php + * // open one browser window + * $this->taskOpenBrowser('http://localhost') + * ->run(); + * + * // open two browser windows + * $this->taskOpenBrowser([ + * 'http://localhost/mysite', + * 'http://localhost/mysite2' + * ]) + * ->run(); + * ``` + */ +class OpenBrowser extends BaseTask +{ + /** + * @var string[] + */ + protected $urls = []; + + /** + * @param string|array $url + */ + public function __construct($url) + { + $this->urls = (array) $url; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $openCommand = $this->getOpenCommand(); + + if (empty($openCommand)) { + return Result::error($this, 'no suitable browser opening command found'); + } + + foreach ($this->urls as $url) { + passthru(sprintf($openCommand, ProcessUtils::escapeArgument($url))); + $this->printTaskInfo('Opened {url}', ['url' => $url]); + } + + return Result::success($this); + } + + /** + * @return null|string + */ + private function getOpenCommand() + { + if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + return 'start "web" explorer "%s"'; + } + + passthru('which xdg-open', $linux); + passthru('which open', $osx); + + if (0 === $linux) { + return 'xdg-open %s'; + } + + if (0 === $osx) { + return 'open %s'; + } + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/PackPhar.php b/vendor/consolidation/robo/src/Task/Development/PackPhar.php new file mode 100644 index 0000000000000000000000000000000000000000..6d0a04d72aa1072776366350166c72c210097006 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/PackPhar.php @@ -0,0 +1,252 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Contract\ProgressIndicatorAwareInterface; +use Robo\Contract\PrintedInterface; +use Robo\Result; +use Robo\Task\BaseTask; + +/** + * Creates Phar. + * + * ``` php + * <?php + * $pharTask = $this->taskPackPhar('package/codecept.phar') + * ->compress() + * ->stub('package/stub.php'); + * + * $finder = Finder::create() + * ->name('*.php') + * ->in('src'); + * + * foreach ($finder as $file) { + * $pharTask->addFile('src/'.$file->getRelativePathname(), $file->getRealPath()); + * } + * + * $finder = Finder::create()->files() + * ->name('*.php') + * ->in('vendor'); + * + * foreach ($finder as $file) { + * $pharTask->addStripped('vendor/'.$file->getRelativePathname(), $file->getRealPath()); + * } + * $pharTask->run(); + * + * // verify Phar is packed correctly + * $code = $this->_exec('php package/codecept.phar'); + * ?> + * ``` + */ +class PackPhar extends BaseTask implements PrintedInterface, ProgressIndicatorAwareInterface +{ + /** + * @var \Phar + */ + protected $phar; + + /** + * @var null|string + */ + protected $compileDir = null; + + /** + * @var string + */ + protected $filename; + + /** + * @var bool + */ + protected $compress = false; + + protected $stub; + + protected $bin; + + /** + * @var string + */ + protected $stubTemplate = <<<EOF +#!/usr/bin/env php +<?php +Phar::mapPhar(); +%s +__HALT_COMPILER(); +EOF; + + /** + * @var string[] + */ + protected $files = []; + + /** + * {@inheritdoc} + */ + public function getPrinted() + { + return true; + } + + /** + * @param string $filename + */ + public function __construct($filename) + { + $file = new \SplFileInfo($filename); + $this->filename = $filename; + if (file_exists($file->getRealPath())) { + @unlink($file->getRealPath()); + } + $this->phar = new \Phar($file->getPathname(), 0, $file->getFilename()); + } + + /** + * @param bool $compress + * + * @return $this + */ + public function compress($compress = true) + { + $this->compress = $compress; + return $this; + } + + /** + * @param string $stub + * + * @return $this + */ + public function stub($stub) + { + $this->phar->setStub(file_get_contents($stub)); + return $this; + } + + /** + * {@inheritdoc} + */ + public function progressIndicatorSteps() + { + // run() will call advanceProgressIndicator() once for each + // file, one after calling stopBuffering, and again after compression. + return count($this->files)+2; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Creating {filename}', ['filename' => $this->filename]); + $this->phar->setSignatureAlgorithm(\Phar::SHA1); + $this->phar->startBuffering(); + + $this->printTaskInfo('Packing {file-count} files into phar', ['file-count' => count($this->files)]); + + $this->startProgressIndicator(); + foreach ($this->files as $path => $content) { + $this->phar->addFromString($path, $content); + $this->advanceProgressIndicator(); + } + $this->phar->stopBuffering(); + $this->advanceProgressIndicator(); + + if ($this->compress and in_array('GZ', \Phar::getSupportedCompression())) { + if (count($this->files) > 1000) { + $this->printTaskInfo('Too many files. Compression DISABLED'); + } else { + $this->printTaskInfo('{filename} compressed', ['filename' => $this->filename]); + $this->phar = $this->phar->compressFiles(\Phar::GZ); + } + } + $this->advanceProgressIndicator(); + $this->stopProgressIndicator(); + $this->printTaskSuccess('{filename} produced', ['filename' => $this->filename]); + return Result::success($this, '', ['time' => $this->getExecutionTime()]); + } + + /** + * @param string $path + * @param string $file + * + * @return $this + */ + public function addStripped($path, $file) + { + $this->files[$path] = $this->stripWhitespace(file_get_contents($file)); + return $this; + } + + /** + * @param string $path + * @param string $file + * + * @return $this + */ + public function addFile($path, $file) + { + $this->files[$path] = file_get_contents($file); + return $this; + } + + /** + * @param \Symfony\Component\Finder\SplFileInfo[] $files + */ + public function addFiles($files) + { + foreach ($files as $file) { + $this->addFile($file->getRelativePathname(), $file->getRealPath()); + } + } + + /** + * @param string $file + * + * @return $this + */ + public function executable($file) + { + $source = file_get_contents($file); + if (strpos($source, '#!/usr/bin/env php') === 0) { + $source = substr($source, strpos($source, '<?php') + 5); + } + $this->phar->setStub(sprintf($this->stubTemplate, $source)); + return $this; + } + + /** + * Strips whitespace from source. Taken from composer + * + * @param string $source + * + * @return string + */ + private function stripWhitespace($source) + { + if (!function_exists('token_get_all')) { + return $source; + } + + $output = ''; + foreach (token_get_all($source) as $token) { + if (is_string($token)) { + $output .= $token; + } elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) { + // $output .= $token[1]; + $output .= str_repeat("\n", substr_count($token[1], "\n")); + } elseif (T_WHITESPACE === $token[0]) { + // reduce wide spaces + $whitespace = preg_replace('{[ \t]+}', ' ', $token[1]); + // normalize newlines to \n + $whitespace = preg_replace('{(?:\r\n|\r|\n)}', "\n", $whitespace); + // trim leading spaces + $whitespace = preg_replace('{\n +}', "\n", $whitespace); + $output .= $whitespace; + } else { + $output .= $token[1]; + } + } + + return $output; + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/PhpServer.php b/vendor/consolidation/robo/src/Task/Development/PhpServer.php new file mode 100644 index 0000000000000000000000000000000000000000..6dd36680a70819f779c2c4e0acec631c37bdb6bc --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/PhpServer.php @@ -0,0 +1,86 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Task\Base\Exec; + +/** + * Runs PHP server and stops it when task finishes. + * + * ``` php + * <?php + * // run server in /public directory + * $this->taskServer(8000) + * ->dir('public') + * ->run(); + * + * // run with IP 0.0.0.0 + * $this->taskServer(8000) + * ->host('0.0.0.0') + * ->run(); + * + * // execute server in background + * $this->taskServer(8000) + * ->background() + * ->run(); + * ?> + * ``` + */ +class PhpServer extends Exec +{ + /** + * @var int + */ + protected $port; + + /** + * @var string + */ + protected $host = '127.0.0.1'; + + /** + * {@inheritdoc} + */ + protected $command = 'php -S %s:%d '; + + /** + * @param int $port + */ + public function __construct($port) + { + $this->port = $port; + + if (strtolower(PHP_OS) === 'linux') { + $this->command = 'exec php -S %s:%d '; + } + } + + /** + * @param string $host + * + * @return $this + */ + public function host($host) + { + $this->host = $host; + return $this; + } + + /** + * @param string $path + * + * @return $this + */ + public function dir($path) + { + $this->command .= "-t $path"; + return $this; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return sprintf($this->command . $this->arguments, $this->host, $this->port); + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/SemVer.php b/vendor/consolidation/robo/src/Task/Development/SemVer.php new file mode 100644 index 0000000000000000000000000000000000000000..639c15323af81b415548f618a05a303b3065684c --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/SemVer.php @@ -0,0 +1,255 @@ +<?php +namespace Robo\Task\Development; + +use Robo\Result; +use Robo\Contract\TaskInterface; +use Robo\Exception\TaskException; + +/** + * Helps to maintain `.semver` file. + * + * ```php + * <?php + * $this->taskSemVer('.semver') + * ->increment() + * ->run(); + * ?> + * ``` + * + */ +class SemVer implements TaskInterface +{ + const SEMVER = "---\n:major: %d\n:minor: %d\n:patch: %d\n:special: '%s'\n:metadata: '%s'"; + + const REGEX = "/^\-\-\-\r?\n:major:\s(0|[1-9]\d*)\r?\n:minor:\s(0|[1-9]\d*)\r?\n:patch:\s(0|[1-9]\d*)\r?\n:special:\s'([a-zA-z0-9]*\.?(?:0|[1-9]\d*)?)'\r?\n:metadata:\s'((?:0|[1-9]\d*)?(?:\.[a-zA-z0-9\.]*)?)'/"; + + const REGEX_STRING = '/^(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<patch>[0-9]+)(|-(?<special>[0-9a-zA-Z.]+))(|\+(?<metadata>[0-9a-zA-Z.]+))$/'; + + /** + * @var string + */ + protected $format = 'v%M.%m.%p%s'; + + /** + * @var string + */ + protected $specialSeparator = '-'; + + /** + * @var string + */ + protected $metadataSeparator = '+'; + + /** + * @var string + */ + protected $path; + + /** + * @var array + */ + protected $version = [ + 'major' => 0, + 'minor' => 0, + 'patch' => 0, + 'special' => '', + 'metadata' => '' + ]; + + /** + * @param string $filename + */ + public function __construct($filename = '') + { + $this->path = $filename; + + if (file_exists($this->path)) { + $semverFileContents = file_get_contents($this->path); + $this->parseFile($semverFileContents); + } + } + + /** + * @return string + */ + public function __toString() + { + $search = ['%M', '%m', '%p', '%s']; + $replace = $this->version + ['extra' => '']; + + foreach (['special', 'metadata'] as $key) { + if (!empty($replace[$key])) { + $separator = $key . 'Separator'; + $replace['extra'] .= $this->{$separator} . $replace[$key]; + } + unset($replace[$key]); + } + + return str_replace($search, $replace, $this->format); + } + + public function version($version) + { + $this->parseString($version); + return $this; + } + + /** + * @param string $format + * + * @return $this + */ + public function setFormat($format) + { + $this->format = $format; + return $this; + } + + /** + * @param string $separator + * + * @return $this + */ + public function setMetadataSeparator($separator) + { + $this->metadataSeparator = $separator; + return $this; + } + + /** + * @param string $separator + * + * @return $this + */ + public function setPrereleaseSeparator($separator) + { + $this->specialSeparator = $separator; + return $this; + } + + /** + * @param string $what + * + * @return $this + * + * @throws \Robo\Exception\TaskException + */ + public function increment($what = 'patch') + { + switch ($what) { + case 'major': + $this->version['major']++; + $this->version['minor'] = 0; + $this->version['patch'] = 0; + break; + case 'minor': + $this->version['minor']++; + $this->version['patch'] = 0; + break; + case 'patch': + $this->version['patch']++; + break; + default: + throw new TaskException( + $this, + 'Bad argument, only one of the following is allowed: major, minor, patch' + ); + } + return $this; + } + + /** + * @param string $tag + * + * @return $this + * + * @throws \Robo\Exception\TaskException + */ + public function prerelease($tag = 'RC') + { + if (!is_string($tag)) { + throw new TaskException($this, 'Bad argument, only strings allowed.'); + } + + $number = 0; + + if (!empty($this->version['special'])) { + list($current, $number) = explode('.', $this->version['special']); + if ($tag != $current) { + $number = 0; + } + } + + $number++; + + $this->version['special'] = implode('.', [$tag, $number]); + return $this; + } + + /** + * @param array|string $data + * + * @return $this + */ + public function metadata($data) + { + if (is_array($data)) { + $data = implode('.', $data); + } + + $this->version['metadata'] = $data; + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $written = $this->dump(); + return new Result($this, (int)($written === false), $this->__toString()); + } + + /** + * @return bool + * + * @throws \Robo\Exception\TaskException + */ + protected function dump() + { + if (empty($this->path)) { + return true; + } + extract($this->version); + $semver = sprintf(self::SEMVER, $major, $minor, $patch, $special, $metadata); + if (is_writeable($this->path) === false || file_put_contents($this->path, $semver) === false) { + throw new TaskException($this, 'Failed to write semver file.'); + } + return true; + } + + protected function parseString($semverString) + { + if (!preg_match_all(self::REGEX_STRING, $semverString, $matches)) { + throw new TaskException($this, 'Bad semver value: ' . $semverString); + } + + $this->version = array_intersect_key($matches, $this->version); + $this->version = array_map(function ($item) { + return $item[0]; + }, $this->version); + } + + /** + * @throws \Robo\Exception\TaskException + */ + protected function parseFile($semverFileContents) + { + if (!preg_match_all(self::REGEX, $semverFileContents, $matches)) { + throw new TaskException($this, 'Bad semver file.'); + } + + list(, $major, $minor, $patch, $special, $metadata) = array_map('current', $matches); + $this->version = compact('major', 'minor', 'patch', 'special', 'metadata'); + } +} diff --git a/vendor/consolidation/robo/src/Task/Development/loadTasks.php b/vendor/consolidation/robo/src/Task/Development/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..e3dc49a39def2baa700f7d546947c4ee527e2fe1 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Development/loadTasks.php @@ -0,0 +1,86 @@ +<?php +namespace Robo\Task\Development; + +trait loadTasks +{ + /** + * @param string $filename + * + * @return Changelog + */ + protected function taskChangelog($filename = 'CHANGELOG.md') + { + return $this->task(Changelog::class, $filename); + } + + /** + * @param string $filename + * + * @return GenerateMarkdownDoc + */ + protected function taskGenDoc($filename) + { + return $this->task(GenerateMarkdownDoc::class, $filename); + } + + /** + * @param string $className + * @param string $wrapperClassName + * + * @return \Robo\Task\Development\GenerateTask + */ + protected function taskGenTask($className, $wrapperClassName = '') + { + return $this->task(GenerateTask::class, $className, $wrapperClassName); + } + + /** + * @param string $pathToSemVer + * + * @return SemVer + */ + protected function taskSemVer($pathToSemVer = '.semver') + { + return $this->task(SemVer::class, $pathToSemVer); + } + + /** + * @param int $port + * + * @return PhpServer + */ + protected function taskServer($port = 8000) + { + return $this->task(PhpServer::class, $port); + } + + /** + * @param string $filename + * + * @return PackPhar + */ + protected function taskPackPhar($filename) + { + return $this->task(PackPhar::class, $filename); + } + + /** + * @param string $tag + * + * @return GitHubRelease + */ + protected function taskGitHubRelease($tag) + { + return $this->task(GitHubRelease::class, $tag); + } + + /** + * @param string|array $url + * + * @return OpenBrowser + */ + protected function taskOpenBrowser($url) + { + return $this->task(OpenBrowser::class, $url); + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Base.php b/vendor/consolidation/robo/src/Task/Docker/Base.php new file mode 100644 index 0000000000000000000000000000000000000000..135f39e7a503871a267696cec5b592c2422edfe4 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Base.php @@ -0,0 +1,28 @@ +<?php +namespace Robo\Task\Docker; + +use Robo\Common\ExecOneCommand; +use Robo\Contract\CommandInterface; +use Robo\Contract\PrintedInterface; +use Robo\Task\BaseTask; + +abstract class Base extends BaseTask implements CommandInterface, PrintedInterface +{ + use ExecOneCommand; + + /** + * @var string + */ + protected $command = ''; + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + return $this->executeCommand($command); + } + + abstract public function getCommand(); +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Build.php b/vendor/consolidation/robo/src/Task/Docker/Build.php new file mode 100644 index 0000000000000000000000000000000000000000..11eb92ab49a9942e9c7e3c8d39202f50c2ed6418 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Build.php @@ -0,0 +1,55 @@ +<?php +namespace Robo\Task\Docker; + +/** + * Builds Docker image + * + * ```php + * <?php + * $this->taskDockerBuild()->run(); + * + * $this->taskDockerBuild('path/to/dir') + * ->tag('database') + * ->run(); + * + * ?> + * + * ``` + * + * Class Build + * @package Robo\Task\Docker + */ +class Build extends Base +{ + /** + * @var string + */ + protected $path; + + /** + * @param string $path + */ + public function __construct($path = '.') + { + $this->command = "docker build"; + $this->path = $path; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . ' ' . $this->arguments . ' ' . $this->path; + } + + /** + * @param string $tag + * + * @return $this + */ + public function tag($tag) + { + return $this->option('-t', $tag); + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Commit.php b/vendor/consolidation/robo/src/Task/Docker/Commit.php new file mode 100644 index 0000000000000000000000000000000000000000..302f1920ed9620f1f667c2b9834d70b8f55438bb --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Commit.php @@ -0,0 +1,66 @@ +<?php +namespace Robo\Task\Docker; + +/** + * Commits docker container to an image + * + * ``` + * $this->taskDockerCommit($containerId) + * ->name('my/database') + * ->run(); + * + * // alternatively you can take the result from DockerRun task: + * + * $result = $this->taskDockerRun('db') + * ->exec('./prepare_database.sh') + * ->run(); + * + * $task->dockerCommit($result) + * ->name('my/database') + * ->run(); + * ``` + */ +class Commit extends Base +{ + /** + * @var string + */ + protected $command = "docker commit"; + + /** + * @var string + */ + protected $name; + + /** + * @var string + */ + protected $cid; + + /** + * @param string|\Robo\Task\Docker\Result $cidOrResult + */ + public function __construct($cidOrResult) + { + $this->cid = $cidOrResult instanceof Result ? $cidOrResult->getCid() : $cidOrResult; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . ' ' . $this->cid . ' ' . $this->name . ' ' . $this->arguments; + } + + /** + * @param $name + * + * @return $this + */ + public function name($name) + { + $this->name = $name; + return $this; + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Exec.php b/vendor/consolidation/robo/src/Task/Docker/Exec.php new file mode 100644 index 0000000000000000000000000000000000000000..fa67c8da0e9d5dc621fe4a17b7ad732cbd42ec67 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Exec.php @@ -0,0 +1,95 @@ +<?php +namespace Robo\Task\Docker; + +use Robo\Common\CommandReceiver; + +/** + * Executes command inside running Docker container + * + * ```php + * <?php + * $test = $this->taskDockerRun('test_env') + * ->detached() + * ->run(); + * + * $this->taskDockerExec($test) + * ->interactive() + * ->exec('./runtests') + * ->run(); + * + * // alternatively use commands from other tasks + * + * $this->taskDockerExec($test) + * ->interactive() + * ->exec($this->taskCodecept()->suite('acceptance')) + * ->run(); + * ?> + * ``` + * + */ +class Exec extends Base +{ + use CommandReceiver; + + /** + * @var string + */ + protected $command = "docker exec"; + + /** + * @var string + */ + protected $cid; + + /** + * @var string + */ + protected $run = ''; + + /** + * @param string|\Robo\Result $cidOrResult + */ + public function __construct($cidOrResult) + { + $this->cid = $cidOrResult instanceof Result ? $cidOrResult->getCid() : $cidOrResult; + } + + /** + * @return $this + */ + public function detached() + { + $this->option('-d'); + return $this; + } + + /** + * {@inheritdoc)} + */ + public function interactive($interactive = true) + { + if ($interactive) { + $this->option('-i'); + } + return parent::interactive($interactive); + } + + /** + * @param string|\Robo\Contract\CommandInterface $command + * + * @return $this + */ + public function exec($command) + { + $this->run = $this->receiveCommand($command); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . ' ' . $this->arguments . ' ' . $this->cid.' '.$this->run; + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Pull.php b/vendor/consolidation/robo/src/Task/Docker/Pull.php new file mode 100644 index 0000000000000000000000000000000000000000..32ba5b40f83db567bbc9b71329376f1a4a2b2f6f --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Pull.php @@ -0,0 +1,33 @@ +<?php +namespace Robo\Task\Docker; + +/** + * Pulls an image from DockerHub + * + * ```php + * <?php + * $this->taskDockerPull('wordpress') + * ->run(); + * + * ?> + * ``` + * + */ +class Pull extends Base +{ + /** + * @param string $image + */ + public function __construct($image) + { + $this->command = "docker pull $image "; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . ' ' . $this->arguments; + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Remove.php b/vendor/consolidation/robo/src/Task/Docker/Remove.php new file mode 100644 index 0000000000000000000000000000000000000000..0a8c0ac619c7a15324f53c4cd94159f13d600db6 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Remove.php @@ -0,0 +1,32 @@ +<?php +namespace Robo\Task\Docker; + +/** + * Remove docker container + * + * ```php + * <?php + * $this->taskDockerRemove($container) + * ->run(); + * ?> + * ``` + * + */ +class Remove extends Base +{ + /** + * @param string $container + */ + public function __construct($container) + { + $this->command = "docker rm $container "; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . ' ' . $this->arguments; + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Result.php b/vendor/consolidation/robo/src/Task/Docker/Result.php new file mode 100644 index 0000000000000000000000000000000000000000..0533159a8744af25af9b3fee715944842edd2860 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Result.php @@ -0,0 +1,35 @@ +<?php +namespace Robo\Task\Docker; + +class Result extends \Robo\Result +{ + + /** + * Do not print result, as it was already printed + */ + protected function printResult() + { + } + + /** + * @return null|string + */ + public function getCid() + { + if (isset($this['cid'])) { + return $this['cid']; + } + return null; + } + + /** + * @return null|string + */ + public function getContainerName() + { + if (isset($this['name'])) { + return $this['name']; + } + return null; + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Run.php b/vendor/consolidation/robo/src/Task/Docker/Run.php new file mode 100644 index 0000000000000000000000000000000000000000..a02ea76f63c9e6230531e289539f45f52d86af8f --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Run.php @@ -0,0 +1,301 @@ +<?php +namespace Robo\Task\Docker; + +use Robo\Common\CommandReceiver; + +/** + * Performs `docker run` on a container. + * + * ```php + * <?php + * $this->taskDockerRun('mysql')->run(); + * + * $result = $this->taskDockerRun('my_db_image') + * ->env('DB', 'database_name') + * ->volume('/path/to/data', '/data') + * ->detached() + * ->publish(3306) + * ->name('my_mysql') + * ->run(); + * + * // retrieve container's cid: + * $this->say("Running container ".$result->getCid()); + * + * // execute script inside container + * $result = $this->taskDockerRun('db') + * ->exec('prepare_test_data.sh') + * ->run(); + * + * $this->taskDockerCommit($result) + * ->name('test_db') + * ->run(); + * + * // link containers + * $mysql = $this->taskDockerRun('mysql') + * ->name('wp_db') // important to set name for linked container + * ->env('MYSQL_ROOT_PASSWORD', '123456') + * ->run(); + * + * $this->taskDockerRun('wordpress') + * ->link($mysql) + * ->publish(80, 8080) + * ->detached() + * ->run(); + * + * ?> + * ``` + * + */ +class Run extends Base +{ + use CommandReceiver; + + /** + * @var string + */ + protected $image = ''; + + /** + * @var string + */ + protected $run = ''; + + /** + * @var string + */ + protected $cidFile; + + /** + * @var string + */ + protected $name; + + /** + * @var string + */ + protected $dir; + + /** + * @param string $image + */ + public function __construct($image) + { + $this->image = $image; + } + + /** + * {@inheritdoc} + */ + public function getPrinted() + { + return $this->isPrinted; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + if ($this->isPrinted) { + $this->option('-i'); + } + if ($this->cidFile) { + $this->option('cidfile', $this->cidFile); + } + return trim('docker run ' . $this->arguments . ' ' . $this->image . ' ' . $this->run); + } + + /** + * @return $this + */ + public function detached() + { + $this->option('-d'); + return $this; + } + + /** + * {@inheritdoc)} + */ + public function interactive($interactive = true) + { + if ($interactive) { + $this->option('-i'); + } + return parent::interactive($interactive); + } + + /** + * @param string|\Robo\Contract\CommandInterface $run + * + * @return $this + */ + public function exec($run) + { + $this->run = $this->receiveCommand($run); + return $this; + } + + /** + * @param string $from + * @param null|string $to + * + * @return $this + */ + public function volume($from, $to = null) + { + $volume = $to ? "$from:$to" : $from; + $this->option('-v', $volume); + return $this; + } + + /** + * Set environment variables. + * n.b. $this->env($variable, $value) also available here, + * inherited from ExecTrait. + * + * @param array $env + * @return type + */ + public function envVars(array $env) + { + foreach ($env as $variable => $value) { + $this->setDockerEnv($variable, $value); + } + return $this; + } + + /** + * @param string $variable + * @param null|string $value + * + * @return $this + */ + protected function setDockerEnv($variable, $value = null) + { + $env = $value ? "$variable=$value" : $variable; + return $this->option("-e", $env); + } + + /** + * @param null|int $port + * @param null|int $portTo + * + * @return $this + */ + public function publish($port = null, $portTo = null) + { + if (!$port) { + return $this->option('-P'); + } + if ($portTo) { + $port = "$port:$portTo"; + } + return $this->option('-p', $port); + } + + /** + * @param string $dir + * + * @return $this + */ + public function containerWorkdir($dir) + { + return $this->option('-w', $dir); + } + + /** + * @param string $user + * + * @return $this + */ + public function user($user) + { + return $this->option('-u', $user); + } + + /** + * @return $this + */ + public function privileged() + { + return $this->option('--privileged'); + } + + /** + * @param string $name + * + * @return $this + */ + public function name($name) + { + $this->name = $name; + return $this->option('name', $name); + } + + /** + * @param string|\Robo\Task\Docker\Result $name + * @param string $alias + * + * @return $this + */ + public function link($name, $alias) + { + if ($name instanceof Result) { + $name = $name->getContainerName(); + } + $this->option('link', "$name:$alias"); + return $this; + } + + /** + * @param string $dir + * + * @return $this + */ + public function tmpDir($dir) + { + $this->dir = $dir; + return $this; + } + + /** + * @return string + */ + public function getTmpDir() + { + return $this->dir ? $this->dir : sys_get_temp_dir(); + } + + /** + * @return string + */ + public function getUniqId() + { + return uniqid(); + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->cidFile = $this->getTmpDir() . '/docker_' . $this->getUniqId() . '.cid'; + $result = parent::run(); + $result['cid'] = $this->getCid(); + return $result; + } + + /** + * @return null|string + */ + protected function getCid() + { + if (!$this->cidFile || !file_exists($this->cidFile)) { + return null; + } + $cid = trim(file_get_contents($this->cidFile)); + @unlink($this->cidFile); + return $cid; + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Start.php b/vendor/consolidation/robo/src/Task/Docker/Start.php new file mode 100644 index 0000000000000000000000000000000000000000..ef19d74d14c1742f9cea17db7cdf99551790cdfe --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Start.php @@ -0,0 +1,41 @@ +<?php +namespace Robo\Task\Docker; + +/** + * Starts Docker container + * + * ```php + * <?php + * $this->taskDockerStart($cidOrResult) + * ->run(); + * ?> + * ``` + */ +class Start extends Base +{ + /** + * @var string + */ + protected $command = "docker start"; + + /** + * @var null|string + */ + protected $cid; + + /** + * @param string|\Robo\Task\Docker\Result $cidOrResult + */ + public function __construct($cidOrResult) + { + $this->cid = $cidOrResult instanceof Result ? $cidOrResult->getCid() : $cidOrResult; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . ' ' . $this->arguments . ' ' . $this->cid; + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/Stop.php b/vendor/consolidation/robo/src/Task/Docker/Stop.php new file mode 100644 index 0000000000000000000000000000000000000000..4d0d436d3f4037546bf5de8e97c8e7add31b2cb6 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/Stop.php @@ -0,0 +1,41 @@ +<?php +namespace Robo\Task\Docker; + +/** + * Stops Docker container + * + * ```php + * <?php + * $this->taskDockerStop($cidOrResult) + * ->run(); + * ?> + * ``` + */ +class Stop extends Base +{ + /** + * @var string + */ + protected $command = "docker stop"; + + /** + * @var null|string + */ + protected $cid; + + /** + * @param string|\Robo\Task\Docker\Result $cidOrResult + */ + public function __construct($cidOrResult) + { + $this->cid = $cidOrResult instanceof Result ? $cidOrResult->getCid() : $cidOrResult; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . ' ' . $this->arguments . ' ' . $this->cid; + } +} diff --git a/vendor/consolidation/robo/src/Task/Docker/loadTasks.php b/vendor/consolidation/robo/src/Task/Docker/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..e58f5ef0c569fe1f611be0cc841813b838e18f48 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Docker/loadTasks.php @@ -0,0 +1,85 @@ +<?php +namespace Robo\Task\Docker; + +trait loadTasks +{ + /** + * @param string $image + * + * @return \Robo\Task\Docker\Run + */ + protected function taskDockerRun($image) + { + return $this->task(Run::class, $image); + } + + /** + * @param string $image + * + * @return \Robo\Task\Docker\Pull + */ + protected function taskDockerPull($image) + { + return $this->task(Pull::class, $image); + } + + /** + * @param string $path + * + * @return \Robo\Task\Docker\Build + */ + protected function taskDockerBuild($path = '.') + { + return $this->task(Build::class, $path); + } + + /** + * @param string|\Robo\Task\Docker\Result $cidOrResult + * + * @return \Robo\Task\Docker\Stop + */ + protected function taskDockerStop($cidOrResult) + { + return $this->task(Stop::class, $cidOrResult); + } + + /** + * @param string|\Robo\Task\Docker\Result $cidOrResult + * + * @return \Robo\Task\Docker\Commit + */ + protected function taskDockerCommit($cidOrResult) + { + return $this->task(Commit::class, $cidOrResult); + } + + /** + * @param string|\Robo\Task\Docker\Result $cidOrResult + * + * @return \Robo\Task\Docker\Start + */ + protected function taskDockerStart($cidOrResult) + { + return $this->task(Start::class, $cidOrResult); + } + + /** + * @param string|\Robo\Task\Docker\Result $cidOrResult + * + * @return \Robo\Task\Docker\Remove + */ + protected function taskDockerRemove($cidOrResult) + { + return $this->task(Remove::class, $cidOrResult); + } + + /** + * @param string|\Robo\Task\Docker\Result $cidOrResult + * + * @return \Robo\Task\Docker\Exec + */ + protected function taskDockerExec($cidOrResult) + { + return $this->task(Exec::class, $cidOrResult); + } +} diff --git a/vendor/consolidation/robo/src/Task/File/Concat.php b/vendor/consolidation/robo/src/Task/File/Concat.php new file mode 100644 index 0000000000000000000000000000000000000000..12b1eca00fe0bdbcd5f4f6ae39ee9e9add1a9d9b --- /dev/null +++ b/vendor/consolidation/robo/src/Task/File/Concat.php @@ -0,0 +1,101 @@ +<?php +namespace Robo\Task\File; + +use Iterator; +use Robo\Common\ResourceExistenceChecker; +use Robo\Result; +use Robo\Task\BaseTask; + +/** + * Merges files into one. Used for preparing assets. + * + * ``` php + * <?php + * $this->taskConcat([ + * 'web/assets/screen.css', + * 'web/assets/print.css', + * 'web/assets/theme.css' + * ]) + * ->to('web/assets/style.css') + * ->run() + * ?> + * ``` + */ +class Concat extends BaseTask +{ + use ResourceExistenceChecker; + + /** + * @var array|Iterator + */ + protected $files; + + /** + * @var string + */ + protected $dst; + + /** + * Constructor. + * + * @param array|Iterator $files + */ + public function __construct($files) + { + $this->files = $files; + } + + /** + * set the destination file + * + * @param string $dst + * + * @return $this + */ + public function to($dst) + { + $this->dst = $dst; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + if (is_null($this->dst) || "" === $this->dst) { + return Result::error($this, 'You must specify a destination file with to() method.'); + } + + if (!$this->checkResources($this->files, 'file')) { + return Result::error($this, 'Source files are missing!'); + } + + if (file_exists($this->dst) && !is_writable($this->dst)) { + return Result::error($this, 'Destination already exists and cannot be overwritten.'); + } + + $dump = ''; + + foreach ($this->files as $path) { + foreach (glob($path) as $file) { + $dump .= file_get_contents($file) . "\n"; + } + } + + $this->printTaskInfo('Writing {destination}', ['destination' => $this->dst]); + + $dst = $this->dst . '.part'; + $write_result = file_put_contents($dst, $dump); + + if (false === $write_result) { + @unlink($dst); + return Result::error($this, 'File write failed.'); + } + // Cannot be cross-volume; should always succeed. + @rename($dst, $this->dst); + + return Result::success($this); + } +} diff --git a/vendor/consolidation/robo/src/Task/File/Replace.php b/vendor/consolidation/robo/src/Task/File/Replace.php new file mode 100644 index 0000000000000000000000000000000000000000..0107df13c3e7c20e75c34ae07bcbe88ff1d325fc --- /dev/null +++ b/vendor/consolidation/robo/src/Task/File/Replace.php @@ -0,0 +1,141 @@ +<?php +namespace Robo\Task\File; + +use Robo\Result; +use Robo\Task\BaseTask; + +/** + * Performs search and replace inside a files. + * + * ``` php + * <?php + * $this->taskReplaceInFile('VERSION') + * ->from('0.2.0') + * ->to('0.3.0') + * ->run(); + * + * $this->taskReplaceInFile('README.md') + * ->from(date('Y')-1) + * ->to(date('Y')) + * ->run(); + * + * $this->taskReplaceInFile('config.yml') + * ->regex('~^service:~') + * ->to('services:') + * ->run(); + * + * $this->taskReplaceInFile('box/robo.txt') + * ->from(array('##dbname##', '##dbhost##')) + * ->to(array('robo', 'localhost')) + * ->run(); + * ?> + * ``` + */ +class Replace extends BaseTask +{ + /** + * @var string + */ + protected $filename; + + /** + * @var string|string[] + */ + protected $from; + + /** + * @var string|string[] + */ + protected $to; + + /** + * @var string + */ + protected $regex; + + /** + * @param string $filename + */ + public function __construct($filename) + { + $this->filename = $filename; + } + + /** + * @param string $filename + * + * @return $this + */ + public function filename($filename) + { + $this->filename = $filename; + return $this; + } + + /** + * String(s) to be replaced. + * + * @param string|string[] $from + * + * @return $this + */ + public function from($from) + { + $this->from = $from; + return $this; + } + + /** + * Value(s) to be set as a replacement. + * + * @param string|string[] $to + * + * @return $this + */ + public function to($to) + { + $this->to = $to; + return $this; + } + + /** + * Regex to match string to be replaced. + * + * @param string $regex + * + * @return $this + */ + public function regex($regex) + { + $this->regex = $regex; + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + if (!file_exists($this->filename)) { + $this->printTaskError('File {filename} does not exist', ['filename' => $this->filename]); + return false; + } + + $text = file_get_contents($this->filename); + if ($this->regex) { + $text = preg_replace($this->regex, $this->to, $text, -1, $count); + } else { + $text = str_replace($this->from, $this->to, $text, $count); + } + if ($count > 0) { + $res = file_put_contents($this->filename, $text); + if ($res === false) { + return Result::error($this, "Error writing to file {filename}.", ['filename' => $this->filename]); + } + $this->printTaskSuccess("{filename} updated. {count} items replaced", ['filename' => $this->filename, 'count' => $count]); + } else { + $this->printTaskInfo("{filename} unchanged. {count} items replaced", ['filename' => $this->filename, 'count' => $count]); + } + return Result::success($this, '', ['replaced' => $count]); + } +} diff --git a/vendor/consolidation/robo/src/Task/File/TmpFile.php b/vendor/consolidation/robo/src/Task/File/TmpFile.php new file mode 100644 index 0000000000000000000000000000000000000000..4a18691d64a204203e126575319b4641088632ef --- /dev/null +++ b/vendor/consolidation/robo/src/Task/File/TmpFile.php @@ -0,0 +1,72 @@ +<?php + +namespace Robo\Task\File; + +use Robo\Contract\CompletionInterface; + +/** + * Create a temporary file that is automatically cleaned up + * once the task collection is is part of completes. When created, + * it is given a random filename. + * + * This temporary file may be manipulated exacatly like taskWrite(). + * It is deleted as soon as the collection it is a part of completes + * or rolls back. + * + * ``` php + * <?php + * $collection = $this->collectionBuilder(); + * $tmpFilePath = $collection->taskTmpFile() + * ->line('-----') + * ->line(date('Y-m-d').' '.$title) + * ->line('----') + * ->getPath(); + * $collection->run(); + * ?> + * ``` + */ +class TmpFile extends Write implements CompletionInterface +{ + /** + * @param string $filename + * @param string $extension + * @param string $baseDir + * @param bool $includeRandomPart + */ + public function __construct($filename = 'tmp', $extension = '', $baseDir = '', $includeRandomPart = true) + { + if (empty($baseDir)) { + $baseDir = sys_get_temp_dir(); + } + if ($includeRandomPart) { + $random = static::randomString(); + $filename = "{$filename}_{$random}"; + } + $filename .= $extension; + parent::__construct("{$baseDir}/{$filename}"); + } + + /** + * Generate a suitably random string to use as the suffix for our + * temporary file. + * + * @param int $length + * + * @return string + */ + private static function randomString($length = 12) + { + return substr(str_shuffle('23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'), 0, $length); + } + + /** + * Delete this file when our collection completes. + * If this temporary file is not part of a collection, + * then it will be deleted when the program terminates, + * presuming that it was created by taskTmpFile() or _tmpFile(). + */ + public function complete() + { + unlink($this->getPath()); + } +} diff --git a/vendor/consolidation/robo/src/Task/File/Write.php b/vendor/consolidation/robo/src/Task/File/Write.php new file mode 100644 index 0000000000000000000000000000000000000000..dc2199f927078a6e1448224068e18922a05b8202 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/File/Write.php @@ -0,0 +1,335 @@ +<?php + +namespace Robo\Task\File; + +use Robo\Result; +use Robo\Task\BaseTask; + +/** + * Writes to file. + * + * ``` php + * <?php + * $this->taskWriteToFile('blogpost.md') + * ->line('-----') + * ->line(date('Y-m-d').' '.$title) + * ->line('----') + * ->run(); + * ?> + * ``` + */ +class Write extends BaseTask +{ + /** + * @var array + */ + protected $stack = []; + + /** + * @var string + */ + protected $filename; + + /** + * @var bool + */ + protected $append = false; + + /** + * @var null|string + */ + protected $originalContents = null; + + /** + * @param string $filename + */ + public function __construct($filename) + { + $this->filename = $filename; + } + + /** + * @param string $filename + * + * @return $this + */ + public function filename($filename) + { + $this->filename = $filename; + return $this; + } + + /** + * @param bool $append + * + * @return $this + */ + public function append($append = true) + { + $this->append = $append; + return $this; + } + + /** + * add a line. + * + * @param string $line + * + * @return $this The current instance + */ + public function line($line) + { + $this->text($line . "\n"); + return $this; + } + + /** + * add more lines. + * + * @param array $lines + * + * @return $this The current instance + */ + public function lines(array $lines) + { + $this->text(implode("\n", $lines) . "\n"); + return $this; + } + + /** + * add a text. + * + * @param string $text + * + * @return $this The current instance + */ + public function text($text) + { + $this->stack[] = array_merge([__FUNCTION__ . 'Collect'], func_get_args()); + return $this; + } + + /** + * add a text from a file. + * + * Note that the file is read in the run() method of this task. + * To load text from the current state of a file (e.g. one that may + * be deleted or altered by other tasks prior the execution of this one), + * use: + * $task->text(file_get_contents($filename)); + * + * @param string $filename + * + * @return $this The current instance + */ + public function textFromFile($filename) + { + $this->stack[] = array_merge([__FUNCTION__ . 'Collect'], func_get_args()); + return $this; + } + + /** + * substitute a placeholder with value, placeholder must be enclosed by `{}`. + * + * @param string $name + * @param string $val + * + * @return $this The current instance + */ + public function place($name, $val) + { + $this->replace('{'.$name.'}', $val); + + return $this; + } + + /** + * replace any string with value. + * + * @param string $string + * @param string $replacement + * + * @return $this The current instance + */ + public function replace($string, $replacement) + { + $this->stack[] = array_merge([__FUNCTION__ . 'Collect'], func_get_args()); + return $this; + } + + /** + * replace any string with value using regular expression. + * + * @param string $pattern + * @param string $replacement + * + * @return $this The current instance + */ + public function regexReplace($pattern, $replacement) + { + $this->stack[] = array_merge([__FUNCTION__ . 'Collect'], func_get_args()); + return $this; + } + + /** + * Append the provided text to the end of the buffer if the provided + * regex pattern matches any text already in the buffer. + * + * @param string $pattern + * @param string $text + * + * @return $this + */ + public function appendIfMatches($pattern, $text) + { + $this->stack[] = array_merge(['appendIfMatchesCollect'], [$pattern, $text, true]); + return $this; + } + + /** + * Append the provided text to the end of the buffer unless the provided + * regex pattern matches any text already in the buffer. + * + * @param string $pattern + * @param string $text + * + * @return $this + */ + public function appendUnlessMatches($pattern, $text) + { + $this->stack[] = array_merge(['appendIfMatchesCollect'], [$pattern, $text, false]); + return $this; + } + + /** + * @param $contents string + * @param $filename string + * + * @return string + */ + protected function textFromFileCollect($contents, $filename) + { + if (file_exists($filename)) { + $contents .= file_get_contents($filename); + } + return $contents; + } + + /** + * @param string|string[] $contents + * @param string|string[] $string + * @param string|string[] $replacement + * + * @return string|string[] + */ + protected function replaceCollect($contents, $string, $replacement) + { + return str_replace($string, $replacement, $contents); + } + + /** + * @param string|string[] $contents + * @param string|string[] $pattern + * @param string|string[] $replacement + * + * @return string|string[] + */ + protected function regexReplaceCollect($contents, $pattern, $replacement) + { + return preg_replace($pattern, $replacement, $contents); + } + + /** + * @param string $contents + * @param string $text + * + * @return string + */ + protected function textCollect($contents, $text) + { + return $contents . $text; + } + + /** + * @param string $contents + * @param string $pattern + * @param string $text + * @param bool $shouldMatch + * + * @return string + */ + protected function appendIfMatchesCollect($contents, $pattern, $text, $shouldMatch) + { + if (preg_match($pattern, $contents) == $shouldMatch) { + $contents .= $text; + } + return $contents; + } + + /** + * @return string + */ + public function originalContents() + { + if (!isset($this->originalContents)) { + $this->originalContents = ''; + if (file_exists($this->filename)) { + $this->originalContents = file_get_contents($this->filename); + } + } + return $this->originalContents; + } + + /** + * @return bool + */ + public function wouldChange() + { + return $this->originalContents() != $this->getContentsToWrite(); + } + + /** + * @return string + */ + protected function getContentsToWrite() + { + $contents = ""; + if ($this->append) { + $contents = $this->originalContents(); + } + foreach ($this->stack as $action) { + $command = array_shift($action); + if (method_exists($this, $command)) { + array_unshift($action, $contents); + $contents = call_user_func_array([$this, $command], $action); + } + } + return $contents; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo("Writing to {filename}.", ['filename' => $this->filename]); + $contents = $this->getContentsToWrite(); + if (!file_exists(dirname($this->filename))) { + mkdir(dirname($this->filename), 0777, true); + } + $res = file_put_contents($this->filename, $contents); + if ($res === false) { + return Result::error($this, "File {$this->filename} couldn't be created"); + } + + return Result::success($this); + } + + /** + * @return string + */ + public function getPath() + { + return $this->filename; + } +} diff --git a/vendor/consolidation/robo/src/Task/File/loadTasks.php b/vendor/consolidation/robo/src/Task/File/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..c5f39c950024085ebf59bb68cc1ea9c9affe7efa --- /dev/null +++ b/vendor/consolidation/robo/src/Task/File/loadTasks.php @@ -0,0 +1,48 @@ +<?php +namespace Robo\Task\File; + +trait loadTasks +{ + /** + * @param array|\Iterator $files + * + * @return \Robo\Task\File\Concat + */ + protected function taskConcat($files) + { + return $this->task(Concat::class, $files); + } + + /** + * @param string $file + * + * @return \Robo\Task\File\Replace + */ + protected function taskReplaceInFile($file) + { + return $this->task(Replace::class, $file); + } + + /** + * @param string $file + * + * @return \Robo\Task\File\Write + */ + protected function taskWriteToFile($file) + { + return $this->task(Write::class, $file); + } + + /** + * @param string $filename + * @param string $extension + * @param string $baseDir + * @param bool $includeRandomPart + * + * @return \Robo\Task\File\TmpFile + */ + protected function taskTmpFile($filename = 'tmp', $extension = '', $baseDir = '', $includeRandomPart = true) + { + return $this->task(TmpFile::class, $filename, $extension, $baseDir, $includeRandomPart); + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/BaseDir.php b/vendor/consolidation/robo/src/Task/Filesystem/BaseDir.php new file mode 100644 index 0000000000000000000000000000000000000000..434334d79740638daa5313429776e9598364129b --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/BaseDir.php @@ -0,0 +1,30 @@ +<?php +namespace Robo\Task\Filesystem; + +use Robo\Task\BaseTask; +use Symfony\Component\Filesystem\Filesystem as sfFilesystem; + +abstract class BaseDir extends BaseTask +{ + /** + * @var string[] + */ + protected $dirs = []; + + /** + * @var \Symfony\Component\Filesystem\Filesystem + */ + protected $fs; + + /** + * @param string|string[] $dirs + */ + public function __construct($dirs) + { + is_array($dirs) + ? $this->dirs = $dirs + : $this->dirs[] = $dirs; + + $this->fs = new sfFilesystem(); + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/CleanDir.php b/vendor/consolidation/robo/src/Task/Filesystem/CleanDir.php new file mode 100644 index 0000000000000000000000000000000000000000..762f8550962d9ef830a0b0f0a6b28a6ac25295eb --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/CleanDir.php @@ -0,0 +1,63 @@ +<?php +namespace Robo\Task\Filesystem; + +use Robo\Common\ResourceExistenceChecker; +use Robo\Result; + +/** + * Deletes all files from specified dir, ignoring git files. + * + * ``` php + * <?php + * $this->taskCleanDir(['tmp','logs'])->run(); + * // as shortcut + * $this->_cleanDir('app/cache'); + * ?> + * ``` + */ +class CleanDir extends BaseDir +{ + use ResourceExistenceChecker; + + /** + * {@inheritdoc} + */ + public function run() + { + if (!$this->checkResources($this->dirs, 'dir')) { + return Result::error($this, 'Source directories are missing!'); + } + foreach ($this->dirs as $dir) { + $this->emptyDir($dir); + $this->printTaskInfo("Cleaned {dir}", ['dir' => $dir]); + } + return Result::success($this); + } + + /** + * @param string $path + */ + protected function emptyDir($path) + { + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($path), + \RecursiveIteratorIterator::CHILD_FIRST + ); + + foreach ($iterator as $path) { + if ($path->isDir()) { + $dir = (string)$path; + if (basename($dir) === '.' || basename($dir) === '..') { + continue; + } + $this->fs->remove($dir); + } else { + $file = (string)$path; + if (basename($file) === '.gitignore' || basename($file) === '.gitkeep') { + continue; + } + $this->fs->remove($file); + } + } + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/CopyDir.php b/vendor/consolidation/robo/src/Task/Filesystem/CopyDir.php new file mode 100644 index 0000000000000000000000000000000000000000..084822229b4d59878663f7452f160c29f11eeafd --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/CopyDir.php @@ -0,0 +1,162 @@ +<?php +namespace Robo\Task\Filesystem; + +use Robo\Common\ResourceExistenceChecker; +use Robo\Result; +use Robo\Exception\TaskException; + +/** + * Copies one dir into another + * + * ``` php + * <?php + * $this->taskCopyDir(['dist/config' => 'config'])->run(); + * // as shortcut + * $this->_copyDir('dist/config', 'config'); + * ?> + * ``` + */ +class CopyDir extends BaseDir +{ + use ResourceExistenceChecker; + + /** + * Explicitly declare our consturctor, so that + * our copyDir() method does not look like a php4 constructor. + */ + public function __construct($dirs) + { + parent::__construct($dirs); + } + + /** + * @var int + */ + protected $chmod = 0755; + + /** + * Files to exclude on copying. + * + * @var string[] + */ + protected $exclude = []; + + /** + * Overwrite destination files newer than source files. + */ + protected $overwrite = true; + + /** + * {@inheritdoc} + */ + public function run() + { + if (!$this->checkResources($this->dirs, 'dir')) { + return Result::error($this, 'Source directories are missing!'); + } + foreach ($this->dirs as $src => $dst) { + $this->copyDir($src, $dst); + $this->printTaskInfo('Copied from {source} to {destination}', ['source' => $src, 'destination' => $dst]); + } + return Result::success($this); + } + + /** + * Sets the default folder permissions for the destination if it doesn't exist + * + * @link http://en.wikipedia.org/wiki/Chmod + * @link http://php.net/manual/en/function.mkdir.php + * @link http://php.net/manual/en/function.chmod.php + * + * @param int $value + * + * @return $this + */ + public function dirPermissions($value) + { + $this->chmod = (int)$value; + return $this; + } + + /** + * List files to exclude. + * + * @param string[] $exclude + * + * @return $this + */ + public function exclude($exclude = []) + { + $this->exclude = $this->simplifyForCompare($exclude); + return $this; + } + + /** + * Destination files newer than source files are overwritten. + * + * @param bool $overwrite + * + * @return $this + */ + public function overwrite($overwrite) + { + $this->overwrite = $overwrite; + return $this; + } + + /** + * Copies a directory to another location. + * + * @param string $src Source directory + * @param string $dst Destination directory + * @param string $parent Parent directory + * + * @throws \Robo\Exception\TaskException + */ + protected function copyDir($src, $dst, $parent = '') + { + $dir = @opendir($src); + if (false === $dir) { + throw new TaskException($this, "Cannot open source directory '" . $src . "'"); + } + if (!is_dir($dst)) { + mkdir($dst, $this->chmod, true); + } + while (false !== ($file = readdir($dir))) { + // Support basename and full path exclusion. + if ($this->excluded($file, $src, $parent)) { + continue; + } + $srcFile = $src . '/' . $file; + $destFile = $dst . '/' . $file; + if (is_dir($srcFile)) { + $this->copyDir($srcFile, $destFile, $parent . $file . DIRECTORY_SEPARATOR); + } else { + $this->fs->copy($srcFile, $destFile, $this->overwrite); + } + } + closedir($dir); + } + + /** + * Check to see if the current item is excluded. + */ + protected function excluded($file, $src, $parent) + { + return + ($file == '.') || + ($file == '..') || + in_array($file, $this->exclude) || + in_array($this->simplifyForCompare($parent . $file), $this->exclude) || + in_array($this->simplifyForCompare($src . DIRECTORY_SEPARATOR . $file), $this->exclude); + } + + /** + * Avoid problems comparing paths on Windows that may have a + * combination of DIRECTORY_SEPARATOR and /. + */ + protected function simplifyForCompare($item) + { + return str_replace(DIRECTORY_SEPARATOR, '/', $item); + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/DeleteDir.php b/vendor/consolidation/robo/src/Task/Filesystem/DeleteDir.php new file mode 100644 index 0000000000000000000000000000000000000000..25cf007b59422d20dcbc941857fc6e1c3111db4b --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/DeleteDir.php @@ -0,0 +1,36 @@ +<?php +namespace Robo\Task\Filesystem; + +use Robo\Common\ResourceExistenceChecker; +use Robo\Result; + +/** + * Deletes dir + * + * ``` php + * <?php + * $this->taskDeleteDir('tmp')->run(); + * // as shortcut + * $this->_deleteDir(['tmp', 'log']); + * ?> + * ``` + */ +class DeleteDir extends BaseDir +{ + use ResourceExistenceChecker; + + /** + * {@inheritdoc} + */ + public function run() + { + if (!$this->checkResources($this->dirs, 'dir')) { + return Result::error($this, 'Source directories are missing!'); + } + foreach ($this->dirs as $dir) { + $this->fs->remove($dir); + $this->printTaskInfo("Deleted {dir}...", ['dir' => $dir]); + } + return Result::success($this); + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/FilesystemStack.php b/vendor/consolidation/robo/src/Task/Filesystem/FilesystemStack.php new file mode 100644 index 0000000000000000000000000000000000000000..8663e245d3676e98a95ba983b9b37dbe4b1faa2a --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/FilesystemStack.php @@ -0,0 +1,154 @@ +<?php +namespace Robo\Task\Filesystem; + +use Robo\Task\StackBasedTask; +use Symfony\Component\Filesystem\Filesystem as sfFilesystem; +use Symfony\Component\Filesystem\Exception\IOException; +use Robo\Contract\BuilderAwareInterface; +use Robo\Common\BuilderAwareTrait; + +/** + * Wrapper for [Symfony Filesystem](http://symfony.com/doc/current/components/filesystem.html) Component. + * Comands are executed in stack and can be stopped on first fail with `stopOnFail` option. + * + * ``` php + * <?php + * $this->taskFilesystemStack() + * ->mkdir('logs') + * ->touch('logs/.gitignore') + * ->chgrp('www', 'www-data') + * ->symlink('/var/log/nginx/error.log', 'logs/error.log') + * ->run(); + * + * // one line + * $this->_touch('.gitignore'); + * $this->_mkdir('logs'); + * + * ?> + * ``` + * + * @method $this mkdir(string|array|\Traversable $dir, int $mode = 0777) + * @method $this touch(string|array|\Traversable $file, int $time = null, int $atime = null) + * @method $this copy(string $from, string $to, bool $force = false) + * @method $this chmod(string|array|\Traversable $file, int $permissions, int $umask = 0000, bool $recursive = false) + * @method $this chgrp(string|array|\Traversable $file, string $group, bool $recursive = false) + * @method $this chown(string|array|\Traversable $file, string $user, bool $recursive = false) + * @method $this remove(string|array|\Traversable $file) + * @method $this rename(string $from, string $to, bool $force = false) + * @method $this symlink(string $from, string $to, bool $copyOnWindows = false) + * @method $this mirror(string $from, string $to, \Traversable $iterator = null, array $options = []) + */ +class FilesystemStack extends StackBasedTask implements BuilderAwareInterface +{ + use BuilderAwareTrait; + + /** + * @var \Symfony\Component\Filesystem\Filesystem + */ + protected $fs; + + public function __construct() + { + $this->fs = new sfFilesystem(); + } + + /** + * @return \Symfony\Component\Filesystem\Filesystem + */ + protected function getDelegate() + { + return $this->fs; + } + + /** + * @param string $from + * @param string $to + * @param bool $force + */ + protected function _copy($from, $to, $force = false) + { + $this->fs->copy($from, $to, $force); + } + + /** + * @param string|string[]|\Traversable $file + * @param int $permissions + * @param int $umask + * @param bool $recursive + */ + protected function _chmod($file, $permissions, $umask = 0000, $recursive = false) + { + $this->fs->chmod($file, $permissions, $umask, $recursive); + } + + /** + * @param string|string[]|\Traversable $file + * @param string $group + * @param bool $recursive + */ + protected function _chgrp($file, $group, $recursive = null) + { + $this->fs->chgrp($file, $group, $recursive); + } + + /** + * @param string|string[]|\Traversable $file + * @param string $user + * @param bool $recursive + */ + protected function _chown($file, $user, $recursive = null) + { + $this->fs->chown($file, $user, $recursive); + } + + /** + * @param string $origin + * @param string $target + * @param bool $overwrite + * + * @return null|true|\Robo\Result + */ + protected function _rename($origin, $target, $overwrite = false) + { + // we check that target does not exist + if ((!$overwrite && is_readable($target)) || (file_exists($target) && !is_writable($target))) { + throw new IOException(sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target); + } + + // Due to a bug (limitation) in PHP, cross-volume renames do not work. + // See: https://bugs.php.net/bug.php?id=54097 + if (true !== @rename($origin, $target)) { + return $this->crossVolumeRename($origin, $target); + } + return true; + } + + /** + * @param string $origin + * @param string $target + * + * @return null|\Robo\Result + */ + protected function crossVolumeRename($origin, $target) + { + // First step is to try to get rid of the target. If there + // is a single, deletable file, then we will just unlink it. + if (is_file($target)) { + unlink($target); + } + // If the target still exists, we will try to delete it. + // TODO: Note that if this fails partway through, then we cannot + // adequately rollback. Perhaps we need to preflight the operation + // and determine if everything inside of $target is writable. + if (file_exists($target)) { + $this->fs->remove($target); + } + + /** @var \Robo\Result $result */ + $result = $this->collectionBuilder()->taskCopyDir([$origin => $target])->run(); + if (!$result->wasSuccessful()) { + return $result; + } + $this->fs->remove($origin); + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/FlattenDir.php b/vendor/consolidation/robo/src/Task/Filesystem/FlattenDir.php new file mode 100644 index 0000000000000000000000000000000000000000..6e885112e0f3ecab3eb170bd9a23230c25f219ea --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/FlattenDir.php @@ -0,0 +1,294 @@ +<?php + +namespace Robo\Task\Filesystem; + +use Robo\Result; +use Robo\Exception\TaskException; +use Symfony\Component\Finder\Finder; + +/** + * Searches for files in a nested directory structure and copies them to + * a target directory with or without the parent directories. The task was + * inspired by [gulp-flatten](https://www.npmjs.com/package/gulp-flatten). + * + * Example directory structure: + * + * ``` + * └── assets + * ├── asset-library1 + * │ ├── README.md + * │ └── asset-library1.min.js + * └── asset-library2 + * ├── README.md + * └── asset-library2.min.js + * ``` + * + * The following code will search the `*.min.js` files and copy them + * inside a new `dist` folder: + * + * ``` php + * <?php + * $this->taskFlattenDir(['assets/*.min.js' => 'dist'])->run(); + * // or use shortcut + * $this->_flattenDir('assets/*.min.js', 'dist'); + * ?> + * ``` + * + * You can also define the target directory with an additional method, instead of + * key/value pairs. More similar to the gulp-flatten syntax: + * + * ``` php + * <?php + * $this->taskFlattenDir(['assets/*.min.js']) + * ->to('dist') + * ->run(); + * ?> + * ``` + * + * You can also append parts of the parent directories to the target path. If you give + * the value `1` to the `includeParents()` method, then the top parent will be appended + * to the target directory resulting in a path such as `dist/assets/asset-library1.min.js`. + * + * If you give a negative number, such as `-1` (the same as specifying `array(0, 1)` then + * the bottom parent will be appended, resulting in a path such as + * `dist/asset-library1/asset-library1.min.js`. + * + * The top parent directory will always be starting from the relative path to the current + * directory. You can override that with the `parentDir()` method. If in the above example + * you would specify `assets`, then the top parent directory would be `asset-library1`. + * + * ``` php + * <?php + * $this->taskFlattenDir(['assets/*.min.js' => 'dist']) + * ->parentDir('assets') + * ->includeParents(1) + * ->run(); + * ?> + * ``` + */ +class FlattenDir extends BaseDir +{ + /** + * @var int + */ + protected $chmod = 0755; + + /** + * @var int[] + */ + protected $parents = array(0, 0); + + /** + * @var string + */ + protected $parentDir = ''; + + /** + * @var string + */ + protected $to; + + /** + * {@inheritdoc} + */ + public function __construct($dirs) + { + parent::__construct($dirs); + $this->parentDir = getcwd(); + } + + /** + * {@inheritdoc} + */ + public function run() + { + // find the files + $files = $this->findFiles($this->dirs); + + // copy the files + $this->copyFiles($files); + + $fileNoun = count($files) == 1 ? ' file' : ' files'; + $this->printTaskSuccess("Copied {count} $fileNoun to {destination}", ['count' => count($files), 'destination' => $this->to]); + + return Result::success($this); + } + + /** + * Sets the default folder permissions for the destination if it does not exist. + * + * @link http://en.wikipedia.org/wiki/Chmod + * @link http://php.net/manual/en/function.mkdir.php + * @link http://php.net/manual/en/function.chmod.php + * + * @param int $permission + * + * @return $this + */ + public function dirPermissions($permission) + { + $this->chmod = (int) $permission; + + return $this; + } + + /** + * Sets the value from which direction and how much parent dirs should be included. + * Accepts a positive or negative integer or an array with two integer values. + * + * @param int|int[] $parents + * + * @return $this + * + * @throws TaskException + */ + public function includeParents($parents) + { + if (is_int($parents)) { + // if an integer is given check whether it is for top or bottom parent + if ($parents >= 0) { + $this->parents[0] = $parents; + return $this; + } + $this->parents[1] = 0 - $parents; + return $this; + } + + if (is_array($parents)) { + // check if the array has two values no more, no less + if (count($parents) == 2) { + $this->parents = $parents; + return $this; + } + } + + throw new TaskException($this, 'includeParents expects an integer or an array with two values'); + } + + /** + * Sets the parent directory from which the relative parent directories will be calculated. + * + * @param string $dir + * + * @return $this + */ + public function parentDir($dir) + { + if (!$this->fs->isAbsolutePath($dir)) { + // attach the relative path to current working directory + $dir = getcwd().'/'.$dir; + } + $this->parentDir = $dir; + + return $this; + } + + /** + * Sets the target directory where the files will be copied to. + * + * @param string $target + * + * @return $this + */ + public function to($target) + { + $this->to = rtrim($target, '/'); + + return $this; + } + + /** + * @param array $dirs + * + * @return array|\Robo\Result + * + * @throws \Robo\Exception\TaskException + */ + protected function findFiles($dirs) + { + $files = array(); + + // find the files + foreach ($dirs as $k => $v) { + // reset finder + $finder = new Finder(); + + $dir = $k; + $to = $v; + // check if target was given with the to() method instead of key/value pairs + if (is_int($k)) { + $dir = $v; + if (isset($this->to)) { + $to = $this->to; + } else { + throw new TaskException($this, 'target directory is not defined'); + } + } + + try { + $finder->files()->in($dir); + } catch (\InvalidArgumentException $e) { + // if finder cannot handle it, try with in()->name() + if (strpos($dir, '/') === false) { + $dir = './'.$dir; + } + $parts = explode('/', $dir); + $new_dir = implode('/', array_slice($parts, 0, -1)); + try { + $finder->files()->in($new_dir)->name(array_pop($parts)); + } catch (\InvalidArgumentException $e) { + return Result::fromException($this, $e); + } + } + + foreach ($finder as $file) { + // store the absolute path as key and target as value in the files array + $files[$file->getRealpath()] = $this->getTarget($file->getRealPath(), $to); + } + $fileNoun = count($files) == 1 ? ' file' : ' files'; + $this->printTaskInfo("Found {count} $fileNoun in {dir}", ['count' => count($files), 'dir' => $dir]); + } + + return $files; + } + + /** + * @param string $file + * @param string $to + * + * @return string + */ + protected function getTarget($file, $to) + { + $target = $to.'/'.basename($file); + if ($this->parents !== array(0, 0)) { + // if the parent is set, create additional directories inside target + // get relative path to parentDir + $rel_path = $this->fs->makePathRelative(dirname($file), $this->parentDir); + // get top parents and bottom parents + $parts = explode('/', rtrim($rel_path, '/')); + $prefix_dir = ''; + $prefix_dir .= ($this->parents[0] > 0 ? implode('/', array_slice($parts, 0, $this->parents[0])).'/' : ''); + $prefix_dir .= ($this->parents[1] > 0 ? implode('/', array_slice($parts, (0 - $this->parents[1]), $this->parents[1])) : ''); + $prefix_dir = rtrim($prefix_dir, '/'); + $target = $to.'/'.$prefix_dir.'/'.basename($file); + } + + return $target; + } + + /** + * @param array $files + */ + protected function copyFiles($files) + { + // copy the files + foreach ($files as $from => $to) { + // check if target dir exists + if (!is_dir(dirname($to))) { + $this->fs->mkdir(dirname($to), $this->chmod); + } + $this->fs->copy($from, $to); + } + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/MirrorDir.php b/vendor/consolidation/robo/src/Task/Filesystem/MirrorDir.php new file mode 100644 index 0000000000000000000000000000000000000000..4eda9097bec44e5d30e9cf8ef4145523913a5703 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/MirrorDir.php @@ -0,0 +1,40 @@ +<?php +namespace Robo\Task\Filesystem; + +use Robo\Result; + +/** + * Mirrors a directory to another + * + * ``` php + * <?php + * $this->taskMirrorDir(['dist/config/' => 'config/'])->run(); + * // or use shortcut + * $this->_mirrorDir('dist/config/', 'config/'); + * + * ?> + * ``` + */ +class MirrorDir extends BaseDir +{ + /** + * {@inheritdoc} + */ + public function run() + { + foreach ($this->dirs as $src => $dst) { + $this->fs->mirror( + $src, + $dst, + null, + [ + 'override' => true, + 'copy_on_windows' => true, + 'delete' => true + ] + ); + $this->printTaskInfo("Mirrored from {source} to {destination}", ['source' => $src, 'destination' => $dst]); + } + return Result::success($this); + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/TmpDir.php b/vendor/consolidation/robo/src/Task/Filesystem/TmpDir.php new file mode 100644 index 0000000000000000000000000000000000000000..104318dedb02aee3e3c054e59962048c1d83afcc --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/TmpDir.php @@ -0,0 +1,173 @@ +<?php + +namespace Robo\Task\Filesystem; + +use Robo\Result; +use Robo\Contract\CompletionInterface; + +/** + * Create a temporary directory that is automatically cleaned up + * once the task collection is is part of completes. + * + * Use WorkDir if you do not want the directory to be deleted. + * + * ``` php + * <?php + * // Delete on rollback or on successful completion. + * // Note that in this example, everything is deleted at + * // the end of $collection->run(). + * $collection = $this->collectionBuilder(); + * $tmpPath = $collection->tmpDir()->getPath(); + * $collection->taskFilesystemStack() + * ->mkdir("$tmpPath/log") + * ->touch("$tmpPath/log/error.txt"); + * $collection->run(); + * // as shortcut (deleted when program exits) + * $tmpPath = $this->_tmpDir(); + * ?> + * ``` + */ +class TmpDir extends BaseDir implements CompletionInterface +{ + /** + * @var string + */ + protected $base; + + /** + * @var string + */ + protected $prefix; + + /** + * @var bool + */ + protected $cwd; + + /** + * @var string + */ + protected $savedWorkingDirectory; + + /** + * @param string $prefix + * @param string $base + * @param bool $includeRandomPart + */ + public function __construct($prefix = 'tmp', $base = '', $includeRandomPart = true) + { + if (empty($base)) { + $base = sys_get_temp_dir(); + } + $path = "{$base}/{$prefix}"; + if ($includeRandomPart) { + $path = static::randomLocation($path); + } + parent::__construct(["$path"]); + } + + /** + * Add a random part to a path, ensuring that the directory does + * not (currently) exist. + * + * @param string $path The base/prefix path to add a random component to + * @param int $length Number of digits in the random part + * + * @return string + */ + protected static function randomLocation($path, $length = 12) + { + $random = static::randomString($length); + while (is_dir("{$path}_{$random}")) { + $random = static::randomString($length); + } + return "{$path}_{$random}"; + } + + /** + * Generate a suitably random string to use as the suffix for our + * temporary directory. + * + * @param int $length + * + * @return string + */ + protected static function randomString($length = 12) + { + return substr(str_shuffle('23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'), 0, max($length, 3)); + } + + /** + * Flag that we should cwd to the temporary directory when it is + * created, and restore the old working directory when it is deleted. + * + * @param bool $shouldChangeWorkingDirectory + * + * @return $this + */ + public function cwd($shouldChangeWorkingDirectory = true) + { + $this->cwd = $shouldChangeWorkingDirectory; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + // Save the current working directory + $this->savedWorkingDirectory = getcwd(); + foreach ($this->dirs as $dir) { + $this->fs->mkdir($dir); + $this->printTaskInfo("Created {dir}...", ['dir' => $dir]); + + // Change the current working directory, if requested + if ($this->cwd) { + chdir($dir); + } + } + + return Result::success($this, '', ['path' => $this->getPath()]); + } + + protected function restoreWorkingDirectory() + { + // Restore the current working directory, if we redirected it. + if ($this->cwd) { + chdir($this->savedWorkingDirectory); + } + } + + protected function deleteTmpDir() + { + foreach ($this->dirs as $dir) { + $this->fs->remove($dir); + } + } + + /** + * Delete this directory when our collection completes. + * If this temporary directory is not part of a collection, + * then it will be deleted when the program terminates, + * presuming that it was created by taskTmpDir() or _tmpDir(). + */ + public function complete() + { + $this->restoreWorkingDirectory(); + $this->deleteTmpDir(); + } + + /** + * Get a reference to the path to the temporary directory, so that + * it may be used to create other tasks. Note that the directory + * is not actually created until the task runs. + * + * @return string + */ + public function getPath() + { + return $this->dirs[0]; + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/WorkDir.php b/vendor/consolidation/robo/src/Task/Filesystem/WorkDir.php new file mode 100644 index 0000000000000000000000000000000000000000..4b75c6ed27d6650e1b963e9495924f6a7ffcf78f --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/WorkDir.php @@ -0,0 +1,126 @@ +<?php + +namespace Robo\Task\Filesystem; + +use Robo\Result; +use Robo\Contract\RollbackInterface; +use Robo\Contract\BuilderAwareInterface; +use Robo\Common\BuilderAwareTrait; + +/** + * Create a temporary working directory that is automatically renamed to its + * final desired location if all of the tasks in the collection succeed. If + * there is a rollback, then the working directory is deleted. + * + * ``` php + * <?php + * $collection = $this->collectionBuilder(); + * $workingPath = $collection->workDir("build")->getPath(); + * $collection->taskFilesystemStack() + * ->mkdir("$workingPath/log") + * ->touch("$workingPath/log/error.txt"); + * $collection->run(); + * ?> + * ``` + */ +class WorkDir extends TmpDir implements RollbackInterface, BuilderAwareInterface +{ + use BuilderAwareTrait; + + /** + * @var string + */ + protected $finalDestination; + + /** + * @param string $finalDestination + */ + public function __construct($finalDestination) + { + $this->finalDestination = $finalDestination; + + // Create a temporary directory to work in. We will place our + // temporary directory in the same location as the final destination + // directory, so that the work directory can be moved into place + // without having to be copied, e.g. in a cross-volume rename scenario. + parent::__construct(basename($finalDestination), dirname($finalDestination)); + } + + /** + * Create our working directory. + * + * @return \Robo\Result + */ + public function run() + { + // Destination cannot be empty + if (empty($this->finalDestination)) { + return Result::error($this, "Destination directory not specified."); + } + + // Before we do anything else, ensure that any directory in the + // final destination is writable, so that we can at a minimum + // move it out of the way before placing our results there. + if (is_dir($this->finalDestination)) { + if (!is_writable($this->finalDestination)) { + return Result::error($this, "Destination directory {dir} exists and cannot be overwritten.", ['dir' => $this->finalDestination]); + } + } + + return parent::run(); + } + + /** + * Move our working directory into its final destination once the + * collection it belongs to completes. + */ + public function complete() + { + $this->restoreWorkingDirectory(); + + // Delete the final destination, if it exists. + // Move it out of the way first, in case it cannot + // be completely deleted. + if (file_exists($this->finalDestination)) { + $temporaryLocation = static::randomLocation($this->finalDestination . '_TO_DELETE_'); + // This should always work, because we already created a temporary + // folder in the parent directory of the final destination, and we + // have already checked to confirm that the final destination is + // writable. + rename($this->finalDestination, $temporaryLocation); + // This may silently fail, leaving artifacts behind, if there + // are permissions problems with some items somewhere inside + // the folder being deleted. + $this->fs->remove($temporaryLocation); + } + + // Move our working directory over the final destination. + // This should never be a cross-volume rename, so this should + // always succeed. + $workDir = reset($this->dirs); + if (file_exists($workDir)) { + rename($workDir, $this->finalDestination); + } + } + + /** + * Delete our working directory + */ + public function rollback() + { + $this->restoreWorkingDirectory(); + $this->deleteTmpDir(); + } + + /** + * Get a reference to the path to the temporary directory, so that + * it may be used to create other tasks. Note that the directory + * is not actually created until the task runs. + * + * @return string + */ + public function getPath() + { + return $this->dirs[0]; + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/loadShortcuts.php b/vendor/consolidation/robo/src/Task/Filesystem/loadShortcuts.php new file mode 100644 index 0000000000000000000000000000000000000000..fe72ce5a43c5f6f501f4c58d0e5b34877dd60fe2 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/loadShortcuts.php @@ -0,0 +1,159 @@ +<?php +namespace Robo\Task\Filesystem; + +trait loadShortcuts +{ + /** + * @param string $src + * @param string $dst + * + * @return \Robo\Result + */ + protected function _copyDir($src, $dst) + { + return $this->taskCopyDir([$src => $dst])->run(); + } + + /** + * @param string $src + * @param string $dst + * + * @return \Robo\Result + */ + protected function _mirrorDir($src, $dst) + { + return $this->taskMirrorDir([$src => $dst])->run(); + } + + /** + * @param string|string[] $dir + * + * @return \Robo\Result + */ + protected function _deleteDir($dir) + { + return $this->taskDeleteDir($dir)->run(); + } + + /** + * @param string|string[] $dir + * + * @return \Robo\Result + */ + protected function _cleanDir($dir) + { + return $this->taskCleanDir($dir)->run(); + } + + /** + * @param string $from + * @param string $to + * @param bool $overwrite + * + * @return \Robo\Result + */ + protected function _rename($from, $to, $overwrite = false) + { + return $this->taskFilesystemStack()->rename($from, $to, $overwrite)->run(); + } + + /** + * @param string|string[] $dir + * + * @return \Robo\Result + */ + protected function _mkdir($dir) + { + return $this->taskFilesystemStack()->mkdir($dir)->run(); + } + + /** + * @param string $prefix + * @param string $base + * @param bool $includeRandomPart + * + * @return string + */ + protected function _tmpDir($prefix = 'tmp', $base = '', $includeRandomPart = true) + { + $result = $this->taskTmpDir($prefix, $base, $includeRandomPart)->run(); + return isset($result['path']) ? $result['path'] : ''; + } + + /** + * @param string $file + * + * @return \Robo\Result + */ + protected function _touch($file) + { + return $this->taskFilesystemStack()->touch($file)->run(); + } + + /** + * @param string|string[] $file + * + * @return \Robo\Result + */ + protected function _remove($file) + { + return $this->taskFilesystemStack()->remove($file)->run(); + } + + /** + * @param string|string[] $file + * @param string $group + * + * @return \Robo\Result + */ + protected function _chgrp($file, $group) + { + return $this->taskFilesystemStack()->chgrp($file, $group)->run(); + } + + /** + * @param string|string[] $file + * @param int $permissions + * @param int $umask + * @param bool $recursive + * + * @return \Robo\Result + */ + protected function _chmod($file, $permissions, $umask = 0000, $recursive = false) + { + return $this->taskFilesystemStack()->chmod($file, $permissions, $umask, $recursive)->run(); + } + + /** + * @param string $from + * @param string $to + * + * @return \Robo\Result + */ + protected function _symlink($from, $to) + { + return $this->taskFilesystemStack()->symlink($from, $to)->run(); + } + + /** + * @param string $from + * @param string $to + * + * @return \Robo\Result + */ + protected function _copy($from, $to) + { + return $this->taskFilesystemStack()->copy($from, $to)->run(); + } + + /** + * @param string $from + * @param string $to + * + * @return \Robo\Result + */ + protected function _flattenDir($from, $to) + { + return $this->taskFlattenDir([$from => $to])->run(); + } +} diff --git a/vendor/consolidation/robo/src/Task/Filesystem/loadTasks.php b/vendor/consolidation/robo/src/Task/Filesystem/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..8fecaafff7c906422f2113357ec9587d6c39f5e5 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Filesystem/loadTasks.php @@ -0,0 +1,85 @@ +<?php +namespace Robo\Task\Filesystem; + +trait loadTasks +{ + /** + * @param string|string[] $dirs + * + * @return \Robo\Task\Filesystem\CleanDir + */ + protected function taskCleanDir($dirs) + { + return $this->task(CleanDir::class, $dirs); + } + + /** + * @param string|string[] $dirs + * + * @return \Robo\Task\Filesystem\DeleteDir + */ + protected function taskDeleteDir($dirs) + { + return $this->task(DeleteDir::class, $dirs); + } + + /** + * @param string $prefix + * @param string $base + * @param bool $includeRandomPart + * + * @return \Robo\Task\Filesystem\WorkDir + */ + protected function taskTmpDir($prefix = 'tmp', $base = '', $includeRandomPart = true) + { + return $this->task(TmpDir::class, $prefix, $base, $includeRandomPart); + } + + /** + * @param string $finalDestination + * + * @return \Robo\Task\Filesystem\TmpDir + */ + protected function taskWorkDir($finalDestination) + { + return $this->task(WorkDir::class, $finalDestination); + } + + /** + * @param string|string[] $dirs + * + * @return \Robo\Task\Filesystem\CopyDir + */ + protected function taskCopyDir($dirs) + { + return $this->task(CopyDir::class, $dirs); + } + + /** + * @param string|string[] $dirs + * + * @return \Robo\Task\Filesystem\MirrorDir + */ + protected function taskMirrorDir($dirs) + { + return $this->task(MirrorDir::class, $dirs); + } + + /** + * @param string|string[] $dirs + * + * @return \Robo\Task\Filesystem\FlattenDir + */ + protected function taskFlattenDir($dirs) + { + return $this->task(FlattenDir::class, $dirs); + } + + /** + * @return \Robo\Task\Filesystem\FilesystemStack + */ + protected function taskFilesystemStack() + { + return $this->task(FilesystemStack::class); + } +} diff --git a/vendor/consolidation/robo/src/Task/Gulp/Base.php b/vendor/consolidation/robo/src/Task/Gulp/Base.php new file mode 100644 index 0000000000000000000000000000000000000000..42728673c25de2fe44bc28de0b4a86fbe2a606d6 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Gulp/Base.php @@ -0,0 +1,97 @@ +<?php + +namespace Robo\Task\Gulp; + +use Robo\Task\BaseTask; +use Robo\Exception\TaskException; +use Robo\Common\ProcessUtils; + +abstract class Base extends BaseTask +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command = ''; + + /** + * @var array + */ + protected $opts = []; + + /** + * @var string + */ + protected $task = ''; + + /** + * adds `silent` option to gulp + * + * @return $this + */ + public function silent() + { + $this->option('silent'); + return $this; + } + + /** + * adds `--no-color` option to gulp + * + * @return $this + */ + public function noColor() + { + $this->option('no-color'); + return $this; + } + + /** + * adds `--color` option to gulp + * + * @return $this + */ + public function color() + { + $this->option('color'); + return $this; + } + + /** + * adds `--tasks-simple` option to gulp + * + * @return $this + */ + public function simple() + { + $this->option('tasks-simple'); + return $this; + } + + /** + * @param string $task + * @param null|string $pathToGulp + * + * @throws \Robo\Exception\TaskException + */ + public function __construct($task, $pathToGulp = null) + { + $this->task = $task; + $this->command = $pathToGulp; + if (!$this->command) { + $this->command = $this->findExecutable('gulp'); + } + if (!$this->command) { + throw new TaskException(__CLASS__, "Gulp executable not found."); + } + } + + /** + * @return string + */ + public function getCommand() + { + return "{$this->command} " . ProcessUtils::escapeArgument($this->task) . "{$this->arguments}"; + } +} diff --git a/vendor/consolidation/robo/src/Task/Gulp/Run.php b/vendor/consolidation/robo/src/Task/Gulp/Run.php new file mode 100644 index 0000000000000000000000000000000000000000..8f2077b57355dee59be5dbbfe955a638841b85a6 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Gulp/Run.php @@ -0,0 +1,35 @@ +<?php +namespace Robo\Task\Gulp; + +use Robo\Contract\CommandInterface; + +/** + * Gulp Run + * + * ``` php + * <?php + * // simple execution + * $this->taskGulpRun()->run(); + * + * // run task 'clean' with --silent option + * $this->taskGulpRun('clean') + * ->silent() + * ->run(); + * ?> + * ``` + */ +class Run extends Base implements CommandInterface +{ + /** + * {@inheritdoc} + */ + public function run() + { + if (strlen($this->arguments)) { + $this->printTaskInfo('Running Gulp task: {gulp_task} with arguments: {arguments}', ['gulp_task' => $this->task, 'arguments' => $this->arguments]); + } else { + $this->printTaskInfo('Running Gulp task: {gulp_task} without arguments', ['gulp_task' => $this->task]); + } + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Gulp/loadTasks.php b/vendor/consolidation/robo/src/Task/Gulp/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..6fdc6ca70a241a229c3051d38fb85d56f797c144 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Gulp/loadTasks.php @@ -0,0 +1,16 @@ +<?php +namespace Robo\Task\Gulp; + +trait loadTasks +{ + /** + * @param string $task + * @param null|string $pathToGulp + * + * @return \Robo\Task\Gulp\Run + */ + protected function taskGulpRun($task = 'default', $pathToGulp = null) + { + return $this->task(Run::class, $task, $pathToGulp); + } +} diff --git a/vendor/consolidation/robo/src/Task/Npm/Base.php b/vendor/consolidation/robo/src/Task/Npm/Base.php new file mode 100644 index 0000000000000000000000000000000000000000..35ff9c48f4319ad2d1fe2261cc8e9ccab293fe87 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Npm/Base.php @@ -0,0 +1,60 @@ +<?php +namespace Robo\Task\Npm; + +use Robo\Task\BaseTask; +use Robo\Exception\TaskException; + +abstract class Base extends BaseTask +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command = ''; + + /** + * @var string[] + */ + protected $opts = []; + + /** + * @var string + */ + protected $action = ''; + + /** + * adds `production` option to npm + * + * @return $this + */ + public function noDev() + { + $this->option('production'); + return $this; + } + + /** + * @param null|string $pathToNpm + * + * @throws \Robo\Exception\TaskException + */ + public function __construct($pathToNpm = null) + { + $this->command = $pathToNpm; + if (!$this->command) { + $this->command = $this->findExecutable('npm'); + } + if (!$this->command) { + throw new TaskException(__CLASS__, "Npm executable not found."); + } + } + + /** + * @return string + */ + public function getCommand() + { + return "{$this->command} {$this->action}{$this->arguments}"; + } +} diff --git a/vendor/consolidation/robo/src/Task/Npm/Install.php b/vendor/consolidation/robo/src/Task/Npm/Install.php new file mode 100644 index 0000000000000000000000000000000000000000..65cbe6189735b88fa3a44543ed8d9fc558814fc4 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Npm/Install.php @@ -0,0 +1,36 @@ +<?php +namespace Robo\Task\Npm; + +use Robo\Contract\CommandInterface; + +/** + * Npm Install + * + * ``` php + * <?php + * // simple execution + * $this->taskNpmInstall()->run(); + * + * // prefer dist with custom path + * $this->taskNpmInstall('path/to/my/npm') + * ->noDev() + * ->run(); + * ?> + * ``` + */ +class Install extends Base implements CommandInterface +{ + /** + * @var string + */ + protected $action = 'install'; + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Install Npm packages: {arguments}', ['arguments' => $this->arguments]); + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Npm/Update.php b/vendor/consolidation/robo/src/Task/Npm/Update.php new file mode 100644 index 0000000000000000000000000000000000000000..75421b307c0f37b0e53af34bb2ceeb651227db37 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Npm/Update.php @@ -0,0 +1,34 @@ +<?php +namespace Robo\Task\Npm; + +/** + * Npm Update + * + * ```php + * <?php + * // simple execution + * $this->taskNpmUpdate()->run(); + * + * // prefer dist with custom path + * $this->taskNpmUpdate('path/to/my/npm') + * ->noDev() + * ->run(); + * ?> + * ``` + */ +class Update extends Base +{ + /** + * @var string + */ + protected $action = 'update'; + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Update Npm packages: {arguments}', ['arguments' => $this->arguments]); + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Npm/loadTasks.php b/vendor/consolidation/robo/src/Task/Npm/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..4d9a26eb3be29c6455303787682dd8975a09f7c3 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Npm/loadTasks.php @@ -0,0 +1,25 @@ +<?php +namespace Robo\Task\Npm; + +trait loadTasks +{ + /** + * @param null|string $pathToNpm + * + * @return \Robo\Task\Npm\Install + */ + protected function taskNpmInstall($pathToNpm = null) + { + return $this->task(Install::class, $pathToNpm); + } + + /** + * @param null|string $pathToNpm + * + * @return \Robo\Task\Npm\Update + */ + protected function taskNpmUpdate($pathToNpm = null) + { + return $this->task(Update::class, $pathToNpm); + } +} diff --git a/vendor/consolidation/robo/src/Task/Remote/Rsync.php b/vendor/consolidation/robo/src/Task/Remote/Rsync.php new file mode 100644 index 0000000000000000000000000000000000000000..324a8d9a55752759f50f7f5b773b98bee191b15b --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Remote/Rsync.php @@ -0,0 +1,484 @@ +<?php +namespace Robo\Task\Remote; + +use Robo\Contract\CommandInterface; +use Robo\Task\BaseTask; +use Robo\Exception\TaskException; + +/** + * Executes rsync in a flexible manner. + * + * ``` php + * $this->taskRsync() + * ->fromPath('src/') + * ->toHost('localhost') + * ->toUser('dev') + * ->toPath('/var/www/html/app/') + * ->remoteShell('ssh -i public_key') + * ->recursive() + * ->excludeVcs() + * ->checksum() + * ->wholeFile() + * ->verbose() + * ->progress() + * ->humanReadable() + * ->stats() + * ->run(); + * ``` + * + * You could also clone the task and do a dry-run first: + * + * ``` php + * $rsync = $this->taskRsync() + * ->fromPath('src/') + * ->toPath('example.com:/var/www/html/app/') + * ->archive() + * ->excludeVcs() + * ->progress() + * ->stats(); + * + * $dryRun = clone $rsync; + * $dryRun->dryRun()->run(); + * if ('y' === $this->ask('Do you want to run (y/n)')) { + * $rsync->run(); + * } + * ``` + */ +class Rsync extends BaseTask implements CommandInterface +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command; + + /** + * @var string + */ + protected $fromUser; + + /** + * @var string + */ + protected $fromHost; + + /** + * @var string + */ + protected $fromPath; + + /** + * @var string + */ + protected $toUser; + + /** + * @var string + */ + protected $toHost; + + /** + * @var string + */ + protected $toPath; + + /** + * @return static + */ + public static function init() + { + return new static(); + } + + public function __construct() + { + $this->command = 'rsync'; + } + + /** + * This can either be a full rsync path spec (user@host:path) or just a path. + * In case of the former do not specify host and user. + * + * @param string|array $path + * + * @return $this + */ + public function fromPath($path) + { + $this->fromPath = $path; + + return $this; + } + + /** + * This can either be a full rsync path spec (user@host:path) or just a path. + * In case of the former do not specify host and user. + * + * @param string $path + * + * @return $this + */ + public function toPath($path) + { + $this->toPath = $path; + + return $this; + } + + /** + * @param string $fromUser + * + * @return $this + */ + public function fromUser($fromUser) + { + $this->fromUser = $fromUser; + return $this; + } + + /** + * @param string $fromHost + * + * @return $this + */ + public function fromHost($fromHost) + { + $this->fromHost = $fromHost; + return $this; + } + + /** + * @param string $toUser + * + * @return $this + */ + public function toUser($toUser) + { + $this->toUser = $toUser; + return $this; + } + + /** + * @param string $toHost + * + * @return $this + */ + public function toHost($toHost) + { + $this->toHost = $toHost; + return $this; + } + + /** + * @return $this + */ + public function progress() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function stats() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function recursive() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function verbose() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function checksum() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function archive() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function compress() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function owner() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function group() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function times() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @return $this + */ + public function delete() + { + $this->option(__FUNCTION__); + + return $this; + } + + /** + * @param int $seconds + * + * @return $this + */ + public function timeout($seconds) + { + $this->option(__FUNCTION__, $seconds); + + return $this; + } + + /** + * @return $this + */ + public function humanReadable() + { + $this->option('human-readable'); + + return $this; + } + + /** + * @return $this + */ + public function wholeFile() + { + $this->option('whole-file'); + + return $this; + } + + /** + * @return $this + */ + public function dryRun() + { + $this->option('dry-run'); + + return $this; + } + + /** + * @return $this + */ + public function itemizeChanges() + { + $this->option('itemize-changes'); + + return $this; + } + + /** + * Excludes .git, .svn and .hg items at any depth. + * + * @return $this + */ + public function excludeVcs() + { + return $this->exclude([ + '.git', + '.svn', + '.hg', + ]); + } + + /** + * @param array|string $pattern + * + * @return $this + */ + public function exclude($pattern) + { + return $this->optionList(__FUNCTION__, $pattern); + } + + /** + * @param string $file + * + * @return $this + * + * @throws \Robo\Exception\TaskException + */ + public function excludeFrom($file) + { + if (!is_readable($file)) { + throw new TaskException($this, "Exclude file $file is not readable"); + } + + return $this->option('exclude-from', $file); + } + + /** + * @param array|string $pattern + * + * @return $this + */ + public function includeFilter($pattern) + { + return $this->optionList('include', $pattern); + } + + /** + * @param array|string $pattern + * + * @return $this + */ + public function filter($pattern) + { + return $this->optionList(__FUNCTION__, $pattern); + } + + /** + * @param string $file + * + * @return $this + * + * @throws \Robo\Exception\TaskException + */ + public function filesFrom($file) + { + if (!is_readable($file)) { + throw new TaskException($this, "Files-from file $file is not readable"); + } + + return $this->option('files-from', $file); + } + + /** + * @param string $command + * + * @return $this + */ + public function remoteShell($command) + { + $this->option('rsh', "$command"); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + + return $this->executeCommand($command); + } + + /** + * Returns command that can be executed. + * This method is used to pass generated command from one task to another. + * + * @return string + */ + public function getCommand() + { + foreach ((array)$this->fromPath as $from) { + $this->option(null, $this->getFromPathSpec($from)); + } + $this->option(null, $this->getToPathSpec()); + + return $this->command . $this->arguments; + } + + /** + * @return string + */ + protected function getFromPathSpec($from) + { + return $this->getPathSpec($this->fromHost, $this->fromUser, $from); + } + + /** + * @return string + */ + protected function getToPathSpec() + { + return $this->getPathSpec($this->toHost, $this->toUser, $this->toPath); + } + + /** + * @param string $host + * @param string $user + * @param string $path + * + * @return string + */ + protected function getPathSpec($host, $user, $path) + { + $spec = isset($path) ? $path : ''; + if (!empty($host)) { + $spec = "{$host}:{$spec}"; + } + if (!empty($user)) { + $spec = "{$user}@{$spec}"; + } + + return $spec; + } +} diff --git a/vendor/consolidation/robo/src/Task/Remote/Ssh.php b/vendor/consolidation/robo/src/Task/Remote/Ssh.php new file mode 100644 index 0000000000000000000000000000000000000000..69df9fe2c62d77704d62044783cc2e88f7a5eacc --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Remote/Ssh.php @@ -0,0 +1,273 @@ +<?php + +namespace Robo\Task\Remote; + +use Robo\Contract\CommandInterface; +use Robo\Exception\TaskException; +use Robo\Task\BaseTask; +use Robo\Contract\SimulatedInterface; + +/** + * Runs multiple commands on a remote server. + * Per default, commands are combined with &&, unless stopOnFail is false. + * + * ```php + * <?php + * + * $this->taskSshExec('remote.example.com', 'user') + * ->remoteDir('/var/www/html') + * ->exec('ls -la') + * ->exec('chmod g+x logs') + * ->run(); + * + * ``` + * + * You can even exec other tasks (which implement CommandInterface): + * + * ```php + * $gitTask = $this->taskGitStack() + * ->checkout('master') + * ->pull(); + * + * $this->taskSshExec('remote.example.com') + * ->remoteDir('/var/www/html/site') + * ->exec($gitTask) + * ->run(); + * ``` + * + * You can configure the remote directory for all future calls: + * + * ```php + * \Robo\Task\Remote\Ssh::configure('remoteDir', '/some-dir'); + * ``` + */ +class Ssh extends BaseTask implements CommandInterface, SimulatedInterface +{ + use \Robo\Common\CommandReceiver; + use \Robo\Common\ExecOneCommand; + + /** + * @var null|string + */ + protected $hostname; + + /** + * @var null|string + */ + protected $user; + + /** + * @var bool + */ + protected $stopOnFail = true; + + /** + * @var array + */ + protected $exec = []; + + /** + * Changes to the given directory before running commands. + * + * @var string + */ + protected $remoteDir; + + /** + * @param null|string $hostname + * @param null|string $user + */ + public function __construct($hostname = null, $user = null) + { + $this->hostname = $hostname; + $this->user = $user; + } + + /** + * @param string $hostname + * + * @return $this + */ + public function hostname($hostname) + { + $this->hostname = $hostname; + return $this; + } + + /** + * @param string $user + * + * @return $this + */ + public function user($user) + { + $this->user = $user; + return $this; + } + + /** + * Whether or not to chain commands together with && and stop the chain if one command fails. + * + * @param bool $stopOnFail + * + * @return $this + */ + public function stopOnFail($stopOnFail = true) + { + $this->stopOnFail = $stopOnFail; + return $this; + } + + /** + * Changes to the given directory before running commands. + * + * @param string $remoteDir + * + * @return $this + */ + public function remoteDir($remoteDir) + { + $this->remoteDir = $remoteDir; + return $this; + } + + /** + * @param string $filename + * + * @return $this + */ + public function identityFile($filename) + { + $this->option('-i', $filename); + + return $this; + } + + /** + * @param int $port + * + * @return $this + */ + public function port($port) + { + $this->option('-p', $port); + + return $this; + } + + /** + * @return $this + */ + public function forcePseudoTty() + { + $this->option('-t'); + + return $this; + } + + /** + * @return $this + */ + public function quiet() + { + $this->option('-q'); + + return $this; + } + + /** + * @return $this + */ + public function verbose() + { + $this->option('-v'); + + return $this; + } + + /** + * @param string|string[]|CommandInterface $command + * + * @return $this + */ + public function exec($command) + { + if (is_array($command)) { + $command = implode(' ', array_filter($command)); + } + + $this->exec[] = $command; + + return $this; + } + + /** + * Returns command that can be executed. + * This method is used to pass generated command from one task to another. + * + * @return string + */ + public function getCommand() + { + $commands = []; + foreach ($this->exec as $command) { + $commands[] = $this->receiveCommand($command); + } + + $remoteDir = $this->remoteDir ? $this->remoteDir : $this->getConfigValue('remoteDir'); + if (!empty($remoteDir)) { + array_unshift($commands, sprintf('cd "%s"', $remoteDir)); + } + $command = implode($this->stopOnFail ? ' && ' : ' ; ', $commands); + + return $this->sshCommand($command); + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->validateParameters(); + $command = $this->getCommand(); + return $this->executeCommand($command); + } + + /** + * {@inheritdoc} + */ + public function simulate($context) + { + $command = $this->getCommand(); + $this->printTaskInfo("Running {command}", ['command' => $command] + $context); + } + + protected function validateParameters() + { + if (empty($this->hostname)) { + throw new TaskException($this, 'Please set a hostname'); + } + if (empty($this->exec)) { + throw new TaskException($this, 'Please add at least one command'); + } + } + + /** + * Returns an ssh command string running $command on the remote. + * + * @param string|CommandInterface $command + * + * @return string + */ + protected function sshCommand($command) + { + $command = $this->receiveCommand($command); + $sshOptions = $this->arguments; + $hostSpec = $this->hostname; + if ($this->user) { + $hostSpec = $this->user . '@' . $hostSpec; + } + + return "ssh{$sshOptions} {$hostSpec} '{$command}'"; + } +} diff --git a/vendor/consolidation/robo/src/Task/Remote/loadTasks.php b/vendor/consolidation/robo/src/Task/Remote/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..092d2a5547b775f5b18a74423fdf546d6a4a72bd --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Remote/loadTasks.php @@ -0,0 +1,24 @@ +<?php +namespace Robo\Task\Remote; + +trait loadTasks +{ + /** + * @return \Robo\Task\Remote\Rsync + */ + protected function taskRsync() + { + return $this->task(Rsync::class); + } + + /** + * @param null|string $hostname + * @param null|string $user + * + * @return \Robo\Task\Remote\Ssh + */ + protected function taskSshExec($hostname = null, $user = null) + { + return $this->task(Ssh::class, $hostname, $user); + } +} diff --git a/vendor/consolidation/robo/src/Task/Simulator.php b/vendor/consolidation/robo/src/Task/Simulator.php new file mode 100644 index 0000000000000000000000000000000000000000..e69d23fa39d67b8dd2442f86f8b069c503275e8e --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Simulator.php @@ -0,0 +1,168 @@ +<?php +namespace Robo\Task; + +use Robo\Contract\WrappedTaskInterface; +use Robo\Exception\TaskException; +use Robo\TaskInfo; +use Robo\Result; +use Robo\Contract\TaskInterface; +use Robo\Contract\SimulatedInterface; +use Robo\Log\RoboLogLevel; +use Robo\Contract\CommandInterface; + +class Simulator extends BaseTask implements CommandInterface +{ + /** + * @var \Robo\Contract\TaskInterface + */ + protected $task; + + /** + * @var array + */ + protected $constructorParameters; + + /** + * @var array + */ + protected $stack = []; + + /** + * @param \Robo\Contract\TaskInterface $task + * @param array $constructorParameters + */ + public function __construct(TaskInterface $task, $constructorParameters) + { + // TODO: If we ever want to convert the simulated task back into + // an executable task, then we should save the wrapped task. + $this->task = ($task instanceof WrappedTaskInterface) ? $task->original() : $task; + $this->constructorParameters = $constructorParameters; + } + + /** + * @param string $function + * @param array $args + * + * @return \Robo\Result|\Robo\Task\Simulator + */ + public function __call($function, $args) + { + $this->stack[] = array_merge([$function], $args); + $result = call_user_func_array([$this->task, $function], $args); + return $result == $this->task ? $this : $result; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $callchain = ''; + foreach ($this->stack as $action) { + $command = array_shift($action); + $parameters = $this->formatParameters($action); + $callchain .= "\n ->$command(<fg=green>$parameters</>)"; + } + $context = $this->getTaskContext( + [ + '_level' => RoboLogLevel::SIMULATED_ACTION, + 'simulated' => TaskInfo::formatTaskName($this->task), + 'parameters' => $this->formatParameters($this->constructorParameters), + '_style' => ['simulated' => 'fg=blue;options=bold'], + ] + ); + + // RoboLogLevel::SIMULATED_ACTION + $this->printTaskInfo( + "Simulating {simulated}({parameters})$callchain", + $context + ); + + $result = null; + if ($this->task instanceof SimulatedInterface) { + $result = $this->task->simulate($context); + } + if (!isset($result)) { + $result = Result::success($this); + } + + return $result; + } + + /** + * Danger: reach through the simulated wrapper and pull out the command + * to be executed. This is used when using a simulated task with another + * simulated task that runs commands, e.g. the Remote\Ssh task. Using + * a simulated CommandInterface task with a non-simulated task may produce + * unexpected results (e.g. execution!). + * + * @return string + * + * @throws \Robo\Exception\TaskException + */ + public function getCommand() + { + if (!$this->task instanceof CommandInterface) { + throw new TaskException($this->task, 'Simulated task that is not a CommandInterface used as a CommandInterface.'); + } + return $this->task->getCommand(); + } + + /** + * @param string $action + * + * @return string + */ + protected function formatParameters($action) + { + $parameterList = array_map([$this, 'convertParameter'], $action); + return implode(', ', $parameterList); + } + + /** + * @param mixed $item + * + * @return string + */ + protected function convertParameter($item) + { + if (is_callable($item)) { + return 'inline_function(...)'; + } + if (is_array($item)) { + return $this->shortenParameter(var_export($item, true)); + } + if (is_object($item)) { + return '[' . get_class($item). ' object]'; + } + if (is_string($item)) { + return $this->shortenParameter("'$item'"); + } + if (is_null($item)) { + return 'null'; + } + return $item; + } + + /** + * @param string $item + * @param string $shortForm + * + * @return string + */ + protected function shortenParameter($item, $shortForm = '') + { + $maxLength = 80; + $tailLength = 20; + if (strlen($item) < $maxLength) { + return $item; + } + if (!empty($shortForm)) { + return $shortForm; + } + $item = trim($item); + $tail = preg_replace("#.*\n#ms", '', substr($item, -$tailLength)); + $head = preg_replace("#\n.*#ms", '', substr($item, 0, $maxLength - (strlen($tail) + 5))); + return "$head ... $tail"; + } +} diff --git a/vendor/consolidation/robo/src/Task/StackBasedTask.php b/vendor/consolidation/robo/src/Task/StackBasedTask.php new file mode 100644 index 0000000000000000000000000000000000000000..91659f33a6bffeb43545a7e531b3c6f8b5519e8c --- /dev/null +++ b/vendor/consolidation/robo/src/Task/StackBasedTask.php @@ -0,0 +1,236 @@ +<?php +namespace Robo\Task; + +use Robo\Result; + +/** + * Extend StackBasedTask to create a Robo task that + * runs a sequence of commands. + * + * This is particularly useful for wrapping an existing + * object-oriented API. Doing it this way requires + * less code than manually adding a method for each wrapped + * function in the delegate. Additionally, wrapping the + * external class in a StackBasedTask creates a loosely-coupled + * interface -- i.e. if a new method is added to the delegate + * class, it is not necessary to update your wrapper, as the + * new functionality will be inherited. + * + * For example, you have: + * + * $frobinator = new Frobinator($a, $b, $c) + * ->friz() + * ->fraz() + * ->frob(); + * + * We presume that the existing library throws an exception on error. + * + * You want: + * + * $result = $this->taskFrobinator($a, $b, $c) + * ->friz() + * ->fraz() + * ->frob() + * ->run(); + * + * Execution is deferred until run(), and a Robo\Result instance is + * returned. Additionally, using Robo will covert Exceptions + * into RoboResult objects. + * + * To create a new Robo task: + * + * - Make a new class that extends StackBasedTask + * - Give it a constructor that creates a new Frobinator + * - Override getDelegate(), and return the Frobinator instance + * + * Finally, add your new class to loadTasks.php as usual, + * and you are all done. + * + * If you need to add any methods to your task that should run + * immediately (e.g. to set parameters used at run() time), just + * implement them in your derived class. + * + * If you need additional methods that should run deferred, just + * define them as 'protected function _foo()'. Then, users may + * call $this->taskFrobinator()->foo() to get deferred execution + * of _foo(). + */ +abstract class StackBasedTask extends BaseTask +{ + /** + * @var array + */ + protected $stack = []; + + /** + * @var bool + */ + protected $stopOnFail = true; + + /** + * @param bool $stop + * + * @return $this + */ + public function stopOnFail($stop = true) + { + $this->stopOnFail = $stop; + return $this; + } + + /** + * Derived classes should override the getDelegate() method, and + * return an instance of the API class being wrapped. When this + * is done, any method of the delegate is available as a method of + * this class. Calling one of the delegate's methods will defer + * execution until the run() method is called. + * + * @return null + */ + protected function getDelegate() + { + return null; + } + + /** + * Derived classes that have more than one delegate may override + * getCommandList to add as many delegate commands as desired to + * the list of potential functions that __call() tried to find. + * + * @param string $function + * + * @return array + */ + protected function getDelegateCommandList($function) + { + return [[$this, "_$function"], [$this->getDelegate(), $function]]; + } + + /** + * Print progress about the commands being executed + * + * @param string $command + * @param string $action + */ + protected function printTaskProgress($command, $action) + { + $this->printTaskInfo('{command} {action}', ['command' => "{$command[1]}", 'action' => json_encode($action, JSON_UNESCAPED_SLASHES)]); + } + + /** + * Derived classes can override processResult to add more + * logic to result handling from functions. By default, it + * is assumed that if a function returns in int, then + * 0 == success, and any other value is the error code. + * + * @param int|\Robo\Result $function_result + * + * @return \Robo\Result + */ + protected function processResult($function_result) + { + if (is_int($function_result)) { + if ($function_result) { + return Result::error($this, $function_result); + } + } + return Result::success($this); + } + + /** + * Record a function to call later. + * + * @param string $command + * @param array $args + * + * @return $this + */ + protected function addToCommandStack($command, $args) + { + $this->stack[] = array_merge([$command], $args); + return $this; + } + + /** + * Any API function provided by the delegate that executes immediately + * may be handled by __call automatically. These operations will all + * be deferred until this task's run() method is called. + * + * @param string $function + * @param array $args + * + * @return $this + */ + public function __call($function, $args) + { + foreach ($this->getDelegateCommandList($function) as $command) { + if (method_exists($command[0], $command[1])) { + // Otherwise, we'll defer calling this function + // until run(), and return $this. + $this->addToCommandStack($command, $args); + return $this; + } + } + + $message = "Method $function does not exist.\n"; + throw new \BadMethodCallException($message); + } + + /** + * @return int + */ + public function progressIndicatorSteps() + { + // run() will call advanceProgressIndicator() once for each + // file, one after calling stopBuffering, and again after compression. + return count($this->stack); + } + + /** + * Run all of the queued objects on the stack + * + * @return \Robo\Result + */ + public function run() + { + $this->startProgressIndicator(); + $result = Result::success($this); + + foreach ($this->stack as $action) { + $command = array_shift($action); + $this->printTaskProgress($command, $action); + $this->advanceProgressIndicator(); + // TODO: merge data from the result on this call + // with data from the result on the previous call? + // For now, the result always comes from the last function. + $result = $this->callTaskMethod($command, $action); + if ($this->stopOnFail && $result && !$result->wasSuccessful()) { + break; + } + } + + $this->stopProgressIndicator(); + + // todo: add timing information to the result + return $result; + } + + /** + * Execute one task method + * + * @param string $command + * @param string $action + * + * @return \Robo\Result + */ + protected function callTaskMethod($command, $action) + { + try { + $function_result = call_user_func_array($command, $action); + return $this->processResult($function_result); + } catch (\Exception $e) { + $this->printTaskError($e->getMessage()); + return Result::fromException($this, $e); + } + } +} diff --git a/vendor/consolidation/robo/src/Task/Testing/Atoum.php b/vendor/consolidation/robo/src/Task/Testing/Atoum.php new file mode 100644 index 0000000000000000000000000000000000000000..56b47d84f35ce0d759ae83138d9537f0213e9ee6 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Testing/Atoum.php @@ -0,0 +1,184 @@ +<?php +namespace Robo\Task\Testing; + +use Robo\Contract\CommandInterface; +use Robo\Contract\PrintedInterface; +use Robo\Task\BaseTask; + +/** + * Runs [atoum](http://atoum.org/) tests + * + * ``` php + * <?php + * $this->taskAtoum() + * ->files('path/to/test.php') + * ->configFile('config/dev.php') + * ->run() + * + * ?> + * ``` + */ +class Atoum extends BaseTask implements CommandInterface, PrintedInterface +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command; + + /** + * Atoum constructor. + * + * @param null|string $pathToAtoum + * + * @throws \Robo\Exception\TaskException + */ + public function __construct($pathToAtoum = null) + { + $this->command = $pathToAtoum; + if (!$this->command) { + $this->command = $this->findExecutable('atoum'); + } + if (!$this->command) { + throw new \Robo\Exception\TaskException(__CLASS__, "Neither local atoum nor global composer installation not found"); + } + } + + /** + * Tag or Tags to filter. + * + * @param string|array $tags + * + * @return $this + */ + public function tags($tags) + { + return $this->addMultipleOption('tags', $tags); + } + + /** + * Display result using the light reporter. + * + * @return $this + */ + public function lightReport() + { + $this->option("--use-light-report"); + + return $this; + } + + /** + * Display result using the tap reporter. + * + * @return $this + */ + public function tap() + { + $this->option("use-tap-report"); + + return $this; + } + + /** + * Path to the bootstrap file. + + * @param string $file + * + * @return $this + */ + public function bootstrap($file) + { + $this->option("bootstrap", $file); + + return $this; + } + + /** + * Path to the config file. + * + * @param string $file + * + * @return $this + */ + public function configFile($file) + { + $this->option('-c', $file); + + return $this; + } + + /** + * Use atoum's debug mode. + * + * @return $this + */ + public function debug() + { + $this->option("debug"); + + return $this; + } + + /** + * Test file or test files to run. + * + * @param string|array + * + * @return $this + */ + public function files($files) + { + return $this->addMultipleOption('f', $files); + } + + /** + * Test directory or directories to run. + * + * @param string|array A single directory or a list of directories. + * + * @return $this + */ + public function directories($directories) + { + return $this->addMultipleOption('directories', $directories); + } + + /** + * @param string $option + * @param string|array $values + * + * @return $this + */ + protected function addMultipleOption($option, $values) + { + if (is_string($values)) { + $values = [$values]; + } + + foreach ($values as $value) { + $this->option($option, $value); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . $this->arguments; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Running atoum ' . $this->arguments); + + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Testing/Behat.php b/vendor/consolidation/robo/src/Task/Testing/Behat.php new file mode 100644 index 0000000000000000000000000000000000000000..7e4f1d41a5a50b34ac90ae70b98d50f67eeaa432 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Testing/Behat.php @@ -0,0 +1,163 @@ +<?php +namespace Robo\Task\Testing; + +use Robo\Contract\CommandInterface; +use Robo\Contract\PrintedInterface; +use Robo\Task\BaseTask; + +/** + * Executes Behat tests + * + * ``` php + * <?php + * $this->taskBehat() + * ->format('pretty') + * ->noInteraction() + * ->run(); + * ?> + * ``` + * + */ +class Behat extends BaseTask implements CommandInterface, PrintedInterface +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command; + + /** + * @var string[] $formaters available formaters for format option + */ + protected $formaters = ['progress', 'pretty', 'junit']; + + /** + * @var string[] $verbose_levels available verbose levels + */ + protected $verbose_levels = ['v', 'vv']; + + /** + * Behat constructor. + * + * @param null|string $pathToBehat + * + * @throws \Robo\Exception\TaskException + */ + public function __construct($pathToBehat = null) + { + $this->command = $pathToBehat; + if (!$this->command) { + $this->command = $this->findExecutable('behat'); + } + if (!$this->command) { + throw new \Robo\Exception\TaskException(__CLASS__, "Neither composer nor phar installation of Behat found"); + } + } + + /** + * @return $this + */ + public function stopOnFail() + { + $this->option('stop-on-failure'); + return $this; + } + + /** + * @return $this + */ + public function noInteraction() + { + $this->option('no-interaction'); + return $this; + } + + /** + * @param $config_file + * + * @return $this + */ + public function config($config_file) + { + $this->option('config', $config_file); + return $this; + } + + /** + * @return $this + */ + public function colors() + { + $this->option('colors'); + return $this; + } + + /** + * @return $this + */ + public function noColors() + { + $this->option('no-colors'); + return $this; + } + + /** + * @param string $suite + * + * @return $this + */ + public function suite($suite) + { + $this->option('suite', $suite); + return $this; + } + + /** + * @param string $level + * + * @return $this + */ + public function verbose($level = 'v') + { + if (!in_array($level, $this->verbose_levels)) { + throw new \InvalidArgumentException('expected ' . implode(',', $this->verbose_levels)); + } + $this->option('-' . $level); + return $this; + } + + /** + * @param string $formater + * + * @return $this + */ + public function format($formater) + { + if (!in_array($formater, $this->formaters)) { + throw new \InvalidArgumentException('expected ' . implode(',', $this->formaters)); + } + $this->option('format', $formater); + return $this; + } + + /** + * Returns command that can be executed. + * This method is used to pass generated command from one task to another. + * + * @return string + */ + public function getCommand() + { + return $this->command . $this->arguments; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Running behat {arguments}', ['arguments' => $this->arguments]); + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Testing/Codecept.php b/vendor/consolidation/robo/src/Task/Testing/Codecept.php new file mode 100644 index 0000000000000000000000000000000000000000..1f8cce7034aa7176e981891f93c3bc35bd382874 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Testing/Codecept.php @@ -0,0 +1,271 @@ +<?php +namespace Robo\Task\Testing; + +use Robo\Contract\PrintedInterface; +use Robo\Exception\TaskException; +use Robo\Task\BaseTask; +use Robo\Contract\CommandInterface; +use Symfony\Component\Process\Process; + +/** + * Executes Codeception tests + * + * ``` php + * <?php + * // config + * $this->taskCodecept() + * ->suite('acceptance') + * ->env('chrome') + * ->group('admin') + * ->xml() + * ->html() + * ->run(); + * + * ?> + * ``` + * + */ +class Codecept extends BaseTask implements CommandInterface, PrintedInterface +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command; + + /** + * @param string $pathToCodeception + * + * @throws \Robo\Exception\TaskException + */ + public function __construct($pathToCodeception = '') + { + $this->command = $pathToCodeception; + if (!$this->command) { + $this->command = $this->findExecutable('codecept'); + } + if (!$this->command) { + throw new TaskException(__CLASS__, "Neither composer nor phar installation of Codeception found."); + } + $this->command .= ' run'; + } + + /** + * @param string $suite + * + * @return $this + */ + public function suite($suite) + { + $this->option(null, $suite); + return $this; + } + + /** + * @param string $testName + * + * @return $this + */ + public function test($testName) + { + $this->option(null, $testName); + return $this; + } + + /** + * set group option. Can be called multiple times + * + * @param string $group + * + * @return $this + */ + public function group($group) + { + $this->option("group", $group); + return $this; + } + + /** + * @param string $group + * + * @return $this + */ + public function excludeGroup($group) + { + $this->option("skip-group", $group); + return $this; + } + + /** + * generate json report + * + * @param string $file + * + * @return $this + */ + public function json($file = null) + { + $this->option("json", $file); + return $this; + } + + /** + * generate xml JUnit report + * + * @param string $file + * + * @return $this + */ + public function xml($file = null) + { + $this->option("xml", $file); + return $this; + } + + /** + * Generate html report + * + * @param string $dir + * + * @return $this + */ + public function html($dir = null) + { + $this->option("html", $dir); + return $this; + } + + /** + * generate tap report + * + * @param string $file + * + * @return $this + */ + public function tap($file = null) + { + $this->option("tap", $file); + return $this; + } + + /** + * provides config file other then default `codeception.yml` with `-c` option + * + * @param string $file + * + * @return $this + */ + public function configFile($file) + { + $this->option("-c", $file); + return $this; + } + + /** + * collect codecoverage in raw format. You may pass name of cov file to save results + * + * @param null|string $cov + * + * @return $this + */ + public function coverage($cov = null) + { + $this->option("coverage", $cov); + return $this; + } + + /** + * execute in silent mode + * + * @return $this + */ + public function silent() + { + $this->option("silent"); + return $this; + } + + /** + * collect code coverage in xml format. You may pass name of xml file to save results + * + * @param string $xml + * + * @return $this + */ + public function coverageXml($xml = null) + { + $this->option("coverage-xml", $xml); + return $this; + } + + /** + * collect code coverage and generate html report. You may pass + * + * @param string $html + * + * @return $this + */ + public function coverageHtml($html = null) + { + $this->option("coverage-html", $html); + return $this; + } + + /** + * @param string $env + * + * @return $this + */ + public function env($env) + { + $this->option("env", $env); + return $this; + } + + /** + * @return $this + */ + public function debug() + { + $this->option("debug"); + return $this; + } + + /** + * @return $this + */ + public function noRebuild() + { + $this->option("no-rebuild"); + return $this; + } + + /** + * @param string $failGroup + * @return $this + */ + public function failGroup($failGroup) + { + $this->option('override', "extensions: config: Codeception\\Extension\\RunFailed: fail-group: {$failGroup}"); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . $this->arguments; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Executing {command}', ['command' => $command]); + return $this->executeCommand($command); + } +} diff --git a/vendor/consolidation/robo/src/Task/Testing/PHPUnit.php b/vendor/consolidation/robo/src/Task/Testing/PHPUnit.php new file mode 100644 index 0000000000000000000000000000000000000000..df67e1c75cd75348eda1e25fff4a0676b9dcbc27 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Testing/PHPUnit.php @@ -0,0 +1,199 @@ +<?php +namespace Robo\Task\Testing; + +use Robo\Contract\CommandInterface; +use Robo\Contract\PrintedInterface; +use Robo\Task\BaseTask; + +/** + * Runs PHPUnit tests + * + * ``` php + * <?php + * $this->taskPHPUnit() + * ->group('core') + * ->bootstrap('test/bootstrap.php') + * ->run() + * + * ?> + * ``` + */ +class PHPUnit extends BaseTask implements CommandInterface, PrintedInterface +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command; + + /** + * Directory of test files or single test file to run. Appended to + * the command and arguments. + * + * @var string + */ + protected $files = ''; + + public function __construct($pathToPhpUnit = null) + { + $this->command = $pathToPhpUnit; + if (!$this->command) { + $this->command = $this->findExecutablePhar('phpunit'); + } + if (!$this->command) { + throw new \Robo\Exception\TaskException(__CLASS__, "Neither local phpunit nor global composer installation not found"); + } + } + + /** + * @param string $filter + * + * @return $this + */ + public function filter($filter) + { + $this->option('filter', $filter); + return $this; + } + + /** + * @param string $group + * + * @return $this + */ + public function group($group) + { + $this->option("group", $group); + return $this; + } + + /** + * @param string $group + * + * @return $this + */ + public function excludeGroup($group) + { + $this->option("exclude-group", $group); + return $this; + } + + /** + * adds `log-json` option to runner + * + * @param string $file + * + * @return $this + */ + public function json($file = null) + { + $this->option("log-json", $file); + return $this; + } + + /** + * adds `log-junit` option + * + * @param string $file + * + * @return $this + */ + public function xml($file = null) + { + $this->option("log-junit", $file); + return $this; + } + + /** + * @param string $file + * + * @return $this + */ + public function tap($file = "") + { + $this->option("log-tap", $file); + return $this; + } + + /** + * @param string $file + * + * @return $this + */ + public function bootstrap($file) + { + $this->option("bootstrap", $file); + return $this; + } + + /** + * @param string $file + * + * @return $this + */ + public function configFile($file) + { + $this->option('-c', $file); + return $this; + } + + /** + * @return $this + */ + public function debug() + { + $this->option("debug"); + return $this; + } + + /** + * Directory of test files or single test file to run. + * + * @param string $files A single test file or a directory containing test files. + * + * @return $this + * + * @throws \Robo\Exception\TaskException + * + * @deprecated Use file() or dir() method instead + */ + public function files($files) + { + if (!empty($this->files) || is_array($files)) { + throw new \Robo\Exception\TaskException(__CLASS__, "Only one file or directory may be provided."); + } + $this->files = ' ' . $files; + + return $this; + } + + /** + * Test the provided file. + * + * @param string $file path to file to test + * + * @return $this + */ + public function file($file) + { + return $this->files($file); + } + + /** + * {@inheritdoc} + */ + public function getCommand() + { + return $this->command . $this->arguments . $this->files; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Running PHPUnit {arguments}', ['arguments' => $this->arguments]); + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Testing/Phpspec.php b/vendor/consolidation/robo/src/Task/Testing/Phpspec.php new file mode 100644 index 0000000000000000000000000000000000000000..dd6a5ae77cc1859e0b38ed198f07e78fcf5c5690 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Testing/Phpspec.php @@ -0,0 +1,116 @@ +<?php +namespace Robo\Task\Testing; + +use Robo\Contract\PrintedInterface; +use Robo\Task\BaseTask; +use Robo\Contract\CommandInterface; + +/** + * Executes Phpspec tests + * + * ``` php + * <?php + * $this->taskPhpspec() + * ->format('pretty') + * ->noInteraction() + * ->run(); + * ?> + * ``` + * + */ +class Phpspec extends BaseTask implements CommandInterface, PrintedInterface +{ + use \Robo\Common\ExecOneCommand; + + /** + * @var string + */ + protected $command; + + /** + * @var string[] $formaters available formaters for format option + */ + protected $formaters = ['progress', 'html', 'pretty', 'junit', 'dot', 'tap']; + + /** + * @var array $verbose_levels available verbose levels + */ + protected $verbose_levels = ['v', 'vv', 'vvv']; + + public function __construct($pathToPhpspec = null) + { + $this->command = $pathToPhpspec; + if (!$this->command) { + $this->command = $this->findExecutable('phpspec'); + } + if (!$this->command) { + throw new \Robo\Exception\TaskException(__CLASS__, "Neither composer nor phar installation of Phpspec found"); + } + $this->arg('run'); + } + + public function stopOnFail() + { + $this->option('stop-on-failure'); + return $this; + } + + public function noCodeGeneration() + { + $this->option('no-code-generation'); + return $this; + } + + public function quiet() + { + $this->option('quiet'); + return $this; + } + + public function verbose($level = 'v') + { + if (!in_array($level, $this->verbose_levels)) { + throw new \InvalidArgumentException('expected ' . implode(',', $this->verbose_levels)); + } + $this->option('-' . $level); + return $this; + } + + public function noAnsi() + { + $this->option('no-ansi'); + return $this; + } + + public function noInteraction() + { + $this->option('no-interaction'); + return $this; + } + + public function config($config_file) + { + $this->option('config', $config_file); + return $this; + } + + public function format($formater) + { + if (!in_array($formater, $this->formaters)) { + throw new \InvalidArgumentException('expected ' . implode(',', $this->formaters)); + } + $this->option('format', $formater); + return $this; + } + + public function getCommand() + { + return $this->command . $this->arguments; + } + + public function run() + { + $this->printTaskInfo('Running phpspec {arguments}', ['arguments' => $this->arguments]); + return $this->executeCommand($this->getCommand()); + } +} diff --git a/vendor/consolidation/robo/src/Task/Testing/loadTasks.php b/vendor/consolidation/robo/src/Task/Testing/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..43145b9b608c53fbc60917ee8ed444f9da17ec53 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Testing/loadTasks.php @@ -0,0 +1,55 @@ +<?php +namespace Robo\Task\Testing; + +trait loadTasks +{ + /** + * @param null|string $pathToCodeception + * + * @return \Robo\Task\Testing\Codecept + */ + protected function taskCodecept($pathToCodeception = null) + { + return $this->task(Codecept::class, $pathToCodeception); + } + + /** + * @param null|string $pathToPhpUnit + * + * @return \Robo\Task\Testing\PHPUnit + */ + protected function taskPhpUnit($pathToPhpUnit = null) + { + return $this->task(PHPUnit::class, $pathToPhpUnit); + } + + /** + * @param null $pathToPhpspec + * + * @return \Robo\Task\Testing\Phpspec + */ + protected function taskPhpspec($pathToPhpspec = null) + { + return $this->task(Phpspec::class, $pathToPhpspec); + } + + /** + * @param null $pathToAtoum + * + * @return \Robo\Task\Testing\Atoum + */ + protected function taskAtoum($pathToAtoum = null) + { + return $this->task(Atoum::class, $pathToAtoum); + } + + /** + * @param null $pathToBehat + * + * @return \Robo\Task\Testing\Behat + */ + protected function taskBehat($pathToBehat = null) + { + return $this->task(Behat::class, $pathToBehat); + } +} diff --git a/vendor/consolidation/robo/src/Task/Vcs/GitStack.php b/vendor/consolidation/robo/src/Task/Vcs/GitStack.php new file mode 100644 index 0000000000000000000000000000000000000000..6cb1783f0460b750ecfe846d6bdbcee56c1807bb --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Vcs/GitStack.php @@ -0,0 +1,177 @@ +<?php +namespace Robo\Task\Vcs; + +use Robo\Task\CommandStack; +use Robo\Common\ProcessUtils; + +/** + * Runs Git commands in stack. You can use `stopOnFail()` to point that stack should be terminated on first fail. + * + * ``` php + * <?php + * $this->taskGitStack() + * ->stopOnFail() + * ->add('-A') + * ->commit('adding everything') + * ->push('origin','master') + * ->tag('0.6.0') + * ->push('origin','0.6.0') + * ->run() + * + * $this->taskGitStack() + * ->stopOnFail() + * ->add('doc/*') + * ->commit('doc updated') + * ->push() + * ->run(); + * ?> + * ``` + */ +class GitStack extends CommandStack +{ + /** + * @param string $pathToGit + */ + public function __construct($pathToGit = 'git') + { + $this->executable = $pathToGit; + } + + /** + * Executes `git clone` + * + * @param string $repo + * @param string $to + * + * @return $this + */ + public function cloneRepo($repo, $to = "", $branch = "") + { + $cmd = ['clone', $repo, $to]; + if (!empty($branch)) { + $cmd[] = "--branch $branch"; + } + return $this->exec($cmd); + } + + /** + * Executes `git clone` with depth 1 as default + * + * @param string $repo + * @param string $to + * @param string $branch + * @param int $depth + * + * @return $this + */ + public function cloneShallow($repo, $to = '', $branch = "", $depth = 1) + { + $cmd = ["clone --depth $depth", $repo, $to]; + if (!empty($branch)) { + $cmd[] = "--branch $branch"; + } + + return $this->exec($cmd); + } + + /** + * Executes `git add` command with files to add pattern + * + * @param string $pattern + * + * @return $this + */ + public function add($pattern) + { + return $this->exec([__FUNCTION__, $pattern]); + } + + /** + * Executes `git commit` command with a message + * + * @param string $message + * @param string $options + * + * @return $this + */ + public function commit($message, $options = "") + { + $message = ProcessUtils::escapeArgument($message); + return $this->exec([__FUNCTION__, "-m $message", $options]); + } + + /** + * Executes `git pull` command. + * + * @param string $origin + * @param string $branch + * + * @return $this + */ + public function pull($origin = '', $branch = '') + { + return $this->exec([__FUNCTION__, $origin, $branch]); + } + + /** + * Executes `git push` command + * + * @param string $origin + * @param string $branch + * + * @return $this + */ + public function push($origin = '', $branch = '') + { + return $this->exec([__FUNCTION__, $origin, $branch]); + } + + /** + * Performs git merge + * + * @param string $branch + * + * @return $this + */ + public function merge($branch) + { + return $this->exec([__FUNCTION__, $branch]); + } + + /** + * Executes `git checkout` command + * + * @param string $branch + * + * @return $this + */ + public function checkout($branch) + { + return $this->exec([__FUNCTION__, $branch]); + } + + /** + * Executes `git tag` command + * + * @param string $tag_name + * @param string $message + * + * @return $this + */ + public function tag($tag_name, $message = "") + { + if ($message != "") { + $message = "-m '$message'"; + } + return $this->exec([__FUNCTION__, $message, $tag_name]); + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo("Running git commands..."); + return parent::run(); + } +} diff --git a/vendor/consolidation/robo/src/Task/Vcs/HgStack.php b/vendor/consolidation/robo/src/Task/Vcs/HgStack.php new file mode 100644 index 0000000000000000000000000000000000000000..71cc0ca9c1639c3065a5ea6e0e7ccb6aa20faf56 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Vcs/HgStack.php @@ -0,0 +1,153 @@ +<?php +namespace Robo\Task\Vcs; + +use Robo\Task\CommandStack; + +/** + * Runs hg commands in stack. You can use `stopOnFail()` to point that stack should be terminated on first fail. + * + * ``` php + * <?php + * $this->hgStack + * ->cloneRepo('https://bitbucket.org/durin42/hgsubversion') + * ->pull() + * ->add() + * ->commit('changed') + * ->push() + * ->tag('0.6.0') + * ->push('0.6.0') + * ->run(); + * ?> + * ``` + */ +class HgStack extends CommandStack +{ + + /** + * @param string $pathToHg + */ + public function __construct($pathToHg = 'hg') + { + $this->executable = $pathToHg; + } + + /** + * Executes `hg clone` + * + * @param string $repo + * @param string $to + * + * @return $this + */ + public function cloneRepo($repo, $to = '') + { + return $this->exec(['clone', $repo, $to]); + } + + /** + * Executes `hg add` command with files to add by pattern + * + * @param string $include + * @param string $exclude + * + * @return $this + */ + public function add($include = '', $exclude = '') + { + if (strlen($include) > 0) { + $include = "-I {$include}"; + } + + if (strlen($exclude) > 0) { + $exclude = "-X {$exclude}"; + } + + return $this->exec([__FUNCTION__, $include, $exclude]); + } + + /** + * Executes `hg commit` command with a message + * + * @param string $message + * @param string $options + * + * @return $this + */ + public function commit($message, $options = '') + { + return $this->exec([__FUNCTION__, "-m '{$message}'", $options]); + } + + /** + * Executes `hg pull` command. + * + * @param string $branch + * + * @return $this + */ + public function pull($branch = '') + { + if (strlen($branch) > 0) { + $branch = "-b '{$branch}''"; + } + + return $this->exec([__FUNCTION__, $branch]); + } + + /** + * Executes `hg push` command + * + * @param string $branch + * + * @return $this + */ + public function push($branch = '') + { + if (strlen($branch) > 0) { + $branch = "-b '{$branch}'"; + } + + return $this->exec([__FUNCTION__, $branch]); + } + + /** + * Performs hg merge + * + * @param string $revision + * + * @return $this + */ + public function merge($revision = '') + { + if (strlen($revision) > 0) { + $revision = "-r {$revision}"; + } + + return $this->exec([__FUNCTION__, $revision]); + } + + /** + * Executes `hg tag` command + * + * @param string $tag_name + * @param string $message + * + * @return $this + */ + public function tag($tag_name, $message = '') + { + if ($message !== '') { + $message = "-m '{$message}'"; + } + return $this->exec([__FUNCTION__, $message, $tag_name]); + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->printTaskInfo('Running hg commands...'); + return parent::run(); + } +} diff --git a/vendor/consolidation/robo/src/Task/Vcs/SvnStack.php b/vendor/consolidation/robo/src/Task/Vcs/SvnStack.php new file mode 100644 index 0000000000000000000000000000000000000000..ec719b538bc178255174f5d8b86837d9c5df49f5 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Vcs/SvnStack.php @@ -0,0 +1,106 @@ +<?php +namespace Robo\Task\Vcs; + +use Robo\Contract\CommandInterface; +use Robo\Result; +use Robo\Task\CommandStack; + +/** + * Runs Svn commands in stack. You can use `stopOnFail()` to point that stack should be terminated on first fail. + * + * ``` php + * <?php + * $this->taskSvnStack() + * ->checkout('http://svn.collab.net/repos/svn/trunk') + * ->run() + * + * // alternatively + * $this->_svnCheckout('http://svn.collab.net/repos/svn/trunk'); + * + * $this->taskSvnStack('username', 'password') + * ->stopOnFail() + * ->update() + * ->add('doc/*') + * ->commit('doc updated') + * ->run(); + * ?> + * ``` + */ +class SvnStack extends CommandStack implements CommandInterface +{ + /** + * @var bool + */ + protected $stopOnFail = false; + + /** + * @var \Robo\Result + */ + protected $result; + + /** + * @param string $username + * @param string $password + * @param string $pathToSvn + */ + public function __construct($username = '', $password = '', $pathToSvn = 'svn') + { + $this->executable = $pathToSvn; + if (!empty($username)) { + $this->executable .= " --username $username"; + } + if (!empty($password)) { + $this->executable .= " --password $password"; + } + $this->result = Result::success($this); + } + + /** + * Updates `svn update` command + * + * @param string $path + * + * @return $this; + */ + public function update($path = '') + { + return $this->exec("update $path"); + } + + /** + * Executes `svn add` command with files to add pattern + * + * @param string $pattern + * + * @return $this + */ + public function add($pattern = '') + { + return $this->exec("add $pattern"); + } + + /** + * Executes `svn commit` command with a message + * + * @param string $message + * @param string $options + * + * @return $this + */ + public function commit($message, $options = "") + { + return $this->exec("commit -m '$message' $options"); + } + + /** + * Executes `svn checkout` command + * + * @param string $branch + * + * @return $this + */ + public function checkout($branch) + { + return $this->exec("checkout $branch"); + } +} diff --git a/vendor/consolidation/robo/src/Task/Vcs/loadShortcuts.php b/vendor/consolidation/robo/src/Task/Vcs/loadShortcuts.php new file mode 100644 index 0000000000000000000000000000000000000000..7d64ab58c3da01905900f854d62a81d5e257cca6 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Vcs/loadShortcuts.php @@ -0,0 +1,35 @@ +<?php +namespace Robo\Task\Vcs; + +trait loadShortcuts +{ + /** + * @param string $url + * + * @return \Robo\Result + */ + protected function _svnCheckout($url) + { + return $this->taskSvnStack()->checkout($url)->run(); + } + + /** + * @param string $url + * + * @return \Robo\Result + */ + protected function _gitClone($url) + { + return $this->taskGitStack()->cloneRepo($url)->run(); + } + + /** + * @param string $url + * + * @return \Robo\Result + */ + protected function _hgClone($url) + { + return $this->taskHgStack()->cloneRepo($url)->run(); + } +} diff --git a/vendor/consolidation/robo/src/Task/Vcs/loadTasks.php b/vendor/consolidation/robo/src/Task/Vcs/loadTasks.php new file mode 100644 index 0000000000000000000000000000000000000000..6dd06228a151d10e882ee4824bbe4cd9457c8f56 --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Vcs/loadTasks.php @@ -0,0 +1,37 @@ +<?php +namespace Robo\Task\Vcs; + +trait loadTasks +{ + /** + * @param string $username + * @param string $password + * @param string $pathToSvn + * + * @return \Robo\Task\Vcs\SvnStack + */ + protected function taskSvnStack($username = '', $password = '', $pathToSvn = 'svn') + { + return $this->task(SvnStack::class, $username, $password, $pathToSvn); + } + + /** + * @param string $pathToGit + * + * @return \Robo\Task\Vcs\GitStack + */ + protected function taskGitStack($pathToGit = 'git') + { + return $this->task(GitStack::class, $pathToGit); + } + + /** + * @param string $pathToHg + * + * @return \Robo\Task\Vcs\HgStack + */ + protected function taskHgStack($pathToHg = 'hg') + { + return $this->task(HgStack::class, $pathToHg); + } +} diff --git a/vendor/consolidation/robo/src/TaskAccessor.php b/vendor/consolidation/robo/src/TaskAccessor.php new file mode 100644 index 0000000000000000000000000000000000000000..e65cd3eb364afa71c5f0cbd4635271060635cfbb --- /dev/null +++ b/vendor/consolidation/robo/src/TaskAccessor.php @@ -0,0 +1,47 @@ +<?php +namespace Robo; + +use Robo\Common\BuilderAwareTrait; + +trait TaskAccessor +{ + use BuilderAwareTrait; + + /** + * Provides the collection builder with access to all of the + * protected 'task' methods available on this object. + * + * @param string $fn + * @param array $args + * + * @return null|\Robo\Collection\CollectionBuilder + */ + public function getBuiltTask($fn, $args) + { + if (preg_match('#^task[A-Z]#', $fn)) { + return call_user_func_array([$this, $fn], $args); + } + } + + /** + * Alternative access to instantiate. Use: + * + * $this->task(Foo::class, $a, $b); + * + * instead of: + * + * $this->taskFoo($a, $b); + * + * The later form is preferred. + * + * @return \Robo\Collection\CollectionBuilder + */ + protected function task() + { + $args = func_get_args(); + $name = array_shift($args); + + $collectionBuilder = $this->collectionBuilder(); + return $collectionBuilder->build($name, $args); + } +} diff --git a/vendor/consolidation/robo/src/TaskInfo.php b/vendor/consolidation/robo/src/TaskInfo.php new file mode 100644 index 0000000000000000000000000000000000000000..ce59c2d5560ef85872e549489bdbc1a177848cd2 --- /dev/null +++ b/vendor/consolidation/robo/src/TaskInfo.php @@ -0,0 +1,35 @@ +<?php +namespace Robo; + +class TaskInfo +{ + /** + * Return a context useful for logging messages. + * + * @param object $task + * + * @return array + */ + public static function getTaskContext($task) + { + return [ + 'name' => TaskInfo::formatTaskName($task), + 'task' => $task, + ]; + } + + /** + * @param object $task + * + * @return string + */ + public static function formatTaskName($task) + { + $name = get_class($task); + $name = preg_replace('~Stack^~', '', $name); + $name = str_replace('Robo\\Task\Base\\', '', $name); + $name = str_replace('Robo\\Task\\', '', $name); + $name = str_replace('Robo\\Collection\\', '', $name); + return $name; + } +} diff --git a/vendor/consolidation/robo/src/Tasks.php b/vendor/consolidation/robo/src/Tasks.php new file mode 100644 index 0000000000000000000000000000000000000000..2822d7d506b3460e31242b45ff57adc7f4e59be5 --- /dev/null +++ b/vendor/consolidation/robo/src/Tasks.php @@ -0,0 +1,23 @@ +<?php +namespace Robo; + +use Robo\Common\IO; +use Robo\Contract\IOAwareInterface; +use Robo\Contract\BuilderAwareInterface; +use League\Container\ContainerAwareInterface; +use League\Container\ContainerAwareTrait; + +class Tasks implements BuilderAwareInterface, IOAwareInterface, ContainerAwareInterface +{ + use ContainerAwareTrait; + use LoadAllTasks; // uses TaskAccessor, which uses BuilderAwareTrait + use IO; + + /** + * @param bool $stopOnFail + */ + protected function stopOnFail($stopOnFail = true) + { + Result::$stopOnFail = $stopOnFail; + } +} diff --git a/vendor/consolidation/self-update/.gitignore b/vendor/consolidation/self-update/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..22d0d82f8095e9c0ed572776afb47f9ca293ce00 --- /dev/null +++ b/vendor/consolidation/self-update/.gitignore @@ -0,0 +1 @@ +vendor diff --git a/vendor/consolidation/self-update/LICENSE b/vendor/consolidation/self-update/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..63e051a65e0fc5937b07a4f0b89eb8dc181f3601 --- /dev/null +++ b/vendor/consolidation/self-update/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Codegyre Developers Team, Consolidation Team + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/consolidation/self-update/README.md b/vendor/consolidation/self-update/README.md new file mode 100644 index 0000000000000000000000000000000000000000..21ba9dc49ce86e8064c57e96981cc2c5808e43ca --- /dev/null +++ b/vendor/consolidation/self-update/README.md @@ -0,0 +1,17 @@ +# SelfUpdate + +Symfony Console command to update a phar in place. + +## Usage + +To use the self:update command, instantiate it with the name of the application, +its current version, and the full name of the GitHub project. +``` +$cmd = new SelfUpdateCommand('MyAppName', '1.0.0', 'org/my-app'); +$app->add($cmd); +``` + +## Similar Projects + +- https://github.com/DavaHome/self-update +- https://github.com/padraic/phar-updater diff --git a/vendor/consolidation/self-update/VERSION b/vendor/consolidation/self-update/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..e25d8d9f357cfa028ffbf2f7bdc597e28968696b --- /dev/null +++ b/vendor/consolidation/self-update/VERSION @@ -0,0 +1 @@ +1.1.5 diff --git a/vendor/consolidation/self-update/composer.json b/vendor/consolidation/self-update/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..3125a65f60df5b3e31d2a0d63ede563727cd7f23 --- /dev/null +++ b/vendor/consolidation/self-update/composer.json @@ -0,0 +1,43 @@ +{ + "name": "consolidation/self-update", + "description": "Provides a self:update command for Symfony Console applications.", + "license": "MIT", + "authors": [ + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload":{ + "psr-4":{ + "SelfUpdate\\":"src" + } + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "scripts": { + "release": "./scripts/release VERSION" + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "5.6.3" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/consolidation/self-update/composer.lock b/vendor/consolidation/self-update/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..af14184c818c80399303b7e5705ae1bf4eedcd8a --- /dev/null +++ b/vendor/consolidation/self-update/composer.lock @@ -0,0 +1,362 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "3c87d0a607c776a773e52613a1ae51a9", + "packages": [ + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.14", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/6b217594552b9323bcdcfc14f8a0ce126e84cd73", + "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "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" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:19:56+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.14", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/d5a058ff6ecad26b30c1ba452241306ea34c65cc", + "reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:19:56+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.14", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "a59f917e3c5d82332514cb4538387638f5bde2d6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a59f917e3c5d82332514cb4538387638f5bde2d6", + "reference": "a59f917e3c5d82332514cb4538387638f5bde2d6", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:19:56+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-08-06T14:22:27+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.6.3" + } +} diff --git a/vendor/consolidation/self-update/scripts/release b/vendor/consolidation/self-update/scripts/release new file mode 100755 index 0000000000000000000000000000000000000000..10314111a284cfa0b61d2ce2fcff2af3f383d1ec --- /dev/null +++ b/vendor/consolidation/self-update/scripts/release @@ -0,0 +1,178 @@ +#!/usr/bin/env php +<?php + +/** + * Usage: + * + * ./vendor/bin/release VERSION + */ + +$semverRegEx = '(?<version>[0-9]+\.[0-9]+\.[0-9]+)(?<prerelease>-[0-9a-zA-Z.]+)?(?<build>\+[0-9a-zA-Z.]*)?'; + +$optind = null; +$options = getopt ("dvy", [ + 'pattern:', + 'simulate', + 'yes', +], $optind) + [ + 'pattern' => "^SEMVER$", +]; +$simulate = array_key_exists('simulate', $options); +$yes = array_key_exists('yes', $options) || array_key_exists('y', $options); + +$pos_args = array_slice($argv, $optind); +$path = array_shift($pos_args); + +if (empty($path)) { + print "Path to version file must be specified as a commandline argument\n"; + exit(1); +} + +if (!file_exists($path)) { + print "Version file not found at $path\n"; + exit(1); +} + +// The --pattern option is expected to contain the string SEMVER +$regex = str_replace('SEMVER', "$semverRegEx", $options['pattern']); +if ($regex == $options['pattern']) { + print "Pattern '$regex' must contain the string 'SEMVER'.\n"; + exit(1); +} + +// Read the contents of the version file and find the version string +$contents = file_get_contents($path); +if (!preg_match("#$regex#m", $contents, $matches)) { + print "A semver version not found in $path\n"; + exit(1); +} +$matches += ['prerelease' => '', 'build' => '']; + +// Calculate the stable and next version strings +$original_version_match = $matches[0]; +$original_version = $matches['version'] . $matches['prerelease'] . $matches['build']; +$stable_version = $matches['version'] . (has_prerelease($matches) ? $matches['prerelease'] : ''); +$next_version = next_version($matches); + +$stable_version_replacement = str_replace($original_version, $stable_version, $original_version_match); +$next_version_replacement = str_replace($original_version, $next_version, $original_version_match); + +$stable_version_contents = str_replace($original_version_match, $stable_version_replacement, $contents); +$next_version_contents = str_replace($original_version_match, $next_version_replacement, $contents); + +$composerContents = file_get_contents('composer.json'); +$composerData = json_decode($composerContents, true); +$project = $composerData['name']; + +$msg = "Release $project version $stable_version"; +$dashes = str_pad('', strlen($msg) + 8, '-', STR_PAD_LEFT); + +print "\n$dashes\n\n"; +print " $msg\n"; +print "\n$dashes\n\n"; + +// Write the stable version into the version file, tag and push the release +if (!$simulate) { + file_put_contents($path, $stable_version_contents); +} +else { + print "Replace stable version in $path:\n> $stable_version_replacement\n"; +} + +run('git add {path}', ['{path}' => $path], $simulate); +run('git commit -m "Version {version}"', ['{version}' => $stable_version], $simulate); +run('git tag {version}', ['{version}' => $stable_version], $simulate); +run('git push origin {version}', ['{version}' => $stable_version], $simulate); + +// Put the next version into the version file and push the result back to master +if (!$simulate) { + file_put_contents($path, $next_version_contents); +} +else { + print "Replace next version in $path:\n> $next_version_replacement\n"; +} + +run('git add {path}', ['{path}' => $path], $simulate); +run('git commit -m "[ci skip] Back to {version}"', ['{version}' => $next_version], $simulate); +run('git push origin master', [], $simulate); + +exit(0); + +/** + * inflect replaces the placeholders in the command with the provided parameter values + * @param string $cmd + * @param array $parameters + * @return string + */ +function inflect($cmd, $parameters = []) +{ + if (!empty($parameters)) { + return str_replace(array_keys($parameters), array_values($parameters), $cmd); + } + return $cmd; +} + +/** + * Run the specified command. Abort most rudely if an error is encountered + */ +function run($cmd, $parameters = [], $simulate = false) +{ + $cmd = inflect($cmd, $parameters); + if ($simulate) { + print "$cmd\n"; + return; + } + passthru($cmd, $status); + if ($status) { + exit($status); + } +} + +/** + * Determine the next version after the current release + */ +function next_version($matches) +{ + $version = $matches['version']; + + $next_version = next_version_prerelease($matches); + if ($next_version !== false) { + return $next_version; + } + return next_version_stable($matches); +} + +/** + * Determine the next version given that the current version is stable + */ +function next_version_stable($matches) +{ + $version_parts = explode('.', $matches['version']); + $last_version = array_pop($version_parts); + $last_version++; + $version_parts[] = $last_version; + + return implode('.', $version_parts) . (empty($matches['prerelease']) ? '-dev' : $matches['prerelease']); +} + +function has_prerelease($matches) +{ + if (empty($matches['prerelease'])) { + return false; + } + + return is_numeric(substr($matches['prerelease'], -1)); +} + +/** + * Determine the next version given that the current version has a pre-release + * (e.g. '-alpha5'). + */ +function next_version_prerelease($version_parts) +{ + if (!preg_match('#(.*?)([0-9]+)$#', $version_parts['prerelease'], $matches)) { + return false; + } + $next = $matches[2] + 1; + return $version_parts['version'] . $matches[1] . $next . '+dev'; +} diff --git a/vendor/consolidation/self-update/src/SelfUpdateCommand.php b/vendor/consolidation/self-update/src/SelfUpdateCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..ad40e347715a67fd06426c1aacdc4091aa98de13 --- /dev/null +++ b/vendor/consolidation/self-update/src/SelfUpdateCommand.php @@ -0,0 +1,154 @@ +<?php + +namespace SelfUpdate; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Filesystem\Filesystem as sfFilesystem; + +/** + * Update the robo.phar from the latest github release + * + * @author Alexander Menk <alex.menk@gmail.com> + */ +class SelfUpdateCommand extends Command +{ + const SELF_UPDATE_COMMAND_NAME = 'self:update'; + + protected $gitHubRepository; + + protected $currentVersion; + + protected $applicationName; + + public function __construct($applicationName = null, $currentVersion = null, $gitHubRepository = null) + { + $this->applicationName = $applicationName; + $this->currentVersion = $currentVersion; + $this->gitHubRepository = $gitHubRepository; + + parent::__construct(self::SELF_UPDATE_COMMAND_NAME); + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $app = $this->applicationName; + + $this + ->setAliases(array('update')) + ->setDescription("Updates $app to the latest version.") + ->setHelp( + <<<EOT +The <info>self-update</info> command checks github for newer +versions of $app and if found, installs the latest. +EOT + ); + } + + protected function getLatestReleaseFromGithub() + { + $opts = [ + 'http' => [ + 'method' => 'GET', + 'header' => [ + 'User-Agent: ' . $this->applicationName . ' (' . $this->gitHubRepository . ')' . ' Self-Update (PHP)' + ] + ] + ]; + + $context = stream_context_create($opts); + + $releases = file_get_contents('https://api.github.com/repos/' . $this->gitHubRepository . '/releases', false, $context); + $releases = json_decode($releases); + + if (! isset($releases[0])) { + throw new \Exception('API error - no release found at GitHub repository ' . $this->gitHubRepository); + } + + $version = $releases[0]->tag_name; + $url = $releases[0]->assets[0]->browser_download_url; + + return [ $version, $url ]; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + if (empty(\Phar::running())) { + throw new \Exception(self::SELF_UPDATE_COMMAND_NAME . ' only works when running the phar version of ' . $this->applicationName . '.'); + } + + $localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0]; + $programName = basename($localFilename); + $tempFilename = dirname($localFilename) . '/' . basename($localFilename, '.phar') . '-temp.phar'; + + // check for permissions in local filesystem before start connection process + if (! is_writable($tempDirectory = dirname($tempFilename))) { + throw new \Exception( + $programName . ' update failed: the "' . $tempDirectory . + '" directory used to download the temp file could not be written' + ); + } + + if (! is_writable($localFilename)) { + throw new \Exception( + $programName . ' update failed: the "' . $localFilename . '" file could not be written (execute with sudo)' + ); + } + + list( $latest, $downloadUrl ) = $this->getLatestReleaseFromGithub(); + + + if ($this->currentVersion == $latest) { + $output->writeln('No update available'); + return; + } + + $fs = new sfFilesystem(); + + $output->writeln('Downloading ' . $this->applicationName . ' (' . $this->gitHubRepository . ') ' . $latest); + + $fs->copy($downloadUrl, $tempFilename); + + $output->writeln('Download finished'); + + try { + \error_reporting(E_ALL); // supress notices + + @chmod($tempFilename, 0777 & ~umask()); + // test the phar validity + $phar = new \Phar($tempFilename); + // free the variable to unlock the file + unset($phar); + @rename($tempFilename, $localFilename); + $output->writeln('<info>Successfully updated ' . $programName . '</info>'); + $this->_exit(); + } catch (\Exception $e) { + @unlink($tempFilename); + if (! $e instanceof \UnexpectedValueException && ! $e instanceof \PharException) { + throw $e; + } + $output->writeln('<error>The download is corrupted (' . $e->getMessage() . ').</error>'); + $output->writeln('<error>Please re-run the self-update command to try again.</error>'); + } + } + + /** + * Stop execution + * + * This is a workaround to prevent warning of dispatcher after replacing + * the phar file. + * + * @return void + */ + protected function _exit() + { + exit; + } +} diff --git a/vendor/consolidation/site-alias/.editorconfig b/vendor/consolidation/site-alias/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..0c29908ffd5949e44dd7118463f38123a0017b67 --- /dev/null +++ b/vendor/consolidation/site-alias/.editorconfig @@ -0,0 +1,17 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[**.php] +indent_style = space +indent_size = 4 + +[{composer.json,composer.lock}] +indent_size = 4 diff --git a/vendor/consolidation/site-alias/.github/issue_template.md b/vendor/consolidation/site-alias/.github/issue_template.md new file mode 100644 index 0000000000000000000000000000000000000000..97335f49df2df0147cec09781c2a74226acc6417 --- /dev/null +++ b/vendor/consolidation/site-alias/.github/issue_template.md @@ -0,0 +1,11 @@ +### Steps to reproduce +What did you do? + +### Expected behavior +Tell us what should happen + +### Actual behavior +Tell us what happens instead + +### System Configuration +Which O.S. and PHP version are you using? diff --git a/vendor/consolidation/site-alias/.github/pull_request_template.md b/vendor/consolidation/site-alias/.github/pull_request_template.md new file mode 100644 index 0000000000000000000000000000000000000000..42ec292461f2be8f2c6b52f54af5104541c823f9 --- /dev/null +++ b/vendor/consolidation/site-alias/.github/pull_request_template.md @@ -0,0 +1,16 @@ +### Overview +This pull request: + +| Q | A +| ------------- | --- +| Bug fix? | yes/no +| New feature? | yes/no <!-- don't forget to update CHANGELOG.md files --> +| Has tests? | yes/no +| BC breaks? | no +| Deprecations? | yes/no + +### Summary +Short overview of what changed. + +### Description +Any additional information. diff --git a/vendor/consolidation/site-alias/.gitignore b/vendor/consolidation/site-alias/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..9722bd90d2d3065ec38baf5603e962b886db2971 --- /dev/null +++ b/vendor/consolidation/site-alias/.gitignore @@ -0,0 +1,5 @@ +.idea/ +box.phar +build +alias-tool.phar +vendor/ diff --git a/vendor/consolidation/site-alias/.scenarios.lock/install b/vendor/consolidation/site-alias/.scenarios.lock/install new file mode 100755 index 0000000000000000000000000000000000000000..16c69e107cce7f71e33e04207254d005200f9fd4 --- /dev/null +++ b/vendor/consolidation/site-alias/.scenarios.lock/install @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff --git a/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/.gitignore b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/composer.json b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..9df0d140f8fa830e489a221bb57a8b6b1f97fa8a --- /dev/null +++ b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/composer.json @@ -0,0 +1,74 @@ +{ + "name": "consolidation/site-alias", + "description": "Manage alias records for local and remote sites.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\SiteAlias\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\SiteAlias\\": "../../tests/src" + } + }, + "require": { + "php": ">=5.5.0", + "consolidation/config": "^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27", + "symfony/yaml": "~2.3|^3", + "consolidation/Robo": "^1.2.3", + "symfony/console": "^2.8|^3|^4", + "knplabs/github-api": "^2.7", + "php-http/guzzle6-adapter": "^1.1", + "g1a/composer-test-scenarios": "^3", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "phar:install-tools": [ + "gem install mime-types -v 2.6.2", + "curl -LSs https://box-project.github.io/box2/installer.php | php" + ], + "phar:build": "box build", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "release": [ + "release VERSION" + ] + }, + "config": { + "platform": { + "php": "5.6.33" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + } +} diff --git a/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/composer.lock b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..a42788f47642c2229fbe874343feccb11bcc90fa --- /dev/null +++ b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/composer.lock @@ -0,0 +1,3720 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "d7b07f5eeac1fc1152ef12b7f00abfdb", + "packages": [ + { + "name": "consolidation/config", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2019-03-03T19:37:04+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/stream-filter", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/php-stream-filter.git", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "time": "2017-08-18T09:54:01+00:00" + }, + { + "name": "consolidation/annotated-command", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/512a2e54c98f3af377589de76c43b24652bcb789", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.5", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2019-03-08T16:55:03+00:00" + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^5.7.27", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "3.2.3", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2018-10-19T22:35:38+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.4.6", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3", + "reference": "d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.10.2", + "consolidation/config": "^1.0.10", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.4", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2019-02-17T05:32:27+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/28f932580981e912ab8f01d15788f1dee06550c8", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2019-02-11T20:22:44+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-04T20:46:45+00:00" + }, + { + "name": "knplabs/github-api", + "version": "2.11.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "7e67b4ccf9ef62fbd6321a314c61d3202c07b855" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/7e67b4ccf9ef62fbd6321a314c61d3202c07b855", + "reference": "7e67b4ccf9ef62fbd6321a314c61d3202c07b855", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "php-http/cache-plugin": "^1.4", + "php-http/client-common": "^1.6", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.0", + "php-http/httplug": "^1.1", + "psr/cache": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "cache/array-adapter": "^0.4", + "guzzlehttp/psr7": "^1.2", + "php-http/guzzle6-adapter": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^5.5 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.11.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": "2019-01-28T19:31:35+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "php-http/cache-plugin", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "8e2505d2090316fac7cce637b39b6bbb5249c5a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/8e2505d2090316fac7cce637b39b6bbb5249c5a8", + "reference": "8e2505d2090316fac7cce637b39b6bbb5249c5a8", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/client-common": "^1.9 || ^2.0", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "time": "2019-01-23T16:51:58+00:00" + }, + { + "name": "php-http/client-common", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/httplug": "^1.1", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.4", + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" + }, + "suggest": { + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "time": "2019-02-02T07:03:15+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^2.4", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", + "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "time": "2019-02-23T07:42:53+00:00" + }, + { + "name": "php-http/guzzle6-adapter", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle6-adapter.git", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "php-http/httplug": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "php-http/adapter-integration-tests": "^0.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle6\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Guzzle 6 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "time": "2016-05-10T06:13:32+00:00" + }, + { + "name": "php-http/httplug", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "php-http/promise": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "time": "2016-08-31T08:30:17+00:00" + }, + { + "name": "php-http/message", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/b159ffe570dffd335e22ef0b91a946eacb182fa1", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^1.0", + "coduo/phpspec-data-provider-extension": "^1.0", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4", + "slim/slim": "^3.0", + "zendframework/zend-diactoros": "^1.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation", + "zendframework/zend-diactoros": "Used with Diactoros Factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "time": "2018-11-01T09:32:41+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "shasum": "" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "time": "2016-01-26T13:27:02+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-10T14:09:06+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "71ce77f37af0c5ffb9590e43cc4f70e426945c5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/71ce77f37af0c5ffb9590e43cc4f70e426945c5e", + "reference": "71ce77f37af0c5ffb9590e43cc4f70e426945c5e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.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" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "8d8a9e877b3fcdc50ddecf8dcea146059753f782" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/8d8a9e877b3fcdc50ddecf8dcea146059753f782", + "reference": "8d8a9e877b3fcdc50ddecf8dcea146059753f782", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2019-02-24T15:45:11+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "ec625e2fff7f584eeb91754821807317b2e79236" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ec625e2fff7f584eeb91754821807317b2e79236", + "reference": "ec625e2fff7f584eeb91754821807317b2e79236", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-02-04T21:34:32+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "fcdde4aa38f48190ce70d782c166f23930084f9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/fcdde4aa38f48190ce70d782c166f23930084f9b", + "reference": "fcdde4aa38f48190ce70d782c166f23930084f9b", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-02-22T14:44:53+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "926e3b797e6bb66c0e4d7da7eff3a174f7378bcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/926e3b797e6bb66c0e4d7da7eff3a174f7378bcf", + "reference": "926e3b797e6bb66c0e4d7da7eff3a174f7378bcf", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:27:11+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "57f1ce82c997f5a8701b89ef970e36bb657fd09c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/57f1ce82c997f5a8701b89ef970e36bb657fd09c", + "reference": "57f1ce82c997f5a8701b89ef970e36bb657fd09c", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.6.33" + } +} diff --git a/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/src b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/src new file mode 120000 index 0000000000000000000000000000000000000000..929cb3dc9ba04d657e86ebde2d29661b78bdd85c --- /dev/null +++ b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/src @@ -0,0 +1 @@ +../../src \ No newline at end of file diff --git a/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/tests b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/tests new file mode 120000 index 0000000000000000000000000000000000000000..c2ebfe530b4e16023832427b3134004e19542bd6 --- /dev/null +++ b/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/tests @@ -0,0 +1 @@ +../../tests \ No newline at end of file diff --git a/vendor/consolidation/site-alias/.scrutinizer.yml b/vendor/consolidation/site-alias/.scrutinizer.yml new file mode 100644 index 0000000000000000000000000000000000000000..8528e06fba99b912e12a39d5f3f9cf8112397e58 --- /dev/null +++ b/vendor/consolidation/site-alias/.scrutinizer.yml @@ -0,0 +1,11 @@ +checks: + php: true +filter: + excluded_paths: + - customize/* + - tests/* +tools: + php_sim: true + php_pdepend: true + php_analyzer: true + php_cs_fixer: false diff --git a/vendor/consolidation/site-alias/.travis.yml b/vendor/consolidation/site-alias/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..d9203d63e100ffc48ce7d8d1c435a271d813194f --- /dev/null +++ b/vendor/consolidation/site-alias/.travis.yml @@ -0,0 +1,41 @@ +dist: trusty +language: php +branches: + only: + - master + - "/^[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+.*$/" +matrix: + fast_finish: true + include: + - php: 7.2 + env: DEPENCENCIES=highest + - php: 7.2 + - php: 7.1 + - php: 7.0.11 + - php: 5.6 + env: SCENARIO=phpunit5 + - php: 5.6 + env: SCENARIO=phpunit5 DEPENDENCIES=lowest +sudo: false +cache: + directories: + - "$HOME/.composer/cache" +install: +- .scenarios.lock/install "${SCENARIO}" "${DEPENDENCIES}" +script: +- composer test +after_success: +- travis_retry php vendor/bin/php-coveralls -v +before_deploy: +- composer phar:install-tools +- composer install --prefer-dist --no-dev --no-interaction +- php box.phar build +deploy: + provider: releases + api_key: + secure: Nk+oRXu2ZpF6UCKSxIK1FeQ4zykN8X2oGZrUjQy+tTVE2/BjhldFqlOxHhjfrtViC+eTvGbJbxGteQ7S+67WKyz5Kps9g2mlf7M2wJj9obIR2YJn1d8ch1PYKkWbiXcp8vZoMXDt++pP5TkL6IDTsV7pom7cBa9Yb7OlGkzyxQmu2sfqXzF4ivcsmmoF49ASkHpA6PmRJetXywW/zM1nglIGXZCqfIIYCMi6BLmWsDFBe1xLbvk4H4DgLyMs5O4p5cW9y2abQ0vydcUSoJmIo/7Ehjg4xy2UNWcJnS/oMc4jQj62uPgAtk81rrSAM8HgmCr/fDAVOdOryypElT6jCXSA0LRvCP67X9JkpM5PBGktFYJwMJFKygpGjyqYjI5u7CR8GQuUpJIhgOvIqJIsz+PoDkFnEohbS0NqtLkTfq4GP3wIr2u42NnArpUNw8ejawGk8sgHlhxWI98+3mif8ZHHZlUEr8JCppFIz/W9f2TiFvoRCsNUOR7t2FV/q0k5tbxRA3465fDy2fxz506c11rb6NHV61mu6Xl1RevtX97bHhRHT1Igmhzn3dnfxAyEWxU5CPeVUKFdAqx0WxrAlosQaUwmRXxUlq9qs5j8F2rjPbE+une/sB5S5+2+lSlz8ympF5vIKIE4eExdXaTaIoXO52hPIMKkhZCHxq5tdU4= + file: alias-tool.phar + skip_cleanup: true + on: + tags: true + repo: consolidation/site-alias diff --git a/vendor/consolidation/site-alias/CHANGELOG.md b/vendor/consolidation/site-alias/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..66203faddfcfd5c602ea8983f16aa5efc6e52cf6 --- /dev/null +++ b/vendor/consolidation/site-alias/CHANGELOG.md @@ -0,0 +1,47 @@ +# Changelog + +### 3.0.0 2019-03-12 + +* Make self.site.yml more discoverable. (#33) +* Add interfaces for the Site Alias Manager (#34) +* Rename AliasRecord to SiteAlias for consistency (#32) +* Add SiteAliasWithConfig class (#31) + +### 2.0.0 2018-11-01 + +* Throw when root() is called with no root + +### 1.1.7 - 1.1.9 - 2018/Oct/30 + +* Fixes #11: Prevent calls to 'localRoot' from failing when there is no root set (#15) +* Set short description in composer.json + +### 1.1.6 - 2018/Oct/27 + +* Add an 'os' method to AliasRecord +* Only run root through realpath if it is present (throw otherwise) (#11) +* Add a site:value command for ad-hoc testing + +### 1.1.3 - 1.1.5 - 2018/Sept/21 + +* Experimental wildcard environments +* Find 'aliases.drushrc.php' files when converting aliases. +* Fix get multiple (#6) + +### 1.1.2 - 2018/Aug/21 + +* Allow SiteAliasFileLoader::loadMultiple to be filtered by location. (#3) + +### 1.1.0 + 1.1.1 - 2018/Aug/14 + +* Add wildcard site alias environments. (#2) +* Remove legacy AliasRecord definition; causes more problems than it solves. + +### 1.0.1 - 2018/Aug/7 + +* Allow addSearchLocation to take an array + +### 1.0.0 - 2018/July/5 + +* Initial release + diff --git a/vendor/consolidation/site-alias/CONTRIBUTING.md b/vendor/consolidation/site-alias/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..978799c11ac210b76a82cad993599b9577f1b086 --- /dev/null +++ b/vendor/consolidation/site-alias/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# Contributing to SiteAlias + +Thank you for your interest in contributing to SiteAlias! Here are some of the guidelines you should follow to make the most of your efforts: + +## Code Style Guidelines + +This project adheres to the [PSR-2 Coding Style Guide](http://www.php-fig.org/psr/psr-2/) for PHP code. An `.editorconfig` file is included with the repository to help you get up and running quickly. Most modern editors support this standard, but if yours does not or you would like to configure your editor manually, follow the guidelines in the document linked above. + +You can run the PHP Codesniffer on your work using a convenient command provided as a composer script: +``` +composer cs +``` +The above will run the PHP Codesniffer on the project sources. To automatically clean up code style violations, run: +``` +composer cbf +``` +Please ensure all contributions are compliant _before_ submitting a pull request. + +## Code of Conduct + +### Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +### Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +### Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +### Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [INSERT EMAIL ADDRESS]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +### Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/consolidation/site-alias/LICENSE b/vendor/consolidation/site-alias/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3565b38f750951640ebeef5ce6437adca9a99c3b --- /dev/null +++ b/vendor/consolidation/site-alias/LICENSE @@ -0,0 +1,27 @@ +The MIT License (MIT) + +Copyright (c) 2018-2019 Greg Anderson + +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. + +DEPENDENCY LICENSES: + +Name Version License +consolidation/config 1.2.1 MIT +dflydev/dot-access-data v1.1.0 MIT +grasmash/expander 1.0.0 MIT \ No newline at end of file diff --git a/vendor/consolidation/site-alias/README.md b/vendor/consolidation/site-alias/README.md new file mode 100644 index 0000000000000000000000000000000000000000..55dee4d287fce54cdd47919e700719dcc28a6faa --- /dev/null +++ b/vendor/consolidation/site-alias/README.md @@ -0,0 +1,178 @@ +# SiteAlias + +Manage alias records for local and remote sites. + +[](https://travis-ci.org/consolidation/site-alias) +[](https://ci.appveyor.com/project/greg-1-anderson/site-alias) +[](https://scrutinizer-ci.com/g/consolidation/site-alias/?branch=master) +[](https://coveralls.io/github/consolidation/site-alias?branch=master) +[](LICENSE) + +## Overview + +This project provides the implementation for Drush site aliases. It is used in Drush 9 and later. It would also be possible to use this library to manage site aliases for similar commandline tools. + +### Alias naming conventions + +Site alias names always begin with a `@`, and typically are divided in three parts: the alias file location (optional), the site name, and the environment name, each separated by a dot. None of these names may contain a dot. An example alias that referenced the `dev` environment of the site `example` in the `myisp` directory might therefore look something like: +``` +@myisp.example.dev +``` +The location name is optional. If specified, it will only consider alias files located in directories with the same name as the provided location name. The remainder of the path is immaterial; only the directory that is the immediate parent of the site alias file is relevant. The location name may be omitted, e.g.: +``` +@example.dev +``` +If the location is not specified, then the alias manaager will consider all locations for an applicable site alias file. Note that by default, deep searching is disabled; unless deep searching is enabled, the location name must refer to a directory that is explicitly listed as a location to place site alias files (e.g. in the application's configuration file). + +It is also possible to use single-word aliases. These can sometimes be ambiguous; the site alias manager will resolve single-word aliases as follows: + +1. `@self` is interpreted to mean the site that has already been selected, or the site that would be selected in the absence of any alias. +2. `@none` is interpreted as the empty alias--an alias with no items defined. +3. `@<env>`, for any `<env>` is equivalent to `@self.<env>` if such an alias is defined. See below. +4. `@<site>`, for any `<site>` is equivalent to the default environment of `<site>`, e.g. `@<site>.<default>`. The default environment defaults to `dev`, but may be explicitly set in the alias. + +### Alias placement on commandline + +It is up to each individual commandline tools how to utilize aliases. There are two primary examples: + +1. Site selection alias: `tool @sitealias command` +2. Alias parameters: `tool command @source @destination` + +In the first example, with the site alias appearing before the command name, the alias is used to determine the target site for the current command. In the second example, the arguments of the command are used to specify source and destination sites. + +### Alias filenames and locations + +It is also up to each individual commandline tool where to search for alias files. Search locations may be added to the SiteAliasManager via an API call. By default, alias files are only found if they appear immediately inside one of the specified search locations. Deep searching is only done if explicitly enabled by the application. + +Aliases are typically stored in Yaml files, although other formats may also be used if a custom alias data file loader is provided. The extension of the file determines the loader type (.yml for Yaml). The base name of the file, sans its extension, is the site name used to address the alias on the commandline. Site names may not contain periods. + +### Alias file contents + +The canonical site alias will contain information about how to locate the site on the local file system, and how the site is addressed on the network (when accessed via a web browser). +``` +dev: + root: /path/to/site + uri: https://example.com +``` +A more complex alias might also contain information about the server that the site is running on (when accessed via ssh for deployment and maintenance). +``` +dev: + root: /path/to/site + uri: https://example.com + remote: server.com + user: www-data +``` + +### Wildcard environments (Experimental) + +It is also possible to define "wildcard" environments that will match any provided environment name. This is only possible to do in instances where the contents of the wildcard aliases are all the same, except for places where the environment name appears. To substitute the name of the environment into a wildcard domain, use the variable replacement string `${env-name}`. For example, a wildcard alias that will match any multisite in a Drupal site might look something like the following example: +``` +'*': + root: /wild/path/to/wild + uri: https://${env-name}.example.com +``` + +### 'Self' environment aliases + +As previously mentioned, an alias in the form of `@<env>` is interpreted as `@self.<env>`. This allows sites to define a `self.site.yml` file that contains common aliases shared among a team--for example, `@stage` and `@live`. + +## Site specifications + +Site specifications are specially-crafted commandline arguments that can serve as replacements for simple site aliases. Site specifications are particularly useful for scripts that may wish to operate on a remote site without generating a temporary alias file. + +The basic form for a site specification is: +``` +user.name@example.com/path#uri +``` +This is equivalent to the following alias record: +``` +env: + user: user.name + host: example.com + root: /path + uri: somemultisite +``` + +## Getting Started + +To get started contributing to this project, simply clone it locally and then run `composer install`. + +### Running the tests + +The test suite may be run locally by way of some simple composer scripts: + +| Test | Command +| ---------------- | --- +| Run all tests | `composer test` +| PHPUnit tests | `composer unit` +| PHP linter | `composer lint` +| Code style | `composer cs` +| Fix style errors | `composer cbf` + +### Development Commandline Tool + +This library comes with a commandline tool called `alias-tool`. The only purpose +this tool serves is to provide a way to do ad-hoc experimentation and testing +for this library. + +Example: +``` +$ ./alias-tool site:list tests/fixtures/sitealiases/sites/ + + ! [NOTE] Add search location: tests/fixtures/sitealiases/sites/ + +'@single.alternate': + foo: bar + root: /alternate/path/to/single +'@single.dev': + foo: bar + root: /path/to/single +'@wild.*': + foo: bar + root: /wild/path/to/wild + uri: 'https://*.example.com' +'@wild.dev': + foo: bar + root: /path/to/wild + uri: 'https://dev.example.com' + +$ ./alias-tool site:get tests/fixtures/sitealiases/sites/ @single.dev + + ! [NOTE] Add search location: tests/fixtures/sitealiases/sites/ + + ! [NOTE] Alias parameter: '@single.dev' + +foo: bar +root: /path/to/single +``` +See `./alias-tool help` and `./alias-tool list` for more information. + +## Release Procedure + +To create a release: + +- Edit the `VERSION` file to contain the version to release, and commit the change. +- Run `composer release` + +## Built With + +This library was created with the [g1a/starter](https://github.com/g1a/starter) project, a fast way to create php libraries and [Robo](https://robo.li/) / [Symfony](https://symfony.com/) applications. + +## Contributing + +Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for submitting pull requests to us. + +## Versioning + +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases](https://github.com/consolidation/site-alias/releases) page. + +## Authors + +* **Greg Anderson** +* **Moshe Weitzman** + +See also the list of [contributors](https://github.com/consolidation/site-alias/contributors) who participated in this project. Thanks also to all of the [drush contributors](https://github.com/drush-ops/drush/contributors) who contributed directly or indirectly to site aliases. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details diff --git a/vendor/consolidation/site-alias/VERSION b/vendor/consolidation/site-alias/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..56fea8a08d2faa60fec80b40241566d3c39744f7 --- /dev/null +++ b/vendor/consolidation/site-alias/VERSION @@ -0,0 +1 @@ +3.0.0 \ No newline at end of file diff --git a/vendor/consolidation/site-alias/alias-tool b/vendor/consolidation/site-alias/alias-tool new file mode 100755 index 0000000000000000000000000000000000000000..c03e309aa9f535d248401141b6bc06d771afb867 --- /dev/null +++ b/vendor/consolidation/site-alias/alias-tool @@ -0,0 +1,45 @@ +#!/usr/bin/env php +<?php + +/** + * Example commandline front controller + * + * The commandline tool is useful for providing ad-hoc access to our class implementations + */ + +// If we're running from phar load the phar autoload file. +$pharPath = \Phar::running(true); +if ($pharPath) { + $autoloaderPath = "$pharPath/vendor/autoload.php"; +} else { + if (file_exists(__DIR__.'/vendor/autoload.php')) { + $autoloaderPath = __DIR__.'/vendor/autoload.php'; + } elseif (file_exists(__DIR__.'/../../autoload.php')) { + $autoloaderPath = __DIR__ . '/../../autoload.php'; + } else { + die("Could not find autoloader. Run 'composer install'."); + } +} +$classLoader = require $autoloaderPath; + +// Customization variables +$argv = $_SERVER['argv']; +$appName = "SiteAlias"; +$appVersion = trim(file_get_contents(__DIR__ . '/VERSION')); +$commandClasses = [ \Consolidation\SiteAlias\Cli\SiteAliasCommands::class ]; +$selfUpdateRepository = 'consolidation/site-alias'; +$configPrefix = 'SITEALIAS'; +$configFilePath = getenv($configPrefix . '_CONFIG') ?: getenv('HOME') . '/.site-alias/site-alias.yml'; + +// Define our Runner, and pass it the command classes we provide. +$runner = new \Robo\Runner($commandClasses); +$runner + ->setSelfUpdateRepository($selfUpdateRepository) + ->setConfigurationFilename($configFilePath) + ->setEnvConfigPrefix($configPrefix) + ->setClassLoader($classLoader); + +// Execute the command and return the result. +$output = new \Symfony\Component\Console\Output\ConsoleOutput(); +$statusCode = $runner->execute($argv, $appName, $appVersion, $output); +exit($statusCode); diff --git a/vendor/consolidation/site-alias/appveyor.yml b/vendor/consolidation/site-alias/appveyor.yml new file mode 100644 index 0000000000000000000000000000000000000000..0483b24f866e90f2f543a725c5e21513134c3032 --- /dev/null +++ b/vendor/consolidation/site-alias/appveyor.yml @@ -0,0 +1,63 @@ +build: false +shallow_clone: false +platform: 'x86' +clone_folder: C:\projects\work +branches: + only: + - master + +## Cache composer bits +cache: + - '%LOCALAPPDATA%\Composer\files -> composer.lock' + +init: + #https://github.com/composer/composer/blob/master/appveyor.yml + #- SET ANSICON=121x90 (121x90) + +# Inspired by https://github.com/Codeception/base/blob/master/appveyor.yml and https://github.com/phpmd/phpmd/blob/master/appveyor.yml +install: + - cinst -y curl + - SET PATH=C:\Program Files\curl;%PATH% + #which is only needed by the test suite. + - cinst -y which + - SET PATH=C:\Program Files\which;%PATH% + - git clone -q https://github.com/acquia/DevDesktopCommon.git #For tar, cksum, ... + - SET PATH=%APPVEYOR_BUILD_FOLDER%/DevDesktopCommon/bintools-win/msys/bin;%PATH% + - SET PATH=C:\Program Files\MySql\MySQL Server 5.7\bin\;%PATH% + #Install PHP per https://blog.wyrihaximus.net/2016/11/running-php-unit-tests-on-windows-using-appveyor-and-chocolatey/ + - ps: appveyor-retry cinst --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','') + - cd c:\tools\php70 + - copy php.ini-production php.ini + + - echo extension_dir=ext >> php.ini + - echo extension=php_openssl.dll >> php.ini + - echo date.timezone="UTC" >> php.ini + - echo variables_order="EGPCS" >> php.ini #May be unneeded. + - echo mbstring.http_input=pass >> php.ini + - echo mbstring.http_output=pass >> php.ini + - echo sendmail_path=nul >> php.ini + - echo extension=php_mbstring.dll >> php.ini + - echo extension=php_curl.dll >> php.ini + - echo extension=php_pdo_mysql.dll >> php.ini + - echo extension=php_pdo_pgsql.dll >> php.ini + - echo extension=php_pdo_sqlite.dll >> php.ini + - echo extension=php_pgsql.dll >> php.ini + - echo extension=php_gd2.dll >> php.ini + - SET PATH=C:\tools\php70;%PATH% + #Install Composer + - cd %APPVEYOR_BUILD_FOLDER% + #- appveyor DownloadFile https://getcomposer.org/composer.phar + - php -r "readfile('http://getcomposer.org/installer');" | php + #Install dependencies via Composer + - php composer.phar -q install --prefer-dist -n + - SET PATH=%APPVEYOR_BUILD_FOLDER%;%APPVEYOR_BUILD_FOLDER%/vendor/bin;%PATH% + #Create a sandbox for testing. Don't think we need this. + - mkdir c:\test_temp + +test_script: + - php composer.phar unit + +# environment variables +environment: + global: + php_ver_target: 7.0 diff --git a/vendor/consolidation/site-alias/box.json.dist b/vendor/consolidation/site-alias/box.json.dist new file mode 100644 index 0000000000000000000000000000000000000000..c81342df0a0076da912b5e7acac4fbabb351108c --- /dev/null +++ b/vendor/consolidation/site-alias/box.json.dist @@ -0,0 +1,25 @@ +{ + "alias": "alias-tool.phar", + "chmod": "0755", + "compactors": [], + "directories": ["src"], + "files": ["alias-tool", "README.md", "VERSION"], + "finder": [ + { + "name": "*.php", + "exclude": [ + "test", + "tests", + "Test", + "Tests", + "Tester" + ], + "in": "vendor" + } + ], + "git-commit": "git-commit", + "git-version": "git-version", + "output": "alias-tool.phar", + "main": "alias-tool", + "stub": true +} diff --git a/vendor/consolidation/site-alias/composer.json b/vendor/consolidation/site-alias/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..f06b866ada10d6e7ed9423d84f3b0d14817e8df5 --- /dev/null +++ b/vendor/consolidation/site-alias/composer.json @@ -0,0 +1,89 @@ +{ + "name": "consolidation/site-alias", + "description": "Manage alias records for local and remote sites.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\SiteAlias\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\SiteAlias\\": "tests/src" + } + }, + "require": { + "php": ">=5.5.0", + "consolidation/config": "^1.2.1" + }, + "require-dev": { + "symfony/yaml": "~2.3|^3", + "consolidation/Robo": "^1.2.3", + "symfony/console": "^2.8|^3|^4", + "knplabs/github-api": "^2.7", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "phar:install-tools": [ + "gem install mime-types -v 2.6.2", + "curl -LSs https://box-project.github.io/box2/installer.php | php" + ], + "phar:build": "box build", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "release": [ + "release VERSION" + ] + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "7.0.8" + } + }, + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + } +} diff --git a/vendor/consolidation/site-alias/composer.lock b/vendor/consolidation/site-alias/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..a890357107693b17c07f320d1504841f82012c87 --- /dev/null +++ b/vendor/consolidation/site-alias/composer.lock @@ -0,0 +1,4183 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "a8b7be6cbb24c26532b63db0ae0c3e39", + "packages": [ + { + "name": "consolidation/config", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2019-03-03T19:37:04+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/stream-filter", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/php-stream-filter.git", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "time": "2017-08-18T09:54:01+00:00" + }, + { + "name": "consolidation/annotated-command", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/512a2e54c98f3af377589de76c43b24652bcb789", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.5", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2019-03-08T16:55:03+00:00" + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^5.7.27", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "3.2.3", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2018-10-19T22:35:38+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.4.6", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3", + "reference": "d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.10.2", + "consolidation/config": "^1.0.10", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.4", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2019-02-17T05:32:27+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/28f932580981e912ab8f01d15788f1dee06550c8", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2019-02-11T20:22:44+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "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": "*", + "monolog/monolog": "1.*", + "phpunit/phpunit": "3.7.*", + "psr/log": "1.0.*", + "symfony/class-loader": "*", + "zendframework/zend-cache": "<2.3", + "zendframework/zend-log": "<2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.8-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": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2014-01-28T22:29:15+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-04T20:46:45+00:00" + }, + { + "name": "knplabs/github-api", + "version": "2.11.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "7e67b4ccf9ef62fbd6321a314c61d3202c07b855" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/7e67b4ccf9ef62fbd6321a314c61d3202c07b855", + "reference": "7e67b4ccf9ef62fbd6321a314c61d3202c07b855", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "php-http/cache-plugin": "^1.4", + "php-http/client-common": "^1.6", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.0", + "php-http/httplug": "^1.1", + "psr/cache": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "cache/array-adapter": "^0.4", + "guzzlehttp/psr7": "^1.2", + "php-http/guzzle6-adapter": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^5.5 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.11.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": "2019-01-28T19:31:35+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "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": "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)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.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", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "php-http/cache-plugin", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "8e2505d2090316fac7cce637b39b6bbb5249c5a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/8e2505d2090316fac7cce637b39b6bbb5249c5a8", + "reference": "8e2505d2090316fac7cce637b39b6bbb5249c5a8", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/client-common": "^1.9 || ^2.0", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "time": "2019-01-23T16:51:58+00:00" + }, + { + "name": "php-http/client-common", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/httplug": "^1.1", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.4", + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" + }, + "suggest": { + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "time": "2019-02-02T07:03:15+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^2.4", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", + "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "time": "2019-02-23T07:42:53+00:00" + }, + { + "name": "php-http/guzzle6-adapter", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle6-adapter.git", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "php-http/httplug": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "php-http/adapter-integration-tests": "^0.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle6\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Guzzle 6 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "time": "2016-05-10T06:13:32+00:00" + }, + { + "name": "php-http/httplug", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "php-http/promise": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "time": "2016-08-31T08:30:17+00:00" + }, + { + "name": "php-http/message", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/b159ffe570dffd335e22ef0b91a946eacb182fa1", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^1.0", + "coduo/phpspec-data-provider-extension": "^1.0", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4", + "slim/slim": "^3.0", + "zendframework/zend-diactoros": "^1.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation", + "zendframework/zend-diactoros": "Used with Diactoros Factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "time": "2018-11-01T09:32:41+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "shasum": "" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "time": "2016-01-26T13:27:02+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.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": "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": "2018-04-06T15:36:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.14", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.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": "2019-02-01T05:22:47+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.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": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "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" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "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": "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": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "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": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "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/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "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/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "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": "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": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "177a276c01575253c95cefe0866e3d1b57637fe0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/177a276c01575253c95cefe0866e3d1b57637fe0", + "reference": "177a276c01575253c95cefe0866e3d1b57637fe0", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "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" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "71ce77f37af0c5ffb9590e43cc4f70e426945c5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/71ce77f37af0c5ffb9590e43cc4f70e426945c5e", + "reference": "71ce77f37af0c5ffb9590e43cc4f70e426945c5e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.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" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "8d8a9e877b3fcdc50ddecf8dcea146059753f782" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/8d8a9e877b3fcdc50ddecf8dcea146059753f782", + "reference": "8d8a9e877b3fcdc50ddecf8dcea146059753f782", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2019-02-24T15:45:11+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "ec625e2fff7f584eeb91754821807317b2e79236" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ec625e2fff7f584eeb91754821807317b2e79236", + "reference": "ec625e2fff7f584eeb91754821807317b2e79236", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-02-04T21:34:32+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "fcdde4aa38f48190ce70d782c166f23930084f9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/fcdde4aa38f48190ce70d782c166f23930084f9b", + "reference": "fcdde4aa38f48190ce70d782c166f23930084f9b", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-02-22T14:44:53+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "926e3b797e6bb66c0e4d7da7eff3a174f7378bcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/926e3b797e6bb66c0e4d7da7eff3a174f7378bcf", + "reference": "926e3b797e6bb66c0e4d7da7eff3a174f7378bcf", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:27:11+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "2a651c2645c10bbedd21170771f122d935e0dd58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2a651c2645c10bbedd21170771f122d935e0dd58", + "reference": "2a651c2645c10bbedd21170771f122d935e0dd58", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T09:39:14+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "57f1ce82c997f5a8701b89ef970e36bb657fd09c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/57f1ce82c997f5a8701b89ef970e36bb657fd09c", + "reference": "57f1ce82c997f5a8701b89ef970e36bb657fd09c", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.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", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.0.8" + } +} diff --git a/vendor/consolidation/site-alias/dependencies.yml b/vendor/consolidation/site-alias/dependencies.yml new file mode 100644 index 0000000000000000000000000000000000000000..c381f99f8458aa9d0f655118cf1b6359af43ee92 --- /dev/null +++ b/vendor/consolidation/site-alias/dependencies.yml @@ -0,0 +1,8 @@ +version: 2 +dependencies: +- type: php + path: / + manifest_updates: + filters: + - name: ".*" + versions: "L.Y.Y" diff --git a/vendor/consolidation/site-alias/phpunit.xml.dist b/vendor/consolidation/site-alias/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..82d63a16def044959aee74d6904cb4254cca01a1 --- /dev/null +++ b/vendor/consolidation/site-alias/phpunit.xml.dist @@ -0,0 +1,19 @@ +<phpunit bootstrap="vendor/autoload.php" colors="true"> + <testsuites> + <testsuite name="site-alias"> + <directory prefix="" suffix="Test.php">tests</directory> + </testsuite> + </testsuites> + <logging> + <!-- + <log type="coverage-html" target="build/logs/coverage" lowUpperBound="35" + highLowerBound="70"/> + --> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">src</directory> + </whitelist> + </filter> +</phpunit> diff --git a/vendor/consolidation/site-alias/src/Cli/SiteAliasCommands.php b/vendor/consolidation/site-alias/src/Cli/SiteAliasCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..3a3058689c41f843bd9cb6bdf946a992abdac680 --- /dev/null +++ b/vendor/consolidation/site-alias/src/Cli/SiteAliasCommands.php @@ -0,0 +1,145 @@ +<?php + +namespace Consolidation\SiteAlias\Cli; + +use Consolidation\SiteAlias\SiteAliasFileLoader; +use Consolidation\SiteAlias\SiteAliasManager; +use Consolidation\SiteAlias\Util\YamlDataFileLoader; +use Consolidation\SiteAlias\SiteSpecParser; +use Consolidation\SiteAlias\SiteAliasName; + +class SiteAliasCommands extends \Robo\Tasks +{ + protected $aliasLoader; + + /** + * List available site aliases. + * + * @command site:list + * @format yaml + * @return array + */ + public function siteList(array $varArgs) + { + $this->aliasLoader = new SiteAliasFileLoader(); + $ymlLoader = new YamlDataFileLoader(); + $this->aliasLoader->addLoader('yml', $ymlLoader); + $aliasName = $this->getLocationsAndAliasName($varArgs, $this->aliasLoader); + + $this->manager = new SiteAliasManager($this->aliasLoader); + + return $this->renderAliases($this->manager->getMultiple($aliasName)); + } + + /** + * Load available site aliases. + * + * @command site:load + * @format yaml + * @return array + */ + public function siteLoad(array $dirs) + { + $this->aliasLoader = new SiteAliasFileLoader(); + $ymlLoader = new YamlDataFileLoader(); + $this->aliasLoader->addLoader('yml', $ymlLoader); + + foreach ($dirs as $dir) { + $this->io()->note("Add search location: $dir"); + $this->aliasLoader->addSearchLocation($dir); + } + + $all = $this->aliasLoader->loadAll(); + + return $this->renderAliases($all); + } + + protected function getLocationsAndAliasName($varArgs) + { + $aliasName = ''; + foreach ($varArgs as $arg) { + if (SiteAliasName::isAliasName($arg)) { + $this->io()->note("Alias parameter: '$arg'"); + $aliasName = $arg; + } else { + $this->io()->note("Add search location: $arg"); + $this->aliasLoader->addSearchLocation($arg); + } + } + return $aliasName; + } + + protected function renderAliases($all) + { + if (empty($all)) { + throw new \Exception("No aliases found"); + } + + $result = []; + foreach ($all as $name => $alias) { + $result[$name] = $alias->export(); + } + + return $result; + } + + /** + * Show contents of a single site alias. + * + * @command site:get + * @format yaml + * @return array + */ + public function siteGet(array $varArgs) + { + $this->aliasLoader = new SiteAliasFileLoader(); + $ymlLoader = new YamlDataFileLoader(); + $this->aliasLoader->addLoader('yml', $ymlLoader); + $aliasName = $this->getLocationsAndAliasName($varArgs, $this->aliasLoader); + + $manager = new SiteAliasManager($this->aliasLoader); + $result = $manager->get($aliasName); + if (!$result) { + throw new \Exception("No alias found"); + } + + return $result->export(); + } + + /** + * Access a value from a single alias. + * + * @command site:value + * @format yaml + * @return string + */ + public function siteValue(array $varArgs) + { + $this->aliasLoader = new SiteAliasFileLoader(); + $ymlLoader = new YamlDataFileLoader(); + $this->aliasLoader->addLoader('yml', $ymlLoader); + $key = array_pop($varArgs); + $aliasName = $this->getLocationsAndAliasName($varArgs, $this->aliasLoader); + + $manager = new SiteAliasManager($this->aliasLoader); + $result = $manager->get($aliasName); + if (!$result) { + throw new \Exception("No alias found"); + } + + return $result->get($key); + } + + /** + * Parse a site specification. + * + * @command site-spec:parse + * @format yaml + * @return array + */ + public function parse($spec, $options = ['root' => '']) + { + $parser = new SiteSpecParser(); + return $parser->parse($spec, $options['root']); + } +} diff --git a/vendor/consolidation/site-alias/src/DataFileLoaderInterface.php b/vendor/consolidation/site-alias/src/DataFileLoaderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..e6463ad386b5b168c1d94eca92d5f36969bb7b9f --- /dev/null +++ b/vendor/consolidation/site-alias/src/DataFileLoaderInterface.php @@ -0,0 +1,10 @@ +<?php +namespace Consolidation\SiteAlias; + +interface DataFileLoaderInterface +{ + /** + * @return array + */ + public function load($path); +} diff --git a/vendor/consolidation/site-alias/src/HostPath.php b/vendor/consolidation/site-alias/src/HostPath.php new file mode 100644 index 0000000000000000000000000000000000000000..1f1515c5386695d5657df7751b3ab5227085ced1 --- /dev/null +++ b/vendor/consolidation/site-alias/src/HostPath.php @@ -0,0 +1,286 @@ +<?php +namespace Consolidation\SiteAlias; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; +use Webmozart\PathUtil\Path; + +/** + * A host path is a path on some machine. The machine may be specified + * by a label, and the label may be an @alias or a site specification. + * If there is no label, then the local machine is assumed. + * + * Examples: + * + * @alias + * @alias:/path + * host:/path + * user@host:/path + * user@host/drupal-root#uri:/path + * /path + * + * Note that /path does not have to begin with a '/'; it may + * be a relative path, or it may begin with a path alias, + * e.g. '%files'. + * + * It is permissible to have an alias or site specification + * without a path, but it is not valid to have just a host + * with no path. + */ +class HostPath +{ + /** @var SiteAlias The alias record obtained from the host path */ + protected $alias_record; + + /** @var string The entire original host path (e.g. @alias:/path) */ + protected $original_path; + + /** @var string The "path" component from the host path */ + protected $path; + + /** @var string The alias record is implicit (e.g. 'path' instead of '@self:path') */ + protected $implicit; + + /** + * HostPath constructor + * + * @param SiteAlias $alias_record The alias record or site specification record + * @param string $original_path The original host path + * @param string $path Just the 'path' component + */ + protected function __construct($alias_record, $original_path, $path = '', $implicit = false) + { + $this->alias_record = $alias_record; + $this->original_path = $original_path; + $this->path = $path; + $this->implicit = $implicit; + } + + /** + * Factory method to create a host path. + * + * @param SiteAliasManager $manager We need to be provided a reference + * to the alias manager to create a host path + * @param string $hostPath The path to create. + */ + public static function create(SiteAliasManager $manager, $hostPath) + { + // Split the alias path up into + // - $parts[0]: everything before the first ":" + // - $parts[1]: everything after the ":", if there was one. + $parts = explode(':', $hostPath, 2); + + // Determine whether or not $parts[0] is a site spec or an alias + // record. If $parts[0] is not in the right form, the result + // will be 'false'. This will throw if $parts[0] is an @alias + // record, but the requested alias cannot be found. + $alias_record = $manager->get($parts[0]); + + if (!isset($parts[1])) { + return static::determinePathOrAlias($manager, $alias_record, $hostPath, $parts[0]); + } + + // If $parts[0] did not resolve to a site spec or alias record, + // but there is a $parts[1], then $parts[0] must be a machine name. + // Unless it was an alias that could not be found. + if ($alias_record === false) { + if (SiteAliasName::isAliasName($parts[0])) { + throw new \Exception('Site alias ' . $parts[0] . ' not found.'); + } + $alias_record = new SiteAlias(['host' => $parts[0]]); + } + + // Create our alias path + return new HostPath($alias_record, $hostPath, $parts[1]); + } + + /** + * Return the alias record portion of the host path. + * + * @return SiteAlias + */ + public function getSiteAlias() + { + return $this->alias_record; + } + + /** + * @deprecated Use getSiteAlias + */ + public function getAliasRecord() + { + return $this->getSiteAlias(); + } + + /** + * Returns true if this host path points at a remote machine + * + * @return bool + */ + public function isRemote() + { + return $this->alias_record->isRemote(); + } + + /** + * Return just the path portion, without considering the alias root. + * + * @return string + */ + public function getOriginalPath() + { + return $this->path; + } + + /** + * Return the original host path string, as provided to the create() method. + * + * @return string + */ + public function getOriginal() + { + return $this->original_path; + } + + /** + * Return just the path portion of the host path + * + * @return string + */ + public function getPath() + { + if (empty($this->path)) { + return $this->alias_record->root(); + } + if ($this->alias_record->hasRoot() && !$this->implicit) { + return Path::makeAbsolute($this->path, $this->alias_record->root()); + } + return $this->path; + } + + /** + * Returns 'true' if the path portion of the host path begins with a + * path alias (e.g. '%files'). Path aliases must appear at the beginning + * of the path. + * + * @return bool + */ + public function hasPathAlias() + { + $pathAlias = $this->getPathAlias(); + return !empty($pathAlias); + } + + /** + * Return just the path alias portion of the path (e.g. '%files'), or + * empty if there is no alias in the path. + * + * @return string + */ + public function getPathAlias() + { + if (preg_match('#%([^/]*).*#', $this->path, $matches)) { + return $matches[1]; + } + return ''; + } + + /** + * Replaces the path alias portion of the path with the resolved path. + * + * @param string $resolvedPath The converted path alias (e.g. 'sites/default/files') + * @return $this + */ + public function replacePathAlias($resolvedPath) + { + $pathAlias = $this->getPathAlias(); + if (empty($pathAlias)) { + return $this; + } + // Make sure that the resolved path always ends in a '\'. + $resolvedPath .= '/'; + // Avoid double / in path. + // $this->path: %files/foo + // $pathAlias: files + // We add one to the length of $pathAlias to account for the '%' in $this->path. + if (strlen($this->path) > (strlen($pathAlias) + 1)) { + $resolvedPath = rtrim($resolvedPath, '/'); + } + // Once the path alias is resolved, replace the alias in the $path with the result. + $this->path = $resolvedPath . substr($this->path, strlen($pathAlias) + 1); + + // Using a path alias such as %files is equivalent to making explicit + // use of @self:%files. We set implicit to false here so that the resolved + // path will be returned as an absolute path rather than a relative path. + $this->implicit = false; + + return $this; + } + + /** + * Return the host portion of the host path, including the user. + * + * @return string + */ + public function getHost() + { + return $this->alias_record->remoteHostWithUser(); + } + + /** + * Return the fully resolved path, e.g. user@server:/path/to/drupalroot/sites/default/files + * + * @return string + */ + public function fullyQualifiedPath() + { + $host = $this->getHost(); + if (!empty($host)) { + return $host . ':' . $this->getPath(); + } + return $this->getPath(); + } + + /** + * Our fully qualified path passes the result through Path::makeAbsolute() + * which canonicallizes the path, removing any trailing slashes. + * That is what we want most of the time; however, the trailing slash is + * sometimes significant, e.g. for rsync, so we provide a separate API + * for those cases where the trailing slash should be preserved. + * + * @return string + */ + public function fullyQualifiedPathPreservingTrailingSlash() + { + $fqp = $this->fullyQualifiedPath(); + if ((substr($this->path, strlen($this->path) - 1) == '/') && (substr($fqp, strlen($fqp) - 1) != '/')) { + $fqp .= '/'; + } + return $fqp; + } + + /** + * Helper method for HostPath::create(). When the host path contains no + * ':', this method determines whether the string that was provided is + * a host or a path. + * + * @param SiteAliasManager $manager + * @param SiteAlias|bool $alias_record + * @param string $hostPath + * @param string $single_part + */ + protected static function determinePathOrAlias(SiteAliasManager $manager, $alias_record, $hostPath, $single_part) + { + // If $alias_record is false, then $single_part must be a path. + if ($alias_record === false) { + return new HostPath($manager->getSelf(), $hostPath, $single_part, true); + } + + // Otherwise, we have a alias record without a path. + // In this instance, the alias record _must_ have a root. + if (!$alias_record->hasRoot()) { + throw new \Exception("$hostPath does not define a path."); + } + return new HostPath($alias_record, $hostPath); + } +} diff --git a/vendor/consolidation/site-alias/src/SiteAlias.php b/vendor/consolidation/site-alias/src/SiteAlias.php new file mode 100644 index 0000000000000000000000000000000000000000..1c9dcedce36c47407d673e910f9accef8be2c4f5 --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAlias.php @@ -0,0 +1,115 @@ +<?php +namespace Consolidation\SiteAlias; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; +use Consolidation\Config\Util\ArrayUtil; +use Consolidation\SiteAlias\Util\FsUtils; + +/** + * An alias record is a configuration record containing well-known items. + * + * @see SiteAliasInterface for documentation + */ +class SiteAlias extends Config implements SiteAliasInterface +{ + use SiteAliasTrait; + + /** + * @var string + */ + protected $name; + + /** + * @inheritdoc + */ + public function __construct(array $data = null, $name = '', $env = '') + { + parent::__construct($data); + if (!empty($env)) { + $name .= ".$env"; + } + $this->name = $name; + } + + /** + * @inheritdoc + */ + public function name() + { + return $this->name; + } + + /** + * @inheritdoc + */ + public function exportConfig() + { + return $this->remap($this->export()); + } + + /** + * Reconfigure data exported from the form it is expected to be in + * inside an alias record to the form it is expected to be in when + * inside a configuration file. + */ + protected function remap($data) + { + foreach ($this->remapOptionTable() as $from => $to) { + if (isset($data[$from])) { + unset($data[$from]); + } + $value = $this->get($from, null); + if (isset($value)) { + $data['options'][$to] = $value; + } + } + + return new Config($data); + } + + /** + * Fetch the parameter-specific options from the 'alias-parameters' section of the alias. + * @param string $parameterName + * @return array + */ + protected function getParameterSpecificOptions($aliasData, $parameterName) + { + if (!empty($parameterName) && $this->has("alias-parameters.{$parameterName}")) { + return $this->get("alias-parameters.{$parameterName}"); + } + return []; + } + + /** + * Convert the data in this record to the layout that was used + * in the legacy code, for backwards compatiblity. + */ + public function legacyRecord() + { + $result = $this->exportConfig()->get('options', []); + + // Backend invoke needs a couple of critical items in specific locations. + if ($this->has('paths.drush-script')) { + $result['path-aliases']['%drush-script'] = $this->get('paths.drush-script'); + } + if ($this->has('ssh.options')) { + $result['ssh-options'] = $this->get('ssh.options'); + } + return $result; + } + + /** + * Conversion table from old to new option names. These all implicitly + * go in `options`, although they can come from different locations. + */ + protected function remapOptionTable() + { + return [ + 'user' => 'remote-user', + 'host' => 'remote-host', + 'root' => 'root', + 'uri' => 'uri', + ]; + } +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasFileDiscovery.php b/vendor/consolidation/site-alias/src/SiteAliasFileDiscovery.php new file mode 100644 index 0000000000000000000000000000000000000000..3902c6c357c03e70e9a28b7062b3806ac946cb38 --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasFileDiscovery.php @@ -0,0 +1,213 @@ +<?php +namespace Consolidation\SiteAlias; + +use Symfony\Component\Finder\Finder; + +/** + * Discover alias files named: + * + * - sitename.site.yml: contains multiple aliases, one for each of the + * environments of 'sitename'. + * + * Drush aliases that contain both a site name and an environment + * (e.g. @site.env) will cause Drush to find the file named after + * the respective site name and retrieve the specified environment + * record. + * + * Sites may also define a special alias file self.site.yml, which + * may be stored in the drush/sites directory relative to either + * the Drupal root or the Composer root of the site. The environments + * in this file will be merged with the available environments for + * the element @self, however it is defined. + */ +class SiteAliasFileDiscovery +{ + protected $searchLocations; + protected $locationFilter; + protected $depth; + + public function __construct($searchLocations = [], $depth = '<= 1', $locationFilter = null) + { + $this->locationFilter = $locationFilter; + $this->searchLocations = $searchLocations; + $this->depth = $depth; + } + + /** + * Add a location that alias files may be found. + * + * @param string $path + * @return $this + */ + public function addSearchLocation($paths) + { + foreach ((array)$paths as $path) { + if (is_dir($path)) { + $this->searchLocations[] = $path; + } + } + return $this; + } + + /** + * Return all of the paths where alias files may be found. + * @return string[] + */ + public function searchLocations() + { + return $this->searchLocations; + } + + public function locationFilter() + { + return $this->locationFilter; + } + + /** + * Set the search depth for finding alias files + * + * @param string|int $depth (@see \Symfony\Component\Finder\Finder::depth) + * @return $this + */ + public function depth($depth) + { + $this->depth = $depth; + return $this; + } + + /** + * Only search for aliases that are in alias files stored in directories + * whose basename or key matches the specified location. + */ + public function filterByLocation($location) + { + if (empty($location)) { + return $this; + } + + return new SiteAliasFileDiscovery($this->searchLocations(), $this->depth, $location); + } + + /** + * Find an alias file SITENAME.site.yml in one + * of the specified search locations. + * + * @param string $siteName + * @return string[] + */ + public function find($siteName) + { + return $this->searchForAliasFiles("$siteName.site.yml"); + } + + /** + * Find an alias file SITENAME.site.yml in one + * of the specified search locations. + * + * @param string $siteName + * @return string|bool + */ + public function findSingleSiteAliasFile($siteName) + { + $matches = $this->find($siteName); + if (empty($matches)) { + return false; + } + return reset($matches); + } + + /** + * Return a list of all SITENAME.site.yml files in any of + * the search locations. + * + * @return string[] + */ + public function findAllSingleAliasFiles() + { + return $this->searchForAliasFiles('*.site.yml'); + } + + /** + * Return all of the legacy alias files used in previous Drush versions. + * + * @return string[] + */ + public function findAllLegacyAliasFiles() + { + return array_merge( + $this->searchForAliasFiles('*.alias.drushrc.php'), + $this->searchForAliasFiles('*.aliases.drushrc.php'), + $this->searchForAliasFiles('aliases.drushrc.php') + ); + } + + /** + * Create a Symfony Finder object to search all available search locations + * for the specified search pattern. + * + * @param string $searchPattern + * @return Finder + */ + protected function createFinder($searchPattern) + { + $finder = new Finder(); + $finder->files() + ->name($searchPattern) + ->in($this->searchLocations) + ->depth($this->depth); + return $finder; + } + + /** + * Return a list of all alias files matching the provided pattern. + * + * @param string $searchPattern + * @return string[] + */ + protected function searchForAliasFiles($searchPattern) + { + if (empty($this->searchLocations)) { + return []; + } + list($match, $site) = $this->splitLocationFromSite($this->locationFilter); + if (!empty($site)) { + $searchPattern = str_replace('*', $site, $searchPattern); + } + $finder = $this->createFinder($searchPattern); + $result = []; + foreach ($finder as $file) { + $path = $file->getRealPath(); + $result[] = $path; + } + // Find every location where the parent directory name matches + // with the first part of the search pattern. + // In theory we can use $finder->path() instead. That didn't work well, + // in practice, though; had trouble correctly escaping the path separators. + if (!empty($this->locationFilter)) { + $result = array_filter($result, function ($path) use ($match) { + return SiteAliasName::locationFromPath($path) === $match; + }); + } + + return $result; + } + + /** + * splitLocationFromSite returns the part of 'site' before the first + * '.' as the "path match" component, and the part after the first + * '.' as the "site" component. + */ + protected function splitLocationFromSite($site) + { + $parts = explode('.', $site, 3) + ['', '', '']; + + return array_slice($parts, 0, 2); + } + + + // TODO: Seems like this could just be basename() + protected function extractKey($basename, $filenameExensions) + { + return str_replace($filenameExensions, '', $basename); + } +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasFileLoader.php b/vendor/consolidation/site-alias/src/SiteAliasFileLoader.php new file mode 100644 index 0000000000000000000000000000000000000000..58325ad780a4995e79ddce782aa9c221da08d31c --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasFileLoader.php @@ -0,0 +1,626 @@ +<?php +namespace Consolidation\SiteAlias; + +use Consolidation\Config\Loader\ConfigProcessor; +use Dflydev\DotAccessData\Util as DotAccessDataUtil; + +/** + * Discover alias files: + * + * - sitename.site.yml: contains multiple aliases, one for each of the + * environments of 'sitename'. + */ +class SiteAliasFileLoader +{ + /** + * @var SiteAliasFileDiscovery + */ + protected $discovery; + + /** + * @var array + */ + protected $referenceData; + + /** + * @var array + */ + protected $loader; + + /** + * @var string + */ + protected $root; + + /** + * SiteAliasFileLoader constructor + * + * @param SiteAliasFileDiscovery|null $discovery + */ + public function __construct($discovery = null) + { + $this->discovery = $discovery ?: new SiteAliasFileDiscovery(); + $this->referenceData = []; + $this->loader = []; + } + + /** + * Allow configuration data to be used in replacements in the alias file. + */ + public function setReferenceData($data) + { + $this->referenceData = $data; + } + + /** + * Allow 'self.site.yml' to be applied to any alias record found. + */ + public function setRoot($root) + { + $this->root = $root; + } + + /** + * Add a search location to our discovery object. + * + * @param string $path + * + * @return $this + */ + public function addSearchLocation($path) + { + $this->discovery()->addSearchLocation($path); + return $this; + } + + /** + * Return our discovery object. + * + * @return SiteAliasFileDiscovery + */ + public function discovery() + { + return $this->discovery; + } + + /** + * Load the file containing the specified alias name. + * + * @param SiteAliasName $aliasName + * + * @return SiteAlias|false + */ + public function load(SiteAliasName $aliasName) + { + // First attempt to load a sitename.site.yml file for the alias. + $aliasRecord = $this->loadSingleAliasFile($aliasName); + if ($aliasRecord) { + return $aliasRecord; + } + + // If aliasname was provides as @site.env and we did not find it, + // then we are done. + if ($aliasName->hasSitename()) { + return false; + } + + // If $aliasName was provided as `@foo` (`hasSitename()` returned `false` + // above), then this was interpreted as `@self.foo` when we searched + // above. If we could not find an alias record for `@self.foo`, then we + // will try to search again, this time with the assumption that `@foo` + // might be `@foo.<default>`, where `<default>` is the default + // environment for the specified site. Note that in this instance, the + // sitename will be found in $aliasName->env(). + $sitename = $aliasName->env(); + return $this->loadDefaultEnvFromSitename($sitename); + } + + /** + * Given only a site name, load the default environment from it. + */ + protected function loadDefaultEnvFromSitename($sitename) + { + $path = $this->discovery()->findSingleSiteAliasFile($sitename); + if (!$path) { + return false; + } + $data = $this->loadSiteDataFromPath($path); + if (!$data) { + return false; + } + $env = $this->getDefaultEnvironmentName($data); + + $aliasName = new SiteAliasName($sitename, $env); + $processor = new ConfigProcessor(); + return $this->fetchSiteAliasFromSiteAliasData($aliasName, $processor, $data); + } + + /** + * Return a list of all site aliases loadable from any findable path. + * + * @return SiteAlias[] + */ + public function loadAll() + { + $result = []; + $paths = $this->discovery()->findAllSingleAliasFiles(); + foreach ($paths as $path) { + $aliasRecords = $this->loadSingleSiteAliasFileAtPath($path); + if ($aliasRecords) { + foreach ($aliasRecords as $aliasRecord) { + $this->storeSiteAliasInResut($result, $aliasRecord); + } + } + } + ksort($result); + return $result; + } + + /** + * Return a list of all available alias files. Does not include + * legacy files. + * + * @param string $location Only consider alias files in the specified location. + * @return string[] + */ + public function listAll($location = '') + { + return $this->discovery()->filterByLocation($location)->findAllSingleAliasFiles(); + } + + /** + * Given an alias name that might represent multiple sites, + * return a list of all matching alias records. If nothing was found, + * or the name represents a single site + env, then we take + * no action and return `false`. + * + * @param string $sitename The site name to return all environments for. + * @return SiteAlias[]|false + */ + public function loadMultiple($sitename, $location = null) + { + $result = []; + foreach ($this->discovery()->filterByLocation($location)->find($sitename) as $path) { + if ($siteData = $this->loadSiteDataFromPath($path)) { + $location = SiteAliasName::locationFromPath($path); + // Convert the raw array into a list of alias records. + $result = array_merge( + $result, + $this->createSiteAliassFromSiteData($sitename, $siteData, $location) + ); + } + } + return $result; + } + + /** + * Given a location, return all alias files located there. + * + * @param string $location The location to filter. + * @return SiteAlias[] + */ + public function loadLocation($location) + { + $result = []; + foreach ($this->listAll($location) as $path) { + if ($siteData = $this->loadSiteDataFromPath($path)) { + $location = SiteAliasName::locationFromPath($path); + $sitename = $this->siteNameFromPath($path); + // Convert the raw array into a list of alias records. + $result = array_merge( + $result, + $this->createSiteAliassFromSiteData($sitename, $siteData, $location) + ); + } + } + return $result; + } + + /** + * @param array $siteData list of sites with its respective data + * + * @param SiteAliasName $aliasName The name of the record being created + * @param $siteData An associative array of envrionment => site data + * @return SiteAlias[] + */ + protected function createSiteAliassFromSiteData($sitename, $siteData, $location = '') + { + $result = []; + if (!is_array($siteData) || empty($siteData)) { + return $result; + } + foreach ($siteData as $envName => $data) { + if (is_array($data) && $this->isValidEnvName($envName)) { + $aliasName = new SiteAliasName($sitename, $envName, $location); + + $processor = new ConfigProcessor(); + $oneRecord = $this->fetchSiteAliasFromSiteAliasData($aliasName, $processor, $siteData); + $this->storeSiteAliasInResut($result, $oneRecord); + } + } + return $result; + } + + /** + * isValidEnvName determines if a given entry should be skipped or not + * (e.g. the "common" entry). + * + * @param string $envName The environment name to test + */ + protected function isValidEnvName($envName) + { + return $envName != 'common'; + } + + /** + * Store an alias record in a list. If the alias record has + * a known name, then the key of the list will be the record's name. + * Otherwise, append the record to the end of the list with + * a numeric index. + * + * @param &SiteAlias[] $result list of alias records + * @param SiteAlias $aliasRecord one more alias to store in the result + */ + protected function storeSiteAliasInResut(&$result, SiteAlias $aliasRecord) + { + if (!$aliasRecord) { + return; + } + $key = $aliasRecord->name(); + if (empty($key)) { + $result[] = $aliasRecord; + return; + } + $result[$key] = $aliasRecord; + } + + /** + * If the alias name is '@sitename', or if it is '@sitename.env', then + * look for a sitename.site.yml file that contains it. We also handle + * '@location.sitename.env' here as well. + * + * @param SiteAliasName $aliasName + * + * @return SiteAlias|false + */ + protected function loadSingleAliasFile(SiteAliasName $aliasName) + { + // Check to see if the appropriate sitename.alias.yml file can be + // found. Return if it cannot. + $path = $this->discovery() + ->filterByLocation($aliasName->location()) + ->findSingleSiteAliasFile($aliasName->sitename()); + if (!$path) { + return false; + } + return $this->loadSingleAliasFileWithNameAtPath($aliasName, $path); + } + + /** + * Given only the path to an alias file `site.alias.yml`, return all + * of the alias records for every environment stored in that file. + * + * @param string $path + * @return SiteAlias[] + */ + protected function loadSingleSiteAliasFileAtPath($path) + { + $sitename = $this->siteNameFromPath($path); + $location = SiteAliasName::locationFromPath($path); + if ($siteData = $this->loadSiteDataFromPath($path)) { + return $this->createSiteAliassFromSiteData($sitename, $siteData, $location); + } + return false; + } + + /** + * Given the path to a single site alias file `site.alias.yml`, + * return the `site` part. + * + * @param string $path + */ + protected function siteNameFromPath($path) + { + return $this->basenameWithoutExtension($path, '.site.yml'); + +// OR: +// $filename = basename($path); +// return preg_replace('#\..*##', '', $filename); + } + + /** + * Chop off the `aliases.yml` or `alias.yml` part of a path. This works + * just like `basename`, except it will throw if the provided path + * does not end in the specified extension. + * + * @param string $path + * @param string $extension + * @return string + * @throws \Exception + */ + protected function basenameWithoutExtension($path, $extension) + { + $result = basename($path, $extension); + // It is an error if $path does not end with site.yml + if ($result == basename($path)) { + throw new \Exception("$path must end with '$extension'"); + } + return $result; + } + + /** + * Given an alias name and a path, load the data from the path + * and process it as needed to generate the alias record. + * + * @param SiteAliasName $aliasName + * @param string $path + * @return SiteAlias|false + */ + protected function loadSingleAliasFileWithNameAtPath(SiteAliasName $aliasName, $path) + { + $data = $this->loadSiteDataFromPath($path); + if (!$data) { + return false; + } + $processor = new ConfigProcessor(); + return $this->fetchSiteAliasFromSiteAliasData($aliasName, $processor, $data); + } + + /** + * Load the yml from the given path + * + * @param string $path + * @return array|bool + */ + protected function loadSiteDataFromPath($path) + { + $data = $this->loadData($path); + if (!$data) { + return false; + } + $selfSiteAliases = $this->findSelfSiteAliases($data, $path); + $data = array_merge($data, $selfSiteAliases); + return $data; + } + + /** + * Given an array of site aliases, find the first one that is + * local (has no 'host' item) and also contains a 'self.site.yml' file. + * @param array $data + * @return array + */ + protected function findSelfSiteAliases($site_aliases, $path) + { + foreach ($site_aliases as $site => $data) { + if (!isset($data['host']) && isset($data['root'])) { + $data = $this->loadSelfSiteData($data['root']); + if (!empty($data)) { + return $data; + } + } + } + + return $this->loadSelfSiteData($this->root); + } + + /** + * Check to see if there is a 'drush/sites/self.site.yml' file at + * the provided root, or one directory up from there. + */ + protected function loadSelfSiteData($root) + { + if (!$root) { + return []; + } + foreach (['.', '..'] as $relative_path) { + $candidate = $root . '/' . $relative_path . '/drush/sites/self.site.yml'; + if (file_exists($candidate)) { + return $this->loadData($candidate); + } + } + return []; + } + + /** + * Load the contents of the specified file. + * + * @param string $path Path to file to load + * @return array + */ + protected function loadData($path) + { + if (empty($path) || !file_exists($path)) { + return []; + } + $loader = $this->getLoader(pathinfo($path, PATHINFO_EXTENSION)); + if (!$loader) { + return []; + } + return $loader->load($path); + } + + /** + * @return DataFileLoaderInterface + */ + public function getLoader($extension) + { + if (!isset($this->loader[$extension])) { + return null; + } + return $this->loader[$extension]; + } + + public function addLoader($extension, DataFileLoaderInterface $loader) + { + $this->loader[$extension] = $loader; + } + + /** + * Given an array containing site alias data, return an alias record + * containing the data for the requested record. If there is a 'common' + * section, then merge that in as well. + * + * @param SiteAliasName $aliasName the alias we are loading + * @param array $data + * + * @return SiteAlias|false + */ + protected function fetchSiteAliasFromSiteAliasData(SiteAliasName $aliasName, ConfigProcessor $processor, array $data) + { + $data = $this->adjustIfSingleAlias($data); + $env = $this->getEnvironmentName($aliasName, $data); + $env_data = $this->getRequestedEnvData($data, $env); + if (!$env_data) { + return false; + } + + // Add the 'common' section if it exists. + if ($this->siteEnvExists($data, 'common')) { + $processor->add($data['common']); + } + + // Then add the data from the desired environment. + $processor->add($env_data); + + // Export the combined data and create an SiteAlias object to manage it. + return new SiteAlias($processor->export($this->referenceData + ['env-name' => $env]), '@' . $aliasName->sitenameWithLocation(), $env); + } + + /** + * getRequestedEnvData fetches the data for the specified environment + * from the provided site record data. + * + * @param array $data The site alias data + * @param string $env The name of the environment desired + * @return array|false + */ + protected function getRequestedEnvData(array $data, $env) + { + // If the requested environment exists, we will use it. + if ($this->siteEnvExists($data, $env)) { + return $data[$env]; + } + + // If there is a wildcard environment, then return that instead. + if ($this->siteEnvExists($data, '*')) { + return $data['*']; + } + + return false; + } + + /** + * Determine whether there is a valid-looking environment '$env' in the + * provided site alias data. + * + * @param array $data + * @param string $env + * @return bool + */ + protected function siteEnvExists(array $data, $env) + { + return ( + is_array($data) && + isset($data[$env]) && + is_array($data[$env]) + ); + } + + /** + * Adjust the alias data for a single-site alias. Usually, a .yml alias + * file will contain multiple entries, one for each of the environments + * of an alias. If there are no environments + * + * @param array $data + * @return array + */ + protected function adjustIfSingleAlias($data) + { + if (!$this->detectSingleAlias($data)) { + return $data; + } + + $result = [ + 'default' => $data, + ]; + + return $result; + } + + /** + * A single-environment alias looks something like this: + * + * --- + * root: /path/to/drupal + * uri: https://mysite.org + * + * A multiple-environment alias looks something like this: + * + * --- + * default: dev + * dev: + * root: /path/to/dev + * uri: https://dev.mysite.org + * stage: + * root: /path/to/stage + * uri: https://stage.mysite.org + * + * The differentiator between these two is that the multi-environment + * alias always has top-level elements that are associative arrays, and + * the single-environment alias never does. + * + * @param array $data + * @return bool + */ + protected function detectSingleAlias($data) + { + foreach ($data as $key => $value) { + if (is_array($value) && DotAccessDataUtil::isAssoc($value)) { + return false; + } + } + return true; + } + + /** + * Return the name of the environment requested. + * + * @param SiteAliasName $aliasName the alias we are loading + * @param array $data + * + * @return string + */ + protected function getEnvironmentName(SiteAliasName $aliasName, array $data) + { + // If the alias name specifically mentions the environment + // to use, then return it. + if ($aliasName->hasEnv()) { + return $aliasName->env(); + } + return $this->getDefaultEnvironmentName($data); + } + + /** + * Given a data array containing site alias environments, determine which + * envirionmnet should be used as the default environment. + * + * @param array $data + * @return string + */ + protected function getDefaultEnvironmentName(array $data) + { + // If there is an entry named 'default', it will either contain the + // name of the environment to use by default, or it will itself be + // the default environment. + if (isset($data['default'])) { + return is_array($data['default']) ? 'default' : $data['default']; + } + // If there is an environment named 'dev', it will be our default. + if (isset($data['dev'])) { + return 'dev'; + } + // If we don't know which environment to use, just take the first one. + $keys = array_keys($data); + return reset($keys); + } +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasInterface.php b/vendor/consolidation/site-alias/src/SiteAliasInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..008f508aaa42c6e03cbb50dbdcb8b5821f84fb8c --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasInterface.php @@ -0,0 +1,133 @@ +<?php +namespace Consolidation\SiteAlias; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; +use Consolidation\Config\Util\ArrayUtil; + +/** + * An alias record is a configuration record containing well-known items. + * + * NOTE: SiteAlias is implemented as a Config subclass; however, it + * should not be used as a config. (A better implementation would be + * "hasa" config, but that is less convenient, as we want all of the + * same capabilities as a config object). + * + * If using an alias record as config is desired, use the 'exportConfig()' + * method. + * + * Example remote alias: + * + * --- + * host: www.myisp.org + * user: www-data + * root: /path/to/drupal + * uri: mysite.org + * + * Example local alias with global and command-specific options: + * + * --- + * root: /path/to/drupal + * uri: mysite.org + * options: + * no-interaction: true + * command: + * user: + * login: + * options: + * name: superuser + */ +interface SiteAliasInterface extends ConfigInterface +{ + /** + * Return the name of this alias record. + * + * @return string + */ + public function name(); + + /** + * Determine whether this alias has a root. + */ + public function hasRoot(); + + /** + * Get the root + */ + public function root(); + + /** + * Get the uri + */ + public function uri(); + + /** + * Record the uri + * + * @param string $uri + */ + public function setUri($uri); + + /** + * Return user@host, or just host if there is no user. Returns + * an empty string if there is no host. + * + * @return string + */ + public function remoteHostWithUser(); + + /** + * Get the remote user + */ + public function remoteUser(); + + /** + * Return true if this alias record has a remote user + */ + public function hasRemoteUser(); + + /** + * Get the remote host + */ + public function remoteHost(); + + /** + * Return true if this alias record has a remote host that is not + * the local host + * + * @internal + */ + public function isRemote(); + + /** + * Return true if the alias record use the Docker Compose transport. + * + * @internal + * + * @return bool + */ + public function isContainer(); + + /** + * Return true if this alias record is for the local system + */ + public function isLocal(); + + /** + * Determine whether this alias does not represent any site. An + * alias record must either be remote or have a root. + */ + public function isNone(); + + /** + * Return the 'root' element of this alias if this alias record + * is local. + */ + public function localRoot(); + + /** + * Export the configuration values in this alias record, and reconfigure + * them so that the layout matches that of the global configuration object. + */ + public function exportConfig(); +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasManager.php b/vendor/consolidation/site-alias/src/SiteAliasManager.php new file mode 100644 index 0000000000000000000000000000000000000000..4105a2bd579e0d0944ca2a2ec9ec8432c9ffe7ad --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasManager.php @@ -0,0 +1,215 @@ +<?php +namespace Consolidation\SiteAlias; + +/** + * Site Alias manager + */ +class SiteAliasManager implements SiteAliasManagerInterface, SiteAliasManagerInitializationInterface +{ + protected $aliasLoader; + protected $selfSiteAlias; + protected $specParser; + protected $root = ''; + + /** + * Constructor for SiteAliasManager + * + * @param SiteAliasFileLoader|null $aliasLoader an alias loader + */ + public function __construct($aliasLoader = null, $root = '') + { + $this->aliasLoader = $aliasLoader ?: new SiteAliasFileLoader(); + $this->specParser = new SiteSpecParser(); + $this->selfSiteAlias = new SiteAlias(); + $this->setRoot($root); + } + + /** + * Allow configuration data to be used in replacements in the alias file. + */ + public function setReferenceData($data) + { + $this->aliasLoader->setReferenceData($data); + return $this; + } + + /** + * Inject the root of the selected site + * + * @param string $root + * @return $this + */ + public function setRoot($root) + { + $this->root = $root; + $this->aliasLoader->setRoot($root); + return $this; + } + + /** + * Add a search location to our site alias discovery object. + * + * @param string $path + * + * @return $this + */ + public function addSearchLocation($path) + { + $this->aliasLoader->discovery()->addSearchLocation($path); + return $this; + } + + /** + * Add search locations to our site alias discovery object. + * + * @param array $paths Any path provided in --alias-path option + * or drush.path.alias-path configuration item. + * + * @return $this + */ + public function addSearchLocations(array $paths) + { + foreach ($paths as $path) { + $this->aliasLoader->discovery()->addSearchLocation($path); + } + return $this; + } + + /** + * Return all of the paths where alias files may be found. + * @return string[] + */ + public function searchLocations() + { + return $this->aliasLoader->discovery()->searchLocations(); + } + + /** + * Get an alias record by name, or convert a site specification + * into an alias record via the site alias spec parser. If a + * simple alias name is provided (e.g. '@alias'), it is interpreted + * as a sitename, and the default environment for that site is returned. + * + * @param string $name Alias name or site specification + * + * @return SiteAlias|false + */ + public function get($name) + { + if (SiteAliasName::isAliasName($name)) { + return $this->getAlias($name); + } + + if ($this->specParser->validSiteSpec($name)) { + return new SiteAlias($this->specParser->parse($name, $this->root), $name); + } + + return false; + } + + /** + * Get the '@self' alias record. + * + * @return SiteAlias + */ + public function getSelf() + { + return $this->selfSiteAlias; + } + + /** + * Force-set the current @self alias. + * + * @param SiteAlias $selfSiteAlias + * @return $this + */ + public function setSelf(SiteAlias $selfSiteAlias) + { + $this->selfSiteAlias = $selfSiteAlias; + $this->setRoot($selfSiteAlias->localRoot()); + return $this; + } + + /** + * Get an alias record from a name. Does not accept site specifications. + * + * @param string $aliasName alias name + * + * @return SiteAlias + */ + public function getAlias($aliasName) + { + $aliasName = SiteAliasName::parse($aliasName); + + if ($aliasName->isSelf()) { + return $this->getSelf(); + } + + if ($aliasName->isNone()) { + return new SiteAlias([], '@none'); + } + + // Search through all search locations, load + // matching and potentially-matching alias files, + // and return the alias matching the provided name. + return $this->aliasLoader->load($aliasName); + } + + /** + * Given a simple alias name, e.g. '@alias', returns all of the + * environments in the specified site. + * + * If the provided name is a site specification et. al., + * then this method will return 'false'. + * + * @param string $name Alias name + * @return SiteAlias[]|false + */ + public function getMultiple($name = '') + { + if (empty($name)) { + return $this->aliasLoader->loadAll(); + } + + if (!SiteAliasName::isAliasName($name)) { + return false; + } + + // Trim off the '@' + $trimmedName = ltrim($name, '@'); + + // If the provided name is a location, return all aliases there + $result = $this->aliasLoader->loadLocation($trimmedName); + if (!empty($result)) { + return $result; + } + + // If the provided name is a site, return all environments + $result = $this->aliasLoader->loadMultiple($trimmedName); + if (!empty($result)) { + return $result; + } + + // Special checking for @self + if ($trimmedName == 'self') { + $self = $this->getSelf(); + $result = array_merge( + ['@self' => $self], + $result + ); + } + + return $result; + } + + /** + * Return the paths to all alias files in all search locations known + * to the alias manager. + * + * @return string[] + */ + public function listAllFilePaths($location = '') + { + return $this->aliasLoader->listAll($location); + } +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasManagerAwareInterface.php b/vendor/consolidation/site-alias/src/SiteAliasManagerAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..15ddab8b203a4bb9a9954e0a30940be083704893 --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasManagerAwareInterface.php @@ -0,0 +1,23 @@ +<?php +namespace Consolidation\SiteAlias; + +/** + * Inflection interface for the site alias manager. + */ +interface SiteAliasManagerAwareInterface +{ + /** + * @param SiteAliasManager $siteAliasManager + */ + public function setSiteAliasManager(SiteAliasManagerInterface $siteAliasManager); + + /** + * @return SiteAliasManagerInterface + */ + public function siteAliasManager(); + + /** + * @return bool + */ + public function hasSiteAliasManager(); +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasManagerAwareTrait.php b/vendor/consolidation/site-alias/src/SiteAliasManagerAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..4f524ac9df7921d5ec954029aca21bd893b8c2f4 --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasManagerAwareTrait.php @@ -0,0 +1,34 @@ +<?php +namespace Consolidation\SiteAlias; + +/** + * Inflection trait for the site alias manager. + */ +trait SiteAliasManagerAwareTrait +{ + protected $siteAliasManager; + + /** + * @inheritdoc + */ + public function setSiteAliasManager(SiteAliasManagerInterface $siteAliasManager) + { + $this->siteAliasManager = $siteAliasManager; + } + + /** + * @return SiteAliasManagerInterface + */ + public function siteAliasManager() + { + return $this->siteAliasManager; + } + + /** + * @inheritdoc + */ + public function hasSiteAliasManager() + { + return isset($this->siteAliasManager); + } +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasManagerInitializationInterface.php b/vendor/consolidation/site-alias/src/SiteAliasManagerInitializationInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..957ebdb6ea37027486d3a6ccd45fa6d003b98c8a --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasManagerInitializationInterface.php @@ -0,0 +1,48 @@ +<?php +namespace Consolidation\SiteAlias; + +/** + * Site Alias manager methods used to set up the object. + */ +interface SiteAliasManagerInitializationInterface +{ + /** + * Allow configuration data to be used in replacements in the alias file. + */ + public function setReferenceData($data); + + /** + * Inject the root of the selected site + * + * @param string $root + * @return $this + */ + public function setRoot($root); + + /** + * Add a search location to our site alias discovery object. + * + * @param string $path + * + * @return $this + */ + public function addSearchLocation($path); + + /** + * Add search locations to our site alias discovery object. + * + * @param array $paths Any path provided in --alias-path option + * or drush.path.alias-path configuration item. + * + * @return $this + */ + public function addSearchLocations(array $paths); + + /** + * Force-set the current @self alias. + * + * @param SiteAlias $selfSiteAlias + * @return $this + */ + public function setSelf(SiteAlias $selfSiteAlias); +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasManagerInterface.php b/vendor/consolidation/site-alias/src/SiteAliasManagerInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..11f3a60c2494296ac37eabed3c861c1401407bcd --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasManagerInterface.php @@ -0,0 +1,62 @@ +<?php +namespace Consolidation\SiteAlias; + +/** + * Site Alias manager + */ +interface SiteAliasManagerInterface +{ + /** + * Return all of the paths where alias files may be found. + * @return string[] + */ + public function searchLocations(); + + /** + * Get an alias record by name, or convert a site specification + * into an alias record via the site alias spec parser. If a + * simple alias name is provided (e.g. '@alias'), it is interpreted + * as a sitename, and the default environment for that site is returned. + * + * @param string $name Alias name or site specification + * + * @return SiteAlias|false + */ + public function get($name); + + /** + * Get the '@self' alias record. + * + * @return SiteAlias + */ + public function getSelf(); + + /** + * Get an alias record from a name. Does not accept site specifications. + * + * @param string $aliasName alias name + * + * @return SiteAlias + */ + public function getAlias($aliasName); + + /** + * Given a simple alias name, e.g. '@alias', returns all of the + * environments in the specified site. + * + * If the provided name is a site specification et. al., + * then this method will return 'false'. + * + * @param string $name Alias name + * @return SiteAlias[]|false + */ + public function getMultiple($name = ''); + + /** + * Return the paths to all alias files in all search locations known + * to the alias manager. + * + * @return string[] + */ + public function listAllFilePaths($location = ''); +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasName.php b/vendor/consolidation/site-alias/src/SiteAliasName.php new file mode 100644 index 0000000000000000000000000000000000000000..d8aa32ec23bf8fe2ef9e83bd1368517bff4973b1 --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasName.php @@ -0,0 +1,342 @@ +<?php +namespace Consolidation\SiteAlias; + +/** + * Parse a string that contains a site alias name, and provide convenience + * methods to access the parts. + * + * When provided by users, aliases must be in one of the following forms: + * + * - @sitename.env: List only sitename and environment. + * + * - @location.sitename.env: List only sitename and environment. Search + * only those paths where the name of the folder holding the alias + * files matches 'location'. Location terms may only be used when both + * the sitename and env are also provided. + * + * - @env: Look up a named environment in instances where the site root + * is known (e.g. via cwd). In this form, there is an implicit sitename + * 'self' which is replaced by the actual site alias name once known. + * + * - @sitename: Provides only the sitename; uses the 'default' environment, + * or 'dev' if there is no 'default' (or whatever is there if there is + * only one). With this form, the site alias name has no environment + * until the appropriate default environment is looked up. This form + * is checked only after `@env` returns no matches. This form can NOT + * be filtered with a `location.` term. + * + * There are also two special aliases that are recognized: + * + * - @self: The current bootstrapped site. + * + * - @none: No alias ('root' and 'uri' unset). + * + * The special alias forms have no environment component. + * + * When provided to an API, the '@' is optional. + * + * Note that @sitename and @env are ambiguous. Aliases in this form + * (that are not one of the special aliases) will first be assumed + * to be @env, and may be converted to @sitename later. + * + * Note that: + * + * - 'sitename' and 'env' MUST NOT contain a '.' (unlike previous + * versions of Drush). + * - Users SHOULD NOT create any environments that have the same name + * as any site name (and visa-versa). + * - All environments in one site record SHOULD be different versions + * of the same site (e.g. dev / test / live). + */ +class SiteAliasName +{ + protected $location; + protected $sitename; + protected $env; + + /** + * Match the parts of a regex name. + */ + const ALIAS_NAME_REGEX = '%^@?([a-zA-Z0-9_-]+)(\.[a-zA-Z0-9_-]+)?(\.[a-zA-Z0-9_-]+)?$%'; + + /** + * Create a new site alias name + * + * @param string $item + * @return SiteAliasName + */ + public static function parse($item) + { + $aliasName = new self(); + $aliasName->doParse($item); + return $aliasName; + } + + /** + * The 'location' of an alias file is defined as being the name + * of the immediate parent of the alias file. e.g. the path + * '$HOME/.drush/sites/isp/mysite.site.yml' would have a location + * of 'isp' and a sitename of 'mysite'. The environments of the site + * are defined by the alias contents. + * + * @param type $path + * @return type + */ + public static function locationFromPath($path) + { + $location = ltrim(basename(dirname($path)), '.'); + if (($location === 'sites') || ($location === 'drush')) { + return ''; + } + return $location; + } + + /** + * Creae a SiteAliasName object from an alias name string. + * + * @param string $sitename The alias name for the site. + * @param string $env The name for the site's environment. + * @param string $location The location filter for the site. + */ + public function __construct($sitename = null, $env = null, $location = null) + { + $this->location = $location; + $this->sitename = $sitename; + $this->env = $env; + } + + /** + * Convert an alias name back to a string. + * + * @return string + */ + public function __toString() + { + $parts = [ $this->sitename() ]; + if ($this->hasLocation()) { + array_unshift($parts, $this->location()); + } + if ($this->hasEnv()) { + $parts[] = $this->env(); + } + return '@' . implode('.', $parts); + } + + /** + * Determine whether or not the provided name is an alias name. + * + * @param string $aliasName + * @return bool + */ + public static function isAliasName($aliasName) + { + // Alias names provided by users must begin with '@' + if (empty($aliasName) || ($aliasName[0] != '@')) { + return false; + } + return preg_match(self::ALIAS_NAME_REGEX, $aliasName); + } + + /** + * Return the sitename portion of the alias name. By definition, + * every alias must have a sitename. If the site name is implicit, + * then 'self' is assumed. + * + * @return string + */ + public function sitename() + { + if (empty($this->sitename)) { + return 'self'; + } + return $this->sitename; + } + + /** + * Return the sitename portion of the alias name. By definition, + * every alias must have a sitename. If the site name is implicit, + * then 'self' is assumed. + * + * @return string + */ + public function sitenameWithLocation() + { + if (empty($this->sitename)) { + return 'self'; + } + return (empty($this->location) ? '' : $this->location . '.') . $this->sitename; + } + + /** + * Set the sitename portion of the alias name + * + * @param string $sitename + */ + public function setSitename($sitename) + { + $this->sitename = $sitename; + return $this; + } + + /** + * In general, all aliases have a sitename. The time when one will not + * is when an environment name `@env` is used as a shortcut for `@self.env` + * + * @return bool + */ + public function hasSitename() + { + return !empty($this->sitename); + } + + /** + * Return true if this alias name contains an 'env' portion. + * + * @return bool + */ + public function hasEnv() + { + return !empty($this->env); + } + + /** + * Set the environment portion of the alias name. + * + * @param string + */ + public function setEnv($env) + { + $this->env = $env; + return $this; + } + + /** + * Return the 'env' portion of the alias name. + * + * @return string + */ + public function env() + { + return $this->env; + } + + /** + * Return true if this alias name contains a 'location' portion + * @return bool + */ + public function hasLocation() + { + return !empty($this->location); + } + + /** + * Set the 'loation' portion of the alias name. + * @param string $location + */ + public function setLocation($location) + { + $this->location = $location; + return $this; + } + + /** + * Return the 'location' portion of the alias name. + * + * @param string + */ + public function location() + { + return $this->location; + } + + /** + * Return true if this alias name is the 'self' alias. + * + * @return bool + */ + public function isSelf() + { + return ($this->sitename == 'self') && !isset($this->env); + } + + /** + * Return true if this alias name is the 'none' alias. + */ + public function isNone() + { + return ($this->sitename == 'none') && !isset($this->env); + } + + /** + * Convert the parts of an alias name to its various component parts. + * + * @param string $aliasName a string representation of an alias name. + */ + protected function doParse($aliasName) + { + // Example contents of $matches: + // + // - a.b: + // [ + // 0 => 'a.b', + // 1 => 'a', + // 2 => '.b', + // ] + // + // - a: + // [ + // 0 => 'a', + // 1 => 'a', + // ] + if (!preg_match(self::ALIAS_NAME_REGEX, $aliasName, $matches)) { + return false; + } + + // Get rid of $matches[0] + array_shift($matches); + + // If $matches contains only one item1, then assume the alias name + // contains only the environment. + if (count($matches) == 1) { + return $this->processSingleItem($matches[0]); + } + + // If there are three items, then the first is the location. + if (count($matches) == 3) { + $this->location = trim(array_shift($matches), '.'); + } + + // The sitename and env follow the location. + $this->sitename = trim(array_shift($matches), '.'); + $this->env = trim(array_shift($matches), '.'); + return true; + } + + /** + * Process an alias name provided as '@sitename'. + * + * @param string $sitename + * @return true + */ + protected function processSingleItem($item) + { + if ($this->isSpecialAliasName($item)) { + $this->setSitename($item); + return true; + } + $this->sitename = ''; + $this->env = $item; + return true; + } + + /** + * Determine whether the requested name is a special alias name. + * + * @param string $item + * @return boolean + */ + protected function isSpecialAliasName($item) + { + return ($item == 'self') || ($item == 'none'); + } +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasTrait.php b/vendor/consolidation/site-alias/src/SiteAliasTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..7b79fb8a8fd9a74f27dcc6e606580a26973dadc5 --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasTrait.php @@ -0,0 +1,154 @@ +<?php +namespace Consolidation\SiteAlias; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; +use Consolidation\Config\Util\ArrayUtil; +use Consolidation\SiteAlias\Util\FsUtils; + +/** + * Common implementation of some SiteAlias methods. + */ +trait SiteAliasTrait +{ + /** + * @inheritdoc + */ + public function hasRoot() + { + return $this->has('root'); + } + + /** + * @inheritdoc + * + * @throws \Exception when the alias does not specify a root. + */ + public function root() + { + if (!$this->hasRoot()) { + throw new \Exception('Site alias ' . $this->name . ' does not specify a root.'); + } + $root = $this->get('root'); + if ($this->isLocal()) { + return FsUtils::realpath($root); + } + return $root; + } + + /** + * @inheritdoc + */ + public function uri() + { + return $this->get('uri'); + } + + /** + * @inheritdoc + */ + public function setUri($uri) + { + return $this->set('uri', $uri); + } + + /** + * @inheritdoc + */ + public function remoteHostWithUser() + { + $result = $this->remoteHost(); + if (!empty($result) && $this->hasRemoteUser()) { + $result = $this->remoteUser() . '@' . $result; + } + return $result; + } + + /** + * @inheritdoc + */ + public function remoteUser() + { + return $this->get('user'); + } + + /** + * @inheritdoc + */ + public function hasRemoteUser() + { + return $this->has('user'); + } + + /** + * @inheritdoc + */ + public function remoteHost() + { + return $this->get('host'); + } + + /** + * @inheritdoc + */ + public function isRemote() + { + return $this->has('host'); + } + + /** + * @inheritdoc + */ + public function isLocal() + { + return !$this->isRemote() && !$this->isContainer(); + } + + /** + * @inheritdoc + */ + public function isContainer() + { + return $this->has('docker'); + } + + /** + * @inheritdoc + */ + public function isNone() + { + return empty($this->root()) && $this->isLocal(); + } + + /** + * @inheritdoc + */ + public function localRoot() + { + if ($this->isLocal() && $this->hasRoot()) { + return $this->root(); + } + + return false; + } + + /** + * os returns the OS that this alias record points to. For local alias + * records, PHP_OS will be returned. For remote alias records, the + * value from the `os` element will be returned. If there is no `os` + * element, then the default assumption is that the remote system is Linux. + * + * @return string + * Linux + * WIN* (e.g. WINNT) + * CYGWIN + * MINGW* (e.g. MINGW32) + */ + public function os() + { + if ($this->isLocal()) { + return PHP_OS; + } + return $this->get('os', 'Linux'); + } +} diff --git a/vendor/consolidation/site-alias/src/SiteAliasWithConfig.php b/vendor/consolidation/site-alias/src/SiteAliasWithConfig.php new file mode 100644 index 0000000000000000000000000000000000000000..8f38efef3823d466f6aae62365ddef30abf31ffa --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteAliasWithConfig.php @@ -0,0 +1,185 @@ +<?php +namespace Consolidation\SiteAlias; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; +use Consolidation\Config\Util\ConfigRuntimeInterface; +use Consolidation\SiteAlias\SiteAlias; +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteAlias\SiteAliasTrait; + +/** + * SiteAliasWithConfig delegates to a site alias, and + * also combines it with two config stores: + * + * - Runtime config (set on commandline): Options that override site alias contents + * - Default config (set from config files): Default options + */ +class SiteAliasWithConfig implements SiteAliasInterface, ConfigRuntimeInterface +{ + use SiteAliasTrait; + + protected $runtimeConfig; + protected $siteAlias; + protected $defaultConfig; + + public function __construct(SiteAliasInterface $siteAlias, ConfigInterface $defaultConfig, ConfigInterface $runtimeConfig) + { + $this->siteAlias = $siteAlias; + $this->defaultConfig = $defaultConfig; + $this->runtimeConfig = $runtimeConfig; + } + + /** + * combine the provided site alias with configuration. + * + * @return SiteAlias read-only site alias combined with the runtime + * config (overrides the site alias values) and the default config. + */ + public static function create(SiteAliasInterface $siteAlias, ConfigInterface $defaultConfig, ConfigInterface $runtimeConfig = null) + { + $runtimeConfig = static::determineCorrectRuntimeConfig($defaultConfig, $runtimeConfig); + + return new self($siteAlias, $defaultConfig, $runtimeConfig); + } + + /** + * Determine what object to use for the runtime config. If a specific + * runtime config is given, use that. Otherwise, pull it from the default + * configuration if available. + */ + protected static function determineCorrectRuntimeConfig(ConfigInterface $defaultConfig, ConfigInterface $runtimeConfig) + { + if ($runtimeConfig) { + return $runtimeConfig; + } + + if ($defaultConfig instanceof ConfigRuntimeInterface) { + return $defaultConfig->runtimeConfig(); + } + + return new Config(); + } + + /** + * @inheritdoc + */ + public function runtimeConfig() + { + return $this->runtimeConfig; + } + + /** + * @inheritdoc + */ + public function name() + { + return $this->siteAlias->name(); + } + + /** + * @inheritdoc + */ + public function has($key) + { + return + $this->runtimeConfig->has($key) || + $this->siteAlias->has($key) || + $this->defaultConfig->has($key); + } + + /** + * @inheritdoc + */ + public function get($key, $defaultFallback = null) + { + if ($this->runtimeConfig->has($key)) { + return $this->runtimeConfig->get($key); + } + if ($this->siteAlias->has($key)) { + return $this->siteAlias->get($key); + } + if ($this->defaultConfig->has($key)) { + return $this->defaultConfig->get($key); + } + + return $defaultFallback; + } + + /** + * @inheritdoc + */ + public function set($key, $value) + { + $this->changesProhibited(); + } + + /** + * @inheritdoc + */ + public function import($data) + { + $this->changesProhibited(); + } + + /** + * @inheritdoc + */ + public function replace($data) + { + $this->changesProhibited(); + } + + /** + * @inheritdoc + */ + public function combine($data) + { + $this->changesProhibited(); + } + + /** + * Export all configuration as a nested array. + */ + public function export() + { + throw new \Exception('SiteAliasWithConfig::export() not supported.'); + } + + /** + * @inheritdoc + */ + public function hasDefault($key) + { + return false; + } + + /** + * @inheritdoc + */ + public function getDefault($key, $defaultFallback = null) + { + return $defaultFallback; + } + + /** + * @inheritdoc + */ + public function setDefault($key, $value) + { + $this->changesProhibited(); + } + + /** + * @inheritdoc + */ + public function exportConfig() + { + throw new \Exception('SiteAliasWithConfig::exportConfig() not supported.'); + } + + protected function changesProhibited() + { + throw new \Exception('Changing a SiteAliasWithConfig is not permitted.'); + } +} diff --git a/vendor/consolidation/site-alias/src/SiteSpecParser.php b/vendor/consolidation/site-alias/src/SiteSpecParser.php new file mode 100644 index 0000000000000000000000000000000000000000..c84ae77a451172ccf6808673b80c77bceecd2491 --- /dev/null +++ b/vendor/consolidation/site-alias/src/SiteSpecParser.php @@ -0,0 +1,234 @@ +<?php +namespace Consolidation\SiteAlias; + +/** + * Parse a string that contains a site specification. + * + * Site specifications contain some of the following elements: + * - user + * - host + * - path + * - uri (multisite selector) + */ +class SiteSpecParser +{ + /** + * @var string Relative path from the site root to directory where + * multisite configuration directories are found. + */ + protected $multisiteDirectoryRoot = 'sites'; + + /** + * Parse a site specification + * + * @param string $spec + * A site specification in one of the accepted forms: + * - /path/to/drupal#uri + * - user@server/path/to/drupal#uri + * - user@server/path/to/drupal + * - user@server#uri + * or, a site name: + * - #uri + * @param string $root + * Drupal root (if provided). + * @return array + * A site specification array with the specified components filled in: + * - user + * - host + * - path + * - uri + * or, an empty array if the provided parameter is not a valid site spec. + */ + public function parse($spec, $root = '') + { + $result = $this->match($spec); + return $this->fixAndCheckUsability($result, $root); + } + + /** + * Determine if the provided specification is valid. Note that this + * tests only for syntactic validity; to see if the specification is + * usable, call 'parse()', which will also filter out specifications + * for local sites that specify a multidev site that does not exist. + * + * @param string $spec + * @see parse() + * @return bool + */ + public function validSiteSpec($spec) + { + $result = $this->match($spec); + return !empty($result); + } + + /** + * Determine whether or not the provided name is an alias name. + * + * @param string $aliasName + * @return bool + */ + public function isAliasName($aliasName) + { + return !empty($aliasName) && ($aliasName[0] == '@'); + } + + public function setMultisiteDirectoryRoot($location) + { + $this->multisiteDirectoryRoot = $location; + } + + public function getMultisiteDirectoryRoot($root) + { + return $root . DIRECTORY_SEPARATOR . $this->multisiteDirectoryRoot; + } + + /** + * Return the set of regular expression patterns that match the available + * site specification formats. + * + * @return array + * key: site specification regex + * value: an array mapping from site specification component names to + * the elements in the 'matches' array containing the data for that element. + */ + protected function patterns() + { + $PATH = '([a-zA-Z]:[/\\\\][^#]*|[/\\\\][^#]*)'; + $USER = '([a-zA-Z0-9\._-]+)'; + $SERVER = '([a-zA-Z0-9\._-]+)'; + $URI = '([a-zA-Z0-9_-]+)'; + + return [ + // /path/to/drupal#uri + "%^{$PATH}#{$URI}\$%" => [ + 'root' => 1, + 'uri' => 2, + ], + // user@server/path/to/drupal#uri + "%^{$USER}@{$SERVER}{$PATH}#{$URI}\$%" => [ + 'user' => 1, + 'host' => 2, + 'root' => 3, + 'uri' => 4, + ], + // user@server/path/to/drupal + "%^{$USER}@{$SERVER}{$PATH}\$%" => [ + 'user' => 1, + 'host' => 2, + 'root' => 3, + 'uri' => 'default', // Or '2' if uri should be 'host' + ], + // user@server#uri + "%^{$USER}@{$SERVER}#{$URI}\$%" => [ + 'user' => 1, + 'host' => 2, + 'uri' => 3, + ], + // #uri + "%^#{$URI}\$%" => [ + 'uri' => 1, + ], + ]; + } + + /** + * Run through all of the available regex patterns and determine if + * any match the provided specification. + * + * @return array + * @see parse() + */ + protected function match($spec) + { + foreach ($this->patterns() as $regex => $map) { + if (preg_match($regex, $spec, $matches)) { + return $this->mapResult($map, $matches); + } + } + return []; + } + + /** + * Inflate the provided array so that it always contains the required + * elements. + * + * @return array + * @see parse() + */ + protected function defaults($result = []) + { + $result += [ + 'root' => '', + 'uri' => '', + ]; + + return $result; + } + + /** + * Take the data from the matches from the regular expression and + * plug them into the result array per the info in the provided map. + * + * @param array $map + * An array mapping from result key to matches index. + * @param array $matches + * The matched strings returned from preg_match + * @return array + * @see parse() + */ + protected function mapResult($map, $matches) + { + $result = []; + + foreach ($map as $key => $index) { + $value = is_string($index) ? $index : $matches[$index]; + $result[$key] = $value; + } + + if (empty($result)) { + return []; + } + + return $this->defaults($result); + } + + /** + * Validate the provided result. If the result is local, then it must + * have a 'root'. If it does not, then fill in the root that was provided + * to us in our consturctor. + * + * @param array $result + * @see parse() result. + * @return array + * @see parse() + */ + protected function fixAndCheckUsability($result, $root) + { + if (empty($result) || !empty($result['host'])) { + return $result; + } + + if (empty($result['root'])) { + // TODO: should these throw an exception, so the user knows + // why their site spec was invalid? + if (empty($root) || !is_dir($root)) { + return []; + } + + $result['root'] = $root; + } + + // If using a sitespec `#uri`, then `uri` MUST + // be the name of a folder that exists in __DRUPAL_ROOT__/sites. + // This restriction does NOT apply to the --uri option. Are there + // instances where we need to allow 'uri' to be a literal uri + // rather than the folder name? If so, we need to loosen this check. + // I think it's fine as it is, though. + $path = $this->getMultisiteDirectoryRoot($result['root']) . DIRECTORY_SEPARATOR . $result['uri']; + if (!is_dir($path)) { + return []; + } + + return $result; + } +} diff --git a/vendor/consolidation/site-alias/src/Util/FsUtils.php b/vendor/consolidation/site-alias/src/Util/FsUtils.php new file mode 100644 index 0000000000000000000000000000000000000000..b5741f290a94e6a23f2bcf1649cbcf3ced5ddac2 --- /dev/null +++ b/vendor/consolidation/site-alias/src/Util/FsUtils.php @@ -0,0 +1,26 @@ +<?php +namespace Consolidation\SiteAlias\Util; + +use Symfony\Component\Filesystem\Filesystem; +use Webmozart\PathUtil\Path; + +class FsUtils +{ + /** + * Returns canonicalized absolute pathname. + * + * The difference between this and PHP's realpath() is that this will + * return the original path even if it doesn't exist. + * + * @param string $path + * The path being checked. + * + * @return string + * The canonicalized absolute pathname. + */ + public static function realpath($path) + { + $realpath = realpath($path); + return $realpath ?: $path; + } +} diff --git a/vendor/consolidation/site-alias/src/Util/YamlDataFileLoader.php b/vendor/consolidation/site-alias/src/Util/YamlDataFileLoader.php new file mode 100644 index 0000000000000000000000000000000000000000..012f5a94a6a26334437032b54fbc8f3f2f91d437 --- /dev/null +++ b/vendor/consolidation/site-alias/src/Util/YamlDataFileLoader.php @@ -0,0 +1,16 @@ +<?php +namespace Consolidation\SiteAlias\Util; + +use Consolidation\SiteAlias\DataFileLoaderInterface; +use Symfony\Component\Yaml\Yaml; + +class YamlDataFileLoader implements DataFileLoaderInterface +{ + /** + * @inheritdoc + */ + public function load($path) + { + return (array) Yaml::parse(file_get_contents($path)); + } +} diff --git a/vendor/consolidation/site-alias/tests/SiteAliasCommandsTest.php b/vendor/consolidation/site-alias/tests/SiteAliasCommandsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0d9fb0198301b329ceb7a4d158267bfa24f06043 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/SiteAliasCommandsTest.php @@ -0,0 +1,109 @@ +<?php + +namespace Consolidation\SiteAlias; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Output\BufferedOutput; + +class ExampleCommandsTest extends TestCase +{ + /** @var string[] */ + protected $commandClasses; + + /** @var string */ + protected $appName; + + /** @var string */ + protected $appVersion; + + const STATUS_OK = 0; + const STATUS_ERROR = 1; + + /** + * Instantiate a new runner + */ + public function setUp() + { + // Store the command classes we are going to test + $this->commandClasses = [ \Consolidation\SiteAlias\Cli\SiteAliasCommands::class ]; + + // Define our invariants for our test + $this->appName = 'TestFixtureApp'; + $this->appVersion = '1.0.1'; + } + + /** + * Data provider for testExample. + * + * Return an array of arrays, each of which contains the parameter + * values to be used in one invocation of the testExample test function. + */ + public function exampleTestCommandParameters() + { + return [ + + [ + 'Add search location: /fixtures/sitealiases/sites', self::STATUS_ERROR, + 'site:list', '/fixtures/sitealiases/sites', + ], + + [ + 'List available site aliases', self::STATUS_OK, + 'list', + ], + + ]; + } + + /** + * Test our example class. Each time this function is called, it will + * be passed data from the data provider function idendified by the + * dataProvider annotation. + * + * @dataProvider exampleTestCommandParameters + */ + public function testExampleCommands($expectedOutput, $expectedStatus, $variable_args) + { + // Create our argv array and run the command + $argv = $this->argv(func_get_args()); + list($actualOutput, $statusCode) = $this->execute($argv); + + // Confirm that our output and status code match expectations + $this->assertContains($expectedOutput, $actualOutput); + $this->assertEquals($expectedStatus, $statusCode); + } + + /** + * Prepare our $argv array; put the app name in $argv[0] followed by + * the command name and all command arguments and options. + */ + protected function argv($functionParameters) + { + $argv = $functionParameters; + array_shift($argv); + array_shift($argv); + array_unshift($argv, $this->appName); + + // TODO: replace paths beginning with '/fixtures' with actual path to fixture data + + return $argv; + } + + /** + * Simulated front controller + */ + protected function execute($argv) + { + // Define a global output object to capture the test results + $output = new BufferedOutput(); + + // We can only call `Runner::execute()` once; then we need to tear down. + $runner = new \Robo\Runner($this->commandClasses); + $statusCode = $runner->execute($argv, $this->appName, $this->appVersion, $output); + \Robo\Robo::unsetContainer(); + + // Return the output and status code. + $actualOutput = trim($output->fetch()); + return [$actualOutput, $statusCode]; + } +} diff --git a/vendor/consolidation/site-alias/tests/SiteAliasFileDiscoveryTest.php b/vendor/consolidation/site-alias/tests/SiteAliasFileDiscoveryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..43021bb383c95db12bfa611515814828bc48058d --- /dev/null +++ b/vendor/consolidation/site-alias/tests/SiteAliasFileDiscoveryTest.php @@ -0,0 +1,70 @@ +<?php +namespace Consolidation\SiteAlias; + +use PHPUnit\Framework\TestCase; + +class SiteAliasFileDiscoveryTest extends TestCase +{ + use FixtureFactory; + use FunctionUtils; + + function setUp() + { + $this->sut = new SiteAliasFileDiscovery(); + } + + public function testSearchForSingleAliasFile() + { + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/sites'); + + $path = $this->sut->findSingleSiteAliasFile('single'); + $this->assertLocation('sites', $path); + $this->assertBasename('single.site.yml', $path); + } + + public function testSearchForMissingSingleAliasFile() + { + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/sites'); + + $path = $this->sut->findSingleSiteAliasFile('missing'); + $this->assertFalse($path); + } + + public function testFindAllLegacyAliasFiles() + { + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/legacy'); + + $result = $this->sut->findAllLegacyAliasFiles(); + $paths = $this->simplifyToBasenamesWithLocation($result); + $this->assertEquals('legacy/aliases.drushrc.php,legacy/cc.aliases.drushrc.php,legacy/one.alias.drushrc.php,legacy/pantheon.aliases.drushrc.php,legacy/server.aliases.drushrc.php', implode(',', $paths)); + } + + protected function assertLocation($expected, $path) + { + $this->assertEquals($expected, basename(dirname($path))); + } + + protected function assertBasename($expected, $path) + { + $this->assertEquals($expected, basename($path)); + } + + protected function simplifyToBasenamesWithLocation($result) + { + if (!is_array($result)) { + return $result; + } + + $result = array_map( + function ($item) { + return basename(dirname($item)) . '/' . basename($item); + } + , + $result + ); + + sort($result); + + return $result; + } +} diff --git a/vendor/consolidation/site-alias/tests/SiteAliasFileLoaderTest.php b/vendor/consolidation/site-alias/tests/SiteAliasFileLoaderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..779b0cdf88a3399c671c43d03011974756f0e672 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/SiteAliasFileLoaderTest.php @@ -0,0 +1,160 @@ +<?php +namespace Consolidation\SiteAlias; + +use PHPUnit\Framework\TestCase; +use Consolidation\SiteAlias\Util\YamlDataFileLoader; + +class SiteAliasFileLoaderTest extends TestCase +{ + use FixtureFactory; + use FunctionUtils; + + function setUp() + { + $this->sut = new SiteAliasFileLoader(); + + $ymlLoader = new YamlDataFileLoader(); + $this->sut->addLoader('yml', $ymlLoader); + } + + public function testLoadWildAliasFile() + { + $siteAliasFixtures = $this->fixturesDir() . '/sitealiases/sites'; + $this->assertTrue(is_dir($siteAliasFixtures)); + $this->assertTrue(is_file($siteAliasFixtures . '/wild.site.yml')); + + $this->sut->addSearchLocation($siteAliasFixtures); + + // Try to get the dev environment. + $name = SiteAliasName::parse('@wild.dev'); + $result = $this->callProtected('loadSingleAliasFile', [$name]); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/path/to/wild', $result->get('root')); + $this->assertEquals('bar', $result->get('foo')); + + // Try to fetch an environment that does not exist. Since this is + // a wildcard alias, there should + $name = SiteAliasName::parse('@wild.other'); + $result = $this->callProtected('loadSingleAliasFile', [$name]); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/wild/path/to/wild', $result->get('root')); + $this->assertEquals('bar', $result->get('foo')); + + } + + public function testLoadSingleAliasFile() + { + $siteAliasFixtures = $this->fixturesDir() . '/sitealiases/sites'; + $this->assertTrue(is_dir($siteAliasFixtures)); + $this->assertTrue(is_file($siteAliasFixtures . '/simple.site.yml')); + $this->assertTrue(is_file($siteAliasFixtures . '/single.site.yml')); + + $this->sut->addSearchLocation($siteAliasFixtures); + + // Add a secondary location + $siteAliasFixtures = $this->fixturesDir() . '/sitealiases/other'; + $this->assertTrue(is_dir($siteAliasFixtures)); + $this->sut->addSearchLocation($siteAliasFixtures); + + // Look for a simple alias with no environments defined + $name = new SiteAliasName('simple'); + $this->assertEquals('simple', $name->sitename()); + $result = $this->callProtected('loadSingleAliasFile', [$name]); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/path/to/simple', $result->get('root')); + + // Look for a single alias without an environment specified. + $name = new SiteAliasName('single'); + $this->assertEquals('single', $name->sitename()); + $result = $this->callProtected('loadSingleAliasFile', [$name]); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/path/to/single', $result->get('root')); + $this->assertEquals('bar', $result->get('foo')); + + // Same test, but with environment explicitly requested. + $name = SiteAliasName::parse('@single.alternate'); + $result = $this->callProtected('loadSingleAliasFile', [$name]); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/alternate/path/to/single', $result->get('root')); + $this->assertEquals('bar', $result->get('foo')); + + // Same test, but with location explicitly filtered. + $name = SiteAliasName::parse('@other.single.dev'); + $result = $this->callProtected('loadSingleAliasFile', [$name]); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/other/path/to/single', $result->get('root')); + $this->assertEquals('baz', $result->get('foo')); + + // Try to fetch an alias that does not exist. + $name = SiteAliasName::parse('@missing'); + $result = $this->callProtected('loadSingleAliasFile', [$name]); + $this->assertFalse($result); + + // Try to fetch an alias using a missing location + $name = SiteAliasName::parse('@missing.single.alternate'); + $result = $this->callProtected('loadSingleAliasFile', [$name]); + $this->assertFalse($result); + } + + public function testLoad() + { + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/sites'); + + // Look for a simple alias with no environments defined + $name = new SiteAliasName('simple'); + $result = $this->sut->load($name); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/path/to/simple', $result->get('root')); + + // Look for a single alias without an environment specified. + $name = new SiteAliasName('single'); + $result = $this->sut->load($name); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/path/to/single', $result->get('root')); + $this->assertEquals('bar', $result->get('foo')); + + // Same test, but with environment explicitly requested. + $name = new SiteAliasName('single', 'alternate'); + $result = $this->sut->load($name); + $this->assertTrue($result instanceof SiteAlias); + $this->assertEquals('/alternate/path/to/single', $result->get('root')); + $this->assertEquals('bar', $result->get('foo')); + + // Try to fetch an alias that does not exist. + $name = new SiteAliasName('missing'); + $result = $this->sut->load($name); + $this->assertFalse($result); + + // Try to fetch an alias that does not exist. + $name = new SiteAliasName('missing'); + $result = $this->sut->load($name); + $this->assertFalse($result); + } + + public function testLoadAll() + { + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/sites'); + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/other'); + + $all = $this->sut->loadAll(); + $this->assertEquals('@other.bob.dev,@other.bob.other,@other.fred.dev,@other.fred.other,@other.single.dev,@other.single.other,@single.alternate,@single.dev,@single.empty,@wild.*,@wild.dev', implode(',', array_keys($all))); + } + + public function testLoadMultiple() + { + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/sites'); + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/other'); + + $aliases = $this->sut->loadMultiple('single'); + $this->assertEquals('@single.dev,@single.alternate,@single.empty,@other.single.dev,@other.single.other', implode(',', array_keys($aliases))); + } + + public function testLoadLocation() + { + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/sites'); + $this->sut->addSearchLocation($this->fixturesDir() . '/sitealiases/other'); + + $aliases = $this->sut->loadLocation('other'); + $this->assertEquals('@other.bob.dev,@other.bob.other,@other.fred.dev,@other.fred.other,@other.single.dev,@other.single.other', implode(',', array_keys($aliases))); + } +} diff --git a/vendor/consolidation/site-alias/tests/SiteAliasManagerTest.php b/vendor/consolidation/site-alias/tests/SiteAliasManagerTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ad7f54807a4460fe4ed583bb4417c29f3173a8cd --- /dev/null +++ b/vendor/consolidation/site-alias/tests/SiteAliasManagerTest.php @@ -0,0 +1,230 @@ +<?php +namespace Consolidation\SiteAlias; + +use Consolidation\SiteAlias\Util\YamlDataFileLoader; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Yaml\Yaml; + +class SiteAliasManagerTest extends TestCase +{ + use FixtureFactory; + + protected $manager; + + /** + * Set up for tests + */ + public function setUp() + { + $root = $this->siteDir(); + $referenceData = []; + $siteAliasFixtures = $this->fixturesDir() . '/sitealiases/sites'; + + $aliasLoader = new SiteAliasFileLoader(); + $ymlLoader = new YamlDataFileLoader(); + $aliasLoader->addLoader('yml', $ymlLoader); + + $this->manager = new SiteAliasManager($aliasLoader, $root); + $this->manager + ->setReferenceData($referenceData) + ->addSearchLocation($siteAliasFixtures); + } + + public function managerGetTestValues() + { + return [ + [ + '@single.other', false, + ], + + [ + '@other.single.other', false, + ], + + [ + '@single.dev', 'foo: bar +root: /path/to/single', + ], + + ]; + } + + public function managerGetWithOtherLocationTestValues() + { + return [ + [ + '@single.other', false, + ], + + [ + '@other.single.other', 'foo: baz +root: /other/other/path/to/single', + ], + + [ + '@single.dev', 'foo: bar +root: /path/to/single', + ], + + ]; + } + + public function managerGetWithDupLocationsTestValues() + { + return [ + [ + '@single.dev', 'foo: bar +root: /path/to/single', + ], + + [ + '@other.single.dev', 'foo: baz +root: /other/path/to/single', + ], + + [ + '@dup.single.dev', 'foo: dup +root: /dup/path/to/single', + ], + + ]; + } + + /** + * This test is just to ensure that our fixture data is being loaded + * accurately so that we can start writing tests. Its okay to remove + * rather than maintain this test once the suite is mature. + */ + public function testGetMultiple() + { + // First set of tests: get all aliases in the default location + + $all = $this->manager->getMultiple(); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@single.alternate,@single.dev,@single.empty,@wild.*,@wild.dev', implode(',', $allNames)); + + $all = $this->manager->getMultiple('@single'); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@single.alternate,@single.dev,@single.empty', implode(',', $allNames)); + + // Next set of tests: Get all aliases in the 'other' location + + $this->addAlternateLocation('other'); + + $all = $this->manager->getMultiple(); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@other.bob.dev,@other.bob.other,@other.fred.dev,@other.fred.other,@other.single.dev,@other.single.other,@single.alternate,@single.dev,@single.empty,@wild.*,@wild.dev', implode(',', $allNames)); + + $all = $this->manager->getMultiple('@other'); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@other.bob.dev,@other.bob.other,@other.fred.dev,@other.fred.other,@other.single.dev,@other.single.other', implode(',', $allNames)); + + // Add the 'dup' location and do some more tests + + $this->addAlternateLocation('dup'); + + $all = $this->manager->getMultiple(); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@dup.bob.dev,@dup.bob.other,@dup.fred.dev,@dup.fred.other,@dup.single.alternate,@dup.single.dev,@other.bob.dev,@other.bob.other,@other.fred.dev,@other.fred.other,@other.single.dev,@other.single.other,@single.alternate,@single.dev,@single.empty,@wild.*,@wild.dev', implode(',', $allNames)); + + $all = $this->manager->getMultiple('@dup'); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@dup.bob.dev,@dup.bob.other,@dup.fred.dev,@dup.fred.other,@dup.single.alternate,@dup.single.dev', implode(',', $allNames)); + + $all = $this->manager->getMultiple('@other'); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@other.bob.dev,@other.bob.other,@other.fred.dev,@other.fred.other,@other.single.dev,@other.single.other', implode(',', $allNames)); + + $all = $this->manager->getMultiple('@dup.single'); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@dup.single.alternate,@dup.single.dev', implode(',', $allNames)); + + $all = $this->manager->getMultiple('@other.single'); + $allNames = array_keys($all); + sort($allNames); + + $this->assertEquals('@other.single.dev,@other.single.other', implode(',', $allNames)); + } + + /** + * @covers \Consolidation\SiteAlias\SiteAlias::root() + */ + public function testGetRoot() { + /* @var SiteAlias $alias */ + $alias = $this->manager->get('@single'); + $this->assertEquals($alias->root(), '/path/to/single'); + /* @var SiteAlias $alias */ + $alias = $this->manager->get('@single.common'); + // Ensure that when root is not specified in the alias, an Exception is + // thrown. + $this->expectExceptionMessage('Site alias @single.common does not specify a root.'); + $alias->root(); + } + + /** + * @dataProvider managerGetTestValues + */ + public function testGet( + $aliasName, + $expected) + { + $alias = $this->manager->get($aliasName); + $actual = $this->renderAlias($alias); + $this->assertEquals($expected, $actual); + } + + /** + * @dataProvider managerGetWithOtherLocationTestValues + */ + public function testGetWithOtherLocation( + $aliasName, + $expected) + { + $this->addAlternateLocation('other'); + $this->testGet($aliasName, $expected); + } + + /** + * @dataProvider managerGetWithDupLocationsTestValues + */ + public function testGetWithDupLocations( + $aliasName, + $expected) + { + $this->addAlternateLocation('dup'); + $this->testGetWithOtherLocation($aliasName, $expected); + } + + protected function addAlternateLocation($fixtureDirName) + { + // Add another search location IN ADDITION to the one + // already added in the setup() mehtod. + $siteAliasFixtures = $this->fixturesDir() . '/sitealiases/' . $fixtureDirName; + $this->manager->addSearchLocation($siteAliasFixtures); + } + + protected function renderAlias($alias) + { + if (!$alias) { + return false; + } + + return trim(Yaml::Dump($alias->export())); + } +} diff --git a/vendor/consolidation/site-alias/tests/SiteAliasNameTest.php b/vendor/consolidation/site-alias/tests/SiteAliasNameTest.php new file mode 100644 index 0000000000000000000000000000000000000000..3c3d3cb0335976cc9f9a79575590b04c22e173c4 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/SiteAliasNameTest.php @@ -0,0 +1,49 @@ +<?php +namespace Consolidation\SiteAlias; + +use PHPUnit\Framework\TestCase; + +class SiteAliasNameTest extends TestCase +{ + public function testSiteAliasName() + { + // Test an ambiguous sitename or env alias. + $name = SiteAliasName::parse('@simple'); + $this->assertFalse($name->hasLocation()); + $this->assertTrue(!$name->hasSitename()); + $this->assertTrue($name->hasEnv()); + $this->assertEquals('simple', $name->env()); + $this->assertEquals('@self.simple', (string)$name); + + // Test a non-ambiguous sitename.env alias. + $name = SiteAliasName::parse('@site.env'); + $this->assertFalse($name->hasLocation()); + $this->assertTrue($name->hasSitename()); + $this->assertTrue($name->hasEnv()); + $this->assertEquals('site', $name->sitename()); + $this->assertEquals('env', $name->env()); + $this->assertEquals('@site.env', (string)$name); + + // Test a non-ambiguous location.sitename.env alias. + $name = SiteAliasName::parse('@location.site.env'); + $this->assertTrue($name->hasLocation()); + $this->assertTrue($name->hasSitename()); + $this->assertTrue($name->hasEnv()); + $this->assertEquals('location', $name->location()); + $this->assertEquals('site', $name->sitename()); + $this->assertEquals('env', $name->env()); + $this->assertEquals('@location.site.env', (string)$name); + + // Test an invalid alias - bad character + $name = SiteAliasName::parse('!site.env'); + $this->assertFalse($name->hasLocation()); + $this->assertFalse($name->hasSitename()); + $this->assertFalse($name->hasEnv()); + + // Test an invalid alias - too many separators + $name = SiteAliasName::parse('@location.group.site.env'); + $this->assertFalse($name->hasLocation()); + $this->assertFalse($name->hasSitename()); + $this->assertFalse($name->hasEnv()); + } +} diff --git a/vendor/consolidation/site-alias/tests/SiteSpecParserTest.php b/vendor/consolidation/site-alias/tests/SiteSpecParserTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a158a2284be74c3926d86aabe42c2a8d84e41425 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/SiteSpecParserTest.php @@ -0,0 +1,177 @@ +<?php +namespace Consolidation\SiteAlias; + +use PHPUnit\Framework\TestCase; + +class SiteSpecParserTest extends TestCase +{ + use FixtureFactory; + + /** + * @dataProvider parserTestValues + */ + public function testSiteSpecParser( + $spec, + $expected) + { + $root = $this->siteDir(); + $fixtureSite = '/' . basename($root); + $parser = new SiteSpecParser(); + + // If the test spec begins with '/fixtures', substitute the + // actual path to our fixture site. + $spec = preg_replace('%^/fixtures%', $root, $spec); + + // Make sure that our spec is valid + $this->assertTrue($parser->validSiteSpec($spec)); + + // Parse it! + $result = $parser->parse($spec, $root); + + // If the result contains the path to our fixtures site, replace + // it with the simple string '/fixtures'. + if (isset($result['root'])) { + $result['root'] = preg_replace("%.*$fixtureSite%", '/fixtures', $result['root']); + } + + // Compare the altered result with the expected value. + $this->assertEquals($expected, $result); + } + + /** + * @dataProvider validSiteSpecs + */ + public function testValidSiteSpecs($spec) + { + $this->isSpecValid($spec, true); + } + + /** + * @dataProvider invalidSiteSpecs + */ + public function testInvalidSiteSpecs($spec) + { + $this->isSpecValid($spec, false); + } + + protected function isSpecValid($spec, $expected) + { + $parser = new SiteSpecParser(); + + $result = $parser->validSiteSpec($spec); + $this->assertEquals($expected, $result); + } + + public static function validSiteSpecs() + { + return [ + [ '/path/to/drupal#uri' ], + [ 'user@server/path/to/drupal#uri' ], + [ 'user.name@example.com/path/to/drupal#uri' ], + [ 'user@server/path/to/drupal' ], + [ 'user@example.com/path/to/drupal' ], + [ 'user@server#uri' ], + [ 'user@example.com#uri' ], + [ '#uri' ], + ]; + } + + public static function invalidSiteSpecs() + { + return [ + [ 'uri' ], + [ '@/#' ], + [ 'user@#uri' ], + [ '@server/path/to/drupal#uri' ], + [ 'user@server/path/to/drupal#' ], + [ 'user@server/path/to/drupal#uri!' ], + [ 'user@server/path/to/drupal##uri' ], + [ 'user#server/path/to/drupal#uri' ], + ]; + } + + public static function parserTestValues() + { + return [ + [ + 'user@server/path#somemultisite', + [ + 'user' => 'user', + 'host' => 'server', + 'root' => '/path', + 'uri' => 'somemultisite', + ], + ], + + [ + 'user.name@example.com/path#somemultisite', + [ + 'user' => 'user.name', + 'host' => 'example.com', + 'root' => '/path', + 'uri' => 'somemultisite', + ], + ], + + [ + 'user@server/path', + [ + 'user' => 'user', + 'host' => 'server', + 'root' => '/path', + 'uri' => 'default', + ], + ], + + [ + 'user.name@example.com/path', + [ + 'user' => 'user.name', + 'host' => 'example.com', + 'root' => '/path', + 'uri' => 'default', + ], + ], + + [ + '/fixtures#mymultisite', + [ + 'root' => '/fixtures', + 'uri' => 'mymultisite', + ], + ], + + [ + '#mymultisite', + [ + 'root' => '/fixtures', + 'uri' => 'mymultisite', + ], + ], + + [ + '/fixtures#somemultisite', + [ + ], + ], + + [ + '/path#somemultisite', + [ + ], + ], + + [ + '/path#mymultisite', + [ + ], + ], + + [ + '#somemultisite', + [ + ], + ], + ]; + } +} diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/bob.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/bob.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..d2aa6f36ece5044a3746aca2bdacd75f4bde250b --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/bob.site.yml @@ -0,0 +1,4 @@ +dev: + root: /other/path/to/bob +other: + root: /other/other/path/to/bob diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/fred.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/fred.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..377e2df404bc3532bd648037f69378983ecac322 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/fred.site.yml @@ -0,0 +1,4 @@ +dev: + root: /other/path/to/fred +other: + root: /other/other/path/to/fred diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/single.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/single.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..eb4634b7b6d4df0ab891b5c22720115ea52fe89c --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/dup/single.site.yml @@ -0,0 +1,8 @@ +default: dev +dev: + root: /dup/path/to/single +alternate: + root: /dup/alternate/path/to/single +common: + foo: dup + diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/aliases.drushrc.php b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/aliases.drushrc.php new file mode 100644 index 0000000000000000000000000000000000000000..09fad12d8c020aa6b4fab9ceacefb959827a0799 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/aliases.drushrc.php @@ -0,0 +1,11 @@ +<?php + +$aliases['production'] = [ + 'uri' => 'example.com', + 'root' => '/path/to/drupal', +]; + +$aliases['staging'] = [ + 'uri' => 'staging.example.com', + 'root' => '/path/to/drupal', +]; diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/cc.aliases.drushrc.php b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/cc.aliases.drushrc.php new file mode 100644 index 0000000000000000000000000000000000000000..c077dcced2c5ccfa4cefa443d62b946237901cd4 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/cc.aliases.drushrc.php @@ -0,0 +1,43 @@ +<?php + +$aliases['live'] = array ( + 'parent' => '@server.digital-ocean', + 'project-type' => 'live', + 'root' => '/srv/www/couturecostume.com/htdocs', + 'uri' => 'couturecostume.com', + 'path-aliases' => array( + '%dump-dir' => '/var/sql-dump/', + ), + 'target-command-specific' => array( + 'sql-sync' => array( + 'disable' => array('stage_file_proxy'), + 'permission' => array( + 'authenticated user' => array( + 'remove' => array('access environment indicator'), + ), + 'anonymous user' => array( + 'remove' => 'access environment indicator', + ), + ), + ), + ), +); + +$aliases['update'] = array ( + 'parent' => '@server.nitrogen', + 'root' => '/srv/www/update.couturecostume.com/htdocs', + 'uri' => 'update.couturecostume.com', + 'target-command-specific' => array( + 'sql-sync' => array( + 'enable' => array('environment_indicator', 'stage_file_proxy'), + 'permission' => array( + 'authenticated user' => array( + 'add' => array('access environment indicator'), + ), + 'anonymous user' => array( + 'add' => 'access environment indicator', + ), + ), + ), + ), +); diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/do-not-find-me.php b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/do-not-find-me.php new file mode 100644 index 0000000000000000000000000000000000000000..0cb51f9c040c2d4c1fe7e92c6debaa405f360cd9 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/do-not-find-me.php @@ -0,0 +1,3 @@ +<?php + +// The search scripts shouldn't find me as I do not match the patterns. diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/one.alias.drushrc.php b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/one.alias.drushrc.php new file mode 100644 index 0000000000000000000000000000000000000000..da408de3168fffc6a71c80491f7159390e85fa32 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/one.alias.drushrc.php @@ -0,0 +1,4 @@ +<?php + +$options['uri'] = 'http://example.com'; +$options['root'] = '/path/to/drupal'; diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/pantheon.aliases.drushrc.php b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/pantheon.aliases.drushrc.php new file mode 100644 index 0000000000000000000000000000000000000000..38cc9f1c3c33cce759b3821498222c4335c1335c --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/pantheon.aliases.drushrc.php @@ -0,0 +1,50 @@ +<?php + /** + * Pantheon drush alias file, to be placed in your ~/.drush directory or the aliases + * directory of your local Drush home. Once it's in place, clear drush cache: + * + * drush cc drush + * + * To see all your available aliases: + * + * drush sa + * + * See http://helpdesk.getpantheon.com/customer/portal/articles/411388 for details. + */ + + $aliases['outlandish-josh.test'] = array( + 'uri' => 'test-outlandish-josh.pantheonsite.io', + 'db-url' => 'mysql://pantheon:pw@dbserver.test.site-id.drush.in:11621/pantheon', + 'db-allows-remote' => TRUE, + 'remote-host' => 'appserver.test.site-id.drush.in', + 'remote-user' => 'test.site-id', + 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'path-aliases' => array( + '%files' => 'code/sites/default/files', + '%drush-script' => 'drush', + ), + ); + $aliases['outlandish-josh.live'] = array( + 'uri' => 'www.outlandishjosh.com', + 'db-url' => 'mysql://pantheon:pw@dbserver.live.site-id.drush.in:10516/pantheon', + 'db-allows-remote' => TRUE, + 'remote-host' => 'appserver.live.site-id.drush.in', + 'remote-user' => 'live.site-id', + 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'path-aliases' => array( + '%files' => 'code/sites/default/files', + '%drush-script' => 'drush', + ), + ); + $aliases['outlandish-josh.dev'] = array( + 'uri' => 'dev-outlandish-josh.pantheonsite.io', + 'db-url' => 'mysql://pantheon:pw@dbserver.dev.site-id.drush.in:21086/pantheon', + 'db-allows-remote' => TRUE, + 'remote-host' => 'appserver.dev.site-id.drush.in', + 'remote-user' => 'dev.site-id', + 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'path-aliases' => array( + '%files' => 'code/sites/default/files', + '%drush-script' => 'drush', + ), + ); diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/server.aliases.drushrc.php b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/server.aliases.drushrc.php new file mode 100644 index 0000000000000000000000000000000000000000..5d1c7ca07d2173b7fcc9c33b78ccf515911cf127 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/legacy/server.aliases.drushrc.php @@ -0,0 +1,11 @@ +<?php + +$aliases['isp'] = array ( + 'remote-host' => 'hydrogen.server.org', + 'remote-user' => 'www-admin', +); + +$aliases['nitrogen'] = array ( + 'remote-host' => 'nitrogen.server.org', + 'remote-user' => 'admin', +); diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/bob.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/bob.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..d2aa6f36ece5044a3746aca2bdacd75f4bde250b --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/bob.site.yml @@ -0,0 +1,4 @@ +dev: + root: /other/path/to/bob +other: + root: /other/other/path/to/bob diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/fred.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/fred.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..377e2df404bc3532bd648037f69378983ecac322 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/fred.site.yml @@ -0,0 +1,4 @@ +dev: + root: /other/path/to/fred +other: + root: /other/other/path/to/fred diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/simple.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/simple.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..cb838f76e06c6aac0773bdecef2fad5cd75cce9a --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/simple.site.yml @@ -0,0 +1 @@ +root: /other/path/to/simple diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/single.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/single.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..b85ded36f60068f829aada79b74dc4e5e495e2c7 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/other/single.site.yml @@ -0,0 +1,7 @@ +default: dev +dev: + root: /other/path/to/single +other: + root: /other/other/path/to/single +common: + foo: baz diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/simple.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/simple.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..34b77c6ccc6c5a851a2f7a492fe2583e9f59c21b --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/simple.site.yml @@ -0,0 +1 @@ +root: /path/to/simple diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/single.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/single.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..5d700f5f8f0640c8e145ae41efc4fb5b7b37d14a --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/single.site.yml @@ -0,0 +1,9 @@ +default: dev +dev: + root: /path/to/single +alternate: + root: /alternate/path/to/single +empty: + foo: bar +common: + foo: bar diff --git a/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/wild.site.yml b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/wild.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..eeafebcd944dabf2ab766f1c8f8e00d0c5ad6ef6 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sitealiases/sites/wild.site.yml @@ -0,0 +1,9 @@ +default: dev +dev: + root: /path/to/wild + uri: https://dev.example.com +'*': + root: /wild/path/to/wild + uri: https://${env-name}.example.com +common: + foo: bar diff --git a/vendor/consolidation/site-alias/tests/fixtures/sites/d8/sites/mymultisite/settings.php b/vendor/consolidation/site-alias/tests/fixtures/sites/d8/sites/mymultisite/settings.php new file mode 100644 index 0000000000000000000000000000000000000000..b3d9bbc7f3711e882119cd6b3af051245d859d04 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/fixtures/sites/d8/sites/mymultisite/settings.php @@ -0,0 +1 @@ +<?php diff --git a/vendor/consolidation/site-alias/tests/src/FixtureFactory.php b/vendor/consolidation/site-alias/tests/src/FixtureFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..9421bac8061884d1e33ff7bdd2d9d97a557bb3f3 --- /dev/null +++ b/vendor/consolidation/site-alias/tests/src/FixtureFactory.php @@ -0,0 +1,24 @@ +<?php +namespace Consolidation\SiteAlias; + +use \Drush\Config\Environment; + +trait FixtureFactory +{ + protected function fixturesDir() + { + return dirname(__DIR__) . '/fixtures'; + } + + protected function homeDir() + { + return $this->fixturesDir() . '/home'; + } + + // It is still an aspirational goal to add Drupal 7 support back to Drush. :P + // For now, only Drupal 8 is supported. + protected function siteDir($majorVersion = '8') + { + return $this->fixturesDir() . '/sites/d' . $majorVersion; + } +} diff --git a/vendor/consolidation/site-alias/tests/src/FunctionUtils.php b/vendor/consolidation/site-alias/tests/src/FunctionUtils.php new file mode 100644 index 0000000000000000000000000000000000000000..bcc3521b7b94c78fd340687529b1566b137da8ad --- /dev/null +++ b/vendor/consolidation/site-alias/tests/src/FunctionUtils.php @@ -0,0 +1,14 @@ +<?php +namespace Consolidation\SiteAlias; + +trait FunctionUtils +{ + protected $sut; + + protected function callProtected($methodName, $args = []) + { + $r = new \ReflectionMethod($this->sut, $methodName); + $r->setAccessible(true); + return $r->invokeArgs($this->sut, $args); + } +} diff --git a/vendor/consolidation/site-process/.editorconfig b/vendor/consolidation/site-process/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..0c29908ffd5949e44dd7118463f38123a0017b67 --- /dev/null +++ b/vendor/consolidation/site-process/.editorconfig @@ -0,0 +1,17 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[**.php] +indent_style = space +indent_size = 4 + +[{composer.json,composer.lock}] +indent_size = 4 diff --git a/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/bug_report_or_support_request.md b/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/bug_report_or_support_request.md new file mode 100644 index 0000000000000000000000000000000000000000..e5ed016a43c3e437e216ac29ed9c3927375f46b6 --- /dev/null +++ b/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/bug_report_or_support_request.md @@ -0,0 +1,31 @@ +--- +name: Bug report or support request +about: Report a bug or ask a question about expected behavior. + +--- + +**Describe the bug or behavior** +A clear and concise description of the behavior you are seeing. + +**To Reproduce** +What did you do? + +**Expected behavior** +What did you expect would happen? + +**Actual behavior** +What happened instead? + +**Workaround** +Is there another way to do the desired action? + +### System Configuration +| Q | A +| --------------- | --- +| Drush version? | 9.x/8.x (please be specific, and try latest dev build) +| Drupal version? | 7.x/8.x +| PHP version | 5.6/7.1 +| OS? | Mac/Linux/Windows + +**Additional information** +Add any other context about the problem here. diff --git a/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/documentation_request.md b/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/documentation_request.md new file mode 100644 index 0000000000000000000000000000000000000000..4a5da8b3a2f6dcfca55466a10016aa9506f14be6 --- /dev/null +++ b/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/documentation_request.md @@ -0,0 +1,19 @@ +--- +name: Documentation request +about: If you know what the documentation change should be, please consider submitting + a pull request instead. If you do know where the documentation you need is, please + submit a support request first. + +--- + +**Existing document** +Please provide a link to the existing document that is unclear or incomplete. + +**What are you attempting to do** +Please explain the task you are attempting to accomplish. + +**In what way is the existing documentation unclear or incomplete** +Please explain any confusion or ambiguities in the existing documentation. + +**What should the documentation say instead?** +To the best of your ability, explain what additional information would allow you to complete your task. If you already know what the documentation should say, please consider submitting a documentation pull request instead. diff --git a/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/feature_request.md b/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000000000000000000000000000000000..066b2d920a28db73b4ba3a0b35e6905eeeef5772 --- /dev/null +++ b/vendor/consolidation/site-process/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/vendor/consolidation/site-process/.github/pull_request_template.md b/vendor/consolidation/site-process/.github/pull_request_template.md new file mode 100644 index 0000000000000000000000000000000000000000..42ec292461f2be8f2c6b52f54af5104541c823f9 --- /dev/null +++ b/vendor/consolidation/site-process/.github/pull_request_template.md @@ -0,0 +1,16 @@ +### Overview +This pull request: + +| Q | A +| ------------- | --- +| Bug fix? | yes/no +| New feature? | yes/no <!-- don't forget to update CHANGELOG.md files --> +| Has tests? | yes/no +| BC breaks? | no +| Deprecations? | yes/no + +### Summary +Short overview of what changed. + +### Description +Any additional information. diff --git a/vendor/consolidation/site-process/.gitignore b/vendor/consolidation/site-process/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..9b0c5771cb98667c5e08d5e1084b3332688dd6ff --- /dev/null +++ b/vendor/consolidation/site-process/.gitignore @@ -0,0 +1,5 @@ +.idea/ +*.phar +build +tools +vendor/ diff --git a/vendor/consolidation/site-process/.scenarios.lock/install b/vendor/consolidation/site-process/.scenarios.lock/install new file mode 100755 index 0000000000000000000000000000000000000000..16c69e107cce7f71e33e04207254d005200f9fd4 --- /dev/null +++ b/vendor/consolidation/site-process/.scenarios.lock/install @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff --git a/vendor/consolidation/site-process/.scenarios.lock/phpunit5/.gitignore b/vendor/consolidation/site-process/.scenarios.lock/phpunit5/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/consolidation/site-process/.scenarios.lock/phpunit5/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/consolidation/site-process/.scenarios.lock/phpunit5/composer.json b/vendor/consolidation/site-process/.scenarios.lock/phpunit5/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..7f3fda29aefcc90bb1d67a7d68957e0932c9eb25 --- /dev/null +++ b/vendor/consolidation/site-process/.scenarios.lock/phpunit5/composer.json @@ -0,0 +1,76 @@ +{ + "name": "consolidation/site-process", + "description": "A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\SiteProcess\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\SiteProcess\\": "../../tests/src" + } + }, + "require": { + "php": ">=5.6.0", + "consolidation/config": "^1.2.1", + "consolidation/site-alias": "^3", + "symfony/process": "^3.4" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27", + "consolidation/Robo": "^1.3", + "knplabs/github-api": "^2.7", + "php-http/guzzle6-adapter": "^1.1", + "g1a/composer-test-scenarios": "^3", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "phar:install-tools": [ + "gem install mime-types -v 2.6.2", + "curl -LSs https://box-project.github.io/box2/installer.php | php", + "mkdir -p tools", + "mv -f box.phar tools/box" + ], + "phar:build": "env PATH=tools:$PATH box build", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "release": [ + "release VERSION" + ] + }, + "config": { + "platform": { + "php": "5.6.33" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "extra": { + "branch-alias": { + "dev-master": "0.x-dev" + } + } +} diff --git a/vendor/consolidation/site-process/.scenarios.lock/phpunit5/composer.lock b/vendor/consolidation/site-process/.scenarios.lock/phpunit5/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..8c3ce9bc8576db1878bd549f6683092c3181d36e --- /dev/null +++ b/vendor/consolidation/site-process/.scenarios.lock/phpunit5/composer.lock @@ -0,0 +1,3837 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "2036f93db131bcf583e5b1bde9e404fe", + "packages": [ + { + "name": "consolidation/config", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2019-03-03T19:37:04+00:00" + }, + { + "name": "consolidation/site-alias", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-alias.git", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-alias/zipball/8cfd3b6ab6d541086fc970bf850864293b284e6f", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4", + "symfony/yaml": "~2.3|^3" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\SiteAlias\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Manage alias records for local and remote sites.", + "time": "2019-03-12T17:31:48+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:27:11+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/stream-filter", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/php-stream-filter.git", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "time": "2017-08-18T09:54:01+00:00" + }, + { + "name": "consolidation/annotated-command", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/512a2e54c98f3af377589de76c43b24652bcb789", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.5", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2019-03-08T16:55:03+00:00" + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.4.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "0881112642ad9059071f13f397f571035b527cb9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/0881112642ad9059071f13f397f571035b527cb9", + "reference": "0881112642ad9059071f13f397f571035b527cb9", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5.7.27", + "squizlabs/php_codesniffer": "^2.7", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony3": { + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "config": { + "platform": { + "php": "5.6.32" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2019-03-14T03:45:44+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.4.9", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.10.2", + "consolidation/config": "^1.2", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.4", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2019-03-19T18:07:19+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "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-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/28f932580981e912ab8f01d15788f1dee06550c8", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2019-02-11T20:22:44+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-04T20:46:45+00:00" + }, + { + "name": "knplabs/github-api", + "version": "2.11.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "7e67b4ccf9ef62fbd6321a314c61d3202c07b855" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/7e67b4ccf9ef62fbd6321a314c61d3202c07b855", + "reference": "7e67b4ccf9ef62fbd6321a314c61d3202c07b855", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "php-http/cache-plugin": "^1.4", + "php-http/client-common": "^1.6", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.0", + "php-http/httplug": "^1.1", + "psr/cache": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "cache/array-adapter": "^0.4", + "guzzlehttp/psr7": "^1.2", + "php-http/guzzle6-adapter": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^5.5 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.11.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": "2019-01-28T19:31:35+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "php-http/cache-plugin", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "8e2505d2090316fac7cce637b39b6bbb5249c5a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/8e2505d2090316fac7cce637b39b6bbb5249c5a8", + "reference": "8e2505d2090316fac7cce637b39b6bbb5249c5a8", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/client-common": "^1.9 || ^2.0", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "time": "2019-01-23T16:51:58+00:00" + }, + { + "name": "php-http/client-common", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/httplug": "^1.1", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.4", + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" + }, + "suggest": { + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "time": "2019-02-02T07:03:15+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^2.4", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", + "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "time": "2019-02-23T07:42:53+00:00" + }, + { + "name": "php-http/guzzle6-adapter", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle6-adapter.git", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "php-http/httplug": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "php-http/adapter-integration-tests": "^0.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle6\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Guzzle 6 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "time": "2016-05-10T06:13:32+00:00" + }, + { + "name": "php-http/httplug", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "php-http/promise": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "time": "2016-08-31T08:30:17+00:00" + }, + { + "name": "php-http/message", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/b159ffe570dffd335e22ef0b91a946eacb182fa1", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^1.0", + "coduo/phpspec-data-provider-extension": "^1.0", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4", + "slim/slim": "^3.0", + "zendframework/zend-diactoros": "^1.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation", + "zendframework/zend-diactoros": "Used with Diactoros Factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "time": "2018-11-01T09:32:41+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "shasum": "" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "time": "2016-01-26T13:27:02+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-10T14:09:06+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "98ae3cdc4bec48fe7ee24afc81dbb4a242186c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/98ae3cdc4bec48fe7ee24afc81dbb4a242186c9e", + "reference": "98ae3cdc4bec48fe7ee24afc81dbb4a242186c9e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.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" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2019-03-31T11:33:18+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "adbdd5d66342fb0a0bce7422ba68181842b6610d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/adbdd5d66342fb0a0bce7422ba68181842b6610d", + "reference": "adbdd5d66342fb0a0bce7422ba68181842b6610d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2019-03-10T17:07:42+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a088aafcefb4eef2520a290ed82e4374092a6dff", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-04-02T08:51:52+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-02-04T21:34:32+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "fcdde4aa38f48190ce70d782c166f23930084f9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/fcdde4aa38f48190ce70d782c166f23930084f9b", + "reference": "fcdde4aa38f48190ce70d782c166f23930084f9b", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-02-22T14:44:53+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v3.4.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "926e3b797e6bb66c0e4d7da7eff3a174f7378bcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/926e3b797e6bb66c0e4d7da7eff3a174f7378bcf", + "reference": "926e3b797e6bb66c0e4d7da7eff3a174f7378bcf", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "82ebae02209c21113908c229e9883c419720738a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "backendtea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-02-06T07:57:58+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2019-02-06T07:57:58+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-03-25T07:48:46+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.6.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.6.33" + } +} diff --git a/vendor/consolidation/site-process/.scrutinizer.yml b/vendor/consolidation/site-process/.scrutinizer.yml new file mode 100644 index 0000000000000000000000000000000000000000..8528e06fba99b912e12a39d5f3f9cf8112397e58 --- /dev/null +++ b/vendor/consolidation/site-process/.scrutinizer.yml @@ -0,0 +1,11 @@ +checks: + php: true +filter: + excluded_paths: + - customize/* + - tests/* +tools: + php_sim: true + php_pdepend: true + php_analyzer: true + php_cs_fixer: false diff --git a/vendor/consolidation/site-process/.travis.yml b/vendor/consolidation/site-process/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..30b8098b990cdf26fc950fbdf3a55bfb4bf51c03 --- /dev/null +++ b/vendor/consolidation/site-process/.travis.yml @@ -0,0 +1,41 @@ +dist: trusty +language: php +branches: + only: + - master + - "/^[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+.*$/" +matrix: + fast_finish: true + include: + - php: 7.2 + env: DEPENCENCIES=highest + - php: 7.2 + - php: 7.1 + - php: 7.0.11 + env: SCENARIO=phpunit5 + - php: 5.6 + env: SCENARIO=phpunit5 + - php: 5.6 + env: SCENARIO=phpunit5 DEPENDENCIES=lowest +sudo: false +cache: + directories: + - "$HOME/.composer/cache" +install: +- .scenarios.lock/install "${SCENARIO}" "${DEPENDENCIES}" +script: +- composer test +after_success: +- travis_retry php vendor/bin/php-coveralls -v +before_deploy: +- composer phar:install-tools +- composer require --no-scripts consolidation/Robo +- composer install --prefer-dist --no-dev --no-interaction +- composer phar:build +deploy: + provider: releases + api_key: + secure: nF8o89VYeIkgHm5Iw7qPAIihVAZHz8zZwcKY1FzRAEuQWwQncMfgRpmW2VffFsDPAE+iaIeTcE5Xl5oIZGstdJ1Toybsm6U1Zwg5nP30t7IeJt4KBcY65LnZLUixnf+W8nfmQ1LLoHriZqSIEqUsb8nBuADkeROWRO1VOdntPmTFSdTeju/cOikW/xighxSLS57Ie4btKKcVmUOSnORPZj3PD0E1epYl6Sl4ghWmk0MdzUFNjlqAKrikkJG3DpLAvHPVzLC7T3IleEN7ueZC+N4iSwRxnBqc/+si07Kir6uJ3Y2uyCUcy5JLmoZHKRJ6OZjOxxW79kQ4xgiulsag2LEW3IntjK3N3h11U8Dcr6gQZ5PsOfND/FeSQlZb5mvqFKWEldwWLdHsMVyOxVmcnmZUK4/ZieHkX4fD5bB8YKHbQdvHPLlhyclps6aF+QVwDuy7ghlozpgEJ9s192ndQAeaJERm6+p6Owre41D6DG4Svq4z3ASlUJNFjWRQrrHjhYDbUg3G23H3UmigZpW3V0+VXzcnRo8tZCcQQulieBhxNLVL369VhWeq5GXiknL8SolT/5hgBPQzCFi/H++ITCBvygRbCZKepsA9YCM4RlW1Uq0wdqTMFgHnBvTpeKyngacY4hCRPFOEli8SEndR5ldPwHcWaGXth0MU35lwUqA= + file: remo.phar + on: + repo: consolidation/site-process diff --git a/vendor/consolidation/site-process/CHANGELOG.md b/vendor/consolidation/site-process/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..7ca3bc0169dcab8e27c7d2992cc9cecdf7ed419d --- /dev/null +++ b/vendor/consolidation/site-process/CHANGELOG.md @@ -0,0 +1,32 @@ +# Changelog + +### 2.0.3 - 2019/Jun/4 + +* Bugfix: Use posix_isatty when available. (#43) + +### 2.0.2 - 2019/Apr/5 + +* When the transport is Docker, allow setting any docker-compose flags in the alias file Alexandru Szasz (#39) +* Added vagrant transport. Alexandru Szasz (#40) +* Added Util class to help detect TTY properly. Dane Powell (#41) + +### 2.0.1 - 2019/Apr/2 + +* Do not format output in RealTimeOutput + +### 2.0.0 - 2019/Mar/12 + +* Add a separaate 'addTransports' method for clients that wish to subclass the process manager (#32) +* Rename AliasRecord to SiteAlias; Use SiteAliasWithConfig::create (#31) +* Use SiteAliasWithConfig (#30) +* Use ConfigAwareInterface/Trait (#26) +* Allow configuration to be injected into ProcessManager. (#22) +* setWorkingDirectory() controls remote execution dir (#25) + +### 1.1.0 - 1.1.2 - 2019/Feb/13 + +* ms-slasher13 improve escaping on Windows (#24) + +### 1.0.0 - 2019/Jan/17 + +* Initial release diff --git a/vendor/consolidation/site-process/CONTRIBUTING.md b/vendor/consolidation/site-process/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..68397318b24808297825b7de8b63d72c0c62ab80 --- /dev/null +++ b/vendor/consolidation/site-process/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# Contributing to SiteProcess + +Thank you for your interest in contributing to SiteProcess! Here are some of the guidelines you should follow to make the most of your efforts: + +## Code Style Guidelines + +This project adheres to the [PSR-2 Coding Style Guide](http://www.php-fig.org/psr/psr-2/) for PHP code. An `.editorconfig` file is included with the repository to help you get up and running quickly. Most modern editors support this standard, but if yours does not or you would like to configure your editor manually, follow the guidelines in the document linked above. + +You can run the PHP Codesniffer on your work using a convenient command provided as a composer script: +``` +composer cs +``` +The above will run the PHP Codesniffer on the project sources. To automatically clean up code style violations, run: +``` +composer cbf +``` +Please ensure all contributions are compliant _before_ submitting a pull request. + +## Code of Conduct + +### Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +### Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +### Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +### Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [INSERT EMAIL ADDRESS]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +### Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/consolidation/site-process/LICENSE b/vendor/consolidation/site-process/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..416ec578ddbe11cb8009d6605d7453024b90764c --- /dev/null +++ b/vendor/consolidation/site-process/LICENSE @@ -0,0 +1,29 @@ +The MIT License (MIT) + +Copyright (c) 2018-2019 Greg Anderson + +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. + +DEPENDENCY LICENSES: + +Name Version License +consolidation/config 1.2.1 MIT +consolidation/site-alias 3.0.0 MIT +dflydev/dot-access-data v1.1.0 MIT +grasmash/expander 1.0.0 MIT +symfony/process v3.4.24 MIT \ No newline at end of file diff --git a/vendor/consolidation/site-process/README.md b/vendor/consolidation/site-process/README.md new file mode 100644 index 0000000000000000000000000000000000000000..19d43168503a3e1b0caeefa0daa8e9ca9ed0762e --- /dev/null +++ b/vendor/consolidation/site-process/README.md @@ -0,0 +1,133 @@ +# Site Process + +A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call. + +[](https://travis-ci.org/consolidation/site-process) +[](https://ci.appveyor.com/project/greg-1-anderson/site-process) +[](https://scrutinizer-ci.com/g/consolidation/site-process/?branch=master) +[](https://coveralls.io/github/consolidation/site-process?branch=master) +[](LICENSE) + + +## Overview + +Site Process is a thin wrapper around the [Symfony Process Component](https://symfony.com/doc/3.4/components/process) that allows applications to use the [Site Alias library](https://github.com/consolidation/site-alias) to specify the target for a remote call. + +For comparison purposes, the `Process` obejct may be created to run an application on the local system using the standard Symfony Process Component API like so: +``` +$process = new Process(['ls', '-lsa']); +``` +Similarly, a remote call can be done using the general-purpose `SiteProcess` API, which is accessible via the ProcessManager object: +``` +$processManager = ProcessManager::createDefault(); +$process = $processManager->siteProcess($site_alias, ['ls', '-lsa', '{root}']); +``` +In this example, if `$site_alias` represents a site on the same system, then the `ls -lsa` command will run locally. If, on the other hand, it represents a remote site, then the `ls -lsa` command will be wrapped in an ssh call to the remote system. In either case, the `{root}` reference will be replaced with the value of the attribute of the site alias named `root`. An exception will be thrown if the named attribute does not exist. + +Options may also be specified as an associative array provided as a third parameter: +``` +$process = $processManager->siteProcess($site_alias, ['git', 'status'], ['untracked-files' => 'no']); +``` +This is equivalent to: +``` +$process = $processManager->siteProcess($site_alias, ['git', '--untracked-files=no', 'status']); +``` +### Transports +#### SSH +Wraps a command so that it runs on a remote system via the ssh cli. + +Example: +```yaml +local: + host: localhost + uri: http://localhost + ssh: + options: -o PasswordAuthentication=no -i $HOME/.ssh/id_rsa + +``` +### Vagrant +Wraps commands so they run with `vagrant ssh -c`. + +Example: +```yaml +local: + uri: http://localhost + vagrant: +``` + +#### Docker Compose +Wraps a command so that it runs on a remote system via docker-compose. + +Example: +```yaml +local: + host: localhost + uri: http://localhost + docker: + service: drupal + compose: + options: --project dockerComposeProjectName --file docker-compose.yml --project-directory dockerComposeWorkDir + exec: + options: --user www-data + +``` + +The above would execute commands prefixed with: +``` +docker-compose --project dockerComposeProjectName --file docker-compose.yml --project-directory dockerComposeWorkDir exec --user www-data -T drupal +``` + +`docker.project` and `compose.options --project` do the same thing, docker.project existed before options. + +`docker.service` is the exact name of the service as it appears in docker-compos.yml + +Check the [docker-compose](https://docs.docker.com/compose/reference/overview/) manual for all available options. + +#### Local +Runs the command on the local system. + +## Symfony 4 + +The Symfony Process component has different typehints in the parameters of several APIs in Symfony 4 than Symfony 3 does. This is due to the fact that Symfony 4 requires PHP 7.1.3 or later, which supports a number of typehints not permitted in earlier PHP versions. This difference is minor for most clients, but presents problems for code that subclasses Process, as it is not possible to be compatible with both the Symofny 3 and the Symfony 4 typehints at the same time. + +In the future, Symfony 4 will be supported in this library on a separate branch. + +## Running the tests + +The test suite may be run locally by way of some simple composer scripts: + +| Test | Command +| ---------------- | --- +| Run all tests | `composer test` +| PHPUnit tests | `composer unit` +| PHP linter | `composer lint` +| Code style | `composer cs` +| Fix style errors | `composer cbf` + + +## Deployment + +- Run `composer release` + +## Contributing + +Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for submitting pull requests to us. + +## Versioning + +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases](https://github.com/consolidation/site-process/releases) page. + +## Authors + +* [Greg Anderson](https://github.com/greg-1-anderson) +* [Moshe Weitzman](http://weitzman.github.com) + +See also the list of [contributors](https://github.com/consolidation/site-process/contributors) who participated in this project. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details + +## Acknowledgments + +* Thanks to PurpleBooth for the [example README template](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2) diff --git a/vendor/consolidation/site-process/VERSION b/vendor/consolidation/site-process/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..6acdb442890d24a5a111bf264099eec7962295c2 --- /dev/null +++ b/vendor/consolidation/site-process/VERSION @@ -0,0 +1 @@ +2.0.3 \ No newline at end of file diff --git a/vendor/consolidation/site-process/appveyor.yml b/vendor/consolidation/site-process/appveyor.yml new file mode 100644 index 0000000000000000000000000000000000000000..c19202f9be33f9f98313842d40e7dba70f5533dc --- /dev/null +++ b/vendor/consolidation/site-process/appveyor.yml @@ -0,0 +1,64 @@ +build: false +shallow_clone: false +platform: 'x86' +clone_folder: C:\projects\work +branches: + only: + - master + +## Cache composer bits +cache: + - '%LOCALAPPDATA%\Composer\files -> composer.lock' + +init: + #https://github.com/composer/composer/blob/master/appveyor.yml + #- SET ANSICON=121x90 (121x90) + +# Inspired by https://github.com/Codeception/base/blob/master/appveyor.yml and https://github.com/phpmd/phpmd/blob/master/appveyor.yml +install: + - cinst -y curl + - SET PATH=C:\Program Files\curl;%PATH% + #which is only needed by the test suite. + - cinst -y which + - SET PATH=C:\Program Files\which;%PATH% + - git clone -q https://github.com/acquia/DevDesktopCommon.git #For tar, cksum, ... + - SET PATH=%APPVEYOR_BUILD_FOLDER%/DevDesktopCommon/bintools-win/msys/bin;%PATH% + - SET PATH=C:\Program Files\MySql\MySQL Server 5.7\bin\;%PATH% + #Install PHP per https://blog.wyrihaximus.net/2016/11/running-php-unit-tests-on-windows-using-appveyor-and-chocolatey/ + - ps: Set-Service wuauserv -StartupType Manual + - ps: appveyor-retry cinst --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','') + - cd c:\tools\php71 + - copy php.ini-production php.ini + + - echo extension_dir=ext >> php.ini + - echo extension=php_openssl.dll >> php.ini + - echo date.timezone="UTC" >> php.ini + - echo variables_order="EGPCS" >> php.ini #May be unneeded. + - echo mbstring.http_input=pass >> php.ini + - echo mbstring.http_output=pass >> php.ini + - echo sendmail_path=nul >> php.ini + - echo extension=php_mbstring.dll >> php.ini + - echo extension=php_curl.dll >> php.ini + - echo extension=php_pdo_mysql.dll >> php.ini + - echo extension=php_pdo_pgsql.dll >> php.ini + - echo extension=php_pdo_sqlite.dll >> php.ini + - echo extension=php_pgsql.dll >> php.ini + - echo extension=php_gd2.dll >> php.ini + - SET PATH=C:\tools\php71;%PATH% + #Install Composer + - cd %APPVEYOR_BUILD_FOLDER% + #- appveyor DownloadFile https://getcomposer.org/composer.phar + - php -r "readfile('http://getcomposer.org/installer');" | php + #Install dependencies via Composer + - php composer.phar -q install --prefer-dist -n + - SET PATH=%APPVEYOR_BUILD_FOLDER%;%APPVEYOR_BUILD_FOLDER%/vendor/bin;%PATH% + #Create a sandbox for testing. Don't think we need this. + - mkdir c:\test_temp + +test_script: + - php composer.phar unit + +# environment variables +environment: + global: + php_ver_target: 7.1 diff --git a/vendor/consolidation/site-process/box.json.dist b/vendor/consolidation/site-process/box.json.dist new file mode 100644 index 0000000000000000000000000000000000000000..875daf8903ec9397243d2b26f77478a11cf3a54c --- /dev/null +++ b/vendor/consolidation/site-process/box.json.dist @@ -0,0 +1,25 @@ +{ + "alias": "remo.phar", + "chmod": "0755", + "compactors": [], + "directories": ["src"], + "files": ["remo", "README.md", "VERSION"], + "finder": [ + { + "name": "*.php", + "exclude": [ + "test", + "tests", + "Test", + "Tests", + "Tester" + ], + "in": "vendor" + } + ], + "git-commit": "git-commit", + "git-version": "git-version", + "output": "remo.phar", + "main": "remo", + "stub": true +} diff --git a/vendor/consolidation/site-process/composer.json b/vendor/consolidation/site-process/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..5fba356d98e94a47e7bd49e5b1aa79c48e79afda --- /dev/null +++ b/vendor/consolidation/site-process/composer.json @@ -0,0 +1,91 @@ +{ + "name": "consolidation/site-process", + "description": "A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\SiteProcess\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\SiteProcess\\": "tests/src" + } + }, + "require": { + "php": ">=5.6.0", + "consolidation/config": "^1.2.1", + "consolidation/site-alias": "^3", + "symfony/process": "^3.4" + }, + "require-dev": { + "consolidation/Robo": "^1.3", + "knplabs/github-api": "^2.7", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "squizlabs/php_codesniffer": "^2.8" + }, + "scripts": { + "phar:install-tools": [ + "gem install mime-types -v 2.6.2", + "curl -LSs https://box-project.github.io/box2/installer.php | php", + "mkdir -p tools", + "mv -f box.phar tools/box" + ], + "phar:build": "env PATH=tools:$PATH box build", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "release": [ + "release VERSION" + ] + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "7.1.3" + } + }, + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "0.x-dev" + } + } +} diff --git a/vendor/consolidation/site-process/composer.lock b/vendor/consolidation/site-process/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..a4d3ae2c3146c0deaae891483d3005be115e1959 --- /dev/null +++ b/vendor/consolidation/site-process/composer.lock @@ -0,0 +1,4271 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "dd093819534b9ff12ec73e8e732e34f6", + "packages": [ + { + "name": "consolidation/config", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2019-03-03T19:37:04+00:00" + }, + { + "name": "consolidation/site-alias", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-alias.git", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-alias/zipball/8cfd3b6ab6d541086fc970bf850864293b284e6f", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4", + "symfony/yaml": "~2.3|^3" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\SiteAlias\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Manage alias records for local and remote sites.", + "time": "2019-03-12T17:31:48+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T13:27:11+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/stream-filter", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/php-stream-filter.git", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "time": "2017-08-18T09:54:01+00:00" + }, + { + "name": "consolidation/annotated-command", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/512a2e54c98f3af377589de76c43b24652bcb789", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.5", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2019-03-08T16:55:03+00:00" + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^5.7.27", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "3.2.3", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2018-10-19T22:35:38+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.4.9", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.10.2", + "consolidation/config": "^1.2", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.4", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2019-03-19T18:07:19+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.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": "2017-07-22T11:58:36+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/28f932580981e912ab8f01d15788f1dee06550c8", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2019-02-11T20:22:44+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "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": "*", + "monolog/monolog": "1.*", + "phpunit/phpunit": "3.7.*", + "psr/log": "1.0.*", + "symfony/class-loader": "*", + "zendframework/zend-cache": "<2.3", + "zendframework/zend-log": "<2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.8-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": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2014-01-28T22:29:15+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-04T20:46:45+00:00" + }, + { + "name": "knplabs/github-api", + "version": "2.11.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "7e67b4ccf9ef62fbd6321a314c61d3202c07b855" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/7e67b4ccf9ef62fbd6321a314c61d3202c07b855", + "reference": "7e67b4ccf9ef62fbd6321a314c61d3202c07b855", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "php-http/cache-plugin": "^1.4", + "php-http/client-common": "^1.6", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.0", + "php-http/httplug": "^1.1", + "psr/cache": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "cache/array-adapter": "^0.4", + "guzzlehttp/psr7": "^1.2", + "php-http/guzzle6-adapter": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^5.5 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.11.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": "2019-01-28T19:31:35+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "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" + ], + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "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": "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)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.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", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "php-http/cache-plugin", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "8e2505d2090316fac7cce637b39b6bbb5249c5a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/8e2505d2090316fac7cce637b39b6bbb5249c5a8", + "reference": "8e2505d2090316fac7cce637b39b6bbb5249c5a8", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/client-common": "^1.9 || ^2.0", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "time": "2019-01-23T16:51:58+00:00" + }, + { + "name": "php-http/client-common", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/httplug": "^1.1", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.4", + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" + }, + "suggest": { + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "time": "2019-02-02T07:03:15+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^2.4", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", + "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "time": "2019-02-23T07:42:53+00:00" + }, + { + "name": "php-http/guzzle6-adapter", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle6-adapter.git", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "php-http/httplug": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "php-http/adapter-integration-tests": "^0.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle6\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Guzzle 6 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "time": "2016-05-10T06:13:32+00:00" + }, + { + "name": "php-http/httplug", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "php-http/promise": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "time": "2016-08-31T08:30:17+00:00" + }, + { + "name": "php-http/message", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/b159ffe570dffd335e22ef0b91a946eacb182fa1", + "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^1.0", + "coduo/phpspec-data-provider-extension": "^1.0", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4", + "slim/slim": "^3.0", + "zendframework/zend-diactoros": "^1.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation", + "zendframework/zend-diactoros": "Used with Diactoros Factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "time": "2018-11-01T09:32:41+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "shasum": "" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "time": "2016-01-26T13:27:02+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.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": "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": "2018-04-06T15:36:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.14", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.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": "2019-02-01T05:22:47+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.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": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "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" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "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": "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": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "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": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "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/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "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/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "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": "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": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "7f70d79c7a24a94f8e98abb988049403a53d7b31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/7f70d79c7a24a94f8e98abb988049403a53d7b31", + "reference": "7f70d79c7a24a94f8e98abb988049403a53d7b31", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:17:42+00:00" + }, + { + "name": "symfony/console", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/9dc2299a016497f9ee620be94524e6c0af0280a9", + "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:17:42+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "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": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "3354d2e6af986dd71f68b4e5cf4a933ab58697fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3354d2e6af986dd71f68b4e5cf4a933ab58697fb", + "reference": "3354d2e6af986dd71f68b4e5cf4a933ab58697fb", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:17:42+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e16b9e471703b2c60b95f14d31c1239f68f11601", + "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-02-07T11:40:08+00:00" + }, + { + "name": "symfony/finder", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/267b7002c1b70ea80db0833c3afe05f0fbde580a", + "reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:42:05+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3896e5a7d06fd15fa4947694c8dcdd371ff147d1", + "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2019-02-23T15:17:42+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:31:39+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "761fa560a937fd7686e5274ff89dcfa87a5047df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/761fa560a937fd7686e5274ff89dcfa87a5047df", + "reference": "761fa560a937fd7686e5274ff89dcfa87a5047df", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:17:42+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.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", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.6.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.1.3" + } +} diff --git a/vendor/consolidation/site-process/dependencies.yml b/vendor/consolidation/site-process/dependencies.yml new file mode 100644 index 0000000000000000000000000000000000000000..c381f99f8458aa9d0f655118cf1b6359af43ee92 --- /dev/null +++ b/vendor/consolidation/site-process/dependencies.yml @@ -0,0 +1,8 @@ +version: 2 +dependencies: +- type: php + path: / + manifest_updates: + filters: + - name: ".*" + versions: "L.Y.Y" diff --git a/vendor/consolidation/site-process/phpunit.xml.dist b/vendor/consolidation/site-process/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..c51e9c6169b1b562139eb29b10f85e18175f5e04 --- /dev/null +++ b/vendor/consolidation/site-process/phpunit.xml.dist @@ -0,0 +1,19 @@ +<phpunit bootstrap="vendor/autoload.php" colors="true"> + <testsuites> + <testsuite name="site-process"> + <directory prefix="" suffix="Test.php">tests</directory> + </testsuite> + </testsuites> + <logging> + <!-- + <log type="coverage-html" target="build/logs/coverage" lowUpperBound="35" + highLowerBound="70"/> + --> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">src</directory> + </whitelist> + </filter> +</phpunit> diff --git a/vendor/consolidation/site-process/remo b/vendor/consolidation/site-process/remo new file mode 100755 index 0000000000000000000000000000000000000000..cd6671bdf1c8b1565ac6effa0c008068ea1a9f41 --- /dev/null +++ b/vendor/consolidation/site-process/remo @@ -0,0 +1,45 @@ +#!/usr/bin/env php +<?php + +/** + * 'Remo' commandline front controller + * + * Use site aliases to make remote calls. + */ + +// If we're running from phar load the phar autoload file. +$pharPath = \Phar::running(true); +if ($pharPath) { + $autoloaderPath = "$pharPath/vendor/autoload.php"; +} else { + if (file_exists(__DIR__.'/vendor/autoload.php')) { + $autoloaderPath = __DIR__.'/vendor/autoload.php'; + } elseif (file_exists(__DIR__.'/../../autoload.php')) { + $autoloaderPath = __DIR__ . '/../../autoload.php'; + } else { + die("Could not find autoloader. Run 'composer install'."); + } +} +$classLoader = require $autoloaderPath; + +// Customization variables +$argv = $_SERVER['argv']; +$appName = "Remo"; +$appVersion = trim(file_get_contents(__DIR__ . '/VERSION')); +$commandClasses = [ \Consolidation\SiteProcess\Remo\RemoCommands::class ]; +$selfUpdateRepository = 'consolidation/site-process'; +$configPrefix = 'REMO'; +$configFilePath = getenv($configPrefix . '_CONFIG') ?: getenv('HOME') . '/.remo/remo.yml'; + +// Define our Runner, and pass it the command classes we provide. +$runner = new \Robo\Runner($commandClasses); +$runner + ->setSelfUpdateRepository($selfUpdateRepository) + ->setConfigurationFilename($configFilePath) + ->setEnvConfigPrefix($configPrefix) + ->setClassLoader($classLoader); + +// Execute the command and return the result. +$output = new \Symfony\Component\Console\Output\ConsoleOutput(); +$statusCode = $runner->execute($argv, $appName, $appVersion, $output); +exit($statusCode); diff --git a/vendor/consolidation/site-process/remo.yml b/vendor/consolidation/site-process/remo.yml new file mode 100644 index 0000000000000000000000000000000000000000..7bd3fed12bb67b35bba34b280ec2e5400f5c5138 --- /dev/null +++ b/vendor/consolidation/site-process/remo.yml @@ -0,0 +1,2 @@ +aliases: + path: ${env.HOME}/.drush/sites \ No newline at end of file diff --git a/vendor/consolidation/site-process/src/Factory/DockerComposeTransportFactory.php b/vendor/consolidation/site-process/src/Factory/DockerComposeTransportFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..c0639891d4bc7b30b7649894531e90eb99a82427 --- /dev/null +++ b/vendor/consolidation/site-process/src/Factory/DockerComposeTransportFactory.php @@ -0,0 +1,31 @@ +<?php + +namespace Consolidation\SiteProcess\Factory; + +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Transport\DockerComposeTransport; +use Consolidation\Config\ConfigInterface; + +/** + * DockerComposeTransportFactory will create an DockerComposeTransport for + * applicable site aliases. + */ +class DockerComposeTransportFactory implements TransportFactoryInterface +{ + /** + * @inheritdoc + */ + public function check(SiteAliasInterface $siteAlias) + { + // TODO: deprecate and eventually remove 'isContainer()', and move the logic here. + return $siteAlias->isContainer(); + } + + /** + * @inheritdoc + */ + public function create(SiteAliasInterface $siteAlias) + { + return new DockerComposeTransport($siteAlias); + } +} diff --git a/vendor/consolidation/site-process/src/Factory/SshTransportFactory.php b/vendor/consolidation/site-process/src/Factory/SshTransportFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..a83c757dcc0c73bced774d147975826410b2ac88 --- /dev/null +++ b/vendor/consolidation/site-process/src/Factory/SshTransportFactory.php @@ -0,0 +1,30 @@ +<?php + +namespace Consolidation\SiteProcess\Factory; + +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Transport\SshTransport; +use Consolidation\Config\ConfigInterface; + +/** + * SshTransportFactory will create an SshTransport for applicable site aliases. + */ +class SshTransportFactory implements TransportFactoryInterface +{ + /** + * @inheritdoc + */ + public function check(SiteAliasInterface $siteAlias) + { + // TODO: deprecate and eventually remove 'isRemote()', and move the logic here. + return $siteAlias->isRemote(); + } + + /** + * @inheritdoc + */ + public function create(SiteAliasInterface $siteAlias) + { + return new SshTransport($siteAlias); + } +} diff --git a/vendor/consolidation/site-process/src/Factory/TransportFactoryInterface.php b/vendor/consolidation/site-process/src/Factory/TransportFactoryInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..c7a919f136b9a4a03e9c3ed004188b60050494d3 --- /dev/null +++ b/vendor/consolidation/site-process/src/Factory/TransportFactoryInterface.php @@ -0,0 +1,34 @@ +<?php + +namespace Consolidation\SiteProcess\Factory; + +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Transport\TransportInterface; +use Consolidation\Config\ConfigInterface; + +/** + * TransportFactoryInterface defines a transport factory that is responsible + * for: + * + * - Determining whether a provided site alias is applicable to this transport + * - Creating an instance of a transport for an applicable site alias. + * + * There is always a transport for every factory, and visa-versa. + * @see Consolidation\SiteProcess\Transport\TransportInterface + */ +interface TransportFactoryInterface +{ + /** + * Check to see if a provided site alias is applicable to this transport type. + * @param SiteAliasInterface $siteAlias + * @return bool + */ + public function check(SiteAliasInterface $siteAlias); + + /** + * Create a transport instance for an applicable site alias. + * @param SiteAliasInterface $siteAlias + * @return TransportInterface + */ + public function create(SiteAliasInterface $siteAlias); +} diff --git a/vendor/consolidation/site-process/src/Factory/VagrantTransportFactory.php b/vendor/consolidation/site-process/src/Factory/VagrantTransportFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..7eec5314e88c20a553a77d3342238ea3be838c07 --- /dev/null +++ b/vendor/consolidation/site-process/src/Factory/VagrantTransportFactory.php @@ -0,0 +1,28 @@ +<?php + +namespace Consolidation\SiteProcess\Factory; + +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Transport\VagrantTransport; + +/** + * VagrantTransportFactory will create a VagrantTransport for applicable site aliases. + */ +class VagrantTransportFactory implements TransportFactoryInterface +{ + /** + * @inheritdoc + */ + public function check(SiteAliasInterface $siteAlias) + { + return $siteAlias->has('vagrant'); + } + + /** + * @inheritdoc + */ + public function create(SiteAliasInterface $siteAlias) + { + return new VagrantTransport($siteAlias); + } +} diff --git a/vendor/consolidation/site-process/src/ProcessBase.php b/vendor/consolidation/site-process/src/ProcessBase.php new file mode 100644 index 0000000000000000000000000000000000000000..e4725c05bf2193c74fbd4bc17588f5aa06e11f68 --- /dev/null +++ b/vendor/consolidation/site-process/src/ProcessBase.php @@ -0,0 +1,229 @@ +<?php + +namespace Consolidation\SiteProcess; + +use Psr\Log\LoggerInterface; +use Symfony\Component\Console\Style\OutputStyle; +use Symfony\Component\Process\Process; +use Consolidation\SiteProcess\Util\RealtimeOutputHandler; +use Consolidation\SiteProcess\Util\Escape; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; + +/** + * A wrapper around Symfony Process. + * + * - Supports simulated mode. Typically enabled via a --simulate option. + * - Supports verbose mode - logs all runs. + * - Can convert output json data into php array (convenience method) + * - Provides a "realtime output" helper + */ +class ProcessBase extends Process +{ + /** + * @var OutputStyle + */ + protected $output; + + /** + * @var OutputInterface + */ + protected $stderr; + + private $simulated = false; + + private $verbose = false; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * Symfony 4 style constructor for creating Process instances from strings. + * @param string $command The commandline string to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input + * @param int|float|null $timeout The timeout in seconds or null to disable + * @return Process + */ + public static function fromShellCommandline($command, $cwd = null, array $env = null, $input = null, $timeout = 60) + { + if (method_exists('\Symfony\Component\Process\Process', 'fromShellCommandline')) { + return Process::fromShellCommandline($command, $cwd, $env, $input, $timeout); + } + return new self($command, $cwd, $env, $input, $timeout); + } + + /** + * realtimeStdout returns the output stream that realtime output + * should be sent to (if applicable) + * + * @return OutputStyle $output + */ + public function realtimeStdout() + { + return $this->output; + } + + protected function realtimeStderr() + { + if ($this->stderr) { + return $this->stderr; + } + if (method_exists($this->output, 'getErrorStyle')) { + return $this->output->getErrorStyle(); + } + + return $this->realtimeStdout(); + } + + /** + * setRealtimeOutput allows the caller to inject an OutputStyle object + * that will be used to stream realtime output if applicable. + * + * @param OutputStyle $output + */ + public function setRealtimeOutput(OutputInterface $output, $stderr = null) + { + $this->output = $output; + $this->stderr = $stderr instanceof ConsoleOutputInterface ? $stderr->getErrorOutput() : $stderr; + } + + /** + * @return bool + */ + public function isVerbose() + { + return $this->verbose; + } + + /** + * @param bool $verbose + */ + public function setVerbose($verbose) + { + $this->verbose = $verbose; + } + + /** + * @return bool + */ + public function isSimulated() + { + return $this->simulated; + } + + /** + * @param bool $simulated + */ + public function setSimulated($simulated) + { + $this->simulated = $simulated; + } + + /** + * @return LoggerInterface + */ + public function getLogger() + { + return $this->logger; + } + + /** + * @param LoggerInterface $logger + */ + public function setLogger($logger) + { + $this->logger = $logger; + } + + /** + * @inheritDoc + */ + public function start(callable $callback = null, $env = array()) + { + $cmd = $this->getCommandLine(); + if ($this->isSimulated()) { + $this->getLogger()->notice('Simulating: ' . $cmd); + // Run a command that always succeeds (on Linux and Windows). + $this->setCommandLine('true'); + } elseif ($this->isVerbose()) { + $this->getLogger()->info('Executing: ' . $cmd); + } + parent::start($callback, $env); + // Set command back to original value in case anyone asks. + if ($this->isSimulated()) { + $this->setCommandLine($cmd); + } + } + + /** + * Get Process output and decode its JSON. + * + * @return array + * An associative array. + */ + public function getOutputAsJson() + { + $output = trim($this->getOutput()); + if (empty($output)) { + throw new \InvalidArgumentException('Output is empty.'); + } + if (Escape::isWindows()) { + // Doubled double quotes were converted to \\". + // Revert to double quote. + $output = str_replace('\\"', '"', $output); + // Revert of doubled backslashes. + $output = preg_replace('#\\\\{2}#', '\\', $output); + } + $output = $this->removeNonJsonJunk($output); + $json = json_decode($output, true); + if (!isset($json)) { + throw new \InvalidArgumentException('Unable to decode output into JSON.'); + } + return $json; + } + + /** + * Allow for a certain amount of resiliancy in the output received when + * json is expected. + * + * @param string $data + * @return string + */ + protected function removeNonJsonJunk($data) + { + // Exit early if we have no output. + $data = trim($data); + if (empty($data)) { + return $data; + } + // If the data is a simple quoted string, or an array, then exit. + if ((($data[0] == '"') && ($data[strlen($data) - 1] == '"')) || + (($data[0] == "[") && ($data[strlen($data) - 1] == "]")) + ) { + return $data; + } + // If the json is not a simple string or a simple array, then is must + // be an associative array. We will remove non-json garbage characters + // before and after the enclosing curley-braces. + $start = strpos($data, '{'); + $end = strrpos($data, '}') + 1; + $data = substr($data, $start, $end - $start); + return $data; + } + + /** + * Return a realTime output object. + * + * @return callable + */ + public function showRealtime() + { + $realTimeOutput = new RealtimeOutputHandler($this->realtimeStdout(), $this->realtimeStderr()); + $realTimeOutput->configure($this); + return $realTimeOutput; + } +} diff --git a/vendor/consolidation/site-process/src/ProcessManager.php b/vendor/consolidation/site-process/src/ProcessManager.php new file mode 100644 index 0000000000000000000000000000000000000000..7e945570569fa34c1fcd8086ae52f69856a034f7 --- /dev/null +++ b/vendor/consolidation/site-process/src/ProcessManager.php @@ -0,0 +1,176 @@ +<?php + +namespace Consolidation\SiteProcess; + +use Consolidation\SiteProcess\Factory\VagrantTransportFactory; +use Psr\Log\LoggerInterface; +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Factory\SshTransportFactory; +use Consolidation\SiteProcess\Factory\DockerComposeTransportFactory; +use Consolidation\SiteProcess\Factory\TransportFactoryInterface; +use Consolidation\SiteProcess\Transport\LocalTransport; +use Symfony\Component\Process\Process; +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; +use Consolidation\Config\ConfigAwareInterface; +use Consolidation\Config\ConfigAwareTrait; +use Consolidation\SiteAlias\SiteAliasWithConfig; + +/** + * ProcessManager will create a SiteProcess to run a command on a given + * site as indicated by a SiteAlias. + * + * ProcessManager also manages a collection of transport factories, and + * will produce transport instances as needed for provided site aliases. + */ +class ProcessManager implements ConfigAwareInterface +{ + use ConfigAwareTrait; + + /** @var ConfigInterface */ + protected $configRuntime; + + protected $transportFactories = []; + + public function __construct() + { + $this->config = new Config(); + $this->configRuntime = new Config(); + } + + /** + * setConfigRuntime sets the config object that holds runtime config + * items, i.e. config set from the commandline rather than a config file. + * Configuration priority (highest to lowest) is: + * - config runtime + * - site alias + * - config files + */ + public function setConfigRuntime(ConfigInterface $configRuntime) + { + $this->configRuntime = $configRuntime; + return $this; + } + + /** + * createDefault creates a Transport manager and add the default transports to it. + */ + public static function createDefault() + { + $processManager = new self(); + return static::addTransports($processManager); + } + + /** + * addTransports adds the avaiable transports to the + * provided process manager. + */ + public static function addTransports(ProcessManager $processManager) + { + $processManager->add(new SshTransportFactory()); + $processManager->add(new DockerComposeTransportFactory()); + $processManager->add(new VagrantTransportFactory()); + + return $processManager; + } + + /** + * Return a site process configured with an appropriate transport + * + * @param SiteAliasInterface $siteAlias Target for command + * @param array $args Command arguments + * @param array $options Associative array of command options + * @param array $optionsPassedAsArgs Associtive array of options to be passed as arguments (after double-dash) + * @return Process + */ + public function siteProcess(SiteAliasInterface $siteAlias, $args = [], $options = [], $optionsPassedAsArgs = []) + { + $transport = $this->getTransport($siteAlias); + $process = new SiteProcess($siteAlias, $transport, $args, $options, $optionsPassedAsArgs); + return $process; + } + + /** + * Create a Process instance from a commandline string. + * @param array $command The command to run and its arguments listed as separate entries + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input + * @param int|float|null $timeout The timeout in seconds or null to disable + * @return Process + */ + public function process($command, $cwd = null, array $env = null, $input = null, $timeout = 60) + { + return new ProcessBase($command, $cwd, $env, $input, $timeout); + } + + /** + * Create a Process instance from a commandline string. + * @param string $command The commandline string to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input + * @param int|float|null $timeout The timeout in seconds or null to disable + * @return Process + */ + public function shell($command, $cwd = null, array $env = null, $input = null, $timeout = 60) + { + return ProcessBase::fromShellCommandline($command, $cwd, $env, $input, $timeout); + } + + /** + * add a transport factory to our factory list + * @param TransportFactoryInterface $factory + */ + public function add(TransportFactoryInterface $factory) + { + $this->transportFactories[] = $factory; + return $this; + } + + /** + * hasTransport determines if there is a transport that handles the + * provided site alias. + * + * @param SiteAliasInterface $siteAlias + * @return boolean + */ + public function hasTransport(SiteAliasInterface $siteAlias) + { + return $this->getTransportFactory($siteAlias) !== null; + } + + /** + * getTransport returns a transport that is applicable to the provided site alias. + * + * @param SiteAliasInterface $siteAlias + * @return TransportInterface + */ + public function getTransport(SiteAliasInterface $siteAlias) + { + $factory = $this->getTransportFactory($siteAlias); + + $siteAliasWithConfig = SiteAliasWithConfig::create($siteAlias, $this->config, $this->configRuntime); + + if ($factory) { + return $factory->create($siteAliasWithConfig); + } + return new LocalTransport(); + } + + /** + * getTransportFactory returns a factory for the provided site alias. + * + * @param SiteAliasInterface $siteAlias + * @return TransportFactoryInterface + */ + protected function getTransportFactory(SiteAliasInterface $siteAlias) + { + foreach ($this->transportFactories as $factory) { + if ($factory->check($siteAlias)) { + return $factory; + } + } + return null; + } +} diff --git a/vendor/consolidation/site-process/src/ProcessManagerAwareInterface.php b/vendor/consolidation/site-process/src/ProcessManagerAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..c40c276c10ba4be7c1651f3e9a66379c797180c7 --- /dev/null +++ b/vendor/consolidation/site-process/src/ProcessManagerAwareInterface.php @@ -0,0 +1,23 @@ +<?php +namespace Consolidation\SiteProcess; + +/** + * Inflection interface for the site alias manager. + */ +interface ProcessManagerAwareInterface +{ + /** + * @param ProcessManager $processManager + */ + public function setProcessManager(ProcessManager $processManager); + + /** + * @return ProcessManager + */ + public function processManager(); + + /** + * @return bool + */ + public function hasProcessManager(); +} diff --git a/vendor/consolidation/site-process/src/ProcessManagerAwareTrait.php b/vendor/consolidation/site-process/src/ProcessManagerAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..a897cafd33fa3eaf2e27551194f88f69d0ef7246 --- /dev/null +++ b/vendor/consolidation/site-process/src/ProcessManagerAwareTrait.php @@ -0,0 +1,34 @@ +<?php +namespace Consolidation\SiteProcess; + +/** + * Inflection trait for the site alias manager. + */ +trait ProcessManagerAwareTrait +{ + protected $processManager; + + /** + * @inheritdoc + */ + public function setProcessManager(ProcessManager $processManager) + { + $this->processManager = $processManager; + } + + /** + * @return ProcessManager + */ + public function processManager() + { + return $this->processManager; + } + + /** + * @inheritdoc + */ + public function hasProcessManager() + { + return isset($this->processManager); + } +} diff --git a/vendor/consolidation/site-process/src/Remo/RemoCommands.php b/vendor/consolidation/site-process/src/Remo/RemoCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..973642024866d5762f9dc9198ab933d9e53b3377 --- /dev/null +++ b/vendor/consolidation/site-process/src/Remo/RemoCommands.php @@ -0,0 +1,42 @@ +<?php + +namespace Consolidation\SiteProcess\Remo; + +use Consolidation\SiteProcess\SiteProcess; + +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Consolidation\SiteAlias\SiteAliasManager; + +class RemoCommands extends \Robo\Tasks +{ + use SiteAliasManagerAwareTrait; + + /** + * Run a command identified by a site alias + * + * @command run + */ + public function run($aliasName, array $args, $options = ['foo' => 'bar']) + { + // The site alias manager has not been added to the DI container yet. + if (!$this->hasSiteAliasManager()) { + // TODO: Provide some way to initialize the alias file loaders, so + // that there is some way to specify where alias files may be + // loaded from. + $manager = new SiteAliasManager(); + // $manager->setRoot($root); + $this->setSiteAliasManager($manager); + } + + // In theory this might do something once we get an alias manager. + $siteAlias = $this->siteAliasManager()->get($aliasName); + if (!$siteAlias) { + throw new \Exception("Alias name $aliasName not found."); + } + $process = new SiteProcess($siteAlias, $args); + $process->setRealtimeOutput($this->io()); + $process->setTty($this->input()->isInteractive()); + $process->mustRun($process->showRealtime()); + } +} diff --git a/vendor/consolidation/site-process/src/SiteProcess.php b/vendor/consolidation/site-process/src/SiteProcess.php new file mode 100644 index 0000000000000000000000000000000000000000..e54270ecc08f1452bb2cb48ea0d013296173ce01 --- /dev/null +++ b/vendor/consolidation/site-process/src/SiteProcess.php @@ -0,0 +1,218 @@ +<?php +namespace Consolidation\SiteProcess; + +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Transport\DockerComposeTransport; +use Consolidation\SiteProcess\Util\ArgumentProcessor; +use Consolidation\SiteProcess\Transport\LocalTransport; +use Consolidation\SiteProcess\Transport\SshTransport; +use Consolidation\SiteProcess\Transport\TransportInterface; +use Consolidation\Config\Util\Interpolator; +use Consolidation\SiteProcess\Util\ShellOperatorInterface; +use Consolidation\SiteProcess\Util\Escape; + +/** + * A wrapper around Symfony Process that uses site aliases + * (https://github.com/consolidation/site-alias) + * + * - Interpolate arguments using values from the alias + * e.g. `$process = new SiteProcess($alias, ['git', '-C', '{{root}}']);` + * - Make remote calls via ssh as if they were local. + */ +class SiteProcess extends ProcessBase +{ + /** @var SiteAliasInterface */ + protected $siteAlias; + /** @var string[] */ + protected $args; + /** @var string[] */ + protected $options; + /** @var string[] */ + protected $optionsPassedAsArgs; + /** @var string */ + protected $cd_remote; + /** @var TransportInterface */ + protected $transport; + + /** + * Process arguments and options per the site alias and build the + * actual command to run. + */ + public function __construct(SiteAliasInterface $siteAlias, TransportInterface $transport, $args, $options = [], $optionsPassedAsArgs = []) + { + $this->siteAlias = $siteAlias; + $this->transport = $transport; + $this->args = $args; + $this->options = $options; + $this->optionsPassedAsArgs = $optionsPassedAsArgs; + + parent::__construct([]); + } + + /** + * Get a starting directory for the remote process. + * + * @return string|null + */ + public function getWorkingDirectory() + { + return $this->cd_remote; + } + + /** + * Set a starting directory for the remote process. + * + * @param string $cd_remote + * + * @return \Consolidation\SiteProcess\SiteProcess + */ + public function setWorkingDirectory($cd_remote) + { + $this->cd_remote = $cd_remote; + return $this; + } + + /** + * Set a starting directory for the initial/local process. + * + * @param string $cd + * + * @return \Consolidation\SiteProcess\SiteProcess + */ + public function setWorkingDirectoryLocal($cd) + { + return parent::setWorkingDirectory($cd); + } + + /** + * Get the starting directory for the initial/local process. + * + * @return string|null; + */ + public function getWorkingDirectoryLocal() + { + return parent::getWorkingDirectory(); + } + + /** + * + * @param bool $shouldUseSiteRoot + * @return $this|\Symfony\Component\Process\Process + * @throws \Exception + */ + public function chdirToSiteRoot($shouldUseSiteRoot = true) + { + if (!$shouldUseSiteRoot || !$this->siteAlias->hasRoot()) { + return $this; + } + + return $this->setWorkingDirectory($this->siteAlias->root()); + } + + /** + * Take all of our individual arguments and process them for use. + */ + protected function processArgs() + { + $transport = $this->getTransport($this->siteAlias); + $transport->configure($this); + + $processor = new ArgumentProcessor(); + $selectedArgs = $processor->selectArgs( + $this->siteAlias, + $this->args, + $this->options, + $this->optionsPassedAsArgs + ); + + // Ask the transport to drop in a 'cd' if needed. + if ($this->getWorkingDirectory()) { + $selectedArgs = $transport->addChdir($this->getWorkingDirectory(), $selectedArgs); + } + + // Do any necessary interpolation on the selected arguments. + $processedArgs = $this->interpolate($selectedArgs); + + // Wrap the command with 'ssh' or some other transport if this is + // a remote command; otherwise, leave it as-is. + return $transport->wrap($processedArgs); + } + + public function setTransport($transport) + { + $this->transport = $transport; + } + + /** + * Ask the transport manager for the correct transport for the + * provided alias. + */ + protected function getTransport(SiteAliasInterface $siteAlias) + { + return $this->transport; + } + + /** + * @inheritDoc + */ + public function getCommandLine() + { + $commandLine = parent::getCommandLine(); + if (empty($commandLine)) { + $processedArgs = $this->processArgs(); + $commandLine = Escape::argsForSite($this->siteAlias, $processedArgs); + $commandLine = implode(' ', $commandLine); + $this->setCommandLine($commandLine); + } + return $commandLine; + } + + /** + * @inheritDoc + */ + public function start(callable $callback = null, $env = array()) + { + $cmd = $this->getCommandLine(); + parent::start($callback, $env); + } + + /** + * @inheritDoc + */ + public function wait(callable $callback = null) + { + $return = parent::wait($callback); + return $return; + } + + /** + * interpolate examines each of the arguments in the provided argument list + * and replaces any token found therein with the value for that key as + * pulled from the given site alias. + * + * Example: "git -C {{root}} status" + * + * The token "{{root}}" will be converted to a value via $siteAlias->get('root'). + * The result will replace the token. + * + * It is possible to use dot notation in the keys to access nested elements + * within the site alias record. + * + * @param SiteAliasInterface $siteAlias + * @param type $args + * @return type + */ + protected function interpolate($args) + { + $interpolator = new Interpolator(); + return array_map( + function ($arg) use ($interpolator) { + if ($arg instanceof ShellOperatorInterface) { + return $arg; + } + return $interpolator->interpolate($this->siteAlias, $arg, false); + }, + $args + ); + } +} diff --git a/vendor/consolidation/site-process/src/Transport/DockerComposeTransport.php b/vendor/consolidation/site-process/src/Transport/DockerComposeTransport.php new file mode 100644 index 0000000000000000000000000000000000000000..c2c5376d564ed979446589fd238c1f9f3f0a0c22 --- /dev/null +++ b/vendor/consolidation/site-process/src/Transport/DockerComposeTransport.php @@ -0,0 +1,107 @@ +<?php + +namespace Consolidation\SiteProcess\Transport; + +use Consolidation\SiteProcess\SiteProcess; +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Util\Shell; +use Consolidation\Config\ConfigInterface; + +/** + * DockerComposeTransport knows how to wrap a command such that it executes + * on a Docker Compose service. + */ +class DockerComposeTransport implements TransportInterface +{ + protected $tty; + protected $siteAlias; + protected $cd_remote; + + public function __construct(SiteAliasInterface $siteAlias) + { + $this->siteAlias = $siteAlias; + } + + /** + * @inheritdoc + */ + public function configure(SiteProcess $process) + { + $this->tty = $process->isTty(); + } + + /** + * @inheritdoc + */ + public function wrap($args) + { + $transport = $this->getTransport(); + $transportOptions = $this->getTransportOptions(); + $commandToExecute = $this->getCommandToExecute($args); + + return array_merge( + $transport, + $transportOptions, + $commandToExecute + ); + } + + /** + * @inheritdoc + */ + public function addChdir($cd, $args) + { + $this->cd_remote = $cd; + return $args; + } + + /** + * getTransport returns the transport along with the docker-compose + * project in case it is defined. + */ + protected function getTransport() + { + $transport = ['docker-compose']; + $project = $this->siteAlias->get('docker.project', ''); + $options = $this->siteAlias->get('docker.compose.options', ''); + if ($project && (strpos($options, '-p') === false || strpos($options, '--project') === false)) { + $transport = array_merge($transport, ['-p', $project]); + } + if ($options) { + $transport[] = Shell::preEscaped($options); + } + return array_merge($transport, ['exec']); + } + + /** + * getTransportOptions returns the transport options for the tranport + * mechanism itself + */ + protected function getTransportOptions() + { + $transportOptions = [ + $this->siteAlias->get('docker.service', ''), + ]; + if ($options = $this->siteAlias->get('docker.exec.options', '')) { + array_unshift($transportOptions, Shell::preEscaped($options)); + } + if (!$this->tty) { + array_unshift($transportOptions, '-T'); + } + if ($this->cd_remote) { + $transportOptions = array_merge(['--workdir', $this->cd_remote], $transportOptions); + } + return array_filter($transportOptions); + } + + /** + * getCommandToExecute processes the arguments for the command to + * be executed such that they are appropriate for the transport mechanism. + * + * Nothing to do for this transport. + */ + protected function getCommandToExecute($args) + { + return $args; + } +} diff --git a/vendor/consolidation/site-process/src/Transport/LocalTransport.php b/vendor/consolidation/site-process/src/Transport/LocalTransport.php new file mode 100644 index 0000000000000000000000000000000000000000..d84c7615e85edf50833ef88e3fcbe432b9eb7f0b --- /dev/null +++ b/vendor/consolidation/site-process/src/Transport/LocalTransport.php @@ -0,0 +1,35 @@ +<?php + +namespace Consolidation\SiteProcess\Transport; + +use Consolidation\SiteProcess\SiteProcess; + +/** + * LocalTransport just runs the command on the local system. + */ +class LocalTransport implements TransportInterface +{ + /** + * @inheritdoc + */ + public function configure(SiteProcess $process) + { + $process->setWorkingDirectoryLocal($process->getWorkingDirectory()); + } + + /** + * @inheritdoc + */ + public function wrap($args) + { + return $args; + } + + /** + * @inheritdoc + */ + public function addChdir($cd, $args) + { + return $args; + } +} diff --git a/vendor/consolidation/site-process/src/Transport/SshTransport.php b/vendor/consolidation/site-process/src/Transport/SshTransport.php new file mode 100644 index 0000000000000000000000000000000000000000..0aeb372927aea6e0b015f4ed12eb459c15d4983b --- /dev/null +++ b/vendor/consolidation/site-process/src/Transport/SshTransport.php @@ -0,0 +1,92 @@ +<?php + +namespace Consolidation\SiteProcess\Transport; + +use Consolidation\SiteProcess\SiteProcess; +use Consolidation\SiteProcess\Util\Escape; +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Util\Shell; +use Consolidation\Config\ConfigInterface; + +/** + * SshTransport knows how to wrap a command such that it runs on a remote + * system via the ssh cli. + */ +class SshTransport implements TransportInterface +{ + protected $tty; + protected $siteAlias; + + public function __construct(SiteAliasInterface $siteAlias) + { + $this->siteAlias = $siteAlias; + } + + /** + * @inheritdoc + */ + public function configure(SiteProcess $process) + { + $this->tty = $process->isTty(); + } + + /** + * inheritdoc + */ + public function wrap($args) + { + $transport = ['ssh']; + $transportOptions = $this->getTransportOptions(); + $commandToExecute = $this->getCommandToExecute($args); + + return array_merge( + $transport, + $transportOptions, + $commandToExecute + ); + } + + /** + * @inheritdoc + */ + public function addChdir($cd_remote, $args) + { + return array_merge( + [ + 'cd', + $cd_remote, + Shell::op('&&'), + ], + $args + ); + } + + /** + * getTransportOptions returns the transport options for the tranport + * mechanism itself + */ + protected function getTransportOptions() + { + $transportOptions = [ + Shell::preEscaped($this->siteAlias->get('ssh.options', '-o PasswordAuthentication=no')), + $this->siteAlias->remoteHostWithUser(), + ]; + if ($this->tty) { + array_unshift($transportOptions, '-t'); + } + return $transportOptions; + } + + /** + * getCommandToExecute processes the arguments for the command to + * be executed such that they are appropriate for the transport mechanism. + */ + protected function getCommandToExecute($args) + { + // Escape each argument for the target system and then join + $args = Escape::argsForSite($this->siteAlias, $args); + $commandToExecute = implode(' ', $args); + + return [$commandToExecute]; + } +} diff --git a/vendor/consolidation/site-process/src/Transport/TransportInterface.php b/vendor/consolidation/site-process/src/Transport/TransportInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..77c7bc693422a8cbe521e5895446b25d3802f1b4 --- /dev/null +++ b/vendor/consolidation/site-process/src/Transport/TransportInterface.php @@ -0,0 +1,40 @@ +<?php + +namespace Consolidation\SiteProcess\Transport; + +use Consolidation\SiteProcess\SiteProcess; + +/** + * SshTransport knows how to wrap a command such that it runs on a remote + * system via the ssh cli. + * + * There is always a transport for every factory, and visa-versa. + * + * @see Consolidation\SiteProcess\Factory\TransportFactoryInterface + */ +interface TransportInterface +{ + /** + * Configure ourselves based on the settings of the process object + * (e.g. isTty()). + * + * @param \Consolidation\SiteProcess\SiteProcess $process + */ + public function configure(SiteProcess $process); + + /** + * wrapWithTransport examines the provided site alias; if it is a local + * alias, then the provided arguments are returned unmodified. If the + * alias points at a remote system, though, then the arguments are + * escaped and wrapped in an appropriate ssh command. + * + * @param array $args arguments provided by caller. + * @return array command and arguments to execute. + */ + public function wrap($args); + + /** + * addChdir adds an appropriate 'chdir' / 'cd' command for the transport. + */ + public function addChdir($cd, $args); +} diff --git a/vendor/consolidation/site-process/src/Transport/VagrantTransport.php b/vendor/consolidation/site-process/src/Transport/VagrantTransport.php new file mode 100644 index 0000000000000000000000000000000000000000..3c4514d2105a3e625cdd7d4a00b724943c6fe13f --- /dev/null +++ b/vendor/consolidation/site-process/src/Transport/VagrantTransport.php @@ -0,0 +1,85 @@ +<?php + +namespace Consolidation\SiteProcess\Transport; + +use Consolidation\SiteProcess\SiteProcess; +use Consolidation\SiteProcess\Util\Escape; +use Consolidation\SiteAlias\SiteAliasInterface; +use Consolidation\SiteProcess\Util\Shell; + +/** + * VagrantTransport knows how to wrap a command such that it runs on a remote + * system via the vagrant cli. + */ +class VagrantTransport implements TransportInterface +{ + protected $tty; + protected $siteAlias; + + public function __construct(SiteAliasInterface $siteAlias) + { + $this->siteAlias = $siteAlias; + } + + /** + * @inheritdoc + */ + public function configure(SiteProcess $process) + { + $this->tty = $process->isTty(); + } + + /** + * inheritdoc + */ + public function wrap($args) + { + $transport = ['vagrant', 'ssh']; + $transportOptions = $this->getTransportOptions(); + $commandToExecute = $this->getCommandToExecute($args); + + return array_merge( + $transport, + $transportOptions, + ['-c'], + $commandToExecute + ); + } + + /** + * @inheritdoc + */ + public function addChdir($cd_remote, $args) + { + return array_merge( + [ + 'cd', + $cd_remote, + Shell::op('&&'), + ], + $args + ); + } + + /** + * getTransportOptions returns the transport options for the tranport + * mechanism itself + */ + protected function getTransportOptions() + { + return $this->tty ? ['-t'] : []; + } + + /** + * getCommandToExecute processes the arguments for the command to + * be executed such that they are appropriate for the transport mechanism. + */ + protected function getCommandToExecute($args) + { + // Escape each argument for the target system and then join + $args = Escape::argsForSite($this->siteAlias, $args); + $commandToExecute = implode(' ', $args); + + return [$commandToExecute]; + } +} diff --git a/vendor/consolidation/site-process/src/Util/ArgumentProcessor.php b/vendor/consolidation/site-process/src/Util/ArgumentProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..c83afd98df9fc0eb0ffeb9e7b05c2ef25b71a12a --- /dev/null +++ b/vendor/consolidation/site-process/src/Util/ArgumentProcessor.php @@ -0,0 +1,95 @@ +<?php +namespace Consolidation\SiteProcess\Util; + +use Consolidation\SiteAlias\SiteAliasInterface; +use Symfony\Component\Process\Process; +use Consolidation\SiteProcess\Transport\TransportInterface; + +/** + * ArgumentProcessor takes a set of arguments and options from the caller + * and processes them with the provided site alias to produce a final + * executable command that will run either locally or on a remote system, + * as applicable. + */ +class ArgumentProcessor +{ + /** + * selectArgs selects the appropriate set of arguments for the command + * to be executed and orders them as needed. + * + * @param SiteAliasInterface $siteAlias Description of + * @param array $args Command and arguments to execute (source) + * @param array $options key / value pair of option and value in include + * in final arguments + * @param array $optionsPassedAsArgs key / value pair of option and value + * to include in final arguments after the '--' argument. + * @return array Command and arguments to execute + */ + public function selectArgs(SiteAliasInterface $siteAlias, $args, $options = [], $optionsPassedAsArgs = []) + { + // Split args into three arrays separated by the `--` + list($leadingArgs, $dashDash, $remaingingArgs) = $this->findArgSeparator($args); + $convertedOptions = $this->convertOptions($options); + $convertedOptionsPassedAsArgs = $this->convertOptions($optionsPassedAsArgs); + + // If the caller provided options that should be passed as args, then we + // always need a `--`, whether or not one existed to begin with in $args + if (!empty($convertedOptionsPassedAsArgs)) { + $dashDash = ['--']; + } + + // Combine our separated args in the correct order. $dashDash will + // always be `['--']` if $optionsPassedAsArgs or $remaingingArgs are + // not empty, and otherwise will usually be empty. + return array_merge( + $leadingArgs, + $convertedOptions, + $dashDash, + $convertedOptionsPassedAsArgs, + $remaingingArgs + ); + } + + /** + * findArgSeparator finds the "--" argument in the provided arguments list, + * if present, and returns the arguments in three sets. + * + * @return array of three arrays, leading, "--" and trailing + */ + protected function findArgSeparator($args) + { + $pos = array_search('--', $args); + if ($pos === false) { + return [$args, [], []]; + } + + return [ + array_slice($args, 0, $pos), + ['--'], + array_slice($args, $pos + 1), + ]; + } + + /** + * convertOptions takes an associative array of options (key / value) and + * converts it to an array of strings in the form --key=value. + * + * @param array $options in key => value form + * @return array options in --option=value form + */ + protected function convertOptions($options) + { + $result = []; + foreach ($options as $option => $value) { + if ($value === true || $value === null) { + $result[] = "--$option"; + } elseif ($value === false) { + // Ignore this option. + } else { + $result[] = "--{$option}={$value}"; + } + } + + return $result; + } +} diff --git a/vendor/consolidation/site-process/src/Util/Escape.php b/vendor/consolidation/site-process/src/Util/Escape.php new file mode 100644 index 0000000000000000000000000000000000000000..f5668d23aec88d6fa55bb70e6375633cbb88748d --- /dev/null +++ b/vendor/consolidation/site-process/src/Util/Escape.php @@ -0,0 +1,145 @@ +<?php +namespace Consolidation\SiteProcess\Util; + +use Consolidation\SiteAlias\SiteAliasInterface; +use Symfony\Component\Process\Process; +use Consolidation\Config\Util\Interpolator; +use Symfony\Component\Console\Output\OutputInterface; +use Consolidation\SiteProcess\Util\ShellOperatorInterface; + +/** + * Escape will shell-escape commandline arguments for different platforms. + */ +class Escape +{ + /** + * argsForSite escapes each argument in an array for the given site. + */ + public static function argsForSite(SiteAliasInterface $siteAlias, $args) + { + return array_map( + function ($arg) use ($siteAlias) { + return Escape::forSite($siteAlias, $arg); + }, + $args + ); + } + + /** + * forSite escapes the provided argument for the specified alias record. + */ + public static function forSite(SiteAliasInterface $siteAlias, $arg) + { + return static::shellArg($arg, $siteAlias->os()); + } + + /** + * shellArg escapes the provided argument for the specified OS + * + * @param string|ShellOperatorInterface $arg The argument to escape + * @param string|null $os The OS to escape for. Optional; defaults to LINUX + * + * @return string The escaped string + */ + public static function shellArg($arg, $os = null) + { + // Short-circuit escaping for simple params (keep stuff readable); + // also skip escaping for shell operators (e.g. &&), which must not + // be escaped. + if (($arg instanceof ShellOperatorInterface) || preg_match('|^[a-zA-Z0-9@=.:/_-]*$|', $arg)) { + return (string) $arg; + } + + if (static::isWindows($os)) { + return static::windowsArg($arg); + } + return static::linuxArg($arg); + } + + /** + * isWindows determines whether the provided OS is Windows. + * + * @param string|null $os The OS to escape for. + * + * @return boolean + */ + public static function isWindows($os = null) + { + // In most cases, $os will be NULL and PHP_OS will be returned. However, + // if an OS is specified in $os, return that instead. + $os = $os ?: PHP_OS; + return strtoupper(substr($os, 0, 3)) === 'WIN'; + } + + /** + * linuxArg is the Linux version of escapeshellarg(). + * + * This is intended to work the same way that escapeshellarg() does on + * Linux. If we need to escape a string that will be used remotely on + * a Linux system, then we need our own implementation of escapeshellarg, + * because the Windows version behaves differently. + * + * Note that we behave somewhat differently than the built-in escapeshellarg() + * with respect to whitespace replacement in order + * + * @param string $arg The argument to escape + * + * @return string The escaped string + */ + public static function linuxArg($arg) + { + // For single quotes existing in the string, we will "exit" + // single-quote mode, add a \' and then "re-enter" + // single-quote mode. The result of this is that + // 'quote' becomes '\''quote'\'' + $arg = preg_replace('/\'/', '\'\\\'\'', $arg); + + // Replace "\t", "\n", "\r", "\0", "\x0B" with a whitespace. + // Note that this replacement makes Drush's escapeshellarg work differently + // than the built-in escapeshellarg in PHP on Linux, as these characters + // usually are NOT replaced. However, this was done deliberately to be more + // conservative when running _drush_escapeshellarg_linux on Windows + // (this can happen when generating a command to run on a remote Linux server.) + // + // TODO: Perhaps we should only do this if the local system is Windows? + // n.b. that would be a little more complicated to test. + $arg = str_replace(["\t", "\n", "\r", "\0", "\x0B"], ' ', $arg); + + // Add surrounding quotes. + $arg = "'" . $arg . "'"; + + return $arg; + } + + /** + * windowsArg is the Windows version of escapeshellarg(). + * + * @param string $arg The argument to escape + * + * @return string The escaped string + */ + public static function windowsArg($arg) + { + if ('' === $arg || null === $arg) { + return '""'; + } + if (false !== strpos($arg, "\0")) { + $arg = str_replace("\0", '?', $arg); + } + if (!preg_match('/[\/()%!^"<>&|\s]/', $arg)) { + return $arg; + } + // Double up existing backslashes + $arg = preg_replace('/(\\\\+)$/', '$1$1', $arg); + + // Replacing whitespace for good measure (see comment above). + $arg = str_replace(["\t", "\n", "\r", "\0", "\x0B"], ' ', $arg); + + $arg = str_replace(['"', '^', '%', '!'], ['""', '"^^"', '"^%"', '"^!"'], $arg); + + // Add surrounding quotes. + $arg = '"' . $arg . '"'; + + return $arg; + } +} diff --git a/vendor/consolidation/site-process/src/Util/RealtimeOutputHandler.php b/vendor/consolidation/site-process/src/Util/RealtimeOutputHandler.php new file mode 100644 index 0000000000000000000000000000000000000000..914c7e6b6d7dc56b84d6470c33096f911fd053e8 --- /dev/null +++ b/vendor/consolidation/site-process/src/Util/RealtimeOutputHandler.php @@ -0,0 +1,123 @@ +<?php +namespace Consolidation\SiteProcess\Util; + +use Symfony\Component\Process\Process; +use Consolidation\Config\Util\Interpolator; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\NullOutput; + +/** + * RealtimeOutput can be provided to a process object when you want + * to display the output of the running command as it is being produced. + */ +class RealtimeOutputHandler +{ + protected $stdout; + protected $stderr; + protected $stdoutMarker = ''; + protected $stderrMarker = ''; + + /** + * Provide the output streams to use for stdout and stderr + */ + const MARKER_ERR = '> '; + + public function __construct(OutputInterface $stdout, OutputInterface $stderr) + { + $this->stdout = $stdout; + $this->stderr = $stderr; + + $this->stdoutMarker = ''; + $this->stderrMarker = self::MARKER_ERR; + } + + /** + * This gives us an opportunity to adapt to the settings of the + * process object (e.g. do we need to do anything differently if + * it is in tty mode, etc.) + */ + public function configure(Process $process) + { + return $this; + } + + /** + * setStderrMarker defines the string that should be added at + * the beginning of every line of stderr that is printed. + */ + public function setStderrMarker($marker) + { + $this->stderrMarker = $marker; + return $this; + } + + /** + * setStdoutMarker defines the string that should be added at + * the beginning of every line of stdout that is printed. + */ + public function setStdoutMarker($marker) + { + $this->stdoutMarker = $marker; + return $this; + } + + /** + * hideStdout overrides whatever was formerly stored in $this->stdout + * with a null output buffer so that none of the standard output data + * is visible. + */ + public function hideStdout() + { + $this->stdout = new NullOutput(); + $this->stdoutMarker = ''; + return $this; + } + + /** + * hideStderr serves the same function as hideStdout, but for the + * standard error stream. Note that it is not useful to unconditionally + * call both hideStdout and hideStderr; if no output is desired, then + * the RealtimeOutputHandler should not be used. + */ + public function hideStderr() + { + $this->stderr = new NullOutput(); + $this->stderrMarker = ''; + return $this; + } + + /** + * If this object is used as a callable, then run 'handleOutput'. + */ + public function __invoke($type, $buffer) + { + $this->handleOutput($type, $buffer); + } + + /** + * Helper method when you want real-time output from a Process call. + * @param string $type + * @param string $buffer + */ + public function handleOutput($type, $buffer) + { + if (Process::ERR === $type) { + $this->stderr->write($this->addMarker($buffer, $this->stderrMarker), false, OutputInterface::OUTPUT_RAW); + } else { + $this->stdout->write($this->addMarker($buffer, $this->stdoutMarker), false, OutputInterface::OUTPUT_RAW); + } + } + + /** + * Make sure that every line in $buffer begins with a MARKER_ERR. + */ + protected function addMarker($buffer, $marker) + { + // Exit early if there is no marker to add + if (empty($marker)) { + return $buffer; + } + // Add a marker on the beginning of every line. + return $marker . rtrim(implode("\n" . $marker, explode("\n", $buffer)), $marker); + } +} diff --git a/vendor/consolidation/site-process/src/Util/Shell.php b/vendor/consolidation/site-process/src/Util/Shell.php new file mode 100644 index 0000000000000000000000000000000000000000..ad653c6a10ff365612c257c1290432163e0c2e14 --- /dev/null +++ b/vendor/consolidation/site-process/src/Util/Shell.php @@ -0,0 +1,52 @@ +<?php +namespace Consolidation\SiteProcess\Util; + +/** + * Shell::op is a static factory that will create shell operators for use + * in command line arguments list. Shell operators are characters that have + * special meaning to the shell, such as "output redirection". When a shell + * operator object is used, it indicates that this element is intended to + * be used as an operator, and is not simply some other parameter to be escaped. + */ +class Shell implements ShellOperatorInterface +{ + protected $value; + + public static function op($operator) + { + static::validateOp($operator); + return new self($operator); + } + + public static function preEscaped($value) + { + return new self($value); + } + + public function __construct($value) + { + $this->value = $value; + } + + public function __toString() + { + return $this->value; + } + + protected static function validateOp($operator) + { + $valid = [ + '&&', + '||', + '|', + '<', + '>', + '>>', + ';', + ]; + + if (!in_array($operator, $valid)) { + throw new \Exception($operator . ' is not a valid shell operator.'); + } + } +} diff --git a/vendor/consolidation/site-process/src/Util/ShellOperatorInterface.php b/vendor/consolidation/site-process/src/Util/ShellOperatorInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..4e121849e842a64ab71c68a3696e25ab6405c238 --- /dev/null +++ b/vendor/consolidation/site-process/src/Util/ShellOperatorInterface.php @@ -0,0 +1,10 @@ +<?php +namespace Consolidation\SiteProcess\Util; + +/** + * ShellOperatorInterface is a marker interface indicating that the object + * represents a shell operator. + */ +interface ShellOperatorInterface +{ +} diff --git a/vendor/consolidation/site-process/src/Util/Tty.php b/vendor/consolidation/site-process/src/Util/Tty.php new file mode 100644 index 0000000000000000000000000000000000000000..4fcf4b4f274cd37fea983a108d11772be55f133e --- /dev/null +++ b/vendor/consolidation/site-process/src/Util/Tty.php @@ -0,0 +1,27 @@ +<?php +namespace Consolidation\SiteProcess\Util; + +use Symfony\Component\Process\Process; + +/** + * Wrapper for universal support of TTY-related functionality across versions of + * Symfony Process. + */ +class Tty +{ + /** + * In Symfony Process 4+, this is simply a wrapper for Process::isTtySupported(). + * In lower versions, it mimics the same functionality. + */ + public static function isTtySupported() + { + // Start off by checking STDIN with `posix_isatty`, as that appears to be more reliable + if (function_exists('posix_isatty')) { + return posix_isatty(STDIN); + } + if (method_exists('\Symfony\Component\Process\Process', 'isTtySupported')) { + return Process::isTtySupported(); + } + return (bool) @proc_open('echo 1 >/dev/null', array(array('file', '/dev/tty', 'r'), array('file', '/dev/tty', 'w'), array('file', '/dev/tty', 'w')), $pipes); + } +} diff --git a/vendor/consolidation/site-process/tests/ArgumentProcessorTest.php b/vendor/consolidation/site-process/tests/ArgumentProcessorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..e1e68670e2c94da94ba0b9c5d154584e931b1351 --- /dev/null +++ b/vendor/consolidation/site-process/tests/ArgumentProcessorTest.php @@ -0,0 +1,70 @@ +<?php + +namespace Consolidation\SiteProcess; + +use PHPUnit\Framework\TestCase; +use Consolidation\SiteProcess\Util\ArgumentProcessor; +use Consolidation\SiteAlias\SiteAlias; + +class ArgumentProcessorTest extends TestCase +{ + /** + * Data provider for testArgumentProcessor. + */ + public function argumentProcessorTestValues() + { + return [ + [ + '["ls", "-al"]', + [], + ['ls', '-al'], + [], + [], + ], + + [ + '["drush", "status", "--fields=root,uri"]', + [], + ['drush', 'status'], + ['fields' => 'root,uri'], + [], + ], + + [ + '["drush", "rsync", "a", "b", "--", "--exclude=vendor"]', + [], + ['drush', 'rsync', 'a', 'b',], + [], + ['exclude' => 'vendor'], + ], + + [ + '["drush", "rsync", "a", "b", "--", "--exclude=vendor", "--include=vendor/autoload.php"]', + [], + ['drush', 'rsync', 'a', 'b', '--', '--include=vendor/autoload.php'], + [], + ['exclude' => 'vendor'], + ], + ]; + } + + /** + * Test the SiteProcess class. + * + * @dataProvider argumentProcessorTestValues + */ + public function testArgumentProcessor( + $expected, + $siteAliasData, + $args, + $options, + $optionsPassedAsArgs) + { + $siteAlias = new SiteAlias($siteAliasData, '@alias.dev'); + $processor = new ArgumentProcessor(); + + $actual = $processor->selectArgs($siteAlias, $args, $options, $optionsPassedAsArgs); + $actual = '["' . implode('", "', $actual) . '"]'; + $this->assertEquals($expected, $actual); + } +} diff --git a/vendor/consolidation/site-process/tests/EscapeTest.php b/vendor/consolidation/site-process/tests/EscapeTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d3b9e3cfb76474e1a0a96b04a22b54cdebf56c84 --- /dev/null +++ b/vendor/consolidation/site-process/tests/EscapeTest.php @@ -0,0 +1,173 @@ +<?php + +namespace Consolidation\SiteProcess; + +use PHPUnit\Framework\TestCase; +use Consolidation\SiteProcess\Util\ArgumentProcessor; +use Consolidation\SiteAlias\SiteAlias; +use Consolidation\SiteProcess\Util\Escape; + +class EscapeTest extends TestCase +{ + const DEFAULT_SITE_ALIAS = ['host' => 'example.com', ]; + const LINUX_SITE_ALIAS = ['host' => 'example.com', 'os' => 'Linux']; + const WINDOWS_SITE_ALIAS = ['host' => 'example.com', 'os' => 'WIN']; + + /** + * Data provider for testIsWindows. + */ + public function isWindowsTestValues() + { + return [ + [ + 'Linux', + false, + static::DEFAULT_SITE_ALIAS, + ], + + [ + 'Linux', + false, + static::LINUX_SITE_ALIAS, + ], + + [ + 'WIN', + true, + static::WINDOWS_SITE_ALIAS, + ], + ]; + } + + /** + * Test the isWindows method. + * + * @dataProvider isWindowsTestValues + */ + public function testIsWindows( + $expected, + $expectToBeWindows, + $siteAliasData) + { + $siteAlias = new SiteAlias($siteAliasData, '@alias.dev'); + $actual = $siteAlias->os(); + $this->assertEquals($expected, $actual); + $actuallyIsWindows = Escape::isWindows($siteAlias->os()); + $this->assertEquals($expectToBeWindows, $actuallyIsWindows); + } + + /** + * Data provider for testEscapeForSite. + */ + public function escapeForSiteTestValues() + { + return [ + [ + 'foo', + 'foo', + static::DEFAULT_SITE_ALIAS, + ], + + [ + 'foo', + 'foo', + static::LINUX_SITE_ALIAS, + ], + + [ + 'foo', + 'foo', + static::WINDOWS_SITE_ALIAS, + ], + + [ + "'foo bar'", + 'foo bar', + static::DEFAULT_SITE_ALIAS, + ], + + [ + "'foo bar'", + 'foo bar', + static::LINUX_SITE_ALIAS, + ], + + [ + '"foo bar"', + 'foo bar', + static::WINDOWS_SITE_ALIAS, + ], + + [ + "'don'\\''t forget'", + "don't forget", + static::DEFAULT_SITE_ALIAS, + ], + + [ + "'don'\\''t forget'", + "don't forget", + static::LINUX_SITE_ALIAS, + ], + + [ + '"don\'t forget"', + "don't forget", + static::WINDOWS_SITE_ALIAS, + ], + + [ + "'I'\''ll try the \"easy\" fix.'", + "I'll try the \"easy\" fix.", + static::DEFAULT_SITE_ALIAS, + ], + + [ + "'I'\''ll try the \"easy\" fix.'", + "I'll try the \"easy\" fix.", + static::LINUX_SITE_ALIAS, + ], + + [ + '"I\'ll try the ""easy"" fix."', + "I'll try the \"easy\" fix.", + static::WINDOWS_SITE_ALIAS, + ], + + [ + "'a b'", + "a\tb", + static::DEFAULT_SITE_ALIAS, + ], + + [ + "'a b'", + "a\tb", + static::LINUX_SITE_ALIAS, + ], + + [ + '"a b"', + "a\tb", + static::WINDOWS_SITE_ALIAS, + ], + + ]; + } + + /** + * Test the forSite method. + * + * @dataProvider escapeForSiteTestValues + */ + public function testEscapeForSite( + $expected, + $arg, + $siteAliasData) + { + $siteAlias = new SiteAlias($siteAliasData, '@alias.dev'); + + $actual = Escape::forSite($siteAlias, $arg); + $this->assertEquals($expected, $actual); + } +} diff --git a/vendor/consolidation/site-process/tests/RealtimeOutputHandlerTest.php b/vendor/consolidation/site-process/tests/RealtimeOutputHandlerTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a5427d3a7192cd2b92b1290e757574f8e670aa46 --- /dev/null +++ b/vendor/consolidation/site-process/tests/RealtimeOutputHandlerTest.php @@ -0,0 +1,78 @@ +<?php + +namespace Consolidation\SiteProcess; + +use Consolidation\SiteProcess\Util\Escape; +use PHPUnit\Framework\TestCase; +use Consolidation\SiteProcess\Util\ArgumentProcessor; +use Consolidation\SiteAlias\SiteAlias; +use Symfony\Component\Console\Output\BufferedOutput; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Console\Input\ArrayInput; + +class RealtimeOutputHandlerTest extends TestCase +{ + /** + * Data provider for testRealtimeOutputHandler. + */ + public function realtimeOutputHandlerTestValues() + { + return [ + [ + 'hello, world', + '', + ['echo', 'hello, world'], + 'LINUX', + ], + + [ + '"hello, world"', + '', + ['echo', 'hello, world'], + 'WIN' + ], + + [ + 'README.md', + '', + ['ls', 'README.md'], + 'LINUX', + ], + + [ + '', + 'no/such/file: No such file or directory', + ['ls', 'no/such/file'], + 'LINUX', + ], + ]; + } + + /** + * Test the RealtimeOutputHandler class. + * + * @dataProvider realtimeOutputHandlerTestValues + */ + public function testRealtimeOutputHandler($expectedStdout, $expectedStderr, $args, $os) + { + if (Escape::isWindows() != Escape::isWindows($os)) { + $this->markTestSkipped("OS isn't supported"); + } + $stdin = new ArrayInput([]); + $stdout = new BufferedOutput(); + $stderr = new BufferedOutput(); + $symfonyStyle = new SymfonyStyle($stdin, $stdout); + + $process = new ProcessBase($args); + $process->setRealtimeOutput($symfonyStyle, $stderr); + $process->run($process->showRealtime()); + + $this->assertEquals($expectedStdout, trim($stdout->fetch())); + if (empty($expectedStderr)) { + $this->assertEquals('', trim($stderr->fetch())); + } + else { + $this->assertContains($expectedStderr, trim($stderr->fetch())); + } + } +} diff --git a/vendor/consolidation/site-process/tests/RemoCommandsTest.php b/vendor/consolidation/site-process/tests/RemoCommandsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8e929eb40ba23e01b666eb22ed7beeb49b1d0430 --- /dev/null +++ b/vendor/consolidation/site-process/tests/RemoCommandsTest.php @@ -0,0 +1,77 @@ +<?php + +namespace Consolidation\SiteProcess; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Output\BufferedOutput; + +class RemoCommandsTest extends TestCase implements CommandTesterInterface +{ + use CommandTesterTrait; + + /** @var string[] */ + protected $commandClasses; + + /** + * Prepare to test our commandfile + */ + public function setUp() + { + // Store the command classes we are going to test + $this->commandClasses = [ \Consolidation\SiteProcess\Remo\RemoCommands::class ]; + $this->setupCommandTester('TestFixtureApp', '1.0.1'); + } + + /** + * Data provider for testRemoCommands. + * + * Return an array of arrays, each of which contains the data for one test. + * The parameters in each array should be: + * + * - Expected output (actual output must CONTAIN this string) + * - Expected function status code + * - argv + * + * All of the remaining parameters after the first two are interpreted + * to be the argv value to pass to the command. The application name + * is automatically unshifted into argv[0] first. + */ + public function remoTestCommandParameters() + { + return [ + + [ + 'Run a command identified by a site alias', + self::STATUS_OK, + 'list', + ], + + [ + 'Not enough arguments (missing: "aliasName")', + self::STATUS_ERROR, + 'run', + ], + ]; + } + + /** + * Test our remo commandfile class. Each time this function is called, + * it will be passed the expected output and expected status code; the + * remainder of the arguments passed will be used as $argv. + * + * @dataProvider remoTestCommandParameters + */ + public function testRemoCommands($expectedOutput, $expectedStatus, $variable_args) + { + // Set this to the path to a fixture configuration file if you'd like to use one. + $configurationFile = false; + + // Create our argv array and run the command + $argv = $this->argv(func_get_args()); + list($actualOutput, $statusCode) = $this->execute($argv, $this->commandClasses, $configurationFile); + + // Confirm that our output and status code match expectations + $this->assertContains($expectedOutput, $actualOutput); + $this->assertEquals($expectedStatus, $statusCode); + } +} diff --git a/vendor/consolidation/site-process/tests/SiteProcessTest.php b/vendor/consolidation/site-process/tests/SiteProcessTest.php new file mode 100644 index 0000000000000000000000000000000000000000..04228223bcc6f7640046bc6d13c8a37207b9dc9f --- /dev/null +++ b/vendor/consolidation/site-process/tests/SiteProcessTest.php @@ -0,0 +1,296 @@ +<?php + +namespace Consolidation\SiteProcess; + +use PHPUnit\Framework\TestCase; +use Consolidation\SiteProcess\Util\ArgumentProcessor; +use Consolidation\SiteProcess\Util\Escape; +use Consolidation\SiteAlias\SiteAlias; + +class SiteProcessTest extends TestCase +{ + /** + * Data provider for testSiteProcess. + */ + public function siteProcessTestValues() + { + return [ + [ + "ls -al", + false, + false, + [], + ['ls', '-al'], + [], + [], + NULL, + ], + + [ + "ls -al", + 'src', + false, + [], + ['ls', '-al'], + [], + [], + NULL, + ], + + [ + "ls -al /path1 /path2", + false, + false, + [], + ['ls', '-al', '/path1', '/path2'], + [], + [], + NULL, + ], + + [ + "ssh -o PasswordAuthentication=no www-admin@server.net 'ls -al'", + false, + false, + ['host' => 'server.net', 'user' => 'www-admin'], + ['ls', '-al'], + [], + [], + NULL, + ], + + [ + "ssh -o PasswordAuthentication=no www-admin@server.net 'cd /srv/www/docroot && ls -al'", + false, + false, + ['host' => 'server.net', 'user' => 'www-admin', 'root' => '/srv/www/docroot'], + ['ls', '-al'], + [], + [], + NULL, + ], + + [ + "ssh -o PasswordAuthentication=no www-admin@server.net 'cd src && ls -al'", + 'src', + false, + ['host' => 'server.net', 'user' => 'www-admin'], + ['ls', '-al'], + [], + [], + NULL, + ], + + [ + "ssh -t -o PasswordAuthentication=no www-admin@server.net 'ls -al'", + false, + true, + ['host' => 'server.net', 'user' => 'www-admin'], + ['ls', '-al'], + [], + [], + NULL, + ], + + [ + "ssh -t -o PasswordAuthentication=no www-admin@server.net 'cd src && ls -al /path1 /path2'", + 'src', + true, + ['host' => 'server.net', 'user' => 'www-admin'], + ['ls', '-al', '/path1', '/path2'], + [], + [], + NULL, + ], + + [ + "ssh -t -o PasswordAuthentication=no www-admin@server.net 'cd src && ls -al /path1 /path2'", + 'src', + true, + ['host' => 'server.net', 'user' => 'www-admin'], + ['ls', '-al', '/path1', '/path2'], + [], + [], + NULL, + ], + + [ + "docker-compose exec --workdir src --user root drupal ls -al /path1 /path2", + 'src', + true, + ['docker' => ['service' => 'drupal', 'exec' => ['options' => '--user root']]], + ['ls', '-al', '/path1', '/path2'], + [], + [], + NULL, + ], + + [ + "docker-compose -p project exec --workdir src --user root drupal ls -al /path1 /path2", + 'src', + true, + ['docker' => ['service' => 'drupal', 'project' => 'project', 'exec' => ['options' => '--user root']]], + ['ls', '-al', '/path1', '/path2'], + [], + [], + NULL, + ], + + [ + "drush status '--fields=root,uri'", + false, + false, + [], + ['drush', 'status'], + ['fields' => 'root,uri'], + [], + 'LINUX', + ], + + [ + 'drush status --fields=root,uri', + false, + false, + [], + ['drush', 'status'], + ['fields' => 'root,uri'], + [], + 'WIN', + ], + + [ + "drush rsync a b -- --exclude=vendor", + false, + false, + [], + ['drush', 'rsync', 'a', 'b',], + [], + ['exclude' => 'vendor'], + NULL, + ], + + [ + "drush rsync a b -- --exclude=vendor --include=vendor/autoload.php", + false, + false, + [], + ['drush', 'rsync', 'a', 'b', '--', '--include=vendor/autoload.php'], + [], + ['exclude' => 'vendor'], + NULL, + ], + ]; + } + + /** + * Test the SiteProcess class. + * + * @dataProvider siteProcessTestValues + */ + public function testSiteProcess( + $expected, + $cd, + $useTty, + $siteAliasData, + $args, + $options, + $optionsPassedAsArgs, + $os) + { + if (Escape::isWindows() != Escape::isWindows($os)) { + $this->markTestSkipped("OS isn't supported"); + } + if ($useTty && Escape::isWindows($os)) { + $this->markTestSkipped('Windows doesn\'t have /dev/tty support'); + } + $processManager = ProcessManager::createDefault(); + $siteAlias = new SiteAlias($siteAliasData, '@alias.dev'); + $siteProcess = $processManager->siteProcess($siteAlias, $args, $options, $optionsPassedAsArgs); + $siteProcess->setTty($useTty); + // The transport handles the chdir during processArgs(). + $fallback = $siteAlias->hasRoot() ? $siteAlias->root() : null; + $siteProcess->setWorkingDirectory($cd ?: $fallback); + + $actual = $siteProcess->getCommandLine(); + $this->assertEquals($expected, $actual); + } + + /** + * Data provider for testSiteProcessJson. + */ + public function siteProcessJsonTestValues() + { + return [ + [ + 'Output is empty.', + '', + 'LINUX', + ], + [ + 'Unable to decode output into JSON.', + 'No json data here', + NULL, + ], + [ + '{"foo":"bar"}', + '{"foo":"bar"}', + NULL, + ], + [ + '{"foo":"b\'ar"}', + '{"foo":"b\'ar"}', + NULL, + ], + [ + '{"foo":"bar"}', + 'Ignored leading data {"foo":"bar"} Ignored trailing data', + NULL, + ], + [ + '["a","b","c"]', + '["a", "b", "c"]', + NULL, + ], + [ + '"string"', + '"string"', + NULL, + ], + [ + '[]', + '[]', + NULL, + ], + ]; + } + + /** + * Test the SiteProcess class. + * + * @dataProvider siteProcessJsonTestValues + */ + public function testSiteProcessJson( + $expected, + $data, + $os) + { + if (Escape::isWindows()) { + $this->markTestSkipped("Windows is not working yet. PRs welcome."); + } + $args = ['echo', $data]; + $processManager = ProcessManager::createDefault(); + $siteAlias = new SiteAlias([], '@alias.dev'); + $siteAlias->set('os', $os); + $siteProcess = $processManager->siteProcess($siteAlias, $args); + $siteProcess->mustRun(); + + try { + $actual = $siteProcess->getOutputAsJson(); + $actual = json_encode($actual, true); + } + catch (\Exception $e) { + $actual = $e->getMessage(); + } + $this->assertEquals($expected, $actual); + } +} diff --git a/vendor/consolidation/site-process/tests/Transport/DockerComposeTransportTest.php b/vendor/consolidation/site-process/tests/Transport/DockerComposeTransportTest.php new file mode 100644 index 0000000000000000000000000000000000000000..bf219a5b972b88777744cd7f717b485815f16711 --- /dev/null +++ b/vendor/consolidation/site-process/tests/Transport/DockerComposeTransportTest.php @@ -0,0 +1,74 @@ +<?php + +namespace Consolidation\SiteProcess; + +use Consolidation\SiteProcess\Transport\DockerComposeTransport; +use PHPUnit\Framework\TestCase; +use Consolidation\SiteAlias\SiteAlias; + +class DockerComposeTransportTest extends TestCase +{ + /** + * Data provider for testWrap. + */ + public function wrapTestValues() + { + return [ + [ + 'docker-compose --project project --project-directory projectDir --file myCompose.yml exec -T --user root drupal ls', + [ + 'docker' => [ + 'service' => 'drupal', + 'compose' => [ + 'options' => '--project project --project-directory projectDir --file myCompose.yml' + ], + 'exec' => ['options' => '--user root'] + ] + ], + ], + [ + 'docker-compose exec -T drupal ls', + [ + 'docker' => [ + 'service' => 'drupal', + ] + ], + ], + [ + 'docker-compose --project project2 --file myCompose.yml exec -T drupal ls', + [ + 'docker' => [ + 'service' => 'drupal', + 'project' => 'project1', + 'compose' => [ + 'options' => '--project project2 --file myCompose.yml' + ] + ] + ], + ], + [ + 'docker-compose -p project1 --file myCompose.yml exec -T drupal ls', + [ + 'docker' => [ + 'service' => 'drupal', + 'project' => 'project1', + 'compose' => [ + 'options' => '--file myCompose.yml' + ] + ] + ], + ], + ]; + } + + /** + * @dataProvider wrapTestValues + */ + public function testWrap($expected, $siteAliasData) + { + $siteAlias = new SiteAlias($siteAliasData, '@alias.dev'); + $dockerTransport = new DockerComposeTransport($siteAlias); + $actual = $dockerTransport->wrap(['ls']); + $this->assertEquals($expected, implode(' ', $actual)); + } +} diff --git a/vendor/consolidation/site-process/tests/Transport/VagrantTransportTest.php b/vendor/consolidation/site-process/tests/Transport/VagrantTransportTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c49bfd61281b3554485bfb8772c5c0b3883d50a9 --- /dev/null +++ b/vendor/consolidation/site-process/tests/Transport/VagrantTransportTest.php @@ -0,0 +1,36 @@ +<?php + +namespace Consolidation\SiteProcess; + +use Consolidation\SiteProcess\Transport\VagrantTransport; +use PHPUnit\Framework\TestCase; +use Consolidation\SiteAlias\SiteAlias; + +class VagrantTransportTest extends TestCase +{ + /** + * Data provider for testWrap. + */ + public function wrapTestValues() + { + return [ + [ + 'vagrant ssh -c ls', + [ + 'vagrant' => [] + ], + ] + ]; + } + + /** + * @dataProvider wrapTestValues + */ + public function testWrap($expected, $siteAliasData) + { + $siteAlias = new SiteAlias($siteAliasData, '@alias.dev'); + $dockerTransport = new VagrantTransport($siteAlias); + $actual = $dockerTransport->wrap(['ls']); + $this->assertEquals($expected, implode(' ', $actual)); + } +} diff --git a/vendor/consolidation/site-process/tests/src/CommandTesterInterface.php b/vendor/consolidation/site-process/tests/src/CommandTesterInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..d92fd4e83cb278db5c853be93a8420f56e0e1409 --- /dev/null +++ b/vendor/consolidation/site-process/tests/src/CommandTesterInterface.php @@ -0,0 +1,9 @@ +<?php + +namespace Consolidation\SiteProcess; + +interface CommandTesterInterface +{ + const STATUS_OK = 0; + const STATUS_ERROR = 1; +} diff --git a/vendor/consolidation/site-process/tests/src/CommandTesterTrait.php b/vendor/consolidation/site-process/tests/src/CommandTesterTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..c1a2802f26fb83a9613ed120ec0abe7049065d64 --- /dev/null +++ b/vendor/consolidation/site-process/tests/src/CommandTesterTrait.php @@ -0,0 +1,64 @@ +<?php + +namespace Consolidation\SiteProcess; + +use Symfony\Component\Console\Output\BufferedOutput; + +trait CommandTesterTrait +{ + /** @var string */ + protected $appName; + + /** @var string */ + protected $appVersion; + + /** + * Instantiate a new runner + */ + public function setupCommandTester($appName, $appVersion) + { + // Define our invariants for our test + $this->appName = $appName; + $this->appVersion = $appVersion; + } + + /** + * Prepare our $argv array; put the app name in $argv[0] followed by + * the command name and all command arguments and options. + * + * @param array $functionParameters should usually be func_get_args() + * @param int $leadingParameterCount the number of function parameters + * that are NOT part of argv. Default is 2 (expected content and + * expected status code). + */ + protected function argv($functionParameters, $leadingParameterCount = 2) + { + $argv = $functionParameters; + $argv = array_slice($argv, $leadingParameterCount); + array_unshift($argv, $this->appName); + + return $argv; + } + + /** + * Simulated front controller + */ + protected function execute($argv, $commandClasses, $configurationFile = false) + { + // Define a global output object to capture the test results + $output = new BufferedOutput(); + + // We can only call `Runner::execute()` once; then we need to tear down. + $runner = new \Robo\Runner($commandClasses); + if ($configurationFile) { + $runner->setConfigurationFilename($configurationFile); + } + $statusCode = $runner->execute($argv, $this->appName, $this->appVersion, $output); + + // Destroy our container so that we can call $runner->execute() again for the next test. + \Robo\Robo::unsetContainer(); + + // Return the output and status code. + return [trim($output->fetch()), $statusCode]; + } +} diff --git a/vendor/container-interop/container-interop/.gitignore b/vendor/container-interop/container-interop/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b2395aa05541e1e90c84bdc3ce67115c8b84c385 --- /dev/null +++ b/vendor/container-interop/container-interop/.gitignore @@ -0,0 +1,3 @@ +composer.lock +composer.phar +/vendor/ diff --git a/vendor/container-interop/container-interop/LICENSE b/vendor/container-interop/container-interop/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7671d9020f64fb337cbf723aeeb6038f4ccde56c --- /dev/null +++ b/vendor/container-interop/container-interop/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 container-interop + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/container-interop/container-interop/README.md b/vendor/container-interop/container-interop/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cdd7a44c8ee8f3da7b6b57bb4542272e9f25501b --- /dev/null +++ b/vendor/container-interop/container-interop/README.md @@ -0,0 +1,148 @@ +# Container Interoperability + +[](https://packagist.org/packages/container-interop/container-interop) +[](https://packagist.org/packages/container-interop/container-interop) + +## Deprecation warning! + +Starting Feb. 13th 2017, container-interop is officially deprecated in favor of [PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md). +Container-interop has been the test-bed of PSR-11. From v1.2, container-interop directly extends PSR-11 interfaces. +Therefore, all containers implementing container-interop are now *de-facto* compatible with PSR-11. + +- Projects implementing container-interop interfaces are encouraged to directly implement PSR-11 interfaces instead. +- Projects consuming container-interop interfaces are very strongly encouraged to directly type-hint on PSR-11 interfaces, in order to be compatible with PSR-11 containers that are not compatible with container-interop. + +Regarding the delegate lookup feature, that is present in container-interop and not in PSR-11, the feature is actually a design pattern. It is therefore not deprecated. Documentation regarding this design pattern will be migrated from this repository into a separate website in the future. + +## About + +*container-interop* tries to identify and standardize features in *container* objects (service locators, +dependency injection containers, etc.) to achieve interoperability. + +Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations. + +If PHP projects that provide container implementations begin to adopt these common standards, then PHP +applications and projects that use containers can depend on the common interfaces instead of specific +implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume +*any* container implementation that can be adapted to these interfaces. + +The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/), but it is being +worked on by members of PHP-FIG and other good developers. We adhere to the spirit and ideals of PHP-FIG, and hope +this project will pave the way for one or more future PSRs. + + +## Installation + +You can install this package through Composer: + +```json +composer require container-interop/container-interop +``` + +The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility +between minor versions. + +## Standards + +### Available + +- [`ContainerInterface`](src/Interop/Container/ContainerInterface.php). +[Description](docs/ContainerInterface.md) [Meta Document](docs/ContainerInterface-meta.md). +Describes the interface of a container that exposes methods to read its entries. +- [*Delegate lookup feature*](docs/Delegate-lookup.md). +[Meta Document](docs/Delegate-lookup-meta.md). +Describes the ability for a container to delegate the lookup of its dependencies to a third-party container. This +feature lets several containers work together in a single application. + +### Proposed + +View open [request for comments](https://github.com/container-interop/container-interop/labels/RFC) + +## Compatible projects + +### Projects implementing `ContainerInterface` + +- [Acclimate](https://github.com/jeremeamia/acclimate-container): Adapters for + Aura.Di, Laravel, Nette DI, Pimple, Symfony DI, ZF2 Service manager, ZF2 + Dependency injection and any container using `ArrayAccess` +- [Aura.Di](https://github.com/auraphp/Aura.Di) +- [auryn-container-interop](https://github.com/elazar/auryn-container-interop) +- [Burlap](https://github.com/codeeverything/burlap) +- [Chernozem](https://github.com/pyrsmk/Chernozem) +- [Data Manager](https://github.com/chrismichaels84/data-manager) +- [Disco](https://github.com/bitexpert/disco) +- [InDI](https://github.com/idealogica/indi) +- [League/Container](http://container.thephpleague.com/) +- [Mouf](http://mouf-php.com) +- [Njasm Container](https://github.com/njasm/container) +- [PHP-DI](http://php-di.org) +- [Picotainer](https://github.com/thecodingmachine/picotainer) +- [PimpleInterop](https://github.com/moufmouf/pimple-interop) +- [Pimple3-ContainerInterop](https://github.com/Sam-Burns/pimple3-containerinterop) (using Pimple v3) +- [SitePoint Container](https://github.com/sitepoint/Container) +- [Thruster Container](https://github.com/ThrusterIO/container) (PHP7 only) +- [Ultra-Lite Container](https://github.com/ultra-lite/container) +- [Unbox](https://github.com/mindplay-dk/unbox) +- [XStatic](https://github.com/jeremeamia/xstatic) +- [Zend\ServiceManager](https://github.com/zendframework/zend-servicemanager) +- [Zit](https://github.com/inxilpro/Zit) + +### Projects implementing the *delegate lookup* feature + +- [Aura.Di](https://github.com/auraphp/Aura.Di) +- [Burlap](https://github.com/codeeverything/burlap) +- [Chernozem](https://github.com/pyrsmk/Chernozem) +- [InDI](https://github.com/idealogica/indi) +- [League/Container](http://container.thephpleague.com/) +- [Mouf](http://mouf-php.com) +- [Picotainer](https://github.com/thecodingmachine/picotainer) +- [PHP-DI](http://php-di.org) +- [PimpleInterop](https://github.com/moufmouf/pimple-interop) +- [Ultra-Lite Container](https://github.com/ultra-lite/container) + +### Middlewares implementing `ContainerInterface` + +- [Alias-Container](https://github.com/thecodingmachine/alias-container): add + aliases support to any container +- [Prefixer-Container](https://github.com/thecodingmachine/prefixer-container): + dynamically prefix identifiers +- [Lazy-Container](https://github.com/snapshotpl/lazy-container): lazy services + +### Projects using `ContainerInterface` + +The list below contains only a sample of all the projects consuming `ContainerInterface`. For a more complete list have a look [here](http://packanalyst.com/class?q=Interop%5CContainer%5CContainerInterface). + +| | Downloads | +| --- | --- | +| [Adroit](https://github.com/bitexpert/adroit) |  | +| [Behat](https://github.com/Behat/Behat/pull/974) |  | +| [blast-facades](https://github.com/phpthinktank/blast-facades): Minimize complexity and represent dependencies as facades. |  | +| [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di): an extension to [Silex](http://silex.sensiolabs.org/) that adds support for any *container-interop* compatible container |  | +| [mindplay/walkway](https://github.com/mindplay-dk/walkway): a modular request router |  | +| [mindplay/middleman](https://github.com/mindplay-dk/middleman): minimalist PSR-7 middleware dispatcher |  | +| [PHP-DI/Invoker](https://github.com/PHP-DI/Invoker): extensible and configurable invoker/dispatcher |  | +| [Prophiler](https://github.com/fabfuel/prophiler) |  | +| [Silly](https://github.com/mnapoli/silly): CLI micro-framework |  | +| [Slim v3](https://github.com/slimphp/Slim) |  | +| [Splash](http://mouf-php.com/packages/mouf/mvc.splash-common/version/8.0-dev/README.md) |  | +| [Woohoo Labs. Harmony](https://github.com/woohoolabs/harmony): a flexible micro-framework |  | +| [zend-expressive](https://github.com/zendframework/zend-expressive) |  | + + +## Workflow + +Everyone is welcome to join and contribute. + +The general workflow looks like this: + +1. Someone opens a discussion (GitHub issue) to suggest an interface +1. Feedback is gathered +1. The interface is added to a development branch +1. We release alpha versions so that the interface can be experimented with +1. Discussions and edits ensue until the interface is deemed stable by a general consensus +1. A new minor version of the package is released + +We try to not break BC by creating new interfaces instead of editing existing ones. + +While we currently work on interfaces, we are open to anything that might help towards interoperability, may that +be code, best practices, etc. diff --git a/vendor/container-interop/container-interop/composer.json b/vendor/container-interop/container-interop/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..855f766723a07230761813b80e9c843efb2acb81 --- /dev/null +++ b/vendor/container-interop/container-interop/composer.json @@ -0,0 +1,15 @@ +{ + "name": "container-interop/container-interop", + "type": "library", + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "license": "MIT", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "require": { + "psr/container": "^1.0" + } +} diff --git a/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md b/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md new file mode 100644 index 0000000000000000000000000000000000000000..59f3d5599faf8a035dee448b0df230719cc61444 --- /dev/null +++ b/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md @@ -0,0 +1,114 @@ +# ContainerInterface Meta Document + +## Introduction + +This document describes the process and discussions that lead to the `ContainerInterface`. +Its goal is to explain the reasons behind each decision. + +## Goal + +The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a +container to obtain objects and parameters. + +By standardizing such a behavior, frameworks and libraries using the `ContainerInterface` +could work with any compatible container. +That would allow end users to choose their own container based on their own preferences. + +It is important to distinguish the two usages of a container: + +- configuring entries +- fetching entries + +Most of the time, those two sides are not used by the same party. +While it is often end users who tend to configure entries, it is generally the framework that fetch +entries to build the application. + +This is why this interface focuses only on how entries can be fetched from a container. + +## Interface name + +The interface name has been thoroughly discussed and was decided by a vote. + +The list of options considered with their respective votes are: + +- `ContainerInterface`: +8 +- `ProviderInterface`: +2 +- `LocatorInterface`: 0 +- `ReadableContainerInterface`: -5 +- `ServiceLocatorInterface`: -6 +- `ObjectFactory`: -6 +- `ObjectStore`: -8 +- `ConsumerInterface`: -9 + +[Full results of the vote](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote) + +The complete discussion can be read in [the issue #1](https://github.com/container-interop/container-interop/issues/1). + +## Interface methods + +The choice of which methods the interface would contain was made after a statistical analysis of existing containers. +The results of this analysis are available [in this document](https://gist.github.com/mnapoli/6159681). + +The summary of the analysis showed that: + +- all containers offer a method to get an entry by its id +- a large majority name such method `get()` +- for all containers, the `get()` method has 1 mandatory parameter of type string +- some containers have an optional additional argument for `get()`, but it doesn't have the same purpose between containers +- a large majority of the containers offer a method to test if it can return an entry by its id +- a majority name such method `has()` +- for all containers offering `has()`, the method has exactly 1 parameter of type string +- a large majority of the containers throw an exception rather than returning null when an entry is not found in `get()` +- a large majority of the containers don't implement `ArrayAccess` + +The question of whether to include methods to define entries has been discussed in +[issue #1](https://github.com/container-interop/container-interop/issues/1). +It has been judged that such methods do not belong in the interface described here because it is out of its scope +(see the "Goal" section). + +As a result, the `ContainerInterface` contains two methods: + +- `get()`, returning anything, with one mandatory string parameter. Should throw an exception if the entry is not found. +- `has()`, returning a boolean, with one mandatory string parameter. + +### Number of parameters in `get()` method + +While `ContainerInterface` only defines one mandatory parameter in `get()`, it is not incompatible with +existing containers that have additional optional parameters. PHP allows an implementation to offer more parameters +as long as they are optional, because the implementation *does* satisfy the interface. + +This issue has been discussed in [issue #6](https://github.com/container-interop/container-interop/issues/6). + +### Type of the `$id` parameter + +The type of the `$id` parameter in `get()` and `has()` has been discussed in +[issue #6](https://github.com/container-interop/container-interop/issues/6). +While `string` is used in all the containers that were analyzed, it was suggested that allowing +anything (such as objects) could allow containers to offer a more advanced query API. + +An example given was to use the container as an object builder. The `$id` parameter would then be an +object that would describe how to create an instance. + +The conclusion of the discussion was that this was beyond the scope of getting entries from a container without +knowing how the container provided them, and it was more fit for a factory. + +## Contributors + +Are listed here all people that contributed in the discussions or votes, by alphabetical order: + +- [Amy Stephen](https://github.com/AmyStephen) +- [David Négrier](https://github.com/moufmouf) +- [Don Gilbert](https://github.com/dongilbert) +- [Jason Judge](https://github.com/judgej) +- [Jeremy Lindblom](https://github.com/jeremeamia) +- [Marco Pivetta](https://github.com/Ocramius) +- [Matthieu Napoli](https://github.com/mnapoli) +- [Paul M. Jones](https://github.com/pmjones) +- [Stephan Hochdörfer](https://github.com/shochdoerfer) +- [Taylor Otwell](https://github.com/taylorotwell) + +## Relevant links + +- [`ContainerInterface.php`](https://github.com/container-interop/container-interop/blob/master/src/Interop/Container/ContainerInterface.php) +- [List of all issues](https://github.com/container-interop/container-interop/issues?labels=ContainerInterface&milestone=&page=1&state=closed) +- [Vote for the interface name](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote) diff --git a/vendor/container-interop/container-interop/docs/ContainerInterface.md b/vendor/container-interop/container-interop/docs/ContainerInterface.md new file mode 100644 index 0000000000000000000000000000000000000000..bda973d6fce146745741f07beb07b40ba4b88076 --- /dev/null +++ b/vendor/container-interop/container-interop/docs/ContainerInterface.md @@ -0,0 +1,158 @@ +Container interface +=================== + +This document describes a common interface for dependency injection containers. + +The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a +container to obtain objects and parameters (called *entries* in the rest of this document). + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", +"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be +interpreted as described in [RFC 2119][]. + +The word `implementor` in this document is to be interpreted as someone +implementing the `ContainerInterface` in a dependency injection-related library or framework. +Users of dependency injections containers (DIC) are referred to as `user`. + +[RFC 2119]: http://tools.ietf.org/html/rfc2119 + +1. Specification +----------------- + +### 1.1 Basics + +- The `Interop\Container\ContainerInterface` exposes two methods : `get` and `has`. + +- `get` takes one mandatory parameter: an entry identifier. It MUST be a string. + A call to `get` can return anything (a *mixed* value), or throws an exception if the identifier + is not known to the container. Two successive calls to `get` with the same + identifier SHOULD return the same value. However, depending on the `implementor` + design and/or `user` configuration, different values might be returned, so + `user` SHOULD NOT rely on getting the same value on 2 successive calls. + While `ContainerInterface` only defines one mandatory parameter in `get()`, implementations + MAY accept additional optional parameters. + +- `has` takes one unique parameter: an entry identifier. It MUST return `true` + if an entry identifier is known to the container and `false` if it is not. + `has($id)` returning true does not mean that `get($id)` will not throw an exception. + It does however mean that `get($id)` will not throw a `NotFoundException`. + +### 1.2 Exceptions + +Exceptions directly thrown by the container MUST implement the +[`Interop\Container\Exception\ContainerException`](../src/Interop/Container/Exception/ContainerException.php). + +A call to the `get` method with a non-existing id SHOULD throw a +[`Interop\Container\Exception\NotFoundException`](../src/Interop/Container/Exception/NotFoundException.php). + +### 1.3 Additional features + +This section describes additional features that MAY be added to a container. Containers are not +required to implement these features to respect the ContainerInterface. + +#### 1.3.1 Delegate lookup feature + +The goal of the *delegate lookup* feature is to allow several containers to share entries. +Containers implementing this feature can perform dependency lookups in other containers. + +Containers implementing this feature will offer a greater lever of interoperability +with other containers. Implementation of this feature is therefore RECOMMENDED. + +A container implementing this feature: + +- MUST implement the `ContainerInterface` +- MUST provide a way to register a delegate container (using a constructor parameter, or a setter, + or any possible way). The delegate container MUST implement the `ContainerInterface`. + +When a container is configured to use a delegate container for dependencies: + +- Calls to the `get` method should only return an entry if the entry is part of the container. + If the entry is not part of the container, an exception should be thrown + (as requested by the `ContainerInterface`). +- Calls to the `has` method should only return `true` if the entry is part of the container. + If the entry is not part of the container, `false` should be returned. +- If the fetched entry has dependencies, **instead** of performing + the dependency lookup in the container, the lookup is performed on the *delegate container*. + +Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself. + +It is however allowed for containers to provide exception cases for special entries, and a way to lookup +into the same container (or another container) instead of the delegate container. + +2. Package +---------- + +The interfaces and classes described as well as relevant exception are provided as part of the +[container-interop/container-interop](https://packagist.org/packages/container-interop/container-interop) package. + +3. `Interop\Container\ContainerInterface` +----------------------------------------- + +```php +<?php +namespace Interop\Container; + +use Interop\Container\Exception\ContainerException; +use Interop\Container\Exception\NotFoundException; + +/** + * Describes the interface of a container that exposes methods to read its entries. + */ +interface ContainerInterface +{ + /** + * Finds an entry of the container by its identifier and returns it. + * + * @param string $id Identifier of the entry to look for. + * + * @throws NotFoundException No entry was found for this identifier. + * @throws ContainerException Error while retrieving the entry. + * + * @return mixed Entry. + */ + public function get($id); + + /** + * Returns true if the container can return an entry for the given identifier. + * Returns false otherwise. + * + * `has($id)` returning true does not mean that `get($id)` will not throw an exception. + * It does however mean that `get($id)` will not throw a `NotFoundException`. + * + * @param string $id Identifier of the entry to look for. + * + * @return boolean + */ + public function has($id); +} +``` + +4. `Interop\Container\Exception\ContainerException` +--------------------------------------------------- + +```php +<?php +namespace Interop\Container\Exception; + +/** + * Base interface representing a generic exception in a container. + */ +interface ContainerException +{ +} +``` + +5. `Interop\Container\Exception\NotFoundException` +--------------------------------------------------- + +```php +<?php +namespace Interop\Container\Exception; + +/** + * No entry was found in the container. + */ +interface NotFoundException extends ContainerException +{ +} +``` diff --git a/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md b/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md new file mode 100644 index 0000000000000000000000000000000000000000..6048b73e290e31e5e9ce49a82f9b9c306944a85d --- /dev/null +++ b/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md @@ -0,0 +1,259 @@ +Delegate lookup feature Meta Document +===================================== + +1. Summary +---------- + +This document describes the *delegate lookup feature*. +Containers are not required to implement this feature to respect the `ContainerInterface`. +However, containers implementing this feature will offer a greater lever of interoperability +with other containers, allowing multiple containers to share entries in the same application. +Implementation of this feature is therefore recommanded. + +2. Why Bother? +-------------- + +The [`ContainerInterface`](../src/Interop/Container/ContainerInterface.php) ([meta doc](ContainerInterface.md)) +standardizes how frameworks and libraries make use of a container to obtain objects and parameters. + +By standardizing such a behavior, frameworks and libraries relying on the `ContainerInterface` +could work with any compatible container. +That would allow end users to choose their own container based on their own preferences. + +The `ContainerInterface` is also enough if we want to have several containers side-by-side in the same +application. For instance, this is what the [CompositeContainer](https://github.com/jeremeamia/acclimate-container/blob/master/src/CompositeContainer.php) +class of [Acclimate](https://github.com/jeremeamia/acclimate-container) is designed for: + + + +However, an instance in container 1 cannot reference an instance in container 2. + +It would be better if an instance of container 1 could reference an instance in container 2, +and the opposite should be true. + + + +In the sample above, entry 1 in container 1 is referencing entry 3 in container 2. + +3. Scope +-------- + +### 3.1 Goals + +The goal of the *delegate lookup* feature is to allow several containers to share entries. + +4. Approaches +------------- + +### 4.1 Chosen Approach + +Containers implementing this feature can perform dependency lookups in other containers. + +A container implementing this feature: + +- must implement the `ContainerInterface` +- must provide a way to register a *delegate container* (using a constructor parameter, or a setter, or any +possible way). The *delegate container* must implement the `ContainerInterface`. + +When a *delegate container* is configured on a container: + +- Calls to the `get` method should only return an entry if the entry is part of the container. +If the entry is not part of the container, an exception should be thrown (as required in the `ContainerInterface`). +- Calls to the `has` method should only return *true* if the entry is part of the container. +If the entry is not part of the container, *false* should be returned. + - Finally, the important part: if the entry we are fetching has dependencies, +**instead** of perfoming the dependency lookup in the container, the lookup is performed on the *delegate container*. + +Important! By default, the lookup should be performed on the delegate container **only**, not on the container itself. + +It is however allowed for containers to provide exception cases for special entries, and a way to lookup into +the same container (or another container) instead of the delegate container. + +### 4.2 Typical usage + +The *delegate container* will usually be a composite container. A composite container is a container that +contains several other containers. When performing a lookup on a composite container, the inner containers are +queried until one container returns an entry. +An inner container implementing the *delegate lookup feature* will return entries it contains, but if these +entries have dependencies, the dependencies lookup calls will be performed on the composite container, giving +a chance to all containers to answer. + +Interestingly enough, the order in which containers are added in the composite container matters. Indeed, +the first containers to be added in the composite container can "override" the entries of containers with +lower priority. + + + +In the example above, "container 2" contains a controller "myController" and the controller is referencing an +"entityManager" entry. "Container 1" contains also an entry named "entityManager". +Without the *delegate lookup* feature, when requesting the "myController" instance to container 2, it would take +in charge the instanciation of both entries. + +However, using the *delegate lookup* feature, here is what happens when we ask the composite container for the +"myController" instance: + +- The composite container asks container 1 if if contains the "myController" instance. The answer is no. +- The composite container asks container 2 if if contains the "myController" instance. The answer is yes. +- The composite container performs a `get` call on container 2 for the "myController" instance. +- Container 2 sees that "myController" has a dependency on "entityManager". +- Container 2 delegates the lookup of "entityManager" to the composite container. +- The composite container asks container 1 if if contains the "entityManager" instance. The answer is yes. +- The composite container performs a `get` call on container 1 for the "entityManager" instance. + +In the end, we get a controller instanciated by container 2 that references an entityManager instanciated +by container 1. + +### 4.3 Alternative: the fallback strategy + +The first proposed approach we tried was to perform all the lookups in the "local" container, +and if a lookup fails in the container, to use the delegate container. In this scenario, the +delegate container is used in "fallback" mode. + +This strategy has been described in @moufmouf blog post: http://mouf-php.com/container-interop-whats-next (solution 1). +It was also discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-33570697) and +[here](https://github.com/container-interop/container-interop/pull/20#issuecomment-56599631). + +Problems with this strategy: + +- Heavy problem regarding infinite loops +- Unable to overload a container entry with the delegate container entry + +### 4.4 Alternative: force implementing an interface + +The first proposed approach was to develop a `ParentAwareContainerInterface` interface. +It was proposed here: https://github.com/container-interop/container-interop/pull/8 + +The interface would have had the behaviour of the delegate lookup feature but would have forced the addition of +a `setParentContainter` method: + +```php +interface ParentAwareContainerInterface extends ReadableContainerInterface { + /** + * Sets the parent container associated to that container. This container will call + * the parent container to fetch dependencies. + * + * @param ContainerInterface $container + */ + public function setParentContainer(ContainerInterface $container); +} +``` + +The interface idea was first questioned by @Ocramius [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777). +@Ocramius expressed the idea that an interface should not contain setters, otherwise, it is forcing implementation +details on the class implementing the interface. +Then @mnapoli made a proposal for a "convention" [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51841079), +this idea was further discussed until all participants in the discussion agreed to remove the interface idea +and replace it with a "standard" feature. + +**Pros:** + +If we had had an interface, we could have delegated the registration of the delegate/composite container to the +the delegate/composite container itself. +For instance: + +```php +$containerA = new ContainerA(); +$containerB = new ContainerB(); + +$compositeContainer = new CompositeContainer([$containerA, $containerB]); + +// The call to 'setParentContainer' is delegated to the CompositeContainer +// It is not the responsibility of the user anymore. +class CompositeContainer { + ... + + public function __construct($containers) { + foreach ($containers as $container) { + if ($container instanceof ParentAwareContainerInterface) { + $container->setParentContainer($this); + } + } + ... + } +} + +``` + +**Cons:** + +Cons have been extensively discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777). +Basically, forcing a setter into an interface is a bad idea. Setters are similar to constructor arguments, +and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweights the benefits of the interface. + +### 4.4 Alternative: no exception case for delegate lookups + +Originally, the proposed wording for delegate lookup calls was: + +> Important! The lookup MUST be performed on the delegate container **only**, not on the container itself. + +This was later replaced by: + +> Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself. +> +> It is however allowed for containers to provide exception cases for special entries, and a way to lookup +> into the same container (or another container) instead of the delegate container. + +Exception cases have been allowed to avoid breaking dependencies with some services that must be provided +by the container (on @njasm proposal). This was proposed here: https://github.com/container-interop/container-interop/pull/20#issuecomment-56597235 + +### 4.5 Alternative: having one of the containers act as the composite container + +In real-life scenarios, we usually have a big framework (Symfony 2, Zend Framework 2, etc...) and we want to +add another DI container to this container. Most of the time, the "big" framework will be responsible for +creating the controller's instances, using it's own DI container. Until *container-interop* is fully adopted, +the "big" framework will not be aware of the existence of a composite container that it should use instead +of its own container. + +For this real-life use cases, @mnapoli and @moufmouf proposed to extend the "big" framework's DI container +to make it act as a composite container. + +This has been discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-40367194) +and [here](http://mouf-php.com/container-interop-whats-next#solution4). + +This was implemented in Symfony 2 using: + +- [interop.symfony.di](https://github.com/thecodingmachine/interop.symfony.di/tree/v0.1.0) +- [framework interop](https://github.com/mnapoli/framework-interop/) + +This was implemented in Silex using: + +- [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di) + +Having a container act as the composite container is not part of the delegate lookup standard because it is +simply a temporary design pattern used to make existing frameworks that do not support yet ContainerInterop +play nice with other DI containers. + + +5. Implementations +------------------ + +The following projects already implement the delegate lookup feature: + +- [Mouf](http://mouf-php.com), through the [`setDelegateLookupContainer` method](https://github.com/thecodingmachine/mouf/blob/2.0/src/Mouf/MoufManager.php#L2120) +- [PHP-DI](http://php-di.org/), through the [`$wrapperContainer` parameter of the constructor](https://github.com/mnapoli/PHP-DI/blob/master/src/DI/Container.php#L72) +- [pimple-interop](https://github.com/moufmouf/pimple-interop), through the [`$container` parameter of the constructor](https://github.com/moufmouf/pimple-interop/blob/master/src/Interop/Container/Pimple/PimpleInterop.php#L62) + +6. People +--------- + +Are listed here all people that contributed in the discussions, by alphabetical order: + +- [Alexandru Pătrănescu](https://github.com/drealecs) +- [Ben Peachey](https://github.com/potherca) +- [David Négrier](https://github.com/moufmouf) +- [Jeremy Lindblom](https://github.com/jeremeamia) +- [Marco Pivetta](https://github.com/Ocramius) +- [Matthieu Napoli](https://github.com/mnapoli) +- [Nelson J Morais](https://github.com/njasm) +- [Phil Sturgeon](https://github.com/philsturgeon) +- [Stephan Hochdörfer](https://github.com/shochdoerfer) + +7. Relevant Links +----------------- + +_**Note:** Order descending chronologically._ + +- [Pull request on the delegate lookup feature](https://github.com/container-interop/container-interop/pull/20) +- [Pull request on the interface idea](https://github.com/container-interop/container-interop/pull/8) +- [Original article exposing the delegate lookup idea along many others](http://mouf-php.com/container-interop-whats-next) + diff --git a/vendor/container-interop/container-interop/docs/Delegate-lookup.md b/vendor/container-interop/container-interop/docs/Delegate-lookup.md new file mode 100644 index 0000000000000000000000000000000000000000..f64a8f785a84d2573ebc23a137f92360a07098a2 --- /dev/null +++ b/vendor/container-interop/container-interop/docs/Delegate-lookup.md @@ -0,0 +1,60 @@ +Delegate lookup feature +======================= + +This document describes a standard for dependency injection containers. + +The goal set by the *delegate lookup* feature is to allow several containers to share entries. +Containers implementing this feature can perform dependency lookups in other containers. + +Containers implementing this feature will offer a greater lever of interoperability +with other containers. Implementation of this feature is therefore RECOMMENDED. + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", +"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be +interpreted as described in [RFC 2119][]. + +The word `implementor` in this document is to be interpreted as someone +implementing the delegate lookup feature in a dependency injection-related library or framework. +Users of dependency injections containers (DIC) are referred to as `user`. + +[RFC 2119]: http://tools.ietf.org/html/rfc2119 + +1. Vocabulary +------------- + +In a dependency injection container, the container is used to fetch entries. +Entries can have dependencies on other entries. Usually, these other entries are fetched by the container. + +The *delegate lookup* feature is the ability for a container to fetch dependencies in +another container. In the rest of the document, the word "container" will reference the container +implemented by the implementor. The word "delegate container" will reference the container we are +fetching the dependencies from. + +2. Specification +---------------- + +A container implementing the *delegate lookup* feature: + +- MUST implement the [`ContainerInterface`](ContainerInterface.md) +- MUST provide a way to register a delegate container (using a constructor parameter, or a setter, + or any possible way). The delegate container MUST implement the [`ContainerInterface`](ContainerInterface.md). + +When a container is configured to use a delegate container for dependencies: + +- Calls to the `get` method should only return an entry if the entry is part of the container. + If the entry is not part of the container, an exception should be thrown + (as requested by the [`ContainerInterface`](ContainerInterface.md)). +- Calls to the `has` method should only return `true` if the entry is part of the container. + If the entry is not part of the container, `false` should be returned. +- If the fetched entry has dependencies, **instead** of performing + the dependency lookup in the container, the lookup is performed on the *delegate container*. + +Important: By default, the dependency lookups SHOULD be performed on the delegate container **only**, not on the container itself. + +It is however allowed for containers to provide exception cases for special entries, and a way to lookup +into the same container (or another container) instead of the delegate container. + +3. Package / Interface +---------------------- + +This feature is not tied to any code, interface or package. diff --git a/vendor/container-interop/container-interop/docs/images/interoperating_containers.png b/vendor/container-interop/container-interop/docs/images/interoperating_containers.png new file mode 100644 index 0000000000000000000000000000000000000000..1d3fdd0ddbea28d77c08cfb65834ec11357be5fb --- /dev/null +++ b/vendor/container-interop/container-interop/docs/images/interoperating_containers.png @@ -0,0 +1,86 @@ +�PNG + +��� IHDR��[��$�����y2��dQIDATx�Ձ����à�K�"%��ʈ�`D�0"����F�#����`D�0"�8{��W�p��z�6�m۶m�a��Nj�uTĶ7��;oϻg�luw��s�q��ff�����"����I�ώ���4=���E��(55|�Ѕ~��߹#��=��C�7>7 +��Z���_PD�5��R�Xo/������-4E������}��_�=�7nhjhP��y����}�O��y�F�@��(�f�y�?�WS}}����Ľ����CC̏vwK�ϊ�mnjR�E��[_�Wgτ.Zw�B��fd'Ļ��^��ftx�l�`��̊�v�f����;������e�U�("�I��/��X/�[��Ξ�Mr����U�*ss-��423ͦ�ݲ�⬩��2۴����Cp���M눏t���]���;x�ܗ�O}y����P[�("`o�42�����iS����\4@�i��˖>;vT��!(H�"M�j����WgN���n��� uu +���]*NM��*�S_U��H�Ǐ��ݍ��\��g�������չ��X�����գ�����Lo���e�xQ��b�3��f�p�ʭ �. d>n.LfG("`� +>|P�A��i�+#���^���i�����}����{q�,��f}-�B+�"V�.(s�w�n���[ +W���,y��'�~y����H�}��͑7�>��4��(�"�`���l)����B�l��������'�է��Ç*��@�. �%\���k��˗���<?qL{MI[���.L�����0��N�gG�tY!��Z;���Ed���=�ݻZ �qce��u����E��]=J��;���Ed�ï�̚������� +V ���kcG�wQ[_����)�E�NNN1vD�]-GT�mu�ƴ�w��5�(" �+�;;��A9t��B�İ09��������PS������<n��� /�[���/�1����n("�V���F����J��=�~~@���T����99��eFGז�)�"?�Pn��&��>�z�#��{�a"�}�g���6��ټ��ki衈@�W?=�Mv%'+���O��|"PD��4����;9|�B�?(3&Z�,���N�pu��/_��E��"/����^���i�9fԣV�<��(�<����pi'@�U��o�qhx玪��oq�vɢ<~S&��?PD���)�f/��yù3��'����.Q���(�"/N�Ў{�����4鯡�h��a�ygN�+/W�|��N� 7��P���𥋍��"raS#GY� ��d��s�E��z�'��u���/B� +ljhP:��(L��Eѽ�� ���E�Ҍto���7Ǝ���}���^C ��M���k'�O^=���]���O�WOYPE��*JI��>�^�=�:��3y�iWk��9�٬&�"Zr�U�}�� �?z��#_x5p_(��#�rN����NƊ5�"º���}�×gN�� +�E�Ҍe������.��("��IN(�{PD�À��s������E��G�Za��{;�s����xy�y#V,k��U��"�Q��ͮ �=���F� ���ݺ����%�WF�--U�5�y�:��{��;E�bc�������$&*XZ�r�y����L]�"�+�I��Ӧ$E�+�j�efx������ب:(" SR�kswۖ�Ύ�"�2L�-��E��=���&*��abu�("���)�n1L�)����K�&*PD�\��=��D��ώs38��2o./��"��y+��Vs��m���I��);>N6�����K��7nh�0zPD�Miz�GwW�(9��pkú�"ؔ��Oݻ������P������6��q�6�tqЀ&�Q6E�T +�?W&�8q�Ơ��c2Sj~���`���d�C�{Z@��d�P���o�d^I��j4��-S�w�n)LN�~(PD��O��j9�'3&Z6+�Ç����&PD�)��S�"F�]��Q����=yb>@,LJR:�"�֯5 r�(JIa���PD���]Z�S�:PDp]������ÇJ��PD����B� �@�5�Ԋ��t�E*ss#V,��j��S�@�O-MM噙q/��~M�����}P`��+��� +�����(�N[�`�v�"J�8�8x���J�>�˯��m�M�L�睂"���Φ">ڻ�A�K栈���ѳ�������{c��Ø8E�&NA��SPD�`���8E�&NAaQ��1�^�<����O�fEGsTE����'�r��9gǤ�H�u����3�H��^v������RWQ��=I�}K85��9���Z�"B����hE_�T:c�������_@�O�kD��Q���CCCw�ر}���#G��ٳ��'�3�����`����?[�N���AG�QC���m◍E�mݺ�����ӧF�ъ������ٻ�6�(㳻�(_��M1�1�ْ�㔙�����u$,cr��� (3�U�b@7��=(����+�q?�y�����q ��n����V�����&99M����������۹s��۷묈4�>�O�p!4�FovE\��K�"� l���2dȉ'***j��;v���tha�zŠ��~�"�V��'N<u��b�Q�$�B���!ў�H��8J]�n]iii �����'�ҟQ�@��PTTt�̙����/�I���!������"��p�\��=A��"��~���L���"���L��`4��⋲���)"�!����f�E�KH ����2�L?���&E�L��,��3�6�����/TD���X!'..����(v���ʕ+�Y���b�r���� җ��h#j����ܹso��E�w�N�#�"�����8���@�@H㘘B��k�+�I��|��7/ �K��t��f�������r4<O��1�W^�t�ң���@�qt�\��� QQ؍�<x��"b@�ٸѦ���NI� 0���\�x�i�i"��G��9��"H�LOKJJ���BQ�$����c�� +����D�M�6����.�Y���V��.��}����EE�D6��*��RO��ӯ��:D�����V�=,f.�L[�zu�"�ر�D$��&���*qVv��D����;D.\H"������m4��Ub�RI���`�(�A�0�u���.�A�6F� �K�R9�ή]�v���j�Y,���у�����s8EEE��'�b��k���y�����S�ѐp61���UbV\,G�Y6�-D۷oO�EZA��orlt���m��h�Z� ��_^^^Q�_~�x<<[GRS�N�}���c��z=�&���43]��G��_-,,T(�>�4iRii����- g���*�5�AA�Y&�)D322��iLL��'P������eee���߹s�9s-Z$I}��˗�K'�7o���X�"&&���꒒�7n�\���<x?`���s�Υ�O>����~�5jD�}��9B��-Z�<���e�ϻr����x� +��W��6m��8���4DY���MI���S���<�}�vz�>}������Ы�{�'�R��H�����?��֭[�[�~��Чy�ݻwϜ9C[���z����o�S�j?>�o�$ItԣgE� <��T*y�H����-DY��@�E.b��TR�����A���z��>|�LII���}���ܹ��s�R����{��,I0<�m{��m۞iw�m۶m�j�m�.�،ͨ�q��<�*W�W�*+�l�'Q�-���L3������7�p��f�-�:�l���B���pn��m�)�Xe�U6�l�%�\2hT�j���B��)�.��"9�=J��=>Z�*�F��J�Ҷ袋�?W��L���o=1�`���ݻ�s���sW+�[c�5LEmh�ݦ�v��cKYS�.r�TxĈ�v�m[l�R�0���/o ��k����ܾ[|��X� �_�0���Q��.�����Д��]�8���~�J�*�-�xq�i����C��I�F�q�/��r��T��c�=V�� +�駟N>��!C�dU����u�] �Q��EU7HK��F T-�_�~�L�!��v[��T��K/��jȂr�%���R��.�,pE��m��n���Cb����W_=f�y�k��ր�� +��32=��3F���.��b�(�>���c<0�i��6p�����À�K.1�X +G�r�9����7���3�d�r�o����{�*Ϗ��W*�g�qF`2e��f�,��"�)V^yen<�c|�����X`��:L��{��f��k��S*��ڻgqrN���UTS/<ꨣ��^�QY��S��h�����E,�������;S���_=����\q�.*[�#/o����#o���&7>���xO!k~�o����� D�#�<2�8餓��H/l�x�K/�t�>}���$�����/��r8�駟Zl��s�=����c��n� 9x�SN9�y�QTX�{�;���&֣vLEm� +�Vk���m��Z���z?�� z�`:��~�O�va��O>qѓ� +�lS�xs��V�VXaذa�j�v�m��\�uS�Ώ��#�<2x�`+�"|�a�� �`1;��[�)X�b�D��N���m>���x�9�d,�b�J��Y�D�2շw�^=:aE���^�8/�ؼ"��b�����/���� ��v�Z�����s�%�ӝw�9�,8���ˮd�Dt�#�=��ҥK��`���x(��C 9L�(h�QB��9��b!9c �~��_�K#8�D%�F�ބ@^^ȸ�^{و��&�����o��#GfY����J"Bz�����$b��1,�P�r��O<��f(��T,�-�3Llg���>�`ID+�z��x kX17n�,�o�i +�'���w_�CIDS�=֦je�*��UzN?]��-�P�t����뼘:Y"�0"�N��lz����.�'��H�����E`H���D�MucQ�J�/,4���nJ=jn|T?�s�FD`�������䂤T�DDZɬzP�,�,?�ah��(b�<A=�6��,%}2�J���:^��Dd�U��4*�hׄ�����:U�ъR�劢F+ +=���~;�(L��{�At�2yQ��[YX��J[e�9�H"�?�\��� +�+����z%���|�M>�w��e��)A��rh�{Q�-�T�"���,o�I)D�H""DYW���+ԉ�~�?+y9۩��j6ȈW��D)K�W��ƕ�,#�ii{Q=����H�b��ѣ��i�Fɀ�ڒ��/Ֆ�d��!�h��@�챯 �Z!�a�c<�Hk���c�&D̏!Z���(��@G�0�X�.M���E"��R��J�d��H"����p� +�O�^�&���Kc�?�à��sυ�։�:ths"�,HMQtB G˩ѭ[��������c.�d����x�ܕ�2-Q#����Qs{)� �����fTa��F��bJm��H���I��.0[#�O��ꫯJ7'��*�_h���^�D�)��V�d��+t�MU�FS}�Ѿ�J�*��U�Y��%�8��u��<�&˟6���1Cp6�>�l`�Ɯv'��"*��(e~G��BK +�K2YE)�n����b�+-Q&P��N��Ab~Q�u�|�Imb=t�v�zM�,���2͉��k��ؚ1�J8�7�Iף�j���V��'S�-�!×�/MQ�X������8�j�������8���O�Jr���&Ɍp��t�{��F"�ZKXb���V�[�NE+ 5$H]oT>����M��?3wG+���6�l�$zv�/Nsj�{K)�����^�ͪ��2���V�f�wS�l;�v�]w�A�]�X�J%b��������FUw�q�S��~���<��U��n�3����_~뭷���D����0��D���˓�N����xj�R#��k{wZn����{[���.B��}C�ת�6ҕ)��a��5^����J��C�����w��Fн<���(�J��O�D�0����0���Vf�K�hm#�d4�0�<��hg"V�R�X���'�]�S�҇.q��A��U��y��\p�(&�I�+�G��~�9�&n �����y�f6Z�~_jhK�?H��Fm�u�]���`y�Z��>��4�8�`�ؚʥ���DH +�N=��N�&cZW��������^pd�8�GmQ���#�qj32�,j��]�D$�ԌFp�_�8)��w�`s�j��ND���]u\��0��G2�9�=�X�J%b�Ug��SM�!U��D<J�4�P��L �d[������,Sg��l>"��$O�w�E>�3�8�$"�/O��9\�S4�p�KR�1cƸ=��]� �����ңL#�I�D4���e0�;~��pJ����������B&����Ӎ -�:;�� ;�ڞB�cd����(Ϯ8���G ���Ba�N����,`Z�ɐ-���M���$�-/��Ə�"���d0S�SZ�4����GS9�a*#�k�T�R�Xe�I'�2����9�s����F`��^w�1�$�?Z_���̈́��Gp�i�_��׳�,��v{ܚ�ơ���8˲�x�]w�t:�j�z���̆�c���� hN��P�ȄAZ_r(�b:�A%T�l6����뺴�4�$�Ǣ�|�4�Z�Z����K��R�HE3o�~�A"��Q�f�I�j4�UUIRX�ڱwJ��p��S۶�vm�-k۶�.}�U����wr~���'�k�KR��>�"��R?] B-_�5��f0�-�z/� ot��A�u��w's���U("t�"��c��u�V}��?-4 +PD@ϜN�����lH�^NMM��Sf�B��4+~>m8)��j��)"�(*�r=M�z�mc��"������`RD�k("�(�\��F��{=��J�]*�҆k��b&��JZ�L�Њ�3�eܔ"��Z>�3m��l��p E�^��K���Zu[.� �~P�n{� �< �&�H�Oe���iofL{=c��zM��q����1�r�xPD���ph��V�����@U�&��E\�N �?ns6-�r[�J����У���,�HX��q�ӆg���� ���t�V�E�x=��3 +a1���@)"t�Z�-�b"��(�������Q��Ed��ڀ��iC����.ϗ_o���@�]�/�x�Q����������PD5-O�e���@մ5��E\�L��ETӾR� k��"�={������nGϳ�m�6�ضmն�x��I�������w_�L��9���~���h����;9WC�~�ӈ�N��@0��`0hį�����300��ѣ<��y��s�ڥ�,���Q7ΜA �?���AAA+W�>|8W4�/����KL8������d�|A#.]�4##C,+�0o5 +�� 22|�inn>uꔉ�Ʉ 8���}�������k�-�Z8?oͪ��6d2��][XX��1����Q�F ���C%|h�ys�3M 2Q�/hĹs��x<n���TUUm۶mĈ��۾`��ڙ�`݈��ܑI��DU�����:;;�r97 �`�M||<k�!�`�1�Ԯ)݈%G������J|A#����ns_o<�x��)S�*�}_0�ǎf/YL7��1�}��Ȅ�/hDj�p�ʕ�/u�$M���� +���|��F ����c�0ﱠ���G��ʒϜ9����X�HK^��n����Z���a_Ј�jW��4��&��4�B�A�-.�4���J. +�N��9�������1n�jm�+Ȅ�/hD;;����+���H7���p��?�:��TYѣG� a{���EK�_�y�C&�|A#Ι3���SY���nl���m K��2���#G��/B����7`����t����(�����hŶ�&W�CY����3f� �W�6u�\�m���@&|A#nٲ�֛�څހ���~�_/�+X�ވ�f/��7nF�)��Ӎ�bⵍH#�4�H$b��+��L��(i�7� ��AU���s$]]]��>|�m��,������_n +_Јk֬Q^��]���������B�}��^�ꗽ����9HZ��nĨU����)|A#���3z3��J9Rx�a.��[��GP¾j���d����E���>�\nJ��@#�4bcc#������.��F�Y��gO�]�Rֲ���?:t(|Q{▯��J�;���8�/hĥK����z�r,x b�'�iİ��DT��,��'''�r���8���{���Qw_l ��@����ӓ��=l =��O`1x��Q n?�>�t�ҥ�c���'��'����������ex��{���1L#�h�#���^য়~z�S#��4�իWY�)&=�k�4���3Q�I�v�HYo�{�W���_Ј���,���V\L��F���@TDG7�b�I�&��7��4�X,fN���GۑiĝV�DE���~���ɓ����Q"��rQ�l��;�y?G�, 9Zl����~�m6L#:��0߷M���Ps�t{� ǥ��*��&� �DR�.'d8|���E7��]�k��r*+��F�4��'������;ͩ?W�� �G +]o�4�Ş��o?����Yx��+q��z�t�A����z ����LA�aft&�/V�� �)�t�|&�8[�����o<3Һ�-]C���嗌�����V�\i��S���K��/�#��l�����5όJR�(Eԩ͊J*��b�[CqϨ��T����:�ťN�s]\�=hw��u�6�����6\�ʽ���ݷS��j5����{� <��2�]�RDŋ/�/Ǟ�:���.�}c݅�U�U������@��J�~!�^�6��Yzm��M:��\VjQ�ܘ��>(_���{mצә㵉���4E����k���a�e���qz�;��Q��x�/#M�l;�w�X��}���v���߾0>U�Qw��T:���;�=�c�î���+�{9wz���G@�5��8."K!��"o,9hH�M]{?�c����GL4������Rα��ZS���Oe�WK��2�W�]* :�0D�,��[��T����_��7Qw +W3� ���]2��8����R��^/�����,��q�^F��˹Q�v�w/Jug|pي�z`�wK�I<Qڛ��7$�)AR�#�Z���k0ZF�Gl�����ȏh#K�u�;��y!��m4������E5�$'�j���ʬ���0I�3�1�M�Tǵ������K����u'?�����cݝT��s�m��q�~��:�E�"^�yh��'/�"��]q$M�Q_F�D\O��]�6#"���x(8��,�F��3�7p�Nj�vn��|�g�)ϭ�壴z��]��Bц����y��t5��ܫ���xcw�����>�v�jbyrr�!�5�JX�M�2��c��D�����������Ac��I�LdLg��m�.�n=�E䓮�;�y8���:zm�Kf������є"��ˮ�9g_U"�n�{⼼8{���ugg/8��?�E�.�<^��UA'|��D�(^�"����[����l8����o��9�{%m�GL2�v=�&0,A��l�{4��iG���>��|&�>i��X)��~\Nכ�&�32��GΠ7�j���=0��y=����rS +����*���=���/��t�.�e��R��^/���*>��eo�b����G��T�~c(l�<^0����� ��V0��E)�ު�Z����h]�u��LE�D@�/>(� Ǐ��?I�v��^� � �M�9���X� /���4��%�l�Bs^u'F�H�,�sN���i��?m^/���GEn"�ܹ�Z���]K��b,��� ����3r�͝ÄG�.�=�u�$�3F�ӳ�F�'��B�ٕ�r&�:0�ψL���s����*�.�����|��M�|[s"E�!�F�ic���iV��(�f`O���.� +��R����E�ra��_�/aK�����L/�+�C�b��\TV�Qw��W��Ǎ\M������o#�3:��4�!�c��I��1��O�E?4`q1����)b]��,�s����賣���5$[K��1���N�"*^�<z�7���`��*�e�xa�H���+9���?4A�Q��� ��Yq<�� >��,=V|^��L�~�����u���� ������X:3��JɌ�VD��٪Λ:ň��,����M�"*^fl�y�7��x����i�^X���3D���וBJ/Juj,�"5W{/��v����+�]au��q�u��� |��,9քj�瑯����j��M5ߛ"*ET���}y��x��?//5u^�6j殯%��\�"*¡�4~+�ج���ޖ�G�y�M5�s[�<i ��G����1$ +�&N8�Q��R-��eϺ�{س�x:CۼJx�_��ة���91�h�����Q����ZS,ߐ��~E^�qֶ��e��P)�"\���2���9�7��Jڻ��|�;�l� ?VV���c�g4_zS��,��_�މ���)���z�`f�_6� ��P�B��ܱǥXYC�� ��("���)���=;���P����7�'H8��Ò�ZS��p��g�N�<��U�t��q�x ��ܣ���PD��#�"/\*�ʕW4���e��X�xQ��KC6�����7�����:�����fA|jrQ���B4�j��s9��=,���M�?�&R�V�"j缽ť�6�����/�Ť0q���SĭB�@�(�@�J/�L��0��G0H���K"�+t{�\M���(^�p������#_%u�#�&�ߔ"*^�H0�99k��lg���j�~/�ib~r8�+��cZ��E)�^�~�ÚiK����j�"e�Ne�S"��\�;�����p��Cz�yt�@ԉ�����C|栞��~�l�숉�8⻫ї�?��H����Y�� Q������ef'm�)�Lef���_֗<�(l9p��ѕF'O��o��/��F}7bN������N�f}=c�W������B��/0"��XS���oє��?���1�'�??�+m�7nqM�\���#`�S���XQ��j����@`D +e�c���WWQ�͙/�3α�dĕ�S��Yvk7�g�qe�H�l5È0"��F�����(,������5a�����q������e��D�O�L}�TβaDF$���"m�g��������x<ߡ�v����u��Â.`����`F��{�ϥ�n#�`#33]Z@dgA��~Y�b�Dͭ6�lU0��fʔ�`F��]0b���8Ɵ�4�q���}��F�GH2�F\���2�|�ʔ�*g�0"�|CwɈS ++����Nñu��aT��|~M_8����L͐;o(]��aDF,��F�/��9R� tA�M����gj��e.F�A<�@F��F��H�v���6ٔM`:���LMڜ0^��F�S�~#)0�?��_��Yklf^��_�;J�\$�#�QW��8�J!H�w���)��L�֔�v*�aD1MF��������7��8���..�aD�1ũ3��#I/(���/��hM}����0"ȚbԜ��&���s�+JM٤Mq��\#`Ra##�M#��N�[�P�눞��:����FS ++�~�%���N����m� +=( +�oD,���m�wF�$θ�O�}�hdE_8���_`Ŀ�������@��#^j9œ*��]�@����}�5��o�������e���a�X�]{�"+ �]`��Pb�h@��J(�!a���W��,wr��s^��dp^Ǚ�=g�|�M~��ߖ�"E���� L�l�V0��E�=����Z�#�eΩv�"E��C-s�|=�X)��l2�����"E��#�"J��'���?.��lS:�K�U��&i)"Ed("EL��tuC�/����9�W�W=L)��PD��8@L�}}�OL��W�1�7�0E���PD L�b��.�����6F�o������)E��E��)e�2u�-]���M��d}�^�\n��Gߢ�%���"RD�"RD\�r�)v͡�������ESD��0��E���k\Dtɦ��~}+��5�"2�" +�j>ɢ����><}�����WlV��1����]�����������),�Hm/"C)"�5�`#�p��PD��j�,�H)"C)�yX��y�SD�"RDVkd�F�H�"RDVkd�F�H�H� �5�`#E���"RDVkd�F�H)"E����Ȃ��"nun�����t/5ٔƘH�˦7|HouiNN���輘�-��PD�h!��Ȃ��"*4��/�fM?1!��fs@����+��|75yV�5 B3G�6Wy촕��"�Z#6RD����x��Y��)�>t��c��@?�nFS~K�1��V�pMMS|L�����B&T�F��+'�V"RD�ȫ#�@B)b�_CĞ���V���qvv�v�l�f� +�-���<����� +W�&�"��PD�HO�67*��U�Y3���33�Ɔ��/�w�E��=����Ύ��"��J?���1M��y��������(����`��I�g�kw����^?XU���<M("E|���"-P4���d���~���s�Ś�Q�=l���� ݑc���V���j�anL�`ץL��Е�e���^������n�/�m�Q`�x��o��"�&�n�d��ۙ"�)"E��q��Hq�!��@�ݞ�§>� +����Gئ<r�¬)��g�<�!*�! +߽Ps�Ke���oqĪ23����\)zt������Y]Wv�0ejW" +���mq��H)"E�������^�,c�5نw1i���Cg�E�"b��3�L����U26DG +?��w��j��~.� +~�az���U{�O;���"RD�HWά)H`B�����L��nEL`v]α,">Ӝ��6�x����_��5;6:�Q˷v ��8XY��km���f�"��G)"E���"���DĽ���;���y�?�z�v�bz��cǃ��8\����낀p�Gm��L����"J;�"RD����t����͍�)����I�6���>�?���$�R�E���"RD�PD���A����}��f��F[���i���J�W�w�{��+X�:��`�jCX(~���"�����5�(��F)�q�~�:?�;�Y:3.T��Z#"�Bu ����=�v�dM��q�?ik3�a�����ڥ�ݻt��eDžsP��=�)Sl�_v��-�"RĕS�Q.�L�ه�|��^�5��".7͉q�y�q�i2?5����)����I�m��x�b~g���XDjD��I ϶��Q��ſpb��n`����-�A���i� nOQA�/�.E��q�l��X��_�wЌF��C��/�PD����/�����N� +wWܰ�L�gp�����`�{%�� ���1}�"RD��� +6�>L?V�0�"�=W܅�q)�)6J�_N)"E�\�F�*\��o���"b&�-&���v�SD�(~��-���H)"V��D��{q�DPD�H%V��"RD���o!E��Q���"RD�"RD�(Ղ��"RD�C)"E�~�F�H)�����"J�`#E��Q�PD�H%Z��"RD�(~("E��,؈T���v�TG����x���G�.����h\~("Ed("E��*؈4DG����� +���Y�H)�����"J�`��Z^("Ed("E��vV����_��"RD�L0� +OD�HY��"RD6E���)"Ed���"�`#E���!Y�Ăx����)"E��� +E�������!$���YD���;ׅ�o%!"E��E��e�1��!4gm��߫Z��(�F����� ���"RD�"RD������k��><��w�{�߬�q`ն�U�)�'/�-ɚ0�+tz�]��?�{��6,}�T�2�H)�}�"R�ԛNI�6���.��}?|��=��x~�zב�;�Bv�2��������~�w����E�o���"RD{E���(b�u�;:Ɣ|�?8���|N��}����O�f]�ttڇ�'?8�ip&�ݘ�Fߢ�7 �E���"RD��8��1�7|}cL���\�;����]D> ʰ&� +���\��<��W7��j RD�H�>�">=_�ōML�a�����QW0���H+�=��Cn�-�2�rx=L)�֦by*�( �0���b��gŷ9�7���Cb��s ��"��qPDI�2����CF踼0��F��RD�H)"E���&�Ʋ��"�6�SQDDb@Z�z)"Edm*����c��o*T�8&�u���O��"~w��ɴ^�7����"RD��M��T��U��"2�)eM��+����ۯ��6���/�SD����T�yu�Vm�� +S!n�ȿܒ���B����:��啧��c +4(�C�M�e���}2��˴I���"RD֦�jy*��0�(�(�a�Ԃ���ꅥ�VbVE���M%��T�aL��|�ܼ�|�X�2�*}��9���5���{�PD֦by*�PD������X���Q�R�����4�L������T,Oe��0;����3?\���ES/7�U��Yr�Edm*�����0�:L��i�����?����ADݎȤw�PD֦by*����^�f��bj'~�;�)��ԦbD��"2LBV��wKwk&��SD���kS1�W�"2��r�P�*n�a("�b�u�J��r�u�ߙuM)"�PDfeh,�8���s����)"�PDf��÷������;ߊg_PD���s�P���5��"RD������z��(Ȼ�v=�"2EdX��E���"2Edޮ��~Q,)v�5�~������"2E$��ŧ��X����ltb�t�X�ޜ*�o6���E)�H�"2+�^ܢ�Aϲ�7�E=�]��j�TD��C�!��+i���@�rٿ8^����a("9��V���)��mJ�wI���q߈]�H�"2Ϟoz7�a��͉���a��"2Ed�b��xH5�9ŕ�q��ai�H�"r��u�L��1�}�G���,"Ed��)�2L�:Ɩ� ���&sv�>�Q��7D�o���g{�"2E�����S��CE�1"}�����a("����B�)��"�_F� +�k�]D��0�" +�j>ɢ����><}�����a("E���}�(��"��oW���a("Ed("Ed�H�H�"RD�"RD�������a("Ed("Ed�H�H�"RD�"RD�������a(���[�c��$�KM6�1&R��N���T9Ԝ�]���a(��B�����������{yZ�9�l��R�����ݞ�:�F�A���jE��Cm����p��Y��)�>t��cĚ@?�nFS~�Fc��������(Dl��Ѷ�#V�("E����~ { +�GZ����ف��-�E�P���� ݑff("E�-��������,���p�"J.���4ms���[��5388?3�ml� �RxW]T0�ۃ)M�>��1��~Cd��V�ǰ>�)�9���6���\:�ڂ��/W�47���~�|��V���X]�2�Hm��L/nQv�,���߶�HvY�s�.RDI�"-�^?���d���~���s����1���������:��0��l���I��07&G�6w]�4]9Y��\���>ioÕ�������~�pu��ц:%_O/V�Bq[�L�q�(9)"E���R�if)k��w{� +���6(�?bjWa���A��� +��@�(|�B͉.�ɿ�ᅤO�̌�J\�� +,'���;*�l��ц��]����6�ӻ�\E� +#E �H)�~jj��cAdB�Yj� ��۟���Cg�E�"b��3�L����U26DG +?��w��t��ϝ��Qyp��*E���:����n����٢mN���@'SD�(�YS�~�,�5'ę^�݊�[��r�e�L{.����^�+-��{{͎��46T�m}q�����j���*�)"E�M�"ή蟨�-�S\�Ƅ����"J�:�q/?`�ν,s��D�}��ӳU;�NX��ҿ��/Ř���+����ԣGx��fY���2W�HE�2��q]D!��E�]��uJ����)E���+)�:���uXD���z�.u�� +^l��z<vPD�(ʩU�)S��ҵa��8�X#qCd>�������mQ��c���jQb��"�����h�R?=��;F{�SL+k�C�h�,E�����S��Cm!�cD.��,-)"E�ߪ����{�Ό��ֈ��P�F�52�gϴ�:Y�gAD\5|��fD3�j�ڝ�uD�h�S+�\Dtɦ�61�2����PD�����8�t�r~jJ�����y��).��6A�b~g���XDjD��I ϶���c^���'����=wZ/�@�������`�H�>���,$�""�]�9�^t�TD��Q �Řޭ���s��+��s��E�-l%7r����1���д*U�"RD>h��Z��䍧-�?�*q)�)6��G��<�("Ed���3�(d3��U�Ý"RD�Z�"2o�i�G�2����c�H)"O-�H����}RD�H)"E��E��<�("E��E��<�("E��E��<�("E��E��<�("E��E��<�("E���}�Hyjmu��F(�g������o|�wSBl��s�#)"E�m("E��<������s6C� +����n5�D)|��{@h�Р�`X�Ѩmj�3KW���"�j6c}pL��D����#�Fs��)&�)&RH}�>+Lj5�~����cJ����x�MM�������hT�а�D���M�f"RD>z�r^|�X�ڹ���Y������������O߀�E���">8��mnT�y���f�QmcCm�»�M��`��':;�����J?���1M��y��������(�������{v�v'�7��쓎���nR�"RĐ,�vbA<�����"���A����y����M?~T���v^�U�����qm}��9�[���ؤZm���#w��.e⢠�K��<t#�'�m�V � �($���pu��QZ�.*k����%���-�����w��A�RD�h+����w@2P!� ���)*|J�c<Y?bjWa���A��� +��@�(|�B͉.�ɿ��N�̌��ֺ��(�b�O����D���":�;�� ��{U����U�2>=��_W��z���s'k��M���=L)�MD�OMM��b,�L�:��CM��]<A{�� ��̋�E�V�gN���0�Ð�!:R�qH.Ǹ�6(�{���q0���JwW�5����)�cl�ڰ��Ͽ�7�]��Wm���{�bܒ��%�U�\O�^�؏�g��W�4�ޚ]G>؛��\���}*bE����5i�L���^sB��ܭ��Z���"�3͉�Ko�8��JK����^�c�#� n[-�.L�ML�j��I�~D�HSo:%]��˺Ȣ��������[����]GV�<� +�qȮ�{�w�~p�p��N~��o�.t��o��:����O�XQ��ESD�����hAD�)غs/˜7�#�wm�����,n+�b��YК��,����9.FBw�SDfQ���8�cJ>�������>'��>�����I���v :�f�����>�l�7��{��}O~p���L�1��EoNXɉH)"�WR�u:�C�������^v\q�3���d�E���8��1�7|}cL���\�;����]D> ʰ���ߧV�#����x�~� }�N� .�~Q�+��5 �GD�HᖏA���E5��)P���h�R?=��;�bZuq��N�r耰c�"Rħ'/��qha��E|�����yTF�O��K{�}��kVo 8�>��~vO�1t:pCl)�����a�Hm"���Vu~nwtf\�2kD�\�N��H��왶S'k�,����O�ڌhX�zp��K���F|j���������)*�JI�H�b&�]L����1����m�9�z� bʆ훣���N��ЇX�����!E���Osb�q^o\Z�t~jJ����:?��y�����;�H�"R#LJ�<M�/��8�TU70P���U�T��:�R-��=����;����?� ��N Y��8�U�Ⱥ��K�ݏԽ�r�=Ro�l�.a_��<!���g�2w&Ґ����� +�k����ɖu����آ��ѻZ齗��S�P�Q���Sq�a/��{�4��oP � �r���JM6r�I��uS�w|$�j�EqQ�2�l�efE�9�7�\��ɤ�"""j'ٕ����W�ߚ�������P0�,"�7���ܓ'��wdDDD $+�r!���짟w�u�eeG��Sc����NM��������re�.-��"""b�#��;�qN���i���������Tm����mT�����cDDDDL��h��2d*��m�;)�!""""�;DmC��5Eׯ�=��� """"""""�o�3'�5�۩�!"""2_������B���H��|!BDD��f�[��� ""j?BDD�˃""��#DDD���D����'���'����?�������s�x�j��K��_y|��?.��"""&����XD,���?r�`����� ^(����~^5q,䔈(�������~��^��=DD �����%�7 +������X�jޣw���:�?��[k��m#�O�M0�iwN��i��Y�u#""�p� +,Q�n�h����:�!�ED��� +�R筢�KyC�?�ٗնlh�w�v�$�z�vʸ��d�.����M\��AFDDL��Ka��>���#"3|MD�C���d�z��yA1����+����e������Ѫ���+��{�<xL��eEZ�WY�:f8"rs`���꽯<����Ņ�e�;��-4�g�S9��t��Q�4p$�+�XI�7#�%�&[Y�{�� b��vr ""qs`5DDD��H>��PF���`Q>Nj�.�:�$F&s�}���sk{"I�~�A�ѓ1,��Q澳��#dDD�Tm�12��D���""�FQ|,+{k.z� ��Q.7�_W��hƖ�lc���$zc�;2�rʒ�&8DD�@��S�z��߱�����5���B��!��&rZ�����C[_$Yޘ���b��G�T��s>�����b4mu^��O���p�E�J�4�*SQ�}og0I��&,DD-Es%��^� N�G�����"j�$��-K���jC-���1f8"�IM�V�r�9�<gI����������Pm�1�� ��!r���.��D�S���H��/Q�t��D����yc�h�ue�u�,'�DDD�+��"�ԍ���}����W���[�B�Le�͛�m�;̗�=�s�Cz�J`�앆�Sϡ������X!"}� �'�,�1�F�� ;���F����,�*O�M_^�-�Eqw��>܅L�>���ń�S���H�-U>��W}�v��XLE��ˌ"R�q�kt�/Fe�9�݉��)"""y+ZT��Z�ždsݒ���P�;ED��A��g�1q�*�2EDD���j^����^����V��b_�<�����X���H��+ꗈ�l�&��ګ��<z<�����3�R���ᕧ���u=����` +�"!""�L��*�x��W��;�z�(.���"!""�7�u��d���@��@ycD�!��〈D����t*".�V�C�ɑf���n��O�q@D"DDD�u^�X:���ۆŜns9��R���ADz鷃;��*����M��D���"�,�Ɯ��Ȁ ""���T?u^1l0�p����:�gk�z��Z9s��ͥ +�����%).�].X���3����'5�""""�5̪��^K'��������ff�w�pL��hADDDDN��Y8�r�oD�t�h��tʴ�U�Y=w�/�i!�P]8m�ǀ �f"���լu�m�E+w�@DD���)u��l}"n&��ʄ +��<w�/��y��2{�;c�p���ٜ7���h�eB�u-X���/ZY8mQ�kC����`�\ؐ�̦�I.ŘhXDDd�tv����Y|�ye���4���܊"""�q�2����s7(D|��c`_즋z�n�@DD�%�yOA�D�c�����͕�#z�ӵ���~%���HV*�c����e�p:n�@Df81���0��+���{���EDD"D�\l��e�"2É�|a�ł��]����3�������N�-��l�о��H����Ojg�q�)"��'BD"Dd�!""2É���D�H���H 㧧��9k�ӷ�ֹ=y�.����Yf@�(MEDD���flQ�{��D$JS�Zb�6l�ی "�����F�ػ��u�ǾJ�Hu���F1���{W�m危/"r]�ŏ�L�C�s6�]$�EDDrL�c�� l\�;����@1�EDD�7��p���\��`^yd�c\�;DDDms%u�!"�w� +m��i�h��Θ�g� ���;�X�(�g�l�5N>۶��6�g����lֶm�ڶ���l��lz��������W�'�g��l��t-O{��7A���CB�-�p�#��+/�� ��.�*bii)��î�H1s�5�(�s��O0�1���`�Qw���pY_���z|;N�*b||</.g�A�����7i�x㓵�?`���!-c�����/�_���6���LF\P�]s11�/��������~��1�����k��6q����q��a�(Ë��.\(y_������������Q�8}AE�s�����Fd�ȹ��V�pr�-rϫH�extt����9���H�x��mk.�"&��qϞ=<Û���1"����t�����cABa+ð�i���8w�\�"m������[�����G�ˑ��}AE\�j�F�1����?d"i�)��o�M>��|����k,�����1]�Z������o�J%|�6��� "9���B0b2!_Pe2YBB�7��y#r��|dߝ�C�j�kt�����p{{����ዴ����c���{m�*"<��;�����v�u��x���y���isj����q-�I�Q�Rщ :J���݈E��X�gX^�~�� +��H�u�^��#oE�8ɾ�"�d2777^�X��V�b���A㈈�E��iC.��~�l+#���I����K�����"�g�_�*�F@���%[8�CƇ~Hxዴ֞��~~�ag4���*"����p:t6"� �A@�O�}�7/i===�Ac�bQuq��l�/��s�����Jn`�ܪ��.����M��<�jL�?�t���Q�T�e�����Hـ���!���CZ&$�qǃDd��sT?��7u��0K�~�i�\_&�_Pɰ��������=�j�Oڜ�K�s�9�~���f56w i����g__��<�G���/��2��^(++�����!-C�pBYcFY�T����?�'uE�gDm���|1�{���ٻ�6�(�{V�#r������3333333(�8T֤�\�`���G��m�wI��n�cҠ$�ݿoo�.�"��P/HDB}t����}�]�n�:SK5�/�|��s�O�����Ǐ��� e���/ԋn��t�gA�$Z��|�r�Y��������^��+={��e�R������^4�����c�NDD��n߳g�Ƌ.���j�pk���<�~��,�����M��L&J#VP/�zyƊ/������{�ߨ��jժQ��L�����i���|>�[o�չsg�ժ���"�`V���Oԋ2�˥��ӦMc@]6չ�b�[�.�1��o�9r䈦>��s���Ԩ��+��������߿�G�4���I�5r��x�{�6�x����������E!�n7�e����f�9Zc`V\��q/�-Z-&��2F�r�ԋ�9��7UK^������ţ�z�ԩ�B"z<�@�պ�A"��#CB�����X�o�G?�+f�$&�4i�B"��~�w���� q��Q�TI�Cm/nHI�7ԛ�rF:����t�ؑ�аTI>qJ���t�e6�NJ��j��$1Aٲeϝ;���;v�`�ꘋ��R�&�Z�L���9�4���pAD�ҥKNN�r"feea���^�"POz��t�N��C�h�A�m۶]�tI9i�q�V��:�##��:��C�C��f�T�$t�|o�ѣG)��;vm"�G�>����L��j�(�~� �OI*#�1fΜYPP 5�H7>>|8�G�mtr�� +��`X�Ğ�+� +� ���8{�,o��x�^�������|}M��嘮��)Wv]r"oK�{�k��A��ODjǍ��!a�D��������� b��e�`K������ߓ���J(E5j�@���R�B٨H���c @��+�� .O����2AabZZڍ7% ]M�f�1�B�.� �k��W�e�l�d2y<�+W�Ȝ�D�;1:d�XD��T����1�Z����� "lذ����D!�N(���[V�U�P���jŊV�X�&�;wnnn������322�v���� �&KYCqHS������͛���u���K(���Ҽ��~�_V��DK�����P��l���M�����o���/4�,��ZC����O?�즬�m�f�W^����N.��.�=e���{��e~�� &"w�ڵ����<jŊ�-���a�v�֯_��i���Y���/C ��'55u��ō7�]�6�j/�0.�p�$���jժժUk̘1o���?�������'���[{w��Ʊ�q�� +X3��p���¯1���N�ff33;V��]izۍ� +�I���3���=���s7h�|)�'b-Q�d���ݮ� ����������%�Q����`;��wWt�KHD@�/N�Z3~������4�:���ɱ�Q�Ϭh�t���(�DD`tt0MD��[� ��2n���w�r�l + 0���-�g�wt�`���Z7�b\�q�;�J�#�DD@9���/�gN���YLka���S���\l��t*�DD�]M�mNc��u��) �t�+�����3.��%���DD�����������i�U�3�'ˤ�X�W��Dϝ5��e�X����@��n�1͌Ã�}���LD������;1���j�����ŋ�o���:;�D��4~�$�V���u��`�K�WŇ�z)HD�r®�N-�� +ըj���S_zb���#$"����+�|�:�v �D��~�Dc?�Y_R� ��+Wb-�ҡ8m��v����[���M��{Bk�$"���ff���������w������gc6�!�$"�[u��i�ii�gL��zGO�B$#p��ZP���@�R���X���HD��HD��HD��HD��HD��9v'֬ꮯS��t7ԧ>�B��&<�8'c��Þ�� +a���rˬFJ�9�i�|_(���<}ڑ_v��)�DDx���(c���|�Q����p��9�9*���F#o�������^5Oƈ����y۫qG]�ջ{ļZ�'Ol�z�[(��6�UN<� �Ҝl����?j�(�(���\.��'�����3_��@B���3�1n�:�DK<Pl/*�8e�������>�<&jܿ�N�_� (�DD��b���"��Ϭ�������@""�y=B���}�&�X*2�D�x66����|v��dQ��q���W$"�XKT�ѣ*�QJC +�� �����v���k��R{L�D� ��T�n[0/��w5�SE�Ng����T#~����OE.�������JE��m����RS#-�"��ݍ�{����p з����������a[W��d�HD@w��^zq����w��]��HD�����QR�/?������F=P��*�L����HD�^�e�� ����R_����o�����Ԙ����&�MLY^��ij���"^Iؽe��Cs�EG�z�����\De��0%e�9f�����65��HD��i�-�yh�eH�/����ӧUh@Ӆ)O/���{��yƴ�ӧ�?�HD`�&uǎm3O�7sqbt�GH78��.������)�̻cd����ښ^5HD���ξދ۶�k/����y���1X�[���be"ct([��.N���Fke ��E��W�O�̢�/�����,�:gv�?������?�ZZ<�$"��ݝ�e���y���O!xY�����>� A��ru�}wlL�t=imhގ�eg���D�d0~�M�&�(HI�5j3/l�b�n��D�n�D����-W�������f����fRM�/�y配�'I78����N :JJ=�d!�D�UU%k}7 +S'X�!\⢧��cE~���5�� +.�ܑ��ǚ��ϼ\h"8�n�d�-{�������hLY����uuǏkG��`��o�6��D*�;Ξ�P �0ND����e���[��%�H�;ʲ���mn����F�ȯ?�.��5xu]s:{[Z䠢���<s�����u%1!<�ح�������}��;��-c��yn�]a���=�&���[.]<�es����q�(�T��jy<�B[��S��O5VD����2gV��]MH�nh��"+H�I:�N��X{��U+��/5��tv����U)^�8��!�ֳ�y;��w��^)�We�?�r�1��x����xSW������}��}W8��v���N�����&oJ�4�$"��u�[s:��aYn�4���3������R���ɄL��O� #5��p�u�,�����Io�� ��KmY�o�J���~���l �U%�y>'�'���'����7(1������5R+T���QV:�)�����3�x=��d^�D�����Oot^]�}����=����eH2�y�2J��dB&#���%/�!97�D��N�M�����˲��O��/O(������������jħp{����IEND�B`� \ No newline at end of file diff --git a/vendor/container-interop/container-interop/docs/images/priority.png b/vendor/container-interop/container-interop/docs/images/priority.png new file mode 100644 index 0000000000000000000000000000000000000000..d02cb7d1f1ed29c6fa87a269cdd8955e0e907a4c --- /dev/null +++ b/vendor/container-interop/container-interop/docs/images/priority.png @@ -0,0 +1,42 @@ +�PNG + +��� IHDR��S�������o��?CIDATx��l%{���hUw��u�em�a��w2���E��i�����Ӿ�tq��m�r��ž��圿0���d�����=|����㊢Ȳ����e˖��L @mm�$I���---��Y�|7o�T%,,���A����֯__VV��o��F��O�4�� �"��X���oMM��������R���:???�gk����ڵ��˗��3I��������6��駟>�l������E���������V_�ݻw�Q�����������s��SU5))���@```[[[oo���7�=GGG�+���� + + +�z��B���В�~�� ~���Ϟ=[V���� ~���o߾]�|�ϟ�M�����رc]]]�O�4???A/��pww�x��?�='�@�c_ZZ��ׯg�O�����:u���g�|�����������g������� ���S�kjj��������UU�*��Ç�� ..����*�(����^xvvv����ŋ�_u����ߏ����N�;������˧(��w����Ǐ����J05���5&&&777%%%44TУ��Y� + +�/��w/:::''g�h������$�����/ߖ-[����eYVU�����͛7���ٷo��h|������`"^^^�$��~�ݻu�Vrr��{���ۑ<p|��(Ŷm��{/�m�v���Sl۶��l��=[籪�MM���{�Ι��_��Әs��N�}����?�W`<t��J��7�M;���j�*U�{l��q�����.�g�}:� F]y��~g.r�y���[�8��F-����wZ��?�{�G Pk�����:�#W\q�w̳ޝw��#�M9唣|���)<�|�y.�q�y�c�9fW�ʪ�����W�4�*��u�q���k��&Y��?�9�Q#�d�^�"6�=I�.?������{���\pxAb�)����7���*����/��b��Q��������k$��5�J���7�j0U��2�,��[v�e�n��"�|I���_�%�l� ��_��n��G��~�m뫮��N�&�`�UVY�u�R�"�#����K���Z�O?}S�T��M5J�b�)Tݔ-��j����L��h�A�I�j!�z���`�-t�[O6X�j�g�yw�J+��a��2�,c*j�@�ztc�1"�,�Ly��yR�Px� 7�f�i:(�/��%X~�I'�{s�n�-����p�WS�ʚ��w���ggL�W��Re����=CM�3�8^x��Y������Uva}��g�{�v�m�Uï��z��63L&PhUŠ+=��!J��-��&�1��+�L7�j���¬R �K����}��)U�����C1�Ix������#=,����0�x����ۀ�����2�t���9T�{�LQ�}�QGQ#��=��p� [o�ui憐a�t�y癤��QP�d�Iz��I���'�|2k�K|��7�p�w~��8o<餓�)�;���e!SV M���{p�a��4ի��:�d���J�NE�*U�KE/��C9��ב����Kz�w���Ιf� f`���o�5�\��[��ۗkvQ鋯�袋\TV��G��y1D�(}�5En��;��~>���N�&\�o���n��6�8���C�c�9F0���C�����9�C� ����f����-�����#w�ygA*�@)�X��K/E^�����_x�QQX��믷;���X�ڦ +�=P[-�>��9sw�,���v�m6���|�x�#ܔ���7�x�EO�\(,#Ma�� ~Z7Yd�v�> �h��ܛK�����1V���۷�v[+�"|�d�M� �`1;�����)X�b�D��N���m>��x�i�El݉�J%_�*<�#�<��\ڰ�bīb��?�!����P���3�X��C���� ���ݻ�3��ܕ��|n1d�f~T#3�0C��� +{���7��h�j�=�hEA���&�aeT +���}�}��(X��!*i�ɴ$���B�]v��F�4 ,�?7����e?���b����9�l����#�<�EX)�-�����e�S܉ٹe�d����V��[n)�gE�ΰr��f +��m����X"M!������'�g*�a�:o5�J%_������O�V�X-�1Dh����dT�ѣ��I>~�,b��瞢=UF��x�dA�Fl�t�RyZ���̿�kR��շ�\���o�z|4����p��V2�`�$YnY^�P'�Q칁z�m���"}2�J���:.���c�2T�8�(*���N��جN��Y�L)[QhE�d�⪫�b��RO-��W&O� ��J+�:�T�U����O ����ѳ�>���>��eH��)��r_�x�Of,�H"D��,o�C�?`H�!AY���d)���N�?+m9���o6�È?��D�I�V�݆�|,#3ii{Qݼ���<�a�������Ħd�KmIB�jK-����D�}"���&��K�ӆt4�?&l!_~�j��g��E�& +2�y:�B��L�y戸��J�J�*U ���%z��t+`I��R� +rN?�t�.����~�v��F�O�A G��1�L3��#��Us ���_�rT4�;�4t�=�(\��a ��GYO�1��-�D��hR۫(R�l/�0<묳��$_r��|�I �v�ّ�L�-l�� ;�tf"�5���� +mS�i�C=�w]�W���JW:٦��I�͖�D�[�wꩧX6Ȍr�-!�����F�w�B�P/\�*J}�������b�+�H><1��:J�� ��E�ֽ�{���z(B���sM�,���2��{ꩧD`-䋯�`L���������ϊQ�d +1��<L����)*��T�U�Jqj��~�r��5}���Y�2�ȓOU/�������� ��:e�X'ZZ�!��zS���2�߶�O?d�Vva� 6ؠ%vr.NCj��{C��PEM�.�fUKd�px�lt+s�l��� 4�<��v���|�)�R�W���JWA��W_�/뀇����D�"��g�6>Z�K��~��{�h�y�I���e��l ɪ�l���F�N5ٽ�6�����G��-��j��E������#�ΚiF�����/*�jk���x,�n��;�h#(^�oS��v�f��Ga��Q��]QM�ȕ��~9��o������4MQ�W���J��� ���9�&Hz�����3��G�':���K?�{��h�8�d�7���͋%�P�P�����PC{�>� 5V[m������)/�ų�>��Jl�I>��bk*� +rF!&�:5ح[7��;�+-$���!,Cs 8�a�8 Ȇq܍ڢRS9�g��fdZY�T��a'�^f�0��:�@H�Ӝ��0���$;�>��c�h�Ug�RSh�q�!�'*��T�U��T���8_I�(P��K`�dX������,S^��{I>�!��G�E8l3���$/��9V�33�p3R�!C��=��Wt j��d�Ҡ!tIߕ�3�s��d0rk��R� +��KxG��^���Fj[1���B2�t&�AvH�=m�s��$9MQ� qH�� ��:g������Y���뮻.l�0Q*��O�C]�c���n/Y���*M![`�=�T�B�*��U�T�U�2�q�RF�Ds�i�y���<�ՠ�Kg| H⣋�D��u�Ha�d^S +M5r�ʚA0�#Ԁv �!��Ѫ�ujݰ���J��h�_O8o���(�T��WS7w�y��~�c~�`\ר [���꼌�4E�TU~e ����l�A����l�Z��5=����P�{p[� ��|�R>����|���B)������|��|��|��|��|��|��|��|��|��|��|��|��|�(�(�(�(�(�(�(�(�(��n�b���qk���<ٺ��4��������n#è�ٮ\�tm���*�P��9M��q��y�42;<R�I�l�̈́�)�(�F��������~yA�_h>��v��UU ø�0fLWWׇ~8~�����(f_|��*++�n�<3Lss�%KRRR^p��������n�㰜�x����'%%�����/4ߔ)S|>���,�0ƍپ}�Xf���o���7�_c���⋼��g�:�0�B|��^]�<��:� �|�=��߃V����ɹ�U�Z��s�6�����{d���...~����'l�ָ�/���Ʊ�]�La�;�u���n<Pf�˕���/�O��7eʔj��7~:;b��0��>��گF��ǎKMM���|������|>_��-]Nрl'v\�MZX��yڴi���R��/�6��(����{�<]�Ϳ�G����TTT$�/��"i� 80R㖮��_g��T[X7�5vÆ �>��/�/��|���4}��?�H~���'\����%%%���/�6_EEE�{��E~`٫J ���/�/��|Ǐ4��qg�U�g�x����&33�t_��E�����L��Q=�� +0��_��&���������&�/�7��fN݄4��Z@��.��K���͋�����ͷt�Ra�Uδ�k��t6��w��/�LOO��|���^y���_�$V�����w.]��KL4�7�|#����j�a-`��|AM�Y>E�/�/1�|�����V|, �? ^������|���TUL��{(�.���$���� ����|�G��c�?u�ڟ�g��kީ���79�ɻ~{ϥn��v���Q�^�oҮ�,���i�ӣi2��ˈ�������{�8��23333����)�6efH�i��o�KV��^�����3%E��ԯf2��x���|�?�?�V���"���GeS��;��iC���<�i�m}�OZ ơ�9M���])E�S��d�Ex*ӏ�_%W{ިo� 3OX��|ˬ���6ҭ�=n����RE� +%���y ���X.�n��H��˫2xZ�S�˨l�� 6}7�dg�g�p#����»"@kj��T}�kyFy�����Iڋ�����~|�j�"�tz�ÕR��F�=�=7�6�ޏæ�N�?��j���l�W����}묅���|�2��d$�(�:E�~L�״�u�&څ�|�Ɇ+N��z�s7�w�ύ�z���"�ݬ���,&���b +�G�����Or��N���Nus7���y��%SA�s�q��;��/�>Νo���)s�l#vz?��R��A������������N2�Ց���ij�U�� +���z]9�a�y]��^��Cv��������Ux�g���+��5�XxBq�_��'�������@��u�}1�}�*�^%����u��G�7��y+��0����E^�B���Ɋj�?���z�GK��^$U�i�W���i()Ծ�i�^w�'���M�J�~fw�£t���dŋ�^b��C�"]q.Ex�g��| ����R{�c��� !��]��G�Om.�_�䙽*z9��D;(�*o�曔ȡ��gyzV�]G�������_�f�i��?�#��v����_ʘ4McIXt$d@�lL/k�z�-�"�V�^|W�:�iܳ��ʪ&,�-{�{ם�����X�TCkߢ��e���N/��a���x:�h�Q���/�4�]7�Mx�g��H��ts!`;p�c)&]I]�l�~�{/����Xq.Y%��+'2酏�.�AG�;Z���h�����ژ�����|-��oY��UT� �"�NY�&����9�ur���o +�A�% ����d60ޫK��I2M��n�6�7%�o��"� (EWS7'��^>����|F��hl��BX��Tc�|� +<��B��ӯ +T�������ˀ����x@l�UQ�M-��Wl����8 +�v��eu���C�]ъ��գC��8�<�GIƪ������^�䁩���zz�':��|� ����'���������N�҇�:��*Q�3�Z�H�l��j�q��;$CQ���{�� �`rb��aMvl��d�%'$c`�&E�Һ����Rޡ��7������~�)�|cx/�J��W��v�Tx�g�`���wq!�M1�7��m��^�4C��0��Sk'��d�"{ӔӠ����BP�h�FGr��gV��9'�LF����mj�S������������|��/#9��h�A��"��`!��$��S��b�R�t�cê˺t!�i��K���s26�_2����\p2� ��el5�t:+�u<��=N�eU������ᅄ��>M�n~-�U��"��`!͈5�콛��%>���`�v| �r�-��Q���z��#¢�W狱#�pznU;�cmk>!Yx^��M�E�U?0UN6X���J�q�CY�L>���K^*�;��&���o�T\��yJ���7E@U�ҧ/`�}��5Ф:�[����C��ƫ��M�t�����\�X^n�1'�:hk� �^� ��B��݅���AjOx�g�n�5��Q�8�I�I.ln��q��vy&:t��L�����"�u�[9;5�Т� !m����������l*��ߔ�H��{���"���S��vLH&h_n��h,"Go]�\�(lf;�Ïr~�d�'�ʒ�d+pc��ZG����y�K��,$/�CE}2����W�*�� /��n������?6t�����ـ�"ZgA�ݚ��k � �{�f������1H���<��*��j���E�:�xl���yq6&-\��:�$�-�R�=���s�%��J 3�Z���S�W��W-�P�\X&5/>��6Ţ�Hf:�i� �=�(�n��� +���sQ{�Y�-ӎ /�������Ѓ�\JYr&i�!�����K\aÕTv���ɪCM9���/9�5NQ��78Х���i��(; ;���d�e�f�t�������FT�X��z��j�6ºA6��vX���Η������V�χ/Ք��'���T~�j�d�b_�l_�/(����S>P>P>���S>P>P>���ɠ|�E�@���(((����)((����)((�M����/���E�@�@���o�(�;((_^�k��9�p�bp$.��)���%j�d���w~���~���7���g_��/){�Ӈ�l��y8�Nގ�o��)(_���M�s����x��e�Px� ��/��7s�~�@��n��i��S7�?<Y�S�d�|��&�U o������{ÓU>��K��Κ�ݕ�#0�~tKx��S�~�i_��o�H�ԁ�ѝ�}�>'��M���>�y���j�6�g�l��s�/��W7��zd{Y���O�jׅg���)$S��u��������N��o`]x����ž((_��[J{V�|ʷ6R��}ʧ|��� m-�^��)_u���L�O��ʇ�)���|ʧ|�|(��)(E]>�S>P>�O������O����S>���ܢ�'�Nu��|S���;gݝ�E�Oxݥ�v�������pw*85�E*8�����i^WK{�k��LfΞ�o��3!�}�HD>"�`�4��-'O49�l��=��u3�L�֭�����D>"��D�#�}��L��:�D"�Lf��d2}�E]����Y�\V^���ܷoeR)����9t�an�|����G"���7�g����r숲�V�d����T�����ByM%�z?~�4u����G�#��|��K�?ؓWW��%����b���J��O?M�L�#��H�/������N#�,sR�r)q�<�����W�~*����*���MȺ�A\�ouZIq!�;F�g=}2<Ds[�ߋz=�TK��woeUCS:t �U˪��/�|>&hԊ�ڜם[a��h�Y{��Zn������2Z%�=#�u�n�ә�z�N$��|����Ϟ���q�-���O����~8*�{e�����YD>"��������N�Ra���}x�g�*A�.h��[���?���q��q�2A\\����@��60I�P;����(��F����=�J�k0�c8 +�`J��|S1�hg����Om�Ά��t:��P)11բlq +Xv�08ė �;^�$⃝9/��*n�C>IY1�����O��/��u�����s��c<�sln�:Ο�U���7|�s2���7�H$"���,W:���I�� K�y��#d�2YEi����ag3*ȼopb�p.����d2�ͱ��K���8��U��0)�H��i%���T����yo0ĸs���� hav5+�e�A�z��'��@zx!��|�ϟ�ȸe{+�>5�V��a@- 4���6�$g�K��~N>o!����D�C�a�F������-Ϟ��U�ٺ�.�Y�ƈ�n�ə�����&�y<�e?��s���t�yp�z����h>�|H���`�c�p>?�0mr��z����</�|�k�虇|�y��a��p˱��V�w�dɇyZO�� +m~9�4��d"�oL�HD>�J���� c�U�q�ܶ=|���XL��5j6���3�0���6ZY&�T���e��c6��Qy] b�v�;Ȱi��v5?�0*˰�9/ sΜ�� +���Bޖ�|Ҋ�T$Ƈ�N丬���Q�q�:�&�3�BD>"����G�c[x)�7�9�C] x�Z��#�X��ra��v�M&�(�ȇ�;���ɧ߸��ш/"��[@�F>l��[}�ɇB&�ww��y����%%D"�������G䃐��u�_�B�'--�Θw >!+r\�<"�e�L��*�&�p�:�D($-.����$�%�3����rf�J��o2Kf+w,�Q*6���U��\���|�� "�O�l ��ˆ ��G tˤ�L$�Y��o�[�m�Y�����D��T�y��",���|��r$m(�D☇|��"OxiW� +�i�H��`~�%d4 ��K�#���u��|x''�!�vhG��W��n���@�.��~���e��@O���b�i�v�${z�g�`�~�" +GAJ�p4���V���;�Z���T�H>ȴc���:w6��K�x�xN5�KCr������?�t"��+��!���|�?UD>�0��W�k�ycX꠲1���0p�kܷ'��ƽ�+�"\ulܿ7pOq��|;E�f(QтC�c�l�01�=���G�vհ�`&����j��0*��(D�]��32�Z����G;_���\g"���G��D䃸�y�����bؼ�i�h��~��� +u5����J�J ��y�sJhA�aS�+����5N���잟�?���˱����_5��Z���m�{l۶m۶mO�w�ɞ���x�t�>u����O�{���Y7�������ȇ|�0"���O��^���]��Lȇ|�zȇ|�>]0�t��y3�C>�C>B>�ӝ��:M]B0�C>�#�C�V�m�|�Gd?�#�C>�#B>B>�C>"�#�C>�#B>B>�C>r/�#�C>�#B>B>�C>"�#�C>�#B>B>�sF>"����q ��C>���!����|��!�!�!_��^� �WfV6�!_�!_���}���p�s k����{,Ҟ"���| ����mQ��3���4~��������1�O;�|�W@D����A��uz,��aF�V�+5^�״r?���_r��%��)�4G�#m�v�b�aUZ��>��D{�o�!_hDȗ�;*q{���^Y�˼j��Vj1�B��Z��!�ԯ�Ky�m�fUh2�R�1U�N��y^�^+���Y�C>"��'_�]j�o]ݞ˄_��3���\���ʭ&Tn9�߸���fUm3�z��5;���w�}�=��F���|�G�|� ���7��R��t_��<��A��5;�Q5:�.͑�H��ϥ�bm�^�u����M���C>�#B>��S�z������O�������J��ȿS�2m\����$���N�,�!���.�9��/a�ԣ�^7��o���~%�c��!�!��OE}/��k���]>�{ȇ|D�W��h7�`�����@�JT�vȇ|D�G�����~ԙ�p�m�чJ(��U�>|�J�ʙ��:�!�K��:�$�V��_��X��^�������sN!�9#��3�'قݷ������^��v��e��"�9#ѱk/��^��=�"�[q�^^��JXp��������8�����������z���̜�����X������h���gE'���S�w�ʋ�|"������!ѯ#���|\t�g~�R�� =U"3��yA>"�#����︄���{�?z/����i�~'�����H/��<���g�o���I�:</�G�|D���Ĕp�}�)6m/�!Q��G|¡��s�I���������C�E�=��FƼ ��Y���szv���#d^����~��|¡�5wǭ���#B>��+.�~c�>ɀ|�&�]���@�Җ���yA>"�#җy��g��3B�C>�'Ԅ|�1kl㱐/��=�m'�?h�C>�1�J%�2����r�c�|̚�j6j�ۏ���C�bR��5���L����.�}���C��7�vߊK K�5k,��� �Ũ���^d=�V����]�g�3k,��� ��� [�<}�4zv}N��>u�N�_OH�����4�(_�Ψ�m l�Pz|�%mփ���)���bАϞ|�'��[��]É����_�(~���)+��b����_�$�^��H�����u����a�����4� _�.��Ҡ��:=��ߡ��Q�大�mw��utt*������|���;� ����m���l�{�N���)��F�Y�o�6@jw]�4z~ ��$�k��gֈAC>k��/��꺀i��@6�X'A����Y# ����gu�.�F��"��3Y�5bА�������������i$�C>B>��C>B>�#�C>�#�C>B>�c ������FB>�#�sH>�#�C>B>�C��Rm�|�}��7��>ӷ����w�m�L�������������0'vA�ݹ�����i��0�fvFm�� +G��;���8n�@2����ږ- E�5aM4�h��*�ͪYӧ�3=��D"Qr�H���y9�|�ǻkk���0�KQ"����H�|�&�O4�����d�4}��rZ�uт������d���`R��_b�H[����_����D4�@<�-ST4IX�D���OR��Y�͟>~���ɄÚ�`R������e,�9#�}#0�����@C}k�9�W,�'�OX�D��|?������D���S'4l���:�Y3�U^�li��^�-g�\U�{��ƍ���Ί���"���H�-�}W�����]a��~�;��<e�FcՕK8sb��e�B��}� +2]�n6�{���0vtյ�����P0���f_�\o�z��Y�+�\673~�,H����+}՝v��:�����Ғhww��a.�em����X��gOB�֯�x����}����Ͳp~����@��f5�54�O4��&����g�69P_��{���^.��<���D�F��n�n��O�B) ;�Ҋ���y_�h{��j�*����"fN#�ϥ�,^��V��]��"L��y;�J cFj4V\8��i�y�@��Xw�u��7��46}��DZ����W��H{�Ƽ��-�5_��0�b�<�k�?�#��>w�*-;y��yy��4�}è"M�s�@-cw�;��Ϟ&�1�I㵏f��Y}�&E].m���r���cD� ��ք5�|���_�d��mڠ~f���tbjeϙ��wz�kș7�R�Ӧ���g�;������9ׯ��5c*pvVU*�H�����+/��S�FH6Mlh67�&�W��3����V��0jx��Wz���'��聙ah�����d.�s�\�����;�_���x,Ju��1j8� ��*r�2��e�5��^<��m[(R��Zș?��� �vv�W��_%#�o4��&�����9�`SST��e��<�;�+1!�l�J���X���FZn1� +�V.W?[�f�Üys����*�5-�^y�"�\>C'��S�utQu�*�+iS���܊K��:6)q�;���X#�����c�J����,��\x��c�{w+����>ISC��'� k��D�a�M��Ξ몮��R)��0�����l#'���捰Qu��ߡ���c+2����p��g�]O��Rˢ��E{���vu�\��c(�Oc֬�����c�vTU�Y��q�~��c{X�I\�����O��㮞R�&�@�"s���:ѮN�3j����H�'�Q�t�q=]���'� k��D�e͞�Mjma���R���Y�&���M�(������N���@c�q�X��pBT��ӈ���t��{��mlkl@%�B#ǻ�N����ljx����h�yc ��4��KJuWo���5&�����]Wi�[73�����X��i��e�1��D��Kք5�|���S&F;�;����W�ߣ�DP�=��}��j����?��i�g��}�D@�S[I�� +�K#0�u��S'�R� l����:��V4���j2�<����&���y��2F|^��8�)2�|��҅5aM4�h>��\���o]��ј5s:�&��a�D#2l�Dz!�_� �`oD#��Pk+�k�?�F�?�`"��,��I�V�0�w�x4��F�@�i7���e�L����h>�|�Κ�&�O�v�f�`��?ʻ|������a��d04"깯Sv�$���3SiT2MM)2��~)��� g I�ϟ"F�?w��)�F�1��zzB�7��L��U/9r������F��֬��� ����������us<d9D�,#ו���'M�'�/�X�D��S[�;Om56(:p�����ԩ*�`��� �"S��I��w�֮�d���e�|�dg�3��~H;�Ac��Ӵ�7Z;��L�3]�=�m�k>��}��g8��y3E#\тs�j�Իh4~b��U?w&�[�h?avNx��;�e#.W�"s�ڐv[�p��@c�7���q�H����O��5��D� kh>y��]���x�6%B�?����*��p {3��eH��ۺ�O���2bXƷ>0fSr�f���ERU!g�s�������OM�^ˢm� E� kh>�|i��id4`:V�H���Q�w�F#�'o/a�r�Z��͗�IX�'�/MO-tUW�cZ�x��� ��r���2>G�����`o��͗�IX�'�/]�qg��i�q�扗�\�np�����t�>~hY�@�\4�h�4Jh>�|���?�>�������@(�`��Dsx�U�u.���ď|)dk�#_�D>��>�O�#��G>k��'��E>�|�F��|"��Q�#��G>k4H�O�#�s]*��!_�l��ȗ�|��#_�l͑�|�|�s��|�k�~Y��Uz�q�/�|�fh���5�L�(��Tֻ�m۶m۶mm�R�b�(�Xe�T��_�7�{��73_�|���c������T�F���K��L�� ��#%��/l����(a\7�G/�yn�\���=�����Bb�|���ȋ&���,m�(qR/�_3��w�o��NY�2�O��ӈ�@��Y�r���]�����0 B�g��5)(��/l����E�i��a�����?^�܋~���t���s�"A����[��2u�:����!L�����'o��Kx�l�0�=�!5���j��V�����]�@Q"��XݯF3�Q;����$`�ld��5"/�O�䧗0�&)��ˈ^d�=�b���CڀVH+QH�{|vҏć���=��G�hr���@�2���;8Rdc7�w2�~e�/�F�Ɖ�x?ظ�y`��F�Ec� ��$�ܾ�L����� Q<���- ��6������'e�C��Z"�CTčПT�c���� �v(����tq� +���7��+aw�����kGS�����f�?y����Z�є/}���-6SS>_����A@�@�<����)((����)((����y2((�'SR>����S>P>P>���S>P>P>����d����|�|�|��ʧ|�|�|��ʧ|�|�|�ʗ�_���E�@�@����O�@�@����O�@�@�<��ϓ�)(����)((����)((�'���y2-�Q>P>P>���S>P>P>���S>P>P>O���dz�ʧ|�|�|��ʧ|�|�|����ɠ|�|�LK��_���O�@�@����O�@�@����ϓA�@�<���(((����)((����)((�'���y2 �Q>P>P>���S>P>P>���S>P>P>O���dB���|�|�|��ʧ|�|�|A��˽Y�u�SR>�_��|�xf��c��(��1Q1]Xۻ�𩼶wKk����Ia�γ�ΰ�9�w=�]zQ߮�S_3��_��q�(��b7��r����Vo2|�e34_kk+��_q�XXp��m��>�333v��_��/�7_^^e��%�0�Z<�՞����'N$&&������{�w(�+��a2��x��DP^frcccBB|1�_�o��z�2yb>���֢����j�c��'���ƚ������KKKE1\f]=��~� +7��4� �n���_i�/��v��㸶�6j�m?1���V���++Z����$''�������#y���)�UM��`���f�������ř���������C�9��f +`���AYը�ݺukDD����_�m>����K�o���=#�2�4ȭ����l���|a��H�N�����U��Їql�����mH�m۶�����i��䩧��L&����8n�0��Y�H4��6??r��/���bbb +�2+�~���wcz���vK~���7m�q=t� ���|a��Hȋ����3ʬ�!P��?v��$�9�jz������ttt��K/�y������H�:���aß�e�'*;ONZډw��F���ƯǪ�M�����VW�۽cǎ�Ņ/����8��ꪫ����?V�ѥ�����+*��1Ͼ�����Yw��I����)��������W2���4 �����ƿ�1�"n���5��ɓ�]vYTT��'����D���g����?o��6ub�� H~~� �V_��P�eee��%bcc�=���2�d���۷o��lǙ�+|A��ꓚ��O��w�}�/�����^{-���'��A�nwii��7��t:Wq�� ���\p��4ߋ/����y���p8233�y����cǎ�jdcB^�s����;�VH�+��4���FC|���>��#����-��f�ۓdCB*���f�×?ڻ������m�!S�+27��抻�� +~���:-�EN��}��SRy� /�݅�a���?�~���e�<��4M��ݝ?>,_�PP/���+�4����`Ŋ�߿�����b���Ç���7*��߿5���������+*��r�Ν����X�lٳgϤ�Q�J�?ΰOK��k��Q�+=�{��C/��TVV�{�NJ��B�m3��h���FD��þӧO���bݺu�m�*�"������Z��koo�<o��|��������`.�?�i�===A���R>~�x� �%��朆��|>�_>���N�-ZD���sѭ[�� �aʧ���[�UQQA���`�����q)�h˧����ӧ�۷�����r���B�(�,�"�t]�ȑ#�o��0X�mi�|�Bd2��Y;ԫ���������(�(x���;wb���=����/^�h�vww�Z؛x�"}}}�l6�J9rd͚5$p����ۻwo}}��7o��y�_>���X,:���֖L&�Ķmۦt,� u7nܺu�ɓ'>|��۷|>?�8o��� +�����?7/$,�wc����IEND�B`� \ No newline at end of file diff --git a/vendor/container-interop/container-interop/docs/images/side_by_side_containers.png b/vendor/container-interop/container-interop/docs/images/side_by_side_containers.png new file mode 100644 index 0000000000000000000000000000000000000000..87884bc2927069abb7f66dfa3e5e71e9c95865a9 --- /dev/null +++ b/vendor/container-interop/container-interop/docs/images/side_by_side_containers.png @@ -0,0 +1,42 @@ +�PNG + +��� IHDR��R��~����;c���?PIDATx��5x[���TX<S���D��]��g�ŷ���+ܡ�ݦ�ݝ >qww9|o_�����Y���?�� ���=x��СC��������`��������J�������?�4��Ξ�뚦��؈I���ٳ����������͞i�V�UQj��r���Ϟ=��������ˋ���[��-[��ŋ���K�Ξ=˄�����۷���c����fD������x��UCC�(��|���<��"##�ݻW__?���7������ŋkkkG�������θ���/??��7o���� �͙�<���~����ٳZ�� A�233?}�4X�N�:%M����oӦMUUU�g�4M///!������^��y�'Xo� �����>|�Й=F=���;z�hMMMK�������~��}��1�I��N�>][[+:/6ͨ'1���ի �h����논�����z��m{�ER���r�JK��^�ʆSz��-[������ ??�%{�� ��ݒ���21��GGLj����̄����@!����UUsrr���?z���͏��(������b����:;;`&n�ނ�����UU5����������Ѷ�M���6I���m�ֶm۶m۶m۶m���g��2.�b���1�F�w��<=�UY����3����w���?�x���'�h���s�Gƒ�����+�����3�0�j��Bٯ����������T�G����i����f�Re����w<� ��_�r�����~�r����|��7���g�y�ᆪ�:j�QG�+�?�#�?���\s�Ճm�1Ǽ��ۙ��x���z=����7�S��(|�]wQx�y��P��vp�}��c�1�@�ʪ�f�!��*}(��Yg��G��'rtC=t�sF��+��"���Ibw�q�G|��~���X��1���N�ӟ��駟��.�.���K%�<�Ia%�6Y�W/�_����뫺K�*3�<����Yf��m����O�n���[b�%�ð�;��ӎ6�h~�[�P_e�U&�`�0��㯼�ʮ�:���H#���⋯���M7]*�T�¥M�|��Uڔ*��rʜ�%K��h��^�S��TSM�_.��c���z,���W3�4���K�W\qEwu�zK/�����M��m��G���3��"�I��}�Y +o��SO=u�Yc����O2�$yon�-����X� WZi�0����||~`yz��y���*U<�@^[��i�k�Ǿ�� �<�H�����_~9���w�a��4h�-�0LPPU�p+ݢ�UI�ŭ���_�1䦛nJ�j\x��R IK^�t�W]uU��E]L��IKb��]7�?�+1��RK-O��;�W^i@Y���Sm a�y�'���z�>S�js�1��1`�,'�tҶ�n[�K�c]p�&�p'�x��/��>y�N=�T�(������N���+z�o�x�)�S�g�����|@�b�����#�8�Wi��?�x�I'��H���*U�J�.5��;�����j��Ez�w~p�f[ `�۷�~k䭷��[_}������]�%�\�R��'����FY;o!r�>h���q��wJ5�����{����ێ�zh�q�q�����Vl���k�o��g�]� zq� f��p�.� ����E#w�uW�)��(�X�뮃.��N���{�=�PX�;�;���X�ڦ +�=P[��~��9sw�,�����6���|�h��"Д����>��E���Ba�h +oN�Ө�����N�i؆n��\��LΏ��<����[����o��H0��� 7���L���$v�t�%m��'�Ŀ3�8#��*U*����_z�%沅�U".H�y����O!�g�a�{�9w$��<8W�in��f�I��W_u%�Ğ� +������O�u�m�)>�M�!�0�R�>ZQ�����sX��nF3�?�����;�FpL�Jz|2�s\��o��v��#M�I� (n��{.K}�{�E��s�Yg�1�F0y��R�[*��#��������s��������[bϊȝ����V̍� kرD�BI�=���COb�T����� +b���*����7��ԮZ�'V������0���曻�������{�-�KeH�5�T`O�Ӎ�=�V*�����k����!L�QM�ϥKm�單�G�wJu{��Eze�r�҉@ a�b_ Գn��$��S�M �A���#���S8Q}��v�5%�fu��`ϊ2���?+ +"�7�|3�(��{d�m�2ybO(�>Z�W�b�J?U��^{ �4)�`��~�m�o��f+� �MY�����{b^4���$dy#���Bb�Z���H�LteX@��Y]��N<�D�IF��$�K�z+��]챌����EE�� ��/���1/���U2�ؔm�-7h�RmE��<{�(ٯ1D���B]��a�R<j�B���c�����E�|V��mB S���)��������T�ث��-����Z�~M{�4[+ը���3�ěna/@��;�cO�3�|�j8gM�g����?� +�Kh�5�ԕ��K�������,�X��R4�"e=�ƨ����D覊Im/�H���H��s�1[{ !�{����u۱gG�2a4��yl?��u��Ä=+ja�M�ڦ�k��~��z�`�J�^�zT��ȍr�-]�70�:`���OG���s�'������E�w��?��\��*�{�\s���� ]�"�$�D{.j!��!�/��裏�d�� �����Z4YF]�eڱ��o��Z�_%�a�b��Q���aϊQ�d +ў�<I����)*��T�U��h��N����uy$���SX��`ﱧ��H���aXe~jhi�1e�=,Ԑ�t��|�Si�o[���1wG+������;!�5g�!� +�B&x�j��%�4�]���T*�kj�����n��6t��dC*��T�U�"<��[8e��ؓ����T�v����AKvI|�����;�흽Ǟ��4]|��dZ�֬o*j��L��K����`�pz�Z^?m�&�\����l�ɮQͫ�]1c=���2o��VZO�gͥ.���6��96A�Oj]��= +�ߎ��܊ +bƬ�f�^b/�AF���4E������*U $�1�g瘚���/��r�d�M�h��. ,{���#\"���^�:���F��kAR��E���~��j���Ⴁ�R�:���{��?���H{ā3��T�4 �K�u:p�M7E/)S��3���24�qC��l�ڨ-5��v6NmF��EM��:���2����j�@J��W��ة��c�)�9VmU&9L�_Ʃ�x���xR�W��dPa���%��@�Z/!�`��c�1F���t����%���1]ހ�T"�{�o�.$��U}�>�TÙw�H5^|�E��� +-���KY��-Y�{�tX��m�1X�U�|5 ���B��+���Hm+���:�G��8����G�� ��!'������R�l��PX����83��q�b�u��l&G���){�k~���%h�B��Z�)� �=�ʱSE��J���*��������h��3���!���G��wi��P����\�li�9-��Q����T�9�b� ��i@��q����h��:5m��vnt��z4��'�7�ś_Bm�j�M쫩����Ea?�E�1�o0�GԄ-KtkE���9�ͮ}@��Y�b(\�.���F�.���=�^~H2��]љ�^t���=d�=����Ze����01���" �=��=��=��=��=��=�d�d�d�d�d�d�d�d�d�d�d��������������!��y.���O��/˒R:�[�va�/�3�� �X@3[ a T��n�<�:��L�ޞ���}{��z z�0{���y^U�n���жmQQ�F#�$�za�� 0�|N���6IQD/�f��<��g4M�a��W����DZsn��~f���,M�{o,��^��,�.~� ��b1��� �����z}`fi��0��C�:e����N�;��wwwwww{����v6l�����s2�J��|w�ڝ�� 9��g����Dt����+��w�&���X����O��Ǘ4��?ʤ�~ll���������'�֯�Wu���z� /H��ʳ� 95a��wM~�������|�����u�0���3ǮyF�@���:M>|�p����E �_ԯ=������t���E����y_b�-��3g��ڵ+�������]S�������T�4���dȐ!��2�/��ްaÜ�s���Y��SZ�8tagx�ڵ�^������'GW�aZs��#+���&��A�hnn�z���/��^0t���陸P��ǢZ�p�X||iG�w���pu��yh���������{���(Z{UUUB�͗ ���}� S�>��cǎ��/*�^ ô]A/��j����C�P$�����koѢEbt�ʨ$�'gf��ͭ[�z��/�.��h�=zTh��v*������!�+��E�ڻ{���xřXbz1e��VS<],����k/99Yh��G�#�-�(}�~���E_����l�1w��)�lI�߿?���苢����#�|;�GGc�,��ؕ�����^f�2333�Bf;̌���0���/�kW!'/u�>�=�Ӎ����~�ɌF�+���V����c���An9�om9��b�N�G�l����E��;8�������Xx^��1}����*�+�EԞ*���-����ۮ���s����iC���Ӵ�����c�ݲ��Q��ܚ���&�Xx^&��}�g.O(:��*m_y�"���3RV�T���Vų���γ��2T(���;bfr��w8%��_LU�{���Fe}�?b��k�1Ϋ .�j$���"��yU�j�=�O��k��E��:7�]�EF�������d��c��C��R��B{��![���M����H�ˋs��S�78���2��Q퍨=�Ex�F�N��<�J�Cp��Yئioz��څQ{����� ���%�����u���#O*�Y�|�DO�9����q�~�t���-ǝ���1�?��~�E�̕�-?�(>��r�����m���L�C�i;�=��V�� ���c���Ï+����`��?J4�ɁG�q�X������|�q�yu4&jOx�(�K +��f >��p��\�Q{����*O���Il�»�>z��!±XqV�v�4�=v�Ͼ��'��G��3�G�^Gaq��h�kE|��������.�bE��v�4����'K���8=t:R:�B}l��k_��t~z�-~�ƛz��<����Q�{G���E���^�U��q*Wx�g��s���c�Ҝz�}�Z_��?�v���6w(�Q��ޒ����eX�D8(/i��\/�P�� +�a����������JF��8*��#������_�h`.�4�`ɑ�挏���k�^s�$Mt��}�U��D��U�W�!0[1g٫�?�(��r!�J�j�ٔ��o��?ĵDk����mK�ޜ�ExQ�jF=��ԭ9h^D� �O��An�R�.�Y�1W�:�ZyX�U�C?��8�R1����E�Lz�}�;�Q�O��'�: ��K��K����q�d6^VI�cb�0��{��E��)��U':=��:�X�����'����^��n�η�TNi�2�%%j���ExAЈ��A.��ݸ���Q{�,����FX���Uy0r��R��� ��gU*�X�K�ZԵd[��O 5ƪ�����+5ƕ�^5vBF�uCk?��Ė6u�������ε�N�I��g�x���t���151_px�Q��"j�!��=���i����"D��'|�GA+x�ه�$�E �jt��5Ķt��o� � t�q��F!���hX~�c���\cZ�E��֮!���� N���6�W�{�P�ojS���w/���w���T��"j��d�o�Fn��R8m����p�L�B0���-� c��3a��i*k���P!�i�Ws���Z�x�A+3mv �:{FT�����i�������"��z�;b$'_�,�i^D�)���H���=�k҂}�X��".]����h�zC��1�(n�a(��L� +��RsƘNW�7����a�����2�Q{i�Xx^�m�h�v5�Aח�=#�t"b�������F.1��O�&l���>VΞ��0���\����%G��"}?/o��6S/F��^���e�I'�a����y��:OԞ`�#�S�ʂf�^�,W�OI��~�����&\)n��:%���j�ї��c�b�3)M,�Vmdv��F��b~rO&ݞ}w�������9d���ӂ���ҏ��"�wl��x%C�y�=��h���1`ƹO���:�;�a�m<��#������FV#[0���ޚ���!7�y!�?���fkZ����o*� 6��u�e R���w�M�D�k� �����(���;�l��^�,1�y��,���*?8�� �YkίW3�l_�Xx^*����W�{U�cnZ�Kx�g��?uxG�ٲ�+2��E�Ά�vk�?��p4��|���]`�?�Tˎ��h��C_��h툽�קS�����(\w�����zx��=�`���� �n����R��iB-Ax�)|b}�sv+�F�%�&]5��ǝjS���c�o`h��IG��7��+/�wj.�@�My�4v-�'���3T�#;�^/���-'�v��OU��]b �_�g�?�O��:و��`p��Z��`�oZz�,����]̱Ӹ��;oJ�v��U�g��a����0���(X����,N�Y�����w͗o��a��b/���^d��"{ { {���'{ { {���g� { {fL=��"{ { {���'{ { {���g� {P/���"{ { {���'{ { {����4����{��������cz��F!�5�5*�J�F?�`��$�X0�t�RJ3��P����r_8�^(��8�d�<�z� �;�\o��s��{��n���������f]�`���^��.�D���m��؞j�lhKϮH2?=B`���~L>a<�#9���z~�{������߸��:`�ĭ��L�A��b����=�K��?��I�_���Ըo���*{�G�Y#FWo�woEG)�7�ؓ��~� +��{�TWob�Q�2}�����ǟ��8'���=�K���_̩ ��#��s��q9pR�a�VV�a�,{���O~�'Ƈd������g���0��!�g��,�R։�����{aU[�j�=�#�{�|�7��Lg�� +�PmUa=_i���c/��7Va>{������� � /�G`�Xi��iưG`�Xi��a�`�`��Yl�|�={��J�,6{�G`�Xi��a�`�`��Yl�`�`�Xi��aϷ�#�{�4�b��{��b�.&�����NYtDN���#=-�"!�&5��@JyL� �{��J�,6{�g۴�500�r ����A��]�EG-^h��bRB_k���46���bE��9O���{�4�b��{�[6��3��ё��FJBV{ٻ*^��i�m>�����柳o���Λ1�������U���To{��NZ��]����k<rhtn�������ٜ����aΝ����m\�.����s��L`������+�v�V�-]T���{��@ookY��U��6d�ި~�﬩�r�4"lh���K/k>{f���ZZr�S�*�5�� G��U�.x���D��q3?Og"i&�{�`�|��2ɛ��F�֒sNJ ��?~/�?W�j�I��W����h-�p�B����W__WC���_�\��.��.#���A��m�w�U�͚�ߌi����ۻ��-:H��y[}s������-�`�`�z��n�"���ܜ�ˌg���s��+��G�d�,���m��a�S{�5�S.���%Ecg]��Km�'�65E�>jVK㱬�����i��^��f�pZ�=c��]��{�{�{������իS4�$,� ����}�w:kRxfO{]����4��fA�:�QƏ� +Ճ<�rţ��W'��r��������X��������1�`�`�AN�%����o�X�~DW�i���`�g�����5�_)�^�8uR�_�(��N{[Y�0=_���ͼ\ƝK��gͰ {� ��{�{�����<��ۥW}����)O�^��Y��hj���Wvn��U3_�<W'���z��5�{���==���� c۸�vɅ��;E���<H�vёTnڠ���d�e��B�`�`�`�h�b��~��y]Z�X�ty�����������MQyr�,Z0�M��in������{�{>�ؠ{Z�օ* �=���ٻs�R����C�&e���ް��K{s��\۳���O��/���>�w��\�4túGR�{s����Tڪ��Uװj�g��NM�?��6�����b�Ft���jɷKKL�� {�7�T�ź����@wwѲ%j ����F {�=2� +��'k��K���_��^���뤣&��[Z<M�|{���kos�Xm�:���;z�`�|l�A]��Ǐ��E��ܬ�ӚyO�,����&p�ȸ���y�Q�Μ�����{�}P��+��أ*�w!xe���������-6�f/�&�( ^��"��`�����{:�W9��a�`���� ���b�`O�:��U_�?{&�y���\l�_��������]����=�#� ����b>x�{�g���g�`�������=��==�_l�<�`�`�|�A==�{�g��a�`�������T�f�[��������1u{~�����uT���`�`�`oL-6��F��ʿ�J۵}{`�`�`���b�#� '�������b��y�b��{cx���A=���a�L��`�`��a�Z�==�c�A�����A�2o�wX�=={���[Q���geW���ْ�����u=�#�{�b�/����� �����؊m S�SLJ��=U�*���=���bNM=��}/-J~a��gg��nҸ����LʌxoBT+M�{~އ/-ܡzN�Tmﱗm�`���^���ӓb�������_Y���;����ٹ����i�2{��!*���ܼ-/my�g���|b�Q�V�===Kd������}�ͰÒ����^^��K�?~qѮ&��N�B�U���|��JUZ�Ǫ�*<�h#�{�{�g�q�ӓ�~��h�N&|��Y��������V�x�Z�h��щ�7Ï���5߸�z�`�`����k/�v���F������[��4�B/C���t*घS�K�y?�°{,��o[u ��/_������^����VOe!*�j��B��g�`o����,?{Vn2~�C�?8�C;�QUu�{�{�{���M��C<�{�ǒK��U���A��L��K.��V]�=Bܙ�%���S��_���ۖ�%{�9Vy��aw8�|[{���-�ĪKSG����Nv���>+JK{���˞�s��ܥ��:P{���%�t%��7k�3ZoI����όx/CT.�M|n���ݪK�G�;���A�?���zfo��s�w���r�r8��,�K.����N��[�?(�i��{G���lť�Þ��c�%V]�=B��`�����_neˣ�[�\h�w�������c�%V]�=B�����?+��D��<����7�w�����Vo/�ǒK��{��쭹�]��?.��9������?U�2����Xr�U�<�I9]�����:�?R�[�,����36�X���K.����!��5w>0����F��'_]�n{�=�\b�%ρ=B֦�{Uq}sW����{ϒK���3x���_���{��!A��<o?_l +���=B��g���v���{��!�l:�)��K��f��#��|�6��,�h�`��1�!����ʷ���1�^`��#,�9�=c�M=B� {�K��.�o�N��\�����b}�`��C�a�-�iL潏r�;���/��&����{�G쑿�K>Qi�oSeٞf�lhKϮH���=B`�l� ���ɩ \7��{�G�a�n�Q��a"{l�vG`������{�G�?���n� T�oS�����5=B`�]������(e��{R��T�-��{�p����������,�V��6�9�q�`��c�3[#�~1�&�f���� ��>��p<P�I�U[UXu�{�G���N>�E��a:{����ڪ�Va��=��KY'������Tm�Y-�`��=�3泼�f:{��VX�j� +[�=�#�`/��7Va>{����Z�=�#��=�#����{�`��={�{�����`��={�{���==B`����!�gf`oZ@YL����_��)��� �b� +̷m�X�F� +{�G�=U`϶i�k``���9:;��{��t,��,Z��d^ެwkk\.��n/�`5��!��T���-�e^�������#%!�����X��6�����;�IMq����i{����{Oۢ�9�=��Y�.m�P�594:�ο�����r�l��SM7�h�b{[[Knέ_ +����{O��#���'�q���`�X��+�v�V�-]T���{��@ookY��U��6d�ިH=�YS�q�riD��^�;��^�|�̀������W��/U�k8���i�(/\�ޣ�O����sa��7ss`�F���K>Qi�o�?���*�ҳ��L���ٓLN����Q��䜓RB�����ճ5R�m�jwGGGk���4:��^}}] ��~Y�v���T��Y���~炠y��ֻתt���9,z�ڴ�s���=�y� ?&���ۑ���uC=?=e����V�/rKѠb�eƳ�YG�9�������F2uP��6o�0ȩ��͋)���Jђ�����֍ܥ�� +��Ԕ�r�;s�D쪯/�7;����{Oe��#\��a"{l�vG`�����=��9����ׯ�W�t�֔���ӳ��K���NgM���i�k�?u���,�W�4*���Va�z��W�x�Q]ۻG]=ۆu���{�o?��?L���Lߦ�}��'Ta=_�[2���������GtU�.x�;��=�F���_)�^�8uR�_�(��N{[Yi�i#���Z[o���~�=�m����O�q�2}�=9y���0���8��=]�.��3�Ly"� +���mj�hj���Wvn�@����_*S�K�;��屡?����z��Lv��=9�a��`�S]���GQ��mrT�j���㜰{���8yBdl��.��)�E��zH��3���GnC�i�͆=���dk��/�Ԅ�L�+�M�8�ڪª�=����u!���r�c��� ����J���Ggr=��t0���<�Ņ�{:��}b|H�Ξ_x�j� +���"{w._j8�Y��Ԥ�ϛ9��4tion��k{vW}�I���ә��UU.mN���x{��ۃ��7���ubo|p:��^�A����Z`�F\�p��T��.Z�D�4>$��c��_N�G�_�w��dM�tiu�k���F��D��u�QA�--��x�^�ٟzzJ�W��=y�:�Fp��x�2T[U�`Ϸ�3\��y������^��ev��O=?{ѵj>�}���.���9��{k<ܵ�`���y�2?O���c"����x`��xh�8��-]�u��g���x`��xh����V����#u�`��~�=�#�ܧ�`�`�`����x`�`����x`�`��{�G�=أ��ra���-��{�G`�h��{4�i�"Gk����EGh��?>[�|m̵�{�S��EE���� �=أ��6m�*��"K�1�����Ȣ�����a���Z�}��\���2����{��e�� dp�`��*�l*�g�ˣ#ˣ#�������W�b����|�gs{����vT]�}U��/�mZo�y��r5d�������� ����w��>#o�lJ����v�����380�q��{mx=�{�{�we��֊����j��zo��)[�Jϯz�xVݯ�����Κ�+�u桽�wh/����{okiɍ�N�_�T�p��7=�U� +���=Ü}}w���g̀=�c��Ӛ[;�ʼ��1�{�g>{�LN����Q��䜓RB�����ճ5R�m�jwGGGkɅ[�jt��KJu54�����bE��:Q7���A��m�w�U�y!ٕ����͂��遰{�x��� +�3q;[R314C��=�%{=MM��~�[JKnN�eƳ�YG�9��nD�5����̶y��AN���h^Lid�4U��,��u�n�.}�Uզ�<~puz`�����\ڴA/�=�a��Ş_��!V��.�������I{�0���h�stww_��^��Y[S�L�������I=��=�um��n������+��0~�UX����+{�W?�%�4��7s�o��=����/�Ԅ�C��������pܬu��Lʌ�f�{�Z�h��ss7��p��9!4S���^6��ި9喔2r��bm��]է�W�����5qk�Rb��q�pQPߝ������<�N�wv����/���`����ǟ���Ĉ�7V�ʲ�/,����������M���Q�T���my!h��K?{}��Ï���0��� ��<��+�W}����)O�^��Y�MMM��wƹ:�|�<hY�r���-�D+b�}�ru�#C�%����_��7�K�W��{yɧ/-���E�^\�|/;�IV�^^�ɫ����*Uh���������Y�=���� c۸�vɅ��;E��<���ꜢBmI :6=��<=y����V�d���թ����__y@yme�7!�����@�(}3����M^{����'�;����k��Dz�KW{���ӣ�3�ejth���.#=�{�f��_};��9u��}�V�1 {*����b*� +8)����g�O�0���hػs�R����C�&e��xÞ�.����]۳���O��/�����ݭ�ri�\� ��Lh�.�ӫ:��]?���/�i�:�)0�{>(_������^�4}e��2��N5�D!�ӓy�{R�p��_�s���h�u�`�Z|�����W�]�8YS4]�D]�Zc/�R��!'䤣&��[Z +��y�!�Μ�Y[;����'�`�|N>?�?}̆]���ʨ�z4�`�S�ȸ�����J����a/#�B����W:�ć�0� {�����чx�`�R1�����H�{(�}�g�`�, �j閮����3a�1?�{���g�U=/o�Ȕ�J=B`�,���=�#�`���{�76{�G���=�#�`��{�G�����{�G`��=�����{����� dp�`�'C`��L�`������{����5�v"�y[�c��`�X/�{q��V��ӳ�+`���lI�����`�X'�{�b�/����� ��� �Lيm S�SLJ��=U�`�X%�{��?�Ŝ�z���^Z����-��^?�ݤq3���0��ބ�V*�����_Z�C������c/�`�X �{Ig��OO��zbD��?e���xn��g�n~vΦq��^��\*�s���奟�����GU[U�`���Y"C�%���O~�'�;,�^]���%������zqa���.$YE{y�'�.����Tu�5z�ڪª3�����u�9OO^�����;��A�fu���/��WP^[��M�j���R�(}3����M^�źz�G���������/ш��}��~+�=A�e�Q1�N�sJI�3�'U�`���YM�l�� �����W�z*�Q�TCMR=�7��=�3E>?ÿ�Οm� +�2�)4c�#�{V����g��q��8��ó�0U�da�:ӆ�333�fjL1Ce +�}W:�Y����^�]O�@���� +��X��=ك�=���ٓ=�=�=��ٓ=�=�=3��3c�=���ٓ=�=�=��ٓ=�=�=3�{�=�=���ٓ=�=�=��ٓ=�=�=3�{�=�=���ٓ=�=�=��ٓ=�=�=3��3cB�=���ٓ=�=�=��ٓ=�=�=3��3cB�=���ٓ=�=�=��ٓ=�=�=3��3c�=���ٓ=�=�=��ٓ=�=�=3��3c�=���ٓ=�=�=�������Dt�Y�={�^"�����g3���MD��Ok[�~����D������^��7NުY\^?x�SSS�b�^�^��R��ٌ�pq��Ӧ��C3�����������]�~��lqq�拾��C3.//��r�����;w���.9��P�;���q���߿�N��% �%���a�`$Y�(�Uc4F�T��3���gE'�Zo��͎��5�m5�vM��;U�dP'��]�_�-��QQQV���dY[|$��-�����ɲ���_���_���Fk��Ǐ+�����,��N7Ͱ�����p����0Z{�%K�(4v���b>�W|��/)W�3g���4����A�܆R�&�����q����p�ӛ����㣍/���k��}��).�[��ӆ)a��|�����۷�z=|a��_X�=��d���Q\�K��m��� Xu�P������2ի+|���k���?�(4�؝��ŝxz� �[�%+9�ZQ���-|���k/ �ܹsj��.��q�=���lx(f4�~V�ע�"A�` ��h�Q�ּ�<������u=�ü5c�!8ot�f]��3�ӥ�����?���y��0Z{��3g�����F�5��ՙYٻ�R�t~� ����Se7 +:���.Y��R$IJKK�y[��j���>������J)�(�nZf鮙��ͫ� +��l��TV��I�*�8lK�������j���|tt�իWLY#����ުSYY��G����&��+�7o�<��8�>�ٰa��X.SAQA��� ����j/..N�]���̙s��1�LF������T�^�q���L4���/k�l6k����$�ǫ{m� �$]�t���7�L8c_��\�ϟ����-[�c <ϓ�F�166��f3==���lz�F��:33�b����/���� |�_��hȗ���}�vK�}�����z��6-A�9*� ��g��/�}����;���E{��#W`|b�mPF��Z�nT36k[������^X�}���-��^g�Ϝ|��Η��ό���8y��Z��i�ѻ�������_�ڵK���E�=z��{�*++���ڻw��g�ݻw�s�,V^^����={J�͛7��`���7o*����֭[,����p���Zk������'��@nn�Ç�R&{߹�˂�2����B)���d�,��=*l���+\��?�;)e$��XqW���=�d�x��Yvv������9sfcccOO�6��=�Եk�fϞm�L�v��(--M�R��g��!_KK˜9s�c����r��y�/B�G��8999ӫ|���6 + +<�SJ ){F�O�>ݸq#��L�����t:��C�)�|�߷o����� +�����70)e<g���������W�^�a�$��A��~uuu^^�:��7�O�>��nww�9�m�����D"��ܼo߾e˖MV����n���%%%��ߗR���q�̐g&��<���-�E�� 6��*�@�V�^�~��Ç744�|�2�J ��8{���yJ<-9������IEND�B`� \ No newline at end of file diff --git a/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php b/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..a75468f6a43565a838e51f945605af815a9f1fa6 --- /dev/null +++ b/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php @@ -0,0 +1,15 @@ +<?php +/** + * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) + */ + +namespace Interop\Container; + +use Psr\Container\ContainerInterface as PsrContainerInterface; + +/** + * Describes the interface of a container that exposes methods to read its entries. + */ +interface ContainerInterface extends PsrContainerInterface +{ +} diff --git a/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php b/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php new file mode 100644 index 0000000000000000000000000000000000000000..3964061a2478a6cb484e7e3a5d396238070bb184 --- /dev/null +++ b/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php @@ -0,0 +1,15 @@ +<?php +/** + * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) + */ + +namespace Interop\Container\Exception; + +use Psr\Container\ContainerExceptionInterface as PsrContainerException; + +/** + * Base interface representing a generic exception in a container. + */ +interface ContainerException extends PsrContainerException +{ +} diff --git a/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php b/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php new file mode 100644 index 0000000000000000000000000000000000000000..031b3ab4e3496d5d2db4530d67b620ba13154ece --- /dev/null +++ b/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php @@ -0,0 +1,15 @@ +<?php +/** + * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) + */ + +namespace Interop\Container\Exception; + +use Psr\Container\NotFoundExceptionInterface as PsrNotFoundException; + +/** + * No entry was found in the container. + */ +interface NotFoundException extends ContainerException, PsrNotFoundException +{ +} diff --git a/vendor/drush/drush/.circleci/config.yml b/vendor/drush/drush/.circleci/config.yml deleted file mode 100644 index d26009f0c12c32e4ee48e67bc0b64849fae01de1..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/.circleci/config.yml +++ /dev/null @@ -1,24 +0,0 @@ -# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs -defaults: &defaults - working_directory: ~/drush - environment: - TZ: "/usr/share/zoneinfo/America/Los_Angeles" - TERM: dumb - PHPUNIT_ARGS: "" - -version: 2 -jobs: - lint: - <<: *defaults - docker: - - image: circleci/php:7.1-apache-node - steps: - - checkout - - run: composer install --prefer-dist --no-interaction - - run: composer lint - -workflows: - version: 2 - build_test: - jobs: - - lint diff --git a/vendor/drush/drush/.env.example b/vendor/drush/drush/.env.example new file mode 100644 index 0000000000000000000000000000000000000000..ce3bccd137e9eece008a66c6182302916570810d --- /dev/null +++ b/vendor/drush/drush/.env.example @@ -0,0 +1,21 @@ +# This file is for customizing the Docker environment which is used to develop +# Drush. If you are just using Drush to run commands, you may ignore this file +# and docker-compose.yml. +# +# Uncomment to change versions of php and DBs and OS +# POSTGRES_TAG= +# MARIADB_TAG= +# PHP_TAG=7.2-dev-macos +# +# Uncomment to run tests against a different DB. Defaults to mysql. +# UNISH_DB_URL=pgsql://unish:unish@postgres +# UNISH_DB_URL=sqlite://sut/sites/dev/files/.ht.sqlite +# +# XDebug defaults to Off in the php container. +# Uncomment to enable XDebug. See https://wodby.com/stacks/drupal/docs/local/xdebug/. +# When Xdebug first successfully connects back to PHPStorm, you are prompted to create a Server called unish +# Then you are prompted to add path mappings (its mandatory). +# PHP_XDEBUG=1 +# PHP_XDEBUG_DEFAULT_ENABLE=1 +# PHP_IDE_CONFIG=serverName=unish +# PHP_XDEBUG_REMOTE_HOST=host.docker.internal \ No newline at end of file diff --git a/vendor/drush/drush/.github/ISSUE_TEMPLATE/bug-report-or-support-request.md b/vendor/drush/drush/.github/ISSUE_TEMPLATE/bug-report-or-support-request.md new file mode 100644 index 0000000000000000000000000000000000000000..47d88176c35f20f7326f357a399b0218aa7a5082 --- /dev/null +++ b/vendor/drush/drush/.github/ISSUE_TEMPLATE/bug-report-or-support-request.md @@ -0,0 +1,31 @@ +--- +name: Bug report or support request +about: For support requests, please use Drupal Answers instead. See http://drupal.stackexchange.com/questions/tagged/drush + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +What did you do? + +**Expected behavior** +What did you expect would happen? + +**Actual behavior** +What happened instead? + +**Workaround** +Is there another way to do the desired action? + +### System Configuration +| Q | A +| --------------- | --- +| Drush version? | 9.x/8.x (please be specific, and try latest dev build) +| Drupal version? | 7.x/8.x +| PHP version | 5.6/7.1 +| OS? | Mac/Linux/Windows + +**Additional information** +Add any other context about the problem here. diff --git a/vendor/drush/drush/.github/ISSUE_TEMPLATE/documentation-request.md b/vendor/drush/drush/.github/ISSUE_TEMPLATE/documentation-request.md new file mode 100644 index 0000000000000000000000000000000000000000..4a5da8b3a2f6dcfca55466a10016aa9506f14be6 --- /dev/null +++ b/vendor/drush/drush/.github/ISSUE_TEMPLATE/documentation-request.md @@ -0,0 +1,19 @@ +--- +name: Documentation request +about: If you know what the documentation change should be, please consider submitting + a pull request instead. If you do know where the documentation you need is, please + submit a support request first. + +--- + +**Existing document** +Please provide a link to the existing document that is unclear or incomplete. + +**What are you attempting to do** +Please explain the task you are attempting to accomplish. + +**In what way is the existing documentation unclear or incomplete** +Please explain any confusion or ambiguities in the existing documentation. + +**What should the documentation say instead?** +To the best of your ability, explain what additional information would allow you to complete your task. If you already know what the documentation should say, please consider submitting a documentation pull request instead. diff --git a/vendor/drush/drush/.github/ISSUE_TEMPLATE/feature_request.md b/vendor/drush/drush/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000000000000000000000000000000000..066b2d920a28db73b4ba3a0b35e6905eeeef5772 --- /dev/null +++ b/vendor/drush/drush/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/vendor/drush/drush/.gitignore b/vendor/drush/drush/.gitignore index cc8bfc4662ac444730de4d4773ced36166f0a045..ea3e34bc70b7cffcb731c9fb357c3e5ab7790789 100644 --- a/vendor/drush/drush/.gitignore +++ b/vendor/drush/drush/.gitignore @@ -1,10 +1,18 @@ tests/phpunit.xml vendor -/lib/Console_Table-* box.phar drush.phar -isolation/ #The mkdocs output directory. site +#The sami output directories +api +.sami-cache # IDE config .idea/ +sut/* +!sut/drush +sut/drush/sites/*test.site.yml +/sandbox/ +.env +# Test fixtures +sut/drush/sites/synctest.site.yml diff --git a/vendor/drush/drush/.scenarios.lock/install b/vendor/drush/drush/.scenarios.lock/install new file mode 100755 index 0000000000000000000000000000000000000000..16c69e107cce7f71e33e04207254d005200f9fd4 --- /dev/null +++ b/vendor/drush/drush/.scenarios.lock/install @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff --git a/vendor/drush/drush/.scenarios.lock/php5/.gitignore b/vendor/drush/drush/.scenarios.lock/php5/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5657f6ea7d574e423dc2c297e2e19a9dbd7a7170 --- /dev/null +++ b/vendor/drush/drush/.scenarios.lock/php5/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/vendor/drush/drush/.scenarios.lock/php5/composer.json b/vendor/drush/drush/.scenarios.lock/php5/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..65c4379781ef98cda364466c749bee1a51922278 --- /dev/null +++ b/vendor/drush/drush/.scenarios.lock/php5/composer.json @@ -0,0 +1,172 @@ +{ + "name": "drush/drush", + "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", + "homepage": "http://www.drush.org", + "license": "GPL-2.0-or-later", + "minimum-stability": "dev", + "prefer-stable": true, + "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, + { + "name": "Owen Barton", + "email": "drupal@owenbarton.com" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Jonathan Ara\u00f1a Cruz", + "email": "jonhattan@faita.net" + }, + { + "name": "Jonathan Hedstrom", + "email": "jhedstrom@gmail.com" + }, + { + "name": "Christopher Gervais", + "email": "chris@ergonlogic.com" + }, + { + "name": "Dave Reid", + "email": "dave@davereid.net" + }, + { + "name": "Damian Lee", + "email": "damiankloip@googlemail.com" + } + ], + "support": { + "forum": "http://drupal.stackexchange.com/questions/tagged/drush", + "irc": "irc://irc.freenode.org/drush", + "slack": "https://drupal.slack.com/messages/C62H9CWQM" + }, + "bin": [ + "drush" + ], + "repositories": { + "drupal_org": { + "type": "composer", + "url": "https://packages.drupal.org/8" + } + }, + "require": { + "php": ">=5.6.0", + "ext-dom": "*", + "chi-teck/drupal-code-generator": "^1.28.1", + "composer/semver": "^1.4", + "consolidation/annotated-command": "^2.12", + "consolidation/config": "^1.2", + "consolidation/filter-via-dot-access-data": "^1", + "consolidation/output-formatters": "^3.3.1", + "consolidation/robo": "^1.4.6", + "consolidation/site-alias": "^3.0.0@stable", + "consolidation/site-process": "^2.0.3", + "grasmash/yaml-expander": "^1.1.1", + "league/container": "~2", + "psr/log": "~1.0", + "psy/psysh": "~0.6", + "symfony/console": "^3.4", + "symfony/event-dispatcher": "^3.4", + "symfony/finder": "^3.4 || ^4.0", + "symfony/process": "^3.4", + "symfony/var-dumper": "^3.4 || ^4.0", + "symfony/yaml": "^3.4", + "webflo/drupal-finder": "^1.1", + "webmozart/path-util": "^2.1.0" + }, + "require-dev": { + "webflo/drupal-core-strict": "8.6.x-dev", + "webflo/drupal-core-require-dev": "8.6.x-dev", + "lox/xhprof": "dev-master", + "g1a/composer-test-scenarios": "^3", + "phpunit/phpunit": "^4.8.36 || ^6.1", + "squizlabs/php_codesniffer": "^2.7 || ^3", + "composer/installers": "^1.2", + "cweagans/composer-patches": "~1.0", + "drupal/empty_theme": "1.0", + "drupal/devel": "^2", + "drupal/alinks": "1.0.0", + "vlucas/phpdotenv": "^2.4" + }, + "autoload": { + "psr-4": { + "Drush\\": "../../src/", + "Drush\\Internal\\": "../../src/internal-forks" + } + }, + "autoload-dev": { + "psr-4": { + "Unish\\": "../../tests/unish" + }, + "files": [ + "../../tests/load.environment.php" + ] + }, + "config": { + "platform": { + "php": "5.6.38" + }, + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true, + "process-timeout": 9600, + "vendor-dir": "../../vendor" + }, + "scripts": { + "cs": "phpcs", + "cbf": "phpcbf", + "lint": [ + "find includes -name '*.inc' -print0 | xargs -0 -n1 php -l", + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@phpunit", + "@cs" + ], + "api": "PATH=$HOME/bin:$PATH sami.phar --ansi update sami-config.php", + "sami-install": "mkdir -p $HOME/bin && curl --output $HOME/bin/sami.phar http://get.sensiolabs.org/sami.phar && chmod +x $HOME/bin/sami.phar", + "sut": "./drush --uri=dev", + "sut:si": "./drush site:install testing --uri=dev --sites-subdir=dev --db-url=${UNISH_DB_URL:-mysql://root:password@mariadb}/unish_dev -v", + "phpunit": "php -d sendmail_path='true' vendor/bin/phpunit --colors=always --configuration tests", + "unit": "composer phpunit -- --testsuite unit", + "integration": "composer phpunit -- --testsuite integration", + "functional": "composer phpunit -- --testsuite functional" + }, + "extra": { + "installer-paths": { + "../../sut/core": [ + "type:drupal-core" + ], + "../../sut/libraries/{$name}": [ + "type:drupal-library" + ], + "../../sut/modules/unish/{$name}": [ + "drupal/devel" + ], + "../../sut/themes/unish/{$name}": [ + "drupal/empty_theme" + ], + "../../sut/modules/contrib/{$name}": [ + "type:drupal-module" + ], + "../../sut/profiles/contrib/{$name}": [ + "type:drupal-profile" + ], + "../../sut/themes/contrib/{$name}": [ + "type:drupal-theme" + ], + "../../sut/drush/contrib/{$name}": [ + "type:drupal-drush" + ] + }, + "branch-alias": { + "dev-master": "9.x-dev" + } + } +} diff --git a/vendor/drush/drush/.scenarios.lock/php5/composer.lock b/vendor/drush/drush/.scenarios.lock/php5/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..7d9fd0058858133dd4bda46f91dcb400012326c7 --- /dev/null +++ b/vendor/drush/drush/.scenarios.lock/php5/composer.lock @@ -0,0 +1,7137 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "8266db40dd17b66e6932589b0401b424", + "packages": [ + { + "name": "chi-teck/drupal-code-generator", + "version": "1.29.2", + "source": { + "type": "git", + "url": "https://github.com/Chi-teck/drupal-code-generator.git", + "reference": "0d2cb5299e5b1361bab6c8b9ee6531e95d68df95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/0d2cb5299e5b1361bab6c8b9ee6531e95d68df95", + "reference": "0d2cb5299e5b1361bab6c8b9ee6531e95d68df95", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.5.9", + "symfony/console": "^3.4 || ^4.0", + "symfony/filesystem": "^2.7 || ^3.4 || ^4.0", + "twig/twig": "^1.35" + }, + "bin": [ + "bin/dcg" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "files": [ + "src/bootstrap.php" + ], + "psr-4": { + "DrupalCodeGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Drupal code generator", + "time": "2019-06-02T07:36:18+00:00" + }, + { + "name": "composer/semver", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2016-08-30T16:08:34+00:00" + }, + { + "name": "consolidation/annotated-command", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/512a2e54c98f3af377589de76c43b24652bcb789", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.5", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2019-03-08T16:55:03+00:00" + }, + { + "name": "consolidation/config", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2019-03-03T19:37:04+00:00" + }, + { + "name": "consolidation/filter-via-dot-access-data", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/filter-via-dot-access-data.git", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/filter-via-dot-access-data/zipball/a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Filter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.", + "time": "2019-01-18T06:05:07+00:00" + }, + { + "name": "consolidation/log", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "shasum": "" + }, + "require": { + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "99ec998ffb697e0eada5aacf81feebfb13023605" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/99ec998ffb697e0eada5aacf81feebfb13023605", + "reference": "99ec998ffb697e0eada5aacf81feebfb13023605", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5.7.27", + "squizlabs/php_codesniffer": "^2.7", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony3": { + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "config": { + "platform": { + "php": "5.6.32" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2019-05-30T23:16:01+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.4.9", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.10.2", + "consolidation/config": "^1.2", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.4", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2019-03-19T18:07:19+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "consolidation/site-alias", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-alias.git", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-alias/zipball/8cfd3b6ab6d541086fc970bf850864293b284e6f", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4", + "symfony/yaml": "~2.3|^3" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\SiteAlias\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Manage alias records for local and remote sites.", + "time": "2019-03-12T17:31:48+00:00" + }, + { + "name": "consolidation/site-process", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-process.git", + "reference": "e25265f4a48c13284ebb6f9e0906ecd415d451df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-process/zipball/e25265f4a48c13284ebb6f9e0906ecd415d451df", + "reference": "e25265f4a48c13284ebb6f9e0906ecd415d451df", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "consolidation/site-alias": "^3", + "php": ">=5.6.0", + "symfony/process": "^3.4" + }, + "require-dev": { + "consolidation/robo": "^1.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\SiteProcess\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.", + "time": "2019-06-04T22:23:52+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "0.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", + "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "@stable" + }, + "type": "project", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "time": "2014-10-24T07:27:01+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "jakub-onderka/php-console-color", + "version": "v0.2", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", + "reference": "d5deaecff52a0d61ccb613bb3804088da0307191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", + "reference": "d5deaecff52a0d61ccb613bb3804088da0307191", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "1.0", + "jakub-onderka/php-parallel-lint": "1.0", + "jakub-onderka/php-var-dump-check": "0.*", + "phpunit/phpunit": "~4.3", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "JakubOnderka\\PhpConsoleColor\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com" + } + ], + "time": "2018-09-29T17:23:10+00:00" + }, + { + "name": "jakub-onderka/php-console-highlighter", + "version": "v0.4", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", + "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/9f7a229a69d52506914b4bc61bfdb199d90c5547", + "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "jakub-onderka/php-console-color": "~0.2", + "php": ">=5.4.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "~1.0", + "jakub-onderka/php-parallel-lint": "~1.0", + "jakub-onderka/php-var-dump-check": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "JakubOnderka\\PhpConsoleHighlighter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "acci@acci.cz", + "homepage": "http://www.acci.cz/" + } + ], + "description": "Highlight PHP code in terminal", + "time": "2018-09-29T18:48:56+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.9.9", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", + "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", + "shasum": "" + }, + "require": { + "dnoegel/php-xdg-base-dir": "0.1", + "ext-json": "*", + "ext-tokenizer": "*", + "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*", + "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", + "php": ">=5.4.0", + "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", + "symfony/var-dumper": "~2.7|~3.0|~4.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "hoa/console": "~2.15|~3.16", + "phpunit/phpunit": "~4.8.35|~5.0|~6.0|~7.0" + }, + "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-develop": "0.9.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" + ], + "time": "2018-10-13T15:16:03+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/6b217594552b9323bcdcfc14f8a0ce126e84cd73", + "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "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" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:19:56+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "c4625e75341e4fb309ce0c049cbf7fb84b8897cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/c4625e75341e4fb309ce0c049cbf7fb84b8897cd", + "reference": "c4625e75341e4fb309ce0c049cbf7fb84b8897cd", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-08-03T10:42:44+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T09:06:28+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-02-04T21:34:32+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "fa5d962a71f2169dfe1cbae217fa5a2799859f6c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/fa5d962a71f2169dfe1cbae217fa5a2799859f6c", + "reference": "fa5d962a71f2169dfe1cbae217fa5a2799859f6c", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-05-24T12:25:55+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/4d6b125d5293cbceedc2aa10f2c71617e76262e7", + "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2018-08-03T10:42:44+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v3.4.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "ca5fef348a0440411bbca0f9ec14e9a11625bd6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ca5fef348a0440411bbca0f9ec14e9a11625bd6a", + "reference": "ca5fef348a0440411bbca0f9ec14e9a11625bd6a", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, + "require-dev": { + "ext-iconv": "*", + "twig/twig": "~1.34|~2.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "ext-symfony_debug": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "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": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2019-05-01T09:52:10+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c2f4812ead9f847cb69e90917ca7502e6892d6b8", + "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-08-10T07:34:36+00:00" + }, + { + "name": "twig/twig", + "version": "v1.38.2", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "874adbd9222f928f6998732b25b01b41dff15b0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/874adbd9222f928f6998732b25b01b41dff15b0c", + "reference": "874adbd9222f928f6998732b25b01b41dff15b0c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "^2.7", + "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.38-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "https://twig.symfony.com/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "time": "2019-03-12T18:45:24+00:00" + }, + { + "name": "webflo/drupal-finder", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-finder.git", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/8a7886c575d6eaa67a425dceccc84e735c0b9637", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637", + "shasum": "" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/DrupalFinder.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Florian Weber", + "email": "florian@webflo.org" + } + ], + "description": "Helper class to locate a Drupal installation from a given path.", + "time": "2017-10-24T08:12:11+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "time": "2015-12-17T08:42:14+00:00" + } + ], + "packages-dev": [ + { + "name": "asm89/stack-cors", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/asm89/stack-cors.git", + "reference": "c163e2b614550aedcf71165db2473d936abbced6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/asm89/stack-cors/zipball/c163e2b614550aedcf71165db2473d936abbced6", + "reference": "c163e2b614550aedcf71165db2473d936abbced6", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/http-foundation": "~2.7|~3.0|~4.0", + "symfony/http-kernel": "~2.7|~3.0|~4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8.10", + "squizlabs/php_codesniffer": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Asm89\\Stack\\": "src/Asm89/Stack/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander", + "email": "iam.asm89@gmail.com" + } + ], + "description": "Cross-origin resource sharing library and stack middleware", + "homepage": "https://github.com/asm89/stack-cors", + "keywords": [ + "cors", + "stack" + ], + "time": "2017-12-20T14:37:45+00:00" + }, + { + "name": "behat/mink", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "6d637f7af4816c26ad8a943da2e3f7eef1231bea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/6d637f7af4816c26ad8a943da2e3f7eef1231bea", + "reference": "6d637f7af4816c26ad8a943da2e3f7eef1231bea", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "^2.7|^3.0|^4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3|^4.0" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)", + "dmore/chrome-mink-driver": "fast and JS-enabled driver for any app (requires chromium or google chrome)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Browser controller/emulator abstraction for PHP", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ], + "time": "2019-05-14T09:56:49+00:00" + }, + { + "name": "behat/mink-browserkit-driver", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", + "reference": "1b9a7ce903cfdaaec5fb32bfdbb26118343662eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/1b9a7ce903cfdaaec5fb32bfdbb26118343662eb", + "reference": "1b9a7ce903cfdaaec5fb32bfdbb26118343662eb", + "shasum": "" + }, + "require": { + "behat/mink": "^1.7.1@dev", + "php": ">=5.3.6", + "symfony/browser-kit": "~2.3|~3.0|~4.0", + "symfony/dom-crawler": "~2.3|~3.0|~4.0" + }, + "require-dev": { + "mink/driver-testsuite": "dev-master", + "symfony/http-kernel": "~2.3|~3.0|~4.0" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Symfony2 BrowserKit driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "Mink", + "Symfony2", + "browser", + "testing" + ], + "time": "2018-05-02T09:25:31+00:00" + }, + { + "name": "behat/mink-goutte-driver", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkGoutteDriver.git", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "shasum": "" + }, + "require": { + "behat/mink": "~1.6@dev", + "behat/mink-browserkit-driver": "~1.2@dev", + "fabpot/goutte": "~1.0.4|~2.0|~3.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7|~3.0" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Goutte driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "goutte", + "headless", + "testing" + ], + "time": "2016-03-05T09:04:22+00:00" + }, + { + "name": "behat/mink-selenium2-driver", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkSelenium2Driver.git", + "reference": "8684ee4e634db7abda9039ea53545f86fc1e105a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/8684ee4e634db7abda9039ea53545f86fc1e105a", + "reference": "8684ee4e634db7abda9039ea53545f86fc1e105a", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1", + "php": ">=5.3.1" + }, + "require-dev": { + "mink/driver-testsuite": "dev-master" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ], + "time": "2018-10-10T12:39:06+00:00" + }, + { + "name": "brumann/polyfill-unserialize", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/dbrumann/polyfill-unserialize.git", + "reference": "844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dbrumann/polyfill-unserialize/zipball/844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b", + "reference": "844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brumann\\Polyfill\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Denis Brumann", + "email": "denis.brumann@sensiolabs.de" + } + ], + "description": "Backports unserialize options introduced in PHP 7.0 to older PHP versions.", + "time": "2017-02-03T09:55:47+00:00" + }, + { + "name": "composer/installers", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "049797d727261bf27f2690430d935067710049c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2", + "reference": "049797d727261bf27f2690430d935067710049c2", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "^4.8.36" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Thelia", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "modulework", + "modx", + "moodle", + "osclass", + "phpbb", + "piwik", + "ppi", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "time": "2017-12-29T09:13:20+00:00" + }, + { + "name": "cweagans/composer-patches", + "version": "1.6.6", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "1d89dcc730e7f42426c434b88261fcfb3bce651e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/1d89dcc730e7f42426c434b88261fcfb3bce651e", + "reference": "1d89dcc730e7f42426c434b88261fcfb3bce651e", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0", + "phpunit/phpunit": "~4.6" + }, + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "time": "2018-10-24T15:51:16+00:00" + }, + { + "name": "doctrine/annotations", + "version": "v1.2.7", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Annotations\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2015-08-31T12:32:49+00:00" + }, + { + "name": "doctrine/cache", + "version": "v1.6.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", + "shasum": "" + }, + "require": { + "php": "~5.5|~7.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": "~4.8|~5.0", + "predis/predis": "~1.0", + "satooshi/php-coveralls": "~0.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2017-07-22T12:49:21+00:00" + }, + { + "name": "doctrine/collections", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ], + "time": "2015-04-14T22:21:58+00:00" + }, + { + "name": "doctrine/common", + "version": "v2.6.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3", + "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": "~5.5|~7.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8|~5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ], + "time": "2016-11-30T16:50:46+00:00" + }, + { + "name": "doctrine/inflector", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Inflector\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2015-11-06T14:35:42+00:00" + }, + { + "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-14T21:17:01+00:00" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, + { + "name": "drupal/alinks", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/alinks.git", + "reference": "8.x-1.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/alinks-8.x-1.0.zip", + "reference": "8.x-1.0", + "shasum": "299713497d4d88136b2a7212ee0cbb851e97848f" + }, + "require": { + "drupal/core": "*", + "wamania/php-stemmer": "^1.0" + }, + "type": "drupal-module", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + }, + "drupal": { + "version": "8.x-1.0", + "datestamp": "1533185792", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Greg Boggs", + "homepage": "https://www.drupal.org/user/153069" + }, + { + "name": "Ivo.Radulovski", + "homepage": "https://www.drupal.org/user/337498" + }, + { + "name": "chinajason", + "homepage": "https://www.drupal.org/user/276946" + }, + { + "name": "gaurav.goyal", + "homepage": "https://www.drupal.org/user/2497208" + }, + { + "name": "joebachana", + "homepage": "https://www.drupal.org/user/113430" + }, + { + "name": "rsvelko", + "homepage": "https://www.drupal.org/user/337401" + }, + { + "name": "tic2000", + "homepage": "https://www.drupal.org/user/103877" + } + ], + "description": "Allows editors to automatically transform keyword phrases into links", + "homepage": "https://www.drupal.org/project/alinks", + "keywords": [ + "Drupal" + ], + "support": { + "source": "http://cgit.drupalcode.org/alinks", + "issues": "https://www.drupal.org/project/issues/alinks" + } + }, + { + "name": "drupal/coder", + "version": "8.3.5", + "source": { + "type": "git", + "url": "https://git.drupal.org/project/coder.git", + "reference": "35277fc8675b6a2cbb194f8880145a9c85c845c4" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.5.9", + "squizlabs/php_codesniffer": "^3.4.1", + "symfony/yaml": ">=2.0.5" + }, + "require-dev": { + "phpunit/phpunit": ">=3.7 <6" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-0": { + "Drupal\\": "coder_sniffer/Drupal/", + "DrupalPractice\\": "coder_sniffer/DrupalPractice/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "Coder is a library to review Drupal code.", + "homepage": "https://www.drupal.org/project/coder", + "keywords": [ + "code review", + "phpcs", + "standards" + ], + "time": "2019-06-14T15:06:06+00:00" + }, + { + "name": "drupal/core", + "version": "8.6.x-dev", + "source": { + "type": "git", + "url": "https://github.com/drupal/core.git", + "reference": "2778155558614c909ffea4d5a6f3eb62ed8e5617" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/drupal/core/zipball/2778155558614c909ffea4d5a6f3eb62ed8e5617", + "reference": "2778155558614c909ffea4d5a6f3eb62ed8e5617", + "shasum": "" + }, + "require": { + "asm89/stack-cors": "^1.1", + "composer/semver": "^1.0", + "doctrine/annotations": "^1.2", + "doctrine/common": "^2.5", + "easyrdf/easyrdf": "^0.9", + "egulias/email-validator": "^1.2", + "ext-date": "*", + "ext-dom": "*", + "ext-filter": "*", + "ext-gd": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-pdo": "*", + "ext-session": "*", + "ext-simplexml": "*", + "ext-spl": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "guzzlehttp/guzzle": "^6.2.1", + "masterminds/html5": "^2.1", + "paragonie/random_compat": "^1.0|^2.0", + "php": "^5.5.9|>=7.0.8", + "stack/builder": "^1.0", + "symfony-cmf/routing": "^1.4", + "symfony/class-loader": "~3.4.0", + "symfony/console": "~3.4.0", + "symfony/dependency-injection": "~3.4.26", + "symfony/event-dispatcher": "~3.4.0", + "symfony/http-foundation": "~3.4.27", + "symfony/http-kernel": "~3.4.14", + "symfony/polyfill-iconv": "^1.0", + "symfony/process": "~3.4.0", + "symfony/psr-http-message-bridge": "^1.0", + "symfony/routing": "~3.4.0", + "symfony/serializer": "~3.4.0", + "symfony/translation": "~3.4.0", + "symfony/validator": "~3.4.0", + "symfony/yaml": "~3.4.5", + "twig/twig": "^1.38.2", + "typo3/phar-stream-wrapper": "^2.1.1", + "zendframework/zend-diactoros": "^1.1", + "zendframework/zend-feed": "^2.4" + }, + "conflict": { + "drush/drush": "<8.1.10" + }, + "replace": { + "drupal/action": "self.version", + "drupal/aggregator": "self.version", + "drupal/automated_cron": "self.version", + "drupal/ban": "self.version", + "drupal/bartik": "self.version", + "drupal/basic_auth": "self.version", + "drupal/big_pipe": "self.version", + "drupal/block": "self.version", + "drupal/block_content": "self.version", + "drupal/block_place": "self.version", + "drupal/book": "self.version", + "drupal/breakpoint": "self.version", + "drupal/ckeditor": "self.version", + "drupal/classy": "self.version", + "drupal/color": "self.version", + "drupal/comment": "self.version", + "drupal/config": "self.version", + "drupal/config_translation": "self.version", + "drupal/contact": "self.version", + "drupal/content_moderation": "self.version", + "drupal/content_translation": "self.version", + "drupal/contextual": "self.version", + "drupal/core-annotation": "self.version", + "drupal/core-assertion": "self.version", + "drupal/core-bridge": "self.version", + "drupal/core-class-finder": "self.version", + "drupal/core-datetime": "self.version", + "drupal/core-dependency-injection": "self.version", + "drupal/core-diff": "self.version", + "drupal/core-discovery": "self.version", + "drupal/core-event-dispatcher": "self.version", + "drupal/core-file-cache": "self.version", + "drupal/core-filesystem": "self.version", + "drupal/core-gettext": "self.version", + "drupal/core-graph": "self.version", + "drupal/core-http-foundation": "self.version", + "drupal/core-php-storage": "self.version", + "drupal/core-plugin": "self.version", + "drupal/core-proxy-builder": "self.version", + "drupal/core-render": "self.version", + "drupal/core-serialization": "self.version", + "drupal/core-transliteration": "self.version", + "drupal/core-utility": "self.version", + "drupal/core-uuid": "self.version", + "drupal/datetime": "self.version", + "drupal/datetime_range": "self.version", + "drupal/dblog": "self.version", + "drupal/dynamic_page_cache": "self.version", + "drupal/editor": "self.version", + "drupal/entity_reference": "self.version", + "drupal/field": "self.version", + "drupal/field_layout": "self.version", + "drupal/field_ui": "self.version", + "drupal/file": "self.version", + "drupal/filter": "self.version", + "drupal/forum": "self.version", + "drupal/hal": "self.version", + "drupal/help": "self.version", + "drupal/history": "self.version", + "drupal/image": "self.version", + "drupal/inline_form_errors": "self.version", + "drupal/language": "self.version", + "drupal/layout_builder": "self.version", + "drupal/layout_discovery": "self.version", + "drupal/link": "self.version", + "drupal/locale": "self.version", + "drupal/media": "self.version", + "drupal/media_library": "self.version", + "drupal/menu_link_content": "self.version", + "drupal/menu_ui": "self.version", + "drupal/migrate": "self.version", + "drupal/migrate_drupal": "self.version", + "drupal/migrate_drupal_multilingual": "self.version", + "drupal/migrate_drupal_ui": "self.version", + "drupal/minimal": "self.version", + "drupal/node": "self.version", + "drupal/options": "self.version", + "drupal/page_cache": "self.version", + "drupal/path": "self.version", + "drupal/quickedit": "self.version", + "drupal/rdf": "self.version", + "drupal/responsive_image": "self.version", + "drupal/rest": "self.version", + "drupal/search": "self.version", + "drupal/serialization": "self.version", + "drupal/settings_tray": "self.version", + "drupal/seven": "self.version", + "drupal/shortcut": "self.version", + "drupal/simpletest": "self.version", + "drupal/standard": "self.version", + "drupal/stark": "self.version", + "drupal/statistics": "self.version", + "drupal/syslog": "self.version", + "drupal/system": "self.version", + "drupal/taxonomy": "self.version", + "drupal/telephone": "self.version", + "drupal/text": "self.version", + "drupal/toolbar": "self.version", + "drupal/tour": "self.version", + "drupal/tracker": "self.version", + "drupal/update": "self.version", + "drupal/user": "self.version", + "drupal/views": "self.version", + "drupal/views_ui": "self.version", + "drupal/workflows": "self.version", + "drupal/workspaces": "self.version" + }, + "require-dev": { + "behat/mink": "1.7.x-dev", + "behat/mink-goutte-driver": "^1.2", + "behat/mink-selenium2-driver": "1.3.x-dev", + "drupal/coder": "^8.2.12", + "jcalderonzumba/gastonjs": "^1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "mikey179/vfsstream": "^1.2", + "phpspec/prophecy": "^1.7", + "phpunit/phpunit": "^4.8.35 || ^6.5", + "symfony/css-selector": "^3.4.0", + "symfony/debug": "^3.4.0", + "symfony/phpunit-bridge": "^3.4.3" + }, + "type": "drupal-core", + "extra": { + "merge-plugin": { + "require": [ + "core/lib/Drupal/Component/Annotation/composer.json", + "core/lib/Drupal/Component/Assertion/composer.json", + "core/lib/Drupal/Component/Bridge/composer.json", + "core/lib/Drupal/Component/ClassFinder/composer.json", + "core/lib/Drupal/Component/Datetime/composer.json", + "core/lib/Drupal/Component/DependencyInjection/composer.json", + "core/lib/Drupal/Component/Diff/composer.json", + "core/lib/Drupal/Component/Discovery/composer.json", + "core/lib/Drupal/Component/EventDispatcher/composer.json", + "core/lib/Drupal/Component/FileCache/composer.json", + "core/lib/Drupal/Component/FileSystem/composer.json", + "core/lib/Drupal/Component/Gettext/composer.json", + "core/lib/Drupal/Component/Graph/composer.json", + "core/lib/Drupal/Component/HttpFoundation/composer.json", + "core/lib/Drupal/Component/PhpStorage/composer.json", + "core/lib/Drupal/Component/Plugin/composer.json", + "core/lib/Drupal/Component/ProxyBuilder/composer.json", + "core/lib/Drupal/Component/Render/composer.json", + "core/lib/Drupal/Component/Serialization/composer.json", + "core/lib/Drupal/Component/Transliteration/composer.json", + "core/lib/Drupal/Component/Utility/composer.json", + "core/lib/Drupal/Component/Uuid/composer.json" + ], + "recurse": false, + "replace": false, + "merge-extra": false + } + }, + "autoload": { + "psr-4": { + "Drupal\\Core\\": "lib/Drupal/Core", + "Drupal\\Component\\": "lib/Drupal/Component", + "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver" + }, + "classmap": [ + "lib/Drupal.php", + "lib/Drupal/Component/Utility/Timer.php", + "lib/Drupal/Component/Utility/Unicode.php", + "lib/Drupal/Core/Database/Database.php", + "lib/Drupal/Core/DrupalKernel.php", + "lib/Drupal/Core/DrupalKernelInterface.php", + "lib/Drupal/Core/Site/Settings.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Drupal is an open source content management platform powering millions of websites and applications.", + "time": "2019-06-17T07:27:38+00:00" + }, + { + "name": "drupal/devel", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/devel.git", + "reference": "8.x-2.1" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/devel-8.x-2.1.zip", + "reference": "8.x-2.1", + "shasum": "8f735892922aa5f228e681e645e5f02b1c008f14" + }, + "require": { + "drupal/core": "~8.0", + "symfony/var-dumper": "~2.7|^3|^4" + }, + "type": "drupal-module", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + }, + "drupal": { + "version": "8.x-2.1", + "datestamp": "1556799496", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + }, + "drush": { + "services": { + "drush.services.yml": "^9" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "homepage": "https://github.com/weitzman", + "email": "weitzman@tejasa.com", + "role": "Maintainer" + }, + { + "name": "Hans Salvisberg", + "homepage": "https://www.drupal.org/u/salvis", + "email": "drupal@salvisberg.com", + "role": "Maintainer" + }, + { + "name": "Luca Lusso", + "homepage": "https://www.drupal.org/u/lussoluca", + "role": "Maintainer" + }, + { + "name": "Marco (willzyx)", + "homepage": "https://www.drupal.org/u/willzyx", + "role": "Maintainer" + }, + { + "name": "See contributors", + "homepage": "https://www.drupal.org/node/3236/committers" + }, + { + "name": "salvis", + "homepage": "https://www.drupal.org/user/82964" + }, + { + "name": "willzyx", + "homepage": "https://www.drupal.org/user/1043862" + } + ], + "description": "Various blocks, pages, and functions for developers.", + "homepage": "http://drupal.org/project/devel", + "support": { + "source": "http://cgit.drupalcode.org/devel", + "issues": "http://drupal.org/project/devel", + "irc": "irc://irc.freenode.org/drupal-contribute" + } + }, + { + "name": "drupal/empty_theme", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/empty_theme.git", + "reference": "8.x-1.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/empty_theme-8.x-1.0.zip", + "reference": "8.x-1.0", + "shasum": "04e6d2493d2ed9f84cde3d01c3442a34dcbeea18" + }, + "require": { + "drupal/core": "~8.0" + }, + "type": "drupal-theme", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + }, + "drupal": { + "version": "8.x-1.0", + "datestamp": "1488718983", + "security-coverage": { + "status": "not-covered", + "message": "Project has not opted into security advisory coverage!" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Dave Reid", + "homepage": "https://www.drupal.org/user/53892" + }, + { + "name": "moshe weitzman", + "homepage": "https://www.drupal.org/user/23" + } + ], + "description": "An empty theme to use for testing.", + "homepage": "https://www.drupal.org/project/empty_theme", + "support": { + "source": "http://cgit.drupalcode.org/empty_theme" + } + }, + { + "name": "easyrdf/easyrdf", + "version": "0.9.1", + "source": { + "type": "git", + "url": "https://github.com/njh/easyrdf.git", + "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/njh/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566", + "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-pcre": "*", + "php": ">=5.2.8" + }, + "require-dev": { + "phpunit/phpunit": "~3.5", + "sami/sami": "~1.4", + "squizlabs/php_codesniffer": "~1.4.3" + }, + "suggest": { + "ml/json-ld": "~1.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "EasyRdf_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nicholas Humfrey", + "email": "njh@aelius.com", + "homepage": "http://www.aelius.com/njh/", + "role": "Developer" + }, + { + "name": "Alexey Zakhlestin", + "email": "indeyets@gmail.com", + "role": "Developer" + } + ], + "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", + "homepage": "http://www.easyrdf.org/", + "keywords": [ + "Linked Data", + "RDF", + "Semantic Web", + "Turtle", + "rdfa", + "sparql" + ], + "time": "2015-02-27T09:45:49+00:00" + }, + { + "name": "egulias/email-validator", + "version": "1.2.14", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "5642614492f0ca2064c01d60cc33284cc2f731a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/5642614492f0ca2064c01d60cc33284cc2f731a9", + "reference": "5642614492f0ca2064c01d60cc33284cc2f731a9", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^1.0.1", + "php": ">= 5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Egulias\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "time": "2017-02-03T22:48:59+00:00" + }, + { + "name": "fabpot/goutte", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "3f0eaf0a40181359470651f1565b3e07e3dd31b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/3f0eaf0a40181359470651f1565b3e07e3dd31b8", + "reference": "3f0eaf0a40181359470651f1565b3e07e3dd31b8", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1|~3.0|~4.0", + "symfony/css-selector": "~2.1|~3.0|~4.0", + "symfony/dom-crawler": "~2.1|~3.0|~4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3 || ^4" + }, + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Goutte\\": "Goutte" + }, + "exclude-from-classmap": [ + "Goutte/Tests" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", + "keywords": [ + "scraper" + ], + "time": "2018-06-29T15:13:57+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/28f932580981e912ab8f01d15788f1dee06550c8", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2019-02-11T20:22:44+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-06-22T18:50:49+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "instaclick/php-webdriver", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "6fa959452e774dcaed543faad3a9d1a37d803327" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/6fa959452e774dcaed543faad3a9d1a37d803327", + "reference": "6fa959452e774dcaed543faad3a9d1a37d803327", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "satooshi/php-coveralls": "^1.0||^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ], + "time": "2017-06-30T04:02:48+00:00" + }, + { + "name": "jcalderonzumba/gastonjs", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/jcalderonzumba/gastonjs.git", + "reference": "575a9c18d8b87990c37252e8d9707b29f0a313f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/575a9c18d8b87990c37252e8d9707b29f0a313f3", + "reference": "575a9c18d8b87990c37252e8d9707b29f0a313f3", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~5.0|~6.0", + "php": ">=5.4" + }, + "require-dev": { + "phpunit/phpunit": "~4.6", + "silex/silex": "~1.2", + "symfony/phpunit-bridge": "~2.7", + "symfony/process": "~2.1" + }, + "type": "phantomjs-api", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zumba\\GastonJS\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Juan Francisco Calderón Zumba", + "email": "juanfcz@gmail.com", + "homepage": "http://github.com/jcalderonzumba" + } + ], + "description": "PhantomJS API based server for webpage automation", + "homepage": "https://github.com/jcalderonzumba/gastonjs", + "keywords": [ + "api", + "automation", + "browser", + "headless", + "phantomjs" + ], + "time": "2017-03-31T07:31:47+00:00" + }, + { + "name": "jcalderonzumba/mink-phantomjs-driver", + "version": "v0.3.3", + "source": { + "type": "git", + "url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git", + "reference": "008f43670e94acd39273d15add1e7348eb23848d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/008f43670e94acd39273d15add1e7348eb23848d", + "reference": "008f43670e94acd39273d15add1e7348eb23848d", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7", + "jcalderonzumba/gastonjs": "~1.0", + "php": ">=5.4", + "twig/twig": "~1.20|~2.0" + }, + "require-dev": { + "mink/driver-testsuite": "dev-master", + "phpunit/phpunit": "~4.6" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "0.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zumba\\Mink\\Driver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Juan Francisco Calderón Zumba", + "email": "juanfcz@gmail.com", + "homepage": "http://github.com/jcalderonzumba" + } + ], + "description": "PhantomJS driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "headless", + "javascript", + "phantomjs", + "testing" + ], + "time": "2016-12-01T10:57:30+00:00" + }, + { + "name": "lox/xhprof", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/lox/xhprof.git", + "reference": "c64571f892bda1298bad9c5e94ede0bc3f0e4627" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lox/xhprof/zipball/c64571f892bda1298bad9c5e94ede0bc3f0e4627", + "reference": "c64571f892bda1298bad9c5e94ede0bc3f0e4627", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "bin": [ + "bin/xhprofile" + ], + "type": "library", + "autoload": { + "files": [ + "xhprof_lib/utils/xhprof_lib.php", + "xhprof_lib/utils/xhprof_runs.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "XHProf: A Hierarchical Profiler for PHP", + "homepage": "http://pecl.php.net/package/xhprof", + "keywords": [ + "performance", + "profiling" + ], + "time": "2015-08-31T22:07:48+00:00" + }, + { + "name": "masterminds/html5", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "2c37c6c520b995b761674de3be8455a381679067" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/2c37c6c520b995b761674de3be8455a381679067", + "reference": "2c37c6c520b995b761674de3be8455a381679067", + "shasum": "" + }, + "require": { + "ext-libxml": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "sami/sami": "~2.0", + "satooshi/php-coveralls": "1.0.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "time": "2017-09-04T12:26:28+00:00" + }, + { + "name": "mikey179/vfsStream", + "version": "v1.6.6", + "source": { + "type": "git", + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "org\\bovigo\\vfs\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Frank Kleine", + "homepage": "http://frankkleine.de/", + "role": "Developer" + } + ], + "description": "Virtual file system to mock the real file system in unit tests.", + "homepage": "http://vfs.bovigo.org/", + "time": "2019-04-08T13:54:32+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.17", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-04T16:31:37+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-10T14:09:06+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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" + ], + "time": "2019-06-13T12:50:23+00:00" + }, + { + "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-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "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.2.2", + "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": "2017-06-21T08:07:12+00:00" + }, + { + "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" + ], + "abandoned": true, + "time": "2015-10-02T06:51:40+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "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": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "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": "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": "2016-06-17T09:04:28+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "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": "2016-10-03T07:41:43+00:00" + }, + { + "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-21T13:59:46+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.4.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2019-04-10T23:49:02+00:00" + }, + { + "name": "stack/builder", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/stackphp/builder.git", + "reference": "fb3d136d04c6be41120ebf8c0cc71fe9507d750a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stackphp/builder/zipball/fb3d136d04c6be41120ebf8c0cc71fe9507d750a", + "reference": "fb3d136d04c6be41120ebf8c0cc71fe9507d750a", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/http-foundation": "~2.1|~3.0|~4.0", + "symfony/http-kernel": "~2.1|~3.0|~4.0" + }, + "require-dev": { + "silex/silex": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Stack": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Builder for stack middlewares based on HttpKernelInterface.", + "keywords": [ + "stack" + ], + "time": "2017-11-18T14:57:29+00:00" + }, + { + "name": "symfony-cmf/routing", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/symfony-cmf/routing.git", + "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony-cmf/routing/zipball/fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac", + "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac", + "shasum": "" + }, + "require": { + "php": "^5.3.9|^7.0", + "psr/log": "1.*", + "symfony/http-kernel": "^2.2|3.*", + "symfony/routing": "^2.2|3.*" + }, + "require-dev": { + "friendsofsymfony/jsrouting-bundle": "^1.1", + "symfony-cmf/testing": "^1.3", + "symfony/config": "^2.2|3.*", + "symfony/dependency-injection": "^2.0.5|3.*", + "symfony/event-dispatcher": "^2.1|3.*" + }, + "suggest": { + "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version (~2.1)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Cmf\\Component\\Routing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony CMF Community", + "homepage": "https://github.com/symfony-cmf/Routing/contributors" + } + ], + "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers", + "homepage": "http://cmf.symfony.com", + "keywords": [ + "database", + "routing" + ], + "time": "2017-05-09T08:10:41+00:00" + }, + { + "name": "symfony/browser-kit", + "version": "v3.4.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/7f2b0843d5045468225f9a9b27a0cb171ae81828", + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/dom-crawler": "~2.8|~3.0|~4.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com", + "time": "2019-04-06T19:33:58+00:00" + }, + { + "name": "symfony/class-loader", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/class-loader.git", + "reference": "31db283fc86d3143e7ff87e922177b457d909c30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/31db283fc86d3143e7ff87e922177b457d909c30", + "reference": "31db283fc86d3143e7ff87e922177b457d909c30", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "require-dev": { + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/polyfill-apcu": "~1.1" + }, + "suggest": { + "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ClassLoader\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ClassLoader Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:19:56+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v3.4.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "8ca29297c29b64fb3a1a135e71cb25f67f9fdccf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/8ca29297c29b64fb3a1a135e71cb25f67f9fdccf", + "reference": "8ca29297c29b64fb3a1a135e71cb25f67f9fdccf", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T09:39:14+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "dee85a9148399cdb2731603802842bcfd8afe5ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/dee85a9148399cdb2731603802842bcfd8afe5ab", + "reference": "dee85a9148399cdb2731603802842bcfd8afe5ab", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/container": "^1.0" + }, + "conflict": { + "symfony/config": "<3.3.7", + "symfony/finder": "<3.3", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0" + }, + "require-dev": { + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2019-04-16T11:13:42+00:00" + }, + { + "name": "symfony/dom-crawler", + "version": "v3.4.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d40023c057393fb25f7ca80af2a56ed948c45a09", + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v3.4.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "677ae5e892b081e71a665bfa7dd90fe61800c00e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/677ae5e892b081e71a665bfa7dd90fe61800c00e", + "reference": "677ae5e892b081e71a665bfa7dd90fe61800c00e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php70": "~1.6" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2019-05-27T05:50:24+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "2819693b25f480966cbfa13b651abccfed4871ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2819693b25f480966cbfa13b651abccfed4871ca", + "reference": "2819693b25f480966cbfa13b651abccfed4871ca", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~3.4.12|~4.0.12|^4.1.1", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4.10|<4.0.10,>=4", + "symfony/var-dumper": "<3.3", + "twig/twig": "<1.34|<2.4,>=2" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/cache": "~1.0", + "symfony/browser-kit": "~2.8|~3.0|~4.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/console": "~2.8|~3.0|~4.0", + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "^3.4.10|^4.0.10", + "symfony/dom-crawler": "~2.8|~3.0|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0", + "symfony/templating": "~2.8|~3.0|~4.0", + "symfony/translation": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~3.3|~4.0" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "", + "symfony/var-dumper": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "https://symfony.com", + "time": "2018-08-28T06:06:12+00:00" + }, + { + "name": "symfony/phpunit-bridge", + "version": "v3.4.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/phpunit-bridge.git", + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/a43a2f6c465a2d99635fea0addbebddc3864ad97", + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, + "suggest": { + "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" + }, + "bin": [ + "bin/simple-phpunit" + ], + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + }, + "thanks": { + "name": "phpunit/phpunit", + "url": "https://github.com/sebastianbergmann/phpunit" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Bridge\\PhpUnit\\": "" + }, + "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": "Symfony PHPUnit Bridge", + "homepage": "https://symfony.com", + "time": "2019-04-16T09:03:16+00:00" + }, + { + "name": "symfony/polyfill-iconv", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-iconv.git", + "reference": "bcc0cd69185b8a5d8b4a5400c489ed3333bf9bb2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/bcc0cd69185b8a5d8b4a5400c489ed3333bf9bb2", + "reference": "bcc0cd69185b8a5d8b4a5400c489ed3333bf9bb2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-iconv": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Iconv\\": "" + }, + "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 for the Iconv extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "iconv", + "polyfill", + "portable", + "shim" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/psr-http-message-bridge", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "53c15a6a7918e6c2ab16ae370ea607fb40cab196" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/53c15a6a7918e6c2ab16ae370ea607fb40cab196", + "reference": "53c15a6a7918e6c2ab16ae370ea607fb40cab196", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "psr/http-message": "^1.0", + "symfony/http-foundation": "^2.3.42 || ^3.4 || ^4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.4 || 4.0" + }, + "suggest": { + "psr/http-factory-implementation": "To use the PSR-17 factory", + "psr/http-message-implementation": "To use the HttpFoundation factory", + "zendframework/zend-diactoros": "To use the Zend Diactoros factory" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\PsrHttpMessage\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "PSR HTTP message bridge", + "homepage": "http://symfony.com", + "keywords": [ + "http", + "http-message", + "psr-7" + ], + "time": "2018-08-30T16:28:28+00:00" + }, + { + "name": "symfony/routing", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "e20f4bb79502c3c0db86d572f7683a30d4143911" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/e20f4bb79502c3c0db86d572f7683a30d4143911", + "reference": "e20f4bb79502c3c0db86d572f7683a30d4143911", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/config": "<3.3.1", + "symfony/dependency-injection": "<3.3", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "psr/log": "~1.0", + "symfony/config": "^3.3.1|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/dependency-injection": "For loading routes from a service", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "time": "2018-07-26T11:19:56+00:00" + }, + { + "name": "symfony/serializer", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/serializer.git", + "reference": "40031683816470610af87c2d03ea86d1cf0f0104" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/serializer/zipball/40031683816470610af87c2d03ea86d1cf0f0104", + "reference": "40031683816470610af87c2d03ea86d1cf0f0104", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "phpdocumentor/type-resolver": "<0.2.1", + "symfony/dependency-injection": "<3.2", + "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", + "symfony/property-info": "<3.1", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", + "symfony/cache": "~3.1|~4.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.2|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/property-access": "~2.8|~3.0|~4.0", + "symfony/property-info": "~3.1|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/http-foundation": "To use the DataUriNormalizer.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/property-info": "To deserialize relations.", + "symfony/yaml": "For using the default YAML mapping loader." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Serializer Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:58:24+00:00" + }, + { + "name": "symfony/translation", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "9749930bfc825139aadd2d28461ddbaed6577862" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/9749930bfc825139aadd2d28461ddbaed6577862", + "reference": "9749930bfc825139aadd2d28461ddbaed6577862", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:19:56+00:00" + }, + { + "name": "symfony/validator", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "5a9ca502663e32aed3302b00121f978d70a09ab9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/5a9ca502663e32aed3302b00121f978d70a09ab9", + "reference": "5a9ca502663e32aed3302b00121f978d70a09ab9", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~2.8|~3.0|~4.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/dependency-injection": "<3.3", + "symfony/http-kernel": "<3.3.5", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.8|~2.0", + "symfony/cache": "~3.1|~4.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/http-kernel": "^3.3.5|~4.0", + "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/property-access": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~3.3|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "", + "symfony/expression-language": "For using the Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For accessing properties within comparison constraints", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "https://symfony.com", + "time": "2018-08-07T09:33:53+00:00" + }, + { + "name": "typo3/phar-stream-wrapper", + "version": "v2.1.2", + "source": { + "type": "git", + "url": "https://github.com/TYPO3/phar-stream-wrapper.git", + "reference": "057622f5a3b92a5ffbea0fbaadce573500a62870" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TYPO3/phar-stream-wrapper/zipball/057622f5a3b92a5ffbea0fbaadce573500a62870", + "reference": "057622f5a3b92a5ffbea0fbaadce573500a62870", + "shasum": "" + }, + "require": { + "brumann/polyfill-unserialize": "^1.0", + "ext-json": "*", + "php": "^5.3.3|^7.0" + }, + "require-dev": { + "ext-xdebug": "*", + "phpunit/phpunit": "^4.8.36" + }, + "suggest": { + "ext-fileinfo": "For PHP builtin file type guessing, otherwise uses internal processing" + }, + "type": "library", + "autoload": { + "psr-4": { + "TYPO3\\PharStreamWrapper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Interceptors for PHP's native phar:// stream handling", + "homepage": "https://typo3.org/", + "keywords": [ + "phar", + "php", + "security", + "stream-wrapper" + ], + "time": "2019-05-14T13:14:31+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v2.6.1", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "2a7dcf7e3e02dc5e701004e51a6f304b713107d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2a7dcf7e3e02dc5e701004e51a6f304b713107d5", + "reference": "2a7dcf7e3e02dc5e701004e51a6f304b713107d5", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "^1.9" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "http://www.vancelucas.com" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "time": "2019-01-29T11:11:52+00:00" + }, + { + "name": "wamania/php-stemmer", + "version": "1.2", + "source": { + "type": "git", + "url": "https://github.com/wamania/php-stemmer.git", + "reference": "6cc76829bddd46f7ae7678e0bf87a0c872c8cf58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wamania/php-stemmer/zipball/6cc76829bddd46f7ae7678e0bf87a0c872c8cf58", + "reference": "6cc76829bddd46f7ae7678e0bf87a0c872c8cf58", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Wamania\\Snowball\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Wamania", + "homepage": "http://wamania.com" + } + ], + "description": "Native PHP5 Stemmer", + "keywords": [ + "php", + "porter", + "stemmer" + ], + "time": "2017-01-27T17:16:44+00:00" + }, + { + "name": "webflo/drupal-core-require-dev", + "version": "8.6.x-dev", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-core-require-dev.git", + "reference": "0f098a7b4893323699232f68d5329e56dff9834c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-core-require-dev/zipball/0f098a7b4893323699232f68d5329e56dff9834c", + "reference": "0f098a7b4893323699232f68d5329e56dff9834c", + "shasum": "" + }, + "require": { + "behat/mink": "1.7.x-dev", + "behat/mink-goutte-driver": "^1.2", + "behat/mink-selenium2-driver": "1.3.x-dev", + "drupal/coder": "^8.2.12", + "drupal/core": "8.6.x-dev", + "jcalderonzumba/gastonjs": "^1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "mikey179/vfsstream": "^1.2", + "phpspec/prophecy": "^1.7", + "phpunit/phpunit": "^4.8.35 || ^6.5", + "symfony/css-selector": "^3.4.0", + "symfony/debug": "^3.4.0", + "symfony/phpunit-bridge": "^3.4.3" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "require-dev dependencies from drupal/core", + "time": "2019-06-17T07:31:39+00:00" + }, + { + "name": "webflo/drupal-core-strict", + "version": "8.6.x-dev", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-core-strict.git", + "reference": "026062f6c982fef1b5b79a9eeecbc697f97a33fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-core-strict/zipball/026062f6c982fef1b5b79a9eeecbc697f97a33fa", + "reference": "026062f6c982fef1b5b79a9eeecbc697f97a33fa", + "shasum": "" + }, + "require": { + "asm89/stack-cors": "1.2.0", + "brumann/polyfill-unserialize": "v1.0.3", + "composer/installers": "v1.5.0", + "composer/semver": "1.4.2", + "doctrine/annotations": "v1.2.7", + "doctrine/cache": "v1.6.2", + "doctrine/collections": "v1.3.0", + "doctrine/common": "v2.6.2", + "doctrine/inflector": "v1.1.0", + "doctrine/lexer": "v1.0.1", + "easyrdf/easyrdf": "0.9.1", + "egulias/email-validator": "1.2.14", + "guzzlehttp/guzzle": "6.3.0", + "guzzlehttp/promises": "v1.3.1", + "guzzlehttp/psr7": "1.4.2", + "masterminds/html5": "2.3.0", + "paragonie/random_compat": "v2.0.17", + "psr/container": "1.0.0", + "psr/http-message": "1.0.1", + "psr/log": "1.0.2", + "stack/builder": "v1.0.5", + "symfony-cmf/routing": "1.4.1", + "symfony/class-loader": "v3.4.15", + "symfony/console": "v3.4.15", + "symfony/debug": "v3.4.15", + "symfony/dependency-injection": "v3.4.26", + "symfony/event-dispatcher": "v3.4.15", + "symfony/http-foundation": "v3.4.28", + "symfony/http-kernel": "v3.4.15", + "symfony/polyfill-ctype": "v1.9.0", + "symfony/polyfill-iconv": "v1.9.0", + "symfony/polyfill-mbstring": "v1.9.0", + "symfony/polyfill-php70": "v1.9.0", + "symfony/process": "v3.4.15", + "symfony/psr-http-message-bridge": "v1.1.0", + "symfony/routing": "v3.4.15", + "symfony/serializer": "v3.4.15", + "symfony/translation": "v3.4.15", + "symfony/validator": "v3.4.15", + "symfony/yaml": "v3.4.15", + "twig/twig": "v1.38.2", + "typo3/phar-stream-wrapper": "v2.1.2", + "wikimedia/composer-merge-plugin": "v1.4.1", + "zendframework/zend-diactoros": "1.4.1", + "zendframework/zend-escaper": "2.5.2", + "zendframework/zend-feed": "2.7.0", + "zendframework/zend-stdlib": "3.0.1" + }, + "require-dev": { + "behat/mink": "dev-master#9ea1cebe3dc529ba3861d87c818f045362c40484", + "behat/mink-browserkit-driver": "1.3.3", + "behat/mink-goutte-driver": "v1.2.1", + "behat/mink-selenium2-driver": "dev-master#93474c65a2a7bf959200ab5f7a14cc450645c185", + "doctrine/instantiator": "1.0.5", + "drupal/coder": "8.2.12", + "fabpot/goutte": "v3.2.3", + "instaclick/php-webdriver": "1.4.5", + "ircmaxell/password-compat": "v1.0.4", + "jcalderonzumba/gastonjs": "v1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "v0.3.2", + "mikey179/vfsstream": "v1.6.5", + "phpdocumentor/reflection-docblock": "2.0.4", + "phpspec/prophecy": "v1.7.0", + "phpunit/php-code-coverage": "2.2.4", + "phpunit/php-file-iterator": "1.4.5", + "phpunit/php-text-template": "1.2.1", + "phpunit/php-timer": "1.0.9", + "phpunit/php-token-stream": "1.4.12", + "phpunit/phpunit": "4.8.36", + "phpunit/phpunit-mock-objects": "2.3.8", + "sebastian/comparator": "1.2.4", + "sebastian/diff": "1.4.3", + "sebastian/environment": "1.3.8", + "sebastian/exporter": "1.2.2", + "sebastian/global-state": "1.1.1", + "sebastian/recursion-context": "1.0.5", + "sebastian/version": "1.0.6", + "squizlabs/php_codesniffer": "2.8.1", + "symfony/browser-kit": "v3.4.15", + "symfony/css-selector": "v3.4.15", + "symfony/dom-crawler": "v3.4.15", + "symfony/phpunit-bridge": "v3.4.15" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Locked core dependencies", + "time": "2019-06-17T07:30:46+00:00" + }, + { + "name": "wikimedia/composer-merge-plugin", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/composer-merge-plugin.git", + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": ">=5.3.2" + }, + "require-dev": { + "composer/composer": "~1.0.0", + "jakub-onderka/php-parallel-lint": "~0.8", + "phpunit/phpunit": "~4.8|~5.0", + "squizlabs/php_codesniffer": "~2.1.0" + }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + }, + "class": "Wikimedia\\Composer\\MergePlugin" + }, + "autoload": { + "psr-4": { + "Wikimedia\\Composer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bryan Davis", + "email": "bd808@wikimedia.org" + } + ], + "description": "Composer plugin to merge multiple composer.json files", + "time": "2017-04-25T02:31:25+00:00" + }, + { + "name": "zendframework/zend-diactoros", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-diactoros.git", + "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/424a840dc3bedcdeea510b42e056c77c2d6c4bef", + "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-dom": "*", + "ext-libxml": "*", + "phpunit/phpunit": "^4.6 || ^5.5", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev", + "dev-develop": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "description": "PSR HTTP Message implementations", + "homepage": "https://github.com/zendframework/zend-diactoros", + "keywords": [ + "http", + "psr", + "psr-7" + ], + "time": "2017-08-17T21:21:00+00:00" + }, + { + "name": "zendframework/zend-escaper", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-escaper.git", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Escaper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-escaper", + "keywords": [ + "escaper", + "zf2" + ], + "time": "2016-06-30T19:48:38+00:00" + }, + { + "name": "zendframework/zend-feed", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-feed.git", + "reference": "12b328d382aa5200f1de53d4147033b885776b67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/12b328d382aa5200f1de53d4147033b885776b67", + "reference": "12b328d382aa5200f1de53d4147033b885776b67", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-escaper": "^2.5", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "psr/http-message": "^1.0", + "zendframework/zend-cache": "^2.5", + "zendframework/zend-db": "^2.5", + "zendframework/zend-http": "^2.5", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-validator": "^2.5" + }, + "suggest": { + "psr/http-message": "PSR-7 ^1.0, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator", + "zendframework/zend-cache": "Zend\\Cache component, for optionally caching feeds between requests", + "zendframework/zend-db": "Zend\\Db component, for use with PubSubHubbub", + "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for easily extending ExtensionManager implementations", + "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries ehen using the Writer subcomponent" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Feed\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides functionality for consuming RSS and Atom feeds", + "homepage": "https://github.com/zendframework/zend-feed", + "keywords": [ + "feed", + "zf2" + ], + "time": "2016-02-11T18:54:29+00:00" + }, + { + "name": "zendframework/zend-stdlib", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "8bafa58574204bdff03c275d1d618aaa601588ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/8bafa58574204bdff03c275d1d618aaa601588ae", + "reference": "8bafa58574204bdff03c275d1d618aaa601588ae", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "~0.1", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" + ], + "time": "2016-04-12T21:19:36+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": { + "consolidation/site-alias": 0, + "webflo/drupal-core-strict": 20, + "webflo/drupal-core-require-dev": 20, + "lox/xhprof": 20 + }, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=5.6.0", + "ext-dom": "*" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.6.38" + } +} diff --git a/vendor/drush/drush/.travis.yml b/vendor/drush/drush/.travis.yml index 4939c0cef3846b34800bda1fe79e505b2e0216c9..3b88416f577ea6a157f995394bf67c3f844b6c3b 100644 --- a/vendor/drush/drush/.travis.yml +++ b/vendor/drush/drush/.travis.yml @@ -9,97 +9,54 @@ branches: - /^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+.*$/ language: php -# Cache Composer & Unish directories. +services: + - mysql + +# Cache Composer. cache: directories: - $HOME/.composer/cache - - /tmp/unish # http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/ sudo: false -env: - global: - # Github deploy - - secure: VfYokT2CchfuBRJp9/gSwfVGPfsVfkZdDVEuNWEqxww3z4vq+5aLKqoCtPL54E5EIMjhyCE3GVo+biG35Gab1KOVgUs8zD1hAUWA1FPKfMFhoPDfI3ZJC2rX2T1iWK4ZR90pBtcPzS+2OObzTYz8go0PfeSTT6eq69Na1KcNLaE= - - UNISH_NO_TIMEOUTS=y - - UNISH_DB_URL=mysql://root:@127.0.0.1 - matrix: include: - # D8.7.x - - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=7.0-alpha1' - - # D8.6.x - - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=6.12' - - # D8.5.x - - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=5.13' - - # D8.4.x - - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=4.8 PHPUNIT_ARGS=--group=commands' - - # D8.3.x - - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=3.7 PHPUNIT_ARGS=--group=commands' - - # D8.2.x - - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=2.8 PHPUNIT_ARGS=--group=commands' - - # D7 - - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=7' - - # D7 + - php: 7.2 + env: 'DEPENDENCIES=highest' + - php: 7.2 + - php: 7.0.11 - php: 5.6 - env: 'UNISH_DRUPAL_MAJOR_VERSION=7' + env: 'SCENARIO=php5 DEPENDENCIES=lowest COMPOSER_MEMORY_LIMIT=-1' - # D6 - - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=6' - - # D6 - - php: 5.4 - env: 'UNISH_DRUPAL_MAJOR_VERSION=6' +env: + global: + # GitHub deploy + - secure: VfYokT2CchfuBRJp9/gSwfVGPfsVfkZdDVEuNWEqxww3z4vq+5aLKqoCtPL54E5EIMjhyCE3GVo+biG35Gab1KOVgUs8zD1hAUWA1FPKfMFhoPDfI3ZJC2rX2T1iWK4ZR90pBtcPzS+2OObzTYz8go0PfeSTT6eq69Na1KcNLaE= + - UNISH_DB_URL=mysql://root:@127.0.0.1 + - UNISH_TMP=/tmp + - SYMFONY_DEPRECATIONS_HELPER=disabled before_install: - echo 'mbstring.http_input = pass' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - echo 'mbstring.http_output = pass' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - travis_retry composer selfupdate + - echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini -install: travis_retry composer install --no-interaction +# Build a System-Under-Test. +install: + - '.scenarios.lock/install "${SCENARIO}" "${DEPENDENCIES}"' before_script: - phpenv config-rm xdebug.ini - echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini # - echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'` - - export UNISH_DRUSH="${PWD}/drush" - -script: ${PWD}/unish.sh $PHPUNIT_ARGS -# Background: https://github.com/drush-ops/drush/pull/1426 -after_success: ${PWD}/tests/testChildren.sh +script: + - composer unit + - composer integration -before_deploy: - - gem install mime-types -v 2.6.2 # https://github.com/travis-ci/travis-ci/issues/5145 - - curl -LSs https://box-project.github.io/box2/installer.php | php - - composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction - - php box.phar build - - test $TRAVIS_TAG=true && mkdir s3-stable && cp drush.phar s3-stable/drush.phar - - test $TRAVIS_BRANCH=master && mkdir s3-unstable && cp drush.phar s3-unstable/drush-unstable.phar -deploy: - # http://docs.travis-ci.com/user/deployment/releases/ - - provider: releases - skip_cleanup: true - api_key: - secure: vRtKwJNzm+FXS5VCsaCu5YM4IS02tAdqV4G557HEyVzNgRmSgPWkaHDR/95TnXtZRjmxuTI++rccEj9+jzjknQ9LWkWhl13WiJdZYobnb240f9Ja8g0gs6/r+EEZG2+DTTerK9zicpf51h5hUaE46zObHjSmzIuGxZBO1syDld8= - file: drush.phar - on: - tags: true - repo: drush-ops/drush - all_branches: true +after_success: + # Publish updated API documentation on every push to the master branch + - git config --global user.email $GITHUB_USER_EMAIL + - git config --global user.name "Drush Documentation Bot" + - cd $TRAVIS_BUILD_DIR && build/scripts/publish-api-docs.sh diff --git a/vendor/drush/drush/CONTRIBUTING.md b/vendor/drush/drush/CONTRIBUTING.md index 2272eb7f6425a7d651f217f7235fa62507512482..7fa4970cf78ac94cd40f0f4ddfdc6755ee1e38f0 100644 --- a/vendor/drush/drush/CONTRIBUTING.md +++ b/vendor/drush/drush/CONTRIBUTING.md @@ -1,21 +1,20 @@ Drush is built by people like you! Please [join us](https://github.com/drush-ops/drush). ## Git and Pull requests -* Contributions are submitted, reviewed, and accepted using Github pull requests. [Read this article](https://help.github.com/articles/using-pull-requests) for some details. We use the _Fork and Pull_ model, as described there. -* To help keep track of [your assigned issues](https://github.com/dashboard/issues/assigned), simply open an issue to be added as an [Outside Collaborator](https://github.com/orgs/drush-ops/outside-collaborators). A maintainer can now assign any issue to you at your request. -* The latest changes are in the `master` branch. -* Make a new branch for every feature you're working on. +* Contributions are submitted, reviewed, and accepted using GitHub pull requests. +* The latest changes are in the `master` branch. PR's should initially target this branch. * Try to make clean commits that are easily readable (including descriptive commit messages!) -* Test before you push. Get familiar with Unish, our test suite. See the test-specific [README.md](tests/README.md) -* Make small pull requests that are easy to review but make sure they do add value by themselves. -* We maintain branches named 7.x, 6.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions. +* See the test-specific [README.md](tests/README.md) for instructions on running the test suite. Test before you push. Get familiar with Unish, our test suite. Optionally run tests in the provided Docker containers. +* We maintain branches named 9.x, 8.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions. + +## Development Environment +* You may choose to use the docker-compose file in root directory for an optimized environment. +* See `composer run-script -l` for a list of helper scripts. ## Coding style * Do write comments. You don't have to comment every line, but if you come up with something thats a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are nearly worthless! -* We use [Drupal's coding standards](https://drupal.org/coding-standards). -* Don't overengineer. Don't try to solve any possible problem in one step, but try to solve problems as easy as possible and improve the solution over time! -* Do generalize sooner or later! (if an old solution, quickly hacked together, poses more problems than it solves today, refactor it!) -* Keep it compatible. Do not introduce changes to the public API, or configurations too lightly. Don't make incompatible changes without good reasons! +* We use [PSR-2](http://www.php-fig.org/psr/psr-2/) in the /src directory. [Drupal's coding standards](https://drupal.org/coding-standards) are still used in the includes directory (deprecated code). +* Keep it compatible. Do not introduce changes to the public API, or configurations too casually. Don't make incompatible changes without good reasons! ## Documentation * The docs are in the [docs](docs) and [examples](examples) folders in the git repository, so people can easily find the suitable docs for the current git revision. You can read these from within Drush, with the `drush topic` command. diff --git a/vendor/drush/drush/README.md b/vendor/drush/drush/README.md index 9dbba98ba6156dbd906c3511895b83f0f0ce7a1d..8fda36a241242eff1e706b2982400c1bd15b50e2 100644 --- a/vendor/drush/drush/README.md +++ b/vendor/drush/drush/README.md @@ -1,28 +1,34 @@ -Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, executes sql queries and DB migrations, and misc utilities like run cron or clear cache. Drush can be extended by [3rd party commandfiles](https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A4654). +Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, executes SQL queries and DB migrations, and misc utilities like run cron or clear cache. Developers love the `generate` command, which jump starts your coding project by writing ready-to-customize PHP and YML files. Drush can be extended by [3rd party commandfiles](https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A4654). -[](https://packagist.org/packages/drush/drush) [](https://packagist.org/packages/drush/drush) [](https://packagist.org/packages/drush/drush) [](https://packagist.org/packages/drush/drush) [](https://readthedocs.org/projects/drush/?badge=master) +[](https://packagist.org/packages/drush/drush) [](https://packagist.org/packages/drush/drush) [](https://packagist.org/packages/drush/drush) [](https://readthedocs.org/projects/drush/?badge=master) + +| Isolation Tests | Functional Tests | +| :-------------: | :--------------: | +| <a href="https://travis-ci.org/drush-ops/drush"><img src="https://travis-ci.org/drush-ops/drush.svg?branch=master"></a> | <a href="https://circleci.com/gh/drush-ops/drush"><img src="https://circleci.com/gh/drush-ops/drush.svg?style=shield"></a> | Resources ----------- * [Installing (and Upgrading)](http://docs.drush.org/en/master/install/) * [General Documentation](http://docs.drush.org) -* [API Documentation](http://api.drush.org) -* [Drush Commands](http://drushcommands.com) -* Subscribe [this atom feed](https://github.com/drush-ops/drush/releases.atom) to receive notification on new releases. Also, [Version eye](https://www.versioneye.com/). +* [API Documentation](http://www.drush.org/api/master/index.html) * [Drush packages available via Composer](https://packagist.org/search/?type=drupal-drush) * [A list of modules that include Drush integration](https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A4654&solrsort=ds_project_latest_release+desc) -* Drush comes with a [full test suite](https://github.com/drush-ops/drush/blob/master/tests/README.md) powered by [PHPUnit](https://github.com/sebastianbergmann/phpunit). Each commit gets tested by the awesome [Travis.ci continuous integration service](https://travis-ci.org/drush-ops/drush). +* Drush comes with a [full test suite](https://github.com/drush-ops/drush/blob/master/tests/README.md) powered by [PHPUnit](https://github.com/sebastianbergmann/phpunit). Each commit gets tested by our CI bots. Support ----------- -* Post support requests to [Drupal Answers](http://drupal.stackexchange.com/questions/tagged/drush). +* Post support requests to [Drupal Answers](http://drupal.stackexchange.com/questions/tagged/drush). Tag question with 'drush'. * Report bugs and request features in the [GitHub Drush Issue Queue](https://github.com/drush-ops/drush/issues). * Use pull requests (PRs) to contribute to Drush. +Code of Conduct +--------------- +The Drush project expects all participants to abide by the [Drupal Code of Conduct](https://www.drupal.org/dcoc). + FAQ ------ -> Q: What does "drush" stand for?<br> +> Q: What does "Drush" stand for?<br> > A: The Drupal Shell. > > Q: How do I pronounce Drush?<br> @@ -31,7 +37,7 @@ FAQ > rhymes with hush, rush, flush, etc. This is the preferred pronunciation. > > Q: Does Drush have unit tests?<br> -> A: Drush has an excellent suite of unit tests. See +> A: Drush has an excellent suite of unit tests. See > [tests/README.md](https://github.com/drush-ops/drush/blob/master/tests/README.md) for more information. @@ -42,5 +48,7 @@ Credits * Redesigned by [Franz Heinzmann](http://unbiskant.org) in May 2007 for Drupal 5. * Maintained by [Moshe Weitzman](http://drupal.org/moshe) with much help from the folks listed at https://github.com/orgs/drush-ops/people. +* Thanks to [JetBrains](https://www.jetbrains.com) for [supporting this project and open source software](https://www.jetbrains.com/buy/opensource/).  +[](https://www.jetbrains.com/phpstorm/) diff --git a/vendor/drush/drush/appveyor.yml b/vendor/drush/drush/appveyor.yml index da0b06fb14941021ec856763d781d5979b1151ab..78b427a560f0be6cb21994289487d1774ef635f0 100644 --- a/vendor/drush/drush/appveyor.yml +++ b/vendor/drush/drush/appveyor.yml @@ -1,15 +1,17 @@ build: false -shallow_clone: true +shallow_clone: false platform: 'x86' -clone_folder: C:\projects\drush -matrix: - allow_failures: - # Don't record a failure until we have a passing test suite. - - UNISH_NO_TIMEOUTS: y +clone_folder: C:\projects\work branches: only: - master - - 8.x + + ## Cache composer bits +cache: + - '%LOCALAPPDATA%\Composer\files -> composer.lock' + +services: + - mysql init: #https://github.com/composer/composer/blob/master/appveyor.yml @@ -17,6 +19,7 @@ init: # Inspired by https://github.com/Codeception/base/blob/master/appveyor.yml and https://github.com/phpmd/phpmd/blob/master/appveyor.yml install: + - ps: Set-Service wuauserv -StartupType Manual - cinst -y curl - SET PATH=C:\Program Files\curl;%PATH% #which is only needed by the test suite. @@ -25,15 +28,15 @@ install: - git clone -q https://github.com/acquia/DevDesktopCommon.git #For tar, cksum, ... - SET PATH=%APPVEYOR_BUILD_FOLDER%/DevDesktopCommon/bintools-win/msys/bin;%PATH% - SET PATH=C:\Program Files\MySql\MySQL Server 5.7\bin\;%PATH% - #Install PHP - - cinst -y php - - cd c:\tools\php + #Install PHP per https://blog.wyrihaximus.net/2016/11/running-php-unit-tests-on-windows-using-appveyor-and-chocolatey/ + - ps: appveyor-retry cinst --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','') + - cd c:\tools\php71 - copy php.ini-production php.ini - echo extension_dir=ext >> php.ini - echo extension=php_openssl.dll >> php.ini - echo date.timezone="UTC" >> php.ini - - echo variables_order="EGPCS" >> php.ini #Debugging related to https://github.com/drush-ops/drush/pull/646. May be unneeded. + - echo variables_order="EGPCS" >> php.ini #May be unneeded. - echo mbstring.http_input=pass >> php.ini - echo mbstring.http_output=pass >> php.ini - echo sendmail_path=nul >> php.ini @@ -44,45 +47,30 @@ install: - echo extension=php_pdo_sqlite.dll >> php.ini - echo extension=php_pgsql.dll >> php.ini - echo extension=php_gd2.dll >> php.ini - - SET PATH=C:\tools\php;%PATH% + - echo extension=php_fileinfo.dll >> php.ini + - SET PATH=C:\tools\php71;%PATH% #Install Composer - cd %APPVEYOR_BUILD_FOLDER% #- appveyor DownloadFile https://getcomposer.org/composer.phar - php -r "readfile('http://getcomposer.org/installer');" | php - #Install Drush's dependencies via Composer - - php composer.phar -q install --prefer-dist -n + #Install dependencies via Composer + - php composer.phar install --prefer-dist -n - SET PATH=%APPVEYOR_BUILD_FOLDER%;%APPVEYOR_BUILD_FOLDER%/vendor/bin;%PATH% - #Create a sandbox for testing. - - mkdir c:\drush_temp - -services: - - mysql + # Uncomment this and on_finish line below to enable RDP into build machine https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ + # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) test_script: - - phpunit --configuration tests %PHPUNIT_ARGS% + - vendor/bin/phpunit --colors=always --configuration tests --testsuite functional --debug + - vendor/bin/phpunit --colors=always --configuration tests --testsuite integration --debug + - vendor/bin/phpunit --colors=always --configuration tests --testsuite unit --debug + +on_finish: + # Uncomment this and above line to enable RDP into build machine https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ + # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # environment variables environment: global: - UNISH_NO_TIMEOUTS: y - UNISH_DB_URL: "mysql://root:Password12!@localhost" - UNISH_TMP: c:\drush_temp - - matrix: - - UNISH_DRUPAL_MAJOR_VERSION: 7 - PHPUNIT_ARGS: --group=base - - - UNISH_DRUPAL_MAJOR_VERSION: 7 - PHPUNIT_ARGS: --group=commands - - - UNISH_DRUPAL_MAJOR_VERSION: 7 - PHPUNIT_ARGS: --group=pm - - - UNISH_DRUPAL_MAJOR_VERSION: 7 - PHPUNIT_ARGS: --group=quick-drupal - - - UNISH_DRUPAL_MAJOR_VERSION: 7 - PHPUNIT_ARGS: --exclude-group=base,make,commands,pm,quick-drupal - - - UNISH_DRUPAL_MAJOR_VERSION: 7 - PHPUNIT_ARGS: --group=make + php_ver_target: 7.1 + UNISH_DB_URL: "mysql://root:Password12!@localhost" + APPVEYOR_RDP_PASSWORD: un1sh@Windows diff --git a/vendor/drush/drush/box.json.dist b/vendor/drush/drush/box.json.dist deleted file mode 100644 index b2e633ba2f44f7f5eff451c0658eef5f35c61de9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/box.json.dist +++ /dev/null @@ -1,27 +0,0 @@ -{ - "alias": "drush.phar", - "chmod": "0755", - "compactors": [], - "directories": ["commands", "docs", "examples", "includes", "lib", "misc"], - "files": ["drush.api.php", "drush.complete.sh", "drush.info", "drush.launcher", "drush.php", "drush_logo-black.png", "README.md"], - "finder": [ - { - "name": "*.php", - "exclude": [ - "isolation", - "phing", - "test", - "tests", - "Test", - "Tests", - "Tester" - ], - "in": "vendor" - } - ], - "git-commit": "git-commit", - "git-version": "git-version", - "output": "drush.phar", - "main": "drush", - "stub": true -} diff --git a/vendor/drush/drush/commands/core/archive.drush.inc b/vendor/drush/drush/commands/core/archive.drush.inc deleted file mode 100644 index 5361f37ebebc98c6ece802b23e874fd23c56ee9e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/archive.drush.inc +++ /dev/null @@ -1,470 +0,0 @@ -<?php - -/** - * @file - * An early implementation of Site Archive dump/restore. See - * http://groups.drupal.org/site-archive-format. - */ - -use Drush\Log\LogLevel; - -function archive_drush_command() { - $items['archive-dump'] = array( - 'description' => 'Backup your code, files, and database into a single file.', - 'arguments' => array( - 'sites' => 'Optional. Site specifications, delimited by commas. Typically, list subdirectory name(s) under /sites.', - ), - // Most options on sql-dump should not be shown, so just offer a subset. - 'options' => drush_sql_get_table_selection_options() + array( - 'description' => 'Describe the archive contents.', - 'tags' => 'Add tags to the archive manifest. Delimit multiple by commas.', - 'destination' => 'The full path and filename in which the archive should be stored. If omitted, it will be saved to the drush-backups directory and a filename will be generated.', - 'overwrite' => 'Do not fail if the destination file exists; overwrite it instead. Default is --no-overwrite.', - 'generator' => 'The generator name to store in the MANIFEST file. The default is "Drush archive-dump".', - 'generatorversion' => 'The generator version number to store in the MANIFEST file. The default is ' . DRUSH_VERSION . '.', - 'pipe' => 'Only print the destination of the archive. Useful for scripts that don\'t pass --destination.', - 'preserve-symlinks' => 'Preserve symbolic links.', - 'no-core' => 'Exclude Drupal core, so the backup only contains the site specific stuff.', - 'tar-options' => 'Options passed thru to the tar command.', - ), - 'examples' => array( - 'drush archive-dump default,example.com,foo.com' => 'Write an archive containing 3 sites in it.', - 'drush archive-dump @sites' => 'Save archive containing all sites in a multi-site.', - 'drush archive-dump default --destination=/backups/mysite.tar' => 'Save archive to custom location.', - 'drush archive-dump --tar-options="--exclude=.git --exclude=sites/default/files"' => 'Omits any .git directories found in the tree as well as sites/default/files.', - 'drush archive-dump --tar-options="--exclude=%files"' => 'Placeholder %files is replaced with the real path for the current site, and that path is excluded.', - ), - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE, - 'aliases' => array('ard', 'archive-backup', 'arb', 'archive:dump'), - ); - $items['archive-restore'] = array( - 'description' => 'Expand a site archive into a Drupal web site.', - 'arguments' => array( - 'file' => 'The site archive file that should be expanded.', - 'site name' => 'Optional. Which site within the archive you want to restore. Defaults to all.', - ), - 'required-arguments' => 1, - 'options' => array( - 'destination' => 'Specify where the Drupal site should be expanded, including the docroot. Defaults to the current working directory.', - 'db-prefix' => 'An optional table prefix to use during restore.', - 'db-url' => array( - 'description' => 'A Drupal 6 style database URL indicating the target for database restore. If not provided, the archived settings.php is used.', - 'example-value' => 'mysql://root:pass@host/db', - ), - 'db-su' => 'Account to use when creating the new database. Optional.', - 'db-su-pw' => 'Password for the "db-su" account. Optional.', - 'overwrite' => 'Allow drush to overwrite any files in the destination. Default is --no-overwrite.', - 'tar-options' => 'Options passed thru to the tar command.', - ), - 'examples' => array( - 'drush archive-restore ./example.tar.gz' => 'Restore the files and databases for all sites in the archive.', - 'drush archive-restore ./example.tar.gz example.com' => 'Restore the files and database for example.com site.', - 'drush archive-restore ./example.tar.gz --destination=/var/www/example.com/docroot' => 'Restore archive to a custom location.', - 'drush archive-restore ./example.tar.gz --db-url=mysql://root:pass@127.0.0.1/dbname' => 'Restore archive to a new database (and customize settings.php to point there.).', - ), - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'aliases' => array('arr', 'archive:restore'), - ); - return $items; -} - -/** - * Command callback. Generate site archive file. - */ -function drush_archive_dump($sites_subdirs = '@self') { - $include_platform = !drush_get_option('no-core', FALSE); - $tar = drush_get_tar_executable(); - - $sites = array(); - list($aliases, $not_found) = drush_sitealias_resolve_sitespecs(explode(',', $sites_subdirs)); - if (!empty($not_found)) { - drush_log(dt("Some site subdirectories are not valid Drupal sites: @list", array("@list" => implode(', ', $not_found))), LogLevel::WARNING); - } - foreach ($aliases as $key => $alias) { - $sites[$key] = $alias; - - if (($db_record = sitealias_get_databases_from_record($alias))) { - $sites[$key]['databases'] = $db_record; - } - else { - $sites[$key]['databases'] = array(); - drush_log(dt('DB definition not found for !alias', array('!alias' => $key)), LogLevel::NOTICE); - } - } - - // The user can specify a destination filepath or not. That filepath might - // end with .gz, .tgz, or something else. At the end of this command we will - // gzip a file, and we want it to end up with the user-specified name (if - // any), but gzip renames files and refuses to compress files ending with - // .gz and .tgz, making our lives difficult. Solution: - // - // 1. Create a unique temporary base name to which gzip WILL append .gz. - // 2. If no destination is provided, set $dest_dir to a backup directory and - // $final_destination to be the unique name in that dir. - // 3. If a destination is provided, set $dest_dir to that directory and - // $final_destination to the exact name given. - // 4. Set $destination, the actual working file we will build up, to the - // unqiue name in $dest_dir. - // 5. After gzip'ing $destination, rename $destination.gz to - // $final_destination. - // - // Sheesh. - - // Create the unique temporary name. - $prefix = 'none'; - if (!empty($sites)) { - $first = current($sites); - if ( !empty($first['databases']['default']['default']['database']) ) { - $prefix = count($sites) > 1 ? 'multiple_sites' : str_replace('/', '-', $first['databases']['default']['default']['database']); - } - } - $date = gmdate('Ymd_His'); - $temp_dest_name = "$prefix.$date.tar"; - - $final_destination = drush_get_option('destination'); - if (!$final_destination) { - // No destination provided. - $backup = drush_include_engine('version_control', 'backup'); - // TODO: this standard Drush pattern leads to a slightly obtuse directory structure. - $dest_dir = $backup->prepare_backup_dir('archive-dump'); - if (empty($dest_dir)) { - $dest_dir = drush_tempdir(); - } - $final_destination = "$dest_dir/$temp_dest_name.gz"; - } - else { - // Use the supplied --destination. If it is relative, resolve it - // relative to the directory in which drush was invoked. - $command_cwd = getcwd(); - drush_op('chdir', drush_get_context('DRUSH_OLDCWD', getcwd())); - // This doesn't perform realpath on the basename, but that's okay. This is - // not path-based security. We just use it for checking for perms later. - drush_mkdir(dirname($final_destination)); - $dest_dir = realpath(dirname($final_destination)); - $final_destination = $dest_dir . '/' . basename($final_destination); - drush_op('chdir', $command_cwd); - } - - // $dest_dir is either the backup directory or specified directory. Set our - // working file. - $destination = "$dest_dir/$temp_dest_name"; - - // Validate the FINAL destination. It should be a file that does not exist - // (unless --overwrite) in a writable directory (and a writable file if - // it exists). We check all this up front to avoid failing after a long - // dump process. - $overwrite = drush_get_option('overwrite'); - $dest_dir = dirname($final_destination); - $dt_args = array('!file' => $final_destination, '!dir' => $dest_dir); - if (is_dir($final_destination)) { - drush_set_error('DRUSH_ARCHIVE_DEST_IS_DIR', dt('Destination !file must be a file, not a directory.', $dt_args)); - return; - } - else if (file_exists($final_destination)) { - if (!$overwrite) { - drush_set_error('DRUSH_ARCHIVE_DEST_EXISTS', dt('Destination !file exists; specify --overwrite to overwrite.', $dt_args)); - return; - } - else if (!is_writable($final_destination)) { - drush_set_error('DRUSH_ARCHIVE_DEST_FILE_NOT_WRITEABLE', dt('Destination !file is not writable.', $dt_args)); - return; - } - } - else if (!is_writable($dest_dir)) { - drush_set_error('DRUSH_ARCHIVE_DEST_DIR_NOT_WRITEABLE', dt('Destination directory !dir is not writable.', $dt_args)); - return; - } - - // Get the extra options for tar, if any - $tar_extra_options = drush_sitealias_evaluate_paths_in_options(drush_get_option('tar-options', '')); - - // Start adding codebase to the archive. - $docroot_path = realpath(drush_get_context('DRUSH_DRUPAL_ROOT')); - $docroot = basename($docroot_path); - $workdir = dirname($docroot_path); - - if ($include_platform) { - $dereference = (drush_get_option('preserve-symlinks', FALSE)) ? '' : '--dereference '; - // Convert destination path to Unix style for tar on MinGW - see http://drupal.org/node/1844224 - if (drush_is_mingw()) { - $destination_orig = $destination; - $destination = str_replace('\\', '/', $destination); - $destination = preg_replace('$^([a-zA-Z]):$', '/$1', $destination); - } - // Archive Drupal core, excluding sites dir. - drush_shell_cd_and_exec($workdir, "$tar {$tar_extra_options} --exclude \"{$docroot}/sites\" {$dereference}-cf %s %s", $destination, $docroot); - // Add sites/all to the same archive. - drush_shell_cd_and_exec($workdir, "$tar {$tar_extra_options} {$dereference}-rf %s %s", $destination, "{$docroot}/sites/all"); - // Add special files in sites/ to the archive. Last 2 items are new in Drupal8. - $files_to_add = array('sites/README.txt', 'sites/sites.php', 'sites/example.sites.php', 'sites/development.services.yml', 'sites/example.settings.local.php'); - foreach ($files_to_add as $file_to_add) { - if (file_exists($file_to_add)) { - drush_shell_cd_and_exec($workdir, "$tar {$dereference}-rf %s %s", $destination, $docroot . '/' . $file_to_add); - } - } - } - - $tmp = drush_tempdir(); - $all_dbs = array(); - // Dump the default database for each site and add to the archive. - foreach ($sites as $key => $alias) { - if (isset($alias['databases']['default']['default'])) { - $db_spec = $alias['databases']['default']['default']; - // Use a subdirectory name matching the docroot name. - drush_mkdir("{$tmp}/{$docroot}"); - - // Ensure uniqueness by prefixing key if needed. Remove path delimiters. - $dbname = str_replace(DIRECTORY_SEPARATOR, '-', $db_spec['database']); - $result_file = count($sites) == 1 ? "$tmp/$dbname.sql" : str_replace('@', '', "$tmp/$key-$dbname.sql"); - - $all_dbs[$key] = array( - 'file' => basename($result_file), - 'driver' => $db_spec['driver'], - ); - $sql = drush_sql_get_class($db_spec); - $sql->dump($result_file); - drush_shell_cd_and_exec($tmp, "$tar {$tar_extra_options} --dereference -rf %s %s", $destination, basename($result_file)); - } - } - - // Build a manifest file AND add sites/$subdir to archive as we go. - $platform = array( - 'datestamp' => time(), - 'formatversion' => '1.0', - 'generator' => drush_get_option('generator', 'Drush archive-dump'), - 'generatorversion' => drush_get_option('generatorversion', DRUSH_VERSION), - 'description' => drush_get_option('description', ''), - 'tags' => drush_get_option('tags', ''), - 'archiveformat' => ($include_platform ? 'platform' : 'site'), - ); - $contents = drush_export_ini(array('Global' => $platform)); - - $i=0; - foreach ($sites as $key => $alias) { - $status = drush_invoke_process($alias, 'core-status', array(), array(), array('integrate' => FALSE)); - if (!$status || $status['error_log']) { - drush_log(dt('Unable to determine sites directory for !alias', array('!alias' => $key)), LogLevel::WARNING); - } - - // Add the site specific directory to archive. - if (!empty($status['object']['%paths']['%site'])) { - drush_shell_cd_and_exec($workdir, "$tar {$tar_extra_options} --dereference -rf %s %s", $destination, "{$docroot}/sites/" . basename($status['object']['%paths']['%site'])); - } - - $site = array( - 'docroot' => DRUPAL_ROOT, - 'sitedir' => @$status['object']['%paths']['%site'], - 'files-public' => @$status['object']['%paths']['%files'], - 'files-private' => @$status['object']['%paths']['%private'], - ); - $site["database-default-file"] = $all_dbs[$key]['file']; - $site["database-default-driver"] = $all_dbs[$key]['driver']; - // The section title is the sites subdirectory name. - $info[basename($site['sitedir'])] = $site; - $contents .= "\n" . drush_export_ini($info); - unset($info); - $i++; - } - file_put_contents("{$tmp}/MANIFEST.ini", $contents); - - // Add manifest to archive. - drush_shell_cd_and_exec($tmp, "$tar --dereference -rf %s %s", $destination, 'MANIFEST.ini'); - - // Ensure that default/default.settings.php is in the archive. This is needed - // by site-install when restoring a site without any DB. - // NOTE: Windows tar file replace operation is broken so we have to check if file already exists. - // Otherwise it will corrupt the archive. - $res = drush_shell_cd_and_exec($workdir, "$tar -tf %s %s", $destination, $docroot . '/sites/default/default.settings.php'); - $output = drush_shell_exec_output(); - if (!$res || !isset($output[0]) || empty($output[0])) { - drush_shell_cd_and_exec($workdir, "$tar --dereference -vrf %s %s", $destination, $docroot . '/sites/default/default.settings.php'); - } - - // Switch back to original destination in case it was modified for tar on MinGW. - if (!empty($destination_orig)) { - $destination = $destination_orig; - } - - // Compress the archive - if (!drush_shell_exec("gzip --no-name -f %s", $destination)) { - // Clean up the tar file - drush_register_file_for_deletion($destination); - return drush_set_error(DRUSH_APPLICATION_ERROR, dt('Failed to gzip !destination', ['!destination' => $destination])); - } - - // gzip appends .gz unless the name already ends in .gz, .tgz, or .taz. - if ("{$destination}.gz" != $final_destination) { - drush_move_dir("{$destination}.gz", $final_destination, $overwrite); - } - - drush_log(dt('Archive saved to !dest', array('!dest' => $final_destination)), LogLevel::OK); - return $final_destination; -} - -/** - * Command argument complete callback. - * - * @return - * List of site names/aliases for archival. - */ -function archive_archive_dump_complete() { - return array('values' => array_keys(_drush_sitealias_all_list())); -} - -/** - * Command callback. Restore web site(s) from a site archive file. - */ -function drush_archive_restore($file, $site_id = NULL) { - $tmp = drush_tempdir(); - - // Get the extra options for tar, if any - $tar_extra_options = drush_sitealias_evaluate_paths_in_options(drush_get_option('tar-options', '')); - - if (!$files = drush_tarball_extract($file, $tmp, FALSE, $tar_extra_options)) { - return drush_set_error('DRUSH_ARCHIVE_UNABLE_TO_EXTRACT', dt('Unable to extract site archive tarball to !tmp.', array('!tmp' => $tmp))); - } - - $manifest = $tmp . '/MANIFEST.ini'; - if (file_exists($manifest)) { - if (!$ini = parse_ini_file($manifest, TRUE)) { - return drush_set_error('DRUSH_ARCHIVE_UNABLE_TO_PARSE_MANIFEST', dt('Unable to parse MANIFEST.ini in the archive.')); - } - } - else { - $ini = drush_archive_guess_manifest($tmp); - } - - // Backward compatibility: 'archiveformat' did not exist - // in older versions of archive-dump. - if (!isset( $ini['Global']['archiveformat'])) { - $ini['Global']['archiveformat'] = 'platform'; - } - - // Grab the first site in the Manifest and move docroot to destination. - $ini_tmp = $ini; - unset($ini_tmp['Global']); - $first = array_shift($ini_tmp); - $docroot = basename($first['docroot']); - $destination = drush_get_option('destination', realpath('.') . "/$docroot"); - - if ($ini['Global']['archiveformat'] == 'platform') { - // Move the whole platform in-place at once. - if (!drush_move_dir("$tmp/$docroot", $destination, drush_get_option('overwrite'))) { - return drush_set_error('DRUSH_ARCHIVE_UNABLE_TO_RESTORE_FILES', dt('Unable to restore platform to !dest', array('!dest' => $destination))); - } - } - else { - // When no platform is included we do this on a per-site basis. - } - - // Loop over sites and restore databases and append to settings.php. - foreach ($ini as $section => $site) { - if ($section != 'Global' && (!isset($site_id) || $section == $site_id) && !empty($site['database-default-file'])) { - $site_destination = $destination . '/' . $site['sitedir']; - // Restore site, in case not already done above. - if ($ini['Global']['archiveformat'] == 'site') { - if (!drush_move_dir("$tmp/$docroot/" . $site['sitedir'], $site_destination, drush_get_option('overwrite'))) { - return drush_set_error('DRUSH_ARCHIVE_UNABLE_TO_RESTORE_FILES', dt('Unable to restore site to !dest', array('!dest' => $site_destination))); - } - } - - // Restore database. - $sql_file = $tmp . '/' . $site['database-default-file']; - if ($db_url = drush_get_option('db-url')) { - if (empty($site_id) && count($ini) >= 3) { - // TODO: Use drushrc to provide multiple db-urls for multi-restore? - return drush_set_error('DRUSH_ARCHIVE_UNABLE_MULTI_RESTORE', dt('You must specify a site to restore when the archive contains multiple sites and a db-url is provided.')); - } - $db_spec = drush_convert_db_from_db_url($db_url); - } - else { - $site_specification = $destination . '#' . $section; - if ($return = drush_invoke_process($site_specification, 'sql-conf', array(), array('all' => TRUE), array('integrate' => FALSE, 'override-simulated' => TRUE))) { - $databases = $return['object']; - $db_spec = $databases['default']['default']; - } - else { - return drush_set_error('DRUSH_ARCHIVE_UNABLE_DISCOVER_DB', dt('Unable to get database details from db-url option or settings.php', array('!key' => $key))); - } - } - $sql = drush_sql_get_class($db_spec); - $sql->drop_or_create(); - $sql->query(NULL, $sql_file); - - // Append new DB info to settings.php. - if ($db_url) { - $settingsfile = $destination . '/' . $site['sitedir'] . '/settings.php'; - //If settings.php doesn't exist in the archive, create it from default.settings.php. - if (!file_exists($settingsfile)) { - drush_op('copy', $destination . '/sites/default/default.settings.php', $settingsfile); - } - // Need to do something here or else we can't write. - chmod($settingsfile, 0664); - file_put_contents($settingsfile, "\n// Appended by drush archive-restore command.\n", FILE_APPEND); - if (drush_drupal_major_version($destination) >= 7) { - file_put_contents($settingsfile, "\n" . '$databases = ' . var_export(drush_sitealias_convert_db_from_db_url($db_url), TRUE) . ";\n", FILE_APPEND); - } - else { - file_put_contents($settingsfile, "\n" . '$db_url = \'' . $db_url . "';\n", FILE_APPEND); - } - drush_log(dt('Drush appended the new database configuration at settings.php. Optionally remove the old configuration manually.'), LogLevel::OK); - } - } - } - drush_log(dt('Archive restored to !dest', array('!dest' => $destination)), LogLevel::OK); - - return $destination; -} - - -/** - * Command argument complete callback. - * - * @return - * Strong glob of files to complete on. - */ -function archive_archive_restore_complete() { - return array( - 'files' => array( - 'directories' => array( - 'pattern' => '*', - 'flags' => GLOB_ONLYDIR, - ), - 'tar' => array( - 'pattern' => '*.tar.gz', - ), - ), - ); -} - -/** - * Try to find docroot and DB dump file in an extracted archive. - * - * @param string $path The location of the extracted archive. - * @return array The manifest data. - */ -function drush_archive_guess_manifest($path) { - $db_file = drush_scan_directory($path, '/\.sql$/', array('.', '..', 'CVS'), 0, 0); - - if (file_exists($path . '/index.php')) { - $docroot = './'; - } - else { - $directories = glob($path . '/*' , GLOB_ONLYDIR); - $docroot = reset($directories); - } - - $ini = array( - 'Global' => array( - // Very crude detection of a platform... - 'archiveformat' => (drush_drupal_version($docroot) ? 'platform' : 'site'), - ), - 'default' => array( - 'docroot' => $docroot, - 'sitedir' => 'sites/default', - 'database-default-file' => key($db_file), - ), - ); - - return $ini; -} diff --git a/vendor/drush/drush/commands/core/cache.drush.inc b/vendor/drush/drush/commands/core/cache.drush.inc deleted file mode 100644 index 59cd97783bff78dba8843a8a1769b287fca561a5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/cache.drush.inc +++ /dev/null @@ -1,309 +0,0 @@ -<?php - -use Drush\Log\LogLevel; -use Drupal\Core\DrupalKernel; -use Drupal\Core\Site\Settings; -use Symfony\Component\HttpFoundation\Request; - -/** - * Implementation of hook_drush_help(). - */ -function cache_drush_help($section) { - switch ($section) { - case 'meta:cache:title': - return dt('Cache commands'); - case 'meta:cache:summary': - return dt('Interact with Drupal\'s cache API.'); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function cache_drush_command() { - $items = array(); - - // We specify command callbacks here because the defaults would collide with - // the drush cache api functions. - $items['cache-get'] = array( - 'description' => 'Fetch a cached object and display it.', - 'examples' => array( - 'drush cache-get schema' => 'Display the data for the cache id "schema" from the "cache" bin.', - 'drush cache-get update_available_releases update' => 'Display the data for the cache id "update_available_releases" from the "update" bin.', - ), - 'arguments' => array( - 'cid' => 'The id of the object to fetch.', - 'bin' => 'Optional. The cache bin to fetch from.', - ), - 'required-arguments' => 1, - 'callback' => 'drush_cache_command_get', - 'outputformat' => array( - 'default' => 'print-r', - 'pipe-format' => 'var_export', - 'output-data-type' => TRUE, - ), - 'aliases' => array('cg','cache:get'), - ); - $items['cache-clear'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'description' => 'Clear a specific cache, or all drupal caches.', - 'arguments' => array( - 'type' => 'The particular cache to clear. Omit this argument to choose from available caches.', - ), - 'callback' => 'drush_cache_command_clear', - 'aliases' => array('cc','cache:clear'), - ); - $items['cache-set'] = array( - 'description' => 'Cache an object expressed in JSON or var_export() format.', - 'arguments' => array( - 'cid' => 'The id of the object to set.', - 'data' => 'The object to set in the cache. Use \'-\' to read the object from STDIN.', - 'bin' => 'Optional. The cache bin to store the object in.', - 'expire' => 'Optional. CACHE_PERMANENT, CACHE_TEMPORARY, or a Unix timestamp.', - 'tags' => 'An array of cache tags.', - ), - 'required-arguments' => 2, - 'options' => array( - // Note that this is not an outputformat option. - 'format' => 'Format to parse the object. Use "string" for string (default), and "json" for JSON.', - 'cache-get' => 'If the object is the result a previous fetch from the cache, only store the value in the "data" property of the object in the cache.', - ), - 'callback' => 'drush_cache_command_set', - 'aliases' => array('cs','cache:set'), - ); - $items['cache-rebuild'] = array( - 'description' => 'Rebuild a Drupal 8 site and clear all its caches.', - 'options' => array(), - 'arguments' => array(), - // Bootstrap to DRUSH_BOOTSTAP_DRUPAL_SITE to pick the correct site. - // Further bootstrap is done by the rebuild script. - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE, - 'core' => array('8+'), - 'aliases' => array('cr', 'rebuild', 'cache:rebuild'), - ); - - return $items; -} - -/** - * Command argument complete callback. - * - * @return - * Array of clear types. - */ -function cache_cache_clear_complete() { - // Bootstrap as far as possible so that Views and others can list their caches. - drush_bootstrap_max(); - return array('values' => array_keys(drush_cache_clear_types(TRUE))); -} - -function drush_cache_clear_pre_validate($type = NULL) { - $types = drush_cache_clear_types(drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)); - // Check if the provided type ($type) is a valid cache type. - if ($type && !array_key_exists($type, $types)) { - if ($type === 'all' && drush_drupal_major_version() >= 8) { - return drush_set_error(dt('`cache-clear all` is deprecated for Drupal 8 and later. Please use the `cache-rebuild` command instead.')); - } - // If we haven't done a full bootstrap, provide a more - // specific message with instructions to the user on - // bootstrapping a Drupal site for more options. - if (!drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - $all_types = drush_cache_clear_types(TRUE); - if (array_key_exists($type, $all_types)) { - return drush_set_error(dt("'!type' cache requires a working Drupal site to operate on. Use the --root and --uri options, or a site @alias, or cd to a directory containing a Drupal settings.php file.", array('!type' => $type))); - } - else { - return drush_set_error(dt("'!type' cache is not a valid cache type. There may be more cache types available if you select a working Drupal site.", array('!type' => $type))); - } - } - return drush_set_error(dt("'!type' cache is not a valid cache type.", array('!type' => $type))); - } -} - -/** - * Command callback for drush cache-clear. - */ -function drush_cache_command_clear($type = NULL) { - if (!drush_get_option('cache-clear', TRUE)) { - drush_log(dt("Skipping cache-clear operation due to --cache-clear=0 option."), LogLevel::OK); - return TRUE; - } - $types = drush_cache_clear_types(drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)); - - if (!isset($type)) { - // Don't offer 'all' unless Drush has bootstrapped the Drupal site - if (!drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - unset($types['all']); - } - $type = drush_choice($types, 'Enter a number to choose which cache to clear.', '!key'); - if (empty($type)) { - return drush_user_abort(); - } - } - // Do it. - drush_op($types[$type]); - if ($type == 'all' && !drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - drush_log(dt("No Drupal site found, only 'drush' cache was cleared."), LogLevel::WARNING); - } - else { - drush_log(dt("'!name' cache was cleared.", array('!name' => $type)), LogLevel::SUCCESS); - } -} - -/** - * Print an object returned from the cache. - * - * @param $cid - * The cache ID of the object to fetch. - * @param $bin - * A specific bin to fetch from. If not specified, the default bin is used. - */ -function drush_cache_command_get($cid = NULL, $bin = NULL) { - drush_include_engine('drupal', 'cache'); - $result = drush_op('_drush_cache_command_get', $cid, $bin); - - if (empty($result)) { - return drush_set_error('DRUSH_CACHE_OBJECT_NOT_FOUND', dt('The !cid object in the !bin bin was not found.', array('!cid' => $cid, '!bin' => $bin ? $bin : _drush_cache_bin_default()))); - } - return $result; -} - -/** - * Set an object in the cache. - * - * @param $cid - * The cache ID of the object to fetch. - * @param $data - * The data to save to the cache, or '-' to read from STDIN. - * @param $bin - * A specific bin to fetch from. If not specified, the default bin is used. - * @param $expire - * The expiry timestamp for the cached object. - * @param $tags - * Cache tags for the cached object. - */ -function drush_cache_command_set($cid = NULL, $data = '', $bin = NULL, $expire = NULL, $tags = array()) { - // In addition to prepare, this also validates. Can't easily be in own validate callback as - // reading once from STDIN empties it. - $data = drush_cache_set_prepare_data($data); - if ($data === FALSE && drush_get_error()) { - // An error was logged above. - return; - } - - drush_include_engine('drupal', 'cache'); - return drush_op('_drush_cache_command_set', $cid, $data, $bin, $expire, $tags); -} - -function drush_cache_set_prepare_data($data) { - if ($data == '-') { - $data = file_get_contents("php://stdin"); - } - - // Now, we parse the object. - switch (drush_get_option('format', 'string')) { - case 'json': - $data = drush_json_decode($data); - break; - } - - if (drush_get_option('cache-get')) { - // $data might be an object. - if (is_object($data) && $data->data) { - $data = $data->data; - } - // But $data returned from `drush cache-get --format=json` will be an array. - elseif (is_array($data) && isset($data['data'])) { - $data = $data['data']; - } - else { - // If $data is neither object nor array and cache-get was specified, then - // there is a problem. - return drush_set_error('CACHE_INVALID_FORMAT', dt("'cache-get' was specified as an option, but the data is neither an object or an array.")); - } - } - - return $data; -} - -/** - * All types of caches available for clearing. Contrib commands can alter in their own. - */ -function drush_cache_clear_types($include_bootstrapped_types = FALSE) { - drush_include_engine('drupal', 'cache'); - $types = _drush_cache_clear_types($include_bootstrapped_types); - - // Include the appropriate environment engine, so callbacks can use core - // version specific cache clearing functions directly. - drush_include_engine('drupal', 'environment'); - - // Command files may customize $types as desired. - drush_command_invoke_all_ref('drush_cache_clear', $types, $include_bootstrapped_types); - - return $types; -} - -/** - * Clear caches internal to drush core. - */ -function drush_cache_clear_drush() { - drush_cache_clear_all(NULL, 'default'); // commandfiles, etc. - drush_cache_clear_all(NULL, 'complete'); // completion - // Release XML. We don't clear tarballs since those never change. - $matches = drush_scan_directory(drush_directory_cache('download'), "/^https---updates.drupal.org-release-history/", array('.', '..')); - array_map('unlink', array_keys($matches)); -} - -/** - * Rebuild a Drupal 8 site. - * - * This is a transpose of core/rebuild.php. Additionally - * it also clears drush cache and drupal render cache. - */ -function drush_cache_rebuild() { - if (!drush_get_option('cache-clear', TRUE)) { - drush_log(dt("Skipping cache-clear operation due to --cache-clear=0 option."), LogLevel::OK); - return TRUE; - } - chdir(DRUPAL_ROOT); - - // Clear the APC cache to ensure APC class loader is reset. - if (function_exists('apc_fetch')) { - apc_clear_cache('user'); - } - // Clear user cache for all major platforms. - $user_caches = [ - 'apcu_clear_cache', - 'wincache_ucache_clear', - 'xcache_clear_cache', - ]; - foreach (array_filter($user_caches, 'is_callable') as $cache) { - call_user_func($cache); - } - - $autoloader = drush_drupal_load_autoloader(DRUPAL_ROOT); - require_once DRUSH_DRUPAL_CORE . '/includes/utility.inc'; - - $request = Request::createFromGlobals(); - // Ensure that the HTTP method is set, which does not happen with Request::createFromGlobals(). - $request->setMethod('GET'); - // Manually resemble early bootstrap of DrupalKernel::boot(). - require_once DRUSH_DRUPAL_CORE . '/includes/bootstrap.inc'; - DrupalKernel::bootEnvironment(); - // Avoid 'Only variables should be passed by reference' - $root = DRUPAL_ROOT; - $site_path = DrupalKernel::findSitePath($request); - Settings::initialize($root, $site_path, $autoloader); - - // Use our error handler since _drupal_log_error() depends on an unavailable theme system (ugh). - set_error_handler('drush_error_handler'); - - // drupal_rebuild() calls drupal_flush_all_caches() itself, so we don't do it manually. - drupal_rebuild($autoloader, $request); - drush_log(dt('Cache rebuild complete.'), LogLevel::OK); - - // As this command replaces `drush cache-clear all` for Drupal 8 users, clear - // the Drush cache as well, for consistency with that behavior. - drush_cache_clear_drush(); -} - diff --git a/vendor/drush/drush/commands/core/cli.drush.inc b/vendor/drush/drush/commands/core/cli.drush.inc deleted file mode 100644 index 3e99ca3a19884fc9bf54e3072e922675c2e4925e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/cli.drush.inc +++ /dev/null @@ -1,271 +0,0 @@ -<?php - -use Drush\Log\LogLevel; -use Drupal\Component\Assertion\Handle; -use Drush\Psysh\DrushHelpCommand; -use Drush\Psysh\DrushCommand; -use Drush\Psysh\Shell; -use Psy\VersionUpdater\Checker; - -/** - * Implements hook_drush_command(). - */ -function cli_drush_command() { - $items['core-cli'] = array( - 'description' => 'Open an interactive shell on a Drupal site.', - 'remote-tty' => TRUE, - 'aliases' => array('php', 'core:cli'), - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'topics' => array('docs-repl'), - 'options' => array( - 'version-history' => 'Use command history based on Drupal version (Default is per site).', - 'cwd' => 'Changes the working directory of the shell (Default is the project root directory)', - ), - ); - $items['docs-repl'] = array( - 'description' => 'repl.md', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array(drush_get_context('DOC_PREFIX', DRUSH_BASE_PATH) . '/docs/repl.md'), - 'aliases' => array('docs:repl'), - ); - return $items; -} - -/** - * Command callback. - */ -function drush_cli_core_cli() { - $drupal_major_version = drush_drupal_major_version(); - $configuration = new \Psy\Configuration(); - - // Set the Drush specific history file path. - $configuration->setHistoryFile(drush_history_path_cli()); - - // Disable checking for updates. Our dependencies are managed with Composer. - $configuration->setUpdateCheck(Checker::NEVER); - - $shell = new Shell($configuration); - - if ($drupal_major_version >= 8) { - // Register the assertion handler so exceptions are thrown instead of errors - // being triggered. This plays nicer with PsySH. - Handle::register(); - $shell->setScopeVariables(['container' => \Drupal::getContainer()]); - - // Add Drupal 8 specific casters to the shell configuration. - $configuration->addCasters(_drush_core_cli_get_casters()); - } - - // Add Drush commands to the shell. - $commands = [new DrushHelpCommand()]; - - foreach (drush_commands_categorize(_drush_core_cli_get_commands()) as $category_data) { - $category_title = (string) $category_data['title']; - foreach ($category_data['commands'] as $command_config) { - $command = new DrushCommand($command_config); - // Set the category label on each. - $command->setCategory($category_title); - $commands[] = $command; - } - } - - $shell->addCommands($commands); - - // PsySH will never return control to us, but our shutdown handler will still - // run after the user presses ^D. Mark this command as completed to avoid a - // spurious error message. - drush_set_context('DRUSH_EXECUTION_COMPLETED', TRUE); - - // Run the terminate event before the shell is run. Otherwise, if the shell - // is forking processes (the default), any child processes will close the - // database connection when they are killed. So when we return back to the - // parent process after, there is no connection. This will be called after the - // command in preflight still, but the subscriber instances are already - // created from before. Call terminate() regardless, this is a no-op for all - // DrupalBoot classes except DrupalBoot8. - if ($bootstrap = drush_get_bootstrap_object()) { - $bootstrap->terminate(); - } - - // To fix the above problem in Drupal 7, the connection can be closed manually. - // This will make sure a new connection is created again in child loops. So - // any shutdown functions will still run ok after the shell has exited. - if ($drupal_major_version == 7) { - Database::closeConnection(); - } - - // if the cwd option is passed, lets change the current working directory to wherever - // the user wants to go before we lift psysh. - if ($cwd = drush_get_option('cwd',FALSE)) { - chdir($cwd); - } - - $shell->run(); -} - -/** - * Returns a filtered list of Drush commands used for CLI commands. - * - * @return array - */ -function _drush_core_cli_get_commands() { - $commands = drush_get_commands(); - $ignored_commands = ['help', 'drush-psysh', 'php-eval', 'core-cli', 'php']; - $php_keywords = _drush_core_cli_get_php_keywords(); - - foreach ($commands as $name => $config) { - // Ignore some commands that don't make sense inside PsySH, are PHP keywords - // are hidden, or are aliases. - if (in_array($name, $ignored_commands) || in_array($name, $php_keywords) || !empty($config['hidden']) || ($name !== $config['command'])) { - unset($commands[$name]); - } - else { - // Make sure the command aliases don't contain any PHP keywords. - if (!empty($config['aliases'])) { - $commands[$name]['aliases'] = array_diff($commands[$name]['aliases'], $php_keywords); - } - } - } - - return $commands; -} - -/** - * Returns a mapped array of casters for use in the shell. - * - * These are Symfony VarDumper casters. - * See http://symfony.com/doc/current/components/var_dumper/advanced.html#casters - * for more information. - * - * @return array. - * An array of caster callbacks keyed by class or interface. - */ -function _drush_core_cli_get_casters() { - return [ - 'Drupal\Core\Entity\ContentEntityInterface' => 'Drush\Psysh\Caster::castContentEntity', - 'Drupal\Core\Field\FieldItemListInterface' => 'Drush\Psysh\Caster::castFieldItemList', - 'Drupal\Core\Field\FieldItemInterface' => 'Drush\Psysh\Caster::castFieldItem', - 'Drupal\Core\Config\Entity\ConfigEntityInterface' => 'Drush\Psysh\Caster::castConfigEntity', - 'Drupal\Core\Config\ConfigBase' => 'Drush\Psysh\Caster::castConfig', - 'Drupal\Component\DependencyInjection\Container' => 'Drush\Psysh\Caster::castContainer', - ]; -} - -/** - * Returns the file path for the CLI history. - * - * This can either be site specific (default) or Drupal version specific. - * - * @return string. - */ -function drush_history_path_cli() { - $cli_directory = drush_directory_cache('cli'); - - // If only the Drupal version is being used for the history. - if (drush_get_option('version-history', FALSE)) { - $drupal_major_version = drush_drupal_major_version(); - $file_name = "drupal-$drupal_major_version"; - } - // If there is an alias, use that in the site specific name. Otherwise, - // use a hash of the root path. - else { - if ($alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS')) { - $site = drush_sitealias_get_record($alias); - $site_suffix = $site['#name']; - } - else { - $site_suffix = md5(DRUPAL_ROOT); - } - - $file_name = "drupal-site-$site_suffix"; - } - - $full_path = "$cli_directory/$file_name"; - - // Output the history path if verbose is enabled. - if (drush_get_context('DRUSH_VERBOSE')) { - drush_log(dt('History: @full_path', ['@full_path' => $full_path]), LogLevel::INFO); - } - - return $full_path; -} - -/** - * Returns a list of PHP keywords. - * - * This will act as a blacklist for command and alias names. - * - * @return array - */ -function _drush_core_cli_get_php_keywords() { - return [ - '__halt_compiler', - 'abstract', - 'and', - 'array', - 'as', - 'break', - 'callable', - 'case', - 'catch', - 'class', - 'clone', - 'const', - 'continue', - 'declare', - 'default', - 'die', - 'do', - 'echo', - 'else', - 'elseif', - 'empty', - 'enddeclare', - 'endfor', - 'endforeach', - 'endif', - 'endswitch', - 'endwhile', - 'eval', - 'exit', - 'extends', - 'final', - 'for', - 'foreach', - 'function', - 'global', - 'goto', - 'if', - 'implements', - 'include', - 'include_once', - 'instanceof', - 'insteadof', - 'interface', - 'isset', - 'list', - 'namespace', - 'new', - 'or', - 'print', - 'private', - 'protected', - 'public', - 'require', - 'require_once', - 'return', - 'static', - 'switch', - 'throw', - 'trait', - 'try', - 'unset', - 'use', - 'var', - 'while', - 'xor', - ]; -} diff --git a/vendor/drush/drush/commands/core/config.drush.inc b/vendor/drush/drush/commands/core/config.drush.inc deleted file mode 100644 index 254f5ce4ef79f3158f88e6370a34017e575b3e0a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/config.drush.inc +++ /dev/null @@ -1,1034 +0,0 @@ -<?php - -/** - * @file - * Provides Configuration Management commands. - */ - -use Drupal\config\StorageReplaceDataWrapper; -use Drush\Log\LogLevel; -use Drupal\Core\Config\StorageComparer; -use Drupal\Core\Config\ConfigImporter; -use Drupal\Core\Config\ConfigException; -use Drupal\Core\Config\FileStorage; -use Drupal\Component\Utility\NestedArray; -use Drush\Config\StorageWrapper; -use Drush\Config\CoreExtensionFilter; -use Symfony\Component\Yaml\Parser; - -/** - * Implementation of hook_drush_help(). - */ -function config_drush_help($section) { - switch ($section) { - case 'meta:config:title': - return dt('Config commands'); - case 'meta:config:summary': - return dt('Interact with the configuration system.'); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function config_drush_command() { - $deps = array('drupal dependencies' => array('config')); - $items['config-get'] = array( - 'description' => 'Display a config value, or a whole configuration object.', - 'arguments' => array( - 'config-name' => 'The config object name, for example "system.site".', - 'key' => 'The config key, for example "page.front". Optional.', - ), - 'required-arguments' => 1, - 'options' => array( - 'source' => array( - 'description' => 'The config storage source to read. Additional labels may be defined in settings.php', - 'example-value' => 'sync', - 'value' => 'required', - ), - 'include-overridden' => array( - 'description' => 'Include overridden values.', - ) - ), - 'examples' => array( - 'drush config-get system.site' => 'Displays the system.site config.', - 'drush config-get system.site page.front' => 'gets system.site:page.front value.', - ), - 'outputformat' => array( - 'default' => 'yaml', - 'pipe-format' => 'var_export', - ), - 'aliases' => array('cget', 'config:get'), - 'core' => array('8+'), - ); - - $items['config-set'] = array( - 'description' => 'Set config value directly. Does not perform a config import.', - 'arguments' => array( - 'config-name' => 'The config object name, for example "system.site".', - 'key' => 'The config key, for example "page.front".', - 'value' => 'The value to assign to the config key. Use \'-\' to read from STDIN.', - ), - 'options' => array( - 'format' => array( - 'description' => 'Format to parse the object. Use "string" for string (default), and "yaml" for YAML.', - 'example-value' => 'yaml', - 'value' => 'required', - ), - // A convenient way to pass a multiline value within a backend request. - 'value' => array( - 'description' => 'The value to assign to the config key (if any).', - 'hidden' => TRUE, - ), - ), - 'examples' => array( - 'drush config-set system.site page.front node' => 'Sets system.site:page.front to "node".', - ), - 'aliases' => array('cset', 'config:set'), - 'core' => array('8+'), - ); - - $items['config-export'] = array( - 'description' => 'Export configuration to a directory.', - 'core' => array('8+'), - 'aliases' => array('cex', 'config:export'), - 'arguments' => array( - 'label' => "A config directory label (i.e. a key in \$config_directories array in settings.php). Defaults to 'sync'", - ), - 'options' => array( - 'add' => 'Run `git add -p` after exporting. This lets you choose which config changes to sync for commit.', - 'commit' => 'Run `git add -A` and `git commit` after exporting. This commits everything that was exported without prompting.', - 'message' => 'Commit comment for the exported configuration. Optional; may only be used with --commit or --push.', - 'push' => 'Run `git push` after committing. Implies --commit.', - 'remote' => array( - 'description' => 'The remote git branch to use to push changes. Defaults to "origin".', - 'example-value' => 'origin', - ), - 'branch' => array( - 'description' => 'Make commit on provided working branch. Ignored if used without --commit or --push.', - 'example-value' => 'branchname', - ), - 'destination' => 'An arbitrary directory that should receive the exported files. An alternative to label argument.', - ), - 'examples' => array( - 'drush config-export --destination' => 'Export configuration; Save files in a backup directory named config-export.', - ), - ); - - $items['config-import'] = array( - 'description' => 'Import config from a config directory.', - 'arguments' => array( - 'label' => "A config directory label (i.e. a key in \$config_directories array in settings.php). Defaults to 'sync'", - ), - 'options' => array( - 'preview' => array( - 'description' => 'Format for displaying proposed changes. Recognized values: list, diff. Defaults to list.', - 'example-value' => 'list', - ), - 'source' => array( - 'description' => 'An arbitrary directory that holds the configuration files. An alternative to label argument', - ), - 'partial' => array( - 'description' => 'Allows for partial config imports from the source directory. Only updates and new configs will be processed with this flag (missing configs will not be deleted).', - ), - ), - 'core' => array('8+'), - 'examples' => array( - 'drush config-import --partial' => 'Import configuration; do not remove missing configuration.', - ), - 'aliases' => array('cim', 'config:import'), - ); - - $items['config-list'] = array( - 'description' => 'List config names by prefix.', - 'core' => array('8+'), - 'aliases' => array('cli', 'config:list'), - 'arguments' => array( - 'prefix' => 'The config prefix. For example, "system". No prefix will return all names in the system.', - ), - 'examples' => array( - 'drush config-list system' => 'Return a list of all system config names.', - 'drush config-list "image.style"' => 'Return a list of all image styles.', - 'drush config-list --format="json"' => 'Return all config names as json.', - ), - 'outputformat' => array( - 'default' => 'list', - 'pipe-format' => 'var_export', - 'output-data-type' => 'format-list', - ), - ); - - $items['config-edit'] = $deps + array( - 'description' => 'Open a config file in a text editor. Edits are imported into active configuration after closing editor.', - 'core' => array('8+'), - 'aliases' => array('cedit', 'config:edit'), - 'arguments' => array( - 'config-name' => 'The config object name, for example "system.site".', - ), - 'global-options' => array('editor', 'bg'), - 'allow-additional-options' => array('config-import'), - 'examples' => array( - 'drush config-edit image.style.large' => 'Edit the image style configurations.', - 'drush config-edit' => 'Choose a config file to edit.', - 'drush config-edit --choice=2' => 'Edit the second file in the choice list.', - 'drush --bg config-edit image.style.large' => 'Return to shell prompt as soon as the editor window opens.', - ), - ); - - $items['config-delete'] = array( - 'description' => 'Delete a configuration object.', - 'core' => array('8+'), - 'aliases' => array('cdel', 'config:delete'), - 'arguments' => array( - 'config-name' => 'The config object name, for example "system.site".', - 'key' => 'A config key to clear, for example "page.front".', - ), - 'required-arguments' => 1, - ); - - $items['config-pull'] = array( - 'description' => 'Export and transfer config from one environment to another.', - // 'core' => array('8+'), Operates on remote sites so not possible to declare this locally. - 'drush dependencies' => array('config', 'core'), // core-rsync, core-execute. - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'aliases' => array('cpull', 'config:pull'), - 'arguments' => array( - 'source' => 'A site-alias or the name of a subdirectory within /sites whose config you want to copy from.', - 'target' => 'A site-alias or the name of a subdirectory within /sites whose config you want to replace.', - ), - 'required-arguments' => TRUE, - 'allow-additional-options' => array(), // Most options from config-export and core-rsync unusable. - 'examples' => array( - 'drush config-pull @prod @stage' => "Export config from @prod and transfer to @stage.", - 'drush config-pull @prod @self --label=vcs' => "Export config from @prod and transfer to the 'vcs' config directory of current site.", - ), - 'options' => array( - 'safe' => 'Validate that there are no git uncommitted changes before proceeding', - 'label' => "A config directory label (i.e. a key in \$config_directories array in settings.php). Defaults to 'sync'", - 'runner' => 'Where to run the rsync command; defaults to the local site. Can also be "source" or "destination".', - ), - 'topics' => array('docs-aliases', 'docs-config-exporting'), - ); - - return $items; -} - -/** - * Implements hook_drush_help_alter(). - */ -function config_drush_help_alter(&$command) { - // Hide additional-options which are for internal use only. - if ($command['command'] == 'config-edit') { - $command['options']['source']['hidden'] = TRUE; - $command['options']['partial']['hidden'] = TRUE; - } -} - -/** - * Config list command callback - * - * @param string $prefix - * The config prefix to retrieve, or empty to return all. - */ -function drush_config_list($prefix = '') { - $names = \Drupal::configFactory()->listAll($prefix); - - if (empty($names)) { - // Just in case there is no config. - if (!$prefix) { - return drush_set_error(dt('No config storage names found.')); - } - else { - return drush_set_error(dt('No config storage names found matching @prefix', array('@prefix' => $prefix))); - } - } - - return $names; -} - -/** - * Config get command callback. - * - * @param $config_name - * The config name. - * @param $key - * The config key. - */ -function drush_config_get($config_name, $key = NULL) { - if (!isset($key)) { - return drush_config_get_object($config_name); - } - else { - return drush_config_get_value($config_name, $key); - } -} - -/** - * Config delete command callback. - * - * @param $config_name - * The config name. - * @param $key - * A config key to clear, for example "page.front". - */ -function drush_config_delete($config_name, $key = null) { - $config =\Drupal::service('config.factory')->getEditable($config_name); - if ($config->isNew()) { - return drush_set_error('DRUSH_CONFIG_ERROR', dt('Configuration name not recognized. Use config-list to see all names.')); - } - else { - if ($key) { - if ($config->get($key) === null) { - return drush_set_error('DRUSH_CONFIG_ERROR', dt('Configuration key !key not found.', array('!key' => $key))); - } - $config->clear($key)->save(); - } - else { - $config->delete(); - } - } -} - -/** - * Config set command callback. - * - * @param $config_name - * The config name. - * @param $key - * The config key. - * @param $data - * The data to save to config. - */ -function drush_config_set($config_name, $key = NULL, $data = NULL) { - // This hidden option is a convenient way to pass a value without passing a key. - $data = drush_get_option('value', $data); - - if (!isset($data)) { - return drush_set_error('DRUSH_CONFIG_ERROR', dt('No config value specified.')); - } - - $config = \Drupal::configFactory()->getEditable($config_name); - // Check to see if config key already exists. - if ($config->get($key) === NULL) { - $new_key = TRUE; - } - else { - $new_key = FALSE; - } - - // Special flag indicating that the value has been passed via STDIN. - if ($data === '-') { - $data = stream_get_contents(STDIN); - } - - // Now, we parse the value. - switch (drush_get_option('format', 'string')) { - case 'yaml': - $parser = new Parser(); - $data = $parser->parse($data, TRUE); - } - - if (is_array($data) && drush_confirm(dt('Do you want to update or set multiple keys on !name config.', array('!name' => $config_name)))) { - foreach ($data as $key => $value) { - $config->set($key, $value); - } - return $config->save(); - } - else { - $confirmed = FALSE; - if ($config->isNew() && drush_confirm(dt('!name config does not exist. Do you want to create a new config object?', array('!name' => $config_name)))) { - $confirmed = TRUE; - } - elseif ($new_key && drush_confirm(dt('!key key does not exist in !name config. Do you want to create a new config key?', array('!key' => $key, '!name' => $config_name)))) { - $confirmed = TRUE; - } - elseif (drush_confirm(dt('Do you want to update !key key in !name config?', array('!key' => $key, '!name' => $config_name)))) { - $confirmed = TRUE; - } - if ($confirmed && !drush_get_context('DRUSH_SIMULATE')) { - return $config->set($key, $data)->save(); - } - } -} - -/* - * If provided $destination is not TRUE and not empty, make sure it is writable. - */ -function drush_config_export_validate() { - $destination = drush_get_option('destination'); - if ($destination === TRUE) { - // We create a dir in command callback. No need to validate. - return; - } - - if (!empty($destination)) { - $additional = array(); - $values = drush_sitealias_evaluate_path($destination, $additional, TRUE); - if (!isset($values['path'])) { - return drush_set_error('config_export_target', 'The destination directory could not be evaluated.'); - } - $destination = $values['path']; - drush_set_option('destination', $destination); - if (!file_exists($destination)) { - $parent = dirname($destination); - if (!is_dir($parent)) { - return drush_set_error('config_export_target', 'The destination parent directory does not exist.'); - } - if (!is_writable($parent)) { - return drush_set_error('config_export_target', 'The destination parent directory is not writable.'); - } - } - else { - if (!is_dir($destination)) { - return drush_set_error('config_export_target', 'The destination is not a directory.'); - } - if (!is_writable($destination)) { - return drush_set_error('config_export_target', 'The destination directory is not writable.'); - } - } - } -} - -/** - * Command callback: Export config to specified directory (usually sync). - */ -function drush_config_export($destination = NULL) { - global $config_directories; - - // Determine which target directory to use. - if ($target = drush_get_option('destination')) { - if ($target === TRUE) { - // User did not pass a specific value for --destination. Make one. - /** @var drush_version_control_backup $backup */ - $backup = drush_include_engine('version_control', 'backup'); - $destination_dir = $backup->prepare_backup_dir('config-export'); - } - else { - $destination_dir = $target; - // It is important to be able to specify a destination directory that - // does not exist yet, for exporting on remote systems - drush_mkdir($destination_dir); - } - } - else { - $choices = drush_map_assoc(array_keys($config_directories)); - unset($choices[CONFIG_ACTIVE_DIRECTORY]); - if (!isset($destination) && count($choices) >= 2) { - $destination = drush_choice($choices, 'Choose a destination.'); - if (empty($destination)) { - return drush_user_abort(); - } - } - elseif (!isset($destination)) { - $destination = CONFIG_SYNC_DIRECTORY; - } - $destination_dir = config_get_config_directory($destination); - } - - // Prepare a new branch, if applicable - $remote = drush_get_option('push', FALSE); - $original_branch = FALSE; - $branch = FALSE; - if ($remote) { - // Get the branch that we're on at the moment - $result = drush_shell_cd_and_exec($destination_dir, 'git rev-parse --abbrev-ref HEAD'); - if (!$result) { - return drush_set_error('DRUSH_CONFIG_EXPORT_NO_GIT', dt("The drush config-export command requires that the selected configuration directory !dir be under git revision control when using --commit or --push options.", array('!dir' => $destination_dir))); - } - $output = drush_shell_exec_output(); - $original_branch = $output[0]; - $branch = drush_get_option('branch', FALSE); - if (!$branch) { - $branch = $original_branch; - } - if ($branch != $original_branch) { - // Switch to the working branch; create it if it does not exist. - // We do NOT want to use -B here, as we do NOT want to reset the - // branch if it already exists. - $result = drush_shell_cd_and_exec($destination_dir, 'git checkout %s', $branch); - if (!$result) { - $result = drush_shell_cd_and_exec($destination_dir, 'git checkout -b %s', $branch); - } - } - } - - // Do the actual config export operation - $result = _drush_config_export($destination, $destination_dir, $branch); - - // Regardless of the result of the export, reset to our original branch. - if ($branch != $original_branch) { - drush_shell_cd_and_exec($destination_dir, 'git checkout %s', $original_branch); - } - - return $result; -} - -function _drush_config_export($destination, $destination_dir, $branch) { - $commit = drush_get_option('commit'); - $comment = drush_get_option('message', 'Exported configuration.'); - if (count(glob($destination_dir . '/*')) > 0) { - // Retrieve a list of differences between the active and target configuration (if any). - if ($destination == CONFIG_SYNC_DIRECTORY) { - $target_storage = \Drupal::service('config.storage.sync'); - } - else { - $target_storage = new FileStorage($destination_dir); - } - /** @var \Drupal\Core\Config\StorageInterface $active_storage */ - $active_storage = \Drupal::service('config.storage'); - $comparison_source = $active_storage; - - $config_comparer = new StorageComparer($comparison_source, $target_storage, \Drupal::service('config.manager')); - if (!$config_comparer->createChangelist()->hasChanges()) { - return drush_log(dt('The active configuration is identical to the configuration in the export directory (!target).', array('!target' => $destination_dir)), LogLevel::OK); - } - - drush_print("Differences of the active config to the export directory:\n"); - $change_list = array(); - foreach ($config_comparer->getAllCollectionNames() as $collection) { - $change_list[$collection] = $config_comparer->getChangelist(NULL, $collection); - } - // Print a table with changes in color, then re-generate again without - // color to place in the commit comment. - _drush_print_config_changes_table($change_list); - $tbl = _drush_format_config_changes_table($change_list); - $output = $tbl->getTable(); - if (!stristr(PHP_OS, 'WIN')) { - $output = str_replace("\r\n", PHP_EOL, $output); - } - $comment .= "\n\n$output"; - - if (!$commit && !drush_confirm(dt('The .yml files in your export directory (!target) will be deleted and replaced with the active config.', array('!target' => $destination_dir)))) { - return drush_user_abort(); - } - // Only delete .yml files, and not .htaccess or .git. - $target_storage->deleteAll(); - } - - // Write all .yml files. - $source_storage = \Drupal::service('config.storage'); - if ($destination == CONFIG_SYNC_DIRECTORY) { - $destination_storage = \Drupal::service('config.storage.sync'); - } - else { - $destination_storage = new FileStorage($destination_dir); - } - - foreach ($source_storage->listAll() as $name) { - $destination_storage->write($name, $source_storage->read($name)); - } - - // Export configuration collections. - foreach (\Drupal::service('config.storage')->getAllCollectionNames() as $collection) { - $source_storage = $source_storage->createCollection($collection); - $destination_storage = $destination_storage->createCollection($collection); - foreach ($source_storage->listAll() as $name) { - $destination_storage->write($name, $source_storage->read($name)); - } - } - - drush_log(dt('Configuration successfully exported to !target.', array('!target' => $destination_dir)), LogLevel::SUCCESS); - drush_backend_set_result($destination_dir); - - // Commit and push, or add exported configuration if requested. - $remote = drush_get_option('push', FALSE); - if ($commit || $remote) { - // There must be changed files at the destination dir; if there are not, then - // we will skip the commit-and-push step - $result = drush_shell_cd_and_exec($destination_dir, 'git status --porcelain .'); - if (!$result) { - return drush_set_error('DRUSH_CONFIG_EXPORT_FAILURE', dt("`git status` failed.")); - } - $uncommitted_changes = drush_shell_exec_output(); - if (!empty($uncommitted_changes)) { - $result = drush_shell_cd_and_exec($destination_dir, 'git add -A .'); - if (!$result) { - return drush_set_error('DRUSH_CONFIG_EXPORT_FAILURE', dt("`git add -A` failed.")); - } - $comment_file = drush_save_data_to_temp_file($comment); - $result = drush_shell_cd_and_exec($destination_dir, 'git commit --file=%s', $comment_file); - if (!$result) { - return drush_set_error('DRUSH_CONFIG_EXPORT_FAILURE', dt("`git commit` failed. Output:\n\n!output", array('!output' => implode("\n", drush_shell_exec_output())))); - } - if ($remote) { - // Remote might be FALSE, if --push was not specified, or - // it might be TRUE if --push was not given a value. - if (!is_string($remote)) { - $remote = 'origin'; - } - $result = drush_shell_cd_and_exec($destination_dir, 'git push --set-upstream %s %s', $remote, $branch); - if (!$result) { - return drush_set_error('DRUSH_CONFIG_EXPORT_FAILURE', dt("`git push` failed.")); - } - } - } - } - elseif (drush_get_option('add')) { - drush_shell_exec_interactive('git add -p %s', $destination_dir); - } - - $values = array( - 'destination' => $destination_dir, - ); - return $values; -} - -function drush_config_import_validate() { - drush_include_engine('drupal', 'environment'); - if (drush_get_option('partial') && !drush_module_exists('config')) { - return drush_set_error('config_import_partial', 'Enable the config module in order to use the --partial option.'); - } - if ($source = drush_get_option('source')) { - if (!file_exists($source)) { - return drush_set_error('config_import_target', 'The source directory does not exist.'); - } - if (!is_dir($source)) { - return drush_set_error('config_import_target', 'The source is not a directory.'); - } - } -} - -/** - * Command callback. Import from specified config directory (defaults to sync). - */ -function drush_config_import($source = NULL) { - global $config_directories; - - // Determine source directory. - if ($target = drush_get_option('source')) { - $source_dir = $target; - } - else { - $choices = drush_map_assoc(array_keys($config_directories)); - unset($choices[CONFIG_ACTIVE_DIRECTORY]); - if (!isset($source) && count($choices) >= 2) { - $source= drush_choice($choices, 'Choose a source.'); - if (empty($source)) { - return drush_user_abort(); - } - } - elseif (!isset($source)) { - $source = CONFIG_SYNC_DIRECTORY; - } - $source_dir = config_get_config_directory($source); - } - - if ($source == CONFIG_SYNC_DIRECTORY) { - $source_storage = \Drupal::service('config.storage.sync'); - } - else { - $source_storage = new FileStorage($source_dir); - } - - // Determine $source_storage in partial and non-partial cases. - /** @var \Drupal\Core\Config\StorageInterface $active_storage */ - $active_storage = \Drupal::service('config.storage'); - if (drush_get_option('partial')) { - $replacement_storage = new StorageReplaceDataWrapper($active_storage); - foreach ($source_storage->listAll() as $name) { - $data = $source_storage->read($name); - $replacement_storage->replaceData($name, $data); - } - $source_storage = $replacement_storage; - } - - /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */ - $config_manager = \Drupal::service('config.manager'); - $storage_comparer = new StorageComparer($source_storage, $active_storage, $config_manager); - - if (!$storage_comparer->createChangelist()->hasChanges()) { - return drush_log(dt('There are no changes to import.'), LogLevel::OK); - } - - if (drush_get_option('preview', 'list') == 'list') { - $change_list = array(); - foreach ($storage_comparer->getAllCollectionNames() as $collection) { - $change_list[$collection] = $storage_comparer->getChangelist(NULL, $collection); - } - _drush_print_config_changes_table($change_list); - } - else { - // Copy active storage to the temporary directory. - $temp_dir = drush_tempdir(); - $temp_storage = new FileStorage($temp_dir); - $source_dir_storage = new FileStorage($source_dir); - foreach ($source_dir_storage->listAll() as $name) { - if ($data = $active_storage->read($name)) { - $temp_storage->write($name, $data); - } - } - drush_shell_exec('diff -x %s -u %s %s', '*.git', $temp_dir, $source_dir); - $output = drush_shell_exec_output(); - drush_print(implode("\n", $output)); - } - - if (drush_confirm(dt('Import the listed configuration changes?'))) { - return drush_op('_drush_config_import', $storage_comparer); - } -} - -// Copied from submitForm() at /core/modules/config/src/Form/ConfigSync.php -function _drush_config_import(StorageComparer $storage_comparer) { - $config_importer = new ConfigImporter( - $storage_comparer, - \Drupal::service('event_dispatcher'), - \Drupal::service('config.manager'), - \Drupal::lock(), - \Drupal::service('config.typed'), - \Drupal::moduleHandler(), - \Drupal::service('module_installer'), - \Drupal::service('theme_handler'), - \Drupal::service('string_translation') - ); - if ($config_importer->alreadyImporting()) { - drush_log('Another request may be synchronizing configuration already.', LogLevel::WARNING); - } - else{ - try { - // This is the contents of \Drupal\Core\Config\ConfigImporter::import. - // Copied here so we can log progress. - if ($config_importer->hasUnprocessedConfigurationChanges()) { - $sync_steps = $config_importer->initialize(); - foreach ($sync_steps as $step) { - $context = array(); - do { - $config_importer->doSyncStep($step, $context); - if (isset($context['message'])) { - drush_log(str_replace('Synchronizing', 'Synchronized', (string)$context['message']), LogLevel::OK); - } - } while ($context['finished'] < 1); - } - } - if ($config_importer->getErrors()) { - throw new \Drupal\Core\Config\ConfigException('Errors occurred during import'); - } - else { - drush_log('The configuration was imported successfully.', LogLevel::SUCCESS); - } - } - catch (ConfigException $e) { - // Return a negative result for UI purposes. We do not differentiate - // between an actual synchronization error and a failed lock, because - // concurrent synchronizations are an edge-case happening only when - // multiple developers or site builders attempt to do it without - // coordinating. - $message = 'The import failed due for the following reasons:' . "\n"; - $message .= implode("\n", $config_importer->getErrors()); - - watchdog_exception('config_import', $e); - return drush_set_error('config_import_fail', $message); - } - } -} - -/** - * Edit command callback. - */ -function drush_config_edit($config_name = '') { - // Identify and validate input. - if ($config_name) { - $config = \Drupal::configFactory()->get($config_name); - if ($config->isNew()) { - return drush_set_error(dt('Config !name does not exist', array('!name' => $config_name))); - } - } - else { - $config_names = \Drupal::configFactory()->listAll(); - $choice = drush_choice($config_names, 'Choose a configuration.'); - if (empty($choice)) { - return drush_user_abort(); - } - else { - $config_name = $config_names[$choice]; - $config = \Drupal::configFactory()->get($config_name); - } - } - - $active_storage = $config->getStorage(); - $contents = $active_storage->read($config_name); - - // Write tmp YAML file for editing - $temp_dir = drush_tempdir(); - $temp_storage = new FileStorage($temp_dir); - $temp_storage->write($config_name, $contents); - - $exec = drush_get_editor(); - drush_shell_exec_interactive($exec, $temp_storage->getFilePath($config_name)); - - // Perform import operation if user did not immediately exit editor. - if (!drush_get_option('bg', FALSE)) { - $options = drush_redispatch_get_options() + array('partial' => TRUE, 'source' => $temp_dir); - $backend_options = array('interactive' => TRUE); - return (bool) drush_invoke_process('@self', 'config-import', array(), $options, $backend_options); - } -} - -/** - * Config pull validate callback - * - */ -function drush_config_pull_validate($source, $destination) { - if (drush_get_option('safe')) { - $return = drush_invoke_process($destination, 'core-execute', array('git diff --quiet'), array('escape' => 0)); - if ($return['error_status']) { - return drush_set_error('DRUSH_GIT_DIRTY', 'There are uncommitted changes in your git working copy.'); - } - } -} - -/** - * Config pull command callback - * - * @param string $label - * The config label which receives the transferred files. - */ -function drush_config_pull($source, $destination) { - // @todo drush_redispatch_get_options() assumes you will execute same command. Not good. - $global_options = drush_redispatch_get_options() + array( - 'strict' => 0, - ); - - // @todo If either call is made interactive, we don't get an $return['object'] back. - $backend_options = array('interactive' => FALSE); - if (drush_get_context('DRUSH_SIMULATE')) { - $backend_options['backend-simulate'] = TRUE; - } - - $export_options = array( - // Use the standard backup directory on Destination. - 'destination' => TRUE, - ); - drush_log(dt('Starting to export configuration on Target.'), LogLevel::OK); - $return = drush_invoke_process($source, 'config-export', array(), $global_options + $export_options, $backend_options); - if ($return === FALSE || $return['error_status']) { - return drush_set_error('DRUSH_CONFIG_PULL_EXPORT_FAILED', dt('Config-export failed.')); - } - else { - // Trailing slash assures that transfer files and not the containing dir. - $export_path = $return['object'] . '/'; - } - - $rsync_options = array( - 'remove-source-files' => TRUE, - 'delete' => TRUE, - 'exclude-paths' => '.htaccess', - 'yes' => TRUE, // No need to prompt as destination is always the target config directory. - ); - $label = drush_get_option('label', 'sync'); - $runner = drush_get_runner($source, $destination, drush_get_option('runner', FALSE)); - drush_log(dt('Starting to rsync configuration files from !source to !dest.', array('!source' => $source, '!dest' => $destination)), LogLevel::OK); - // This comment applies similarly to sql-sync's use of core-rsync. - // Since core-rsync is a strict-handling command and drush_invoke_process() puts options at end, we can't send along cli options to rsync. - // Alternatively, add options like --ssh-options to a site alias (usually on the machine that initiates the sql-sync). - $return = drush_invoke_process($runner, 'core-rsync', array("$source:$export_path", "$destination:%config-$label"), $rsync_options); - if ($return['error_status']) { - return drush_set_error('DRUSH_CONFIG_PULL_RSYNC_FAILED', dt('Config-pull rsync failed.')); - } - - drush_backend_set_result($return['object']); -} - -/** - * Show and return a config object - * - * @param $config_name - * The config object name. - */ -function drush_config_get_object($config_name) { - $source = drush_get_option('source', 'active'); - $include_overridden = drush_get_option('include-overridden', FALSE); - - if ($include_overridden) { - // Displaying overrides only applies to active storage. - $config = \Drupal::config($config_name); - $data = $config->get(); - } - elseif ($source == 'active') { - $config = \Drupal::service('config.storage'); - $data = $config->read($config_name); - } - elseif ($source == 'sync') { - $config = \Drupal::service('config.storage.sync'); - $data = $config->read($config_name); - } - else { - return drush_set_error(dt('Unknown value !value for config source.', array('!value' => $source))); - } - - if ($data === FALSE) { - return drush_set_error(dt('Config !name does not exist in !source configuration.', array('!name' => $config_name, '!source' => $source))); - } - if (empty($data)) { - drush_log(dt('Config !name exists but has no data.', array('!name' => $config_name)), LogLevel::NOTICE); - return; - } - return $data; -} - -/** - * Show and return a value from config system. - * - * @param $config_name - * The config name. - * @param $key - * The config key. - */ -function drush_config_get_value($config_name, $key) { - $data = drush_config_get_object($config_name); - $parts = explode('.', $key); - if (count($parts) == 1) { - $value = isset($data[$key]) ? $data[$key] : NULL; - } - else { - $value = NestedArray::getValue($data, $parts, $key_exists); - $value = $key_exists ? $value : NULL; - } - - $returns[$config_name . ':' . $key] = $value; - - if ($value === NULL) { - return drush_set_error('DRUSH_CONFIG_ERROR', dt('No matching key found in !name config.', array('!name' => $config_name))); - } - else { - return $returns; - } -} - -/** - * Print a table of config changes. - * - * @param array $config_changes - * An array of changes keyed by collection. - */ -function _drush_format_config_changes_table(array $config_changes, $use_color = FALSE) { - if (!$use_color) { - $red = "%s"; - $yellow = "%s"; - $green = "%s"; - } - else { - $red = "\033[31;40m\033[1m%s\033[0m"; - $yellow = "\033[1;33;40m\033[1m%s\033[0m"; - $green = "\033[1;32;40m\033[1m%s\033[0m"; - } - - $rows = array(); - $rows[] = array('Collection', 'Config', 'Operation'); - foreach ($config_changes as $collection => $changes) { - foreach ($changes as $change => $configs) { - switch ($change) { - case 'delete': - $colour = $red; - break; - case 'update': - $colour = $yellow; - break; - case 'create': - $colour = $green; - break; - default: - $colour = "%s"; - break; - } - foreach($configs as $config) { - $rows[] = array( - $collection, - $config, - sprintf($colour, $change) - ); - } - } - } - $tbl = _drush_format_table($rows); - return $tbl; -} - -/** - * Print a table of config changes. - * - * @param array $config_changes - * An array of changes keyed by collection. - */ -function _drush_print_config_changes_table(array $config_changes) { - $tbl = _drush_format_config_changes_table($config_changes, !drush_get_context('DRUSH_NOCOLOR')); - - $output = $tbl->getTable(); - if (!stristr(PHP_OS, 'WIN')) { - $output = str_replace("\r\n", PHP_EOL, $output); - } - - drush_print(rtrim($output)); - return $tbl; -} - -/** - * Command argument complete callback. - */ -function config_config_get_complete() { - return _drush_config_names_complete(); -} - -/** - * Command argument complete callback. - */ -function config_config_set_complete() { - return _drush_config_names_complete(); -} - -/** - * Command argument complete callback. - */ -function config_config_view_complete() { - return _drush_config_names_complete(); -} - -/** - * Command argument complete callback. - */ -function config_config_edit_complete() { - return _drush_config_names_complete(); -} - -/** - * Command argument complete callback. - */ -function config_config_import_complete() { - return _drush_config_directories_complete(); -} - -/** - * Command argument complete callback. - */ -function config_config_export_complete() { - return _drush_config_directories_complete(); -} - -/** - * Command argument complete callback. - */ -function config_config_pull_complete() { - return array('values' => array_keys(_drush_sitealias_all_list())); -} - -/** - * Helper function for command argument complete callback. - * - * @return - * Array of available config directories. - */ -function _drush_config_directories_complete() { - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION); - global $config_directories; - return array('values' => array_keys($config_directories)); -} - -/** - * Helper function for command argument complete callback. - * - * @return - * Array of available config names. - */ -function _drush_config_names_complete() { - drush_bootstrap_max(); - return array('values' => $storage = \Drupal::service('config.storage')->listAll()); -} diff --git a/vendor/drush/drush/commands/core/core.drush.inc b/vendor/drush/drush/commands/core/core.drush.inc deleted file mode 100644 index 62caf5c5a736515f83287327119e397f078865ed..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/core.drush.inc +++ /dev/null @@ -1,1394 +0,0 @@ -<?php - -/** - * @file - * Core drush commands. - */ - -use Drush\Log\LogLevel; - -/** - * Implementation of hook_drush_help(). - * - * This function is called whenever a drush user calls - * 'drush help <name-of-your-command>' - * - * @param - * A string with the help section (prepend with 'drush:') - * - * @return - * A string with the help text for your command. - */ -function core_drush_help($section) { - switch ($section) { - case 'meta:core:title': - return dt("Core Drush commands"); - case 'drush:php-script': - return dt("Runs the given php script(s) after a full Drupal bootstrap. A useful alternative to eval command when your php is lengthy or you can't be bothered to figure out bash quoting. If you plan to share a script with others, consider making a full drush command instead, since that's more self-documenting. Drush provides commandline options to the script via drush_get_option('option-name'), and commandline arguments can be accessed either via drush_get_arguments(), which returns all arguments in an array, or drush_shift(), which removes the next argument from the list and returns it."); - case 'drush:rsync': - return dt("Sync the entire drupal directory or a subdirectory to a <destination> using ssh. Excludes reserved files and directories for supported VCSs. Useful for pushing copies of your tree to a staging server, or retrieving a files directory from a remote site. Relative paths start from the Drupal root directory if a site alias is used; otherwise they start from the current working directory."); - case 'error:DRUSH_DRUPAL_DB_ERROR': - $message = dt("Drush was not able to start (bootstrap) the Drupal database.\n"); - $message .= dt("Hint: This may occur when Drush is trying to:\n"); - $message .= dt(" * bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See `drush topic docs-aliases` for details.\n"); - $message .= dt(" * connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See http://drupal.org/node/1428638 for details.\n"); - $message .= dt(" * connect to the database through a cli command using the --defaults-extra-file parameter to pass credentials through a tmp file. This method can break if other credentials are specified in a ~/.my.cnf file in your home directory. You may have to delete or rename the ~/.my.cnf file in your home directory.\n"); - $message .= dt("\nDrush was attempting to connect to: \n!credentials\n", array('!credentials' => _core_site_credentials(12))); - return $message; - case 'error:DRUSH_DRUPAL_BOOTSTRAP_ERROR': - $message = dt("Drush was not able to start (bootstrap) Drupal.\n"); - $message .= dt("Hint: This error can only occur once the database connection has already been successfully initiated, therefore this error generally points to a site configuration issue, and not a problem connecting to the database.\n"); - $message .= dt("\nDrush was attempting to connect to: \n!credentials\n", array('!credentials' => _core_site_credentials(12))); - return $message; - break; - } -} - -/** - * Implements hook_drush_help_alter(). - */ -function core_drush_help_alter(&$command) { - // Drupal 8+ only options. - if (drush_drupal_major_version() < 8) { - if ($command['commandfile'] == 'core' && $command['command'] == 'updatedb') { - unset($command['options']['entity-updates']); - } - } -} - -/** - * Implementation of hook_drush_command(). - * - * In this hook, you specify which commands your - * drush module makes available, what it does and - * description. - * - * Notice how this structure closely resembles how - * you define menu hooks. - * - * @return - * An associative array describing your command(s). - */ -function core_drush_command() { - $items = array(); - - $items['version'] = array( - 'description' => 'Show drush version.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, // No bootstrap. - 'options' => array( - 'pipe' => 'Print just the version number, and nothing else.', - ), - 'outputformat' => array( - 'default' => 'key-value', - 'pipe-format' => 'string', - 'label' => 'Drush Version', - 'output-data-type' => 'format-single', - ), - ); - $items['core-cron'] = array( - 'description' => 'Run all cron hooks in all active modules for specified site.', - 'aliases' => array('cron', 'core:cron'), - 'topics' => array('docs-cron'), - ); - $items['updatedb'] = array( - 'description' => 'Apply any database updates required (as with running update.php).', - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE, - 'global-options' => array( - 'cache-clear', - ), - 'options' => array( - 'entity-updates' => 'Run automatic entity schema updates at the end of any update hooks. Defaults to --no-entity-updates.', - ), - 'aliases' => array('updb'), - ); - $items['entity-updates'] = array( - 'description' => 'Apply pending entity schema updates.', - 'aliases' => array('entup', 'entity:updates'), - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - 'core' => array('8+'), - ); - $items['twig-compile'] = array( - 'description' => 'Compile all Twig template(s).', - 'aliases' => array('twigc', 'twig:compile'), - 'core' => array('8+'), - ); - $items['updatedb-status'] = array( - 'description' => 'List any pending database updates.', - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'csv', - 'field-labels' => array('module' => 'Module', 'update_id' => 'Update ID', 'description' => 'Description'), - 'fields-default' => array('module', 'update_id', 'description'), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('updbst', 'updatedb:status'), - ); - $items['core-config'] = array( - 'description' => 'Edit drushrc, site alias, and Drupal settings.php files.', - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'arguments' => array( - 'filter' => 'A substring for filtering the list of files. Omit this argument to choose from loaded files.', - ), - 'global-options' => array('editor', 'bg'), - 'examples' => array( - 'drush core-config' => 'Pick from a list of config/alias/settings files. Open selected in editor.', - 'drush --bg core-config' => 'Return to shell prompt as soon as the editor window opens.', - 'drush core-config etc' => 'Edit the global configuration file.', - 'drush core-config demo.alia' => 'Edit a particular alias file.', - 'drush core-config sett' => 'Edit settings.php for the current Drupal site.', - 'drush core-config --choice=2' => 'Edit the second file in the choice list.', - ), - 'aliases' => array('conf', 'config', 'core:config'), - ); - $items['core-status'] = array( - 'description' => 'Provides a birds-eye view of the current Drupal installation, if any.', - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'aliases' => array('status', 'st', 'core:status'), - 'examples' => array( - 'drush core-status version' => 'Show all status lines that contain version information.', - 'drush core-status --pipe' => 'A list key=value items separated by line breaks.', - 'drush core-status drush-version --pipe' => 'Emit just the drush version with no label.', - 'drush core-status config-sync --pipe' => 'Emit just the sync Config directory with no label.', - ), - 'arguments' => array( - 'item' => 'Optional. The status item line(s) to display.', - ), - 'options' => array( - 'show-passwords' => 'Show database password. Defaults to --no-show-passwords.', - 'full' => 'Show all file paths and drush aliases in the report, even if there are a lot.', - 'project' => array( - 'description' => 'One or more projects that should be added to the path list', - 'example-value' => 'foo,bar', - ), - ), - 'outputformat' => array( - 'default' => 'key-value', - 'pipe-format' => 'json', - 'field-labels' => array('drupal-version' => 'Drupal version', 'uri' => 'Site URI', 'db-driver' => 'Database driver', 'db-hostname' => 'Database hostname', 'db-port' => 'Database port', 'db-username' => 'Database username', 'db-password' => 'Database password', 'db-name' => 'Database name', 'db-status' => 'Database', 'bootstrap' => 'Drupal bootstrap', 'user' => 'Drupal user', 'theme' => 'Default theme', 'admin-theme' => 'Administration theme', 'php-bin' => 'PHP executable', 'php-conf' => 'PHP configuration', 'php-os' => 'PHP OS', 'drush-script' => 'Drush script', 'drush-version' => 'Drush version', 'drush-temp' => 'Drush temp directory', 'drush-conf' => 'Drush configuration', 'drush-alias-files' => 'Drush alias files', 'install-profile' => 'Install profile', 'root' => 'Drupal root', 'drupal-settings-file' => 'Drupal Settings File', 'site-path' => 'Site path', 'root' => 'Drupal root', 'site' => 'Site path', 'themes' => 'Themes path', 'modules' => 'Modules path', 'files' => 'File directory path', 'private' => 'Private file directory path', 'temp' => 'Temporary file directory path', 'config-sync' => 'Sync config path', 'files-path' => 'File directory path', 'temp-path' => 'Temporary file directory path', '%paths' => 'Other paths'), - 'formatted-filter' => '_drush_core_status_format_table_data', - 'private-fields' => 'db-password', - 'simplify-single' => TRUE, - 'table-metadata' => array( - 'list-separator' => ' ', - ), - 'output-data-type' => 'format-list', - ), - 'topics' => array('docs-readme'), - ); - - $items['core-requirements'] = array( - 'description' => 'Provides information about things that may be wrong in your Drupal installation, if any.', - 'aliases' => array('status-report','rq', 'core:requirements'), - 'examples' => array( - 'drush core-requirements' => 'Show all status lines from the Status Report admin page.', - 'drush core-requirements --severity=2' => 'Show only the red lines from the Status Report admin page.', - 'drush core-requirements --pipe' => 'Print out a short report in JSON format, where severity 2=error, 1=warning, and 0/-1=OK', - ), - 'options' => array( - 'severity' => array( - 'description' => 'Only show status report messages with a severity greater than or equal to the specified value.', - 'value' => 'required', - 'example-value' => '3', - ), - 'ignore' => 'Comma-separated list of requirements to remove from output. Run with --pipe to see key values to use.', - ), - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'json', - 'field-labels' => array('title' => 'Title', 'severity' => 'Severity', 'sid' => 'SID', 'description' => 'Description', 'value' => 'Summary', 'reason' => 'Reason', 'weight' => 'Weight'), - 'fields-default' => array('title', 'severity', 'description'), - 'column-widths' => array('severity' => 8), - 'concatenate-columns' => array('description' => array('value', 'description')), - 'strip-tags' => TRUE, - 'ini-item' => 'sid', - 'key-value-item' => 'severity', - 'list-metadata' => array( - 'list-item' => 'severity', - ), - 'output-data-type' => 'format-table', - ), - ); - $items['php-eval'] = array( - 'description' => 'Evaluate arbitrary php code after bootstrapping Drupal (if available).', - 'examples' => array( - 'drush php-eval \'variable_set("hello", "world");\'' => 'Sets the hello variable using Drupal API.', - 'drush php-eval \'$node = node_load(1); print $node->title;\'' => 'Loads node with nid 1 and then prints its title.', - 'drush php-eval "file_unmanaged_copy(\'$HOME/Pictures/image.jpg\', \'public://image.jpg\');"' => 'Copies a file whose path is determined by an environment\'s variable. Note the use of double quotes so the variable $HOME gets replaced by its value.', - 'drush php-eval "node_access_rebuild();"' => 'Rebuild node access permissions.', - ), - 'arguments' => array( - 'code' => 'PHP code', - ), - 'required-arguments' => TRUE, - 'allow-additional-options' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'aliases' => array('eval', 'ev', 'php:eval'), - 'outputformat' => array( - 'default' => 'var_export', - ), - ); - $items['php-script'] = array( - 'description' => "Run php script(s).", - 'examples' => array( - 'drush php-script scratch' => 'Run scratch.php script. See commands/core directory.', - 'drush php-script example --script-path=/path/to/scripts:/another/path' => 'Run script from specified paths', - 'drush php-script' => 'List all available scripts.', - '' => '', - "#!/usr/bin/env drush\n<?php\nvariable_set('key', drush_shift());" => "Execute php code with a full Drupal bootstrap directly from a shell script.", - ), - 'arguments' => array( - 'filename' => 'Optional. The file you wish to execute (without extension). If omitted, list files ending in .php in the current working directory and specified script-path. Some might not be real drush scripts. Beware.', - ), - 'options' => array( - 'script-path' => array( - 'description' => "Additional paths to search for scripts, separated by : (Unix-based systems) or ; (Windows).", - 'example-value' => '~/scripts', - ), - ), - 'allow-additional-options' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'aliases' => array('scr', 'php:script'), - 'topics' => array('docs-examplescript', 'docs-scripts'), - ); - $items['core-execute'] = array( - 'description' => 'Execute a shell command. Usually used with a site alias.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, // No bootstrap. - 'arguments' => array( - 'command' => 'The shell command to be executed.', - ), - 'options' => array( - 'escape' => 'Escape parameters before executing them with the shell. Default is escape; use --no-escape to disable.', - ) + drush_shell_exec_proc_build_options(), - 'required-arguments' => TRUE, - 'allow-additional-options' => TRUE, - 'handle-remote-commands' => TRUE, - 'strict-option-handling' => TRUE, - 'examples' => array( - 'drush core-execute git pull origin rebase' => 'Retrieve latest code from git', - ), - 'aliases' => array('exec', 'execute', 'core:execute'), - 'topics' => array('docs-aliases'), - ); - $items['core-rsync'] = array( - 'description' => 'Rsync the Drupal tree to/from another server using ssh.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, // No bootstrap. - 'arguments' => array( - 'source' => 'May be rsync path or site alias. See rsync documentation and example.aliases.drushrc.php.', - 'destination' => 'May be rsync path or site alias. See rsync documentation and example.aliases.drushrc.php.', - ), - 'options' => array( - 'mode' => 'The unary flags to pass to rsync; --mode=rultz implies rsync -rultz. Default is -akz.', - 'exclude-conf' => 'Excludes settings.php from being rsynced. Default.', - 'include-conf' => 'Allow settings.php to be rsynced. Default is to exclude settings.php.', - 'include-vcs' => 'Include special version control directories (e.g. .svn). Default is to exclude vcs files.', - 'exclude-files' => 'Exclude the files directory.', - 'exclude-sites' => 'Exclude all directories in "sites/" except for "sites/all".', - 'exclude-other-sites' => 'Exclude all directories in "sites/" except for "sites/all" and the site directory for the site being synced. Note: if the site directory is different between the source and destination, use --exclude-sites followed by "drush rsync @from:%site @to:%site"', - 'exclude-paths' => 'List of paths to exclude, seperated by : (Unix-based systems) or ; (Windows).', - 'include-paths' => 'List of paths to include, seperated by : (Unix-based systems) or ; (Windows).', - '{rsync-option-name}' => "Replace {rsync-option-name} with the rsync option (or option='value') that you would like to pass through to rsync. Examples include --delete, --exclude=*.sql, --filter='merge /etc/rsync/default.rules', etc. See the rsync documentation for a complete explanation of all the rsync options and values.", - 'rsync-version' => 'Set to the version of rsync you are using to signal Drush to go into backwards-compatibility mode when using very old versions of rsync. For example, --rsync-version=2.6.8 or earlier will cause Drush to avoid the --remove-source-files flag.', - - ), - 'strict-option-handling' => TRUE, - 'examples' => array( - 'drush rsync @dev @stage' => 'Rsync Drupal root from Drush alias dev to the alias stage. Either or both may be remote.', - 'drush rsync ./ @stage:%files/img' => 'Rsync all files in the current directory to the \'img\' directory in the file storage folder on the Drush alias stage.', - 'drush -s rsync @dev @stage --exclude=*.sql --delete' => "Simulate Rsync Drupal root from the Drush alias dev to the alias stage (one of which must be local), excluding all files that match the filter '*.sql' and delete all files on the destination that are no longer on the source.", - ), - 'aliases' => array('rsync', 'core:rsync'), - 'topics' => array('docs-aliases'), - ); - $items['drupal-directory'] = array( - 'description' => 'Return the filesystem path for modules/themes and other key folders.', - 'arguments' => array( - 'target' => 'A module/theme name, or special names like root, files, private, or an alias : path alias string such as @alias:%files. Defaults to root.', - ), - 'options' => array( - 'component' => "The portion of the evaluated path to return. Defaults to 'path'; 'name' returns the site alias of the target.", - 'local-only' => "Reject any target that specifies a remote site.", - ), - 'examples' => array( - 'cd `drush dd devel`' => 'Navigate into the devel module directory', - 'cd `drush dd` ' => 'Navigate to the root of your Drupal site', - 'cd `drush dd files`' => 'Navigate to the files directory.', - 'drush dd @alias:%files' => 'Print the path to the files directory on the site @alias.', - 'edit `drush dd devel`/devel.module' => "Open devel module in your editor (customize 'edit' for your editor)", - ), - 'aliases' => array('dd', 'drupal:directory'), - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - - $items['batch-process'] = array( - 'description' => 'Process operations in the specified batch set', - 'hidden' => TRUE, - 'arguments' => array( - 'batch-id' => 'The batch id that will be processed.', - ), - 'required-arguments' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN, - 'aliases' => array('batch:process'), - ); - - $items['updatedb-batch-process'] = array( - 'description' => 'Perform update functions', - 'hidden' => TRUE, - 'arguments' => array( - 'batch-id' => 'The batch id that will be processed', - ), - 'required-arguments' => TRUE, - // Drupal 7 needs DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, while Drupal 8 needs _FULL. - // Therefore we bootstrap to _FULL in commands/core/drupal/update.inc. - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, - 'aliases' => array('updatedb:batch-process'), - ); - $items['core-global-options'] = array( - 'description' => 'All global options', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'csv', - 'field-labels' => array('label' => 'Label', 'description' => 'Description'), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('core:global-options'), - ); - $items['core-quick-drupal'] = array( - 'description' => 'Download, install, serve and login to Drupal with minimal configuration and dependencies.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'aliases' => array('qd', 'cutie', 'core:quick:drupal'), - 'arguments' => array( - 'site' => 'Short name for the site to be created - used as a directory name and as sqlite file name. Optional - if omitted timestamped "quick-drupal" directory will be used instead.', - 'projects' => 'A list of projects to download into the new site. If projects contain extensions (modules or themes) with the same name they will be enabled by default. See --enable option to control this behaviour further.', - ), - 'examples' => array( - 'drush qd' => 'Download and install stable release of Drupal into a timestamped directory, start server, and open the site logged in as admin.', - 'drush qd --profile=minimal --cache --core=drupal-8.0.x --yes' => 'Fire up dev release of Drupal site with minimal install profile.', - 'drush qd testsite devel --server=:8081/admin --browser=firefox --cache --yes' => 'Fire up stable release (using the cache) of Drupal site called "testsite", download and enable devel module, start a server on port 8081 and open /admin in firefox.', - 'drush qd commercesite --core=commerce_kickstart --profile=commerce_kickstart --cache --yes --watchdog' => 'Download and install the "Commerce Kickstart" distribution/install profile, display watchdog messages on the server console.', - 'drush qd --makefile=mysite.make' => 'Create and install a site from a makefile.', - ), - ); - // Add in options/engines. - drush_core_quick_drupal_options($items); - // Add in topics for engines - $items += drush_get_engine_topics(); - return $items; -} - -/** - * Command argument complete callback. - * - * @return - * Array of available profile names. - */ -function core_site_install_complete() { - $max = drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_ROOT); - if ($max >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) { - return array('values' => array_keys(drush_find_profiles(DRUPAL_ROOT))); - } -} - -/** - * Command argument complete callback. - * - * @return - * Array of available site aliases. - */ -function core_core_rsync_complete() { - return array('values' => array_keys(_drush_sitealias_all_list())); -} - -/** - * @defgroup engines Engine types - * @{ - */ - -/** - * Implementation of hook_drush_engine_type_info(). - */ -function core_drush_engine_type_info() { - $info = array(); - $info['drupal'] = array(); - return $info; -} - -/** - * Implements hook_drush_engine_ENGINE_TYPE(). - */ -function core_drush_engine_drupal() { - $engines = array( - 'batch' => array(), - 'update'=> array(), - 'environment' => array(), - 'site_install' => array(), - 'pm' => array(), - 'cache' => array(), - 'image' => array(), - ); - return $engines; -} - -/** - * @} End of "Engine types". - */ - -/** - * Command handler. Apply pending entity schema updates. - */ -function drush_core_entity_updates() { - if (drush_get_context('DRUSH_SIMULATE')) { - drush_log(dt('entity-updates command does not support --simulate option.'), LogLevel::OK); - } - - drush_include_engine('drupal', 'update'); - if (entity_updates_main() === FALSE) { - return FALSE; - } - - drush_drupal_cache_clear_all(); - - drush_log(dt('Finished performing updates.'), LogLevel::OK); -} - -/** - * Command handler. Execute update.php code from drush. - */ -function drush_core_updatedb() { - if (drush_get_context('DRUSH_SIMULATE')) { - drush_log(dt('updatedb command does not support --simulate option.'), LogLevel::OK); - return TRUE; - } - - drush_include_engine('drupal', 'update'); - $result = update_main(); - if ($result === FALSE) { - return FALSE; - } - elseif ($result > 0) { - // Clear all caches in a new process. We just performed major surgery. - drush_drupal_cache_clear_all(); - - drush_log(dt('Finished performing updates.'), LogLevel::OK); - } -} - -/** - * Command handler. List pending DB updates. - */ -function drush_core_updatedb_status() { - require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; - drupal_load_updates(); - drush_include_engine('drupal', 'update'); - list($pending, $start) = updatedb_status(); - if (empty($pending)) { - drush_log(dt("No database updates required"), LogLevel::OK); - } - return $pending; -} - -function _core_site_credentials($right_margin = 0) { - // Leave some space on the right so that we can put the result into the - // drush_log, which will again wordwrap the result. - $original_columns = drush_get_context('DRUSH_COLUMNS', 80); - drush_set_context('DRUSH_COLUMNS', $original_columns - $right_margin); - $status_table = _core_site_status_table(); - $metadata = drush_get_command_format_metadata('core-status'); - $output = drush_format($status_table, $metadata, 'key-value'); - drush_set_context('DRUSH_COLUMNS', $original_columns); - return $output; -} - -function _core_path_aliases($project = '') { - $paths = array(); - $site_wide = drush_drupal_sitewide_directory(); - $boot = drush_get_bootstrap_object(); - if ($drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT')) { - $paths['%root'] = $drupal_root; - if ($site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT')) { - $paths['%site'] = $site_root; - if (is_dir($modules_path = $boot->conf_path() . '/modules')) { - $paths['%modules'] = $modules_path; - } - else { - $paths['%modules'] = ltrim($site_wide . '/modules', '/'); - } - if (is_dir($themes_path = $boot->conf_path() . '/themes')) { - $paths['%themes'] = $themes_path; - } - else { - $paths['%themes'] = ltrim($site_wide . '/themes', '/'); - } - if (drush_drupal_major_version() >= 8 && drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)) { - try { - if (isset($GLOBALS['config_directories'])) { - foreach ($GLOBALS['config_directories'] as $label => $unused) { - $paths["%config-$label"] = config_get_config_directory($label); - } - } - } - catch (Exception $e) { - // Nothing to do. - } - } - - if (drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - $paths['%files'] = drush_file_get_public(); - if ($private_path = drush_file_get_private()) { - $paths['%private'] = $private_path; - } - } - - if (function_exists('file_directory_temp')) { - $paths['%temp'] = file_directory_temp(); - } - // If the 'project' parameter was specified, then search - // for a project (or a few) and add its path to the path list - if (!empty($project)) { - drush_include_engine('drupal', 'environment'); - $projects = array_merge(drush_get_modules(), drush_get_themes()); - foreach(explode(',', $project) as $target) { - if (array_key_exists($target, $projects)) { - $paths['%' . $target] = $drupal_root . '/' . _drush_extension_get_path($projects[$target]); - } - } - } - } - } - - // Add in all of the global paths from $options['path-aliases'] - $paths = array_merge($paths, drush_get_option('path-aliases', array())); - - return $paths; -} - -function _core_site_status_table($project = '') { - $phase = drush_get_context('DRUSH_BOOTSTRAP_PHASE'); - if ($drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT')) { - $status_table['drupal-version'] = drush_drupal_version(); - $boot_object = drush_get_bootstrap_object(); - $conf_dir = $boot_object->conf_path(); - $settings_file = "$conf_dir/settings.php"; - $status_table['drupal-settings-file'] = file_exists($settings_file) ? $settings_file : ''; - if ($site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT')) { - $status_table['uri'] = drush_get_context('DRUSH_URI'); - try { - $sql = drush_sql_get_class(); - $db_spec = $sql->db_spec(); - $status_table['db-driver'] = $db_spec['driver']; - if (!empty($db_spec['unix_socket'])) { - $status_table['db-socket'] = $db_spec['unix_socket']; - } - elseif (isset($db_spec['host'])) { - $status_table['db-hostname'] = $db_spec['host']; - } - $status_table['db-username'] = isset($db_spec['username']) ? $db_spec['username'] : NULL; - $status_table['db-password'] = isset($db_spec['password']) ? $db_spec['password'] : NULL; - $status_table['db-name'] = isset($db_spec['database']) ? $db_spec['database'] : NULL; - $status_table['db-port'] = isset($db_spec['port']) ? $db_spec['port'] : NULL; - if ($phase > DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION) { - $status_table['install-profile'] = $boot_object->get_profile(); - if ($phase > DRUSH_BOOTSTRAP_DRUPAL_DATABASE) { - $status_table['db-status'] = dt('Connected'); - if ($phase > DRUSH_BOOTSTRAP_DRUPAL_FULL) { - $status_table['bootstrap'] = dt('Successful'); - if ($phase == DRUSH_BOOTSTRAP_DRUPAL_LOGIN) { - $status_table['user'] = drush_user_get_class()->getCurrentUserAsSingle()->getUsername(); - } - } - } - } - } - catch (Exception $e) { - // Don't worry be happy. - } - } - if (drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - $status_table['theme'] = drush_theme_get_default(); - $status_table['admin-theme'] = drush_theme_get_admin(); - } - } - if ($php_bin = drush_get_option('php')) { - $status_table['php-bin'] = $php_bin; - } - $status_table['php-os'] = PHP_OS; - if ($php_ini_files = _drush_core_config_php_ini_files()) { - $status_table['php-conf'] = $php_ini_files; - } - $status_table['drush-script'] = DRUSH_COMMAND; - $status_table['drush-version'] = DRUSH_VERSION; - $status_table['drush-temp'] = drush_find_tmp(); - $status_table['drush-conf'] = drush_flatten_array(drush_get_context_options('context-path', '')); - $alias_files = _drush_sitealias_find_alias_files(); - $status_table['drush-alias-files'] = $alias_files; - - $paths = _core_path_aliases($project); - if (!empty($paths)) { - foreach ($paths as $target => $one_path) { - $name = $target; - if (substr($name,0,1) == '%') { - $name = substr($name,1); - } - $status_table[$name] = $one_path; - } - } - - // Store the paths into the '%paths' index; this will be - // used by other code, but will not be included in the output - // of the drush status command. - $status_table['%paths'] = $paths; - - return $status_table; -} - -// Adjust the status output for any non-pipe output format -function _drush_core_status_format_table_data($output, $metadata) { - if (drush_get_option('full', FALSE) == FALSE) { - // Hide any key that begins with a % - foreach ($output as $key => $value) { - if ($key[0] == '%') { - unset($output[$key]); - } - } - // Hide 'Modules path' and 'Themes path' as well - unset($output['modules']); - unset($output['themes']); - // Shorten the list of alias files if there are too many - if (isset($output['drush-alias-files']) && count($output['drush-alias-files']) > 24) { - $msg = dt("\nThere are !count more alias files. Run with --full to see the full list.", array('!count' => count($output['drush-alias-files']) - 1)); - $output['drush-alias-files'] = array($output['drush-alias-files'][0] , $msg); - } - if (isset($output['drupal-settings-file']) && empty($output['drupal-settings-file'])) { - $output['drupal-settings-file'] = dt('MISSING'); - } - } - return $output; -} - -/** - * Command callback. Runs all cron hooks. - */ -function drush_core_cron() { - if (drush_drupal_major_version() < 8) { - $result = drupal_cron_run(); - } - else { - $result = \Drupal::service('cron')->run(); - } - if ($result) { - drush_log(dt('Cron run successful.'), LogLevel::SUCCESS); - } - else { - return drush_set_error('DRUSH_CRON_FAILED', dt('Cron run failed.')); - } -} - -/** - * Command callback. Edit drushrc and alias files. - */ -function drush_core_config($filter = NULL) { - $all = drush_core_config_load(); - - // Apply any filter that was supplied. - if ($filter) { - foreach ($all as $key => $file) { - if (strpos($file, $filter) === FALSE) { - unset($all[$key]); - } - } - } - $all = drush_map_assoc(array_values($all)); - - $exec = drush_get_editor(); - if (count($all) == 1) { - $filepath = current($all); - } - else { - $choice = drush_choice($all, 'Enter a number to choose which file to edit.', '!key'); - if (!$choice) { - return drush_user_abort(); - } - $filepath = $all[$choice]; - } - return drush_shell_exec_interactive($exec, $filepath, $filepath); -} - -/** - * Command argument complete callback. - * - * @return - * Array of available configuration files for editing. - */ -function core_core_config_complete() { - return array('values' => drush_core_config_load(FALSE)); -} - -function drush_core_config_load($headers = TRUE) { - $php_header = $php = $rcs_header = $rcs = $aliases_header = $aliases = $drupal_header = $drupal = array(); - $php = _drush_core_config_php_ini_files(); - if (!empty($php)) { - if ($headers) { - $php_header = array('phpini' => '-- PHP ini files --'); - } - } - - $bash = _drush_core_config_bash_files(); - if (!empty($bash)) { - if ($headers) { - $bash_header = array('bash' => '-- Bash files --'); - } - } - - drush_sitealias_load_all(); - if ($rcs = drush_get_context_options('context-path', TRUE)) { - if ($headers) { - $rcs_header = array('drushrc' => '-- Drushrc --'); - } - } - if ($aliases = drush_get_context('drush-alias-files')) { - if ($headers) { - $aliases_header = array('aliases' => '-- Aliases --'); - } - } - if ($site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT')) { - $drupal[] = realpath($site_root . '/settings.php'); - if (file_exists($site_root . '/settings.local.php')) { - $drupal[] = realpath($site_root . '/settings.local.php'); - } - $drupal[] = realpath(DRUPAL_ROOT . '/.htaccess'); - if ($headers) { - $drupal_header = array('drupal' => '-- Drupal --'); - } - } - return array_merge($php_header, $php, $bash_header, $bash, $rcs_header, $rcs, $aliases_header, $aliases, $drupal_header, $drupal); -} - -function _drush_core_config_php_ini_files() { - $ini_files = array(); - $ini_files[] = php_ini_loaded_file(); - if ($drush_ini = getenv('DRUSH_INI')) { - if (file_exists($drush_ini)) { - $ini_files[] = $drush_ini; - } - } - foreach (array(DRUSH_BASE_PATH, '/etc/drush', drush_server_home() . '/.drush') as $ini_dir) { - if (file_exists($ini_dir . "/drush.ini")) { - $ini_files[] = realpath($ini_dir . "/drush.ini"); - } - } - return array_unique($ini_files); -} - -function _drush_core_config_bash_files() { - $bash_files = array(); - $home = drush_server_home(); - if ($bashrc = drush_init_find_bashrc($home)) { - $bash_files[] = $bashrc; - } - $prompt = $home . '/.drush/drush.prompt.sh'; - if (file_exists($prompt)) { - $bash_files[] = $prompt; - } - return $bash_files; -} - -/** - * Command callback. Provides information from the 'Status Reports' admin page. - */ -function drush_core_requirements() { - include_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; - $severities = array( - REQUIREMENT_INFO => t('Info'), - REQUIREMENT_OK => t('OK'), - REQUIREMENT_WARNING => t('Warning'), - REQUIREMENT_ERROR => t('Error'), - ); - - drupal_load_updates(); - - drush_include_engine('drupal', 'environment'); - $requirements = drush_module_invoke_all('requirements', 'runtime'); - // If a module uses "$requirements[] = " instead of - // "$requirements['label'] = ", then build a label from - // the title. - foreach($requirements as $key => $info) { - if (is_numeric($key)) { - unset($requirements[$key]); - $new_key = strtolower(str_replace(' ', '_', $info['title'])); - $requirements[$new_key] = $info; - } - } - $ignore_requirements = drush_get_option_list('ignore'); - foreach ($ignore_requirements as $ignore) { - unset($requirements[$ignore]); - } - ksort($requirements); - - $min_severity = drush_get_option('severity', -1); - foreach($requirements as $key => $info) { - $severity = array_key_exists('severity', $info) ? $info['severity'] : -1; - $requirements[$key]['sid'] = $severity; - $requirements[$key]['severity'] = $severities[$severity]; - if ($severity < $min_severity) { - unset($requirements[$key]); - } - if (isset($requirements[$key]['description'])) { - $requirements[$key]['description'] = drush_render($requirements[$key]['description']); - } - } - return $requirements; -} - -/** - * Command callback. Provides a birds-eye view of the current Drupal - * installation. - */ -function drush_core_status() { - $status_table = _core_site_status_table(drush_get_option('project','')); - // If args are specified, filter out any entry that is not named - // (in other words, only show lines named by one of the arg values) - $args = func_get_args(); - if (!empty($args)) { - $field_list = $args; - $metadata = drush_get_command_format_metadata('core-status'); - foreach ($metadata['field-labels'] as $field_key => $field_label) { - if (_drush_core_is_named_in_array($field_label, $args)) { - $field_list[] = $field_key; - } - } - foreach ($status_table as $key => $value) { - if (!_drush_core_is_named_in_array($key, $field_list)) { - unset($status_table[$key]); - } - } - } - return $status_table; -} - -// Command callback. Show all global options. Exposed via topic command. -function drush_core_global_options() { - drush_print(dt('These options are applicable to most drush commands. Most options can be disabled by using --no-option (i.e. --no-debug to disable --debug.)')); - drush_print(); - $fake = drush_global_options_command(FALSE); - return drush_format_help_section($fake, 'options'); -} - -function _drush_core_is_named_in_array($key, $the_array) { - $is_named = FALSE; - - $simplified_key = str_replace(array(' ', '_', '-'), array('', '', ''), $key); - - foreach ($the_array as $name) { - if (stristr($simplified_key, str_replace(array(' ', '_', '-'), array('', '', ''), $name))) { - $is_named = TRUE; - } - } - - return $is_named; -} - -/** - * Callback for core-quick-drupal command. - */ -function drush_core_quick_drupal() { - $requests = FALSE; - $make_projects = array(); - $args = func_get_args(); - $name = drush_get_option('use-name'); - drush_set_option('backend', TRUE); - drush_set_option('strict', FALSE); // We fail option validation because do so much internal drush_invoke(). - $makefile = drush_get_option('makefile'); - $root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - if (drush_get_option('use-existing', ($root != FALSE))) { - if (!$root) { - return drush_set_error('QUICK_DRUPAL_NO_ROOT_SPECIFIED', 'Must specify site with --root when using --use-existing.'); - } - // If a --db-url was not explicitly provided, and if there is already - // a settings.php file provided, then use the db-url defined inside it. - if (!drush_get_option('db-url', FALSE)) { - $values = drush_invoke_process('@self', 'site-alias', array('@self'), array('with-db-url' => TRUE), array('integrate' => FALSE, 'override-simulated' => TRUE)); - if (!empty($values['object']['self']['db-url'])) { - drush_set_option('db-url', $values['object']['self']['db-url']); - } - } - if (empty($name)) { - $name = basename($root); - } - $base = dirname($root); - } - else { - if (!empty($args) && empty($name)) { - $name = array_shift($args); - } - if (empty($name)) { - $name = 'quick-drupal-' . gmdate('YmdHis', $_SERVER['REQUEST_TIME']); - } - $root = drush_get_option('root', FALSE); - $core = drush_get_option('core', 'drupal'); - $project_rename = $core; - if ($root) { - $base = dirname($root); - $project_rename = basename($root); - } - else { - $base = getcwd() . '/' . $name; - $root = $base . '/' . $core; - } - if (!empty($makefile)) { - // Invoke 'drush make $makefile'. - $result = drush_invoke_process('@none', 'make', array($makefile, $root), array('core-quick-drupal' => TRUE)); - if ($result['error_status'] != 0) { - return drush_set_error('DRUSH_QD_MAKE', 'Could not make; aborting.'); - } - $make_projects = array_diff(array_keys($result['object']['projects']), array('drupal')); - } - else { - drush_mkdir($base); - drush_set_option('destination', $base); - drush_set_option('drupal-project-rename', $project_rename); - if (drush_invoke('pm-download', array($core)) === FALSE) { - return drush_set_error('QUICK_DRUPAL_CORE_DOWNLOAD_FAIL', 'Drupal core download/extract failed.'); - } - } - } - if (!drush_get_option('db-url', FALSE)) { - drush_set_option('db-url', 'sqlite://sites/' . strtolower(drush_get_option('sites-subdir', 'default')) . "/files/$name.sqlite"); - } - // We have just created a site root where one did not exist before. - // We therefore must manually reset DRUSH_SELECTED_DRUPAL_ROOT to - // our new root, and force a bootstrap to DRUSH_BOOTSTRAP_DRUPAL_ROOT. - drush_set_context('DRUSH_SELECTED_DRUPAL_ROOT', $root); - if (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_ROOT)) { - return drush_set_error('QUICK_DRUPAL_ROOT_LOCATE_FAIL', 'Unable to locate Drupal root directory.'); - } - if (!empty($args)) { - $requests = pm_parse_arguments($args, FALSE); - } - if ($requests) { - // Unset --destination, so that downloads go to the site directories. - drush_unset_option('destination'); - if (drush_invoke('pm-download', $requests) === FALSE) { - return drush_set_error('QUICK_DRUPAL_PROJECT_DOWNLOAD_FAIL', 'Project download/extract failed.'); - } - } - drush_invoke('site-install', array(drush_get_option('profile'))); - // Log in with the admin user. - // TODO: If site-install is given a sites-subdir other than 'default', - // then it will bootstrap to DRUSH_BOOTSTRAP_DRUPAL_SITE get the installer - // to recognize the desired site directory. This somehow interferes - // with our desire to bootstrap to DRUSH_BOOTSTRAP_DRUPAL_LOGIN here. - // We could do the last few steps in a new process if uri is not 'default'. - drush_set_option('user', '1'); - if (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_LOGIN)) { - return drush_set_error('QUICK_DRUPAL_INSTALL_FAIL', 'Drupal core install failed.'); - } - $enable = array_merge(pm_parse_arguments(drush_get_option('enable', $requests)), $make_projects); - if (!empty($enable)) { - if (drush_invoke('pm-enable', $enable) === FALSE) { - return drush_set_error('QUICK_DRUPAL_PROJECT_ENABLE_FAIL', 'Project enable failed.'); - } - } - $server = drush_get_option('server', '/'); - if ($server) { - $server_uri = runserver_uri($server); - _drush_core_qd_cache_uri($server_uri); - } - if (!drush_get_option('no-server', FALSE)) { - if ($server) { - // Current CLI user is also the web server user, which is for development - // only. Hence we can safely make the site directory writable. This makes - // it easier to delete and edit settings.php. - $boot = drush_get_bootstrap_object(); - @chmod($boot->conf_path(), 0700); - drush_invoke_process(array('root' => $root, 'uri' => $server_uri), 'runserver', array($server)); - } - } - else { - drush_print(dt('Login URL: ') . drush_invoke('user-login')); - } -} - -// Write a drushrc.php to cache the server information for future Drush calls -function _drush_core_qd_cache_uri($uri) { - $server = $uri['host']; - if (!empty($uri["port"])) { - $server .= ':' . $uri["port"]; - } - $dir = DRUPAL_ROOT . '/drush'; - $target_file = $dir . '/drushrc.php'; - drush_log(dt("Caching 'uri' !uri in !target", array('!uri' => $server, '!target' => $target_file)), LogLevel::OK); - $create_file = TRUE; - if (file_exists($target_file)) { - // Don't bother to ask with --use-existing; just - // continue. - if (drush_get_option('use-existing', FALSE)) { - $create_file = FALSE; - } - else { - $create_file = drush_confirm(dt('!target already exists. Overwrite?', array('!target' => $target_file))); - } - } - $content = <<<EOT -<?php - -// Inserted by `drush quick-drupal`. This allows `drush user-login` -// and similar commands to work seemlessly. Remove if using -// Drupal multisite feature. -\$options['uri'] = "$server"; -EOT; - if ($create_file) { - drush_mkdir($dir); - file_put_contents($target_file, $content); - } -} - -/** - * Include options and engines for core-quick-drupal command, aggregated from - * other command options that are available. We prefix option descriptons, - * to make the long list more navigable. - * - * @param $items - * The core commandfile command array, by reference. Used to include - * site-install options and add options and engines for core-quick-drupal. - */ -function drush_core_quick_drupal_options(&$items) { - $options = array( - 'core' => 'Drupal core to download. Defaults to "drupal" (latest stable version).', - 'use-existing' => 'Use an existing Drupal root, specified with --root. Overrides --core. Defaults to true when run from an existing site.', - 'profile' => 'The install profile to use. Defaults to standard.', - 'enable' => 'Specific extensions (modules or themes) to enable. By default, extensions with the same name as requested projects will be enabled automatically.', - 'server' => 'Host IP address and port number to bind to and path to open in web browser (hyphen to clear a default path), all elements optional. See runserver examples for shorthand.', - 'no-server' => 'Avoid starting runserver (and browser) for the created Drupal site.', - 'browser' => 'Optional name of a browser to open site in. If omitted the OS default browser will be used. Set --no-browser to disable.', - 'use-name' => array('hidden' => TRUE, 'description' => 'Overrides "name" argument.'), - 'makefile' => array('description' => 'Makefile to use. Makefile must specify which version of Drupal core to build.', 'example-value' => 'mysite.make', 'value' => 'optional'), - 'root' => array('description' => 'Path to Drupal root.', 'example-value' => '/path/to/root', 'value' => 'optional'), - ); - $pm = pm_drush_command(); - foreach ($pm['pm-download']['options'] as $option => $description) { - if (is_array($description)) { - $description = $description['description']; - } - $options[$option] = 'Download option: ' . $description; - } - // Unset a few options that are not usable here, as we control them ourselves - // or they are otherwise implied by the environment. - unset($options['destination']); - unset($options['drupal-project-rename']); - unset($options['default-major']); - unset($options['use-site-dir']); - $si = site_install_drush_command(); - foreach ($si['site-install']['options'] as $option => $description) { - if (is_array($description)) { - $description = $description['description']; - } - $options[$option] = 'Site install option: ' . $description; - } - unset($options['sites-subdir']); - $runserver = runserver_drush_command(); - foreach ($runserver['runserver']['options'] as $option => $description) { - $options[$option] = 'Runserver option: ' . $description; - } - unset($options['user']); - $items['core-quick-drupal']['options'] = $options; - $items['core-quick-drupal']['engines'] = $pm['pm-download']['engines']; -} - -/** - * Command callback. Runs "naked" php scripts - * and drush "shebang" scripts ("#!/usr/bin/env drush"). - */ -function drush_core_php_script() { - $found = FALSE; - $script = NULL; - if ($args = func_get_args()) { - $script = $args[0]; - } - - if ($script == '-') { - return eval(stream_get_contents(STDIN)); - } - elseif (file_exists($script)) { - $found = $script; - } - else { - // Array of paths to search for scripts - $searchpath['DIR'] = dirname(__FILE__); - $searchpath['cwd'] = drush_cwd(); - - // Additional script paths, specified by 'script-path' option - if ($script_path = drush_get_option('script-path', FALSE)) { - foreach (explode(PATH_SEPARATOR, $script_path) as $path) { - $searchpath[] = $path; - } - } - drush_log(dt('Searching for scripts in ') . implode(',', $searchpath), LogLevel::DEBUG); - - if (!isset($script)) { - // List all available scripts. - $all = array(); - foreach($searchpath as $key => $path) { - $recurse = !(($key == 'cwd') || ($path == '/')); - $all = array_merge( $all , array_keys(drush_scan_directory($path, '/\.php$/', array('.', '..', 'CVS'), NULL, $recurse)) ); - } - drush_print(implode("\n", $all)); - } - else { - // Execute the specified script. - foreach($searchpath as $path) { - $script_filename = $path . '/' . $script; - if (file_exists($script_filename . '.php')) { - $script_filename .= '.php'; - } - if (file_exists($script_filename)) { - $found = $script_filename; - break; - } - $all[] = $script_filename; - } - if (!$found) { - return drush_set_error('DRUSH_TARGET_NOT_FOUND', dt('Unable to find any of the following: @files', array('@files' => implode(', ', $all)))); - } - } - } - - if ($found) { - // Set the DRUSH_SHIFT_SKIP to two; this will cause - // drush_shift to skip the next two arguments the next - // time it is called. This allows scripts to get all - // arguments, including the 'php-script' and script - // pathname, via drush_get_arguments(), or it can process - // just the arguments that are relevant using drush_shift(). - drush_set_context('DRUSH_SHIFT_SKIP', 2); - if (_drush_core_eval_shebang_script($found) === FALSE) { - return include($found); - } - } -} - -function drush_core_php_eval($php) { - return eval($php . ';'); -} - -/** - * Evaluate a script that begins with #!drush php-script - */ -function _drush_core_eval_shebang_script($script_filename) { - $found = FALSE; - $fp = fopen($script_filename, "r"); - if ($fp !== FALSE) { - $line = fgets($fp); - if (_drush_is_drush_shebang_line($line)) { - $first_script_line = ''; - while ($line = fgets($fp)) { - $line = trim($line); - if ($line == '<?php') { - $found = TRUE; - break; - } - elseif (!empty($line)) { - $first_script_line = $line . "\n"; - break; - } - } - $script = stream_get_contents($fp); - // Pop off the first two arguments, the - // command (php-script) and the path to - // the script to execute, as a service - // to the script. - eval($first_script_line . $script); - $found = TRUE; - } - fclose($fp); - } - return $found; -} - -/** - * Command callback. Process sets from the specified batch. - * - * This is the default batch processor that will be used if the $command parameter - * to drush_backend_batch_process() has not been specified. - */ -function drush_core_batch_process($id) { - drush_batch_command($id); -} - -/** - * Command callback. Process outstanding updates during updatedb. - * - * This is a batch processing command that makes use of the drush_backend_invoke - * api. - * - * This command includes the version specific update engine, which correctly - * initialises the environment to be able to successfully handle minor and major - * upgrades. - */ -function drush_core_updatedb_batch_process($id) { - drush_include_engine('drupal', 'update'); - _update_batch_command($id); -} - -/** - * Given a target (e.g. @site:%modules), return the evaluated directory path. - * - * @param $target - * The target to evaluate. Can be @site or /path or @site:path - * or @site:%pathalias, etc. (just like rsync parameters) - * @param $component - * The portion of the evaluated path to return. Possible values: - * 'path' - the full path to the target (default) - * 'name' - the name of the site from the path (e.g. @site1) - * 'user-path' - the part after the ':' (e.g. %modules) - * 'root' & 'uri' - the Drupal root and URI of the site from the path - * 'path-component' - The ':' and the path - */ -function _drush_core_directory($target = 'root', $component = 'path', $local_only = FALSE) { - // Normalize to a sitealias in the target. - $normalized_target = $target; - if (strpos($target, ':') === FALSE) { - if (substr($target, 0, 1) != '@') { - // drush_sitealias_evaluate_path() requires bootstrap to database. - if (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_DATABASE)) { - return drush_set_error('DRUPAL_SITE_NOT_FOUND', dt('You need to specify an alias or run this command within a drupal site.')); - } - $normalized_target = '@self:'; - if (substr($target, 0, 1) != '%') { - $normalized_target .= '%'; - } - $normalized_target .= $target; - } - } - $additional_options = array(); - $values = drush_sitealias_evaluate_path($normalized_target, $additional_options, $local_only); - if (isset($values[$component])) { - // Hurray, we found the destination. - return $values[$component]; - } -} - -/** - * Command callback. - */ -function drush_core_drupal_directory($target = 'root') { - $path = _drush_core_directory($target, drush_get_option('component', 'path'), drush_get_option('local-only', FALSE)); - - // If _drush_core_directory is working right, it will turn - // %blah into the path to the item referred to by the key 'blah'. - // If there is no such key, then no replacement is done. In the - // case of the dd command, we will consider it an error if - // any keys are -not- replaced in _drush_core_directory. - if ($path && (strpos($path, '%') === FALSE)) { - return $path; - } - else { - return drush_set_error('DRUSH_TARGET_NOT_FOUND', dt("Target '!target' not found.", array('!target' => $target))); - } -} - -/** - * Called for `drush version` or `drush --version` - */ -function drush_core_version() { - return DRUSH_VERSION; -} - -/** - * Command callback. Execute specified shell code. Often used by shell aliases - * that start with !. - */ -function drush_core_execute() { - $result = TRUE; - $escape = drush_get_option('escape', TRUE); - // Get all of the args and options that appear after the command name. - $args = drush_get_original_cli_args_and_options(); - if ($escape) { - for ($x = 0; $x < count($args); $x++) { - // escape all args except for command separators. - if (!in_array($args[$x], array('&&', '||', ';'))) { - $args[$x] = drush_escapeshellarg($args[$x]); - } - } - } - $cmd = implode(' ', $args); - // If we selected a Drupal site, then cwd to the site root prior to exec - $cwd = FALSE; - if ($selected_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT')) { - if (is_dir($selected_root)) { - $cwd = getcwd(); - drush_op('chdir', $selected_root); - } - } - if ($alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS')) { - $site = drush_sitealias_get_record($alias); - if (!empty($site['site-list'])) { - $sites = drush_sitealias_resolve_sitelist($site); - foreach ($sites as $site_name => $site_spec) { - $result = _drush_core_execute_cmd($site_spec, $cmd); - if (!$result) { - break; - } - } - } - else { - $result = _drush_core_execute_cmd($site, $cmd); - } - } - else { - // Must be a local command. - $result = (drush_shell_proc_open($cmd) == 0); - } - // Restore the cwd if we changed it - if ($cwd) { - drush_op('chdir', $selected_root); - } - if (!$result) { - return drush_set_error('CORE_EXECUTE_FAILED', dt("Command !command failed.", array('!command' => $cmd))); - } - return $result; -} - -function drush_core_twig_compile() { - require_once DRUSH_DRUPAL_CORE . "/themes/engines/twig/twig.engine"; - // Scan all enabled modules and themes. - // @todo refactor since \Drush\Boot\DrupalBoot::commandfile_searchpaths is similar. - $ignored_modules = drush_get_option_list('ignored-modules', array()); - $cid = drush_cid_install_profile(); - if ($cached = drush_cache_get($cid)) { - $ignored_modules[] = $cached->data; - } - foreach (array_diff(drush_module_list(), $ignored_modules) as $module) { - $searchpaths[] = drupal_get_path('module', $module); - } - - $themes = drush_theme_list(); - foreach ($themes as $name => $theme) { - $searchpaths[] = $theme->getPath(); - } - - foreach ($searchpaths as $searchpath) { - foreach ($file = drush_scan_directory($searchpath, '/\.html.twig/', array('tests')) as $file) { - $relative = str_replace(drush_get_context('DRUSH_DRUPAL_ROOT'). '/', '', $file->filename); - // @todo Dynamically disable twig debugging since there is no good info there anyway. - twig_render_template($relative, array('theme_hook_original' => '')); - drush_log(dt('Compiled twig template !path', array('!path' => $relative)), LogLevel::NOTICE); - } - } -} - -/** - * Helper function for drush_core_execute: run one shell command - */ -function _drush_core_execute_cmd($site, $cmd) { - if (!empty($site['remote-host'])) { - // Remote, so execute an ssh command with a bash fragment at the end. - $exec = drush_shell_proc_build($site, $cmd, TRUE); - return (drush_shell_proc_open($exec) == 0); - } - elseif (!empty($site['root']) && is_dir($site['root'])) { - return (drush_shell_proc_open('cd ' . drush_escapeshellarg($site['root']) . ' && ' . $cmd) == 0); - } - return (drush_shell_proc_open($cmd) == 0); -} diff --git a/vendor/drush/drush/commands/core/docs.drush.inc b/vendor/drush/drush/commands/core/docs.drush.inc deleted file mode 100644 index eadeabb0bf8ad51eb5132e1e20283a99c186858e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/docs.drush.inc +++ /dev/null @@ -1,332 +0,0 @@ -<?php - -/** - * @file - * Documentation commands providing various topics. - */ - -/** - * Implementation of hook_drush_help(). - */ -function docs_drush_help($section) { - switch ($section) { - case 'meta:docs:title': - return dt('Documentation commands'); - case 'meta:docs:summary': - return dt('Show information on various drush topics.'); - } -} - -/** - * Implementation of hook_drush_command(). - * - * @return - * An associative array describing your command(s). - */ -function docs_drush_command() { - $docs_dir = drush_get_context('DOC_PREFIX', DRUSH_BASE_PATH); - - // - // Topic commands. - // Any commandfile may add topics. - // Set 'topic' => TRUE to indicate the command is a topic (REQUIRED) - // Begin the topic name with the name of the commandfile (just like - // any other command). - // - $items['docs-readme'] = array( - 'description' => 'README.md', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/README.md'), - 'aliases' => array('docs:readme'), - ); - $items['docs-bisect'] = array( - 'description' => 'git bisect and Drush may be used together to find the commit an error was introduced in.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/git-bisect.example.sh'), - 'aliases' => array('docs:bisect'), - ); - $items['docs-bashrc'] = array( - 'description' => 'Bashrc customization examples for Drush.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/example.bashrc'), - 'aliases' => array('docs:bashrc'), - ); - $items['docs-configuration'] = array( - 'description' => 'Configuration overview with examples from example.drushrc.php.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/example.drushrc.php'), - 'aliases' => array('docs:configuration'), - ); - $items['docs-config-exporting'] = array( - 'description' => 'Drupal configuration export instructions, including customizing configuration by environment.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/config-exporting.md'), - 'aliases' => array('docs:config:exporting'), - ); - $items['docs-aliases'] = array( - 'description' => 'Site aliases overview on creating your own aliases for commonly used Drupal sites with examples from example.aliases.drushrc.php.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/example.aliases.drushrc.php'), - 'aliases' => array('docs:aliases'), - ); - $items['docs-ini-files'] = array( - 'description' => 'php.ini or drush.ini configuration to set PHP values for use with Drush.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/example.drush.ini'), - 'aliases' => array('docs:ini-files'), - ); - $items['docs-bastion'] = array( - 'description' => 'Bastion server configuration: remotely operate on a Drupal sites behind a firewall.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/bastion.md'), - 'aliases' => array('docs:bastion'), - ); - $items['docs-bootstrap'] = array( - 'description' => 'Bootstrap explanation: how Drush starts up and prepares the Drupal environment for use with the command.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/bootstrap.md'), - 'aliases' => array('docs:bootstrap'), - ); - $items['docs-cron'] = array( - 'description' => 'Crontab instructions for running your Drupal cron tasks via `drush cron`.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/cron.md'), - 'aliases' => array('docs:cron'), - ); - $items['docs-scripts'] = array( - 'description' => 'Shell script overview on writing simple sequences of Drush statements.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/shellscripts.md'), - 'aliases' => array('docs:scripts'), - ); - $items['docs-shell-aliases'] = array( - 'description' => 'Shell alias overview on creating your own aliases for commonly used Drush commands.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/shellaliases.md'), - 'aliases' => array('docs:shell-aliases'), - ); - $items['docs-commands'] = array( - 'description' => 'Drush command instructions on creating your own Drush commands.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/commands.md'), - 'aliases' => array('docs:commands'), - ); - $items['docs-errorcodes'] = array( - 'description' => 'Error code list containing all identifiers used with drush_set_error.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'aliases' => array('docs:errorcodes'), - ); - $items['docs-api'] = array( - 'description' => 'Drush API', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/drush.api.php'), - 'aliases' => array('docs:api'), - ); - $items['docs-context'] = array( - 'description' => 'Contexts overview explaining how Drush manages command line options and configuration file settings.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/context.md'), - 'aliases' => array('docs:context'), - ); - $items['docs-examplescript'] = array( - 'description' => 'Example Drush script.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/helloworld.script'), - 'aliases' => array('docs:examplescript'), - ); - $items['docs-examplecommand'] = array( - 'description' => 'Example Drush command file.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/sandwich.drush.inc'), - 'aliases' => array('docs:examplecommand'), - ); - $items['docs-example-sync-extension'] = array( - 'description' => 'Example Drush commandfile that extends sql-sync to enable development modules in the post-sync hook.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/sync_enable.drush.inc'), - 'aliases' => array('docs:example-sync-extension'), - ); - $items['docs-example-sync-via-http'] = array( - 'description' => 'Example Drush commandfile that extends sql-sync to allow transfer of the sql dump file via http rather than ssh and rsync.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/sync_via_http.drush.inc'), - 'aliases' => array('docs:example-sync-via-http'), - ); - $items['docs-policy'] = array( - 'description' => 'Example policy file.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/policy.drush.inc'), - 'aliases' => array('docs:policy'), - ); - $items['docs-strict-options'] = array( - 'description' => 'Strict option handling, and how commands that use it differ from regular Drush commands.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/strict-options.md'), - 'aliases' => array('docs:strict-options'), - ); - return $items; -} - -/** - * docs-errorcodes command. Print a list of all error codes - * that can be found. - */ -function drush_docs_errorcodes() { - $header = <<<EOD -==== Drush Error Codes ==== - -Drush error codes are alphanumeric constants that represent an unrecoverable error condition that may arise during the execution of some command. They are set by the following function: - - return drush_set_error('DRUSH_ERROR_CODE', dt('Error message.')); - -In general, any drush command that calls drush_set_error is expected to also return FALSE as its function result. The drush_set_error function returns FALSE to make it easy to exit with an error code. Error codes are returned as part of the drush backend invoke process, which is used by drush API functions such as drush_invoke_process. An example of how to test for a specific error code is shown below: - - \$result = drush_invoke_process('@self', 'some-command'); - if (array_key_exists('DRUSH_ERROR_CODE', \$result['error_log'])) { - // handle ocurrances of DRUSH_ERROR_CODE here - } - -Some of the available drush error codes are listed in the table below. - - -EOD; - - // Find all of the files that we will search for error messages. - // Start with all of the commandfiles. - $commandfiles = drush_commandfile_list(); - $files = array_flip($commandfiles); - // In addition to the commandfiles, we will also look for files - // that drush will load when executing a command (e.g - // updatecode.pm.inc) - $commands = drush_get_commands(); - foreach ($commands as $command_name => $command) { - $files = array_merge($files, drush_command_get_includes($command_name)); - } - // We will also search through all of the .inc files in the - // drush includes directory - $drush_include_files = drush_scan_directory(DRUSH_BASE_PATH . '/includes', '/.*\.inc$/', array('.', '..', 'CVS'), 0, FALSE); - foreach ($drush_include_files as $filename => $info) { - $files[$filename] = 'include'; - } - - // Extract error messages from all command files - $error_list = array(); - foreach ($files as $file => $commandfile) { - _drush_docs_find_set_error_calls($error_list, $file, $commandfile); - } - // Order error messages alphabetically by key - ksort($error_list); - // Convert to a table - $data = array(); - foreach ($error_list as $error_code => $error_messages) { - $data[] = array($error_code, '-', implode("\n", $error_messages)); - } - - $tmpfile = drush_tempnam('drush-errorcodes.'); - file_put_contents($tmpfile, $header); - $handle = fopen($tmpfile, 'a'); - drush_print_table($data, FALSE, array(0 => 35), $handle); - fclose($handle); - drush_print_file($tmpfile); -} - -/** - * Search through a php source file looking for calls to - * the function drush_set_error. If found, and if the - * first parameter is an uppercase alphanumeric identifier, - * then record the error code and the error message in our table. - */ -function _drush_docs_find_set_error_calls(&$error_list, $filename, $shortname) { - $lines = file($filename); - foreach ($lines as $line) { - $matches = array(); - // Find the error code after the drush_set_error call. The error code - // should consist of uppercase letters and underscores only (numbers thrown in just in case) - $match_result = preg_match("/.*drush_set_error[^'\"]['\"]([A-Z0-9_]*)['\"][^,]*,[^'\"]*(['\"])/", $line, $matches); - if ($match_result) { - $error_code = $matches[1]; - $quote_char = $matches[2]; - $error_message = ""; - $message_start = strlen($matches[0]) - 1; - - // Regex adapted from http://stackoverflow.com/questions/1824325/regex-expression-for-escaped-quoted-string-wont-work-in-phps-preg-match-allif ($quote_char == '"') { - if ($quote_char == '"') { - $regex = '/"((?:[^\\\]*?(?:\\\")?)*?)"/'; - } - else { - $regex = "/'((?:[^\\\]*?(?:\\\')?)*?)'/"; - } - $match_result = preg_match($regex, $line, $matches, 0, $message_start); - - if ($match_result) { - $error_message = $matches[1]; - } - $error_list[$error_code] = array_key_exists($error_code, $error_list) ? array_merge($error_list[$error_code], array($error_message)) : array($error_message); - } - } -} diff --git a/vendor/drush/drush/commands/core/drupal/batch.inc b/vendor/drush/drush/commands/core/drupal/batch.inc deleted file mode 100644 index 883d3a2c8c20318036eb348d8dded200900f604e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/batch.inc +++ /dev/null @@ -1,291 +0,0 @@ -<?php -/** - * @file - * Drupal 7 engine for the Batch API - */ - -use Drush\Log\LogLevel; - -/** - * Main loop for the Drush batch API. - * - * Saves a record of the batch into the database, and progressively call $command to - * process the operations. - * - * @param command - * The command to call to process the batch. - * - */ -function _drush_backend_batch_process($command = 'batch-process', $args, $options) { - $batch =& batch_get(); - - if (isset($batch)) { - $process_info = array( - 'current_set' => 0, - ); - $batch += $process_info; - - // The batch is now completely built. Allow other modules to make changes - // to the batch so that it is easier to reuse batch processes in other - // enviroments. - if (drush_drupal_major_version() >= 8) { - \Drupal::moduleHandler()->alter('batch', $batch); - } - else { - drupal_alter('batch', $batch); - } - - // Assign an arbitrary id: don't rely on a serial column in the 'batch' - // table, since non-progressive batches skip database storage completely. - $batch['id'] = db_next_id(); - $args[] = $batch['id']; - - $batch['progressive'] = TRUE; - - // Move operations to a job queue. Non-progressive batches will use a - // memory-based queue. - foreach ($batch['sets'] as $key => $batch_set) { - _batch_populate_queue($batch, $key); - } - - drush_include_engine('drupal', 'environment'); - // Store the batch. - if (drush_drupal_major_version() >= 8) { - /** @var \Drupal\Core\Batch\BatchStorage $batch_storage */ - $batch_storage = \Drupal::service('batch.storage'); - $batch_storage->create($batch); - } - else { - db_insert('batch') - ->fields(array( - 'bid' => $batch['id'], - 'timestamp' => REQUEST_TIME, - 'token' => drush_get_token($batch['id']), - 'batch' => serialize($batch), - )) - ->execute(); - } - $finished = FALSE; - - // Not used in D8+ and possibly earlier. - global $user; - - while (!$finished) { - $data = drush_invoke_process('@self', $command, $args, array('user' => drush_user_get_class()->getCurrentUserAsSingle()->id())); - - $finished = drush_get_error() || !$data || (isset($data['context']['drush_batch_process_finished']) && $data['context']['drush_batch_process_finished'] == TRUE); - } - } -} - - -/** - * Initialize the batch command and call the worker function. - * - * Loads the batch record from the database and sets up the requirements - * for the worker, such as registering the shutdown function. - * - * @param id - * The batch id of the batch being processed. - */ -function _drush_batch_command($id) { - $batch =& batch_get(); - - $data = db_query("SELECT batch FROM {batch} WHERE bid = :bid", array( - ':bid' => $id))->fetchField(); - - if ($data) { - $batch = unserialize($data); - } - else { - return FALSE; - } - - if (!isset($batch['running'])) { - $batch['running'] = TRUE; - } - - // Register database update for end of processing. - register_shutdown_function('_drush_batch_shutdown'); - - if (_drush_batch_worker()) { - _drush_batch_finished(); - } -} - - -/** - * Process batch operations - * - * Using the current $batch process each of the operations until the batch - * has been completed or half of the available memory for the process has been - * reached. - */ -function _drush_batch_worker() { - $batch =& batch_get(); - $current_set =& _batch_current_set(); - $set_changed = TRUE; - - if (empty($current_set['start'])) { - $current_set['start'] = microtime(TRUE); - } - $queue = _batch_queue($current_set); - while (!$current_set['success']) { - // If this is the first time we iterate this batch set in the current - // request, we check if it requires an additional file for functions - // definitions. - if ($set_changed && isset($current_set['file']) && is_file($current_set['file'])) { - include_once DRUPAL_ROOT . '/' . $current_set['file']; - } - - $task_message = ''; - // Assume a single pass operation and set the completion level to 1 by - // default. - $finished = 1; - - if ($item = $queue->claimItem()) { - list($function, $args) = $item->data; - - // Build the 'context' array and execute the function call. - $batch_context = array( - 'sandbox' => &$current_set['sandbox'], - 'results' => &$current_set['results'], - 'finished' => &$finished, - 'message' => &$task_message, - ); - // Magic wrap to catch changes to 'message' key. - $batch_context = new DrushBatchContext($batch_context); - - // Tolerate recoverable errors. - // See https://github.com/drush-ops/drush/issues/1930 - $halt_on_error = drush_get_option('halt-on-error', TRUE); - drush_set_option('halt-on-error', FALSE); - call_user_func_array($function, array_merge($args, array(&$batch_context))); - drush_set_option('halt-on-error', $halt_on_error); - - $finished = $batch_context['finished']; - if ($finished >= 1) { - // Make sure this step is not counted twice when computing $current. - $finished = 0; - // Remove the processed operation and clear the sandbox. - $queue->deleteItem($item); - $current_set['count']--; - $current_set['sandbox'] = array(); - } - } - - // When all operations in the current batch set are completed, browse - // through the remaining sets, marking them 'successfully processed' - // along the way, until we find a set that contains operations. - // _batch_next_set() executes form submit handlers stored in 'control' - // sets (see form_execute_handlers()), which can in turn add new sets to - // the batch. - $set_changed = FALSE; - $old_set = $current_set; - while (empty($current_set['count']) && ($current_set['success'] = TRUE) && _batch_next_set()) { - $current_set = &_batch_current_set(); - $current_set['start'] = microtime(TRUE); - $set_changed = TRUE; - } - - // At this point, either $current_set contains operations that need to be - // processed or all sets have been completed. - $queue = _batch_queue($current_set); - - // If we are in progressive mode, break processing after 1 second. - if (drush_memory_limit() > 0 && (memory_get_usage() * 2) >= drush_memory_limit()) { - drush_log(dt("Batch process has consumed in excess of 50% of available memory. Starting new thread"), LogLevel::BATCH); - // Record elapsed wall clock time. - $current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2); - break; - } - } - - // Reporting 100% progress will cause the whole batch to be considered - // processed. If processing was paused right after moving to a new set, - // we have to use the info from the new (unprocessed) set. - if ($set_changed && isset($current_set['queue'])) { - // Processing will continue with a fresh batch set. - $remaining = $current_set['count']; - $total = $current_set['total']; - $progress_message = $current_set['init_message']; - $task_message = ''; - } - else { - // Processing will continue with the current batch set. - $remaining = $old_set['count']; - $total = $old_set['total']; - $progress_message = $old_set['progress_message']; - } - - $current = $total - $remaining + $finished; - $percentage = _batch_api_percentage($total, $current); - return ($percentage == 100); -} - -/** - * End the batch processing: - * Call the 'finished' callbacks to allow custom handling of results, - * and resolve page redirection. - */ -function _drush_batch_finished() { - $batch = &batch_get(); - - // Execute the 'finished' callbacks for each batch set, if defined. - foreach ($batch['sets'] as $batch_set) { - if (isset($batch_set['finished'])) { - // Check if the set requires an additional file for function definitions. - if (isset($batch_set['file']) && is_file($batch_set['file'])) { - include_once DRUPAL_ROOT . '/' . $batch_set['file']; - } - if (is_callable($batch_set['finished'])) { - $queue = _batch_queue($batch_set); - $operations = $queue->getAllItems(); - $elapsed = $batch_set['elapsed'] / 1000; - $elapsed = drush_drupal_major_version() >=8 ? \Drupal::service('date.formatter')->formatInterval($elapsed) : format_interval($elapsed); - call_user_func_array($batch_set['finished'], [$batch_set['success'], $batch_set['results'], $operations, $elapsed]); - } - } - } - - // Clean up the batch table and unset the static $batch variable. - if (drush_drupal_major_version() >= 8) { - /** @var \Drupal\Core\Batch\BatchStorage $batch_storage */ - $batch_storage = \Drupal::service('batch.storage'); - $batch_storage->delete($batch['id']); - } - else { - db_delete('batch') - ->condition('bid', $batch['id']) - ->execute(); - } - - foreach ($batch['sets'] as $batch_set) { - if ($queue = _batch_queue($batch_set)) { - $queue->deleteQueue(); - } - } - $_batch = $batch; - $batch = NULL; - drush_set_option('drush_batch_process_finished', TRUE); -} - -/** - * Shutdown function: store the batch data for next request, - * or clear the table if the batch is finished. - */ -function _drush_batch_shutdown() { - if ($batch = batch_get()) { - if (drush_drupal_major_version() >= 8) { - /** @var \Drupal\Core\Batch\BatchStorage $batch_storage */ - $batch_storage = \Drupal::service('batch.storage'); - $batch_storage->update($batch); - } - else { - db_update('batch') - ->fields(array('batch' => serialize($batch))) - ->condition('bid', $batch['id']) - ->execute(); - } - } -} diff --git a/vendor/drush/drush/commands/core/drupal/batch_6.inc b/vendor/drush/drush/commands/core/drupal/batch_6.inc deleted file mode 100644 index 11bbb5a8f2e9c2986db758dfe2057db678b3991b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/batch_6.inc +++ /dev/null @@ -1,199 +0,0 @@ -<?php -/** - * @file - * Drupal 6 engine for the Batch API - */ - -use Drush\Log\LogLevel; - -/** - * Main loop for the Drush batch API. - * - * Saves a record of the batch into the database, and progressively call $command to - * process the operations. - * - * @param command - * The command to call to process the batch. - * - */ -function _drush_backend_batch_process($command = 'batch-process', $args, $options) { - $batch =& batch_get(); - - if (isset($batch)) { - $process_info = array( - 'current_set' => 0, - ); - $batch += $process_info; - - // Initiate db storage in order to get a batch id. We have to provide - // at least an empty string for the (not null) 'token' column. - db_query("INSERT INTO {batch} (token, timestamp) VALUES ('', %d)", time()); - $batch['id'] = db_last_insert_id('batch', 'bid'); - $args[] = $batch['id']; - - // Actually store the batch data and the token generated form the batch id. - db_query("UPDATE {batch} SET token = '%s', batch = '%s' WHERE bid = %d", drupal_get_token($batch['id']), serialize($batch), $batch['id']); - - $finished = FALSE; - - while (!$finished) { - $data = drush_invoke_process('@self', $command, $args, $options); - $finished = drush_get_error() || !$data || (isset($data['context']['drush_batch_process_finished']) && $data['context']['drush_batch_process_finished'] == TRUE); - } - } -} - -/** - * Initialize the batch command and call the worker function. - * - * Loads the batch record from the database and sets up the requirements - * for the worker, such as registering the shutdown function. - * - * @param id - * The batch id of the batch being processed. - */ -function _drush_batch_command($id) { - $batch =& batch_get(); - // Retrieve the current state of batch from db. - if ($data = db_result(db_query("SELECT batch FROM {batch} WHERE bid = %d", $id))) { - $batch = unserialize($data); - } - else { - return FALSE; - } - if (!isset($batch['running'])) { - $batch['running'] = TRUE; - } - - // Register database update for end of processing. - register_shutdown_function('_drush_batch_shutdown'); - - if (_drush_batch_worker()) { - _drush_batch_finished(); - } -} - -/** - * Process batch operations - * - * Using the current $batch process each of the operations until the batch - * has been completed or half of the available memory for the process has been - * reached. - */ -function _drush_batch_worker() { - $batch =& batch_get(); - $current_set =& _batch_current_set(); - $set_changed = TRUE; - - timer_start('batch_processing'); - - while (!$current_set['success']) { - // If this is the first time we iterate this batch set in the current - // request, we check if it requires an additional file for functions - // definitions. - if ($set_changed && isset($current_set['file']) && is_file($current_set['file'])) { - include_once($current_set['file']); - } - - $finished = 1; - $task_message = ''; - if ((list($function, $args) = reset($current_set['operations'])) && function_exists($function)) { - // Build the 'context' array, execute the function call, - // and retrieve the user message. - $batch_context = array('sandbox' => &$current_set['sandbox'], 'results' => &$current_set['results'], 'finished' => &$finished, 'message' => &$task_message); - // Magic wrap to catch changes to 'message' key. - $batch_context = new DrushBatchContext($batch_context); - // Process the current operation. - call_user_func_array($function, array_merge($args, array(&$batch_context))); - $finished = $batch_context['finished']; - } - - if ($finished >= 1) { - // Make sure this step isn't counted double when computing $current. - $finished = 0; - // Remove the operation and clear the sandbox. - array_shift($current_set['operations']); - $current_set['sandbox'] = array(); - } - - // If the batch set is completed, browse through the remaining sets, - // executing 'control sets' (stored form submit handlers) along the way - - // this might in turn insert new batch sets. - // Stop when we find a set that actually has operations. - $set_changed = FALSE; - $old_set = $current_set; - while (empty($current_set['operations']) && ($current_set['success'] = TRUE) && _batch_next_set()) { - $current_set =& _batch_current_set(); - $set_changed = TRUE; - } - // At this point, either $current_set is a 'real' batch set (has operations), - // or all sets have been completed. - - - // TODO - replace with memory check! - // If we're in progressive mode, stop after 1 second. - if ((memory_get_usage() * 2) >= drush_memory_limit()) { - drush_log(dt("Batch process has consumed in excess of 50% of available memory. Starting new thread"), LogLevel::BATCH); - break; - } - } - - // Gather progress information. - - // Reporting 100% progress will cause the whole batch to be considered - // processed. If processing was paused right after moving to a new set, - // we have to use the info from the new (unprocessed) one. - if ($set_changed && isset($current_set['operations'])) { - // Processing will continue with a fresh batch set. - $remaining = count($current_set['operations']); - $total = $current_set['total']; - $task_message = ''; - } - else { - $remaining = count($old_set['operations']); - $total = $old_set['total']; - } - - $current = $total - $remaining + $finished; - $percentage = $total ? floor($current / $total * 100) : 100; - - return ($percentage == 100); -} - -/** - * End the batch processing: - * Call the 'finished' callbacks to allow custom handling of results, - * and resolve page redirection. - */ -function _drush_batch_finished() { - $batch =& batch_get(); - - // Execute the 'finished' callbacks for each batch set. - foreach ($batch['sets'] as $key => $batch_set) { - if (isset($batch_set['finished'])) { - // Check if the set requires an additional file for functions definitions. - if (isset($batch_set['file']) && is_file($batch_set['file'])) { - include_once($batch_set['file']); - } - if (function_exists($batch_set['finished'])) { - $batch_set['finished']($batch_set['success'], $batch_set['results'], $batch_set['operations']); - } - } - } - - // Cleanup the batch table and unset the global $batch variable. - db_query("DELETE FROM {batch} WHERE bid = %d", $batch['id']); - $_batch = $batch; - $batch = NULL; - drush_set_option('drush_batch_process_finished', TRUE); -} - -/** - * Shutdown function: store the batch data for next request, - * or clear the table if the batch is finished. - */ -function _drush_batch_shutdown() { - if ($batch = batch_get()) { - db_query("UPDATE {batch} SET batch = '%s' WHERE bid = %d", serialize($batch), $batch['id']); - } -} diff --git a/vendor/drush/drush/commands/core/drupal/cache.inc b/vendor/drush/drush/commands/core/drupal/cache.inc deleted file mode 100644 index a980d622fe60a7487b3d5ab7c7889087f7781035..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/cache.inc +++ /dev/null @@ -1,101 +0,0 @@ -<?php -/** - * @file - * Engine for the cache commands. - */ - -function _drush_cache_command_get($cid, $bin) { - if (is_null($bin)) { - $bin = _drush_cache_bin_default(); - } - return cache_get($cid, $bin); -} - -/** - * The default bin. - * - * @return string - */ -function _drush_cache_bin_default() { - return 'cache'; -} - -function _drush_cache_command_set($cid, $data, $bin, $expire, $tags) { - // Convert the "expire" argument to a valid value for Drupal's cache_set(). - if (is_null($bin)) { - $bin = _drush_cache_bin_default(); - } - if ($expire == 'CACHE_TEMPORARY') { - $expire = CACHE_TEMPORARY; - } - if (!isset($expire) || $expire == 'CACHE_PERMANENT') { - $expire = CACHE_PERMANENT; - } - - // D6/D7 don't natively support cache tags. - return cache_set($cid, $data, $bin, $expire); -} - -function _drush_cache_clear_types($include_bootstrapped_types) { - $types = array( - 'drush' => 'drush_cache_clear_drush', - 'all' => 'drush_cache_clear_both', - ); - if ($include_bootstrapped_types) { - $types += array( - 'theme-registry' => 'drush_cache_clear_theme_registry', - 'menu' => 'menu_rebuild', - 'css-js' => 'drush_cache_clear_css_js', - 'block' => 'drush_cache_clear_block', - 'module-list' => 'drush_get_modules', - 'theme-list' => 'drush_get_themes', - ); - } - $drupal_version = drush_drupal_major_version(); - - if ($drupal_version >= 7) { - $types['registry'] = 'registry_update'; - } - elseif ($drupal_version == 6 && function_exists('module_exists') && module_exists('autoload')) { - // TODO: move this to autoload module. - $types['registry'] = 'autoload_registry_update'; - } - - return $types; -} - -function drush_cache_clear_theme_registry() { - if (drush_drupal_major_version() >= 7) { - drupal_theme_rebuild(); - } - else { - cache_clear_all('theme_registry', 'cache', TRUE); - } -} - -function drush_cache_clear_menu() { - return menu_router_rebuild(); -} - -function drush_cache_clear_css_js() { - _drupal_flush_css_js(); - drupal_clear_css_cache(); - drupal_clear_js_cache(); -} - -/** - * Clear the cache of the block output. - */ -function drush_cache_clear_block() { - cache_clear_all(NULL, 'cache_block'); -} - -/** - * Clear caches internal to Drush core and Drupal. - */ -function drush_cache_clear_both() { - drush_cache_clear_drush(); - if (drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - drupal_flush_all_caches(); - } -} diff --git a/vendor/drush/drush/commands/core/drupal/cache_8.inc b/vendor/drush/drush/commands/core/drupal/cache_8.inc deleted file mode 100644 index fca98a7167d9983fc6598a3160ee9887890f7da6..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/cache_8.inc +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * @file - * Engine for the cache commands. - */ - -use Drupal\Core\Cache\Cache; - -function _drush_cache_command_get($cid, $bin) { - if (is_null($bin)) { - $bin = _drush_cache_bin_default(); - } - return \Drupal::cache($bin)->get($cid); -} - -/** - * The default bin. - * - * @return string - */ -function _drush_cache_bin_default() { - return 'default'; -} - -function _drush_cache_command_set($cid, $data, $bin, $expire, $tags) { - if (is_null($bin)) { - $bin = _drush_cache_bin_default(); - } - - // Convert the "expire" argument to a valid value for Drupal's cache_set(). - if ($expire == 'CACHE_TEMPORARY') { - $expire = Cache::TEMPORARY; - } - if (!isset($expire) || $expire == 'CACHE_PERMANENT') { - $expire = Cache::PERMANENT; - } - - return \Drupal::cache($bin)->set($cid, $data, $expire, $tags); -} - -function _drush_cache_clear_types($include_bootstrapped_types) { - $types = array( - 'drush' => 'drush_cache_clear_drush', - ); - if ($include_bootstrapped_types) { - $types += array( - 'theme-registry' => 'drush_cache_clear_theme_registry', - 'router' => 'drush_cache_clear_router', - 'css-js' => 'drush_cache_clear_css_js', - 'module-list' => 'drush_get_modules', - 'theme-list' => 'drush_get_themes', - 'render' => 'drush_cache_clear_render', - ); - } - return $types; -} - -function drush_cache_clear_theme_registry() { - \Drupal::service('theme.registry')->reset(); -} - -function drush_cache_clear_router() { - /** @var \Drupal\Core\Routing\RouteBuilderInterface $router_builder */ - $router_builder = \Drupal::service('router.builder'); - $router_builder->rebuild(); -} - -function drush_cache_clear_css_js() { - _drupal_flush_css_js(); - drupal_clear_css_cache(); - drupal_clear_js_cache(); -} - -/** - * Clear the cache of the block output. - */ -function drush_cache_clear_block() { - // There is no distinct block cache in D8. See https://github.com/drush-ops/drush/issues/1531. - // \Drupal::cache('block')->deleteAll(); -} - -/** - * Clears the render cache entries. - */ -function drush_cache_clear_render() { - Cache::invalidateTags(['rendered']); -} diff --git a/vendor/drush/drush/commands/core/drupal/environment.inc b/vendor/drush/drush/commands/core/drupal/environment.inc deleted file mode 100644 index 9a9192090ea55157870f4b7d04e0b8277e231668..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/environment.inc +++ /dev/null @@ -1,438 +0,0 @@ -<?php -/** - * @file - * Specific functions for a drupal 8+ environment. - * drush_include_engine() magically includes either this file - * or environment_X.inc depending on which version of drupal Drush - * is called from. - */ - -use Drupal\Core\Site\Settings; -use Drupal\Core\StreamWrapper\PrivateStream; -use Drupal\Core\StreamWrapper\PublicStream; -use Drush\Log\LogLevel; -use Drupal\Core\Logger\RfcLogLevel; - -/** - * Get complete information for all available modules. - * - * @param $include_hidden - * Boolean to indicate whether hidden modules should be excluded or not. - * @return - * An array containing module info for all available modules. - */ -function drush_get_modules($include_hidden = TRUE) { - $modules = system_rebuild_module_data(); - - foreach ($modules as $key => $module) { - if ((!$include_hidden) && (!empty($module->info['hidden']))) { - unset($modules[$key]); - } - else { - $module->schema_version = drupal_get_installed_schema_version($key); - } - } - - return $modules; -} - -/** - * Returns drupal required modules, including modules declared as required dynamically. - */ -function _drush_drupal_required_modules($module_info) { - $required = drupal_required_modules(); - foreach ($module_info as $name => $module) { - if (isset($module->info['required']) && $module->info['required']) { - $required[] = $name; - } - } - return array_unique($required); -} - -/** - * Return dependencies and its status for modules. - * - * @param $modules - * Array of module names - * @param $module_info - * Drupal 'files' array for modules as returned by drush_get_modules(). - * @return - * Array with dependencies and status for $modules - */ -function drush_check_module_dependencies($modules, $module_info) { - $status = array(); - foreach ($modules as $key => $module) { - $dependencies = array_reverse($module_info[$module]->requires); - $unmet_dependencies = array_diff(array_keys($dependencies), array_keys($module_info)); - if (!empty($unmet_dependencies)) { - $status[$key]['error'] = array( - 'code' => 'DRUSH_PM_ENABLE_DEPENDENCY_NOT_FOUND', - 'message' => dt('Module !module cannot be enabled because it depends on the following modules which could not be found: !unmet_dependencies', array('!module' => $module, '!unmet_dependencies' => implode(',', $unmet_dependencies))) - ); - } - else { - // check for version incompatibility - foreach ($dependencies as $dependency_name => $v) { - $current_version = $module_info[$dependency_name]->info['version']; - $current_version = str_replace(drush_get_drupal_core_compatibility() . '-', '', $current_version); - $incompatibility = drupal_check_incompatibility($v, $current_version); - if (isset($incompatibility)) { - $status[$key]['error'] = array( - 'code' => 'DRUSH_PM_ENABLE_DEPENDENCY_VERSION_MISMATCH', - 'message' => dt('Module !module cannot be enabled because it depends on !dependency !required_version but !current_version is available', array('!module' => $module, '!dependency' => $dependency_name, '!required_version' => $incompatibility, '!current_version' => $current_version)) - ); - } - } - } - $status[$key]['unmet-dependencies'] = $unmet_dependencies; - $status[$key]['dependencies'] = $dependencies; - } - - return $status; -} - -/** - * Return dependents of modules. - * - * @param $modules - * Array of module names - * @param $module_info - * Drupal 'files' array for modules as returned by drush_get_modules(). - * @return - * Array with dependents for each one of $modules - */ -function drush_module_dependents($modules, $module_info) { - $dependents = array(); - foreach ($modules as $module) { - $keys = array_keys($module_info[$module]->required_by); - $dependents = array_merge($dependents, array_combine($keys, $keys)); - } - - return array_unique($dependents); -} - -/** - * Returns a list of enabled modules. - * - * This is a wrapper for module_list(). - */ -function drush_module_list() { - $modules = array_keys(\Drupal::moduleHandler()->getModuleList()); - return array_combine($modules, $modules); -} - -/** - * Installs a given list of modules. - * - * @see \Drupal\Core\Extension\ModuleInstallerInterface::install() - * - */ -function drush_module_install($module_list, $enable_dependencies = TRUE) { - return \Drupal::service('module_installer')->install($module_list, $enable_dependencies); -} - -/** - * Checks that a given module exists and is enabled. - * - * @see \Drupal\Core\Extension\ModuleHandlerInterface::moduleExists() - * - */ -function drush_module_exists($module) { - return \Drupal::moduleHandler()->moduleExists($module); -} - -/** - * Determines which modules are implementing a hook. - * - * @param string $hook - * The hook name. - * @param bool $sort - * Not used in Drupal 8 environment. - * @param bool $reset - * TRUE to reset the hook implementation cache. - * - * @see \Drupal\Core\Extension\ModuleHandlerInterface::getImplementations(). - * @see \Drupal\Core\Extension\ModuleHandlerInterface::resetImplementations(). - * - */ -function drush_module_implements($hook, $sort = FALSE, $reset = FALSE) { - // $sort is there for consistency, but looks like Drupal 8 has no equilavient for it. - // We can sort the list manually later if really needed. - if ($reset == TRUE){ - \Drupal::moduleHandler()->resetImplementations(); - } - return \Drupal::moduleHandler()->getImplementations($hook); -} - -/** - * Return a list of modules from a list of named modules. - * Both enabled and disabled/uninstalled modules are returned. - */ -function drush_get_named_extensions_list($extensions) { - $result = array(); - $modules = drush_get_modules(); - foreach($modules as $name => $module) { - if (in_array($name, $extensions)) { - $result[$name] = $module; - } - } - $themes = drush_get_themes(); - foreach($themes as $name => $theme) { - if (in_array($name, $extensions)) { - $result[$name] = $theme; - } - } - return $result; -} - -/** - * Enable a list of modules. It is assumed the list contains all the dependencies not already enabled. - * - * @param $modules - * Array of module names - */ -function drush_module_enable($modules) { - // The list of modules already have all the dependencies, but they might not - // be in the correct order. Still pass $enable_dependencies = TRUE so that - // Drupal will enable the modules in the correct order. - drush_module_install($modules); - - // Our logger got blown away during the container rebuild above. - $boot = drush_select_bootstrap_class(); - $boot->add_logger(); - - // Flush all caches. No longer needed in D8 per https://github.com/drush-ops/drush/issues/1207 - // drupal_flush_all_caches(); -} - -/** - * Disable a list of modules. It is assumed the list contains all dependents not already disabled. - * - * @param $modules - * Array of module names - */ -function drush_module_disable($modules) { - drush_set_error('DRUSH_MODULE_DISABLE', dt('Drupal 8 does not support disabling modules. Use pm-uninstall instead.')); -} - -/** - * Uninstall a list of modules. - * - * @param $modules - * Array of module names - * - * @see \Drupal\Core\Extension\ModuleInstallerInterface::uninstall() - */ -function drush_module_uninstall($modules) { - \Drupal::service('module_installer')->uninstall($modules); - // Our logger got blown away during the container rebuild above. - $boot = drush_select_bootstrap_class(); - $boot->add_logger(); -} - -/** - * Invokes a hook in a particular module. - * - */ -function drush_module_invoke($module, $hook) { - $args = func_get_args(); - // Remove $module and $hook from the arguments. - unset($args[0], $args[1]); - return \Drupal::moduleHandler()->invoke($module, $hook, $args); -} - -/** - * Invokes a hook in all enabled modules that implement it. - * - */ -function drush_module_invoke_all($hook) { - $args = func_get_args(); - // Remove $hook from the arguments. - array_shift($args); - return \Drupal::moduleHandler()->invokeAll($hook, $args); -} - -/** - * Returns a list of enabled themes. Use drush_get_themes() if you need to rebuild - * and include hidden as well. - * - * @return \Drupal\Core\Extension\Extension[] - * A list of themes keyed by name. - */ -function drush_theme_list() { - $theme_handler = \Drupal::service('theme_handler'); - return $theme_handler->listInfo(); -} - -/** - * Get complete information for all available themes. - * - * @param $include_hidden - * Boolean to indicate whether hidden themes should be excluded or not. - * @return - * An array containing theme info for all available themes. - */ -function drush_get_themes($include_hidden = TRUE) { - $themes = \Drupal::service('theme_handler')->rebuildThemeData(); - foreach ($themes as $key => $theme) { - if (!$include_hidden) { - if (isset($theme->info['hidden'])) { - // Don't exclude default or admin theme. - if ($key != _drush_theme_default() && $key != _drush_theme_admin()) { - unset($themes[$key]); - } - } - } - } - - return $themes; -} - -/** - * Enable a list of themes. - * - * @param $themes - * Array of theme names. - */ -function drush_theme_enable($themes) { - \Drupal::service('theme_handler')->install($themes); -} - -/** - * Disable a list of themes. - * - * @param $themes - * Array of theme names. - */ -function drush_theme_disable($themes) { - drush_set_error('DRUSH_THEME_DISABLE', dt('Drupal 8 does not support disabling themes. Use pm-uninstall instead.')); -} - -/** - * Uninstall a list of themes. - * - * @param $themes - * Array of theme names - * - * @see \Drupal\Core\Extension\ThemeHandlerInterface::uninstall() - */ -function drush_theme_uninstall($themes) { - \Drupal::service('theme_handler')->uninstall($themes); - // Our logger got blown away during the container rebuild above. - $boot = drush_select_bootstrap_class(); - $boot->add_logger(); -} - -/** - * Helper function to obtain the severity levels based on Drupal version. - * - * @return array - * Watchdog severity levels keyed by RFC 3164 severities. - */ -function drush_watchdog_severity_levels() { - return array( - RfcLogLevel::EMERGENCY => LogLevel::EMERGENCY, - RfcLogLevel::ALERT => LogLevel::ALERT, - RfcLogLevel::CRITICAL => LogLevel::CRITICAL, - RfcLogLevel::ERROR => LogLevel::ERROR, - RfcLogLevel::WARNING => LogLevel::WARNING, - RfcLogLevel::NOTICE => LogLevel::NOTICE, - RfcLogLevel::INFO => LogLevel::INFO, - RfcLogLevel::DEBUG => LogLevel::DEBUG, - ); -} - -/** - * Helper function to obtain the message types based on drupal version. - * - * @return - * Array of watchdog message types. - */ -function drush_watchdog_message_types() { - return _dblog_get_message_types(); -} - -function _drush_theme_default() { - return \Drupal::config('system.theme')->get('default'); -} - -function _drush_theme_admin() { - $theme = \Drupal::config('system.theme')->get('admin'); - return empty($theme) ? 'seven' : $theme; -} - -function _drush_file_public_path() { - return PublicStream::basePath(); -} - -function _drush_file_private_path() { - return PrivateStream::basePath(); -} - -/** - * Gets the extension name. - * - * @param $info - * The extension info. - * @return string - * The extension name. - */ -function _drush_extension_get_name($info) { - return $info->getName(); -} - -/** - * Gets the extension type. - * - * @param $info - * The extension info. - * @return string - * The extension type. - */ -function _drush_extension_get_type($info) { - return $info->getType(); -} - -/** - * Gets the extension path. - * - * @param $info - * The extension info. - * @return string - * The extension path. - */ -function _drush_extension_get_path($info) { - return $info->getPath(); -} - -/* - * Wrapper for CSRF token generation. - */ -function drush_get_token($value = NULL) { - return \Drupal::csrfToken()->get($value); -} - -/* - * Wrapper for _url(). - */ -function drush_url($path = NULL, array $options = array()) { - return \Drupal\Core\Url::fromUserInput('/' . $path, $options)->toString(); -} - -/** - * Output a Drupal render array, object or string as plain text. - * - * @param string $data - * Data to render. - * - * @return string - * The plain-text representation of the input. - */ -function drush_render($data) { - if (is_array($data)) { - $data = \Drupal::service('renderer')->renderRoot($data); - } - - $data = \Drupal\Core\Mail\MailFormatHelper::htmlToText($data); - return $data; -} diff --git a/vendor/drush/drush/commands/core/drupal/environment_6.inc b/vendor/drush/drush/commands/core/drupal/environment_6.inc deleted file mode 100644 index 059d5ec3f93ef34512e3f9e0ddcc8f0c17b8a62a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/environment_6.inc +++ /dev/null @@ -1,416 +0,0 @@ -<?php -/** - * @file - * Specific functions for a drupal 6 environment. - * drush_include_engine() magically includes either this file - * or environment_X.inc depending on which version of drupal drush - * is called from. - */ - -/** - * Get complete information for all available modules. - * - * We need to set the type for those modules that are not already in the system table. - * - * @param $include_hidden - * Boolean to indicate whether hidden modules should be excluded or not. - * @return - * An array containing module info for all available modules. - */ -function drush_get_modules($include_hidden = TRUE) { - $modules = module_rebuild_cache(); - foreach ($modules as $key => $module) { - if (!isset($module->type)) { - $module->type = 'module'; - } - if ((!$include_hidden) && isset($module->info['hidden']) && ($module->info['hidden'])) { - unset($modules[$key]); - } - } - - return $modules; -} - -/** - * Returns drupal required modules, including their dependencies. - * - * A module may alter other module's .info to set a dependency on it. - * See for example http://drupal.org/project/phpass - */ -function _drush_drupal_required_modules($module_info) { - $required = drupal_required_modules(); - foreach ($required as $module) { - $required = array_merge($required, $module_info[$module]->info['dependencies']); - } - return $required; -} - -/** - * Return dependencies and its status for modules. - * - * @param $modules - * Array of module names - * @param $module_info - * Drupal 'files' array for modules as returned by drush_get_modules(). - * @return - * Array with dependencies and status for $modules - */ -function drush_check_module_dependencies($modules, $module_info) { - $status = array(); - foreach ($modules as $key => $module) { - $dependencies = array_reverse($module_info[$module]->info['dependencies']); - $unmet_dependencies = array_diff($dependencies, array_keys($module_info)); - if (!empty($unmet_dependencies)) { - $status[$key]['error'] = array( - 'code' => 'DRUSH_PM_ENABLE_DEPENDENCY_NOT_FOUND', - 'message' => dt('Module !module cannot be enabled because it depends on the following modules which could not be found: !unmet_dependencies', array('!module' => $module, '!unmet_dependencies' => implode(',', $unmet_dependencies))) - ); - } - $status[$key]['unmet-dependencies'] = $unmet_dependencies; - $status[$key]['dependencies'] = array(); - foreach ($dependencies as $dependency) { - $status[$key]['dependencies'][$dependency] = array('name' => $dependency); - } - } - - return $status; -} - -/** - * Return dependents of modules. - * - * @param $modules - * Array of module names - * @param $module_info - * Drupal 'files' array for modules as returned by drush_get_modules(). - * @return - * Array with dependents for each one of $modules - */ -function drush_module_dependents($modules, $module_info) { - $dependents = array(); - foreach ($modules as $module) { - $dependents = array_merge($dependents, $module_info[$module]->info['dependents']); - } - - return array_unique($dependents); -} - -/** - * Returns a list of enabled modules. - * - * This is a simplified version of module_list(). - */ -function drush_module_list() { - $enabled = array(); - $rsc = drush_db_select('system', 'name', 'type=:type AND status=:status', array(':type' => 'module', ':status' => 1)); - while ($row = drush_db_result($rsc)) { - $enabled[$row] = $row; - } - - return $enabled; -} - -/** - * Return a list of extensions from a list of named extensions. - * Both enabled and disabled/uninstalled extensions are returned. - */ -function drush_get_named_extensions_list($extensions) { - $result = array(); - $rsc = drush_db_select('system', array('name', 'status'), 'name IN (:extensions)', array(':extensions' => $extensions)); - while ($row = drush_db_fetch_object($rsc)) { - $result[$row->name] = $row; - } - return $result; -} - -/** - * Enable a list of modules. It is assumed the list contains all the dependencies not already enabled. - * - * @param $modules - * Array of module names - */ -function drush_module_enable($modules) { - // Try to install modules previous to enabling. - foreach ($modules as $module) { - _drupal_install_module($module); - } - module_enable($modules); - drush_system_modules_form_submit(); -} - -/** - * Disable a list of modules. It is assumed the list contains all dependents not already disabled. - * - * @param $modules - * Array of module names - */ -function drush_module_disable($modules) { - module_disable($modules, FALSE); - drush_system_modules_form_submit(); -} - -/** - * Uninstall a list of modules. - * - * @param $modules - * Array of module names - */ -function drush_module_uninstall($modules) { - require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; - foreach ($modules as $module) { - drupal_uninstall_module($module); - } -} - -/** - * Checks that a given module exists and is enabled. - * - * @see module_exists(). - * - */ -function drush_module_exists($module) { - return module_exists($module); -} - -/** - * Determines which modules are implementing a hook. - * - */ -function drush_module_implements($hook, $sort = FALSE, $reset = FALSE) { - return module_implements($hook, $sort, $reset); -} - -/** - * Invokes a hook in a particular module. - * - */ -function drush_module_invoke($module, $hook) { - $args = func_get_args(); - return call_user_func_array('module_invoke', $args); -} - -/** - * Invokes a hook in all enabled modules that implement it. - * - */ -function drush_module_invoke_all($hook) { - $args = func_get_args(); - return call_user_func_array('module_invoke_all', $args); -} - -/** - * Submit the system modules form. - * - * The modules should already be fully enabled/disabled before calling this - * function. Calling this function just makes sure any activities triggered by - * the form submit (such as admin_role) are completed. - */ -function drush_system_modules_form_submit() { - $active_modules = array(); - foreach (drush_get_modules(FALSE) as $key => $module) { - if ($module->status == 1) { - $active_modules[$key] = $key; - } - } - module_load_include('inc', 'system', 'system.admin'); - $form_state = array('values' => array('status' => $active_modules)); - drupal_execute('system_modules', $form_state); -} - -/** - * Returns a list of enabled themes. Use drush_get_themes() if you need to rebuild - * and include hidden/disabled as well. - * - * @return array - * A list of themes keyed by name. - */ -function drush_theme_list() { - $enabled = array(); - foreach (list_themes() as $key => $info) { - if ($info->status) { - $enabled[$key] = $info; - } - } - return $enabled; -} - -/** - * Get complete information for all available themes. - * - * We need to set the type for those themes that are not already in the system table. - * - * @param $include_hidden - * Boolean to indicate whether hidden themes should be excluded or not. - * @return - * An array containing theme info for all available themes. - */ -function drush_get_themes($include_hidden = TRUE) { - $themes = system_theme_data(); - foreach ($themes as $key => $theme) { - if (!isset($theme->type)) { - $theme->type = 'theme'; - } - if ((!$include_hidden) && isset($theme->info['hidden']) && ($theme->info['hidden'])) { - unset($themes[$key]); - } - } - - return $themes; -} - -/** - * Enable a list of themes. - * - * This function is based on system_themes_form_submit(). - * - * @see system_themes_form_submit() - * @param $themes - * Array of theme names. - */ -function drush_theme_enable($themes) { - drupal_clear_css_cache(); - foreach ($themes as $theme) { - system_initialize_theme_blocks($theme); - } - db_query("UPDATE {system} SET status = 1 WHERE type = 'theme' AND name IN (".db_placeholders($themes, 'text').")", $themes); - list_themes(TRUE); - menu_rebuild(); - module_invoke('locale', 'system_update', $themes); -} - -/** - * Disable a list of themes. - * - * This function is based on system_themes_form_submit(). - * - * @see system_themes_form_submit() - * @param $themes - * Array of theme names. - */ -function drush_theme_disable($themes) { - drupal_clear_css_cache(); - db_query("UPDATE {system} SET status = 0 WHERE type = 'theme' AND name IN (".db_placeholders($themes, 'text').")", $themes); - list_themes(TRUE); - menu_rebuild(); - drupal_rebuild_theme_registry(); - module_invoke('locale', 'system_update', $themes); -} - -/** - * Helper function to obtain the severity levels based on Drupal version. - * - * This is a copy of watchdog_severity_levels() without t(). - * - * Severity levels, as defined in RFC 3164: http://www.ietf.org/rfc/rfc3164.txt. - * - * @return - * Array of watchdog severity levels. - */ -function drush_watchdog_severity_levels() { - return array( - WATCHDOG_EMERG => 'emergency', - WATCHDOG_ALERT => 'alert', - WATCHDOG_CRITICAL => 'critical', - WATCHDOG_ERROR => 'error', - WATCHDOG_WARNING => 'warning', - WATCHDOG_NOTICE => 'notice', - WATCHDOG_INFO => 'info', - WATCHDOG_DEBUG => 'debug', - ); -} - -/** - * Helper function to obtain the message types based on drupal version. - * - * @return - * Array of watchdog message types. - */ -function drush_watchdog_message_types() { - return drupal_map_assoc(_dblog_get_message_types()); -} - -function _drush_theme_default() { - return variable_get('theme_default', 'garland'); -} - -function _drush_theme_admin() { - return variable_get('admin_theme', drush_theme_get_default()); -} - -function _drush_file_public_path() { - if (function_exists('file_directory_path')) { - return file_directory_path(); - } -} - -function _drush_file_private_path() { - // @todo -} - -/** - * Gets the extension name. - * - * @param $info - * The extension info. - * @return string - * The extension name. - */ -function _drush_extension_get_name($info) { - return $info->name; -} - -/** - * Gets the extension type. - * - * @param $info - * The extension info. - * @return string - * The extension type. - */ -function _drush_extension_get_type($info) { - return $info->type; -} - -/** - * Gets the extension path. - * - * @param $info - * The extension info. - * @return string - * The extension path. - */ -function _drush_extension_get_path($info) { - return dirname($info->filename); -} - -/* - * Wrapper for CSRF token generation. - */ -function drush_get_token($value = NULL) { - return drupal_get_token($value); -} - -/* - * Wrapper for _url(). - */ -function drush_url($path = NULL, $options = array()) { - return url($path, $options); -} - -/** - * Output a Drupal render array, object or plain string as plain text. - * - * @param string $data - * Data to render. - * - * @return string - * The plain-text representation of the input. - */ -function drush_render($data) { - if (is_array($data)) { - $data = drupal_render($data); - } - - $data = drupal_html_to_text($data); - return $data; -} diff --git a/vendor/drush/drush/commands/core/drupal/environment_7.inc b/vendor/drush/drush/commands/core/drupal/environment_7.inc deleted file mode 100644 index 45038baad1a46eeb5c10f3c5a104b95953abeb2f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/environment_7.inc +++ /dev/null @@ -1,389 +0,0 @@ -<?php -/** - * @file - * Specific functions for a drupal 7 environment. - * drush_include_engine() magically includes either this file - * or environment_X.inc depending on which version of drupal drush - * is called from. - */ - -/** - * Get complete information for all available modules. - * - * @param $include_hidden - * Boolean to indicate whether hidden modules should be excluded or not. - * @return - * An array containing module info for all available modules. - */ -function drush_get_modules($include_hidden = TRUE) { - $modules = system_rebuild_module_data(); - if (!$include_hidden) { - foreach ($modules as $key => $module) { - if (isset($module->info['hidden'])) { - unset($modules[$key]); - } - } - } - - return $modules; -} - -/** - * Returns drupal required modules, including modules declared as required dynamically. - */ -function _drush_drupal_required_modules($module_info) { - $required = drupal_required_modules(); - foreach ($module_info as $name => $module) { - if (isset($module->info['required']) && $module->info['required']) { - $required[] = $name; - } - } - return array_unique($required); -} - -/** - * Return dependencies and its status for modules. - * - * @param $modules - * Array of module names - * @param $module_info - * Drupal 'files' array for modules as returned by drush_get_modules(). - * @return - * Array with dependencies and status for $modules - */ -function drush_check_module_dependencies($modules, $module_info) { - $status = array(); - foreach ($modules as $key => $module) { - $dependencies = array_reverse($module_info[$module]->requires); - $unmet_dependencies = array_diff(array_keys($dependencies), array_keys($module_info)); - if (!empty($unmet_dependencies)) { - $status[$key]['error'] = array( - 'code' => 'DRUSH_PM_ENABLE_DEPENDENCY_NOT_FOUND', - 'message' => dt('Module !module cannot be enabled because it depends on the following modules which could not be found: !unmet_dependencies', array('!module' => $module, '!unmet_dependencies' => implode(',', $unmet_dependencies))) - ); - } - else { - // check for version incompatibility - foreach ($dependencies as $dependency_name => $v) { - $current_version = $module_info[$dependency_name]->info['version']; - $current_version = str_replace(drush_get_drupal_core_compatibility() . '-', '', $current_version); - $incompatibility = drupal_check_incompatibility($v, $current_version); - if (isset($incompatibility)) { - $status[$key]['error'] = array( - 'code' => 'DRUSH_PM_ENABLE_DEPENDENCY_VERSION_MISMATCH', - 'message' => dt('Module !module cannot be enabled because it depends on !dependency !required_version but !current_version is available', array('!module' => $module, '!dependency' => $dependency_name, '!required_version' => $incompatibility, '!current_version' => $current_version)) - ); - } - } - } - $status[$key]['unmet-dependencies'] = $unmet_dependencies; - $status[$key]['dependencies'] = $dependencies; - } - - return $status; -} - -/** - * Return dependents of modules. - * - * @param $modules - * Array of module names - * @param $module_info - * Drupal 'files' array for modules as returned by drush_get_modules(). - * @return - * Array with dependents for each one of $modules - */ -function drush_module_dependents($modules, $module_info) { - $dependents = array(); - foreach ($modules as $module) { - $dependents = array_merge($dependents, drupal_map_assoc(array_keys($module_info[$module]->required_by))); - } - - return array_unique($dependents); -} - -/** - * Returns a list of enabled modules. - * - * This is a simplified version of module_list(). - */ -function drush_module_list() { - $enabled = array(); - $rsc = drush_db_select('system', 'name', 'type=:type AND status=:status', array(':type' => 'module', ':status' => 1)); - while ($row = drush_db_result($rsc)) { - $enabled[$row] = $row; - } - - return $enabled; -} - -/** - * Return a list of extensions from a list of named extensions. - * Both enabled and disabled/uninstalled extensions are returned. - */ -function drush_get_named_extensions_list($extensions) { - $result = array(); - $rsc = drush_db_select('system', array('name', 'status'), 'name IN (:extensions)', array(':extensions' => $extensions)); - while ($row = drush_db_fetch_object($rsc)) { - $result[$row->name] = $row; - } - return $result; -} - -/** - * Enable a list of modules. It is assumed the list contains all the dependencies not already enabled. - * - * @param $modules - * Array of module names - */ -function drush_module_enable($modules) { - // The list of modules already have all the dependencies, but they might not - // be in the correct order. Still pass $enable_dependencies = TRUE so that - // Drupal will enable the modules in the correct order. - module_enable($modules); - // Flush all caches. - drupal_flush_all_caches(); -} - -/** - * Disable a list of modules. It is assumed the list contains all dependents not already disabled. - * - * @param $modules - * Array of module names - */ -function drush_module_disable($modules) { - // The list of modules already have all the dependencies, but they might not - // be in the correct order. Still pass $enable_dependencies = TRUE so that - // Drupal will enable the modules in the correct order. - module_disable($modules); - // Flush all caches. - drupal_flush_all_caches(); -} - -/** - * Uninstall a list of modules. - * - * @param $modules - * Array of module names - */ -function drush_module_uninstall($modules) { - require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; - // Break off 8.x functionality when we get another change. - if (drush_drupal_major_version() >= 8) { - module_uninstall($modules); - } - else { - drupal_uninstall_modules($modules); - } -} - -/** - * Checks that a given module exists and is enabled. - * - * @see module_exists(). - * - */ -function drush_module_exists($module) { - return module_exists($module); -} - -/** - * Determines which modules are implementing a hook. - * - */ -function drush_module_implements($hook, $sort = FALSE, $reset = FALSE) { - return module_implements($hook, $sort, $reset); -} - -/** - * Invokes a hook in a particular module. - * - */ -function drush_module_invoke($module, $hook) { - $args = func_get_args(); - return call_user_func_array('module_invoke', $args); -} - -/** - * Invokes a hook in all enabled modules that implement it. - * - */ -function drush_module_invoke_all($hook) { - $args = func_get_args(); - return call_user_func_array('module_invoke_all', $args); -} - -/** - * Returns a list of enabled themes. Use drush_get_themes() if you need to rebuild - * and include hidden/disabled as well. - * - * @return array - * A list of themes keyed by name. - */ -function drush_theme_list() { - $enabled = array(); - foreach (list_themes() as $key => $info) { - if ($info->status) { - $enabled[$key] = $info; - } - } - return $enabled; -} - -/** - * Get complete information for all available themes. - * - * @param $include_hidden - * Boolean to indicate whether hidden themes should be excluded or not. - * @return - * An array containing theme info for all available themes. - */ -function drush_get_themes($include_hidden = TRUE) { - $themes = system_rebuild_theme_data(); - if (!$include_hidden) { - foreach ($themes as $key => $theme) { - if (isset($theme->info['hidden'])) { - unset($themes[$key]); - } - } - } - - return $themes; -} - -/** - * Enable a list of themes. - * - * @param $themes - * Array of theme names. - */ -function drush_theme_enable($themes) { - theme_enable($themes); -} - -/** - * Disable a list of themes. - * - * @param $themes - * Array of theme names. - */ -function drush_theme_disable($themes) { - theme_disable($themes); -} - -/** - * Helper function to obtain the severity levels based on Drupal version. - * - * This is a copy of watchdog_severity_levels() without t(). - * - * Severity levels, as defined in RFC 3164: http://www.ietf.org/rfc/rfc3164.txt. - * - * @return - * Array of watchdog severity levels. - */ -function drush_watchdog_severity_levels() { - return array( - WATCHDOG_EMERGENCY=> 'emergency', - WATCHDOG_ALERT => 'alert', - WATCHDOG_CRITICAL => 'critical', - WATCHDOG_ERROR => 'error', - WATCHDOG_WARNING => 'warning', - WATCHDOG_NOTICE => 'notice', - WATCHDOG_INFO => 'info', - WATCHDOG_DEBUG => 'debug', - ); -} - -/** - * Helper function to obtain the message types based on drupal version. - * - * @return - * Array of watchdog message types. - */ -function drush_watchdog_message_types() { - return drupal_map_assoc(_dblog_get_message_types()); -} - -function _drush_theme_default() { - return variable_get('theme_default', 'garland'); -} - -function _drush_theme_admin() { - return variable_get('admin_theme', drush_theme_get_default()); -} - -function _drush_file_public_path() { - return variable_get('file_public_path', conf_path() . '/files'); -} - -function _drush_file_private_path() { - return variable_get('file_private_path', FALSE); -} - -/** - * Gets the extension name. - * - * @param $info - * The extension info. - * @return string - * The extension name. - */ -function _drush_extension_get_name($info) { - return $info->name; -} - -/** - * Gets the extension type. - * - * @param $info - * The extension info. - * @return string - * The extension type. - */ -function _drush_extension_get_type($info) { - return $info->type; -} - -/** - * Gets the extension path. - * - * @param $info - * The extension info. - * @return string - * The extension path. - */ -function _drush_extension_get_path($info) { - return dirname($info->filename); -} - -/* - * Wrapper for CSRF token generation. - */ -function drush_get_token($value = NULL) { - return drupal_get_token($value); -} - -/* - * Wrapper for _url(). - */ -function drush_url($path = NULL, array $options = array()) { - return url($path, $options); -} - -/** - * Output a Drupal render array, object or plain string as plain text. - * - * @param string $data - * Data to render. - * - * @return string - * The plain-text representation of the input. - */ -function drush_render($data) { - if (is_array($data)) { - $data = drupal_render($data); - } - - $data = drupal_html_to_text($data); - return $data; -} diff --git a/vendor/drush/drush/commands/core/drupal/image.inc b/vendor/drush/drush/commands/core/drupal/image.inc deleted file mode 100644 index 353233246e3f9ca29eb7ba21e0e815907f704dbd..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/image.inc +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * @file - * Specific functions for a Drupal image handling. - * drush_include_engine() magically includes either this file - * or image_X.inc depending on which version of Drupal - * is in use. - */ - -function drush_image_styles() { - return \Drupal::entityManager()->getStorage('image_style')->loadMultiple(); -} - -function drush_image_style_load($style_name) { - return \Drupal::entityManager()->getStorage('image_style')->load($style_name); -} - -function drush_image_flush_single($style_name) { - if ($style = drush_image_style_load($style_name)) { - $style->flush(); - drush_log(dt('Image style !style_name flushed', array('!style_name' => $style_name)), LogLevel::SUCCESS); - } -} - -/* - * Command callback. Create an image derivative. - * - * @param string $style_name - * The name of an image style. - * - * @param string $source - * The path to a source image, relative to Drupal root. - */ -function _drush_image_derive($style_name, $source) { - $image_style = drush_image_style_load($style_name); - $derivative_uri = $image_style->buildUri($source); - if ($image_style->createDerivative($source, $derivative_uri)) { - return $derivative_uri; - } -} diff --git a/vendor/drush/drush/commands/core/drupal/image_7.inc b/vendor/drush/drush/commands/core/drupal/image_7.inc deleted file mode 100644 index bcf1198ccfdaee242bd2740259c2bd69257ef3a1..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/image_7.inc +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * @file - * Specific functions for a Drupal image handling. - * drush_include_engine() magically includes either this file - * or image_X.inc depending on which version of Drupal - * is in use. - */ - -function drush_image_styles() { - return image_styles(); -} - -function drush_image_style_load($style_name) { - return image_style_load($style_name); -} - -function drush_image_flush_single($style_name) { - if ($style = image_style_load($style_name)) { - image_style_flush($style); - drush_log(dt('Image style !style_name flushed', array('!style_name' => $style_name)), LogLevel::SUCCESS); - } -} - -/* - * Command callback. Create an image derivative. - * - * @param string $style_name - * The name of an image style. - * - * @param string $source - * The path to a source image, relative to Drupal root. - */ -function _drush_image_derive($style_name, $source) { - $image_style = image_style_load($style_name); - $scheme = file_default_scheme(); - $image_uri = $scheme . '://' . $source; - $derivative_uri = image_style_path($image_style['name'], $image_uri); - if (image_style_create_derivative($image_style, $source, $derivative_uri)) { - return $derivative_uri; - } -} diff --git a/vendor/drush/drush/commands/core/drupal/pm.inc b/vendor/drush/drush/commands/core/drupal/pm.inc deleted file mode 100644 index 0a64d2d6f5f78d699b18c0c33adc0dad4ac7fffa..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/pm.inc +++ /dev/null @@ -1,162 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Command callback. Disable one or more extensions. - */ -function _drush_pm_disable($args) { - $extension_info = drush_get_extensions(); - - // classify $args in themes, modules or unknown. - $modules = array(); - $themes = array(); - drush_pm_classify_extensions($args, $modules, $themes, $extension_info); - $extensions = array_merge($modules, $themes); - $unknown = array_diff($args, $extensions); - - // Discard and set an error for each unknown extension. - foreach ($unknown as $name) { - drush_log('DRUSH_PM_ENABLE_EXTENSION_NOT_FOUND', dt('!extension was not found and will not be disabled.', array('!extension' => $name)), LogLevel::WARNING); - } - - // Discard already disabled extensions. - foreach ($extensions as $name) { - if (!$extension_info[$name]->status) { - if ($extension_info[$name]->type == 'module') { - unset($modules[$name]); - } - else { - unset($themes[$name]); - } - drush_log(dt('!extension is already disabled.', array('!extension' => $name)), LogLevel::OK); - } - } - - // Discard default theme. - if (!empty($themes)) { - $default_theme = drush_theme_get_default(); - if (in_array($default_theme, $themes)) { - unset($themes[$default_theme]); - drush_log(dt('!theme is the default theme and can\'t be disabled.', array('!theme' => $default_theme)), LogLevel::OK); - } - } - - if (!empty($modules)) { - // Add enabled dependents to the list of modules to disable. - $dependents = drush_module_dependents($modules, $extension_info); - $dependents = array_intersect($dependents, drush_module_list()); - $modules = array_merge($modules, $dependents); - - // Discard required modules. - $required = drush_drupal_required_modules($extension_info); - foreach ($required as $module) { - if (isset($modules[$module])) { - unset($modules[$module]); - $info = $extension_info[$module]->info; - // No message for hidden modules. - if (!isset($info['hidden'])) { - $explanation = !empty($info['explanation']) ? ' ' . dt('Reason: !explanation.', array('!explanation' => strip_tags($info['explanation']))) : ''; - drush_log(dt('!module is a required module and can\'t be disabled.', array('!module' => $module)) . $explanation, LogLevel::OK); - } - } - } - } - - // Inform the user which extensions will finally be disabled. - $extensions = array_merge($modules, $themes); - if (empty($extensions)) { - return drush_log(dt('There were no extensions that could be disabled.'), LogLevel::OK); - } - else { - drush_print(dt('The following extensions will be disabled: !extensions', array('!extensions' => implode(', ', $extensions)))); - if(!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - } - - // Disable themes. - if (!empty($themes)) { - drush_theme_disable($themes); - } - - // Disable modules and pass dependency validation in form submit. - if (!empty($modules)) { - drush_module_disable($modules); - } - - // Inform the user of final status. - $result_extensions = drush_get_named_extensions_list($extensions); - $problem_extensions = array(); - foreach ($result_extensions as $extension) { - if (!$extension->status) { - drush_log(dt('!extension was disabled successfully.', array('!extension' => $extension->name)), LogLevel::OK); - } - else { - $problem_extensions[] = $extension->name; - } - } - if (!empty($problem_extensions)) { - return drush_set_error('DRUSH_PM_DISABLE_EXTENSION_ISSUE', dt('There was a problem disabling !extension.', array('!extension' => implode(',', $problem_extensions)))); - } -} - -/** - * Command callback. Uninstall one or more modules. - */ -function _drush_pm_uninstall($modules) { - drush_include_engine('drupal', 'environment'); - $module_info = drush_get_modules(); - $required = drush_drupal_required_modules($module_info); - - // Discards modules which are enabled, not found or already uninstalled. - foreach ($modules as $key => $module) { - if (!isset($module_info[$module])) { - // The module does not exist in the system. - unset($modules[$key]); - drush_log(dt('Module !module was not found and will not be uninstalled.', array('!module' => $module)), LogLevel::WARNING); - } - else if ($module_info[$module]->status) { - // The module is enabled. - unset($modules[$key]); - drush_log(dt('!module is not disabled. Use `pm-disable` command before `pm-uninstall`.', array('!module' => $module)), LogLevel::WARNING); - } - else if ($module_info[$module]->schema_version == -1) { // SCHEMA_UNINSTALLED - // The module is uninstalled. - unset($modules[$key]); - drush_log(dt('!module is already uninstalled.', array('!module' => $module)), LogLevel::OK); - } - else { - $dependents = array(); - foreach (drush_module_dependents(array($module), $module_info) as $dependent) { - if (!in_array($dependent, $required) && ($module_info[$dependent]->schema_version != -1)) { - $dependents[] = $dependent; - } - } - if (count($dependents)) { - drush_log(dt('To uninstall !module, the following modules must be uninstalled first: !required', array('!module' => $module, '!required' => implode(', ', $dependents))), LogLevel::ERROR); - unset($modules[$key]); - } - } - } - - // Inform the user which modules will finally be uninstalled. - if (empty($modules)) { - return drush_log(dt('There were no modules that could be uninstalled.'), LogLevel::OK); - } - else { - drush_print(dt('The following modules will be uninstalled: !modules', array('!modules' => implode(', ', $modules)))); - if(!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - } - - // Uninstall the modules. - drush_module_uninstall($modules); - - // Inform the user of final status. - foreach ($modules as $module) { - drush_log(dt('!module was successfully uninstalled.', array('!module' => $module)), LogLevel::OK); - } -} - diff --git a/vendor/drush/drush/commands/core/drupal/pm_8.inc b/vendor/drush/drush/commands/core/drupal/pm_8.inc deleted file mode 100644 index d0d44b12c1617096c9b4cdcc80ca9de436aa5b4b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/pm_8.inc +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Command callback. Drupal 8 does not support disabled modules. - * - * @param array $args - * Arguments from the command line. - */ -function _drush_pm_disable($args) { - drush_include_engine('drupal', 'environment'); - // To be consistent call the environment.inc function which will show the user - // an error. - drush_module_disable($args); -} - -/** - * Command callback. Uninstall one or more extensions. - * - * @param array $args - * Arguments from the command line. - */ -function _drush_pm_uninstall($extensions) { - $extension_info = drush_get_extensions(); - $required = drush_drupal_required_modules($extension_info); - - // Discards extensions which are enabled, not found or already uninstalled. - $extensions = array_combine($extensions, $extensions); - foreach ($extensions as $extension) { - if (!isset($extension_info[$extension])) { - unset($extensions[$extension]); - drush_log(dt('Extension !extension was not found and will not be uninstalled.', array('!extension' => $extension)), LogLevel::WARNING); - } - elseif (in_array($extension, $required)) { - unset($extensions[$extension]); - $info = $extension_info[$extension]->info; - $explanation = !empty($info['explanation']) ? ' ' . dt('Reason: !explanation.', array('!explanation' => strip_tags($info['explanation']))) : ''; - drush_log(dt('!extension is a required extension and can\'t be uninstalled.', array('!extension' => $extension)) . $explanation, LogLevel::OK); - } - elseif (!$extension_info[$extension]->status) { - unset($extensions[$extension]); - drush_log(dt('!extension is already uninstalled.', array('!extension' => $extension)), LogLevel::OK); - } - elseif (drush_extension_get_type($extension_info[$extension]) == 'module') { - // Add installed dependencies to the list of modules to uninstall. - foreach (drush_module_dependents(array($extension), $extension_info) as $dependent) { - // Check if this dependency is not required, already enabled, and not already already in the list of modules to uninstall. - if (!in_array($dependent, $required) && ($extension_info[$dependent]->status) && !in_array($dependent, $extensions)) { - $extensions[] = $dependent; - } - } - } - } - - // Discard default theme. - $default_theme = drush_theme_get_default(); - if (in_array($default_theme, $extensions)) { - unset($extensions[$default_theme]); - drush_log(dt('!theme is the default theme and can\'t be uninstalled.', array('!theme' => $default_theme)), LogLevel::OK); - } - - // Inform the user which extensions will finally be disabled. - if (empty($extensions)) { - return drush_log(dt('There were no extensions that could be uninstalled.'), LogLevel::OK); - } - else { - drush_print(dt('The following extensions will be uninstalled: !extensions', array('!extensions' => implode(', ', $extensions)))); - if(!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - } - - // Classify extensions in themes and modules. - $modules = array(); - $themes = array(); - drush_pm_classify_extensions($extensions, $modules, $themes, $extension_info); - - drush_module_uninstall($modules); - drush_theme_uninstall($themes); - - // Inform the user of final status. - foreach ($extensions as $extension) { - drush_log(dt('!extension was successfully uninstalled.', array('!extension' => $extension)), LogLevel::OK); - } -} diff --git a/vendor/drush/drush/commands/core/drupal/site_install.inc b/vendor/drush/drush/commands/core/drupal/site_install.inc deleted file mode 100644 index f0fe0e4272794300b51c02a9be9b5e2e32e01edb..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/site_install.inc +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Install Drupal 8+ - */ -function drush_core_site_install_version($profile, array $additional_form_options = array()) { - require_once DRUSH_DRUPAL_CORE . '/includes/install.core.inc'; - $class_loader = drush_drupal_load_autoloader(DRUPAL_ROOT); - - if (!isset($profile)) { - // If there is an installation profile that acts as a distribution, use that - // one. - $install_state = array('interactive' => FALSE) + install_state_defaults(); - try { - install_begin_request($class_loader, $install_state); - $profile = _install_select_profile($install_state); - } - catch (\Exception $e) { - // This is only a best effort to provide a better default, no harm done - // if it fails. - } - if (empty($profile)) { - $profile = 'standard'; - } - } - - $sql = drush_sql_get_class(); - $db_spec = $sql->db_spec(); - - $account_name = drush_get_option('account-name', 'admin'); - $account_pass = drush_get_option('account-pass', FALSE); - $show_password = drush_get_option('show-passwords', !$account_pass); - if (!$account_pass) { - $account_pass = drush_generate_password(); - } - $settings = array( - 'parameters' => array( - 'profile' => $profile, - 'langcode' => drush_get_option('locale', 'en'), - ), - 'forms' => array( - 'install_settings_form' => array( - 'driver' => $db_spec['driver'], - $db_spec['driver'] => $db_spec, - 'op' => dt('Save and continue'), - ), - 'install_configure_form' => array( - 'site_name' => drush_get_option('site-name', 'Site-Install'), - 'site_mail' => drush_get_option('site-mail', 'admin@example.com'), - 'account' => array( - 'name' => $account_name, - 'mail' => drush_get_option('account-mail', 'admin@example.com'), - 'pass' => array( - 'pass1' => $account_pass, - 'pass2' => $account_pass, - ), - ), - 'enable_update_status_module' => TRUE, - 'enable_update_status_emails' => TRUE, - 'clean_url' => drush_get_option('clean-url', TRUE), - 'op' => dt('Save and continue'), - ), - ), - ); - - // Merge in the additional options. - foreach ($additional_form_options as $key => $value) { - $current = &$settings['forms']; - foreach (explode('.', $key) as $param) { - $current = &$current[$param]; - } - $current = $value; - } - - $msg = 'Starting Drupal installation. This takes a while.'; - if (is_null(drush_get_option('notify'))) { - $msg .= ' Consider using the --notify global option.'; - } - drush_log(dt($msg), LogLevel::OK); - drush_op('install_drupal', $class_loader, $settings); - if ($show_password) { - drush_log(dt('Installation complete. User name: @name User password: @pass', array('@name' => $account_name, '@pass' => $account_pass)), LogLevel::OK); - } - else { - drush_log(dt('Installation complete.'), LogLevel::OK); - } - -} diff --git a/vendor/drush/drush/commands/core/drupal/site_install_6.inc b/vendor/drush/drush/commands/core/drupal/site_install_6.inc deleted file mode 100644 index d989c8c309222c20e094a761ebb73ae16d786307..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/site_install_6.inc +++ /dev/null @@ -1,149 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Install Drupal 6.x - */ -function drush_core_site_install_version($profile, array $additional_form_options = array()) { - drush_log(dt('Starting Drupal installation. This takes a few seconds ...'), LogLevel::OK); - if (!isset($profile)) { - $profile = 'default'; - } - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - - // We need to disable reporting of E_NOTICE if we want to read the command's output - // on Windows, because of how Windows is handling output order when using 2>&1 - // redirect added to the command in drush_shell_exec(). We will actually take out - // all but fatal errors. See http://drupal.org/node/985716 for more information. - $phpcode = 'error_reporting(E_ERROR);' . _drush_site_install6_cookies($profile). ' include("'. $drupal_root .'/install.php");'; - drush_shell_exec('php -r %s', $phpcode); - $cli_output = drush_shell_exec_output(); - $cli_cookie = end($cli_output); - - // We need to bootstrap the database to be able to check the progress of the - // install batch process since we're not duplicating the install process using - // drush_batch functions, but calling the process directly. - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_DATABASE); - - $status = _drush_site_install6_stage($profile, $cli_cookie, "start"); - if ($status === FALSE) { - return FALSE; - } - - $status = _drush_site_install6_stage($profile, $cli_cookie, "do_nojs"); - if ($status === FALSE) { - return FALSE; - } - - $status = _drush_site_install6_stage($profile, $cli_cookie, "finished"); - if ($status === FALSE) { - return FALSE; - } - - $account_name = drush_get_option('account-name', 'admin'); - $account_pass = drush_get_option('account-pass', FALSE); - $show_password = drush_get_option('show-passwords', !$account_pass); - if (!$account_pass) { - $account_pass = drush_generate_password(); - } - $phpcode = _drush_site_install6_cookies($profile, $cli_cookie); - $post = array ( - "site_name" => drush_get_option('site-name', 'Site-Install'), - "site_mail" => drush_get_option('site-mail', 'admin@example.com'), - "account" => array ( - "name" => $account_name, - "mail" => drush_get_option('account-mail', 'admin@example.com'), - "pass" => array ( - "pass1" => $account_pass, - "pass2" => $account_pass, - ) - ), - "date_default_timezone" => "0", - "clean_url" => drush_get_option('clean-url', TRUE), - "form_id" => "install_configure_form", - "update_status_module" => array("1" => "1"), - ); - // Merge in the additional options. - foreach ($additional_form_options as $key => $value) { - $current = &$post; - foreach (explode('.', $key) as $param) { - $current = &$current[$param]; - } - $current = $value; - } - $phpcode .= ' - $_POST = ' . var_export($post, true) . '; - include("'. $drupal_root .'/install.php");'; - drush_shell_exec('php -r %s', $phpcode); - - if ($show_password) { - drush_log(dt('Installation complete. User name: @name User password: @pass', array('@name' => $account_name, '@pass' => $account_pass)), LogLevel::OK); - } - else { - drush_log(dt('Installation complete.'), LogLevel::OK); - } -} - -/** - * Submit a given op to install.php; if a meta "Refresh" tag - * is returned in the result, then submit that op as well. - */ -function _drush_site_install6_stage($profile, $cli_cookie, $initial_op) { - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - // Remember the install task at the start of the stage - $install_task = _drush_site_install6_install_task(); - $op = $initial_op; - while (!empty($op)) { - $phpcode = _drush_site_install6_cookies($profile, $cli_cookie). ' $_GET["op"]="' . $op . '"; include("'. $drupal_root .'/install.php");'; - drush_shell_exec('php -r %s', $phpcode); - $output = implode("\n", drush_shell_exec_output()); - // Check for a "Refresh" back to the do_nojs op; e.g.: - // <meta http-equiv="Refresh" content="0; URL=http://default/install.php?locale=en&profile=wk_profile6&id=1&op=do_nojs"> - // If this pattern is NOT found, then go on to the "finished" step. - $matches = array(); - $match_result = preg_match('/http-equiv="Refresh".*op=([a-zA-Z0-9_]*)/', $output, $matches); - if ($match_result) { - $op = $matches[1]; - } - else { - $op = ''; - } - } - if (($install_task == _drush_site_install6_install_task()) && ($initial_op != "finished")) { - return drush_set_error('DRUSH_SITE_INSTALL_FAILED', dt("The site install task '!task' failed.", array('!task' => $install_task))); - } - return TRUE; -} - -/** - * Utility function to grab/set current "cli cookie". - */ -function _drush_site_install6_cookies($profile, $cookie = NULL) { - $drupal_base_url = parse_url(drush_get_context('DRUSH_SELECTED_URI')); - $output = '$_GET=array("profile"=>"' . $profile . '", "locale"=>"' . drush_get_option('locale', 'en') . '", "id"=>"1"); $_REQUEST=&$_GET;'; - $output .= 'define("DRUSH_SITE_INSTALL6", TRUE);$_SERVER["SERVER_SOFTWARE"] = NULL;'; - $output .= '$_SERVER["SCRIPT_NAME"] = "/install.php";'; - $output .= '$_SERVER["HTTP_HOST"] = "'.$drupal_base_url['host'].'";'; - $output .= '$_SERVER["REMOTE_ADDR"] = "127.0.0.1";'; - - if ($cookie) { - $output .= sprintf('$_COOKIE=unserialize("%s");', str_replace('"', '\"', $cookie)); - } - else { - $output .= 'function _cli_cookie_print(){print(serialize(array(session_name()=>session_id())));} register_shutdown_function("_cli_cookie_print");'; - } - - return $output; -} - -/** - * Utility function to check the install_task. We are - * not bootstrapped to a high enough level to use variable_get. - */ -function _drush_site_install6_install_task() { - if ($data = db_result(db_query("SELECT value FROM {variable} WHERE name = 'install_task'",1))) { - $result = unserialize($data); - } - return $result; -} diff --git a/vendor/drush/drush/commands/core/drupal/site_install_7.inc b/vendor/drush/drush/commands/core/drupal/site_install_7.inc deleted file mode 100644 index c7f3cdfa619ccc49b7beca63ba472fd1ee606f15..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/site_install_7.inc +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Install Drupal 7 - */ -function drush_core_site_install_version($profile, array $additional_form_options = array()) { - require_once DRUSH_DRUPAL_CORE . '/includes/install.core.inc'; - - if (!isset($profile)) { - require_once DRUSH_DRUPAL_CORE . '/includes/file.inc'; - require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; - require_once DRUSH_DRUPAL_CORE . '/includes/common.inc'; - require_once DRUSH_DRUPAL_CORE . '/includes/module.inc'; - - // If there is an installation profile that is marked as exclusive, use that - // one. - try { - $profile = _install_select_profile(install_find_profiles()); - } - catch (\Exception $e) { - // This is only a best effort to provide a better default, no harm done - // if it fails. - } - if (empty($profile)) { - $profile = 'standard'; - } - } - - $sql = drush_sql_get_class(); - $db_spec = $sql->db_spec(); - - $account_name = drush_get_option('account-name', 'admin'); - $account_pass = drush_get_option('account-pass', FALSE); - $show_password = drush_get_option('show-passwords', !$account_pass); - if (!$account_pass) { - $account_pass = drush_generate_password(); - } - $settings = array( - 'parameters' => array( - 'profile' => $profile, - 'locale' => drush_get_option('locale', 'en'), - ), - 'forms' => array( - 'install_settings_form' => array( - 'driver' => $db_spec['driver'], - $db_spec['driver'] => $db_spec, - 'op' => dt('Save and continue'), - ), - 'install_configure_form' => array( - 'site_name' => drush_get_option('site-name', 'Site-Install'), - 'site_mail' => drush_get_option('site-mail', 'admin@example.com'), - 'account' => array( - 'name' => $account_name, - 'mail' => drush_get_option('account-mail', 'admin@example.com'), - 'pass' => array( - 'pass1' => $account_pass, - 'pass2' => $account_pass, - ), - ), - 'update_status_module' => array( - 1 => TRUE, - 2 => TRUE, - ), - 'clean_url' => drush_get_option('clean-url', TRUE), - 'op' => dt('Save and continue'), - ), - ), - ); - - // Merge in the additional options. - foreach ($additional_form_options as $key => $value) { - $current = &$settings['forms']; - foreach (explode('.', $key) as $param) { - $current = &$current[$param]; - } - $current = $value; - } - - $msg = 'Starting Drupal installation. This takes a while.'; - if (is_null(drush_get_option('notify'))) { - $msg .= ' Consider using the --notify global option.'; - } - drush_log(dt($msg), LogLevel::OK); - drush_op('install_drupal', $settings); - if ($show_password) { - drush_log(dt('Installation complete. User name: @name User password: @pass', array('@name' => $account_name, '@pass' => $account_pass)), LogLevel::OK); - } - else { - drush_log(dt('Installation complete.'), LogLevel::OK); - } -} diff --git a/vendor/drush/drush/commands/core/drupal/update.inc b/vendor/drush/drush/commands/core/drupal/update.inc deleted file mode 100644 index 62cbb578bdb3d358169833a162b2c54fda491fa3..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/update.inc +++ /dev/null @@ -1,448 +0,0 @@ -<?php -/** - * @file - * Update.php for provisioned sites. - * This file is a derivative of the standard drupal update.php, - * which has been modified to allow being run from the command - * line. - */ - -use Drush\Log\LogLevel; - -/** - * Drupal's update.inc has functions that are in previous update_X.inc files - * for example, update_check_incompatibility() which can prove useful when - * enabling modules. - */ -require_once DRUSH_DRUPAL_CORE . '/includes/update.inc'; - -use Drupal\Core\Utility\Error; -use Drupal\Core\Entity\EntityStorageException; -/** - * Perform one update and store the results which will later be displayed on - * the finished page. - * - * An update function can force the current and all later updates for this - * module to abort by returning a $ret array with an element like: - * $ret['#abort'] = array('success' => FALSE, 'query' => 'What went wrong'); - * The schema version will not be updated in this case, and all the - * aborted updates will continue to appear on update.php as updates that - * have not yet been run. - * - * @param $module - * The module whose update will be run. - * @param $number - * The update number to run. - * @param $context - * The batch context array - */ -function drush_update_do_one($module, $number, $dependency_map, &$context) { - $function = $module . '_update_' . $number; - - // Disable config entity overrides. - if (!defined('MAINTENANCE_MODE')) { - define('MAINTENANCE_MODE', 'update'); - } - - // If this update was aborted in a previous step, or has a dependency that - // was aborted in a previous step, go no further. - if (!empty($context['results']['#abort']) && array_intersect($context['results']['#abort'], array_merge($dependency_map, array($function)))) { - return; - } - - $context['log'] = FALSE; - - \Drupal::moduleHandler()->loadInclude($module, 'install'); - - $ret = array(); - if (function_exists($function)) { - try { - if ($context['log']) { - Database::startLog($function); - } - - drush_log("Executing " . $function); - $ret['results']['query'] = $function($context['sandbox']); - $ret['results']['success'] = TRUE; - } - // @TODO We may want to do different error handling for different exception - // types, but for now we'll just print the message. - catch (Exception $e) { - $ret['#abort'] = array('success' => FALSE, 'query' => $e->getMessage()); - drush_set_error('DRUPAL_EXCEPTION', $e->getMessage()); - } - - if ($context['log']) { - $ret['queries'] = Database::getLog($function); - } - } - else { - $ret['#abort'] = array('success' => FALSE); - drush_set_error('DRUSH_UPDATE_FUNCTION_NOT_FOUND', dt('Update function @function not found', array('@function' => $function))); - } - - if (isset($context['sandbox']['#finished'])) { - $context['finished'] = $context['sandbox']['#finished']; - unset($context['sandbox']['#finished']); - } - - if (!isset($context['results'][$module])) { - $context['results'][$module] = array(); - } - if (!isset($context['results'][$module][$number])) { - $context['results'][$module][$number] = array(); - } - $context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret); - - if (!empty($ret['#abort'])) { - // Record this function in the list of updates that were aborted. - $context['results']['#abort'][] = $function; - } - - // Record the schema update if it was completed successfully. - if ($context['finished'] == 1 && empty($ret['#abort'])) { - drupal_set_installed_schema_version($module, $number); - } - - $context['message'] = 'Performing ' . $function; -} - -/** - * Clears caches and rebuilds the container. - * - * This is called in between regular updates and post updates. Do not use - * drush_drupal_cache_clear_all() as the cache clearing and container rebuild - * must happen in the same process that the updates are run in. - * - * Drupal core's update.php uses drupal_flush_all_caches() directly without - * explicitly rebuilding the container as the container is rebuilt on the next - * HTTP request of the batch. - * - * @see drush_drupal_cache_clear_all() - * @see \Drupal\system\Controller\DbUpdateController::triggerBatch() - */ -function drush_update_cache_rebuild() { - drupal_flush_all_caches(); - \Drupal::service('kernel')->rebuildContainer(); -} - -function update_main() { - // In D8, we expect to be in full bootstrap. - drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_FULL); - - require_once DRUPAL_ROOT . '/core/includes/install.inc'; - require_once DRUPAL_ROOT . '/core/includes/update.inc'; - drupal_load_updates(); - update_fix_compatibility(); - - // Check requirements before updating. - if (!drush_update_check_requirements()) { - if (!drush_confirm(dt('Requirements check reports errors. Do you wish to continue?'))) { - return drush_user_abort(); - } - } - - // Pending hook_update_N() implementations. - $pending = update_get_update_list(); - - // Pending hook_post_update_X() implementations. - $post_updates = \Drupal::service('update.post_update_registry')->getPendingUpdateInformation(); - - $start = array(); - - $change_summary = []; - if (drush_get_option('entity-updates', FALSE)) { - $change_summary = \Drupal::entityDefinitionUpdateManager()->getChangeSummary(); - } - - // Print a list of pending updates for this module and get confirmation. - if (count($pending) || count($change_summary) || count($post_updates)) { - drush_print(dt('The following updates are pending:')); - drush_print(); - - foreach ($change_summary as $entity_type_id => $changes) { - drush_print($entity_type_id . ' entity type : '); - foreach ($changes as $change) { - drush_print(strip_tags($change), 2); - } - } - - foreach (array('update', 'post_update') as $update_type) { - $updates = $update_type == 'update' ? $pending : $post_updates; - foreach ($updates as $module => $updates) { - if (isset($updates['start'])) { - drush_print($module . ' module : '); - if (!empty($updates['pending'])) { - $start += [$module => array()]; - - $start[$module] = array_merge($start[$module], $updates['pending']); - foreach ($updates['pending'] as $update) { - drush_print(strip_tags($update), 2); - } - } - drush_print(); - } - } - } - - if (!drush_confirm(dt('Do you wish to run all pending updates?'))) { - return drush_user_abort(); - } - - drush_update_batch($start); - } - else { - drush_log(dt("No database updates required"), LogLevel::SUCCESS); - } - - return count($pending) + count($change_summary) + count($post_updates); -} - -/** - * Check update requirements and report any errors. - */ -function drush_update_check_requirements() { - $continue = TRUE; - - \Drupal::moduleHandler()->resetImplementations(); - $requirements = update_check_requirements(); - $severity = drupal_requirements_severity($requirements); - - // If there are issues, report them. - if ($severity != REQUIREMENT_OK) { - if ($severity === REQUIREMENT_ERROR) { - $continue = FALSE; - } - foreach ($requirements as $requirement) { - if (isset($requirement['severity']) && $requirement['severity'] != REQUIREMENT_OK) { - $message = isset($requirement['description']) ? $requirement['description'] : ''; - if (isset($requirement['value']) && $requirement['value']) { - $message .= ' (Currently using '. $requirement['title'] .' '. $requirement['value'] .')'; - } - $log_level = $requirement['severity'] === REQUIREMENT_ERROR ? LogLevel::ERROR : LogLevel::WARNING; - drush_log($message, $log_level); - } - } - } - - return $continue; -} - -function _update_batch_command($id) { - // In D8, we expect to be in full bootstrap. - drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_FULL); - - drush_batch_command($id); -} - -/** - * Start the database update batch process. - */ -function drush_update_batch() { - $start = drush_get_update_list(); - // Resolve any update dependencies to determine the actual updates that will - // be run and the order they will be run in. - $updates = update_resolve_dependencies($start); - - // Store the dependencies for each update function in an array which the - // batch API can pass in to the batch operation each time it is called. (We - // do not store the entire update dependency array here because it is - // potentially very large.) - $dependency_map = array(); - foreach ($updates as $function => $update) { - $dependency_map[$function] = !empty($update['reverse_paths']) ? array_keys($update['reverse_paths']) : array(); - } - - $operations = array(); - - foreach ($updates as $update) { - if ($update['allowed']) { - // Set the installed version of each module so updates will start at the - // correct place. (The updates are already sorted, so we can simply base - // this on the first one we come across in the above foreach loop.) - if (isset($start[$update['module']])) { - drupal_set_installed_schema_version($update['module'], $update['number'] - 1); - unset($start[$update['module']]); - } - // Add this update function to the batch. - $function = $update['module'] . '_update_' . $update['number']; - $operations[] = array('drush_update_do_one', array($update['module'], $update['number'], $dependency_map[$function])); - } - } - - // Apply post update hooks. - $post_updates = \Drupal::service('update.post_update_registry')->getPendingUpdateFunctions(); - if ($post_updates) { - $operations[] = ['drush_update_cache_rebuild', []]; - foreach ($post_updates as $function) { - $operations[] = ['update_invoke_post_update', [$function]]; - } - } - - // Lastly, perform entity definition updates, which will update storage - // schema if needed. If module update functions need to work with specific - // entity schema they should call the entity update service for the specific - // update themselves. - // @see \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::applyEntityUpdate() - // @see \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::applyFieldUpdate() - if (drush_get_option('entity-updates', FALSE) && \Drupal::entityDefinitionUpdateManager()->needsUpdates()) { - $operations[] = array('drush_update_entity_definitions', array()); - } - - $batch['operations'] = $operations; - $batch += array( - 'title' => 'Updating', - 'init_message' => 'Starting updates', - 'error_message' => 'An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.', - 'finished' => 'drush_update_finished', - 'file' => 'includes/update.inc', - ); - batch_set($batch); - \Drupal::service('state')->set('system.maintenance_mode', TRUE); - drush_backend_batch_process('updatedb-batch-process'); - \Drupal::service('state')->set('system.maintenance_mode', FALSE); -} - -/** - * Apply entity schema updates. - */ -function drush_update_entity_definitions(&$context) { - try { - \Drupal::entityDefinitionUpdateManager()->applyUpdates(); - } - catch (EntityStorageException $e) { - watchdog_exception('update', $e); - $variables = Error::decodeException($e); - unset($variables['backtrace']); - // The exception message is run through - // \Drupal\Component\Utility\SafeMarkup::checkPlain() by - // \Drupal\Core\Utility\Error::decodeException(). - $ret['#abort'] = array('success' => FALSE, 'query' => t('%type: !message in %function (line %line of %file).', $variables)); - $context['results']['core']['update_entity_definitions'] = $ret; - $context['results']['#abort'][] = 'update_entity_definitions'; - } -} - -// Copy of protected \Drupal\system\Controller\DbUpdateController::getModuleUpdates. -function drush_get_update_list() { - $return = array(); - $updates = update_get_update_list(); - foreach ($updates as $module => $update) { - $return[$module] = $update['start']; - } - - return $return; -} - -/** - * Process and display any returned update output. - * - * @see \Drupal\system\Controller\DbUpdateController::batchFinished() - * @see \Drupal\system\Controller\DbUpdateController::results() - */ -function drush_update_finished($success, $results, $operations) { - - if (!drush_get_option('cache-clear', TRUE)) { - drush_log(dt("Skipping cache-clear operation due to --cache-clear=0 option."), LogLevel::WARNING); - } - else { - drupal_flush_all_caches(); - } - - foreach ($results as $module => $updates) { - if ($module != '#abort') { - foreach ($updates as $number => $queries) { - foreach ($queries as $query) { - // If there is no message for this update, don't show anything. - if (empty($query['query'])) { - continue; - } - - if ($query['success']) { - drush_log(strip_tags($query['query'])); - } - else { - drush_set_error(dt('Failed: ') . strip_tags($query['query'])); - } - } - } - } - } -} - -/** - * Return a 2 item array with - * - an array where each item is a 3 item associative array describing a pending update. - * - an array listing the first update to run, keyed by module. - */ -function updatedb_status() { - $pending = update_get_update_list(); - - $return = array(); - // Ensure system module's updates run first. - $start['system'] = array(); - - foreach (\Drupal::entityDefinitionUpdateManager()->getChangeSummary() as $entity_type_id => $changes) { - foreach ($changes as $change) { - $return[] = array( - 'module' => dt('@type entity type', array('@type' => $entity_type_id)), 'update_id' => '', 'description' => strip_tags($change)); - } - } - - // Print a list of pending updates for this module and get confirmation. - foreach ($pending as $module => $updates) { - if (isset($updates['start'])) { - foreach ($updates['pending'] as $update_id => $description) { - // Strip cruft from front. - $description = str_replace($update_id . ' - ', '', $description); - $return[] = array('module' => ucfirst($module), 'update_id' => $update_id, 'description' => $description); - } - if (isset($updates['start'])) { - $start[$module] = $updates['start']; - } - } - } - - return array($return, $start); -} - -/** - * Apply pending entity schema updates. - */ -function entity_updates_main() { - $change_summary = \Drupal::entityDefinitionUpdateManager()->getChangeSummary(); - if (!empty($change_summary)) { - drush_print(dt('The following updates are pending:')); - drush_print(); - - foreach ($change_summary as $entity_type_id => $changes) { - drush_print($entity_type_id . ' entity type : '); - foreach ($changes as $change) { - drush_print(strip_tags($change), 2); - } - } - - if (!drush_confirm(dt('Do you wish to run all pending updates?'))) { - return drush_user_abort(); - } - - $operations[] = array('drush_update_entity_definitions', array()); - - - $batch['operations'] = $operations; - $batch += array( - 'title' => 'Updating', - 'init_message' => 'Starting updates', - 'error_message' => 'An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.', - 'finished' => 'drush_update_finished', - 'file' => 'includes/update.inc', - ); - batch_set($batch); - \Drupal::service('state')->set('system.maintenance_mode', TRUE); - drush_backend_batch_process('updatedb-batch-process'); - \Drupal::service('state')->set('system.maintenance_mode', FALSE); - } - else { - drush_log(dt("No entity schema updates required"), LogLevel::SUCCESS); - } -} diff --git a/vendor/drush/drush/commands/core/drupal/update_6.inc b/vendor/drush/drush/commands/core/drupal/update_6.inc deleted file mode 100644 index 2accffc9c80278dc075ce05c58409f4ce35ab9d5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/update_6.inc +++ /dev/null @@ -1,522 +0,0 @@ -<?php -/** - * @file - * Update.php for provisioned sites. - * This file is a derivative of the standard drupal update.php, - * which has been modified to allow being run from the command - * line. - */ - -use Drush\Log\LogLevel; - -define('MAINTENANCE_MODE', 'update'); - - -/** - * Add a column to a database using syntax appropriate for PostgreSQL. - * Save result of SQL commands in $ret array. - * - * Note: when you add a column with NOT NULL and you are not sure if there are - * already rows in the table, you MUST also add DEFAULT. Otherwise PostgreSQL - * won't work when the table is not empty, and db_add_column() will fail. - * To have an empty string as the default, you must use: 'default' => "''" - * in the $attributes array. If NOT NULL and DEFAULT are set the PostgreSQL - * version will set values of the added column in old rows to the - * DEFAULT value. - * - * @param $ret - * Array to which results will be added. - * @param $table - * Name of the table, without {} - * @param $column - * Name of the column - * @param $type - * Type of column - * @param $attributes - * Additional optional attributes. Recognized attributes: - * not null => TRUE|FALSE - * default => NULL|FALSE|value (the value must be enclosed in '' marks) - * @return - * nothing, but modifies $ret parameter. - */ -function db_add_column(&$ret, $table, $column, $type, $attributes = array()) { - if (array_key_exists('not null', $attributes) and $attributes['not null']) { - $not_null = 'NOT NULL'; - } - if (array_key_exists('default', $attributes)) { - if (!isset($attributes['default'])) { - $default_val = 'NULL'; - $default = 'default NULL'; - } - elseif ($attributes['default'] === FALSE) { - $default = ''; - } - else { - $default_val = "$attributes[default]"; - $default = "default $attributes[default]"; - } - } - - $ret[] = update_sql("ALTER TABLE {". $table ."} ADD $column $type"); - if (!empty($default)) { - $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column SET $default"); - } - if (!empty($not_null)) { - if (!empty($default)) { - $ret[] = update_sql("UPDATE {". $table ."} SET $column = $default_val"); - } - $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column SET NOT NULL"); - } -} - -/** - * Change a column definition using syntax appropriate for PostgreSQL. - * Save result of SQL commands in $ret array. - * - * Remember that changing a column definition involves adding a new column - * and dropping an old one. This means that any indices, primary keys and - * sequences from serial-type columns are dropped and might need to be - * recreated. - * - * @param $ret - * Array to which results will be added. - * @param $table - * Name of the table, without {} - * @param $column - * Name of the column to change - * @param $column_new - * New name for the column (set to the same as $column if you don't want to change the name) - * @param $type - * Type of column - * @param $attributes - * Additional optional attributes. Recognized attributes: - * not null => TRUE|FALSE - * default => NULL|FALSE|value (with or without '', it won't be added) - * @return - * nothing, but modifies $ret parameter. - */ -function db_change_column(&$ret, $table, $column, $column_new, $type, $attributes = array()) { - if (array_key_exists('not null', $attributes) and $attributes['not null']) { - $not_null = 'NOT NULL'; - } - if (array_key_exists('default', $attributes)) { - if (!isset($attributes['default'])) { - $default_val = 'NULL'; - $default = 'default NULL'; - } - elseif ($attributes['default'] === FALSE) { - $default = ''; - } - else { - $default_val = "$attributes[default]"; - $default = "default $attributes[default]"; - } - } - - $ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $column TO ". $column ."_old"); - $ret[] = update_sql("ALTER TABLE {". $table ."} ADD $column_new $type"); - $ret[] = update_sql("UPDATE {". $table ."} SET $column_new = ". $column ."_old"); - if ($default) { $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET $default"); } - if ($not_null) { $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET NOT NULL"); } - $ret[] = update_sql("ALTER TABLE {". $table ."} DROP ". $column ."_old"); -} - - -/** - * Disable anything in the {system} table that is not compatible with the - * current version of Drupal core. - */ -function update_fix_compatibility() { - $ret = array(); - $incompatible = array(); - $query = db_query("SELECT name, type, status FROM {system} WHERE status = 1 AND type IN ('module','theme')"); - while ($result = db_fetch_object($query)) { - if (update_check_incompatibility($result->name, $result->type)) { - $incompatible[] = $result->name; - drush_log(dt("!type !name is incompatible with this release of Drupal, and will be disabled.", - array("!type" => $result->type, '!name' => $result->name)), LogLevel::WARNING); - } - } - if (!empty($incompatible)) { - - $ret[] = update_sql("UPDATE {system} SET status = 0 WHERE name IN ('". implode("','", $incompatible) ."')"); - } - return $ret; -} - -/** - * Helper function to test compatibility of a module or theme. - */ -function update_check_incompatibility($name, $type = 'module') { - static $themes, $modules; - - // Store values of expensive functions for future use. - if (empty($themes) || empty($modules)) { - drush_include_engine('drupal', 'environment'); - $themes = _system_theme_data(); - $modules = module_rebuild_cache(); - } - - if ($type == 'module' && isset($modules[$name])) { - $file = $modules[$name]; - } - else if ($type == 'theme' && isset($themes[$name])) { - $file = $themes[$name]; - } - if (!isset($file) - || !isset($file->info['core']) - || $file->info['core'] != drush_get_drupal_core_compatibility() - || version_compare(phpversion(), $file->info['php']) < 0) { - return TRUE; - } - return FALSE; -} - -/** - * Perform Drupal 5.x to 6.x updates that are required for update.php - * to function properly. - * - * This function runs when update.php is run the first time for 6.x, - * even before updates are selected or performed. It is important - * that if updates are not ultimately performed that no changes are - * made which make it impossible to continue using the prior version. - * Just adding columns is safe. However, renaming the - * system.description column to owner is not. Therefore, we add the - * system.owner column and leave it to system_update_6008() to copy - * the data from description and remove description. The same for - * renaming locales_target.locale to locales_target.language, which - * will be finished by locale_update_6002(). - */ -function update_fix_d6_requirements() { - $ret = array(); - - if (drupal_get_installed_schema_version('system') < 6000 && !variable_get('update_d6_requirements', FALSE)) { - $spec = array('type' => 'int', 'size' => 'small', 'default' => 0, 'not null' => TRUE); - db_add_field($ret, 'cache', 'serialized', $spec); - db_add_field($ret, 'cache_filter', 'serialized', $spec); - db_add_field($ret, 'cache_page', 'serialized', $spec); - db_add_field($ret, 'cache_menu', 'serialized', $spec); - - db_add_field($ret, 'system', 'info', array('type' => 'text')); - db_add_field($ret, 'system', 'owner', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); - if (db_table_exists('locales_target')) { - db_add_field($ret, 'locales_target', 'language', array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => '')); - } - if (db_table_exists('locales_source')) { - db_add_field($ret, 'locales_source', 'textgroup', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'default')); - db_add_field($ret, 'locales_source', 'version', array('type' => 'varchar', 'length' => 20, 'not null' => TRUE, 'default' => 'none')); - } - variable_set('update_d6_requirements', TRUE); - - // Create the cache_block table. See system_update_6027() for more details. - $schema['cache_block'] = array( - 'fields' => array( - 'cid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'data' => array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'), - 'expire' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'headers' => array('type' => 'text', 'not null' => FALSE), - 'serialized' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array('expire' => array('expire')), - 'primary key' => array('cid'), - ); - db_create_table($ret, 'cache_block', $schema['cache_block']); - - // Create the semaphore table now -- the menu system after 6.15 depends on - // this table, and menu code runs in updates prior to the table being - // created in its original update function, system_update_6054(). - $schema['semaphore'] = array( - 'fields' => array( - 'name' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => ''), - 'value' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => ''), - 'expire' => array( - 'type' => 'float', - 'size' => 'big', - 'not null' => TRUE), - ), - 'indexes' => array('expire' => array('expire')), - 'primary key' => array('name'), - ); - db_create_table($ret, 'semaphore', $schema['semaphore']); - } - - return $ret; -} - -/** - * Check update requirements and report any errors. - */ -function update_check_requirements() { - // Check the system module requirements only. - $requirements = module_invoke('system', 'requirements', 'update'); - $severity = drupal_requirements_severity($requirements); - - // If there are issues, report them. - if ($severity != REQUIREMENT_OK) { - foreach ($requirements as $requirement) { - if (isset($requirement['severity']) && $requirement['severity'] != REQUIREMENT_OK) { - $message = isset($requirement['description']) ? $requirement['description'] : ''; - if (isset($requirement['value']) && $requirement['value']) { - $message .= ' (Currently using '. $requirement['title'] .' '. $requirement['value'] .')'; - } - drush_log($message, LogLevel::WARNING); - } - } - } -} - -/** - * Create the batch table. - * - * This is part of the Drupal 5.x to 6.x migration. - */ -function update_create_batch_table() { - - // If batch table exists, update is not necessary - if (db_table_exists('batch')) { - return; - } - - $schema['batch'] = array( - 'fields' => array( - 'bid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'token' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE), - 'timestamp' => array('type' => 'int', 'not null' => TRUE), - 'batch' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') - ), - 'primary key' => array('bid'), - 'indexes' => array('token' => array('token')), - ); - - $ret = array(); - db_create_table($ret, 'batch', $schema['batch']); - return $ret; -} - -function update_main_prepare() { - global $profile; - // Some unavoidable errors happen because the database is not yet up-to-date. - // Our custom error handler is not yet installed, so we just suppress them. - drush_errors_off(); - - require_once './includes/bootstrap.inc'; - // Minimum load of components. - // This differs from the Drupal 6 update.php workflow for compatbility with - // the Drupal 6 backport of module_implements() caching. - // @see http://drupal.org/node/557542 - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_DATABASE); - require_once './includes/install.inc'; - require_once './includes/file.inc'; - require_once './modules/system/system.install'; - - // Load module basics. - include_once './includes/module.inc'; - $module_list['system']['filename'] = 'modules/system/system.module'; - $module_list['filter']['filename'] = 'modules/filter/filter.module'; - module_list(TRUE, FALSE, FALSE, $module_list); - module_implements('', FALSE, TRUE); - - drupal_load('module', 'system'); - drupal_load('module', 'filter'); - - // Set up $language, since the installer components require it. - drupal_init_language(); - - // Set up theme system for the maintenance page. - drupal_maintenance_theme(); - - // Check the update requirements for Drupal. - update_check_requirements(); - - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL); - $profile = variable_get('install_profile', 'default'); - // Updates only run reliably if user ID #1 is logged in. For example, node_delete() requires elevated perms in D5/6. - if (!drush_get_context('DRUSH_USER')) { - drush_set_option('user', 1); - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_LOGIN); - } - - // This must happen *after* drupal_bootstrap(), since it calls - // variable_(get|set), which only works after a full bootstrap. - _drush_log_update_sql(update_create_batch_table()); - - // Turn error reporting back on. From now on, only fatal errors (which are - // not passed through the error handler) will cause a message to be printed. - drush_errors_on(); - - // Perform Drupal 5.x to 6.x updates that are required for update.php to function properly. - _drush_log_update_sql(update_fix_d6_requirements()); - - // Must unset $theme->status in order to safely rescan and repopulate - // the system table to ensure we have a full picture of the platform. - // This is needed because $theme->status is set to 0 in a call to - // list_themes() done by drupal_maintenance_theme(). - // It is a issue with _system_theme_data() that returns its own cache - // variable and can be modififed by others. When this is fixed in - // drupal core we can remove this unset. - // For reference see: http://drupal.org/node/762754 - $themes = _system_theme_data(); - foreach ($themes as $theme) { - unset($theme->status); - } - drush_get_extensions(); - - include_once './includes/batch.inc'; - drupal_load_updates(); - - // Disable anything in the {system} table that is not compatible with the current version of Drupal core. - _drush_log_update_sql(update_fix_compatibility()); -} - -function update_main() { - update_main_prepare(); - - list($pending, $start) = updatedb_status(); - - // Print a list of pending updates for this module and get confirmation. - if ($pending) { - // @todo get table header working - // array_unshift($pending, array(dt('Module'), dt('ID'), dt('Description'))); - drush_print_table($pending, FALSE); - if (!drush_confirm(dt('Do you wish to run all pending updates?'))) { - return drush_user_abort(); - } - // Proceed with running all pending updates. - $operations = array(); - foreach ($start as $module => $version) { - drupal_set_installed_schema_version($module, $version - 1); - $updates = drupal_get_schema_versions($module); - $max_version = max($updates); - if ($version <= $max_version) { - drush_log(dt('Updating module @module from schema version @start to schema version @max', array('@module' => $module, '@start' => $version - 1, '@max' => $max_version))); - foreach ($updates as $update) { - if ($update >= $version) { - $operations[] = array('_update_do_one', array($module, $update)); - } - } - } - else { - drush_log(dt('No database updates for module @module', array('@module' => $module)), LogLevel::SUCCESS); - } - } - $batch = array( - 'operations' => $operations, - 'title' => 'Updating', - 'init_message' => 'Starting updates', - 'error_message' => 'An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.', - 'finished' => 'update_finished', - ); - batch_set($batch); - $batch =& batch_get(); - $batch['progressive'] = FALSE; - drush_backend_batch_process('updatedb-batch-process'); - } - else { - drush_log(dt("No database updates required"), LogLevel::SUCCESS); - } - - return count($pending); -} - -/** - * A simplified version of the batch_do_one function from update.php - * - * This does not mess with sessions and the like, as it will be used - * from the command line - */ -function _update_do_one($module, $number, &$context) { - // If updates for this module have been aborted - // in a previous step, go no further. - if (!empty($context['results'][$module]['#abort'])) { - return; - } - - $function = $module .'_update_'. $number; - drush_log("Executing $function", LogLevel::SUCCESS); - - if (function_exists($function)) { - $ret = $function($context['sandbox']); - $context['results'][$module] = $ret; - _drush_log_update_sql($ret); - } - - if (isset($ret['#finished'])) { - $context['finished'] = $ret['#finished']; - unset($ret['#finished']); - } - - if ($context['finished'] == 1 && empty($context['results'][$module]['#abort'])) { - drupal_set_installed_schema_version($module, $number); - } - -} - -function _update_batch_command($id) { - update_main_prepare(); - drush_batch_command($id); -} - -/** - * Return a 2 item array with - * - an array where each item is a 3 item associative array describing a pending update. - * - an array listing the first update to run, keyed by module. - */ -function updatedb_status() { - $return = array(); - - $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE); - foreach ($modules as $module => $schema_version) { - $updates = drupal_get_schema_versions($module); - // Skip incompatible module updates completely, otherwise test schema versions. - if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) { - // module_invoke returns NULL for nonexisting hooks, so if no updates - // are removed, it will == 0. - $last_removed = module_invoke($module, 'update_last_removed'); - if ($schema_version < $last_removed) { - drush_set_error('PROVISION_DRUPAL_UPDATE_FAILED', dt( $module .' module can not be updated. Its schema version is '. $schema_version .'. Updates up to and including '. $last_removed .' have been removed in this release. In order to update '. $module .' module, you will first <a href="http://drupal.org/upgrade">need to upgrade</a> to the last version in which these updates were available.')); - continue; - } - - $updates = drupal_map_assoc($updates); - - // Record the starting update number for each module. - foreach (array_keys($updates) as $update) { - if ($update > $schema_version) { - $start[$module] = $update; - break; - } - } - if (isset($start['system'])) { - // Ensure system module's updates run first. - $start = array('system' => $start['system']) + $start; - } - - // Record any pending updates. Used for confirmation prompt. - foreach (array_keys($updates) as $update) { - if ($update > $schema_version) { - if (class_exists('ReflectionFunction')) { - // The description for an update comes from its Doxygen. - $func = new ReflectionFunction($module. '_update_'. $update); - $description = trim(str_replace(array("\n", '*', '/'), '', $func->getDocComment())); - } - if (empty($description)) { - $description = dt('description not available'); - } - - $return[] = array('module' => ucfirst($module), 'update_id' => $update, 'description' => $description); - } - } - } - } - - return array($return, $start); -} diff --git a/vendor/drush/drush/commands/core/drupal/update_7.inc b/vendor/drush/drush/commands/core/drupal/update_7.inc deleted file mode 100644 index 9dd4803c25d944a72c37b6f9c4baf96c84e8016f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/drupal/update_7.inc +++ /dev/null @@ -1,344 +0,0 @@ -<?php -/** - * @file - * Update.php for provisioned sites. - * This file is a derivative of the standard drupal update.php, - * which has been modified to allow being run from the command - * line. - */ - -use Drush\Log\LogLevel; - -/** - * Global flag to identify update.php run, and so avoid various unwanted - * operations, such as hook_init() and hook_exit() invokes, css/js preprocessing - * and translation, and solve some theming issues. This flag is checked on several - * places in Drupal code (not just update.php). - */ -define('MAINTENANCE_MODE', 'update'); - -/** - * Drupal's update.inc has functions that are in previous update_X.inc files - * for example, update_check_incompatibility() which can prove useful when - * enabling modules. - */ -require_once DRUSH_DRUPAL_CORE . '/includes/update.inc'; -/** - * Returns (and optionally stores) extra requirements that only apply during - * particular parts of the update.php process. - */ -function update_extra_requirements($requirements = NULL) { - static $extra_requirements = array(); - if (isset($requirements)) { - $extra_requirements += $requirements; - } - return $extra_requirements; -} - -/** - * Perform one update and store the results which will later be displayed on - * the finished page. - * - * An update function can force the current and all later updates for this - * module to abort by returning a $ret array with an element like: - * $ret['#abort'] = array('success' => FALSE, 'query' => 'What went wrong'); - * The schema version will not be updated in this case, and all the - * aborted updates will continue to appear on update.php as updates that - * have not yet been run. - * - * @param $module - * The module whose update will be run. - * @param $number - * The update number to run. - * @param $context - * The batch context array - */ -function drush_update_do_one($module, $number, $dependency_map, &$context) { - $function = $module . '_update_' . $number; - - // If this update was aborted in a previous step, or has a dependency that - // was aborted in a previous step, go no further. - if (!empty($context['results']['#abort']) && array_intersect($context['results']['#abort'], array_merge($dependency_map, array($function)))) { - return; - } - - $context['log'] = FALSE; - - $ret = array(); - if (function_exists($function)) { - try { - if ($context['log']) { - Database::startLog($function); - } - - drush_log("Executing " . $function); - $ret['results']['query'] = $function($context['sandbox']); - - // If the update hook returned a status message (common in batch updates), - // show it to the user. - if ($ret['results']['query']) { - drush_log($ret['results']['query'], LogLevel::OK); - } - - $ret['results']['success'] = TRUE; - } - // @TODO We may want to do different error handling for different exception - // types, but for now we'll just print the message. - catch (Exception $e) { - $ret['#abort'] = array('success' => FALSE, 'query' => $e->getMessage()); - drush_set_error('DRUPAL_EXCEPTION', $e->getMessage()); - } - - if ($context['log']) { - $ret['queries'] = Database::getLog($function); - } - } - - if (isset($context['sandbox']['#finished'])) { - $context['finished'] = $context['sandbox']['#finished']; - unset($context['sandbox']['#finished']); - } - - if (!isset($context['results'][$module])) { - $context['results'][$module] = array(); - } - if (!isset($context['results'][$module][$number])) { - $context['results'][$module][$number] = array(); - } - $context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret); - - if (!empty($ret['#abort'])) { - // Record this function in the list of updates that were aborted. - $context['results']['#abort'][] = $function; - } - - // Record the schema update if it was completed successfully. - if ($context['finished'] == 1 && empty($ret['#abort'])) { - drupal_set_installed_schema_version($module, $number); - } - - $context['message'] = 'Performed update: ' . $function; -} - -/** - * Check update requirements and report any errors. - */ -function update_check_requirements() { - $warnings = FALSE; - - // Check the system module and update.php requirements only. - $requirements = system_requirements('update'); - $requirements += update_extra_requirements(); - - // If there are issues, report them. - foreach ($requirements as $requirement) { - if (isset($requirement['severity']) && $requirement['severity'] > REQUIREMENT_OK) { - $message = isset($requirement['description']) ? $requirement['description'] : ''; - if (isset($requirement['value']) && $requirement['value']) { - $message .= ' (Currently using ' . $requirement['title'] . ' ' . $requirement['value'] . ')'; - } - $warnings = TRUE; - drupal_set_message($message, LogLevel::WARNING); - } - } - return $warnings; -} - - -function update_main_prepare() { - // Some unavoidable errors happen because the database is not yet up-to-date. - // Our custom error handler is not yet installed, so we just suppress them. - drush_errors_off(); - - // We prepare a minimal bootstrap for the update requirements check to avoid - // reaching the PHP memory limit. - $core = DRUSH_DRUPAL_CORE; - require_once $core . '/includes/bootstrap.inc'; - require_once $core . '/includes/common.inc'; - require_once $core . '/includes/file.inc'; - require_once $core . '/includes/entity.inc'; - include_once $core . '/includes/unicode.inc'; - - update_prepare_d7_bootstrap(); - drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION); - - require_once $core . '/includes/install.inc'; - require_once $core . '/modules/system/system.install'; - - // Load module basics. - include_once $core . '/includes/module.inc'; - $module_list['system']['filename'] = 'modules/system/system.module'; - module_list(TRUE, FALSE, FALSE, $module_list); - drupal_load('module', 'system'); - - // Reset the module_implements() cache so that any new hook implementations - // in updated code are picked up. - module_implements('', FALSE, TRUE); - - // Set up $language, since the installer components require it. - drupal_language_initialize(); - - // Set up theme system for the maintenance page. - drupal_maintenance_theme(); - - // Check the update requirements for Drupal. - update_check_requirements(); - - // update_fix_d7_requirements() needs to run before bootstrapping beyond path. - // So bootstrap to DRUPAL_BOOTSTRAP_LANGUAGE then include unicode.inc. - drupal_bootstrap(DRUPAL_BOOTSTRAP_LANGUAGE); - - update_fix_d7_requirements(); - - // Clear the module_implements() cache before the full bootstrap. The calls - // above to drupal_maintenance_theme() and update_check_requirements() have - // invoked hooks before all modules have actually been loaded by the full - // bootstrap. This means that the module_implements() results for any hooks - // that have been invoked, including hook_module_implements_alter(), is a - // smaller set of modules than should be returned normally. - // @see https://github.com/drush-ops/drush/pull/399 - module_implements('', FALSE, TRUE); - - // Ensure we re-evaluate the stream wrappers on full bootstrap. - // update_check_requirements() invokes a writeable check and hence loads the - // stream wrappers while not all modules are available. - drupal_static_reset('file_get_stream_wrappers'); - - // Now proceed with a full bootstrap. - - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL); - drupal_maintenance_theme(); - - drush_errors_on(); - - include_once DRUPAL_ROOT . '/includes/batch.inc'; - drupal_load_updates(); - - update_fix_compatibility(); - - // Change query-strings on css/js files to enforce reload for all users. - _drupal_flush_css_js(); - // Flush the cache of all data for the update status module. - if (db_table_exists('cache_update')) { - cache_clear_all('*', 'cache_update', TRUE); - } - - module_list(TRUE, FALSE, TRUE); -} - -function update_main() { - update_main_prepare(); - - list($pending, $start) = updatedb_status(); - if ($pending) { - // @todo get table header working. - // $headers = array(dt('Module'), dt('ID'), dt('Description')); - drush_print_table($pending); - if (!drush_confirm(dt('Do you wish to run all pending updates?'))) { - return drush_user_abort(); - } - drush_update_batch($start); - } - else { - drush_log(dt("No database updates required"), LogLevel::SUCCESS); - } - - return count($pending); -} - -function _update_batch_command($id) { - update_main_prepare(); - drush_batch_command($id); -} - -/** - * Start the database update batch process. - * - * @param $start - * An array of all the modules and which update to start at. - * @param $redirect - * Path to redirect to when the batch has finished processing. - * @param $url - * URL of the batch processing page (should only be used for separate - * scripts like update.php). - * @param $batch - * Optional parameters to pass into the batch API. - * @param $redirect_callback - * (optional) Specify a function to be called to redirect to the progressive - * processing page. - */ -function drush_update_batch($start) { - // Resolve any update dependencies to determine the actual updates that will - // be run and the order they will be run in. - $updates = update_resolve_dependencies($start); - - // Store the dependencies for each update function in an array which the - // batch API can pass in to the batch operation each time it is called. (We - // do not store the entire update dependency array here because it is - // potentially very large.) - $dependency_map = array(); - foreach ($updates as $function => $update) { - $dependency_map[$function] = !empty($update['reverse_paths']) ? array_keys($update['reverse_paths']) : array(); - } - - $operations = array(); - foreach ($updates as $update) { - if ($update['allowed']) { - // Set the installed version of each module so updates will start at the - // correct place. (The updates are already sorted, so we can simply base - // this on the first one we come across in the above foreach loop.) - if (isset($start[$update['module']])) { - drupal_set_installed_schema_version($update['module'], $update['number'] - 1); - unset($start[$update['module']]); - } - // Add this update function to the batch. - $function = $update['module'] . '_update_' . $update['number']; - $operations[] = array('drush_update_do_one', array($update['module'], $update['number'], $dependency_map[$function])); - } - } - - $batch['operations'] = $operations; - $batch += array( - 'title' => 'Updating', - 'init_message' => 'Starting updates', - 'error_message' => 'An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.', - 'finished' => 'drush_update_finished', - 'file' => 'includes/update.inc', - ); - batch_set($batch); - drush_backend_batch_process('updatedb-batch-process'); -} - - - -function drush_update_finished($success, $results, $operations) { - // Nothing to do here. All caches already cleared. Kept as documentation of 'finished' callback. -} - -/** - * Return a 2 item array with - * - an array where each item is a 3 item associative array describing a pending update. - * - an array listing the first update to run, keyed by module. - */ -function updatedb_status() { - $pending = update_get_update_list(); - - $return = array(); - // Ensure system module's updates run first. - $start['system'] = array(); - - // Print a list of pending updates for this module and get confirmation. - foreach ($pending as $module => $updates) { - if (isset($updates['start'])) { - foreach ($updates['pending'] as $update_id => $description) { - // Strip cruft from front. - $description = str_replace($update_id . ' - ', '', $description); - $return[] = array('module' => ucfirst($module), 'update_id' => $update_id, 'description' => $description); - } - if (isset($updates['start'])) { - $start[$module] = $updates['start']; - } - } - } - return array($return, $start); -} diff --git a/vendor/drush/drush/commands/core/field.drush.inc b/vendor/drush/drush/commands/core/field.drush.inc deleted file mode 100644 index 961e22e8eb6025e34fa6ed7b89cc0f57c8dff52f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/field.drush.inc +++ /dev/null @@ -1,392 +0,0 @@ -<?php - -/** - * @file - * Field API's drush integration - */ - -/** - * Implementation of hook_drush_help(). - */ -function field_drush_help($section) { - switch ($section) { - case 'meta:field:title': - return dt('Field commands'); - case 'meta:field:summary': - return dt('Manipulate Drupal 7+ fields.'); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function field_drush_command() { - $items['field-create'] = array( - 'description' => 'Create fields and instances. Returns urls for field editing.', - 'core' => array('7+'), - 'arguments' => array( - 'bundle' => 'Content type (for nodes). Name of bundle to attach fields to. Required.', - 'field_spec' => 'Comma delimited triple in the form: field_name,field_type,widget_name. If widget_name is omitted, the default widget will be used. Separate multiple fields by space. If omitted, a wizard will prompt you.' - ), - 'required-arguments' => 1, - 'options' => array( - 'entity_type' => 'Type of entity (e.g. node, user, comment). Defaults to node.', - ), - 'examples' => array( - 'drush field-create article' => 'Define new article fields via interactive prompts.', - 'open `drush field-create article`' => 'Define new article fields and then open field edit form for refinement.', - 'drush field-create article city,text,text_textfield subtitle,text,text_textfield' => 'Create two new fields.' - ), - 'aliases' => array('field:create'), - ); - $items['field-update'] = array( - 'description' => 'Return URL for field editing web page.', - 'core' => array('7+'), - 'arguments' => array( - 'field_name' => 'Name of field that needs updating.', - ), - 'examples' => array( - 'field-update comment_body' => 'Quickly navigate to a field edit web page.', - ), - 'aliases' => array('field:update'), - ); - $items['field-delete'] = array( - 'description' => 'Delete a field and its instances.', - 'core' => array('7+'), - 'arguments' => array( - 'field_name' => 'Name of field to delete.', - ), - 'options' => array( - 'bundle' => 'Only delete the instance attached to this bundle. If omitted, admin can choose to delete one instance or whole field.', - 'entity_type' => 'Disambiguate a particular bundle from identically named bundles. Usually not needed.' - ), - 'examples' => array( - 'field-delete city' => 'Delete the city field and any instances it might have.', - 'field-delete city --bundle=article' => 'Delete the city instance on the article bundle', - ), - 'aliases' => array('field:delete'), - ); - $items['field-clone'] = array( - 'description' => 'Clone a field and all its instances.', - 'core' => array('7+'), - 'arguments' => array( - 'source_field_name' => 'Name of field that will be cloned', - 'target_field_name' => 'Name of new, cloned field.', - ), - 'examples' => array( - 'field-clone tags labels' => 'Copy \'tags\' field into a new field \'labels\' field which has same instances.', - 'open `field-clone tags labels`' => 'Clone field and then open field edit forms for refinement.', - ), - 'aliases' => array('field:clone'), - ); - $items['field-info'] = array( - 'description' => 'View information about fields, field_types, and widgets.', - 'core' => array('7+'), - 'arguments' => array( - 'type' => 'Recognized values: fields, types. If omitted, a choice list appears.', - ), - 'examples' => array( - 'field-info types' => 'Show a table which lists all field types and their available widgets', - ), - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'csv', - 'field-labels' => array( - 'field-name' => 'Field name', - 'type' => 'Field type', - 'bundle' => 'Field bundle', - 'type-name' => 'Type name', - 'widget' => 'Default widget', - 'widgets' => 'Widgets', - ), - 'table-metadata' => array( - 'process-cell' => '_drush_field_info_process_cell', - ), - 'output-data-type' => 'format-table', - 'aliases' => array('field:info'), - ), - ); - return $items; -} - -/** - * Command argument complete callback. - */ -function field_field_create_complete() { - if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - $all = array(); - $info = field_info_bundles(); - foreach ($info as $entity_type => $bundles) { - $all = array_merge($all, array_keys($bundles)); - } - return array('values' => array_unique($bundles)); - } -} - -/** - * Command argument complete callback. - */ -function field_field_update_complete() { - return field_field_complete_field_names(); -} - -/** - * Command argument complete callback. - */ -function field_field_delete_complete() { - return field_field_complete_field_names(); -} - -/** - * Command argument complete callback. - */ -function field_field_clone_complete() { - return field_field_complete_field_names(); -} - -/** - * Command argument complete callback. - */ -function field_field_info_complete() { - return array('values' => array('fields', 'types')); -} - -/** - * List field names for completion. - * - * @return - * Array of available site aliases. - */ -function field_field_complete_field_names() { - if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - $info = field_info_fields(); - return array('values' => array_keys($info)); - } -} - -function drush_field_create($bundle) { - $entity_type = drush_get_option('entity_type', 'node'); - - $args = func_get_args(); - array_shift($args); - if (empty($args)) { - // Just one item in this array for now. - $args[] = drush_field_create_wizard(); - } - - // Iterate over each field spec. - foreach ($args as $string) { - list($name, $type, $widget) = explode(',', $string); - $info = field_info_field($name); - if (empty($info)) { - // Field does not exist already. Create it. - $field = array( - 'field_name' => $name, - 'type' => $type, - ); - drush_op('field_create_field', $field); - } - - // Create the instance. - $instance = array( - 'field_name' => $name, - 'entity_type' => $entity_type, - 'bundle' => $bundle, - ); - if ($widget) { - $instance['widget'] = array('type' => $widget); - } - drush_op('field_create_instance', $instance); - - $urls[] = drush_url(drush_field_ui_bundle_admin_path($entity_type, $bundle) . '/fields/' . $name, array('absolute' => TRUE)); - } - drush_print(implode(' ', $urls)); -} - -// Copy of function _field_ui_bundle_admin_path() since we don't want to load UI module. -function drush_field_ui_bundle_admin_path($entity_type, $bundle_name) { - $bundles = field_info_bundles($entity_type); - $bundle_info = $bundles[$bundle_name]; - if (isset($bundle_info['admin'])) { - return isset($bundle_info['admin']['real path']) ? $bundle_info['admin']['real path'] : $bundle_info['admin']['path']; - } -} - -function drush_field_update($field_name) { - $info = field_info_field($field_name); - foreach ($info['bundles'] as $entity_type => $bundles) { - foreach ($bundles as $bundle) { - $urls[] = drush_url(drush_field_ui_bundle_admin_path($entity_type, $bundle) . '/fields/' . $field_name, array('absolute' => TRUE)); - } - } - drush_print(implode(' ', $urls)); -} - -function drush_field_delete($field_name) { - $info = field_info_field($field_name); - $confirm = TRUE; - - if (!$bundle = drush_get_option('bundle')) { - foreach ($info['bundles'] as $entity_type => $bundles) { - foreach ($bundles as $bundle) { - $all_bundles[] = $bundle; - } - } - if (count($all_bundles) > 1) { - $options = array_merge(array('all' => dt('All bundles')), array_combine($all_bundles, $all_bundles)); - $bundle = drush_choice($options, dt("Choose a particular bundle or 'All bundles'")); - if (!$bundle) { - return drush_user_abort(); - } - $confirm = FALSE; - } - else { - if (!drush_confirm(dt('Do you want to delete the !field_name field?', array('!field_name' => $field_name)))) { - return drush_user_abort(); - } - } - } - - if ($bundle == 'all') { - foreach ($info['bundles'] as $entity_type => $bundles) { - foreach ($bundles as $bundle) { - $instance = field_info_instance($entity_type, $field_name, $bundle); - drush_op('field_delete_instance', $instance); - } - } - } - else { - $entity_type = drush_field_get_entity_from_bundle($bundle); - $instance = field_info_instance($entity_type, $field_name, $bundle); - drush_op('field_delete_instance', $instance); - } - - // If there are no more bundles, delete the field. - $info = field_info_field($field_name); - if (empty($info['bundles'])) { - drush_op('field_delete_field', $field_name); - } -} - -function drush_field_clone($source_field_name, $target_field_name) { - if (!$info = field_info_field($source_field_name)) { - return drush_set_error(dt('!source not found in field list.', array('!source' => $source_field_name))); - } - - unset($info['id']); - $info['field_name'] = $target_field_name; - $target = drush_op('field_create_field', $info); - - foreach ($info['bundles'] as $entity_type => $bundles) { - foreach ($bundles as $bundle) { - $instance = field_info_instance($entity_type, $source_field_name, $bundle); - $instance['field_name'] = $target_field_name; - unset($instance['id']); - $instance['field_id'] = $target['id']; - drush_op('field_create_instance', $instance); - $urls[] = drush_url(drush_field_ui_bundle_admin_path($entity_type, $bundle) . '/fields/' . $target_field_name, array('absolute' => TRUE)); - } - } - - drush_print(implode(' ', $urls)); -} - -function drush_field_info($type = NULL) { - if (!isset($type)) { - // Don't ask in 'pipe' mode -- just default to 'fields'. - if (drush_get_context('DRUSH_PIPE')) { - $type = 'fields'; - } - else { - $type = drush_choice(array_combine(array('types', 'fields'), array('types', 'fields')), dt('Which information do you wish to see?')); - } - } - - $result = array(); - switch ($type) { - case 'fields': - drush_hide_output_fields(array('type-name', 'widget', 'widgets')); - $info = field_info_fields(); - foreach ($info as $field_name => $field) { - $bundle_strs = array(); - foreach ($field['bundles'] as $entity_type => $bundles) { - $bundle_strs += $bundles; - } - $result[$field_name] = array( - 'field-name' => $field_name, - 'type' => $field['type'], - 'bundle' => $bundle_strs, - ); - } - break; - case 'types': - drush_hide_output_fields(array('field-name', 'type', 'bundle')); - $info = field_info_field_types(); - module_load_include('inc', 'field_ui', 'field_ui.admin'); - $widgets = field_info_widget_types(); - foreach ($info as $type_name => $type) { - $widgets = field_ui_widget_type_options($type_name); - $result[$type_name] = array( - 'type-name' => $type_name, - 'widget' => $type['default_widget'], - 'widgets' => $widgets, - ); - } - break; - default: - return drush_set_error('DRUSH_FIELD_INVALID_SELECTION', dt("Argument for drush field-info must be 'fields' or 'types'")); - } - - return $result; -} - -/** - * We need to handle the formatting of cells in table-format - * output specially. In 'types' output, the output data is a simple - * associative array of machine names => human-readable names. - * We choose to show the machine names. In 'fields' output, the - * output data is a list of entity types, each of which contains a list - * of bundles. We comma-separate the bundles, and space-separate - * the entities. - */ -function _drush_field_info_process_cell($data, $metadata) { - $first = reset($data); - if (is_array($first)) { - foreach($data as $entity => $bundles) { - $list[] = drush_format($bundles, array(), 'csv'); - } - return drush_format($list, array(), 'list'); - } - return drush_format(array_keys($data), array(), 'csv'); -} - -/** - * Prompt user enough to create basic field and instance. - * - * @return array $field_spec - * An array of brief field specifications. - */ -function drush_field_create_wizard() { - $specs[] = drush_prompt(dt('Field name')); - module_load_include('inc', 'field_ui', 'field_ui.admin'); - $types = field_ui_field_type_options(); - $field_type = drush_choice($types, dt('Choose a field type')); - $specs[] = $field_type; - $widgets = field_ui_widget_type_options($field_type); - $specs[] = drush_choice($widgets, dt('Choose a widget')); - return implode(',', $specs); -} - -function drush_field_get_entity_from_bundle($bundle) { - if (drush_get_option('entity_type')) { - return drush_get_option('entity_type'); - } - else { - $info = field_info_bundles(); - foreach ($info as $entity_type => $bundles) { - if (isset($bundles[$bundle])) { - return $entity_type; - } - } - } -} diff --git a/vendor/drush/drush/commands/core/help.drush.inc b/vendor/drush/drush/commands/core/help.drush.inc deleted file mode 100644 index 55dbc0ba8df84a86d2102204ea4e987af41aa5ef..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/help.drush.inc +++ /dev/null @@ -1,202 +0,0 @@ -<?php - -/** - * Implementation of hook_drush_help(). - * - * This function is called whenever a drush user calls - * 'drush help <name-of-your-command>' - * - * @param - * A string with the help section (prepend with 'drush:') - * - * @return - * A string with the help text for your command. - */ -function help_drush_help($section) { - switch ($section) { - case 'drush:help': - return dt("Drush provides an extensive help system that describes both drush commands and topics of general interest. Use `drush help --filter` to present a list of command categories to view, and `drush topic` for a list of topics that go more in-depth on how to use and extend drush."); - } -} - -/** - * Implementation of hook_drush_command(). - * - * In this hook, you specify which commands your - * drush module makes available, what it does and - * description. - * - * Notice how this structure closely resembles how - * you define menu hooks. - * - * @return - * An associative array describing your command(s). - */ -function help_drush_command() { - $items = array(); - - $items['help'] = array( - 'description' => 'Print this help message. See `drush help help` for more options.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'allow-additional-options' => array('helpsingle'), - 'options' => array( - 'sort' => 'Sort commands in alphabetical order. Drush waits for full bootstrap before printing any commands when this option is used.', - 'filter' => array( - 'description' => 'Restrict command list to those commands defined in the specified file. Omit value to choose from a list of names.', - 'example-value' => 'category', - 'value' => 'optional', - ), - ), - 'arguments' => array( - 'command' => 'A command name, or command alias.', - ), - 'examples' => array( - 'drush' => 'List all commands.', - 'drush --filter=devel_generate' => 'Show only commands defined in devel_generate.drush.inc', - 'drush help pm-download' => 'Show help for one command.', - 'drush help dl' => 'Show help for one command using an alias.', - 'drush help --format=html' => 'Show an HTML page detailing all available commands.', - 'drush help --format=json' => 'All available comamnds, in a machine parseable format.', - ), - // Use output format system for all formats except the default presentation. - 'outputformat' => array( - 'default' => 'table', - 'field-labels' => array('name' => 'Name', 'description' => 'Description'), - 'output-data-type' => 'format-table', - ), - 'topics' => array('docs-readme'), - ); - return $items; -} - - -/** - * Command argument complete callback. - * - * For now, this can't move to helpsingle since help command is the entry point for both. - * - * @return - * Array of available command names. - */ -function core_help_complete() { - return array('values' => array_keys(drush_get_commands())); -} - -/** - * Command callback for help command. This is the default command, when none - * other has been specified. - */ -function drush_core_help($name = '') { - $format = drush_get_option('format', 'table'); - if ($name) { - // helpsingle command builds output when a command is specified. - $options = drush_redispatch_get_options(); - if ($name != 'help') { - unset($options['help']); - } - $return = drush_invoke_process('@self' ,'helpsingle', func_get_args(), $options); - drush_backend_set_result($return['object']); - return; - } - - // For speed, only bootstrap up to DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION. - drush_bootstrap_max(); - drush_get_commands(true); - $implemented = drush_get_commands(); - ksort($implemented); - $command_categories = drush_commands_categorize($implemented); - if ($format != 'table') { - return $command_categories; - } - else { - $visible = drush_help_visible($command_categories); - - // If the user specified --filter w/out a value, then - // present a choice list of help categories. - if (drush_get_option('filter', FALSE) === TRUE) { - $help_categories = array(); - foreach ($command_categories as $key => $info) { - $description = $info['title']; - if (array_key_exists('summary', $info)) { - $description .= ": " . $info['summary']; - } - $help_categories[$key] = $description; - } - $result = drush_choice($help_categories, 'Select a help category:'); - if (!$result) { - return drush_user_abort(); - } - drush_set_option('filter', $result); - } - // Filter out categories that the user does not want to see - $filter_category = drush_get_option('filter'); - if (!empty($filter_category) && ($filter_category !== TRUE)) { - if (!array_key_exists($filter_category, $command_categories)) { - return drush_set_error('DRUSH_NO_CATEGORY', dt("The specified command category !filter does not exist.", array('!filter' => $filter_category))); - } - $command_categories = array($filter_category => $command_categories[$filter_category]); - } - - // Make a fake command section to hold the global options, then print it. - $global_options_help = drush_global_options_command(TRUE); - if (!drush_get_option('filter')) { - drush_print_help($global_options_help); - } - drush_help_listing_print($command_categories); - drush_backend_set_result($command_categories); - return; - } -} - -// Uncategorize the list of commands. Hiddens have been removed and -// filtering performed. -function drush_help_visible($command_categories) { - $all = array(); - foreach ($command_categories as $category => $info) { - $all = array_merge($all, $info['commands']); - } - return $all; -} - -/** - * Print CLI table listing all commands. - */ -function drush_help_listing_print($command_categories) { - $all_commands = array(); - foreach ($command_categories as $key => $info) { - // Get the commands in this category. - $commands = $info['commands']; - - // Build rows for drush_print_table(). - $rows = array(); - foreach($commands as $cmd => $command) { - $name = $command['aliases'] ? $cmd . ' (' . implode(', ', $command['aliases']) . ')': $cmd; - $rows[$cmd] = array('name' => $name, 'description' => $command['description']); - } - drush_print($info['title'] . ": (" . $key . ")"); - drush_print_table($rows, FALSE, array('name' => 20)); - } -} - -/** - * Build a fake command for the purposes of showing examples and options. - */ -function drush_global_options_command($brief = FALSE) { - $global_options_help = array( - 'description' => 'Execute a drush command. Run `drush help [command]` to view command-specific help. Run `drush topic` to read even more documentation.', - 'sections' => array( - 'options' => 'Global options (see `drush topic core-global-options` for the full list)', - ), - 'options' => drush_get_global_options($brief), - 'examples' => array( - 'drush dl cck zen' => 'Download CCK module and Zen theme.', - 'drush --uri=http://example.com status' => 'Show status command for the example.com multi-site.', - ), - '#brief' => TRUE, - ); - $global_options_help += drush_command_defaults('global-options', 'global_options', __FILE__); - drush_command_invoke_all_ref('drush_help_alter', $global_options_help); - ksort($global_options_help['options']); - - return $global_options_help; -} diff --git a/vendor/drush/drush/commands/core/helpsingle.drush.inc b/vendor/drush/drush/commands/core/helpsingle.drush.inc deleted file mode 100644 index 7c6bee4efcb0d8d9c75f1597a3644eea9565dcda..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/helpsingle.drush.inc +++ /dev/null @@ -1,277 +0,0 @@ -<?php - -/** - * Implementation of hook_drush_command(). - * - * In this hook, you specify which commands your - * drush module makes available, what it does and - * description. - * - * Notice how this structure closely resembles how - * you define menu hooks. - * - * @return - * An associative array describing your command(s). - */ -function helpsingle_drush_command() { - $items = array(); - $items['helpsingle'] = array( - 'description' => 'Print help for a single command', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'allow-additional-options' => TRUE, - 'hidden' => TRUE, - 'arguments' => array( - 'command' => 'A command name, or command alias.', - ), - 'examples' => array( - 'drush help pm-download' => 'Show help for one command.', - 'drush help dl' => 'Show help for one command using an alias.', - ), - 'topics' => array('docs-readme'), - ); - return $items; -} - -/** - * Command callback. Show help for a single command. - */ -function drush_core_helpsingle($commandstring) { - // First check and see if the command can already be found. - $commands = drush_get_commands(); - if (!array_key_exists($commandstring, $commands)) { - // If the command cannot be found, then bootstrap so that - // additional commands will be brought in. - // TODO: We need to do a full bootstrap in order to find module service - // commands. We only need to do this for Drupal 8, though; 7 and earlier - // can stop at DRUSH_BOOTSTRAP_DRUPAL_SITE. Perhaps we could use command - // caching to avoid bootstrapping, if we have collected the commands for - // this site once already. - drush_bootstrap_max(); - $commands = drush_get_commands(); - } - if (array_key_exists($commandstring, $commands)) { - $command = $commands[$commandstring]; - - annotationcommand_adapter_add_hook_options($command); - - drush_print_help($command); - return TRUE; - } - $shell_aliases = drush_get_context('shell-aliases', array()); - if (array_key_exists($commandstring, $shell_aliases)) { - $msg = dt("'@alias-name' is a shell alias. Its value is: !name. See `drush topic docs-shell-aliases` and `drush shell-alias` for more information.", array('@alias-name' => $commandstring, '!name' => $shell_aliases[$commandstring])); - drush_log($msg, 'ok'); - return TRUE; - } - return drush_set_error('DRUSH_COMMAND_NOT_FOUND', dt('Invalid command !command.', array('!command' => $commandstring))); -} - -/** - * Print the help for a single command to the screen. - * - * @param array $command - * A fully loaded $command array. - */ -function drush_print_help($command) { - _drush_help_merge_subcommand_information($command); - - if (!$help = drush_command_invoke_all('drush_help', 'drush:'. $command['command'])) { - $help = array($command['description']); - } - - if ($command['strict-option-handling']) { - $command['topics'][] = 'docs-strict-options'; - } - - // Give commandfiles an opportunity to add examples and options to the command. - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_SITE); - drush_engine_add_help_topics($command); - drush_command_invoke_all_ref('drush_help_alter', $command); - - drush_print(wordwrap(implode("\n", $help), drush_get_context('DRUSH_COLUMNS', 80))); - drush_print(); - - $global_options = drush_get_global_options(); - foreach ($command['global-options'] as $global_option) { - $command['options'][$global_option] = $global_options[$global_option]; - } - - // Sort command options. - uksort($command['options'], '_drush_help_sort_command_options'); - - // Print command sections help. - foreach ($command['sections'] as $key => $value) { - if (!empty($command[$key])) { - $rows = drush_format_help_section($command, $key); - if ($rows) { - drush_print(dt($value) . ':'); - drush_print_table($rows, FALSE, array('label' => 40)); - unset($rows); - drush_print(); - } - } - } - - // Append aliases if any. - if ($command['aliases']) { - drush_print(dt("Aliases: ") . implode(', ', $command['aliases'])); - } -} - -/** - * Sort command options alphabetically. Engine options at the end. - */ -function _drush_help_sort_command_options($a, $b) { - $engine_a = strpos($a, '='); - $engine_b = strpos($b, '='); - if ($engine_a && !$engine_b) { - return 1; - } - else if (!$engine_a && $engine_b) { - return -1; - } - elseif ($engine_a && $engine_b) { - if (substr($a, 0, $engine_a) == substr($b, 0, $engine_b)) { - return 0; - } - } - return ($a < $b) ? -1 : 1; -} - -/** - * Check to see if the specified command contains an 'allow-additional-options' - * record. If it does, find the additional options that are allowed, and - * add in the help text for the options of all of the sub-commands. - */ -function _drush_help_merge_subcommand_information(&$command) { - // 'allow-additional-options' will either be FALSE (default), - // TRUE ("allow anything"), or an array that lists subcommands - // that are or may be called via drush_invoke by this command. - if (is_array($command['allow-additional-options'])) { - $implemented = drush_get_commands(); - foreach ($command['allow-additional-options'] as $subcommand_name) { - if (array_key_exists($subcommand_name, $implemented)) { - $command['options'] += $implemented[$subcommand_name]['options']; - $command['sub-options'] = array_merge_recursive($command['sub-options'], $implemented[$subcommand_name]['sub-options']); - if (empty($command['arguments'])) { - $command['arguments'] = $implemented[$subcommand_name]['arguments']; - } - $command['topics'] = array_merge($command['topics'], $implemented[$subcommand_name]['topics']); - } - } - } -} - -/** - * Format one named help section from a command record - * - * @param $command - * A command record with help information - * @param $section - * The name of the section to format ('options', 'topic', etc.) - * @returns array - * Formatted rows, suitable for printing via drush_print_table. The returned - * array can be empty. - */ -function drush_format_help_section($command, $section) { - $rows = array(); - $formatter = (function_exists('drush_help_section_formatter_' . $section)) ? 'drush_help_section_formatter_' . $section : 'drush_help_section_default_formatter'; - foreach ($command[$section] as $name => $help_attributes) { - if (!is_array($help_attributes)) { - $help_attributes = array('description' => $help_attributes); - } - $help_attributes['label'] = $name; - call_user_func_array($formatter, array($command, &$help_attributes)); - if (empty($help_attributes['hidden'])) { - $rows[] = array('label' => $help_attributes['label'], 'description' => $help_attributes['description']); - // Process the subsections too, if any - if (!empty($command['sub-' . $section]) && array_key_exists($name, $command['sub-' . $section])) { - $rows = array_merge($rows, _drush_format_help_subsection($command, $section, $name, $formatter)); - } - } - } - return $rows; -} - -/** - * Format one named portion of a subsection from a command record. - * Subsections allow related parts of a help record to be grouped - * together. For example, in the 'options' section, sub-options that - * are related to a particular primary option are stored in a 'sub-options' - * section whose name == the name of the primary option. - * - * @param $command - * A command record with help information - * @param $section - * The name of the section to format ('options', 'topic', etc.) - * @param $subsection - * The name of the subsection (e.g. the name of the primary option) - * @param $formatter - * The name of a function to use to format the rows of the subsection - * @param $prefix - * Characters to prefix to the front of the label (for indentation) - * @returns array - * Formatted rows, suitable for printing via drush_print_table. - */ -function _drush_format_help_subsection($command, $section, $subsection, $formatter, $prefix = ' ') { - $rows = array(); - foreach ($command['sub-' . $section][$subsection] as $name => $help_attributes) { - if (!is_array($help_attributes)) { - $help_attributes = array('description' => $help_attributes); - } - $help_attributes['label'] = $name; - call_user_func_array($formatter, array($command, &$help_attributes)); - if (!array_key_exists('hidden', $help_attributes)) { - $rows[] = array('label' => $prefix . $help_attributes['label'], 'description' => $help_attributes['description']); - // Process the subsections too, if any - if (!empty($command['sub-' . $section]) && array_key_exists($name, $command['sub-' . $section])) { - $rows = array_merge($rows, _drush_format_help_subsection($command, $section, $name, $formatter, $prefix . ' ')); - } - } - } - return $rows; -} - -/** - * The options section formatter. Adds a "--" in front of each - * item label. Also handles short-form and example-value - * components in the help attributes. - */ -function drush_help_section_formatter_options($command, &$help_attributes) { - if ($help_attributes['label'][0] == '-') { - drush_log(dt("Option '!option' of command !command should instead be declared as '!fixed'", array('!option' => $help_attributes['label'], '!command' => $command['command'], '!fixed' => preg_replace('/^--*/', '', $help_attributes['label']))), 'debug'); - } - else { - $help_attributes['label'] = '--' . $help_attributes['label']; - } - if (!empty($help_attributes['required'])) { - $help_attributes['description'] .= " " . dt("Required."); - } - - $prefix = '<'; - $suffix = '>'; - if (array_key_exists('example-value', $help_attributes)) { - if (isset($help_attributes['value']) && $help_attributes['value'] == 'optional') { - $prefix = '['; - $suffix = ']'; - } - $help_attributes['label'] .= '=' . $prefix . $help_attributes['example-value'] . $suffix; - - if (array_key_exists('short-form', $help_attributes)) { - $help_attributes['short-form'] .= " $prefix" . $help_attributes['example-value'] . $suffix; - } - } - if (array_key_exists('short-form', $help_attributes)) { - $help_attributes['label'] = '-' . $help_attributes['short-form'] . ', ' . $help_attributes['label']; - } - drush_help_section_default_formatter($command, $help_attributes); -} - -/** - * The default section formatter. Replaces '[command]' with the - * command name. - */ -function drush_help_section_default_formatter($command, &$help_attributes) { - // '[command]' is a token representing the current command. @see pm_drush_engine_version_control(). - $help_attributes['label'] = str_replace('[command]', $command['command'], $help_attributes['label']); -} diff --git a/vendor/drush/drush/commands/core/image.drush.inc b/vendor/drush/drush/commands/core/image.drush.inc deleted file mode 100644 index ddfbf04bcdaf40529b569f7adcf84187bd9adbb7..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/image.drush.inc +++ /dev/null @@ -1,130 +0,0 @@ -<?php - -/** - * @file - * Image module's drush integration. - * - * @todo image-build($field_name, $bundle, $style_name) - */ - -use Drush\Log\LogLevel; - -/** - * Implementation of hook_drush_command(). - */ -function image_drush_command() { - $items['image-flush'] = array( - 'description' => 'Flush all derived images for a given style.', - 'core' => array('7+'), - 'arguments' => array( - 'style' => 'An image style machine name. If not provided, user may choose from a list of names.', - ), - 'options' => array( - 'all' => 'Flush all derived images', - ), - 'examples' => array( - 'drush image-flush' => 'Pick an image style and then delete its images.', - 'drush image-flush thumbnail' => 'Delete all thumbnail images.', - 'drush image-flush --all' => 'Flush all derived images. They will be regenerated on the fly.', - ), - 'aliases' => array('if', 'image:flush'), - ); - $items['image-derive'] = array( - 'description' => 'Create an image derivative.', - 'core' => array('7+'), - 'drupal dependencies' => array('image'), - 'arguments' => array( - 'style' => 'An image style machine name.', - 'source' => 'Path to a source image. Optionally prepend stream wrapper scheme.', - ), - 'required arguments' => TRUE, - 'options' => array(), - 'examples' => array( - 'drush image-derive thumbnail themes/bartik/logo.png' => 'Save thumbnail sized derivative of logo image.', - ), - 'aliases' => array('id', 'image:derive'), - ); - return $items; -} - -/** - * Implements hook_drush_help_alter(). - */ -function image_drush_help_alter(&$command) { - // Drupal 8+ customizations. - if ($command['command'] == 'image-derive' && drush_drupal_major_version() >= 8) { - unset($command['examples']); - $command['examples']['drush image-derive thumbnail core/themes/bartik/logo.png'] = 'Save thumbnail sized derivative of logo image.'; - } -} - -/** - * Command argument complete callback. - * - * @return - * Array of available configuration files for editing. - */ -function image_image_flush_complete() { - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL); - drush_include_engine('drupal', 'image'); - return array('values' => array_keys(drush_image_styles())); -} - -function drush_image_flush_pre_validate($style_name = NULL) { - drush_include_engine('drupal', 'image'); - if (!empty($style_name) && !$style = drush_image_style_load($style_name)) { - return drush_set_error(dt('Image style !style not recognized.', array('!style' => $style_name))); - } -} - -function drush_image_flush($style_name = NULL) { - drush_include_engine('drupal', 'image'); - if (drush_get_option('all')) { - $style_name = 'all'; - } - - if (empty($style_name)) { - $styles = array_keys(drush_image_styles()); - $choices = array_combine($styles, $styles); - $choices = array_merge(array('all' => 'all'), $choices); - $style_name = drush_choice($choices, dt("Choose a style to flush.")); - if ($style_name === FALSE) { - return drush_user_abort(); - } - } - - if ($style_name == 'all') { - foreach (drush_image_styles() as $style_name => $style) { - drush_image_flush_single($style_name); - } - drush_log(dt('All image styles flushed'), LogLevel::SUCCESS); - } - else { - drush_image_flush_single($style_name); - } -} - -function drush_image_derive_validate($style_name, $source) { - drush_include_engine('drupal', 'image'); - if (!$style = drush_image_style_load($style_name)) { - return drush_set_error(dt('Image style !style not recognized.', array('!style' => $style_name))); - } - - if (!file_exists($source)) { - return drush_set_error(dt('Source file not found - !file.', array('!file' => $source))); - } -} - -/* - * Command callback. Create an image derivative. - * - * @param string $style_name - * The name of an image style. - * - * @param string $source - * The path to a source image, relative to Drupal root. - */ -function drush_image_derive($style_name, $source) { - drush_include_engine('drupal', 'image'); - return _drush_image_derive($style_name, $source); -} diff --git a/vendor/drush/drush/commands/core/init.drush.inc b/vendor/drush/drush/commands/core/init.drush.inc deleted file mode 100644 index d7c5da8d01dced29c829757d386fadc4558316bc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/init.drush.inc +++ /dev/null @@ -1,174 +0,0 @@ -<?php - -/** - * @file - * Set up local Drush configuration. - */ - -use Drush\Log\LogLevel; - -/** - * Implementation of hook_drush_command(). - * - * @return - * An associative array describing your command(s). - */ -function init_drush_command() { - $items['core-init'] = array( - 'description' => 'Enrich the bash startup file with completion and aliases. Copy .drushrc file to ~/.drush', - 'aliases' => array('init', 'core:init'), - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'package' => 'core', - 'global-options' => array('editor', 'bg'), - 'options' => array( - 'edit' => 'Open the new config file in an editor.', - 'add-path' => "Always add Drush to the \$PATH in the user's .bashrc file, even if it is already in the \$PATH. Use --no-add-path to skip updating .bashrc with the Drush \$PATH. Default is to update .bashrc only if Drush is not already in the \$PATH.", - ), - 'examples' => array( - 'drush core-init --edit' => 'Enrich Bash and open drush config file in editor.', - 'drush core-init --edit --bg' => 'Return to shell prompt as soon as the editor window opens.', - ), - ); - return $items; -} - -/** - * Initialize local Drush configuration - */ -function drush_init_core_init() { - $home = drush_server_home(); - $drush_config_dir = $home . "/.drush"; - $drush_config_file = $drush_config_dir . "/drushrc.php"; - $drush_bashrc = $drush_config_dir . "/drush.bashrc"; - $drush_prompt = $drush_config_dir . "/drush.prompt.sh"; - $drush_complete = $drush_config_dir . "/drush.complete.sh"; - $examples_dir = DRUSH_BASE_PATH . "/examples"; - $example_configuration = $examples_dir . "/example.drushrc.php"; - $example_bashrc = $examples_dir . "/example.bashrc"; - $example_prompt = $examples_dir . "/example.prompt.sh"; - $example_complete = DRUSH_BASE_PATH . "/drush.complete.sh"; - $bashrc_additions = array(); - - // Create a ~/.drush directory if it does not yet exist - if (!is_dir($drush_config_dir)) { - drush_mkdir($drush_config_dir); - } - - // If there is no ~/.drush/drushrc.php, then copy the - // example Drush configuration file here - if (!is_file($drush_config_file)) { - copy($example_configuration, $drush_config_file); - drush_log(dt("Copied example Drush configuration file to !path", array('!path' => $drush_config_file)), LogLevel::OK); - } - - // If Drush is not in the $PATH, then figure out which - // path to add so that Drush can be found globally. - $add_path = drush_get_option('add-path', NULL); - if ((!drush_which("drush") || $add_path) && ($add_path !== FALSE)) { - $drush_path = drush_find_path_to_drush($home); - $drush_path = preg_replace("%^" . preg_quote($home) . "/%", '$HOME/', $drush_path); - - $bashrc_additions["%$drush_path%"] = "\n# Path to Drush, added by 'drush init'.\nexport PATH=\"\$PATH:$drush_path\"\n\n"; - } - - // If there is no ~/.drush/drush.bashrc file, then copy - // the example bashrc file there - if (!is_file($drush_bashrc)) { - copy($example_bashrc, $drush_bashrc); - $pattern = basename($drush_bashrc); - $bashrc_additions["%$pattern%"] = "\n# Include Drush bash customizations.". drush_bash_addition($drush_bashrc); - drush_log(dt("Copied example Drush bash configuration file to !path", array('!path' => $drush_bashrc)), LogLevel::OK); - } - - // If there is no ~/.drush/drush.complete.sh file, then copy it there - if (!is_file($drush_complete)) { - copy($example_complete, $drush_complete); - $pattern = basename($drush_complete); - $bashrc_additions["%$pattern%"] = "\n# Include Drush completion.\n". drush_bash_addition($drush_complete); - drush_log(dt("Copied Drush completion file to !path", array('!path' => $drush_complete)), LogLevel::OK); - } - - // If there is no ~/.drush/drush.prompt.sh file, then copy - // the example prompt.sh file here - if (!is_file($drush_prompt)) { - copy($example_prompt, $drush_prompt); - $pattern = basename($drush_prompt); - $bashrc_additions["%$pattern%"] = "\n# Include Drush prompt customizations.\n". drush_bash_addition($drush_prompt); - drush_log(dt("Copied example Drush prompt file to !path", array('!path' => $drush_prompt)), LogLevel::OK); - } - - // Decide whether we want to add our Bash commands to - // ~/.bashrc or ~/.bash_profile - $bashrc = drush_init_find_bashrc($home); - - // Modify the user's bashrc file, adding our customizations. - $bashrc_contents = ""; - if (file_exists($bashrc)) { - $bashrc_contents = file_get_contents($bashrc); - } - $new_bashrc_contents = $bashrc_contents; - foreach ($bashrc_additions as $pattern => $addition) { - // Only put in the addition if the pattern does not already - // exist in the bashrc file. - if (!preg_match($pattern, $new_bashrc_contents)) { - $new_bashrc_contents = $new_bashrc_contents . $addition; - } - } - if ($new_bashrc_contents != $bashrc_contents) { - if (drush_confirm(dt(implode('', $bashrc_additions) . "Append the above code to !file?", array('!file' => $bashrc)))) { - file_put_contents($bashrc, "\n\n". $new_bashrc_contents); - drush_log(dt("Updated bash configuration file !path", array('!path' => $bashrc)), LogLevel::OK); - drush_log(dt("Start a new shell in order to experience the improvements (e.g. `bash`)."), LogLevel::OK); - if (drush_get_option('edit')) { - $exec = drush_get_editor(); - drush_shell_exec_interactive($exec, $drush_config_file, $drush_config_file); - } - } - else { - return drush_user_abort(); - } - } - else { - drush_log(dt('No code added to !path', array('!path' => $bashrc)), LogLevel::OK); - } -} - -/** - * Determine which .bashrc file is best to use on this platform. - */ -function drush_init_find_bashrc($home) { - return $home . "/.bashrc"; -} - -/** - * Determine where Drush is located, so that we can add - * that location to the $PATH - */ -function drush_find_path_to_drush($home) { - // First test: is Drush inside a vendor directory? - // Does vendor/bin exist? If so, use that. We do - // not have a good way to locate the 'bin' directory - // if it has been relocated in the composer.json config - // section. - if ($vendor_pos = strpos(DRUSH_BASE_PATH, "/vendor/")) { - $vendor_dir = substr(DRUSH_BASE_PATH, 0, $vendor_pos + 7); - $vendor_bin = $vendor_dir . '/bin'; - if (is_dir($vendor_bin)) { - return $vendor_bin; - } - } - - // Fallback is to use the directory that Drush is in. - return DRUSH_BASE_PATH; -} - -function drush_bash_addition($file) { - return <<<EOD - -if [ -f "$file" ] ; then - source $file -fi - - -EOD; -} diff --git a/vendor/drush/drush/commands/core/locale.d8.drush.inc b/vendor/drush/drush/commands/core/locale.d8.drush.inc deleted file mode 100644 index 2016daca63db980e206bd7ac8ef564918eef1e4f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/locale.d8.drush.inc +++ /dev/null @@ -1,126 +0,0 @@ -<?php - -/** - * @file - * Provides Drush commands related to Interface Translation. - */ - -/** - * Implementation of hook_drush_help(). - */ -function locale_drush_help($section) { - switch ($section) { - case 'meta:locale:title': - return dt('Interface translation'); - case 'meta:locale:summary': - return dt('Interact with the interface translation system.'); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function locale_drush_command() { - $items['locale-check'] = [ - 'description' => 'Checks for available translation updates.', - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - ]; - $items['locale-update'] = [ - 'description' => 'Updates the available translations.', - 'options' => [ - 'langcodes' => 'A comma-separated list of language codes to update. If omitted, all translations will be updated.' - ], - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - 'aliases' => array('locale:check'), - ]; - // @todo Implement proper export and import commands. - return $items; -} - -/** - * Checks for available translation updates. - * - * @see \Drupal\locale\Controller\LocaleController::checkTranslation() - * - * @todo This can be simplified once https://www.drupal.org/node/2631584 lands - * in Drupal core. - */ -function drush_locale_check() { - \Drupal::moduleHandler()->loadInclude('locale', 'inc', 'locale.compare'); - - // Check translation status of all translatable project in all languages. - // First we clear the cached list of projects. Although not strictly - // necessary, this is helpful in case the project list is out of sync. - locale_translation_flush_projects(); - locale_translation_check_projects(); - - // Execute a batch if required. A batch is only used when remote files - // are checked. - if (batch_get()) { - drush_backend_batch_process(); - } -} - -/** - * Imports the available translation updates. - * - * @see TranslationStatusForm::buildForm() - * @see TranslationStatusForm::prepareUpdateData() - * @see TranslationStatusForm::submitForm() - * - * @todo This can be simplified once https://www.drupal.org/node/2631584 lands - * in Drupal core. - */ -function drush_locale_update() { - $module_handler = \Drupal::moduleHandler(); - $module_handler->loadInclude('locale', 'fetch.inc'); - $module_handler->loadInclude('locale', 'bulk.inc'); - - $langcodes = []; - foreach (locale_translation_get_status() as $project_id => $project) { - foreach ($project as $langcode => $project_info) { - if (!empty($project_info->type)) { - $langcodes[] = $langcode; - } - } - } - - if ($passed_langcodes = drush_get_option('langcodes')) { - $langcodes = array_intersect($langcodes, explode(',', $passed_langcodes)); - // @todo Not selecting any language code in the user interface results in - // all translations being updated, so we mimick that behavior here. - } - // Deduplicate the list of langcodes since each project may have added the - // same language several times. - $langcodes = array_unique($langcodes); - - // @todo Restricting by projects is not possible in the user interface and is - // broken when attempting to do it in a hook_form_alter() implementation so - // we do not allow for it here either. - $projects = []; - - // Set the translation import options. This determines if existing - // translations will be overwritten by imported strings. - $options = _locale_translation_default_update_options(); - - // If the status was updated recently we can immediately start fetching the - // translation updates. If the status is expired we clear it an run a batch to - // update the status and then fetch the translation updates. - $last_checked = \Drupal::state()->get('locale.translation_last_checked'); - if ($last_checked < REQUEST_TIME - LOCALE_TRANSLATION_STATUS_TTL) { - locale_translation_clear_status(); - $batch = locale_translation_batch_update_build(array(), $langcodes, $options); - batch_set($batch); - } - else { - // Set a batch to download and import translations. - $batch = locale_translation_batch_fetch_build($projects, $langcodes, $options); - batch_set($batch); - // Set a batch to update configuration as well. - if ($batch = locale_config_batch_update_components($options, $langcodes)) { - batch_set($batch); - } - } - - drush_backend_batch_process(); -} diff --git a/vendor/drush/drush/commands/core/notify.drush.inc b/vendor/drush/drush/commands/core/notify.drush.inc deleted file mode 100644 index 9994d13f9565c3496ab8c9ecf6f1b60e80d0c666..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/notify.drush.inc +++ /dev/null @@ -1,212 +0,0 @@ -<?php -/** - * @file - * Add system notifications as a new drush option. - */ - -/** - * @todo there are no hooks fired after a command errors out. - */ -register_shutdown_function('drush_notify_shutdown'); - -/** - * Implements hook_drush_help_alter(). - */ -function notify_drush_help_alter(&$command) { - if ($command['command'] == 'global-options') { - // Do not include these in options in standard help. - if ($command['#brief'] === FALSE) { - $command['options']['notify'] = array( - 'description' => 'Use system notifications to signal command completion. If set to a number, commands that finish in fewer seconds will not trigger a notification.', - 'example-value' => 60, - 'never-propagate' => TRUE, - ); - $command['options']['notify-audio'] = array( - 'description' => 'Trigger an audio alert to signal command completion. If set to a number, commands that finish in fewer seconds will not trigger a notification.', - 'example-value' => 60, - 'never-propagate' => TRUE, - ); - $command['sub-options']['notify']['notify-cmd'] = array( - 'description' => 'Specify the shell command to trigger the notification.', - 'never-propagate' => TRUE, - ); - $command['sub-options']['notify']['notify-cmd-audio'] = array( - 'description' => 'Specify the shell command to trigger the audio notification.', - 'never-propagate' => TRUE, - ); - } - } -} - -/** - * Implements hook_drush_help(). - */ -function notify_drush_help($section) { - switch ($section) { - case 'notify:cache-clear': - return dt('Caches have been cleared.'); - case 'notify:site-install:error': - return dt('Failed on site installation'); - } -} - -/** - * Shutdown function to signal on errors. - */ -function drush_notify_shutdown() { - $cmd = drush_get_command(); - - if (empty($cmd['command'])) { - return; - } - - // pm-download handles its own notification. - if ($cmd['command'] != 'pm-download' && drush_notify_allowed($cmd['command'])) { - $msg = dt("Command '!command' completed.", array('!command' => $cmd['command'])); - drush_notify_send(drush_notify_command_message($cmd['command'], $msg)); - } - - if (drush_get_option('notify', FALSE) && drush_get_error()) { - // If the only error is that notify failed, do not try to notify again. - $log = drush_get_error_log(); - if (count($log) == 1 && array_key_exists('NOTIFY_COMMAND_NOT_FOUND', $log)) { - return; - } - - // Send an alert that the command failed. - if (drush_notify_allowed($cmd['command'])) { - $msg = dt("Command '!command' failed.", array('!command' => $cmd['command'])); - drush_notify_send(drush_notify_command_message($cmd['command'] . ':error', $msg)); - } - } -} - -/** - * Determine the message to send on command completion. - * - * @param string $command - * Name of the Drush command for which we check message overrides. - * @param string $default - * (Default: NULL) Default message to use if there are not notification message overrides. - * - * @return string - * Message to use for notification. - */ -function drush_notify_command_message($command, $default = NULL) { - if ($msg = drush_command_invoke_all('drush_help', 'notify:' . $command)) { - $msg = implode("\n", $msg); - } - else { - $msg = $default ? $default : $msg = $command . ': No news is good news.'; - } - - return $msg; -} - -/** - * Prepares and dispatches notifications to delivery mechanisms. - * - * You may avoid routing a message to secondary messaging mechanisms (e.g. audio), - * by direct use of the delivery functions. - * - * @param string $msg - * Message to send via notification. - */ -function drush_notify_send($msg) { - drush_notify_send_text($msg); - if (drush_get_option('notify-audio', FALSE)) { - drush_notify_send_audio($msg); - } -} - -/** - * Send text-based system notification. - * - * This is the automatic, default behavior. It is intended for use with tools - * such as libnotify in Linux and Notification Center on OSX. - * - * @param string $msg - * Message text for delivery. - * - * @return bool - * TRUE on success, FALSE on failure - */ -function drush_notify_send_text($msg) { - $override = drush_get_option('notify-cmd', FALSE); - - if (!empty($override)) { - $cmd = $override; - } - else { - switch (PHP_OS) { - case 'Darwin': - $cmd = 'terminal-notifier -message %s -title Drush'; - $error_message = dt('terminal-notifier command failed. Please install it from https://github.com/alloy/terminal-notifier.'); - break; - case 'Linux': - default: - $icon = drush_normalize_path(DRUSH_BASE_PATH . '/drush_logo-black.png'); - $cmd = "notify-send %s -i $icon"; - $error_message = dt('notify-send command failed. Please install it as per http://coderstalk.blogspot.com/2010/02/how-to-install-notify-send-in-ubuntu.html.'); - break; - } - } - - if (!drush_shell_exec($cmd, $msg)) { - return drush_set_error('NOTIFY_COMMAND_NOT_FOUND', $error_message . ' ' . dt('Or you may specify an alternate command to run by specifying --notify-cmd=<my_command>')); - } - - return TRUE; -} - -/** - * Send an audio-based system notification. - * - * This function is only automatically invoked with the additional use of the - * --notify-audio flag or configuration state. - * - * @param $msg - * Message for audio recital. - * - * @return bool - * TRUE on success, FALSE on failure - */ -function drush_notify_send_audio($msg) { - $override = drush_get_option('notify-cmd-audio', FALSE); - - if (!empty($override)) { - $cmd = $override; - } - else { - switch (PHP_OS) { - case 'Darwin': - $cmd = 'say %s'; - break; - case 'Linux': - default: - $cmd = drush_get_option('notify-cmd-audio', 'spd-say') . ' %s'; - } - } - - if (!drush_shell_exec($cmd, $msg)) { - return drush_set_error('NOTIFY_COMMAND_NOT_FOUND', dt('The third party notification utility failed.')); - } -} - -/** - * Identify if the given Drush request should trigger a notification. - * - * @param $command - * Name of the command. - * - * @return - * Boolean - */ -function drush_notify_allowed($command) { - $notify = drush_get_option(array('notify', 'notify-audio'), FALSE); - $execution = time() - $_SERVER['REQUEST_TIME']; - - return ($notify === TRUE || - (is_numeric($notify) && $notify > 0 && $execution > $notify)); -} - diff --git a/vendor/drush/drush/commands/core/outputformat.drush.inc b/vendor/drush/drush/commands/core/outputformat.drush.inc deleted file mode 100644 index 7cc84e93df6e5d167eba36224263742d8999f0d5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat.drush.inc +++ /dev/null @@ -1,475 +0,0 @@ -<?php - -/** - * @file - * Core drush output formats. - */ - -/** - * @return drush_outputformat The selected output format engine - */ -function drush_get_outputformat() { - return drush_get_engine('outputformat'); -} - -/** - * Dynamically switch to a new output format. Does NOT override - * user-selected output format. - */ -function drush_set_default_outputformat($format, $metadata = array()) { - $command = drush_get_command(); - $command['engines']['outputformat']['default'] = $format; - $outputformat = drush_load_command_engine($command, 'outputformat', $metadata); -} - -/** - * Given a command name or a command record, return the - * command formatter that is used to process that command's output. - */ -function drush_get_command_format_metadata($command, $metadata = array()) { - $commands = drush_get_commands(); - if (!is_array($command) && array_key_exists($command, $commands)) { - $command = $commands[$command]; - } - return drush_get_command_engine_config($command, 'outputformat', $metadata); -} - -/** - * Implementation of hook_drush_engine_type_info(). - */ -function outputformat_drush_engine_type_info() { - $info = array(); - $info['outputformat'] = array( - 'description' => 'Output formatting options selection and use.', - 'topic' => 'docs-output-formats', - 'topic-file' => 'docs/output-formats.md', - 'combine-help' => TRUE, - 'option' => 'format', - 'options' => array( - 'format' => array( - 'description' => 'Select output format.', - 'example-value' => 'json', - ), - 'fields' => array( - 'description' => 'Fields to output.', - 'example-value' => 'field1,field2', - 'value' => 'required', - 'list' => TRUE, - ), - 'list-separator' => array( - 'description' => 'Specify how elements in a list should be separated. In lists of lists, this applies to the elements in the inner lists.', - 'hidden' => TRUE, - ), - 'line-separator' => array( - 'description' => 'In nested lists of lists, specify how the outer lists ("lines") should be separated.', - 'hidden' => TRUE, - ), - 'field-labels' => array( - 'description' => 'Add field labels before first line of data. Default is on; use --no-field-labels to disable.', - 'default' => '1', - 'key' => 'include-field-labels', - ), - ), - // Allow output formats to declare their - // "output data type" instead of their - // "required engine capability" for readability. - 'config-aliases' => array( - 'output-data-type' => 'require-engine-capability', - ), - ); - return $info; -} - -/** - * Implements hook_drush_engine_ENGINE_TYPE(). - * - * The output format types supported are represented by - * the 'engine-capabilities' of the output format engine. - * The different capabilities include: - * - * format-single: A simple string. - * - * format-list: An associative array where the key - * is usually the row label, and the value - * is a simple string. Some list formatters - * render the label, and others (like - * "list" and "csv") throw it away. - * - * format-table: An associative array, where the key - * is the row id, and the value is the - * column data. The column data is also - * an associative array where the key - * is the column id and the value is the - * cell data. The cell data should usually - * be a simple string; however, some - * formatters can recursively format their - * cell contents before rendering (e.g. if - * a cell contains a list of items in an array). - * - * These definitions align with the declared 'output-data-type' - * declared in command records. @see drush_parse_command(). - * - * Any output format that does not declare any engine capabilities - * is expected to be able to render any php data structure that is - * passed to it. - */ -function outputformat_drush_engine_outputformat() { - $common_topic_example = array( - "a" => array("b" => 2, "c" => 3), - "d" => array("e" => 5, "f" => 6) - ); - - $engines = array(); - $engines['table'] = array( - 'description' => 'A formatted, word-wrapped table.', - 'engine-capabilities' => array('format-table'), - ); - $engines['key-value'] = array( - 'description' => 'A formatted list of key-value pairs.', - 'engine-capabilities' => array('format-single', 'format-list', 'format-table'), - 'hidden' => TRUE, - ); - $engines['key-value-list'] = array( - 'implemented-by' => 'list', - 'list-item-type' => 'key-value', - 'description' => 'A list of formatted lists of key-value pairs.', - 'list-field-selection-control' => 1, - 'engine-capabilities' => array('format-table'), - 'hidden' => TRUE, - ); - $engines['json'] = array( - 'machine-parsable' => TRUE, - 'description' => 'Javascript Object Notation.', - 'topic-example' => $common_topic_example, - ); - $engines['string'] = array( - 'machine-parsable' => TRUE, - 'description' => 'A simple string.', - 'engine-capabilities' => array('format-single'), - ); - $engines['message'] = array( - 'machine-parsable' => FALSE, // depends on the label.... - 'hidden' => TRUE, - ); - $engines['print-r'] = array( - 'machine-parsable' => TRUE, - 'description' => 'Output via php print_r function.', - 'verbose-only' => TRUE, - 'topic-example' => $common_topic_example, - ); - $engines['var_export'] = array( - 'machine-parsable' => TRUE, - 'description' => 'An array in executable php format.', - 'topic-example' => $common_topic_example, - ); - $engines['yaml'] = array( - 'machine-parsable' => TRUE, - 'description' => 'Yaml output format.', - 'topic-example' => $common_topic_example, - ); - $engines['php'] = array( - 'machine-parsable' => TRUE, - 'description' => 'A serialized php string.', - 'verbose-only' => TRUE, - 'topic-example' => $common_topic_example, - ); - $engines['config'] = array( - 'machine-parsable' => TRUE, - 'implemented-by' => 'list', - 'list-item-type' => 'var_export', - 'description' => "A configuration file in executable php format. The variable name is \"config\", and the variable keys are taken from the output data array's keys.", - 'metadata' => array( - 'variable-name' => 'config', - ), - 'list-field-selection-control' => -1, - 'engine-capabilities' => array('format-list','format-table'), - 'verbose-only' => TRUE, - ); - $engines['list'] = array( - 'machine-parsable' => TRUE, - 'list-item-type' => 'string', - 'description' => 'A simple list of values.', - // When a table is printed as a list, only the array keys of the rows will print. - 'engine-capabilities' => array('format-list', 'format-table'), - 'topic-example' => array('a', 'b', 'c'), - ); - $engines['nested-csv'] = array( - 'machine-parsable' => TRUE, - 'implemented-by' => 'list', - 'list-separator' => ',', - 'list-item-type' => 'csv-or-string', - 'hidden' => TRUE, - ); - $engines['csv-or-string'] = array( - 'machine-parsable' => TRUE, - 'hidden' => TRUE, - ); - $engines['csv'] = array( - 'machine-parsable' => TRUE, - 'implemented-by' => 'list', - 'list-item-type' => 'nested-csv', - 'labeled-list' => TRUE, - 'description' => 'A list of values, one per row, each of which is a comma-separated list of values.', - 'engine-capabilities' => array('format-table'), - 'topic-example' => array(array('a', 12, 'a@one.com'),array('b', 17, 'b@two.com')), - ); - $engines['variables'] = array( - 'machine-parsable' => TRUE, - 'description' => 'A list of php variable assignments.', - 'engine-capabilities' => array('format-table'), - 'verbose-only' => TRUE, - 'list-field-selection-control' => -1, - 'topic-example' => $common_topic_example, - ); - $engines['labeled-export'] = array( - 'machine-parsable' => TRUE, - 'description' => 'A list of php exports, labeled with a name.', - 'engine-capabilities' => array('format-table'), - 'verbose-only' => TRUE, - 'implemented-by' => 'list', - 'list-item-type' => 'var_export', - 'metadata' => array( - 'label-template' => '!label: !value', - ), - 'list-field-selection-control' => -1, - 'topic-example' => $common_topic_example, - ); - $engines['html'] = array( - 'machine-parsable' => FALSE, - 'description' => 'An HTML representation', - 'engine-capabilities' => array('format-table'), - ); - return $engines; -} - -/** - * Implements hook_drush_command_alter - */ -function outputformat_drush_command_alter(&$command) { - // In --pipe mode, change the default format to the default pipe format, or - // to json, if no default pipe format is given. - if (drush_get_context('DRUSH_PIPE') && (isset($command['engines']['outputformat']))) { - $default_format = isset($command['engines']['outputformat']['pipe-format']) ? $command['engines']['outputformat']['pipe-format'] : 'json'; - $command['engines']['outputformat']['default'] = $default_format; - } -} - -/** - * Implements hook_drush_help_alter(). - */ -function outputformat_drush_help_alter(&$command) { - if (isset($command['engines']['outputformat'])) { - $outputformat = $command['engines']['outputformat']; - // If the command defines specific field labels, - // then modify the help for --fields to include - // specific information about the available fields. - if (isset($outputformat['field-labels'])) { - $all_fields = array(); - $all_fields_description = array(); - foreach ($outputformat['field-labels'] as $field => $human_readable) { - $all_fields[] = $field; - if ((strtolower($field) != strtolower($human_readable)) && !array_key_exists(strtolower($human_readable), $outputformat['field-labels'])) { - $all_fields_description[] = $field . dt(" (or '!other')", array('!other' => strtolower($human_readable))); - } - else { - $all_fields_description[] = $field; - } - } - $field_defaults = isset($outputformat['fields-default']) ? $outputformat['fields-default'] : $all_fields; - $command['options']['fields']['example-value'] = implode(', ', $field_defaults); - $command['options']['fields']['description'] .= ' '. dt('All available fields are: !fields.', array('!fields' => implode(', ', $all_fields_description))); - if (isset($outputformat['fields-default'])) { - $command['options']['full']['description'] = dt("Show the full output, with all fields included."); - } - } - else { - // If the command does not define specific field labels, - // then hide the help for --fields unless the command - // uses output format engines that format tables. - if (isset($outputformat['require-engine-capability']) && is_array($outputformat['require-engine-capability'])) { - if (!in_array('format-table', $outputformat['require-engine-capability'])) { - unset($command['options']['fields']); - unset($command['options']['field-labels']); - } - } - // If the command does define output formats, but does not - // define fields, then just hide the help for the --fields option. - else { - $command['options']['fields']['hidden'] = TRUE; - $command['options']['field-labels']['hidden'] = TRUE; - } - } - - // If the command defines a default pipe format, then - // add '--pipe Equivalent to --format=<pipe-default>'. - if (isset($outputformat['pipe-format'])) { - if (isset($command['options']['pipe'])) { - $command['options']['pipe'] .= ' '; - } - else { - $command['options']['pipe'] = ''; - } - if (isset($outputformat['pipe-metadata']['message-template'])) { - $command['options']['pipe'] .= dt('Displays output in the form "!message"', array('!message' => $outputformat['pipe-metadata']['message-template'])); - } - else { - $command['options']['pipe'] .= dt("Equivalent to --format=!default.", array('!default' => $outputformat['pipe-format'])); - } - } - } -} - -/** - * Implements hook_drush_engine_topic_additional_text(). - */ -function outputformat_drush_engine_topic_additional_text($engine, $instance, $config) { - $result = array(); - - // If the output format engine has a 'topic-example' in - // its configuration, then format the provided array using - // the output formatter, and insert the result of the - // transform into the topic text. - if ($engine == 'outputformat') { - if (array_key_exists('topic-example', $config)) { - $code = $config['topic-example']; - $formatted = drush_format($code, array(), $instance); - $result[] = dt("Code:\n\nreturn !code;\n\nOutput with --format=!instance:\n\n!formatted", array('!code' => var_export($code, TRUE), '!instance' => $instance, '!formatted' => $formatted)); - } - } - - return $result; -} - -/** - * Interface for output format engines. - */ -class drush_outputformat { - function __construct($config) { - $config += array( - 'column-widths' => array(), - 'field-mappings' => array(), - 'engine-info' => array(), - ); - $config['engine-info'] += array( - 'machine-parsable' => FALSE, - 'metadata' => array(), - ); - $config += $config['engine-info']['metadata']; - $this->engine_config = $config; - } - function format_error($message) { - return drush_set_error('DRUSH_FORMAT_ERROR', dt("The output data could not be processed by the selected format '!type'. !message", array('!type' => $this->engine, '!message' => $message))); - } - function formatter_type() { - return $this->engine; - } - function is_list() { - return FALSE; - } - function formatter_is_simple_list() { - if (!isset($this->sub_engine)) { - return false; - } - return ($this->formatter_type() == 'list') && ($this->sub_engine->supports_single_only()); - } - function data_type($metadata) { - if (isset($metadata['metameta']['require-engine-capability']) && is_array($metadata['metameta']['require-engine-capability'])) { - return $metadata['metameta']['require-engine-capability'][0]; - } - if (isset($metadata['require-engine-capability']) && is_array($metadata['require-engine-capability'])) { - return $metadata['require-engine-capability'][0]; - } - return 'unspecified'; - } - function supported_data_types($metadata = NULL) { - if ($metadata == NULL) { - $metadata = $this->engine_config; - } - if (isset($metadata['metameta']['engine-info']['engine-capabilities'])) { - return $metadata['metameta']['engine-info']['engine-capabilities']; - } - if (isset($metadata['engine-info']['engine-capabilities'])) { - return $metadata['engine-info']['engine-capabilities']; - } - return array(); - } - function supports_single_only($metadata = NULL) { - $supported = $this->supported_data_types($metadata); - return (count($supported) == 1) && ($supported[0] == 'format-single'); - } - function get_info($key) { - if (array_key_exists($key, $this->engine_config)) { - return $this->engine_config[$key]; - } - elseif (isset($this->sub_engine)) { - return $this->sub_engine->get_info($key); - } - return FALSE; - } - /** - * Perform pre-processing and then format() the $input. - */ - function process($input, $metadata = array()) { - $metadata = array_merge_recursive($metadata, $this->engine_config); - if (isset($metadata['private-fields']) && is_array($input)) { - if (!drush_get_option('show-passwords', FALSE)) { - if (!is_array($metadata['private-fields'])) { - $metadata['private-fields'] = array($metadata['private-fields']); - } - foreach ($metadata['private-fields'] as $private) { - drush_unset_recursive($input, $private); - } - } - } - if (isset($metadata[$this->engine . '-metadata'])) { - $engine_specific_metadata = $metadata[$this->engine . '-metadata']; - unset($metadata[$this->engine . '-metadata']); - $metadata = array_merge($metadata, $engine_specific_metadata); - } - if ((drush_get_context('DRUSH_PIPE')) && (isset($metadata['pipe-metadata']))) { - $pipe_specific_metadata = $metadata['pipe-metadata']; - unset($metadata['pipe-metadata']); - $metadata = array_merge($metadata, $pipe_specific_metadata); - } - $machine_parsable = $this->engine_config['engine-info']['machine-parsable']; - $formatter_type = $machine_parsable ? 'parsable' : 'formatted'; - if ((!$machine_parsable) && is_bool($input)) { - $input = $input ? 'TRUE' : 'FALSE'; - } - - // Run $input through any filters that are specified for this formatter. - if (isset($metadata[$formatter_type . '-filter'])) { - $filters = $metadata[$formatter_type . '-filter']; - if (!is_array($filters)) { - $filters = array($filters); - } - foreach ($filters as $filter) { - if (function_exists($filter)) { - $input = $filter($input, $metadata); - } - } - } - if (isset($metadata['field-labels'])) { - foreach (drush_hide_output_fields() as $hidden_field) { - unset($metadata['field-labels'][$hidden_field]); - } - } - return $this->format($input, $metadata); - } - function format($input, $metadata) { - return $input; - } -} - -/** - * Specify that certain fields should not appear in the resulting output. - */ -function drush_hide_output_fields($fields_to_hide = array()) { - $already_hidden = drush_get_context('DRUSH_HIDDEN_OUTPUT_FIELDS'); - if (!is_array($fields_to_hide)) { - $fields_to_hide = array($fields_to_hide); - } - $result = array_merge($already_hidden, $fields_to_hide); - drush_set_context('DRUSH_HIDDEN_OUTPUT_FIELDS', $result); - return $result; -} diff --git a/vendor/drush/drush/commands/core/outputformat/csv_or_string.inc b/vendor/drush/drush/commands/core/outputformat/csv_or_string.inc deleted file mode 100644 index ad3b992de821a542eecc5556f88f7df8c7eddb08..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/csv_or_string.inc +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * Output formatter 'csv-or-string' - * - * @param $data - * The render data may be either a string or an array - * - string: printed as-is, without quotes. - * - array: the value is printed as a csv list. - * - * This is a helper format for handling nested csv lists. - */ -class drush_outputformat_csv_or_string extends drush_outputformat { - function format($data, $metadata) { - // If the data is an array, print it as a comma-separated list - if (is_array($data)) { - return drush_format($data, $metadata, 'csv'); - } - return (string)$data; - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/html.inc b/vendor/drush/drush/commands/core/outputformat/html.inc deleted file mode 100644 index 215f27ccc888355a984665ae5b880a44d2ebaf8a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/html.inc +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** -* Output formatter 'html' -* -* @param $data -* -* @param $metadata -* '' - -* '' - -*/ -class drush_outputformat_html extends drush_outputformat { - function format($input, $metadata) { - $input = drush_help_visible($input); - $global_options_command = drush_global_options_command(TRUE); - $global_options_rows = drush_format_help_section($global_options_command, 'options'); - ob_start(); - require_once __DIR__ . '/html.tpl.php'; - $return = ob_get_clean(); - return $return; - } -} - diff --git a/vendor/drush/drush/commands/core/outputformat/html.tpl.php b/vendor/drush/drush/commands/core/outputformat/html.tpl.php deleted file mode 100644 index 44a4efcba50bd8bf593944e29e35ccffee7ecaaa..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/html.tpl.php +++ /dev/null @@ -1,29 +0,0 @@ -<html> -<head><title>Drush help</title><style>dt {font-size: 110%; font-weight: bold}</style></head> -<body> - <h3>Global Options (see `drush topic core-global-options` for the full list)</h3> - <table><?php - foreach ($global_options_rows as $key => $row) { - print '<tr>'; - foreach ($row as $value) { - print "<td>" . htmlspecialchars($value) . "</td>\n"; - } - print "</tr>\n"; - } ?> - </table> - <h3>Command list</h3> - <table><?php - foreach ($input as $key => $command) { - print " <tr><td><a href=\"#$key\">$key</a></td><td>" . $command['description'] . "</td></tr>\n"; - } ?> - </table> -<h3>Command detail</h3> -<dl><?php - foreach ($input as $key => $command) { - print "\n<a name=\"$key\"></a><dt>$key</dt><dd><pre>\n"; - drush_core_helpsingle($key); - print "</pre></dd>\n"; - } - ?> -</body> -</html> diff --git a/vendor/drush/drush/commands/core/outputformat/json.inc b/vendor/drush/drush/commands/core/outputformat/json.inc deleted file mode 100644 index 7132d97b0934f82160140ba641947246a43efef8..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/json.inc +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * Output formatter 'json' - * - * @param $data - * The $data parameter is converted to Javascript Object Notation - * @param $metadata - * Unused - * - * Code: - * - * return array( - * "a" => array("b" => 2, "c" => 3), - * "d" => array("e" => 5, "f" => 6) - * ); - * - * Output with --format=json: - * - * {"a":{"b":2,"c":3},"d":{"e":5,"f":6}} - */ -class drush_outputformat_json extends drush_outputformat { - function format($input, $metadata) { - return drush_json_encode($input); - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/key_value.inc b/vendor/drush/drush/commands/core/outputformat/key_value.inc deleted file mode 100644 index 5cc85eeedc0a2e39af2ff37e1090e6c7074624f7..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/key_value.inc +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -/** - * Output formatter 'key_value' - * - * @param $data - * The $data parameter contains an array of key / value pairs which - * are rendered as "key : value" in a formatted word-wrapped table - * with aligned columns. 'value' is expected to always be a simple string; - * if it is not, it is rendered with var_export. - * @param $metadata - * 'label' - If present, creates a section header "[label]" prior to the data - * 'separator' - If present, used instead of ', ' when impoding data values - * 'ini-item' - If present, selects a single item from any data value that is - * an array and uses it instead of imploding all values together. - * - * Code: - * - * return array( - * "b" => "Two B or ! Two B, that is the comparison", - * "c" => "I see that C has gone to Sea" - * ); - * - * Output with --format=key-value: - * - * b : Two B or ! Two B, - * that is the - * comparison - * c : I see that C has gone - * to Sea - * - * Code: - * - * return array( - * "a" => array( - * "b" => "Two B or ! Two B, that is the comparison", - * "c" => "I see that C has gone to Sea" - * ), - * "d" => array( - * "e" => "Elephants and electron microscopes", - * "f" => "My margin is too small" - * ) - * ); - * - * Output with --format=key-value-list: - * - * b : Two B or ! Two B, - * that is the - * comparison - * c : I see that C has gone - * to Sea - * - * e : Elephants and - * electron microscopes - * f : My margin is too - * small - */ -class drush_outputformat_key_value extends drush_outputformat { - function format($input, $metadata) { - if (!is_array($input)) { - if (isset($metadata['label'])) { - $input = array(dt($metadata['label']) => $input); - } - else { - return $this->format_error(dt('No label provided.')); - } - } - $kv_metadata = isset($metadata['table-metadata']) ? $metadata['table-metadata'] : array(); - if ((!isset($kv_metadata['key-value-item'])) && (isset($metadata['field-labels']))) { - $input = drush_select_output_fields($input, $metadata['field-labels'], $metadata['field-mappings']); - } - if (isset($metadata['include-field-labels'])) { - $kv_metadata['include-field-labels'] = $metadata['include-field-labels']; - } - $formatted_table = drush_key_value_to_array_table($input, $kv_metadata); - if ($formatted_table === FALSE) { - return FALSE; - } - return drush_format_table($formatted_table, FALSE, array()); - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/list.inc b/vendor/drush/drush/commands/core/outputformat/list.inc deleted file mode 100644 index 5d6bf4945e99580c1a787759cda7a66d59666dab..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/list.inc +++ /dev/null @@ -1,156 +0,0 @@ -<?php - -/** - * Output formatter 'list' - * - * @param $data - * The $data parameter is expected to be an array of key / value pairs. - * Each key / value pair is passed to some other output formatter for - * rendering; the key becomes the label, $metadata['label'], and the - * value becomes the $data for the sub-formatter. - * @param $metadata - * 'matches' - Specifies the exact kind of list to be rendered in an - * array of two elements. $matches[0] is the full name of the - * list format (e.g. 'string-list'), and $matches[1] is the type - * of the sub-formatter (e.g. 'string'). If not specified, 'string' - * is assumed. - * - * Code: - * - * return array('a', 'b', 'c'); - * - * Output with --format=list: (list of string): - * - * a - * b - * c - */ -class drush_outputformat_list extends drush_outputformat { - function is_list() { - return TRUE; - } - function validate() { - // Separate the 'list' and 'filter' metadata from everything - // else in $engine_config['engine-info'] - $list_metadata = array(); - foreach ($this->engine_config as $key => $value) { - if ((substr($key, 0, 4) == 'list') || (substr($key, -6) == 'filter') || (substr($key, 0, 5) == 'field') || ($key == 'options')) { - unset($this->engine_config[$key]); - $list_metadata[$key] = $value; - } - } - foreach ($this->engine_config['engine-info'] as $key => $value) { - if ((substr($key, 0, 4) == 'list') || (substr($key, -6) == 'filter')) { - unset($this->engine_config['engine-info'][$key]); - $list_metadata[$key] = $value; - } - } - $sub_formatter = isset($list_metadata['list-item-type']) ? $list_metadata['list-item-type'] : 'string'; - $this->sub_engine = drush_load_engine('outputformat', $sub_formatter, $this->engine_config); - if (!is_object($this->sub_engine)) { - return drush_set_error('DRUSH_INVALID_SUBFORMATTER', dt("The list output formatter could not load its subformatter: !sub", array('!sub' => $sub_formatter))); - } - $engine_info = $this->engine_config['engine-info']; - $this->engine_config = array( - 'engine-info' => array( - 'machine-parsable' => $this->sub_engine->engine_config['engine-info']['machine-parsable'], - ), - 'metameta' => $this->sub_engine->engine_config, - ) + $list_metadata; - return TRUE; - } - - function format($input, $metadata) { - $output = ''; - if (is_array($input)) { - // If this list is processing output from a command that produces table - // @todo - need different example below? - // output, but our subformatter only supports 'single' items (e.g. csv), - // then we will convert our data such that the output will be the keys - // of the table rows. - if (($this->data_type($metadata) == 'format-table') && ($this->supports_single_only($metadata)) && !isset($metadata['list-item'])) { - // If the user specified exactly one field with --fields, then - // use it to select the data column to use instead of the array key. - if (isset($metadata['field-labels']) && (count($metadata['field-labels']) == 1)) { - $first_label = key($metadata['field-labels']); - $input = drush_output_get_selected_field($input, $first_label); - } - else { - $input = array_keys($input); - } - } - $first = TRUE; - $field_selection_control = isset($metadata['list-field-selection-control']) ? $metadata['list-field-selection-control'] : 0; - $selected_output_fields = false; - if (empty($metadata['metameta'])) { - $metameta = $metadata; - unset($metameta['list-item']); - unset($metameta['list-item-default-value']); - } - else { - $metameta = $metadata['metameta']; - } - $list_separator_key = 'list-separator'; - if ($this->sub_engine->is_list()) { - $list_separator_key = 'line-separator'; - if (isset($metadata['list-separator'])) { - $metameta['list-separator'] = $metadata['list-separator']; - } - } - $separator = isset($metadata[$list_separator_key]) && !empty($metadata[$list_separator_key]) ? $metadata[$list_separator_key] : "\n"; - // @todo - bug? we iterate over a hard coded, single item array? - foreach (array('field-labels') as $key) { - if (isset($metadata[$key])) { - $metameta[$key] = $metadata[$key]; - } - } - - // Include field labels, if specified - if (!isset($metadata['list-item']) && isset($metadata['labeled-list']) && is_array($input) && isset($metadata['field-labels'])) { - if (isset($metadata['include-field-labels']) && $metadata['include-field-labels']) { - array_unshift($input, $metadata['field-labels']); - } - } - foreach ($input as $label => $data) { - // If this output formatter is set to print a single item from each - // element, select that item here. - if (isset($metadata['list-item'])) { - $data = isset($data[$metadata['list-item']]) ? $data[$metadata['list-item']] : $metadata['list-item-default-value']; - } - // If this formatter supports the --fields option, then filter and - // order the fields the user wants here. Note that we need to be - // careful about when we call drush_select_output_fields(); sometimes, - // there will be nested formatters of type 'list', and it would not - // do to select the output fields more than once. - // 'list-field-selection-control can be set to a positive number to - // cause output fields to be selected at a later point in the call chain. - elseif (is_array($data) && isset($metadata['field-labels'])) { - if (!$field_selection_control) { - $data = drush_select_output_fields($data, $metadata['field-labels'], $metadata['field-mappings']); - $selected_output_fields = true; - } - } - $metameta['label'] = $label; - if ($selected_output_fields) { - $metameta['list-field-selection-control'] = -1; - } - elseif ($field_selection_control) { - $metameta['list-field-selection-control'] = $field_selection_control - 1; - } - $formatted_item = $this->sub_engine->format($data, $metameta); - if ($formatted_item === FALSE) { - return FALSE; - } - if (!$first) { - $output .= $separator; - } - if (($separator != "\n") && !empty($separator) && (strpos($formatted_item, $separator) !== FALSE)) { - $formatted_item = drush_wrap_with_quotes($formatted_item); - } - $output .= $formatted_item; - $first = FALSE; - } - } - return $output; - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/message.inc b/vendor/drush/drush/commands/core/outputformat/message.inc deleted file mode 100644 index 725bcbe23714964b49a3174fd01f7b3bd449fb01..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/message.inc +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * Output formatter 'message' - * - * @param $data - * The parameters for the render data - * @param $metadata - * 'message-template' - Provides the template string to use with dt(). - * - * Code: - * - * return array('a' => 1, 'b' => 2); - * - * Given 'message-template' == 'The first is !a and the second is !b', - * output with --format=message: - * - * The first is 1 and the second is 2 - */ -class drush_outputformat_message extends drush_outputformat { - function format($data, $metadata) { - $result = ''; - if (isset($metadata['message-template'])) { - foreach ($data as $key => $value) { - $data_for_dt['!' . $key] = $value; - } - $result = dt($metadata['message-template'], $data_for_dt); - } - return $result; - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/php.inc b/vendor/drush/drush/commands/core/outputformat/php.inc deleted file mode 100644 index 056314f3a97f25f65815da91020438e24e836abc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/php.inc +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * Output formatter 'php' - * - * @param $data - * The $data parameter is rendered as a serialized php string - * @param $metadata - * - * Code: - * - */ -class drush_outputformat_php extends drush_outputformat { - function format($input, $metadata) { - return serialize($input); - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/print_r.inc b/vendor/drush/drush/commands/core/outputformat/print_r.inc deleted file mode 100644 index 4ee8b9f071cc624fbb880c5339bb79bce8468aa3..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/print_r.inc +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * Output formatter 'print-r' - * - * @param $data - * The $data parameter is rendered with the php print_r function - * @param $metadata - * 'label' - If present, prints "label: " prior to the data - * - * Code: - * - * return array( - * "a" => array("b" => 2, "c" => 3), - * "d" => array("e" => 5, "f" => 6) - * ); - * - * Output with --format=print-r: - * - * Array - * ( - * [a] => Array - * ( - * [b] => 2 - * [c] => 3 - * ) - * - * [d] => Array - * ( - * [e] => 5 - * [f] => 6 - * ) - * ) - */ -class drush_outputformat_print_r extends drush_outputformat { - function format($input, $metadata) { - if (is_string($input)) { - $output = '"' . $input . '"'; - } - elseif (is_array($input) || is_object($input)) { - $output = print_r($input, TRUE); - } - else { - $output = $input; - } - if (isset($metadata['label'])) { - $output = $metadata['label'] . ': ' . $output; - } - return $output; - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/string.inc b/vendor/drush/drush/commands/core/outputformat/string.inc deleted file mode 100644 index a86e7d172bab9718075dfca2cd80e24fdeb0bc44..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/string.inc +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * Output formatter 'string' - * - * @param $data - * The render data may be either a string or an array - * string - printed as-is, without quotes - * array - the value of the first item in the array is printed as-is - * @param $metadata - * 'label' - If present, prints "label: " prior to the data - * - * Code: - * - * return DRUSH_VERSION; - * - * Output with --format=string: - * - * 6.0-dev - */ -class drush_outputformat_string extends drush_outputformat { - function format($data, $metadata) { - // If the data is an array, print the value of the first item. - if (is_array($data)) { - if (count($data) > 1) { - return $this->format_error("Multiple rows provided where only one is allowed."); - } - if (!empty($data)) { - $data = reset($data); - } - if (is_array($data)) { - return $this->format_error("Array provided where a string is required."); - } - } - return (string)$data; - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/table.inc b/vendor/drush/drush/commands/core/outputformat/table.inc deleted file mode 100644 index 81a9cfa27bb3db3ee80169d24a115cda695cfbac..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/table.inc +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * Output formatter 'table' - * - * @param $data - * The $data parameter is expected to be an array (keys ignored) of - * rows; each row, in turn, is an array of key / value pairs. Every - * row is expected to have the same set of keys. The data is rendered - * as a formatted word-wrapped table with rows of data cells aligned in - * columns. - * @param $metadata - * 'field-labels' - If present, contains an array of key / value pairs - * that map from the keys in the row columns to the label for the - * column header. - * 'column-widths' - If present, contains an array of key / value pairs, - * where the key is the integer column number, and the value is the - * width that column should be formatted to. - * - * Code: - * - * return array( - * "a" => array("b" => 2, "c" => 3), - * "d" => array("b" => 5, "c" => 6) - * ); - * - * Output with --format=table: - * - * b c - * 2 3 - * 5 6 - */ -class drush_outputformat_table extends drush_outputformat { - function format($input, $metadata) { - $field_list = isset($metadata['field-labels']) ? $metadata['field-labels'] : array(); - $widths = array(); - $col = 0; - foreach($field_list as $key => $label) { - if (isset($metadata['column-widths'][$key])) { - $widths[$col] = $metadata['column-widths'][$key]; - } - ++$col; - } - $rows = drush_rows_of_key_value_to_array_table($input, $field_list, $metadata); - $field_labels = array_key_exists('include-field-labels', $metadata) && $metadata['include-field-labels']; - if (!$field_labels) { - array_shift($rows); - } - return drush_format_table($rows, $field_labels, $widths); - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/topics/table.html b/vendor/drush/drush/commands/core/outputformat/topics/table.html deleted file mode 100644 index acc149a45055759589098a1c6d723ecbd94e98c8..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/topics/table.html +++ /dev/null @@ -1,56 +0,0 @@ -The 'table' formatter will convert an associative array into a formatted, -word-wrapped table. Each item in the associative array represents one row -in the table. Each row is similarly composed of associative arrays, with -the key of each item indicating the column, and the value indicating the -contents of the cell. See below for an example source array. -<p> -The command core-requirements is an example of a command that produces output -in a tabular format. -<p> -<i>$ drush core-requirements</i> -<pre> - Title Severity Description - Cron maintenance Error Last run 2 weeks ago - tasks Cron has not run recently. For more - information, see the online handbook entry for - configuring cron jobs. You can run cron - manually. - Drupal Info 7.19 -</pre> -(Note: the output above has been shortened for clarity; the actual output -of core-requirements contains additional rows not shown here.) -<p> -It is possible to determine the available fields by consulting <i>drush -help core requirements</i>: -<pre> - --fields=<title, severity, description> Fields to output. All - available fields are: - title, severity, sid, - description, value, - reason, weight. -</pre> -It is possible to control the fields that appear in the table, and their -order, by naming the desired fields in the --fields option. The space -between items is optional, so `--fields=title,sid` is valid. -<p> -Code: -<pre> -return array ( - 'cron' => - array ( - 'title' => 'Cron maintenance tasks', - 'severity' => 2, - 'value' => 'Last run 2 weeks ago', - 'description' => 'Cron has not run recently. For more information, see the online handbook entry for <a href="http://drupal.org/cron">configuring cron jobs</a>. You can <a href="/admin/reports/status/run-cron">run cron manually</a>.', - 'severity-label' => 'Error', - ), - 'drupal' => - array ( - 'title' => 'Drupal', - 'value' => '7.19', - 'severity' => -1, - 'weight' => -10, - 'severity-label' => 'Info', - ), -) -</pre> diff --git a/vendor/drush/drush/commands/core/outputformat/var_export.inc b/vendor/drush/drush/commands/core/outputformat/var_export.inc deleted file mode 100644 index c82bb9684dcc68874c5c0ee706442edb6c36af7b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/var_export.inc +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/** - * Output formatter 'var_export' - * - * Note: this class is also used by format 'config' - * - * @param $data - * The $data parameter is rendered with the php var_export() function - * @param $metadata - * 'label' - If present, prints "$variable['label'] = " prior to the data - * 'variable-name' - If present, provides an alternate name for $variable - * when labels are in use. - * - * Code: - * - * return array( - * "a" => array("b" => 2, "c" => 3), - * "d" => array("e" => 5, "f" => 6) - * ); - * - * Output with --format=var_export: - * - * array ( - * 'a' => - * array ( - * 'b' => 2, - * 'c' => 3, - * ), - * 'd' => - * array ( - * 'e' => 5, - * 'f' => 6, - * ), - * ) - * - * Output with --format=config: (list of export) - * - * $config['a'] = array ( - * 'b' => 2, - * 'c' => 3, - * ); - * $config['d'] = array ( - * 'e' => 5, - * 'f' => 6, - * ); - */ -class drush_outputformat_var_export extends drush_outputformat { - function format($input, $metadata) { - if (isset($metadata['label'])) { - $variable_name = isset($metadata['variable-name']) ? $metadata['variable-name'] : 'variables'; - $variable_name = preg_replace("/[^a-zA-Z0-9_-]/", "", str_replace(' ', '_', $variable_name)); - $label = $metadata['label']; - $label_template = (isset($metadata['label-template'])) ? $metadata['label-template'] : '$!variable["!label"] = !value;'; - $output = dt($label_template, array('!variable' => $variable_name, '!label' => $label, '!value' => var_export($input, TRUE))); - } - else { - $output = drush_var_export($input); - } - return $output; - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/variables.inc b/vendor/drush/drush/commands/core/outputformat/variables.inc deleted file mode 100644 index 7220aab86c3dade86c49912a324cebda0a701531..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/variables.inc +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * Output formatter 'variables' - * - * @param $data - * The $data parameter is expected to be a nested array of key / value pairs. - * The top-level key becomes the variable name, $metadata['variable-name'], - * and the key on the inner-level items becomes the array label, - * $metadata['label']. These items are then rendered by the 'var_export' formatter. - * @param $metadata - * Unused. - * - * Code: - * - * return array( - * "a" => array("b" => 2, "c" => 3), - * "d" => array("e" => 5, "f" => 6) - * ); - * - * Output with --format=variables: - * - * $a['b'] = 2; - * $a['c'] = 3; - * $d['e'] = 5; - * $d['f'] = 6; - */ -class drush_outputformat_variables extends drush_outputformat { - function validate() { - $metadata = $this->engine_config; - $this->sub_engine = drush_load_engine('outputformat', 'var_export', $metadata); - if (!is_object($this->sub_engine)) { - return FALSE; - } - return TRUE; - } - - function format($data, $metadata) { - $output = ''; - if (is_array($data)) { - foreach ($data as $variable_name => $section) { - foreach ($section as $label => $value) { - $metameta = array( - 'variable-name' => $variable_name, - 'label' => $label, - ); - $formatted_item = $this->sub_engine->process($value, $metameta); - if ($formatted_item === FALSE) { - return FALSE; - } - $output .= $formatted_item; - $output .= "\n"; - } - } - } - return $output; - } -} diff --git a/vendor/drush/drush/commands/core/outputformat/yaml.inc b/vendor/drush/drush/commands/core/outputformat/yaml.inc deleted file mode 100644 index 6a33ac607623861984ad1b6b66bf9c868f9a1398..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/outputformat/yaml.inc +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -use Symfony\Component\Yaml\Dumper; - -/** - * Output formatter 'yaml' - * - * @param $data - * The $data parameter is rendered in yaml - * @param $metadata - * - * Code: - * - */ -class drush_outputformat_yaml extends drush_outputformat { - function format($input, $metadata) { - $dumper = new Dumper(); - // Set Yaml\Dumper's default indentation for nested nodes/collections to - // 2 spaces for consistency with Drupal coding standards. - $dumper->setIndentation(2); - // The level where you switch to inline YAML is set to PHP_INT_MAX to - // ensure this does not occur. - $output = $dumper->dump($input, PHP_INT_MAX, NULL, NULL, TRUE); - return $output; - } -} diff --git a/vendor/drush/drush/commands/core/queue.drush.inc b/vendor/drush/drush/commands/core/queue.drush.inc deleted file mode 100644 index 3dcae01526fd719cdd6e5f8267c79665feb5793f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/queue.drush.inc +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Implements hook_drush_help(). - */ -function queue_drush_help($section) { - switch ($section) { - case 'drush:queue-run': - return dt('Run Drupal queue workers. As opposed to "drush cron" that can only be run one at a time on a single site, "drush queue-run" can be invoked as many times as the server load allows.'); - } -} - -/** - * Implements hook_drush_command(). - */ -function queue_drush_command() { - $items['queue-run'] = array( - 'description' => 'Run a specific queue by name', - 'arguments' => array( - 'queue_name' => 'The name of the queue to run, as defined in either hook_queue_info or hook_cron_queue_info.', - ), - 'required-arguments' => TRUE, - 'options' => array( - 'time-limit' => 'The maximum number of seconds allowed to run the queue', - ), - 'aliases' => array('queue:run'), - ); - $items['queue-list'] = array( - 'description' => 'Returns a list of all defined queues', - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'csv', - 'field-labels' => array( - 'queue' => 'Queue', - 'items' => 'Items', - 'class' => 'Class', - ), - 'ini-item' => 'items', - 'table-metadata' => array( - 'key-value-item' => 'items', - ), - 'output-data-type' => 'format-table', - 'aliases' => array('queue:list'), - ), - ); - - return $items; -} - -/** - * Validation callback for drush queue-run. - */ -function drush_queue_run_validate($queue_name) { - try { - $queue = drush_queue_get_class(); - $queue->getInfo($queue_name); - } - catch (\Drush\Queue\QueueException $exception) { - return drush_set_error('DRUSH_QUEUE_RUN_VALIDATION_ERROR', $exception->getMessage()); - } -} - -/** - * Return the appropriate queue class. - */ -function drush_queue_get_class() { - return drush_get_class('Drush\Queue\Queue'); -} - -/** - * Command callback for drush queue-run. - * - * Queue runner that is compatible with queues declared using both - * hook_queue_info() and hook_cron_queue_info(). - * - * @param $queue_name - * Arbitrary string. The name of the queue to work with. - */ -function drush_queue_run($queue_name) { - $queue = drush_queue_get_class(); - $time_limit = (int) drush_get_option('time-limit'); - $start = microtime(TRUE); - $count = $queue->run($queue_name, $time_limit); - $elapsed = microtime(TRUE) - $start; - drush_log(dt('Processed @count items from the @name queue in @elapsed sec.', array('@count' => $count, '@name' => $queue_name, '@elapsed' => round($elapsed, 2))), drush_get_error() ? LogLevel::WARNING : LogLevel::OK); -} - -/** - * Command callback for drush queue-list. - */ -function drush_queue_list() { - $queue = drush_queue_get_class(); - return $queue->listQueues(); -} - diff --git a/vendor/drush/drush/commands/core/role.drush.inc b/vendor/drush/drush/commands/core/role.drush.inc deleted file mode 100644 index 8f6b71c0e1b19bce6c52cdbe58d9b21bc6dfec26..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/role.drush.inc +++ /dev/null @@ -1,314 +0,0 @@ -<?php - -use Drush\Log\LogLevel; -use Drush\Role\RoleBase; - -/** - * Implementation of hook_drush_help(). - */ -function role_drush_help($section) { - switch ($section) { - case 'meta:role:title': - return dt('Role commands'); - case 'meta:role:summary': - return dt('Interact with the role system.'); - } -} - -/** - * Implements hook_drush_help_alter(). - */ -function role_drush_help_alter(&$command) { - // Drupal 8+ has changed role names. - if (in_array($command['command'] , array('role-add-perm', 'role-add-perm', 'role-list')) && drush_drupal_major_version() >= 8) { - foreach ($command['examples'] as $key => $val) { - $newkey = str_replace(array('anonymous user', 'authenticated user'), array('anonymous', 'authenticated'), $key); - $command['examples'][$newkey] = $val; - unset($command['examples'][$key]); - } - } -} - -/** - * Implementation of hook_drush_command(). - */ -function role_drush_command() { - $items['role-create'] = array( - 'description' => 'Create a new role.', - 'examples' => array( - "drush role-create 'test role'" => "Create a new role 'test role' on D6 or D7; auto-assign the rid. On D8, 'test role' is the rid, and the human-readable name is set to 'Test role'.", - "drush role-create 'test role' 'Test role'" => "Create a new role with a machine name of 'test role', and a human-readable name of 'Test role'. On D6 and D7, behaves as the previous example." - ), - 'arguments' => array( - 'machine name' => 'The symbolic machine name for the role. Required.', - 'human-readable name' => 'A descriptive name for the role. Optional; Drupal 8 only. Ignored in D6 and D7.', - ), - 'aliases' => array('rcrt', 'role:create'), - ); - $items['role-delete'] = array( - 'description' => 'Delete a role.', - 'examples' => array( - "drush role-delete 'test role'" => "Delete the role 'test role'.", - ), - 'arguments' => array( - 'machine name' => 'The symbolic machine name for the role. Required. In D6 and D7, this may also be a numeric role ID.', - ), - 'aliases' => array('rdel', 'role:delete'), - ); - $items['role-add-perm'] = array( - 'description' => 'Grant specified permission(s) to a role.', - 'examples' => array( - "drush role-add-perm 'anonymous user' 'post comments'" => 'Allow anon users to post comments.', - "drush role-add-perm 'anonymous user' \"'post comments','access content'\"" => 'Allow anon users to post comments and access content.', - "drush role-add-perm 'authenticated user' --module=node" => 'Select a permission from "node" permissions to add to logged in users.' - ), - 'arguments' => array( - 'role' => 'The role to modify. Required.', - 'permissions' => 'The list of permission to grant, delimited by commas. Required, unless the --module option is used.', - ), - 'required-arguments' => 1, - 'options' => array( - 'module' => 'Select the permission to modify from an interactive list of all permissions available in the specified module.', - ), - 'global-options' => array( - 'cache-clear', - ), - 'aliases' => array('rap', 'role:add:perm'), - ); - - $items['role-remove-perm'] = array( - 'description' => 'Remove specified permission(s) from a role.', - 'examples' => array( - "drush role-remove-perm 'anonymous user' 'access content'" => 'Hide content from anon users.', - ), - 'arguments' => array( - 'role' => 'The role to modify.', - 'permissions' => 'The list of permission to grant, delimited by commas. Required, unless the --module option is used.', - ), - 'required-arguments' => 1, - 'options' => array( - 'module' => 'Select the permission to modify from an interactive list of all permissions available in the specified module.', - ), - 'global-options' => array( - 'cache-clear', - ), - 'aliases' => array('rmp', 'role:remove:perm'), - ); - - $items['role-list'] = array( - 'description' => 'Display a list of all roles defined on the system. If a role name is provided as an argument, then all of the permissions of that role will be listed. If a permission name is provided as an option, then all of the roles that have been granted that permission will be listed.', - 'examples' => array( - "drush role-list --filter='administer nodes'" => 'Display a list of roles that have the administer nodes permission assigned.', - "drush role-list 'anonymous user'" => 'Display all of the permissions assigned to the anon user role.' - ), - 'arguments' => array( - 'role' => 'The role to list. Optional; if specified, lists all permissions assigned to that role. If no role is specified, lists all of the roles available on the system.', - ), - 'options' => array( - 'filter' => 'Limits the list of roles to only those that have been assigned the specified permission. Optional; may not be specified if a role argument is provided.', - ), - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'list', - 'field-labels' => array('rid' => 'ID', 'label' => 'Role Label', 'perm' => "Permission"), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('rls', 'role:list'), - ); - - return $items; -} - -/** - * Create the specified role - */ -function drush_role_create($rid, $role_name = '') { - $role = drush_role_get_class(); - $result = $role->role_create($rid, $role_name); - if ($result !== FALSE) { - drush_log(dt('Created "!role"', array('!role' => $rid)), LogLevel::SUCCESS); - } - return $result; -} - -/** - * Create the specified role - */ -function drush_role_delete($rid) { - $role = drush_role_get_class($rid); - if ($role === FALSE) { - return FALSE; - } - $result = $role->delete(); - if ($result !== FALSE) { - drush_log(dt('Deleted "!role"', array('!role' => $rid)), LogLevel::SUCCESS); - } - return $result; -} - -/** - * Add one or more permission(s) to the specified role. - * - * @param string $rid machine name for a role - * @param null|string $permissions machine names, delimited by commas. - * - * @return bool - */ -function drush_role_add_perm($rid, $permissions = NULL) { - if (is_null($permissions)) { - // Assume --module is used thus inject a FALSE - $perms = array(FALSE); - } - else { - $perms = _convert_csv_to_array($permissions); - } - - $added_perm = FALSE; - - foreach($perms as $perm) { - $result = drush_role_perm('add', $rid, $perm); - if ($result !== FALSE) { - $added_perm = TRUE; - drush_log(dt('Added "!perm" to "!role"', array('!perm' => $perm, '!role' => $result->name)), LogLevel::SUCCESS); - } - } - - if ($added_perm) { - drush_drupal_cache_clear_all(); - } - - return $result; -} - -/** - * Remove permission(s) from the specified role. - * - * @param string $rid machine name for a role - * @param null|string $permissions machine names, delimited by commas. - * - * @return bool - */ -function drush_role_remove_perm($rid, $permissions = NULL) { - if (is_null($permissions)) { - // Assume --module is used thus inject a FALSE - $perms = array(FALSE); - } - else { - $perms = _convert_csv_to_array($permissions); - } - - $removed_perm = FALSE; - - foreach($perms as $perm) { - $result = drush_role_perm('remove', $rid, $perm); - if ($result !== FALSE) { - $removed_perm = TRUE; - drush_log(dt('Removed "!perm" from "!role"', array('!perm' => $perm, '!role' => $result->name)), LogLevel::OK); - } - } - - if ($removed_perm) { - drush_drupal_cache_clear_all(); - } - - return $result; -} - -/** - * Implement permission add / remove operations. - * - * @param string $action 'add' | 'remove' - * @param string $rid - * @param string|null $permission - * - * @return bool|RoleBase - * - * @see drush_set_error() - */ -function drush_role_perm($action, $rid, $permission = NULL) { - $role = drush_role_get_class($rid); - if (!$role) { - return FALSE; - } - - // If a permission wasn't provided, but the module option is specified, - // provide a list of permissions provided by that module. - if (!$permission && $module = drush_get_option('module', FALSE)) { - drush_include_engine('drupal', 'environment'); - if (!drush_module_exists($module)) { - return drush_set_error('DRUSH_ROLE_ERROR', dt('!module not enabled!', array('!module' => $module))); - } - $module_perms = $role->getModulePerms($module); - if (empty($module_perms)) { - return drush_set_error('DRUSH_ROLE_NO_PERMISSIONS', dt('No permissions found for module !module', array('!module' => $module))); - } - $choice = drush_choice($module_perms, "Enter a number to choose which permission to $action."); - if ($choice === FALSE) { - return drush_user_abort(); - } - $permission = $module_perms[$choice]; - } - else { - $permissions = $role->getAllModulePerms(); - if (!in_array($permission, $permissions)) { - return drush_set_error(dt('Could not find the permission: !perm', array('!perm' => $permission))); - } - } - - $result = $role->{$action}($permission); - if ($result === FALSE) { - return FALSE; - } - return $role; -} - -/** - * Get core version specific Role handler class. - * - * @param string $role_name - * @return RoleBase - * - * @see drush_get_class(). - */ -function drush_role_get_class($role_name = DRUPAL_ANONYMOUS_RID) { - return drush_get_class('Drush\Role\Role', func_get_args()); -} - -/** - * Displays a list of roles - */ -function drush_role_list($rid = '') { - $result = array(); - if (empty($rid)) { - drush_hide_output_fields(array('perm')); - // Get options passed. - $perm = drush_get_option('filter'); - $roles = array(); - - // Get all roles - if $perm is empty user_roles retrieves all roles. - $roles = user_roles(FALSE, $perm); - if (empty($roles)) { - return drush_set_error('DRUSH_NO_ROLES', dt("No roles found.")); - } - foreach ($roles as $rid => $value) { - $role = drush_role_get_class($rid); - $result[$role->name] = array( - 'rid' => $rid, - 'label' => $role->name, - ); - } - } - else { - drush_hide_output_fields(array('rid', 'label')); - $role = drush_role_get_class($rid); - if (!$role) { - return FALSE; - } - $perms = $role->getPerms(); - foreach ($perms as $permission) { - $result[$permission] = array( - 'perm' => $permission); - } - } - return $result; -} diff --git a/vendor/drush/drush/commands/core/rsync.core.inc b/vendor/drush/drush/commands/core/rsync.core.inc deleted file mode 100644 index 4bc9dbba37658c9065c49878bbc4c4d99bcb1503..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/rsync.core.inc +++ /dev/null @@ -1,294 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/* - * Implements COMMAND hook init. - */ -function drush_core_rsync_init() { - // Try to get @self defined when --uri was not provided. - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_SITE); -} - -/** - * A command callback. - * - * @param source - * A site alias ("@dev") or site specification ("/path/to/drupal#mysite.com") - * followed by an optional path (":path/to/sync"), or any path - * that could be passed to rsync ("user@server.com:/path/to/dir/"). - * @param destination - * Same format as source. - * @param additional_options - * An array of options that overrides whatever was passed in on - * the command line (like the 'process' context, but only for - * the scope of this one call). - */ -function drush_core_rsync($source, $destination, $additional_options = array()) { - // Preflight source in case it defines aliases used by the destination - _drush_sitealias_preflight_path($source); - // After preflight, evaluate file paths. We evaluate destination paths first, because - // there is a first-one-wins policy with --exclude-paths, and we want --target-command-specific - // to take precedence over --source-command-specific. - $destination_settings = drush_sitealias_evaluate_path($destination, $additional_options, FALSE, "rsync", 'target-'); - $source_settings = drush_sitealias_evaluate_path($source, $additional_options, FALSE, "rsync", 'source-'); - $source_path = $source_settings['evaluated-path']; - $destination_path = $destination_settings['evaluated-path']; - - if (!isset($source_settings)) { - return drush_set_error('DRUSH_BAD_PATH', dt('Could not evaluate source path !path.', array('!path' => $source))); - } - if (!isset($destination_settings)) { - return drush_set_error('DRUSH_BAD_PATH', dt('Could not evaluate destination path !path.', array('!path' => $destination))); - } - - // If the user path is the same for the source and the destination, then - // always add a slash to the end of the source. If the user path is not - // the same in the source and the destination, then you need to know how - // rsync paths work, and put on the trailing '/' if you want it. - if ($source_settings['user-path'] == $destination_settings['user-path']) { - $source_path .= '/'; - } - // Prompt for confirmation. This is destructive. - if (!drush_get_context('DRUSH_SIMULATE')) { - drush_print(dt("You will delete files in !target and replace with data from !source", array('!source' => $source_path, '!target' => $destination_path))); - if (!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - } - - // Next, check to see if both the source and the destination are remote. - // If so, then we'll process this as an rsync from source to local, - // followed by an rsync from local to the destination. - if (drush_sitealias_is_remote_site($source_settings) && drush_sitealias_is_remote_site($destination_settings)) { - return _drush_core_rsync_both_remote($source, $destination, $additional_options, $source_path); - } - - // Exclude settings is the default only when both the source and - // the destination are aliases or site names. Therefore, include - // settings will be the default whenever either the source or the - // destination contains a : or a /. - $include_settings_is_default = (strpos($source . $destination, ':') !== FALSE) || (strpos($source . $destination, '/') !== FALSE); - - $options = _drush_build_rsync_options($additional_options, $include_settings_is_default); - - // Get all of the args and options that appear after the command name. - $original_args = drush_get_original_cli_args_and_options(); - foreach ($original_args as $original_option) { - if ($original_option{0} == '-') { - $options .= ' ' . $original_option; - } - } - - drush_backend_set_result($destination_path); - // Go ahead and call rsync with the paths we determined - return drush_core_exec_rsync($source_path, $destination_path, $options); -} - -/** - * Make a direct call to rsync after the source and destination paths - * have been evaluated. - * - * @param $source - * Any path that can be passed to rsync. - * @param $destination - * Any path that can be passed to rsync. - * @param $additional_options - * An array of options that overrides whatever was passed in on the command - * line (like the 'process' context, but only for the scope of this one - * call). - * @param $include_settings_is_default - * If TRUE, then settings.php will be transferred as part of the rsync unless - * --exclude-conf is specified. If FALSE, then settings.php will be excluded - * from the transfer unless --include-conf is specified. - * @param $live_output - * If TRUE, output goes directly to the terminal using system(). If FALSE, - * rsync is executed with drush_shell_exec() with output in - * drush_shell_exec_output(). - * - * @return - * TRUE on success, FALSE on failure. - */ -function drush_core_call_rsync($source, $destination, $additional_options = array(), $include_settings_is_default = TRUE, $live_output = TRUE) { - $options = _drush_build_rsync_options($additional_options, $include_settings_is_default); - return drush_core_exec_rsync($source, $destination, $options, $additional_options, $live_output); -} - -function drush_core_exec_rsync($source, $destination, $options, $additional_options = array(), $live_output = TRUE) { - $ssh_options = drush_get_option_override($additional_options, 'ssh-options', ''); - $exec = "rsync -e 'ssh $ssh_options' $options $source $destination"; - - if ($live_output) { - $exec_result = drush_op_system($exec); - $result = ($exec_result == 0); - } - else { - $result = drush_shell_exec($exec); - } - - if (!$result) { - drush_set_error('DRUSH_RSYNC_FAILED', dt("Could not rsync from !source to !dest", array('!source' => $source, '!dest' => $destination))); - } - - return $result; -} - -function _drush_build_rsync_options($additional_options, $include_settings_is_default = TRUE) { - $options = ''; - // Exclude vcs reserved files. - if (!_drush_rsync_option_exists('include-vcs', $additional_options)) { - $vcs_files = drush_version_control_reserved_files(); - foreach ($vcs_files as $file) { - $options .= ' --exclude="'.$file.'"'; - } - } - else { - unset($additional_options['include-vcs']); - } - - $mode = '-akz'; - // Process --include-paths and --exclude-paths options the same way - foreach (array('include', 'exclude') as $include_exclude) { - // Get the option --include-paths or --exclude-paths and explode to an array of paths - // that we will translate into an --include or --exclude option to pass to rsync - $inc_ex_path = explode(PATH_SEPARATOR, drush_get_option($include_exclude . '-paths', '')); - foreach ($inc_ex_path as $one_path_to_inc_ex) { - if (!empty($one_path_to_inc_ex)) { - $options .= ' --' . $include_exclude . '="' . $one_path_to_inc_ex . '"'; - } - } - // Remove stuff inserted by evaluate path - unset($additional_options[$include_exclude . '-paths']); - unset($additional_options[$include_exclude . '-files-processed']); - } - // drush_core_rsync passes in $include_settings_is_default such that - // 'exclude-conf' is the default when syncing from one alias to - // another, and 'include-conf' is the default when a path component - // is included. - if ($include_settings_is_default ? _drush_rsync_option_exists('exclude-conf', $additional_options) : !_drush_rsync_option_exists('include-conf', $additional_options)) { - $options .= ' --exclude="settings.php"'; - unset($additional_options['exclude-conf']); - } - if (_drush_rsync_option_exists('exclude-sites', $additional_options)) { - $options .= ' --include="sites/all" --exclude="sites/*"'; - unset($additional_options['exclude-sites']); - } - if (_drush_rsync_option_exists('mode', $additional_options)) { - $mode = "-" . drush_get_option_override($additional_options, 'mode'); - unset($additional_options['mode']); - } - if (drush_get_context('DRUSH_VERBOSE')) { - // the drush_op() will be verbose about the command that gets executed. - $mode .= 'v'; - $options .= ' --stats --progress'; - } - - // Check if the user has set $options['rsync-version'] to enable rsync legacy version support. - // Drush was written for rsync 2.6.9 or later, so assume that version if nothing was explicitly set. - $rsync_version = drush_get_option(array('rsync-version','source-rsync-version','target-rsync-version'), '2.6.9'); - $options_to_exclude = array('ssh-options'); - foreach ($additional_options as $test_option => $value) { - // Downgrade some options for older versions of rsync - if ($test_option == 'remove-source-files') { - if (version_compare($rsync_version, '2.6.4', '<')) { - $test_option = NULL; - drush_log('Rsync does not support --remove-sent-files prior to version 2.6.4; some temporary files may remain undeleted.', LogLevel::WARNING); - } - elseif (version_compare($rsync_version, '2.6.9', '<')) { - $test_option = 'remove-sent-files'; - } - } - if ((isset($test_option)) && !in_array($test_option, $options_to_exclude) && (isset($value) && !is_array($value))) { - if (($value === TRUE) || (!isset($value))) { - $options .= " --$test_option"; - } - else { - $options .= " --$test_option=" . escapeshellarg($value); - } - } - } - - return $mode . $options; -} - -function _drush_rsync_option_exists($option, $additional_options) { - if (array_key_exists($option, $additional_options)) { - return TRUE; - } - else { - return drush_get_option($option, FALSE); - } -} - -/** - * Handle an rsync operation from a remote site to a remote - * site by first rsync'ing to a local location, and then - * copying that location to its final destination. - */ -function _drush_core_rsync_both_remote($source, $destination, $additional_options, $source_path) { - $options = $additional_options + drush_redispatch_get_options(); - - // Make a temporary directory to copy to. There are three - // cases to consider: - // - // 1. rsync @src:file.txt @dest:location - // 2. rsync @src:dir @dest:location - // 3. rsync @src:dir/ @dest:location - // - // We will explain each of these in turn. - // - // 1. Copy a single file. We'll split this up like so: - // - // rsync @src:file.txt /tmp/tmpdir - // rsync /tmp/tmpdir/file.txt @dest:location - // - // Since /tmp/tmpdir is empty, we could also rsync from - // '/tmp/tmpdir/' if we wished. - // - // 2. Copy a directory. A directory with the same name - // is copied to the destination. We'll split this up like so: - // - // rsync @src:dir /tmp/tmpdir - // rsync /tmp/tmpdir/dir @dest:location - // - // The result is that everything in 'dir' is copied to @dest, - // and ends up in 'location/dir'. - // - // 3. Copy the contents of a directory. We will split this - // up as follows: - // - // rsync @src:dir/ /tmp/tmpdir - // rsync /tmp/tmpdir/ @dest:location - // - // After the first rsync, everything in 'dir' will end up in - // tmpdir. The second rsync copies everything in tmpdir to - // @dest:location without creating an encapsulating folder - // in the destination (i.e. there is no 'tmpdir' in the destination). - // - // All three of these cases need to be handled correctly in order - // to ensure the correct results. In all cases the first - // rsync always copies to $tmpDir, however the second rsync has - // two cases that depend on the source path. If the source path ends - // in /, the contents of a directory have been copied to $tmpDir, and - // the contents of $tmpDir must be copied to the destination. Otherwise, - // a specific file or directory has been copied to $tmpDir and that - // specific item, identified by basename($source_path) must be copied to - // the destination. - - $putInTmpPath = drush_tempdir(); - $getFromTmpPath = "$putInTmpPath/"; - if (substr($source_path, -1) !== '/') { - $getFromTmpPath .= basename($source_path); - } - - // Copy from the source to the temporary location. Exit on failure. - $values = drush_invoke_process('@self', 'core-rsync', array($source, $putInTmpPath), $options); - if ($values['error'] != 0) { - return FALSE; - } - - // Copy from the temporary location to the final destination. - $values = drush_invoke_process('@self', 'core-rsync', array($getFromTmpPath, $destination), $options); - - return $values['error'] == 0; -} diff --git a/vendor/drush/drush/commands/core/scratch.php b/vendor/drush/drush/commands/core/scratch.php deleted file mode 100644 index e6d2cffc058c1cb96fe2a888304fa133f133f7a2..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/scratch.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * @file - * Use this file as a php scratchpad for your Drupal site. You might want to - * load a node, change it, and call node_save($node), for example. If you have - * used the Execute PHP feature of devel.module, this is the drush equivalent. - * - * You may edit this file with whatever php you choose. Then execute the file - * using `drush script scratch.php`. That command will bootstrap your drupal - * site and then run the php below. - * - * The script command enables you to store your script files wherever you wish and - * will help you list all of them should you collection grow. See its help. - * - */ - -// Just some ideas to get the juices flowing. -drush_print_r(user_roles()); -drush_print_r($GLOBALS['user']); diff --git a/vendor/drush/drush/commands/core/search.drush.inc b/vendor/drush/drush/commands/core/search.drush.inc deleted file mode 100644 index d09a0d27bd9a710542e0067067c3a8e3b4407636..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/search.drush.inc +++ /dev/null @@ -1,216 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Implementation of hook_drush_help(). - */ -function search_drush_help($section) { - switch ($section) { - case 'meta:search:title': - return dt('Search commands'); - case 'meta:search:summary': - return dt('Interact with Drupal\'s core search system.'); - } -} - -function search_drush_command() { - $items['search-status'] = array( - 'description' => 'Show how many items remain to be indexed out of the total.', - 'drupal dependencies' => array('search'), - 'outputformat' => array( - 'default' => 'message', - 'pipe-format' => 'message', - 'field-labels' => array('remaining' => 'Items not yet indexed', 'total' => 'Total items'), - 'message-template' => 'There are !remaining items out of !total still to be indexed.', - 'pipe-metadata' => array( - 'message-template' => '!remaining/!total', - ), - 'output-data-type' => 'format-list', - 'aliases' => array('search:status'), - ), - ); - $items['search-index'] = array( - 'description' => 'Index the remaining search items without wiping the index.', - 'drupal dependencies' => array('search'), - ); - $items['search-reindex'] = array( - 'description' => 'Force the search index to be rebuilt.', - 'drupal dependencies' => array('search'), - 'options' => array( - 'immediate' => 'Rebuild the index immediately, instead of waiting for cron.', - ), - 'aliases' => array('search:index'), - ); - return $items; -} - -function drush_search_status() { - list($remaining, $total) = _drush_search_status(); - return array( - 'remaining' => $remaining, - 'total' => $total, - ); -} - -function _drush_search_status() { - $remaining = 0; - $total = 0; - if (drush_drupal_major_version() >= 8) { - $search_page_repository = \Drupal::service('search.search_page_repository'); - foreach ($search_page_repository->getIndexableSearchPages() as $entity) { - $status = $entity->getPlugin()->indexStatus(); - $remaining += $status['remaining']; - $total += $status['total']; - } - } - elseif (drush_drupal_major_version() == 7) { - foreach (variable_get('search_active_modules', array('node', 'user')) as $module) { - drush_include_engine('drupal', 'environment'); - $status = drush_module_invoke($module, 'search_status'); - $remaining += $status['remaining']; - $total += $status['total']; - } - } - else { - drush_include_engine('drupal', 'environment'); - foreach (drush_module_implements('search') as $module) { - // Special case. Apachesolr recommends disabling core indexing with - // search_cron_limit = 0. Need to avoid infinite status loop. - if ($module == 'node' && variable_get('search_cron_limit', 10) == 0) { - continue; - } - $status = drush_module_invoke($module, 'search', 'status'); - if (isset($status['remaining']) && isset($status['total'])) { - $remaining += $status['remaining']; - $total += $status['total']; - } - } - } - return array($remaining, $total); -} - -function drush_search_index() { - drush_op('_drush_search_index'); - drush_log(dt('The search index has been built.'), LogLevel::OK); -} - -function _drush_search_index() { - list($remaining, $total) = _drush_search_status(); - register_shutdown_function('search_update_totals'); - $failures = 0; - while ($remaining > 0) { - $done = $total - $remaining; - $percent = $done / $total * 100; - drush_log(dt('!percent complete. Remaining items to be indexed: !count', array('!percent' => number_format($percent, 2), '!count' => $remaining)), LogLevel::OK); - $eval = "register_shutdown_function('search_update_totals');"; - - // Use drush_invoke_process() to start subshell. Avoids out of memory issue. - if (drush_drupal_major_version() >= 8) { - $eval = "drush_module_invoke('search', 'cron');"; - } - elseif (drush_drupal_major_version() == 7) { - // If needed, prod drush_module_implements() to recognize our - // hook_node_update_index() implementations. - drush_include_engine('drupal', 'environment'); - $implementations = drush_module_implements('node_update_index'); - if (!in_array('system', $implementations)) { - // Note that this resets module_implements cache. - drush_module_implements('node_update_index', FALSE, TRUE); - } - - foreach (variable_get('search_active_modules', array('node', 'user')) as $module) { - // TODO: Make sure that drush_module_invoke is really available when doing this eval(). - $eval .= " drush_module_invoke('$module', 'update_index');"; - } - } - else { - // If needed, prod module_implements() to recognize our hook_nodeapi() - // implementations. - $implementations = module_implements('nodeapi'); - if (!in_array('system', $implementations)) { - // Note that this resets module_implements cache. - module_implements('nodeapi', FALSE, TRUE); - } - - $eval .= " module_invoke_all('update_index');"; - } - drush_invoke_process('@self', 'php-eval', array($eval)); - $previous_remaining = $remaining; - list($remaining, ) = _drush_search_status(); - // Make sure we're actually making progress. - if ($remaining == $previous_remaining) { - $failures++; - if ($failures == 3) { - drush_log(dt('Indexing stalled with @number items remaining.', array( - '@number' => $remaining, - )), LogLevel::ERROR); - return; - } - } - // Only count consecutive failures. - else { - $failures = 0; - } - } -} - -function drush_search_reindex() { - drush_print(dt("The search index must be fully rebuilt before any new items can be indexed.")); - if (drush_get_option('immediate')) { - drush_print(dt("Rebuilding the index may take a long time.")); - } - if (!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - - if (drush_drupal_major_version() == 8) { - // D8 CR: https://www.drupal.org/node/2326575 - $search_page_repository = \Drupal::service('search.search_page_repository'); - foreach ($search_page_repository->getIndexableSearchPages() as $entity) { - $entity->getPlugin()->markForReindex(); - } - } - elseif (drush_drupal_major_version() == 7) { - drush_op('search_reindex'); - } - else { - drush_op('search_wipe'); - } - - if (drush_get_option('immediate')) { - drush_op('_drush_search_index'); - drush_log(dt('The search index has been rebuilt.'), LogLevel::OK); - } - else { - drush_log(dt('The search index will be rebuilt.'), LogLevel::OK); - } -} - -/** - * Fake an implementation of hook_node_update_index() for Drupal 7. - */ -function system_node_update_index($node) { - // Verbose output. - if (drush_get_context('DRUSH_VERBOSE')) { - $nid = $node->nid; - if (is_object($nid)) { - // In D8, this is a FieldItemList. - $nid = $nid->value; - } - - drush_log(dt('Indexing node !nid.', array('!nid' => $nid)), LogLevel::OK); - } -} - -/** - * Fake an implementation of hook_nodeapi() for Drupal 6. - */ -function system_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { - if ($op == 'update index') { - // Verbose output. - if (drush_get_context('DRUSH_VERBOSE')) { - drush_log(dt('Indexing node !nid.', array('!nid' => $node->nid)), LogLevel::OK); - } - } -} diff --git a/vendor/drush/drush/commands/core/shellalias.drush.inc b/vendor/drush/drush/commands/core/shellalias.drush.inc deleted file mode 100644 index 06c02e9bb881e0422691a5a03c0608bc40526dfc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/shellalias.drush.inc +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/** - * @file - * Shell alias commands. @see example.drushrc.php for details. - */ - -function shellalias_drush_help($section) { - switch ($section) { - case 'drush:shell-alias': - return dt('Print a shell alias record.'); - } -} - -/** - * Command argument complete callback. - * - * @return - * Array of available site aliases. - */ -function shellalias_shell_alias_complete() { - if ($all = drush_get_context('shell-aliases', array())) { - return array('values' => array_keys($all)); - } -} - -function shellalias_drush_command() { - $items = array(); - - $items['shell-alias'] = array( - 'description' => 'Print all known shell alias records.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'arguments' => array( - 'alias' => 'Shell alias to print', - ), - 'outputformat' => array( - 'default' => 'key-value', - 'pipe-format' => 'json', - 'simplify-single' => TRUE, - 'output-data-type' => 'format-list', - ), - 'aliases' => array('sha', 'shell:alias'), - 'examples' => array( - 'drush shell-alias' => 'List all alias records known to drush.', - 'drush shell-alias pull' => 'Print the value of the shell alias \'pull\'.', - ), - ); - return $items; -} - -/** - * Print out the specified shell aliases. - */ -function drush_core_shell_alias($alias = FALSE) { - $shell_aliases = drush_get_context('shell-aliases', array()); - if (!$alias) { - return $shell_aliases; - } - elseif (isset($shell_aliases[$alias])) { - return array($alias => $shell_aliases[$alias]); - } -} diff --git a/vendor/drush/drush/commands/core/site_install.drush.inc b/vendor/drush/drush/commands/core/site_install.drush.inc deleted file mode 100644 index 8366d7ae8cf96bd314d18033979bf11340f4fdf0..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/site_install.drush.inc +++ /dev/null @@ -1,282 +0,0 @@ -<?php - -use Drush\Log\LogLevel; -use Drupal\Core\Config\FileStorage; - -function site_install_drush_command() { - $items['site-install'] = array( - 'description' => 'Install Drupal along with modules/themes/configuration using the specified install profile.', - 'arguments' => array( - // In Drupal 7 installation profiles can be marked as exclusive by placing - // a - // @code - // exclusive: true - // @endcode - // line in the profile's info file. - // See https://www.drupal.org/node/1022020 for more information. - // - // In Drupal 8 you can turn your installation profile into a distribution - // by providing a - // @code - // distribution: - // name: 'Distribution name' - // @endcode - // block in the profile's info YAML file. - // See https://www.drupal.org/node/2210443 for more information. - 'profile' => 'The install profile you wish to run. Defaults to \'default\' in D6, \'standard\' in D7+, unless an install profile is marked as exclusive (or as a distribution in D8+ terminology) in which case that is used.', - 'key=value...' => 'Any additional settings you wish to pass to the profile. Fully supported on D7+, partially supported on D6 (single step configure forms only). The key is in the form [form name].[parameter name] on D7 or just [parameter name] on D6.', - ), - 'options' => array( - 'db-url' => array( - 'description' => 'A Drupal 6 style database URL. Only required for initial install - not re-install.', - 'example-value' => 'mysql://root:pass@host/db', - ), - 'db-prefix' => 'An optional table prefix to use for initial install. Can be a key-value array of tables/prefixes in a drushrc file (not the command line).', - 'db-su' => array( - 'description' => 'Account to use when creating a new database. Must have Grant permission (mysql only). Optional.', - 'example-value' => 'root', - ), - 'db-su-pw' => array( - 'description' => 'Password for the "db-su" account. Optional.', - 'example-value' => 'pass', - ), - 'account-name' => 'uid1 name. Defaults to admin', - 'account-pass' => 'uid1 pass. Defaults to a randomly generated password. If desired, set a fixed password in drushrc.php.', - 'account-mail' => 'uid1 email. Defaults to admin@example.com', - 'locale' => array( - 'description' => 'A short language code. Sets the default site language. Language files must already be present. You may use download command to get them.', - 'example-value' => 'en-GB', - ), - 'clean-url'=> 'Defaults to clean; use --no-clean-url to disable. Note that Drupal 8 and later requires clean.', - 'site-name' => 'Defaults to Site-Install', - 'site-mail' => 'From: for system mailings. Defaults to admin@example.com', - 'sites-subdir' => array( - 'description' => "Name of directory under 'sites' which should be created. Only needed when the subdirectory does not already exist. Defaults to 'default'", - 'value' => 'required', - 'example-value' => 'directory_name', - ), - 'config-dir' => 'A path pointing to a full set of configuration which should be imported after installation.', - ), - 'examples' => array( - 'drush site-install expert --locale=uk' => '(Re)install using the expert install profile. Set default language to Ukrainian.', - 'drush site-install --db-url=mysql://root:pass@localhost:port/dbname' => 'Install using the specified DB params.', - 'drush site-install --db-url=sqlite://sites/example.com/files/.ht.sqlite' => 'Install using SQLite (D7+ only).', - 'drush site-install --account-name=joe --account-pass=mom' => 'Re-install with specified uid1 credentials.', - 'drush site-install standard install_configure_form.site_default_country=FR my_profile_form.my_settings.key=value' => 'Pass additional arguments to the profile (D7 example shown here - for D6, omit the form id).', - "drush site-install standard install_configure_form.update_status_module='array(FALSE,FALSE)'" => 'Disable email notification during install and later (D7). If your server has no mail transfer agent, this gets rid of an error during install.', - 'drush site-install standard install_configure_form.enable_update_status_module=NULL install_configure_form.enable_update_status_emails=NULL' => 'Disable email notification during install and later (D8). If your server has no mail transfer agent, this gets rid of an error during install.', - ), - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT, - 'aliases' => array('si', 'site:install'), - ); - return $items; -} - -/** - * Implements hook_drush_help_alter(). - */ -function site_install_drush_help_alter(&$command) { - // Drupal version-specific customizations. - if ($command['command'] == 'site-install') { - if (drush_drupal_major_version() >= 8) { - unset($command['options']['clean-url']); - } - else { - unset($command['options']['config-dir']); - } - } -} - -/** - * Command validate. - */ -function drush_core_site_install_validate() { - if ($sites_subdir = drush_get_option('sites-subdir')) { - $lower = strtolower($sites_subdir); - if ($sites_subdir != $lower) { - drush_log(dt('Only lowercase sites-subdir are valid. Switching to !lower.', array('!lower' => $lower)), LogLevel::WARNING); - drush_set_option('sites-subdir', $lower); - } - // Make sure that we will bootstrap to the 'sites-subdir' site. - drush_set_context('DRUSH_SELECTED_URI', 'http://' . $sites_subdir); - drush_sitealias_create_self_alias(); - } - - if ($config = drush_get_option('config-dir')) { - if (!file_exists($config)) { - return drush_set_error('config_import_target', 'The config source directory does not exist.'); - } - if (!is_dir($config)) { - return drush_set_error('config_import_target', 'The config source is not a directory.'); - } - $configFiles = glob("$config/*.yml"); - if (empty($configFiles)) { - drush_log(dt('Configuration import directory !config does not contain any configuration; will skip import.', array('!config' => $config)), LogLevel::WARNING); - drush_set_option('config-dir', ''); - } - } -} - -/** - * Perform setup tasks for installation. - */ -function drush_core_pre_site_install($profile = NULL) { - $sql = drush_sql_get_class(); - if (!$db_spec = $sql->db_spec()) { - drush_set_error(dt('Could not determine database connection parameters. Pass --db-url option.')); - return; - } - - // Make sure URI is set so we get back a proper $alias_record. Needed for quick-drupal. - _drush_bootstrap_selected_uri(); - - $alias_record = drush_sitealias_get_record('@self'); - $sites_subdir = drush_sitealias_local_site_path($alias_record); - // Override with sites-subdir if specified. - if ($dir = drush_get_option('sites-subdir')) { - $sites_subdir = "sites/$dir"; - } - $conf_path = $sites_subdir; - // Handle the case where someuse uses --variables to set the file public path. Won't work on D8+. - $files = !empty($GLOBALS['conf']['files_public_path']) ? $GLOBALS['conf']['files_public_path'] : "$conf_path/files"; - $settingsfile = "$conf_path/settings.php"; - $sitesfile = "sites/sites.php"; - $default = realpath($alias_record['root'] . '/sites/default'); - $sitesfile_write = drush_drupal_major_version() >= 8 && $conf_path != $default && !file_exists($sitesfile); - - if (!file_exists($settingsfile)) { - $msg[] = dt('create a @settingsfile file', array('@settingsfile' => $settingsfile)); - } - if ($sitesfile_write) { - $msg[] = dt('create a @sitesfile file', array('@sitesfile' => $sitesfile)); - } - if ($sql->db_exists()) { - $msg[] = dt("DROP all tables in your '@db' database.", array('@db' => $db_spec['database'])); - } - else { - $msg[] = dt("CREATE the '@db' database.", array('@db' => $db_spec['database'])); - } - - if (!drush_confirm(dt('You are about to ') . implode(dt(' and '), $msg) . ' Do you want to continue?')) { - return drush_user_abort(); - } - - // Can't install without sites subdirectory and settings.php. - if (!file_exists($conf_path)) { - if (!drush_mkdir($conf_path) && !drush_get_context('DRUSH_SIMULATE')) { - drush_set_error(dt('Failed to create directory @conf_path', array('@conf_path' => $conf_path))); - return; - } - } - else { - drush_log(dt('Sites directory @subdir already exists - proceeding.', array('@subdir' => $conf_path))); - } - - if (!drush_file_not_empty($settingsfile)) { - if (!drush_op('copy', 'sites/default/default.settings.php', $settingsfile) && !drush_get_context('DRUSH_SIMULATE')) { - return drush_set_error(dt('Failed to copy sites/default/default.settings.php to @settingsfile', array('@settingsfile' => $settingsfile))); - } - } - - if (drush_drupal_major_version() == 6) { - if (!_drush_core_site_install_add_db_url_to_settings($settingsfile, $db_spec)) { - return drush_set_error(dt('Failed to write database settings to @settingsfile', array('@settingsfile' => $settingsfile))); - } - } - - // Write an empty sites.php if we are on D8 and using multi-site. - if ($sitesfile_write) { - if (!drush_op('copy', 'sites/example.sites.php', $sitesfile) && !drush_get_context('DRUSH_SIMULATE')) { - return drush_set_error(dt('Failed to copy sites/example.sites.php to @sitesfile', array('@sitesfile' => $sitesfile))); - } - } - - // We need to be at least at DRUSH_BOOTSTRAP_DRUPAL_SITE to select the site uri to install to - define('MAINTENANCE_MODE', 'install'); - if (drush_drupal_major_version() == 6) { - // The Drupal 6 installer needs to bootstrap up to the specified site. - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION); - } - else { - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE); - } - - if (!$sql->drop_or_create($db_spec)) { - return drush_set_error(dt('Failed to create database: @error', array('@error' => implode(drush_shell_exec_output())))); - } - - return TRUE; -} - -function _drush_core_site_install_add_db_url_to_settings($settingsfile, $db_spec) { - $settingsContents = file_get_contents($settingsfile); - if (preg_match('#^.db_url *=#', $settingsContents)) { - return true; - } - // On D6, we have to write $db_url ourselves. In D7+, the installer does it. - if (file_put_contents($settingsfile, "\n" . '$db_url = \'' . drush_convert_db_url(drush_get_option('db-url')) . "';\n", FILE_APPEND) === false) { - return false; - } - - // Instead of parsing and performing string replacement on the configuration file, - // the options are appended and override the defaults. - // Database table prefix - if (!empty($db_spec['db_prefix'])) { - if (is_array($db_spec['db_prefix'])) { - // Write db_prefix configuration as an array - $db_prefix_config = '$db_prefix = ' . var_export($db_spec['db_prefix'], TRUE) . ';'; - } - else { - // Write db_prefix configuration as a string - $db_prefix_config = '$db_prefix = \'' . $db_spec['db_prefix'] . '\';'; - } - file_put_contents($settingsfile, "\n" . $db_prefix_config . "\n", FILE_APPEND); - } - return true; -} - - -/** - * Command callback. - */ -function drush_core_site_install($profile = NULL) { - $args = func_get_args(); - $form_options = array(); - - if ($args) { - // The first argument is the profile. - $profile = array_shift($args); - // Subsequent arguments are additional form values. - foreach ($args as $arg) { - list($key, $value) = explode('=', $arg, 2); - - // Allow for numeric and NULL values to be passed in. - if (is_numeric($value)) { - $value = intval($value); - } - elseif ($value == 'NULL') { - $value = NULL; - } - - $form_options[$key] = $value; - } - } - - // If the profile is not explicitly set, default to the 'minimal' for an issue-free config import. - if (empty($profile) && drush_get_option('config-dir')) { - $profile = 'minimal'; - } - - drush_include_engine('drupal', 'site_install'); - drush_core_site_install_version($profile, $form_options); - - // Post installation, run the configuration import. - if ($config = drush_get_option('config-dir')) { - // Set the destination site UUID to match the source UUID, to bypass a core fail-safe. - $source_storage = new FileStorage($config); - $options = ['yes' => TRUE]; - drush_invoke_process('@self', 'config-set', array('system.site', 'uuid', $source_storage->read('system.site')['uuid']), $options); - // Run a full configuration import. - drush_invoke_process('@self', 'config-import', array(), array('source' => $config) + $options); - } -} diff --git a/vendor/drush/drush/commands/core/sitealias.drush.inc b/vendor/drush/drush/commands/core/sitealias.drush.inc deleted file mode 100644 index 3ac59a9a014ff1e762b23daa9e48cd10e1e932d5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/sitealias.drush.inc +++ /dev/null @@ -1,398 +0,0 @@ -<?php - -/** - * @file - * Site alias commands. @see example.drushrc.php for details. - */ - -function sitealias_drush_help($section) { - switch ($section) { - case 'drush:site-alias': - return dt('Print an alias record.'); - } -} - -function sitealias_drush_command() { - $items = array(); - - $items['site-alias'] = array( - 'callback' => 'drush_sitealias_print', - 'description' => 'Print site alias records for all known site aliases and local sites.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'arguments' => array( - 'site' => 'Site specification to print', - ), - 'options' => array( - 'with-db' => 'Include the databases structure in the full alias record.', - 'with-db-url' => 'Include the short-form db-url in the full alias record.', - 'no-db' => 'Do not include the database record in the full alias record (default).', - 'with-optional' => 'Include optional default items.', - 'alias-name' => 'For a single alias, set the name to use in the output.', - 'local-only' => 'Only display sites that are available on the local system (remote-site not set, and Drupal root exists).', - 'show-hidden' => 'Include hidden internal elements in site alias output', - ), - 'outputformat' => array( - 'default' => 'config', - 'pipe-format' => 'var_export', - 'variable-name' => 'aliases', - 'hide-empty-fields' => TRUE, - 'private-fields' => 'password', - 'field-labels' => array('#name' => 'Name', 'root' => 'Root', 'uri' => 'URI', 'remote-host' => 'Host', 'remote-user' => 'User', 'remote-port' => 'Port', 'os' => 'OS', 'ssh-options' => 'SSH options', 'php' => 'PHP'), - 'fields-default' => array('#name', 'root', 'uri', 'remote-host', 'remote-user'), - 'field-mappings' => array('name' => '#name'), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('sa', 'site:alias'), - 'examples' => array( - 'drush site-alias' => 'List all alias records known to drush.', - 'drush site-alias @dev' => 'Print an alias record for the alias \'dev\'.', - 'drush @none site-alias' => 'Print only actual aliases; omit multisites from the local Drupal installation.', - ), - 'topics' => array('docs-aliases'), - ); - $items['site-set'] = array( - 'description' => 'Set a site alias to work on that will persist for the current session.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'handle-remote-commands' => TRUE, - 'arguments' => array( - 'site' => 'Site specification to use, or "-" for previous site. Omit this argument to "unset"', - ), - 'aliases' => array('use', 'site:set'), - 'examples' => array( - 'drush site-set @dev' => 'Set the current session to use the @dev alias.', - 'drush site-set user@server/path/to/drupal#sitename' => 'Set the current session to use a remote site via site specification.', - 'drush site-set /path/to/drupal#sitename' => 'Set the current session to use a local site via site specification.', - 'drush site-set -' => 'Go back to the previously-set site (like `cd -`).', - 'drush site-set' => 'Without an argument, any existing site becomes unset.', - ), - ); - return $items; -} - -/** - * Command argument complete callback. - * - * @return - * Array of available site aliases. - */ -function sitealias_site_alias_complete() { - return array('values' => array_keys(_drush_sitealias_all_list())); -} - -/** - * Command argument complete callback. - * - * @return - * Array of available site aliases. - */ -function sitealias_site_set_complete() { - return array('values' => array_keys(_drush_sitealias_all_list())); -} - -/** - * Return a list of all site aliases known to drush. - * - * The array key is the site alias name, and the array value - * is the site specification for the given alias. - */ -function _drush_sitealias_alias_list() { - return drush_get_context('site-aliases'); -} - -/** - * Return a list of all of the local sites at the current drupal root. - * - * The array key is the site folder name, and the array value - * is the site specification for that site. - */ -function _drush_sitealias_site_list() { - $site_list = array(); - $base_path = drush_get_context('DRUSH_DRUPAL_ROOT'); - if ($base_path) { - $base_path .= '/sites'; - $files = drush_scan_directory($base_path, '/settings\.php/', array('.', '..', 'CVS', 'all'), 0, 1); - foreach ($files as $filename => $info) { - if ($info->basename == 'settings.php') { - $alias_record = drush_sitealias_build_record_from_settings_file($filename); - if (!empty($alias_record)) { - $site_list[drush_sitealias_uri_to_site_dir($alias_record['uri'])] = $alias_record; - } - } - } - } - return $site_list; -} - -/** - * Return the list of all site aliases and all local sites. - */ -function _drush_sitealias_all_list() { - drush_sitealias_load_all(); - return array_merge(_drush_sitealias_alias_list(), _drush_sitealias_site_list()); -} - -/** - * Return the list of site aliases (remote or local) that the - * user specified on the command line. If none were specified, - * then all are returned. - */ -function _drush_sitealias_user_specified_list() { - $command = drush_get_command(); - $specifications = $command['arguments']; - $site_list = array(); - - // Iterate over the arguments and convert them to alias records - if (!empty($specifications)) { - list($site_list, $not_found) = drush_sitealias_resolve_sitespecs($specifications); - if (!empty($not_found)) { - return drush_set_error('DRUSH_ALIAS_NOT_FOUND', dt("Not found: @list", array("@list" => implode(', ', $not_found)))); - } - } - // If the user provided no args, then we will return everything. - else { - drush_set_default_outputformat('list'); - $site_list = _drush_sitealias_all_list(); - - // Filter out the hidden items - foreach ($site_list as $site_name => $one_site) { - if (array_key_exists('#hidden', $one_site)) { - unset($site_list[$site_name]); - } - } - } - - // Filter for only local sites if specified. - if (drush_get_option('local-only', FALSE)) { - foreach ($site_list as $site_name => $one_site) { - if ( (array_key_exists('remote-site', $one_site)) || - (!array_key_exists('root', $one_site)) || - (!is_dir($one_site['root'])) - ) { - unset($site_list[$site_name]); - } - } - } - return $site_list; -} - -/** - * Print out the specified site aliases (or else all) using the format - * specified. - */ -function drush_sitealias_print() { - // Try to get the @self alias to be defined. - $phase = drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_SITE); - $site_list = _drush_sitealias_user_specified_list(); - if ($site_list === FALSE) { - return FALSE; - } - ksort($site_list); - $with_db = (drush_get_option('with-db') != NULL) || (drush_get_option('with-db-url') != NULL); - - $site_specs = array(); - foreach ($site_list as $site => $alias_record) { - $result_record = _drush_sitealias_prepare_record($alias_record); - $site_specs[$site] = $result_record; - } - ksort($site_specs); - return $site_specs; -} - -/** - * Given a site alias name, print out a php-syntax - * representation of it. - * - * @param alias_record - * The name of the site alias to print - */ -function _drush_sitealias_prepare_record($alias_record) { - $output_db = drush_get_option('with-db'); - $output_db_url = drush_get_option('with-db-url'); - $output_optional_items = drush_get_option('with-optional'); - - // Make sure that the default items have been added for all aliases - _drush_sitealias_add_static_defaults($alias_record); - - // Include the optional items, if requested - if ($output_optional_items) { - _drush_sitealias_add_transient_defaults($alias_record); - } - - drush_sitealias_resolve_path_references($alias_record); - - if (isset($output_db_url) || isset($output_db)) { - drush_sitealias_add_db_settings($alias_record); - } - // If the user specified --with-db-url, then leave the - // 'db-url' entry in the alias record (unless it is not - // set, in which case we will leave the 'databases' record instead). - if (isset($output_db_url)) { - if (!isset($alias_record['db-url'])) { - $alias_record['db-url'] = drush_sitealias_convert_databases_to_db_url($alias_record['databases']); - } - unset($alias_record['databases']); - } - // If the user specified --with-db, then leave the - // 'databases' entry in the alias record. - else if (isset($output_db)) { - unset($alias_record['db-url']); - } - // If neither --with-db nor --with-db-url were specified, - // then remove both the 'db-url' and the 'databases' entries. - else { - unset($alias_record['db-url']); - unset($alias_record['databases']); - } - - // We don't want certain fields to go into the output - if (!drush_get_option('show-hidden')) { - foreach ($alias_record as $key => $value) { - if ($key[0] == '#') { - unset($alias_record[$key]); - } - } - } - - // We only want to output the 'root' item; don't output the '%root' path alias - if (array_key_exists('path-aliases', $alias_record) && array_key_exists('%root', $alias_record['path-aliases'])) { - unset($alias_record['path-aliases']['%root']); - // If there is nothing left in path-aliases, then clear it out - if (count($alias_record['path-aliases']) == 0) { - unset($alias_record['path-aliases']); - } - } - - return $alias_record; -} - -function _drush_sitealias_print_record($alias_record, $site_alias = '') { - $result_record = _drush_sitealias_prepare_record($alias_record); - - // The alias name will be the same as the site alias name, - // unless the user specified some other name on the command line. - $alias_name = drush_get_option('alias-name'); - if (!isset($alias_name)) { - $alias_name = $site_alias; - if (empty($alias_name) || is_numeric($alias_name)) { - $alias_name = drush_sitealias_uri_to_site_dir($result_record['uri']); - } - } - - // Alias names contain an '@' when referenced, but do - // not contain an '@' when defined. - if (substr($alias_name,0,1) == '@') { - $alias_name = substr($alias_name,1); - } - - $exported_alias = var_export($result_record, TRUE); - drush_print('$aliases[\'' . $alias_name . '\'] = ' . $exported_alias . ';'); -} - -/** - * Use heuristics to attempt to convert from a site directory to a URI. - * This function should only be used when the URI really is unknown, as - * the mapping is not perfect. - * - * @param site_dir - * A directory, such as domain.com.8080.drupal - * - * @return string - * A uri, such as http://domain.com:8080/drupal - */ -function _drush_sitealias_site_dir_to_uri($site_dir) { - // Protect IP addresses NN.NN.NN.NN by converting them - // temporarily to NN_NN_NN_NN for now. - $uri = preg_replace("/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/", "$1_$2_$3_$4", $site_dir); - // Convert .[0-9]+. into :[0-9]+/ - $uri = preg_replace("/\.([0-9]+)\./", ":$1/", $uri); - // Convert .[0-9]$ into :[0-9] - $uri = preg_replace("/\.([0-9]+)$/", ":$1", $uri); - // Convert .(com|net|org|info). into .(com|net|org|info)/ - $uri = str_replace(array('.com.', '.net.', '.org.', '.info.'), array('.com/', '.net/', '.org/', '.info/'), $uri); - - // If there is a / then convert every . after the / to / - // Then again, if we did this we would break if the path contained a "." - // I hope that the path would never contain a "."... - $pos = strpos($uri, '/'); - if ($pos !== false) { - $uri = substr($uri, 0, $pos + 1) . str_replace('.', '/', substr($uri, $pos + 1)); - } - - // n.b. this heuristic works all the time if there is a port, - // it also works all the time if there is a port and no path, - // but it does not work for domains such as .co.jp with no path, - // and it can fail horribly if someone makes a domain like "info.org". - // Still, I think this is the best we can do short of consulting DNS. - - // Convert from NN_NN_NN_NN back to NN.NN.NN.NN - $uri = preg_replace("/([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)/", "$1.$2.$3.$4", $site_dir); - - return 'http://' . $uri; -} - -/** - * Validation callback for drush site-set. - */ -function drush_sitealias_site_set_validate() { - if (!function_exists('posix_getppid')) { - $args = array('!command' => 'site-set', '!dependencies' => 'POSIX'); - return drush_set_error('DRUSH_COMMAND_PHP_DEPENDENCY_ERROR', dt('Command !command needs the following PHP extensions installed/enabled to run: !dependencies.', $args)); - } -} - -/** - * Set the DRUPAL_SITE variable by writing it out to a temporary file that we - * then source for persistent site switching. - * - * @param site - * A valid site specification. - */ -function drush_sitealias_site_set($site = '@none') { - if ($filename = drush_sitealias_get_envar_filename()) { - $last_site_filename = drush_sitealias_get_envar_filename('drush-drupal-prev-site-'); - if ($site == '-') { - if (file_exists($last_site_filename)) { - $site = file_get_contents($last_site_filename); - } - else { - $site = '@none'; - } - } - if ($site == '@self') { - $path = drush_cwd(); - $site_record = drush_sitealias_lookup_alias_by_path($path, TRUE); - if (isset($site_record['#name'])) { - $site = '@' . $site_record['#name']; - } - else { - $site = '@none'; - } - // Using 'site-set @self' is quiet if there is no change. - $current = is_file($filename) ? trim(file_get_contents($filename)) : "@none"; - if ($current == $site) { - return; - } - } - if (_drush_sitealias_set_context_by_name($site)) { - if (file_exists($filename)) { - @unlink($last_site_filename); - @rename($filename, $last_site_filename); - } - $success_message = dt("Site set to !site", array('!site' => $site)); - if ($site == '@none') { - if (drush_delete_dir($filename)) { - drush_print($success_message); - } - } - elseif (drush_mkdir(dirname($filename), TRUE)) { - if (file_put_contents($filename, $site)) { - drush_print($success_message); - drush_log(dt("Site information stored in !file", array('!file' => $filename))); - } - } - } - else { - return drush_set_error('DRUPAL_SITE_NOT_FOUND', dt("Could not find a site definition for !site.", array('!site' => $site))); - } - } -} diff --git a/vendor/drush/drush/commands/core/ssh.drush.inc b/vendor/drush/drush/commands/core/ssh.drush.inc deleted file mode 100644 index ceb4af87af27415b6e021ef64a571097a8336f14..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/ssh.drush.inc +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -/** -* @file -* The drush site-ssh command for connecting to a remote alias' server via -* SSH, either for an interactive session or to run a shell command. -*/ - -function ssh_drush_command() { - $items['site-ssh'] = array( - 'description' => 'Connect to a Drupal site\'s server via SSH for an interactive session or to run a shell command', - 'arguments' => array( - 'bash' => 'Bash to execute on target. Optional, except when site-alias is a list.', - ), - 'options' => array( - 'cd' => "Directory to change to. Use a full path, TRUE for the site's Drupal root directory, or --no-cd for the ssh default (usually the remote user's home directory). Defaults to the Drupal root.", - ) + drush_shell_exec_proc_build_options(), - 'handle-remote-commands' => TRUE, - 'strict-option-handling' => TRUE, - 'examples' => array( - 'drush @mysite ssh' => 'Open an interactive shell on @mysite\'s server.', - 'drush @prod ssh ls /tmp' => 'Run "ls /tmp" on @prod site. If @prod is a site list, then ls will be executed on each site.', - 'drush @prod ssh git pull' => 'Run "git pull" on the Drupal root directory on the @prod site.', - ), - 'aliases' => array('ssh', 'site:ssh'), - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'topics' => array('docs-aliases'), - ); - return $items; -} - -/** - * Command callback. - */ -function drush_ssh_site_ssh($command = NULL) { - // Get all of the args and options that appear after the command name. - $args = drush_get_original_cli_args_and_options(); - // n.b. we do not escape the first (0th) arg to allow `drush ssh 'ls /path'` - // to work in addition to the preferred form of `drush ssh ls /path`. - // Supporting the legacy form means that we cannot give the full path to an - // executable if it contains spaces. - for ($x = 1; $x < count($args); $x++) { - $args[$x] = drush_escapeshellarg($args[$x]); - } - $command = implode(' ', $args); - if (!$alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS')) { - return drush_set_error('DRUSH_MISSING_TARGET_ALIAS', 'A site alias is required. The way you call ssh command has changed to `drush @alias ssh`.'); - } - $site = drush_sitealias_get_record($alias); - // If we have multiple sites, run ourselves on each one. Set context back when done. - if (isset($site['site-list'])) { - if (empty($command)) { - drush_set_error('DRUSH_SITE_SSH_COMMAND_REQUIRED', dt('A command is required when multiple site aliases are specified.')); - return; - } - foreach ($site['site-list'] as $alias_single) { - drush_set_context('DRUSH_TARGET_SITE_ALIAS', $alias_single); - drush_ssh_site_ssh($command); - } - drush_set_context('DRUSH_TARGET_SITE_ALIAS', $alias); - return; - } - - if (!drush_sitealias_is_remote_site($alias)) { - // Local sites run their bash without SSH. - $return = drush_invoke_process('@self', 'core-execute', array($command), array('escape' => FALSE)); - return $return['object']; - } - - // We have a remote site - build ssh command and run. - $interactive = FALSE; - $cd = drush_get_option('cd', TRUE); - if (empty($command)) { - $command = 'bash -l'; - $interactive = TRUE; - } - $cmd = drush_shell_proc_build($site, $command, $cd, $interactive); - $status = drush_shell_proc_open($cmd); - if ($status != 0) { - return drush_set_error('DRUSH_SITE_SSH_ERROR', dt('An error @code occurred while running the command `@command`', array('@command' => $cmd, '@code' => $status))); - } -} diff --git a/vendor/drush/drush/commands/core/state.drush.inc b/vendor/drush/drush/commands/core/state.drush.inc deleted file mode 100644 index cd78014f56bbb6fac9778a90a05f0b23be5e783d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/state.drush.inc +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -/** - * @file - * Provides State commands. - */ - -/** - * Implementation of hook_drush_help(). - */ -function state_drush_help($section) { - switch ($section) { - case 'meta:state:title': - return dt('State commands'); - case 'meta:state:summary': - return dt('Interact with the State system.'); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function state_drush_command() { - $items['state-get'] = array( - 'description' => 'Display a state value.', - 'arguments' => array( - 'key' => 'The key name.', - ), - 'required-arguments' => 1, - 'examples' => array( - 'drush state-get system.cron_last' => 'Displays last cron run timestamp', - ), - 'outputformat' => array( - 'default' => 'json', - 'pipe-format' => 'json', - ), - 'aliases' => array('sget', 'state:get'), - 'core' => array('8+'), - ); - - $items['state-set'] = array( - 'description' => 'Set a state value.', - 'arguments' => array( - 'key' => 'The state key, for example "system.cron_last".', - 'value' => 'The value to assign to the state key. Use \'-\' to read from STDIN.', - ), - 'required arguments' => 2, - 'options' => array( - 'format' => array( - 'description' => 'Deprecated. See input-format option.', - 'example-value' => 'boolean', - 'value' => 'required', - ), - 'input-format' => array( - 'description' => 'Type for the value. Use "auto" to detect format from value. Other recognized values are string, integer float, or boolean for corresponding primitive type, or json, yaml for complex types.', - 'example-value' => 'boolean', - 'value' => 'required', - ), - // A convenient way to pass a multiline value within a backend request. - 'value' => array( - 'description' => 'The value to assign to the state key (if any).', - 'hidden' => TRUE, - ), - ), - 'examples' => array( - 'drush state-set system.cron_last 1406682882 --format=integer' => 'Sets a timestamp for last cron run.', - 'php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush state-set --format=json foo.name -'=> 'Set a key to a complex value (e.g. array)', - ), - 'aliases' => array('sset', 'state:set'), - 'core' => array('8+'), - ); - - $items['state-delete'] = array( - 'description' => 'Delete a state value.', - 'arguments' => array( - 'key' => 'The state key, for example "system.cron_last".', - ), - 'required arguments' => 1, - 'examples' => array( - 'drush state-del system.cron_last' => 'Delete state entry for system.cron_last.', - ), - 'aliases' => array('sdel', 'state:delete'), - 'core' => array('8+'), - ); - - return $items; -} - -/** - * State get command callback. - * - * @state $key - * The state key. - */ -function drush_state_get($key = NULL) { - return \Drupal::state()->get($key); -} - -/** - * State set command callback. - * - * @param $key - * The config key. - * @param $value - * The data to save to state. - */ -function drush_state_set($key = NULL, $value = NULL) { - // This hidden option is a convenient way to pass a value without passing a key. - $value = drush_get_option('value', $value); - - if (!isset($value)) { - return drush_set_error('DRUSH_STATE_ERROR', dt('No state value specified.')); - } - - // Special flag indicating that the value has been passed via STDIN. - if ($value === '-') { - $value = stream_get_contents(STDIN); - } - - // If the value is a string (usual case, unless we are called from code), - // then format the input. - if (is_string($value)) { - $value = drush_value_format($value, drush_get_option('format', 'auto')); - } - - \Drupal::state()->set($key, $value); -} - -/** - * State delete command callback. - * - * @state $key - * The state key. - */ -function drush_state_delete($key = NULL) { - \Drupal::state()->delete($key); -} diff --git a/vendor/drush/drush/commands/core/topic.drush.inc b/vendor/drush/drush/commands/core/topic.drush.inc deleted file mode 100644 index 3fa63ecf27acce81bf701e212595dc2c412a2399..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/topic.drush.inc +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -/** - * @file - * Topic command and associated hooks. - */ - -/** - * Implementation of hook_drush_command(). - * - * @return - * An associative array describing your command(s). - */ -function topic_drush_command() { - $items['core-topic'] = array( - 'description' => 'Read detailed documentation on a given topic.', - 'arguments' => array( - 'topic name' => 'The name of the topic you wish to view. If omitted, list all topic descriptions (and names in parenthesis).', - ), - 'examples' => array( - 'drush topic' => 'Show all available topics.', - 'drush topic docs-context' => 'Show documentation for the drush context API', - 'drush docs-context' => 'Show documentation for the drush context API', - ), - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'remote-tty' => TRUE, - 'aliases' => array('topic', 'core:topic'), - 'topics' => array('docs-readme'), - ); - - return $items; -} - -/** - * Implement hook_drush_help_alter(). Show 'Topics' section on help detail. - */ -function topic_drush_help_alter(&$command) { - $implemented = drush_get_commands(); - foreach ($command['topics'] as $topic_name) { - // We have a related topic. Inject into the $command so the topic displays. - $command['sections']['topic_section'] = 'Topics'; - $command['topic_section'][$topic_name] = $implemented[$topic_name]['description']; - } -} - -/** - * A command callback. - * - * Show a choice list of available topics and then dispatch to the respective command. - * - * @param string $topic_name - * A command name. - */ -function drush_topic_core_topic($topic_name = NULL) { - $commands = drush_get_commands(); - $topics = drush_get_topics(); - if (isset($topic_name)) { - foreach (drush_get_topics() as $key => $topic) { - if (strstr($key, $topic_name) === FALSE) { - unset($topics[$key]); - } - } - } - if (empty($topics)) { - return drush_set_error('DRUSH_NO_SUCH_TOPIC', dt("No topics on !topic found.", array('!topic' => $topic_name))); - } - if (count($topics) > 1) { - // Show choice list. - foreach ($topics as $key => $topic) { - $choices[$key] = $topic['description']; - } - natcasesort($choices); - if (!$topic_name = drush_choice($choices, dt('Choose a topic'), '!value (!key)', array(5))) { - return drush_user_abort(); - } - } - else { - $keys = array_keys($topics); - $topic_name = array_pop($keys); - } - return drush_dispatch($commands[$topic_name]); -} - -/** - * A command argument complete callback. - * - * @return - * Available topic keys. - */ -function topic_core_topic_complete() { - return array('values' => array_keys(drush_get_topics())); -} - -/** - * Retrieve all defined topics - */ -function drush_get_topics() { - $commands = drush_get_commands(); - foreach ($commands as $key => $command) { - if (!empty($command['topic']) && empty($command['is_alias'])) { - $topics[$key] = $command; - } - } - return $topics; -} diff --git a/vendor/drush/drush/commands/core/usage.drush.inc b/vendor/drush/drush/commands/core/usage.drush.inc deleted file mode 100644 index b39d2be62e9a643314ac3b6d9e18041aaf987e06..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/usage.drush.inc +++ /dev/null @@ -1,158 +0,0 @@ -<?php - -/** - * @file - * Send scrubbed usage data to drush. Omits arguments and option values in order - * to assure that no sensitive data is shared. See http://drupal.org/node/1246738. - */ - -use Drush\Log\LogLevel; - -/** - * To send usage data, add the following to a .drushrc.php file: - * $options['drush_usage_log'] = TRUE; - * $options['drush_usage_send'] = TRUE; - * $options['drush_usage_size'] = 51200; -*/ - -function usage_drush_command() { - $disclaimer = 'Usage statistics contain the Drush command name and the Drush option names, but no arguments or option values.'; - $items['usage-show'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'description' => 'Show Drush usage information that has been logged but not sent. ' . $disclaimer, - 'hidden' => TRUE, - 'examples' => array( - 'drush usage-show' => 'Show cached usage statistics.', - '$options[\'drush_usage_log\'] = TRUE;' => 'Specify in a .drushrc.php file that usage information should be logged locally in a usage statistics file.', - ), - 'aliases' => array('ushow', 'usage:show'), - ); - $items['usage-send'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'hidden' => TRUE, - 'description' => 'Send anonymous Drush usage information to statistics logging site. ' . $disclaimer, - 'examples' => array( - 'drush usage-send' => 'Immediately send cached usage statistics.', - '$options[\'drush_usage_send\'] = TRUE;' => 'Specify in a .drushrc.php file that usage information should be sent.', - '$options[\'drush_usage_size\'] = 10240;' => 'Specify the frequency (file size) that usage information should be sent.', - ), - 'aliases' => array('usend', 'usage:send'), - ); - return $items; -} - -/** - * Log and/or send usage data to Mongolab. - * - * An organization can implement own hook_drush_exit() to send data to a - * different endpoint. - */ -function usage_drush_exit() { - // Ignore statistics for simulated commands. (n.b. in simulated mode, _drush_usage_mongolab will print rather than send statistics) - if (!drush_get_context('DRUSH_SIMULATE')) { - $file = _drush_usage_get_file(); - if (drush_get_option('drush_usage_log', FALSE)) { - _drush_usage_log(drush_get_command(), $file); - } - if (drush_get_option('drush_usage_send', FALSE)) { - _drush_usage_mongolab($file, drush_get_option('drush_usage_size', 51200)); - } - } -} - -/** - * Set option to send usage to Mongolab. - * - * See usage_drush_exit() for more information. - */ -function drush_usage_send() { - $file = _drush_usage_get_file(TRUE); - if ($file) { - drush_set_option('drush_usage_send', TRUE); - drush_set_option('drush_usage_size', 0); - drush_print(dt('To automatically send anonymous usage data, add the following to a .drushrc.php file: $options[\'drush_usage_send\'] = TRUE;')); - } - else { - return drush_set_error('DRUSH_NO_USAGE_FILE', dt('No usage file; set $options[\'drush_usage_log\'] = TRUE; in a .drushrc.php file to enable.')); - } -} - -/** - * Displays usage file. - */ -function drush_usage_show() { - $file = _drush_usage_get_file(TRUE); - if ($file) { - $json = '[' . file_get_contents($file) . ']'; - $usage_data = json_decode($json); - foreach ($usage_data as $item) { - $cmd = $item->cmd; - $options = (array) $item->opt; - array_unshift($options, ''); - drush_print($cmd . implode(' --', $options)); - } - } - else { - return drush_set_error('DRUSH_NO_USAGE_FILE', dt('No usage file; set $options[\'drush_usage_log\'] = TRUE; in a .drushrc.php file to enable.')); - } -} - -/** - * Returns path to usage file. - */ -function _drush_usage_get_file($required = FALSE) { - $file = drush_directory_cache('usage') . '/usage.txt'; - if (!file_exists($file) && $required) { - return FALSE; - - } - return $file; -} - -function _drush_usage_log($command, $file) { - $options = drush_get_command_options_extended($command); - - $used = drush_get_merged_options(); - $command_specific = array_intersect(array_keys($used), array_keys($options)); - $record = array( - 'date' => $_SERVER['REQUEST_TIME'], - 'cmd' => $command['command'], - 'opt' => $command_specific, - 'major' => DRUSH_MAJOR_VERSION, - 'minor' => DRUSH_MINOR_VERSION, - 'os' => php_uname('s'), - 'host' => md5(php_uname('n') . get_current_user()), - ); - $prequel = (file_exists($file)) ? ",\n" : ""; - if (file_put_contents($file, $prequel . json_encode($record), FILE_APPEND)) { - drush_log(dt('Logged command and option names to local cache.'), LogLevel::DEBUG); - } - else { - drush_log(dt('Failed to log command and option names to local cache.'), LogLevel::DEBUG); - } -} - -// We only send data periodically to save network traffic and delay. Files -// are sent once they grow over 50KB (configurable). -function _drush_usage_mongolab($file, $min_size_to_send) { - $json = '[' . file_get_contents($file) . ']'; - if (filesize($file) > $min_size_to_send) { - $base = 'https://api.mongolab.com/api/1'; - $apikey = '4eb95456e4b0bcd285d8135d'; // submitter account. - $database = 'usage'; - $collection = 'usage'; - $action = "/databases/$database/collections/$collection"; - $url = $base . $action . "?apiKey=$apikey"; - $header = 'Content-Type: application/json'; - if (!drush_shell_exec("wget -q -O - --no-check-certificate --timeout=20 --header=\"$header\" --post-data %s %s", $json, $url)) { - if (!drush_shell_exec("curl -s --connect-timeout 20 --header \"$header\" --data %s %s", $json, $url)) { - drush_log(dt('Drush usage statistics failed to post.'), LogLevel::DEBUG); - return FALSE; - } - } - drush_log(dt('Drush usage statistics successfully posted.'), LogLevel::DEBUG); - // Empty the usage.txt file. - unlink($file); - return TRUE; - } -} diff --git a/vendor/drush/drush/commands/core/variable.drush.inc b/vendor/drush/drush/commands/core/variable.drush.inc deleted file mode 100644 index b9a1c4a2091f169a70cbcc94fd6d166bf46ab3e5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/variable.drush.inc +++ /dev/null @@ -1,283 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Implementation of hook_drush_command(). - * - * In this hook, you specify which commands your - * drush module makes available, what it does and - * description. - * - * Notice how this structure closely resembles how - * you define menu hooks. - * - * @return - * An associative array describing your command(s). - */ -function variable_drush_command() { - $items['variable-get'] = array( - 'description' => 'Get a list of some or all site variables and values.', - 'core' => array(6,7), - 'arguments' => array( - 'name' => 'A string to filter the variables by. Variables whose name contains the string will be listed.', - ), - 'examples' => array( - 'drush vget' => 'List all variables and values.', - 'drush vget user' => 'List all variables containing the string "user".', - 'drush vget site_mail --exact' => 'Show only the value of the variable with the exact key "site_mail".', - 'drush vget site_mail --exact --pipe' => 'Show only the variable with the exact key "site_mail" without changing the structure of the output.', - ), - 'options' => array( - 'exact' => "Only get the one variable that exactly matches the specified name. Output will contain only the variable's value.", - ), - 'outputformat' => array( - 'default' => 'yaml', - 'pipe-format' => 'config', - 'variable-name' => 'variables', - 'table-metadata' => array( - 'format' => 'var_export', - ), - ), - 'aliases' => array('vget', 'variable:get'), - ); - $items['variable-set'] = array( - 'description' => "Set a variable.", - 'core' => array(6,7), - 'arguments' => array( - 'name' => 'The name of a variable or the first few letters of its name.', - 'value' => 'The value to assign to the variable. Use \'-\' to read the object from STDIN.', - ), - 'required-arguments' => TRUE, - 'options' => array( - 'yes' => 'Skip confirmation if only one variable name matches.', - 'always-set' => array('description' => 'Older synonym for --exact; deprecated.', 'hidden' => TRUE), - 'exact' => 'The exact name of the variable to set has been provided; do not prompt for similarly-named variables.', - 'format' => array( - 'description' => 'Type for the value. Use "auto" to detect format from value. Other recognized values are string, integer float, or boolean for corresponding primitive type, or json, yaml for complex types.', - 'example-value' => 'boolean', - ), - ), - 'examples' => array( - 'drush vset --yes preprocess_css TRUE' => 'Set the preprocess_css variable to true. Skip confirmation if variable already exists.', - 'drush vset --exact maintenance_mode 1' => 'Take the site offline; skips confirmation even if maintenance_mode variable does not exist. Variable is rewritten to site_offline for Drupal 6.', - 'drush vset pr TRUE' => 'Choose from a list of variables beginning with "pr" to set to (bool)true.', - 'php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush vset --format=json project_dependency_excluded_dependencies -'=> 'Set a variable to a complex value (e.g. array)', - ), - 'aliases' => array('vset', 'variable:set'), - ); - $items['variable-delete'] = array( - 'core' => array(6,7), - 'description' => "Delete a variable.", - 'arguments' => array( - 'name' => 'The name of a variable or the first few letters of its name.', - ), - 'required-arguments' => TRUE, - 'options' => array( - 'yes' => 'Skip confirmation if only one variable name matches.', - 'exact' => 'Only delete the one variable that exactly matches the specified name.', - ), - 'examples' => array( - 'drush vdel user_pictures' => 'Delete the user_pictures variable.', - 'drush vdel u' => 'Choose from a list of variables beginning with "u" to delete.', - 'drush vdel -y --exact maintenance_mode' => 'Bring the site back online, skipping confirmation. Variable is rewritten to site_offline for Drupal 6.', - ), - 'aliases' => array('vdel', 'variable:delete'), - ); - - return $items; -} - -/** - * Command argument complete callback. - */ -function variable_variable_get_complete() { - return variable_complete_variables(); -} - -/** - * Command argument complete callback. - */ -function variable_variable_set_complete() { - return variable_complete_variables(); -} - -/** - * Command argument complete callback. - */ -function variable_variable_delete_complete() { - return variable_complete_variables(); -} - -/** - * List variables for completion. - * - * @return - * Array of available variables. - */ -function variable_complete_variables() { - if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - global $conf; - return array('values' => array_keys($conf)); - } -} - -/** - * Command callback. - * List your site's variables. - */ -function drush_variable_get() { - global $conf; - $exact = drush_get_option('exact', FALSE); - - $keys = array_keys($conf); - if ($args = func_get_args()) { - $args[0] = drush_variable_name_adjust($args[0]); - if ($exact) { - $keys = in_array($args[0], $keys) ? array($args[0]) : array(); - } - $keys = preg_grep("/{$args[0]}/", $keys); - } - - // In --exact mode, if --pipe is not set, then simplify the return type. - if ($exact && !drush_get_context('DRUSH_PIPE')) { - $key = reset($keys); - $returns = isset($conf[$key]) ? $conf[$key] : FALSE; - } - else { - foreach ($keys as $name) { - $value = $conf[$name]; - $returns[$name] = $value; - } - } - if (empty($keys)) { - return drush_set_error('No matching variable found.'); - } - else { - return $returns; - } -} - -/** - * Command callback. - * Set a variable. - */ -function drush_variable_set() { - $args = func_get_args(); - $value = $args[1]; - if (!isset($value)) { - return drush_set_error('DRUSH_VARIABLE_ERROR', dt('No value specified.')); - } - - $args[0] = drush_variable_name_adjust($args[0]); - $result = drush_variable_like($args[0]); - - $options[] = "$args[0] ". dt('(new variable)'); - $match = FALSE; - while (!$match && $name = drush_db_result($result)) { - if ($name == $args[0]) { - $options[0] = $name; - $match = TRUE; - } - else { - $options[] = $name; - } - } - - if ($value == '-') { - $value = stream_get_contents(STDIN); - } - - // If the value is a string (usual case, unless we are called from code), - // then format the input - if (is_string($value)) { - $value = drush_value_format($value, drush_get_option('format', 'auto')); - } - - // Format the output for display - if (is_array($value)) { - $display = "\n" . var_export($value, TRUE); - } - elseif (is_integer($value)) { - $display = $value; - } - elseif (is_bool($value)) { - $display = $value ? "TRUE" : "FALSE"; - } - else { - $display = '"' . $value . '"'; - } - - // Check 'always-set' for compatibility with older scripts; --exact is preferred. - $always_set = drush_get_option('always-set', FALSE) || drush_get_option('exact', FALSE); - - if ($always_set || count($options) == 1 || $match) { - variable_set($args[0], $value); - drush_log(dt('!name was set to !value.', array('!name' => $args[0], '!value' => $display)), LogLevel::SUCCESS); - return ''; - } - else { - $choice = drush_choice($options, 'Enter a number to choose which variable to set.'); - if ($choice === FALSE) { - return drush_user_abort(); - } - $choice = $options[$choice]; - $choice = str_replace(' ' . dt('(new variable)'), '', $choice); - drush_op('variable_set', $choice, $value); - drush_log(dt('!name was set to !value', array('!name' => $choice, '!value' => $display)), LogLevel::SUCCESS); - } -} - -/** - * Command callback. - * Delete a variable. - */ -function drush_variable_delete() { - $args = func_get_args(); - $args[0] = drush_variable_name_adjust($args[0]); - // Look for similar variable names. - $result = drush_variable_like($args[0]); - - $options = array(); - while ($name = drush_db_result($result)) { - $options[] = $name; - } - if (drush_get_option('exact', FALSE)) { - $options = in_array($args[0], $options) ? array($args[0]) : array(); - } - - if (count($options) == 0) { - drush_print(dt('!name not found.', array('!name' => $args[0]))); - return ''; - } - - if ((count($options) == 1) && drush_get_context('DRUSH_AFFIRMATIVE')) { - drush_op('variable_del', $args[0]); - drush_log(dt('!name was deleted.', array('!name' => $args[0])), LogLevel::SUCCESS); - return ''; - } - else { - $choice = drush_choice($options, 'Enter a number to choose which variable to delete.'); - if ($choice !== FALSE) { - $choice = $options[$choice]; - drush_op('variable_del', $choice); - drush_log(dt('!choice was deleted.', array('!choice' => $choice)), LogLevel::SUCCESS); - } - } -} - -// Query for similar variable names. -function drush_variable_like($arg) { - return drush_db_select('variable', 'name', 'name LIKE :keyword', array(':keyword' => $arg . '%'), NULL, NULL, 'name'); -} - -// Unify similar variable names across different versions of Drupal -function drush_variable_name_adjust($arg) { - if (($arg == 'maintenance_mode') && (drush_drupal_major_version() < 7)) { - $arg = 'site_offline'; - } - if (($arg == 'site_offline') && (drush_drupal_major_version() >= 7)) { - $arg = 'maintenance_mode'; - } - return $arg; -} diff --git a/vendor/drush/drush/commands/core/views.d8.drush.inc b/vendor/drush/drush/commands/core/views.d8.drush.inc deleted file mode 100644 index 4d8d8142a82eb331e8f3afaf903318a9b69cdc2f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/views.d8.drush.inc +++ /dev/null @@ -1,487 +0,0 @@ -<?php - -/** - * @file - * Drush integration for views. - */ - -use Drush\Log\LogLevel; -use Drupal\views\Analyzer; -use Drupal\views\Entity\View; -use Drupal\views\Views; -use Drupal\Component\Utility\MapArray; - -/** - * Implements hook_drush_help(). - */ -function views_drush_help($section) { - switch ($section) { - case 'meta:views:title': - return dt('Views commands'); - case 'meta:views:summary': - return dt('Views drush commands.'); - } -} - -/** - * Implements hook_drush_command(). - */ -function views_drush_command() { - $items = array(); - - $base = array( - 'core' => array('8+'), - 'drupal dependencies' => array('views'), - ); - - $items['views-dev'] = array( - 'description' => 'Set the Views settings to more developer-oriented values.', - 'aliases' => array('vd', 'views:dev'), - ) + $base; - - $items['views-list'] = array( - 'description' => 'Get a list of all views in the system.', - 'aliases' => array('vl', 'views:list'), - 'options' => array( - 'name' => array( - 'description' => 'A string contained in the view\'s name to filter the results with.', - 'example-value' => 'node', - 'value' => 'required', - ), - 'tags' => array( - 'description' => 'A comma-separated list of views tags by which to filter the results.', - 'example-value' => 'default', - 'value' => 'required', - ), - 'status' => array( - 'description' => 'Status of the views by which to filter the results. Choices: enabled, disabled.', - 'example-value' => 'enabled', - 'value' => 'required', - ), - ), - 'examples' => array( - 'drush vl' => 'Show a list of all available views.', - 'drush vl --name=blog' => 'Show a list of views which names contain "blog".', - 'drush vl --tags=tag1,tag2' => 'Show a list of views tagged with "tag1" or "tag2".', - 'drush vl --status=enabled' => 'Show a list of enabled views.', - ), - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'list', - 'field-default' => array('name', 'label', 'description', 'status', 'tag'), - 'field-labels' => array('name' => 'Machine Name', 'label' => 'Name', 'description' => 'Description', 'status' => 'Status', 'tag' => 'Tag'), - 'output-data-type' => 'format-table', - ), - ) + $base; - - $items['views-execute'] = array( - 'description' => 'Execute a view and get the results.', - 'aliases' => array('vex', 'views:execute'), - 'arguments' => array( - 'view' => 'The name of the view to execute.', - 'display' => 'The display ID to execute. If none specified, the default display will be used.', - ), - 'required-arguments' => 1, - 'options' => array( - 'count' => array( - 'description' => 'Display a count of the results instead of each row.', - ), - 'rendered' => array( - 'description' => 'Return the results as rendered HTML output for the display.', - ), - 'show-admin-links' => array( - 'description' => 'Show contextual admin links in the rendered markup.', - ), - ), - 'outputformat' => array( - 'default' => 'print-r', - 'pipe-format' => 'var_export', - ), - 'examples' => array( - 'drush views-execute my_view' => 'Show the result set of the default display for the my_view view.', - 'drush views-execute my_view page_1 --rendered' => 'Show the rendered output of the my_view:page_1 view.', - 'drush views-execute my_view page_1 3 --count' => 'Show a count of my_view:page_1 with an agument of 3 being passed.', - ), - ) + $base; - - $items['views-analyze'] = array( - 'drupal dependencies' => array('views', 'views_ui'), - 'description' => 'Get a list of all Views analyze warnings', - 'aliases' => array('va', 'views:analyze'), - 'options' => array( - 'format' => array( - 'description' => 'Define the output format. Known formats are: json, print_r, and export.', - ), - ), - ) + $base; - - $items['views-enable'] = array( - 'description' => 'Enable the specified views.', - 'arguments' => array( - 'views' => 'A space delimited list of view names.', - ), - 'required-arguments' => 1, - 'aliases' => array('ven', 'views:enable'), - 'examples' => array( - 'drush ven frontpage taxonomy_term' => 'Enable the frontpage and taxonomy_term views.', - ), - ) + $base; - - $items['views-disable'] = array( - 'description' => 'Disable the specified views.', - 'arguments' => array( - 'views' => 'A space delimited list of view names.', - ), - 'required-arguments' => 1, - 'aliases' => array('vdis', 'views:disable'), - 'examples' => array( - 'drush vdis frontpage taxonomy_term' => 'Disable the frontpage and taxonomy_term views.', - ), - ) + $base; - - return $items; -} - -/** - * Command callback function for views-dev command. - * - * Changes the settings to more developer oriented values. - */ -function drush_views_dev() { - $settings = array( - 'ui.show.listing_filters' => TRUE, - 'ui.show.master_display' => TRUE, - 'ui.show.advanced_column' => TRUE, - 'ui.always_live_preview' => FALSE, - 'ui.always_live_preview_button' => TRUE, - 'ui.show.preview_information' => TRUE, - 'ui.show.sql_query.enabled' => TRUE, - 'ui.show.sql_query.where' => 'above', - 'ui.show.performance_statistics' => TRUE, - 'ui.show.additional_queries' => TRUE, - 'debug.output' => TRUE, - 'debug.region' => 'message', - 'ui.show.display_embed' => TRUE, - ); - - $config = \Drupal::configFactory()->getEditable('views.settings'); - - foreach ($settings as $setting => $value) { - $config->set($setting, $value); - // Convert boolean values into a string to print. - if (is_bool($value)) { - $value = $value ? 'TRUE' : 'FALSE'; - } - // Wrap string values in quotes. - elseif (is_string($value)) { - $value = "\"$value\""; - } - drush_log(dt('!setting set to !value', array('!setting' => $setting, '!value' => $value))); - } - - // Save the new config. - $config->save(); - - drush_log(dt('New views configuration saved.'), LogLevel::SUCCESS); -} - -/** - * Callback function for views-list command. - */ -function drush_views_list() { - $disabled_views = array(); - $enabled_views = array(); - - $format = drush_get_option('format', FALSE); - - $views = \Drupal::entityManager()->getStorage('view')->loadMultiple(); - - // Get the --name option. - $name = array_filter(drush_get_option_list('name')); - $with_name = !empty($name) ? TRUE : FALSE; - - // Get the --tags option. - $tags = array_filter(drush_get_option_list('tags')); - $with_tags = !empty($tags) ? TRUE : FALSE; - - // Get the --status option. Store user input appart to reuse it after. - $status = drush_get_option('status', FALSE); - - // Throw an error if it's an invalid status. - if ($status && !in_array($status, array('enabled', 'disabled'))) { - return drush_set_error(dt('Invalid status: @status. Available options are "enabled" or "disabled"', array('@status' => $status))); - } - - // Setup a row for each view. - foreach ($views as $view) { - // If options were specified, check that first mismatch push the loop to the - // next view. - if ($with_name && !stristr($view->id(), $name[0])) { - continue; - } - if ($with_tags && !in_array($view->get('tag'), $tags)) { - continue; - } - - $status_bool = $status == 'enabled'; - if ($status && ($view->status() !== $status_bool)) { - continue; - } - - $row = array( - 'name' => $view->id(), - 'label' => $view->label(), - 'description' => $view->get('description'), - 'status' => $view->status() ? dt('Enabled') : dt('Disabled'), - 'tag' => $view->get('tag'), - ); - - // Place the row in the appropiate array, so we can have disabled views at - // the bottom. - if ($view->status()) { - $enabled_views[] = $row; - } - else{ - $disabled_views[] = $row; - } - } - - // Sort alphabeticaly. - asort($disabled_views); - asort($enabled_views); - - if (count($enabled_views) || count($disabled_views)) { - $rows = array_merge($enabled_views, $disabled_views); - return $rows; - } - else { - drush_log(dt('No views found.')); - } -} - -/** - * Drush views execute command. - */ -function drush_views_execute($view_name, $display_id = NULL) { - $args = func_get_args(); - $view_args = array(); - - // If it's more than 2, we have arguments. A display has to be specified in - // that case. - if (count($args) > 2) { - $view_args = array_slice($args, 2); - } - - if (!$view = Views::getView($view_name)) { - return drush_set_error(dt('View: "@view" not found.', array('@view' => $view_name))); - } - - // Set the display and execute the view. - $view->setDisplay($display_id); - $view->preExecute($view_args); - $view->execute(); - - if (drush_get_option('count', FALSE)) { - drush_set_default_outputformat('string'); - return count($view->result); - } - elseif (!empty($view->result)) { - if (drush_get_option('rendered', FALSE)) { - drush_set_default_outputformat('string'); - // Don't show admin links in markup by default. - $view->hide_admin_links = !drush_get_option('show-admin-links', FALSE); - $output = $view->preview(); - return drupal_render($output); - - } - else { - return $view->result; - } - } - else { - drush_log(dt('No results returned for this view.') ,LogLevel::WARNING); - return NULL; - } -} - -/** - * Drush views analyze command. - */ -function drush_views_analyze() { - $messages = NULL; - $messages_count = 0; - - $format = drush_get_option('format', FALSE); - - $views = \Drupal::entityManager()->getStorage('view')->loadMultiple(); - - if (!empty($views)) { - $analyzer = \Drupal::service('views.analyzer'); - foreach ($views as $view_name => $view) { - $view = $view->getExecutable(); - - if ($messages = $analyzer->getMessages($view)) { - if ($format) { - $output = drush_format($messages, $format); - drush_print($output); - return $output; - } - else { - drush_print($view_name); - foreach ($messages as $message) { - $messages_count++; - drush_print($message['type'] .': '. $message['message'], 2); - } - } - } - } - - drush_log(dt('A total of @total views were analyzed and @messages problems were found.', array('@total' => count($views), '@messages' => $messages_count)), LogLevel::OK); - return $messages; - } - else { - return drush_set_error(dt('There are no views to analyze')); - } -} - -/** - * Drush views enable command. - */ -function drush_views_enable() { - $view_names = func_get_args(); - _views_drush_op('enable', $view_names); -} - -/** - * Drush views disable command. - */ -function drush_views_disable() { - $view_names = func_get_args(); - _views_drush_op('disable', $view_names); -} - -/** - * Perform operations on view objects. - * - * @param string $op - * The operation to perform. - * @param array $view_names - * An array of view names to load and perform this operation on. - */ -function _views_drush_op($op = '', array $view_names = array()) { - $op_types = _views_drush_op_types(); - if (!in_array($op, array_keys($op_types))) { - return drush_set_error(dt('Invalid op type')); - } - - $view_names = array_combine($view_names, $view_names); - - if ($views = \Drupal::entityManager()->getStorage('view')->loadMultiple($view_names)) { - foreach ($views as $view) { - $tokens = array('@view' => $view->id(), '@action' => $op_types[$op]['action']); - - if ($op_types[$op]['validate']($view)) { - $function = 'views_' . $op . '_view'; - drush_op($function, $view); - drush_log(dt('View: @view has been @action', $tokens), LogLevel::SUCCESS); - } - else { - drush_log(dt('View: @view is already @action', $tokens), LogLevel::NOTICE); - } - // Remove this view from the viewnames input list. - unset($view_names[$view->id()]); - } - - return $views; - } - else { - drush_set_error(dt('No views have been loaded')); - } - - // If we have some unmatched/leftover view names that weren't loaded. - if (!empty($view_names)) { - foreach ($view_names as $viewname) { - drush_log(dt('View: @view could not be found.', array('@view' => $viewname)), LogLevel::ERROR); - } - } - -} - -/** - * Returns an array of op types that can be performed on views. - * - * @return array - * An associative array keyed by op type => action name. - */ -function _views_drush_op_types() { - return array( - 'enable' => array( - 'action' => dt('enabled'), - 'validate' => '_views_drush_view_is_disabled', - ), - 'disable' => array( - 'action' => dt('disabled'), - 'validate' => '_views_drush_view_is_enabled', - ), - ); -} - -/** - * Returns whether a view is enabled. - * - * @param Drupal\views\Entity\ViewDrupal\views\ $view - * The view object to check. - * - * @return bool - * TRUE if the View is enabled, FALSE otherwise. - */ -function _views_drush_view_is_enabled(View $view) { - return $view->status(); -} - -/** - * Returns whether a view is disabled. - * - * @param Drupal\views\Entity\View $view - * The view object to check. - * - * @return bool - * TRUE if the View is disabled, FALSE otherwise. - */ -function _views_drush_view_is_disabled(View $view) { - return !$view->status(); -} - -/** - * Implements hook_cache_clear. Adds a cache clear option for views. - */ -function views_drush_cache_clear(&$types, $include_bootstrapped_types) { - if ($include_bootstrapped_types && \Drupal::moduleHandler()->moduleExists('views')) { - $types['views'] = 'views_invalidate_cache'; - } -} - -/** - * Command argument complete callback. - */ -function views_views_enable_complete() { - return _drush_views_complete(); -} - -/** - * Command argument complete callback. - */ -function views_views_disable_complete() { - return _drush_views_complete(); -} - -/** - * Helper function to return a list of view names for complete callbacks. - * - * @return array - * An array of available view names. - */ -function _drush_views_complete() { - drush_bootstrap_max(); - return array('values' => array_keys(\Drupal::entityManager()->getStorage('view')->loadMultiple())); -} diff --git a/vendor/drush/drush/commands/core/watchdog.drush.inc b/vendor/drush/drush/commands/core/watchdog.drush.inc deleted file mode 100644 index 923b095ac3f1fe158278355c34b144ff553fdb51..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/core/watchdog.drush.inc +++ /dev/null @@ -1,397 +0,0 @@ -<?php - -use Drush\Log\LogLevel; -use Drupal\Component\Utility\Unicode; -use Drupal\Component\Utility\Html; - -/** - * Implementation of hook_drush_help(). - */ -function watchdog_drush_help($section) { - switch ($section) { - case 'meta:watchdog:title': - return dt('Watchdog commands'); - case 'meta:watchdog:summary': - return dt('Interact with Drupal\'s db logging system.'); - case 'drush:watchdog-list': - return dt('Show available message types and severity levels. A prompt will ask for a choice to show watchdog messages.'); - case 'drush:watchdog-show': - return dt('Show watchdog messages. Arguments and options can be combined to configure which messages to show.'); - case 'drush:watchdog-delete': - return dt('Delete watchdog messages. Arguments or options must be provided to specify which messages to delete.'); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function watchdog_drush_command() { - $items['watchdog-list'] = array( - 'description' => 'Show available message types and severity levels. A prompt will ask for a choice to show watchdog messages.', - 'drupal dependencies' => array('dblog'), - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'var_export', - 'field-labels' => array('wid' => 'ID', 'type' => 'Type', 'message' => 'Message', 'severity' => 'Severity', 'location' => 'Location', 'hostname' => 'Hostname', 'date' => 'Date', 'username' => 'Username'), - 'fields-default' => array('wid', 'date', 'type', 'severity', 'message'), - 'column-widths' => array('type' => 8, 'severity' => 8), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('wd-list', 'watchdog:list'), - ); - $items['watchdog-show'] = array( - 'description' => 'Show watchdog messages.', - 'drupal dependencies' => array('dblog'), - 'arguments' => array( - 'wid' => 'Optional id of a watchdog message to show in detail. If not provided, a listing of most recent 10 messages will be displayed. Alternatively if a string is provided, watchdog messages will be filtered by it.', - ), - 'options' => array( - 'count' => 'The number of messages to show. Defaults to 10.', - 'severity' => 'Restrict to messages of a given severity level.', - 'type' => 'Restrict to messages of a given type.', - 'tail' => 'Continuously show new watchdog messages until interrupted.', - 'sleep-delay' => 'To be used in conjunction with --tail. This is the number of seconds to wait between each poll to the database. Delay is 1 second by default.', - 'extended' => 'Return extended information about each message.', - ), - 'examples' => array( - 'drush watchdog-show' => 'Show a listing of most recent 10 messages.', - 'drush watchdog-show 64' => 'Show in detail message with id 64.', - 'drush watchdog-show "cron run succesful"' => 'Show a listing of most recent 10 messages containing the string "cron run succesful".', - 'drush watchdog-show --count=46' => 'Show a listing of most recent 46 messages.', - 'drush watchdog-show --severity=notice' => 'Show a listing of most recent 10 messages with a severity of notice.', - 'drush watchdog-show --type=php' => 'Show a listing of most recent 10 messages of type php.', - 'drush watchdog-show --tail --extended' => 'Show a listing of most recent 10 messages with extended information about each one and continue showing messages as they are registered in the watchdog.', - 'drush watchdog-show --tail --sleep-delay=2' => 'Do a tail of the watchdog with a delay of two seconds between each poll to the database.', - ), - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'var_export', - 'field-labels' => array('wid' => 'ID', 'type' => 'Type', 'message' => 'Message', 'severity' => 'Severity', 'location' => 'Location', 'hostname' => 'Hostname', 'date' => 'Date', 'username' => 'Username'), - 'fields-default' => array('wid', 'date', 'type', 'severity', 'message'), - 'column-widths' => array('type' => 8, 'severity' => 8), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('wd-show', 'ws', 'watchdog:show'), - ); - $items['watchdog-delete'] = array( - 'description' => 'Delete watchdog messages.', - 'drupal dependencies' => array('dblog'), - 'options' => array( - 'severity' => 'Delete messages of a given severity level.', - 'type' => 'Delete messages of a given type.', - ), - 'examples' => array( - 'drush watchdog-delete all' => 'Delete all messages.', - 'drush watchdog-delete 64' => 'Delete messages with id 64.', - 'drush watchdog-delete "cron run succesful"' => 'Delete messages containing the string "cron run succesful".', - 'drush watchdog-delete --severity=notice' => 'Delete all messages with a severity of notice.', - 'drush watchdog-delete --type=cron' => 'Delete all messages of type cron.', - ), - 'aliases' => array('wd-del', 'wd-delete', 'watchdog:delete'), - ); - return $items; -} - -/** - * Command callback. - */ -function drush_core_watchdog_list() { - drush_include_engine('drupal', 'environment'); - - $options['-- types --'] = dt('== message types =='); - $types = drush_watchdog_message_types(); - foreach ($types as $key => $type) { - $options[$key] = $type; - } - $options['-- levels --'] = dt('== severity levels =='); - $severities = drush_watchdog_severity_levels(); - foreach ($severities as $key => $value) { - $options[$key] = "$value($key)"; - } - $option = drush_choice($options, dt('Select a message type or severity level.')); - if ($option === FALSE) { - return drush_user_abort(); - } - if (isset($types[$option])) { - drush_set_option('type', $types[$option]); - } - else { - drush_set_option('severity', $option - $ntypes); - } - return drush_core_watchdog_show_many(); -} - -/** - * Command callback. - */ -function drush_core_watchdog_show($arg = NULL) { - drush_include_engine('drupal', 'environment'); - - if (is_numeric($arg)) { - return drush_core_watchdog_show_one($arg); - } - else { - return drush_core_watchdog_show_many($arg); - } -} - -/** - * Print a watchdog message. - * - * @param $wid - * The id of the message to show. - */ -function drush_core_watchdog_show_one($wid) { - drush_set_default_outputformat('key-value-list', array('fields-default' => array('wid', 'type', 'message', 'severity', 'date'),)); - $rsc = drush_db_select('watchdog', '*', 'wid = :wid', array(':wid' => $wid), 0, 1); - $result = drush_db_fetch_object($rsc); - if (!$result) { - return drush_set_error(dt('Watchdog message #!wid not found.', array('!wid' => $wid))); - } - $result = core_watchdog_format_result($result, TRUE); - return array($result->wid => (array)$result); -} - -/** - * Print a table of watchdog messages. - * - * @param $filter - * String to filter the message's text by. - */ -function drush_core_watchdog_show_many($filter = NULL) { - $count = drush_get_option('count', 10); - $type = drush_get_option('type'); - $severity = drush_get_option('severity'); - $tail = drush_get_option('tail', FALSE); - $extended = drush_get_option('extended', FALSE); - - $where = core_watchdog_query($type, $severity, $filter); - if ($where === FALSE) { - return drush_log(dt('Aborting.')); - } - $rsc = drush_db_select('watchdog', '*', $where['where'], $where['args'], 0, $count, 'wid', 'DESC'); - if ($rsc === FALSE) { - return drush_log(dt('Aborting.')); - } - $table = array(); - while ($result = drush_db_fetch_object($rsc)) { - $row = core_watchdog_format_result($result, $extended); - $table[$row->wid] = (array)$row; - } - if (empty($table) && !$tail) { - drush_log(dt('No log messages available.'), LogLevel::OK); - return array(); - } - else { - drush_log(dt('Most recent !count watchdog log messages:', array('!count' => $count))); - } - if ($tail) { - $field_list = array('wid' => 'ID', 'date' => 'Date', 'severity' => 'Severity', 'type' => 'Type', 'message' => 'Message'); - $table = array_reverse($table); - $table_rows = drush_rows_of_key_value_to_array_table($table, $field_list, array()); - $tbl = drush_print_table($table_rows, TRUE); - // Reuse the table object to display each line generated while in tail mode. - // To make it possible some hacking is done on the object: - // remove the header and reset the rows on each iteration. - $tbl->_headers = NULL; - // Obtain the last wid. If the table has no rows, start at 0. - if (count($table_rows) > 1) { - $last = array_pop($table_rows); - $last_wid = $last[0]; - } - else { - $last_wid = 0; - } - // Adapt the where snippet. - if ($where['where'] != '') { - $where['where'] .= ' AND '; - } - $where['where'] .= 'wid > :wid'; - // sleep-delay - $sleep_delay = drush_get_option('sleep-delay', 1); - while (TRUE) { - $where['args'][':wid'] = $last_wid; - $table = array(); - // Reset table rows. - $tbl->_data = array(); - $rsc = drush_db_select('watchdog', '*', $where['where'], $where['args'], NULL, NULL, 'wid', 'ASC'); - while ($result = drush_db_fetch_object($rsc)) { - $row = core_watchdog_format_result($result, $extended); - $table[] = array($row->wid, $row->date, $row->severity, $row->type, $row->message); - #$tbl->addRow(array($row->wid, $row->date, $row->severity, $row->type, $row->message)); - $last_wid = $row->wid; - } - $tbl->addData($table); - print $tbl->_buildTable(); - sleep($sleep_delay); - } - } - return $table; -} - -/** - * Format a watchdog database row. - * - * @param $result - * Array. A database result object. - * @param $extended - * Boolean. Return extended message details. - * @return - * Array. The result object with some attributes themed. - */ -function core_watchdog_format_result($result, $extended = FALSE) { - // Severity. - $severities = drush_watchdog_severity_levels(); - $result->severity = $severities[$result->severity]; - - // Date. - $result->date = format_date($result->timestamp, 'custom', 'd/M H:i'); - unset($result->timestamp); - - // Message. - $variables = $result->variables; - if (is_string($variables)) { - $variables = unserialize($variables); - } - if (is_array($variables)) { - $result->message = strtr($result->message, $variables); - } - unset($result->variables); - $message_length = 188; - - // Print all the data available - if ($extended) { - // Possible empty values. - if (empty($result->link)) { - unset($result->link); - } - if (empty($result->referer)) { - unset($result->referer); - } - // Username. - if ($account = user_load($result->uid)) { - $result->username = $account->name; - } - else { - $result->username = dt('Anonymous'); - } - unset($result->uid); - $message_length = PHP_INT_MAX; - } - - if (drush_drupal_major_version() >= 8) { - $result->message = Unicode::truncate(strip_tags(Html::decodeEntities($result->message)), $message_length, FALSE, FALSE); - } - else { - $result->message = truncate_utf8(strip_tags(decode_entities($result->message)), $message_length, FALSE, FALSE); - } - - return $result; -} - -/** - * Command callback. - * - * @param $arg - * The id of the message to delete or 'all'. - */ -function drush_core_watchdog_delete($arg = NULL) { - drush_include_engine('drupal', 'environment'); - - if ($arg == 'all') { - drush_print(dt('All watchdog messages will be deleted.')); - if (!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - drush_db_delete('watchdog'); - drush_log(dt('All watchdog messages have been deleted.'), LogLevel::OK); - } - else if (is_numeric($arg)) { - drush_print(dt('Watchdog message #!wid will be deleted.', array('!wid' => $arg))); - if(!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - $affected_rows = drush_db_delete('watchdog', 'wid=:wid', array(':wid' => $arg)); - if ($affected_rows == 1) { - drush_log(dt('Watchdog message #!wid has been deleted.', array('!wid' => $arg)), LogLevel::OK); - } - else { - return drush_set_error(dt('Watchdog message #!wid does not exist.', array('!wid' => $arg))); - } - } - else { - $type = drush_get_option('type'); - $severity = drush_get_option('severity'); - if ((!isset($arg))&&(!isset($type))&&(!isset($severity))) { - return drush_set_error(dt('No options provided.')); - } - $where = core_watchdog_query($type, $severity, $arg, 'OR'); - if ($where === FALSE) { - // Drush set error was already called by core_watchdog_query - return FALSE; - } - drush_print(dt('All messages with !where will be deleted.', array('!where' => preg_replace("/message LIKE %$arg%/", "message body containing '$arg'" , strtr($where['where'], $where['args']))))); - if(!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - $affected_rows = drush_db_delete('watchdog', $where['where'], $where['args']); - drush_log(dt('!affected_rows watchdog messages have been deleted.', array('!affected_rows' => $affected_rows)), LogLevel::OK); - } -} - -/** - * Build a WHERE snippet based on given parameters. - * - * @param $type - * String. Valid watchdog type. - * @param $severity - * Int or String for a valid watchdog severity message. - * @param $filter - * String. Value to filter watchdog messages by. - * @param $criteria - * ('AND', 'OR'). Criteria for the WHERE snippet. - * @return - * False or array with structure ('where' => string, 'args' => array()) - */ -function core_watchdog_query($type = NULL, $severity = NULL, $filter = NULL, $criteria = 'AND') { - $args = array(); - $conditions = array(); - if ($type) { - $types = drush_watchdog_message_types(); - if (array_search($type, $types) === FALSE) { - $msg = "Unrecognized message type: !type.\nRecognized types are: !types."; - return drush_set_error('WATCHDOG_UNRECOGNIZED_TYPE', dt($msg, array('!type' => $type, '!types' => implode(', ', $types)))); - } - $conditions[] = "type = :type"; - $args[':type'] = $type; - } - if (isset($severity)) { - $severities = drush_watchdog_severity_levels(); - if (isset($severities[$severity])) { - $level = $severity; - } - elseif (($key = array_search($severity, $severities)) !== FALSE) { - $level = $key; - } - else { - $level = FALSE; - } - if ($level === FALSE) { - foreach ($severities as $key => $value) { - $levels[] = "$value($key)"; - } - $msg = "Unknown severity level: !severity.\nValid severity levels are: !levels."; - return drush_set_error(dt($msg, array('!severity' => $severity, '!levels' => implode(', ', $levels)))); - } - $conditions[] = 'severity = :severity'; - $args[':severity'] = $level; - } - if ($filter) { - $conditions[] = "message LIKE :filter"; - $args[':filter'] = '%'.$filter.'%'; - } - - $where = implode(" $criteria ", $conditions); - - return array('where' => $where, 'args' => $args); -} diff --git a/vendor/drush/drush/commands/make/generate.contents.make.inc b/vendor/drush/drush/commands/make/generate.contents.make.inc deleted file mode 100644 index a7a17e0541e5043e283bd44039555babc0219757..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/make/generate.contents.make.inc +++ /dev/null @@ -1,364 +0,0 @@ -<?php -/** - * @file - * Functions for the generate makefile command. - */ - -use Drush\Log\LogLevel; - -/** - * Generate the actual contents of the .make file. - */ -function _drush_make_generate_makefile_contents($projects, $libraries = array(), $core_version = NULL, $defaults = array()) { - if (is_null($core_version)) { - $core_version = drush_get_drupal_core_compatibility(); - } - - $header = array(); - $header[] = '; This file was auto-generated by drush make'; - $header['core'] = $core_version; - $header['api'] = MAKE_API; - $header[] = ''; - if (!empty($defaults)) { - _drush_make_generate_defaults($defaults, $header); - $header[] = ''; - } - $header[] = '; Core'; - - return _drush_make_generate_makefile_body($projects, $header) . _drush_make_generate_makefile_body($libraries); -} - -function _drush_make_generate_makefile_body($projects, $output = array()) { - $custom = FALSE; - $previous_type = 'core'; - if (isset($projects)) { - foreach ($projects as $name => $project) { - $type = (isset($project['type']) && ($project['type'] == 'library')) ? 'libraries' : 'projects'; - if ($previous_type != $project['_type']) { - $previous_type = $project['_type']; - $output[] = '; ' . ucfirst($previous_type) . 's'; - } - unset($project['_type']); - if (!$project && is_string($name)) { - $output[] = $type . '[] = "' . $name . '"'; - continue; - } - $base = $type . '[' . $name . ']'; - if (isset($project['custom_download'])) { - $custom = TRUE; - $output[] = '; Please fill the following out. Type may be one of get, git, bzr or svn,'; - $output[] = '; and url is the url of the download.'; - $output[$base . '[download][type]'] = '""'; - $output[$base . '[download][url]'] = '""'; - unset($project['custom_download']); - } - - $output = array_merge($output, _drush_make_generate_lines($base, $project)); - $output[] = ''; - } - } - $string = ''; - foreach ($output as $k => $v) { - if (!is_numeric($k)) { - $string .= $k . ' = ' . $v; - } - else { - $string .= $v; - } - $string .= "\n"; - } - if ($custom) { - drush_log(dt('Some of the properties in your makefile will have to be manually edited. Please do that now.'), LogLevel::WARNING); - } - return $string; -} - -/** - * Write a makefile based on data parsed from a previous makefile. - * - * @param $file - * The path to the file to write our generated makefile to, or TRUE to - * print to the terminal. - * @param $makefile - * A makefile on which to base our generated one. - */ -function make_generate_from_makefile($file, $makefile) { - if (!$info = make_parse_info_file($makefile)) { - return drush_set_error('MAKE_GENERATE_FAILED_PARSE', dt('Failed to parse makefile :makefile.', array(':makefile' => $makefile))); - } - $projects = drush_get_option('DRUSH_MAKE_PROJECTS', FALSE); - if ($projects === FALSE) { - $projects = make_prepare_projects(FALSE, $info); - if (isset($projects['contrib'])) { - $projects = array_merge($projects['core'], $projects['contrib']); - } - } - - $defaults = isset($info['defaults']) ? $info['defaults'] : array(); - $core = current($projects); - $core = $core['core']; - foreach ($projects as $name => $project) { - // If a specific revision was requested, do not set the version. - if (!isset($project['revision'])) { - $projects[$name]['version'] = isset($project['download']['full_version']) ? $project['download']['full_version'] : ''; - if ($project['type'] != 'core' && strpos($projects[$name]['version'], $project['core']) === 0) { - $projects[$name]['version'] = substr($projects[$name]['version'], strlen($project['core'] . '-')); - } - } - else { - unset($projects[$name]['version']); - } - $projects[$name]['_type'] = $project['type']; - - if ($project['download']['type'] == 'git') { - drush_make_resolve_git_refs($projects[$name]); - } - - // Don't clutter the makefile with defaults - if (is_array($defaults)) { - foreach ($defaults as $type => $defs) { - if ($type == 'projects') { - foreach ($defs as $key => $value) { - if (isset($project[$key]) && $project[$key] == $value) { - unset($projects[$name][$key]); - } - } - } - } - } - if ($project['name'] == $name) { - unset($projects[$name]['name']); - } - if ($project['type'] == 'module' && !isset($info[$name]['type'])) { - unset($projects[$name]['type']); // Module is the default - } - if (!(isset($project['download']['type'])) || ($project['download']['type'] == 'pm')) { - unset($projects[$name]['download']); // PM is the default - } - $ignore = array('build_path', 'contrib_destination', 'core', 'make_directory', 'l10n_url', 'download_type'); - foreach ($ignore as $key) { - unset($projects[$name][$key]); - } - - // Remove the location if it's the default. - if ($projects[$name]['location'] == 'https://updates.drupal.org/release-history') { - unset($projects[$name]['location']); - } - - // Remove empty entries (e.g. 'directory_name') - $projects[$name] = _make_generate_array_filter($projects[$name]); - } - - $libraries = drush_get_option('DRUSH_MAKE_LIBRARIES', FALSE); - if ($libraries === FALSE) { - $libraries = isset($info['libraries']) ? $info['libraries'] : array(); - } - if (is_array($libraries)) { - foreach ($libraries as $name => $library) { - $libraries[$name]['type'] = 'library'; - $libraries[$name]['_type'] = 'librarie'; - - if ($library['download']['type'] == 'git') { - drush_make_resolve_git_refs($libraries[$name]); - } - } - } - - $contents = make_generate_makefile_contents($projects, $libraries, $core, $defaults); - - // Write or print our makefile. - $file = $file !== TRUE ? $file : NULL; - make_generate_print($contents, $file); -} - -/** - * Resolve branches and revisions for git-based projects. - */ -function drush_make_resolve_git_refs(&$project) { - if (!isset($project['download']['branch'])) { - $project['download']['branch'] = drush_make_resolve_git_branch($project); - } - if (!isset($project['download']['revision'])) { - $project['download']['revision'] = drush_make_resolve_git_revision($project); - } -} - -/** - * Resolve branch for a git-based project. - */ -function drush_make_resolve_git_branch($project) { - drush_log(dt('Resolving default branch for repo at: :repo', array(':repo' => $project['download']['url']))); - if (drush_shell_exec("git ls-remote %s HEAD", $project['download']['url'])) { - $head_output = drush_shell_exec_output(); - list($head_commit) = explode("\t", $head_output[0]); - - drush_log(dt('Scanning branches in repo at: :repo', array(':repo' => $project['download']['url']))); - drush_shell_exec("git ls-remote --heads %s", $project['download']['url']); - $heads_output = drush_shell_exec_output(); - $branches = array(); - foreach ($heads_output as $key => $head) { - list($commit, $ref) = explode("\t", $head); - $branches[$commit] = explode("/", $ref)[2]; - } - - $branch = $branches[$head_commit]; - drush_log(dt('Resolved git branch to: :branch', array(':branch' => $branch))); - return $branch; - } - else { - drush_log(dt('Could not resolve branch for `:project` using git repo at :repo', array(':project' => $project['name'], ':repo' => $project['download']['url'])), 'warning'); - } -} - -/** - * Resolve revision for a git-based project. - */ -function drush_make_resolve_git_revision($project) { - drush_log(dt('Resolving head commit on `:branch` branch for repo at: :repo', array(':branch' => $project['download']['branch'], ':repo' => $project['download']['url']))); - if (drush_shell_exec("git ls-remote %s %s", $project['download']['url'], $project['download']['branch'])) { - $head_output = drush_shell_exec_output(); - list($revision) = explode("\t", $head_output[0]); - drush_log(dt('Resolved git revision to: :revision', array(':revision' => $revision))); - return $revision; - } - else { - drush_log(dt('Could not resolve head commit for `:project` using git repo at :repo', array(':project' => $project['name'], ':repo' => $project['download']['url'])), 'warning'); - } -} - -/** - * Generate makefile contents in the appropriate format. - */ -function make_generate_makefile_contents($projects, $libraries = array(), $core = NULL, $defaults = array()) { - $format = drush_get_option('format', 'yaml'); - $func = "make_generate_makefile_contents_$format"; - if (function_exists($func)) { - $contents = call_user_func($func, $projects, $libraries, $core, $defaults); - } - else { - return drush_set_error('MAKE_UNKNOWN_OUTPUT_FORMAT', dt('Generating makefiles in the :format output format is not yet supported. Implement :func() to add such support.', array(':format' => $format, ':func' => $func))); - } - return $contents; -} - -/** - * Generate makefile contents in (legacy) INI format. - */ -function make_generate_makefile_contents_ini($projects, $libraries, $core, $defaults) { - return _drush_make_generate_makefile_contents($projects, $libraries, $core, $defaults); -} - -/** - * Generate makefile contents in YAML format. - */ -function make_generate_makefile_contents_yaml($projects, $libraries, $core, $defaults) { - $info = array( - 'core' => $core, - 'api' => MAKE_API, - 'defaults' => $defaults, - 'projects' => $projects, - 'libraries' => $libraries, - ); - - $info = _make_generate_array_filter($info); - $info = _make_generate_array_filter_key('_type', $info); - $dumper = drush_load_engine('outputformat', 'yaml'); - $yaml = $dumper->format($info, array()); - - return $yaml; -} - -/** - * Helper function to recursively remove empty values from an array (but not - * '0'!). - */ -function _make_generate_array_filter($haystack) { - foreach ($haystack as $key => $value) { - if (is_array($value)) { - $haystack[$key] = _make_generate_array_filter($haystack[$key]); - } - if (empty($value) && $value !== '0') { - unset($haystack[$key]); - } - } - return $haystack; -} - -/** - * Helper function to recursively remove elements matching a specific key from an array. - */ -function _make_generate_array_filter_key($needle, $haystack) { - foreach ($haystack as $key => $value) { - if ($key === $needle) { - unset($haystack[$key]); - } - elseif (is_array($value)) { - $haystack[$key] = _make_generate_array_filter_key($needle, $haystack[$key]); - } - } - return $haystack; -} - -/** - * Print the generated makefile to the terminal, or write it to a file. - * - * @param $contents - * The formatted contents of a makefile. - * @param $file - * (optional) The path to write the makefile. - */ -function make_generate_print($contents, $file = NULL) { - if (!$file) { - drush_print($contents); - } - elseif (file_put_contents($file, $contents)) { - drush_log(dt("Wrote .make file @file", array('@file' => $file)), LogLevel::OK); - } - else { - make_error('FILE_ERROR', dt("Unable to write .make file !file", array('!file' => $file))); - } -} - -/** - * Utility function to generate the line or lines for a key/value pair in the - * make file. - * - * @param $base - * The base for the configuration lines. Values will be appended to it as - * [$key] = $value, or if value is an array itself it will expand into as many - * lines as required. - * @param $values - * May be a single value or an array. - * @return - * An array of strings that represent lines for the make file. - */ -function _drush_make_generate_lines($base, $values) { - $output = array(); - - if (is_array($values)) { - foreach ($values as $key => $value) { - $newbase = $base . '[' . $key . ']'; - $output = array_merge($output, _drush_make_generate_lines($newbase, $value)); - } - } - else { - $output[$base] = '"' . $values . '"'; - } - - return $output; -} - -function _drush_make_generate_defaults($defaults, &$output = array()) { - $output[] = '; Defaults'; - foreach ($defaults as $name => $project) { - $type = 'defaults'; - if (!$project && is_string($name)) { - $output[] = $type . '[] = "' . $name . '"'; - continue; - } - $base = $type . '[' . $name . ']'; - - $output = array_merge($output, _drush_make_generate_lines($base, $project)); - } -} - diff --git a/vendor/drush/drush/commands/make/generate.make.inc b/vendor/drush/drush/commands/make/generate.make.inc deleted file mode 100644 index a180b788ad4221413561d6081aafad3c82cbf587..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/make/generate.make.inc +++ /dev/null @@ -1,308 +0,0 @@ -<?php -/** - * @file - * Functions for the generate makefile command. - */ - -include_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; -include_once drupal_get_path('module', 'system') . '/system.install'; -include_once 'generate.contents.make.inc'; - -/** - * Drush callback; generate makefile from the current build. - */ -function drush_make_generate($file = NULL) { - $version_options = _drush_make_generate_get_version_options(); - $all_extensions = drush_get_extensions(); - list($projects, $libraries) = _drush_make_generate_projects($all_extensions, $version_options); - $core = drush_drupal_major_version() . '.x'; - $contents = make_generate_makefile_contents($projects, $libraries, $core); - - // Write or print our makefile. - make_generate_print($contents, $file); -} - -/** - * Create the $version_options array from the --include-versions and - * --exclude-versions command line options. - */ -function _drush_make_generate_get_version_options() { - // What projects should we pin the versions for? - // Check the command-line options for details. - foreach (array("include", "exclude") as $option) { - $version_options[$option] = drush_get_option("$option-versions"); - if ($version_options[$option] !== TRUE) { - $version_options[$option] = array_filter(explode(",", $version_options[$option])); - } - } - return $version_options; -} - -/** - * Generate the $projects makefile array for the current site. - */ -function _drush_make_generate_projects($all_extensions, $version_options) { - $release_info = drush_get_engine('release_info'); - - $projects = array(); - $project_libraries = array(); - - $system_requirements = system_requirements('runtime'); - // Update xml expects the drupal version to be expressed as "7.x" or "8.x" - // We used to check $system_requirements['drupal']['value'], but this now - // contains values such as "7.10-dev". - $drupal_major_version = drush_drupal_major_version() . '.x'; - $core_project = strtolower($system_requirements['drupal']['title']); - $projects[$core_project] = array('_type' => 'core'); - if ($core_project != 'drupal') { - $projects[$core_project]['custom_download'] = TRUE; - $projects[$core_project]['type'] = 'core'; - } - else { - // Drupal core - we can determine the version if required. - if (_drush_generate_track_version("drupal", $version_options)) { - $projects[$core_project]["version"] = drush_drupal_version(); - } - } - - $install_profile = drush_drupal_major_version() >= 7 ? drupal_get_profile() : variable_get('install_profile', ''); - if (!in_array($install_profile, array('default', 'standard', 'minimal', 'testing')) && $install_profile != '') { - $projects[$install_profile]['type'] - = $projects[$install_profile]['_type'] = 'profile'; - $request = array( - 'name' => $install_profile, - 'drupal_version' => $drupal_major_version, - ); - if (!$release_info->checkProject($request, 'profile')) { - $projects[$install_profile]['custom_download'] = TRUE; - } - } - - // Iterate installed projects to build $projects array. - $extensions = $all_extensions; - $project_info = drush_get_projects($extensions); - foreach ($project_info as $name => $project) { - // Discard the extensions within this project. At the end $extensions will - // contain only extensions part of custom projects (not from drupal.org or - // other update service). - foreach ($project['extensions'] as $ext) { - unset($extensions[$ext]); - } - if ($name == 'drupal') { - continue; - } - $type = $project['type']; - // Discard projects with all modules disabled. - if (($type == 'module') && (!$project['status'])) { - continue; - } - $projects[$name] = array('_type' => $type); - // Check the project is on drupal.org or its own update service. - $request = array( - 'name' => $name, - 'drupal_version' => $drupal_major_version, - ); - if (isset($project['status url'])) { - $request['status url'] = $project['status url']; - $projects[$name]['location'] = $project['status url']; - } - if (!$release_info->checkProject($request, $type)) { - // It is not a project on drupal.org neither an external update service. - $projects[$name]['type'] = $type; - $projects[$name]['custom_download'] = TRUE; - } - // Add 'subdir' if the project is installed in a non-default location. - if (isset($project['path'])) { - $projects[$name] += _drush_generate_makefile_check_path($project); - } - // Add version number if this project's version is to be tracked. - if (_drush_generate_track_version($name, $version_options) && $project["version"]) { - $version = preg_replace("/^" . drush_get_drupal_core_compatibility() . "-/", "", $project["version"]); - // Strip out MINOR+GIT_COMMIT strings for dev releases. - if (substr($version, -4) == '-dev' && strpos($version, '+')) { - $version = substr($version, 0, strrpos($version, '.')) . '.x-dev'; - } - $projects[$name]['version'] = $version; - } - foreach ($project['extensions'] as $extension_name) { - _drush_make_generate_add_patch_files($projects[$name], _drush_extension_get_path($all_extensions[$extension_name])); - } - } - - // Add a project for each unknown extension. - foreach ($extensions as $name => $extension) { - list($project_name, $project_data) = _drush_generate_custom_project($name, $extension, $version_options); - $projects[$project_name] = $project_data; - } - - // Add libraries. - if (function_exists('libraries_get_libraries')) { - $libraries = libraries_get_libraries(); - foreach ($libraries as $library_name => $library_path) { - $path = explode('/', $library_path); - $project_libraries[$library_name] = array( - 'directory_name' => $path[(count($path) - 1)], - 'custom_download' => TRUE, - 'type' => 'library', - '_type' => 'librarie', // For plural. - ); - } - } - return array($projects, $project_libraries); -} - -/** - * Record any patches that were applied to this project - * per information stored in PATCHES.txt. - */ -function _drush_make_generate_add_patch_files(&$project, $location) { - $patchfile = DRUPAL_ROOT . '/' . $location . '/PATCHES.txt'; - if (is_file($patchfile)) { - foreach (file($patchfile) as $line) { - if (substr($line, 0, 2) == '- ') { - $project['patch'][] = trim(substr($line, 2)); - } - } - } -} - -/** - * Create a project record for an extension not downloaded from drupal.org - */ -function _drush_generate_custom_project($name, $extension, $version_options) { - $project['_type'] = drush_extension_get_type($extension); - $project['type'] = drush_extension_get_type($extension); - $location = drush_extension_get_path($extension); - // To start off, we will presume that our custom extension is - // stored in a folder named after its project, and there are - // no subfolders between the .info file and the project root. - $project_name = basename($location); - drush_shell_cd_and_exec($location, 'git rev-parse --git-dir 2> ' . drush_bit_bucket()); - $output = drush_shell_exec_output(); - if (!empty($output)) { - $git_dir = $output[0]; - // Find the actual base of the git repository. - $repo_root = $git_dir == ".git" ? $location : dirname($git_dir); - // If the repository root is at the drupal root or some parent - // of the drupal root, or some other location that could not - // pausibly be a project, then there is nothing we can do. - // (We can't tell Drush make to download some sub-part of a repo, - // can we?) - if ($repo_project_name = _drush_generate_validate_repo_location($repo_root)) { - $project_name = $repo_project_name; - drush_shell_cd_and_exec($repo_root, 'git remote show origin'); - $output = drush_shell_exec_output(); - foreach ($output as $line) { - if (strpos($line, "Fetch URL:") !== FALSE) { - $url = preg_replace('/ *Fetch URL: */', '', $line); - if (!empty($url)) { - // We use the unconventional-looking keys - // `download][type` and `download][url` so that - // we can produce output that appears to be two-dimensional - // arrays from a single-dimensional array. - $project['download][type'] = 'git'; - $project['download][url'] = $url; - - // Fill in the branch as well. - drush_shell_cd_and_exec($repo_root, 'git branch'); - $output = drush_shell_exec_output(); - foreach ($output as $line) { - if ($line{0} == '*') { - $branch = substr($line, 2); - if ($branch != "master") { - $project['download][branch'] = $branch; - } - } - } - - // Put in the commit hash. - drush_shell_cd_and_exec($repo_root, 'git log'); - $output = drush_shell_exec_output(); - if (substr($output[0], 0, 7) == "commit ") { - $revision = substr($output[0], 7); - if (_drush_generate_track_version($project_name, $version_options)) { - $project['download][revision'] = $revision; - } - } - - // Add patch files, if any. - _drush_make_generate_add_patch_files($project, $repo_root); - } - } - } - } - } - // If we could not figure out where the extension came from, then give up and - // flag it as a "custom" download. - if (!isset($project['download][type'])) { - $project['custom_download'] = TRUE; - } - return array($project_name, $project); -} - -/** - * If the user has checked in the Drupal root, or the 'sites/all/modules' - * folder into a git repository, then we do not want to confuse that location - * with a "project". - */ -function _drush_generate_validate_repo_location($repo_root) { - $project_name = basename($repo_root); - // The Drupal root, or any folder immediately inside the Drupal - // root cannot be a project location. - if ((strlen(DRUPAL_ROOT) >= strlen($repo_root)) || (dirname($repo_root) == DRUPAL_ROOT)) { - return NULL; - } - // Also exclude sites/* and sites/*/{modules,themes} and profile/* and - // profile/*/{modules,themes}. - return $project_name; -} - -/** - * Helper function to determine if a given project is to have its version - * tracked. - */ -function _drush_generate_track_version($project, $version_options) { - // A. If --exclude-versions has been specified: - // A.a. if it's a boolean, check the --include-versions option. - if ($version_options["exclude"] === TRUE) { - // A.a.1 if --include-versions has been specified, ensure it's an array. - if (is_array($version_options["include"])) { - return in_array($project, $version_options["include"]); - } - // A.a.2 If no include array, then we're excluding versions for ALL - // projects. - return FALSE; - } - // A.b. if --exclude-versions is an array with items, check this project is in - // it: if so, then return FALSE. - elseif (is_array($version_options["exclude"]) && count($version_options["exclude"])) { - return !in_array($project, $version_options["exclude"]); - } - - // B. If by now no --exclude-versions, but --include-versions is an array, - // examine it for this project. - if (is_array($version_options["include"]) && count($version_options["include"])) { - return in_array($project, $version_options["include"]); - } - - // If none of the above conditions match, include version number by default. - return TRUE; -} - -/** - * Helper function to check for a non-default installation location. - */ -function _drush_generate_makefile_check_path($project) { - $info = array(); - $type = $project['type']; - $path = dirname($project['path']); - // Check to see if the path is in a subdir sites/all/modules or - // profiles/profilename/modules - if (preg_match('@^sites/[a-zA-Z0-9_]*/' . $type . 's/..*@', $path) || preg_match('@^sites/[a-zA-Z0-9_]*/' . $type . 's/..*@', $path)) { - $subdir = preg_replace(array('@^[a-zA-Z0-9_]*/[a-zA-Z0-9_]*/' . $type . 's/*@', "@/$name" . '$@'), '', $path); - if (!empty($subdir)) { - $info['subdir'] = $subdir; - } - } - return $info; -} diff --git a/vendor/drush/drush/commands/make/lock.make.inc b/vendor/drush/drush/commands/make/lock.make.inc deleted file mode 100644 index d7bc41da28c029b48dd35bd1f2605c27058f53ef..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/make/lock.make.inc +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * @file - * make-lock command implementation. - */ - -/** - * Command callback for make-lock. - */ -function drush_make_lock($makefile) { - make_generate_from_makefile(drush_get_option('result-file'), $makefile); -} diff --git a/vendor/drush/drush/commands/make/make.download.inc b/vendor/drush/drush/commands/make/make.download.inc deleted file mode 100644 index 13365d3c62d3cb114499a5f55f23dcb61cd39a5c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/make/make.download.inc +++ /dev/null @@ -1,548 +0,0 @@ -<?php -/** - * @file - * Download-specific functions for Drush Make. - */ - -use Drush\Log\LogLevel; - -/** - * Downloads the given package to the destination directory. - * - * @return mixed - * The destination path on success, FALSE on failure. - */ -function make_download_factory($name, $type, $download, $download_location) { - $function = 'make_download_' . $download['type']; - if (function_exists($function)) { - return $function($name, $type, $download, $download_location); - } - else { - return FALSE; - } -} - -/** - * Download project using drush's pm-download command. - */ -function make_download_pm($name, $type, $download, $download_location) { - $full_project_version = $name . '-' . $download['full_version']; - - $options = array( - 'destination' => dirname($download_location), - 'yes' => TRUE, - 'package-handler' => 'wget', - 'source' => $download['status url'], - // This is only relevant for profiles, but we generally want the variant to - // be 'profile-only' so we don't end up with extra copies of core. - 'variant' => $type == 'core' ? 'full' : $download['variant'], - 'cache' => TRUE, - ); - if ($type == 'core') { - $options['drupal-project-rename'] = basename($download_location); - } - if (drush_get_option('no-cache', FALSE)) { - unset($options['cache']); - } - - $backend_options = array(); - if (!drush_get_option(array('verbose', 'debug'), FALSE)) { - $backend_options['integrate'] = TRUE; - $backend_options['log'] = FALSE; - } - - // Perform actual download with `drush pm-download`. - $return = drush_invoke_process('@none', 'pm-download', array($full_project_version), $options, $backend_options); - if (empty($return['error_log'])) { - // @todo Report the URL we used for download. See - // http://drupal.org/node/1452672. - drush_log(dt('@project downloaded.', array('@project' => $full_project_version)), LogLevel::OK); - } -} - -/** - * Downloads a file to the specified location. - * - * @return mixed - * The destination directory on success, FALSE on failure. - */ -function make_download_file($name, $type, $download, $download_location, $cache_duration = DRUSH_CACHE_LIFETIME_DEFAULT) { - if ($filename = _make_download_file($download['url'], $cache_duration)) { - if (!drush_get_option('ignore-checksums') && !_make_verify_checksums($download, $filename)) { - return FALSE; - } - drush_log(dt('@project downloaded from @url.', array('@project' => $name, '@url' => $download['url'])), LogLevel::OK); - $download_filename = isset($download['filename']) ? $download['filename'] : ''; - $subtree = isset($download['subtree']) ? $download['subtree'] : NULL; - return make_download_file_unpack($filename, $download_location, $download_filename, $subtree); - } - make_error('DOWNLOAD_ERROR', dt('Unable to download @project from @url.', array('@project' => $name, '@url' => $download['url']))); - return FALSE; -} - -/** - * Wrapper to drush_download_file(). - * - * @param string $download - * The url of the file to download. - * @param int $cache_duration - * The time in seconds to cache the resultant download. - * - * @return string - * The location of the downloaded file, or FALSE on failure. - */ -function _make_download_file($download, $cache_duration = DRUSH_CACHE_LIFETIME_DEFAULT) { - if (drush_get_option('no-cache', FALSE)) { - $cache_duration = 0; - } - - $tmp_path = make_tmp(); - // Ensure that we aren't including the querystring when generating a filename - // to save our download to. - $file = basename(current(explode('?', $download, 2))); - return drush_download_file($download, $tmp_path . '/' . $file, $cache_duration); -} - -/** - * Unpacks a file to the specified download location. - * - * @return mixed - * The download location on success, FALSE on failure. - */ -function make_download_file_unpack($filename, $download_location, $name, $subtree = NULL) { - $success = FALSE; - - if (drush_file_is_tarball($filename)) { - $tmp_location = drush_tempdir(); - - if (!drush_tarball_extract($filename, $tmp_location)) { - return FALSE; - } - - if ($subtree) { - $tmp_location .= '/' . $subtree; - if (!file_exists($tmp_location)) { - return drush_set_error('DRUSH_MAKE_SUBTREE_NOT_FOUND', dt('Directory !subtree not found within !file', array('!subtree' => $subtree, '!file' => $filename))); - } - } - else { - $files = scandir($tmp_location); - unset($files[0]); // . directory - unset($files[1]); // .. directory - if ((count($files) == 1) && is_dir($tmp_location . '/' . current($files))) { - $tmp_location .= '/' . current($files); - } - } - - $success = drush_move_dir($tmp_location, $download_location, TRUE); - - // Remove the tarball. - if (file_exists($filename)) { - drush_delete_dir($filename, TRUE); - } - } - else { - // If this is an individual file, and no filename has been specified, - // assume the original name. - if (is_file($filename) && !$name) { - $name = basename($filename); - } - - // The destination directory has already been created by - // findDownloadLocation(). - $destination = $download_location . ($name ? '/' . $name : ''); - $success = drush_move_dir($filename, $destination, TRUE); - } - return $success ? $download_location : FALSE; -} - -/** - * Move a downloaded and unpacked file or directory into place. - */ -function _make_download_file_move($tmp_path, $filename, $download_location, $subtree = NULL) { - $lines = drush_scan_directory($tmp_path, '/./', array('.', '..'), 0, FALSE, 'filename', 0, TRUE); - $main_directory = basename($download_location); - if (count($lines) == 1) { - $directory = array_shift($lines); - if ($directory->basename != $main_directory) { - drush_move_dir($directory->filename, $tmp_path . DIRECTORY_SEPARATOR . $main_directory, TRUE); - } - drush_copy_dir($tmp_path . DIRECTORY_SEPARATOR . $main_directory . DIRECTORY_SEPARATOR . $subtree, $download_location, FILE_EXISTS_OVERWRITE); - drush_delete_dir($tmp_path, TRUE); - } - elseif (count($lines) > 1) { - drush_delete_dir($download_location, TRUE); - drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . $subtree, $download_location, TRUE); - } - - // Remove the tarball. - if (file_exists($filename)) { - drush_delete_dir($filename, TRUE); - } - - if (file_exists($tmp_path)) { - drush_delete_dir($tmp_path, TRUE); - } - return TRUE; -} - - -/** - * For backwards compatibility. - */ -function make_download_get($name, $type, $download, $download_location) { - return make_download_file($name, $type, $download, $download_location); -} - -/** - * Copies a folder the specified location. - * - * @return mixed - * The TRUE on success, FALSE on failure. - */ -function make_download_copy($name, $type, $download, $download_location) { - if ($folder = _make_download_copy($download['url'])) { - drush_log(dt('@project copied from @url.', array('@project' => $name, '@url' => $download['url'])), LogLevel::OK); - return drush_copy_dir($folder, $download_location, FILE_EXISTS_OVERWRITE); - } - make_error('COPY_ERROR', dt('Unable to copy @project from @url.', array('@project' => $name, '@url' => $download['url']))); - return FALSE; -} - -/** - * Wrapper to drush_download_copy(). - * - * @param string $folder - * The location of the folder to copy. - * - * @return string - * The location of the folder, or FALSE on failure. - */ -function _make_download_copy($folder) { - if (substr($folder, 0, 7) == 'file://') { - $folder = substr($folder, 7); - } - - if (is_dir($folder)) { - return $folder; - } - return FALSE; -} - -/** - * Checks out a git repository to the specified download location. - * - * Allowed parameters in $download, in order of precedence: - * - 'tag' - * - 'revision' - * - 'branch' - * - * This will also attempt to write out release information to the - * .info file if the 'no-gitinfofile' option is FALSE. If - * $download['full_version'] is present, this will be used, otherwise, - * version will be set in this order of precedence: - * - 'tag' - * - 'branch' - * - 'revision' - * - * @return mixed - * The download location on success, FALSE otherwise. - */ -function make_download_git($name, $type, $download, $download_location) { - $tmp_path = make_tmp(); - $wc = _get_working_copy_option($download); - $checkout_after_clone = TRUE; - // If no download URL specified, assume anonymous clone from git.drupal.org. - $download['url'] = isset($download['url']) ? $download['url'] : "https://git.drupal.org/project/$name.git"; - // If no working-copy download URL specified, assume it is the same. - $download['wc_url'] = isset($download['wc_url']) ? $download['wc_url'] : $download['url']; - - // If not a working copy, and if --no-cache has not been explicitly - // declared, create a new git reference cache of the remote repository, - // or update the existing cache to fetch recent changes. - // @see package_handler_download_project() - $cache = !$wc && !drush_get_option('no-cache', FALSE); - if ($cache && ($git_cache = drush_directory_cache('git'))) { - $project_cache = $git_cache . '/' . $name . '-' . md5($download['url']); - // Set up a new cache, if it doesn't exist. - if (!file_exists($project_cache)) { - $command = 'git clone --mirror'; - if (drush_get_context('DRUSH_VERBOSE')) { - $command .= ' --verbose --progress'; - } - $command .= ' %s %s'; - drush_shell_cd_and_exec($git_cache, $command, $download['url'], $project_cache); - } - else { - // Update the --mirror clone. - drush_shell_cd_and_exec($project_cache, 'git remote update'); - } - $git_cache = $project_cache; - } - - // Use working-copy download URL if --working-copy specified. - $url = $wc ? $download['wc_url'] : $download['url']; - - $tmp_location = drush_tempdir() . '/' . basename($download_location); - - $command = 'git clone %s %s'; - if (drush_get_context('DRUSH_VERBOSE')) { - $command .= ' --verbose --progress'; - } - if ($cache) { - $command .= ' --reference ' . drush_escapeshellarg($git_cache); - } - - // the shallow clone option is only applicable to git entries which reference a tag or a branch - if (drush_get_option('shallow-clone', FALSE) && - (!empty($download['tag']) || !empty($download['branch']))) { - - $branch = (!empty($download['branch']) ? $download['branch'] : $download['tag']); - $command .= " --depth=1 --branch=${branch}"; - - // since the shallow copy option automatically "checks out" the requested branch, no further - // actions are needed after the clone command - $checkout_after_clone = FALSE; - } - - // Before we can checkout anything, we need to clone the repository. - if (!drush_shell_exec($command, $url, $tmp_location)) { - make_error('DOWNLOAD_ERROR', dt('Unable to clone @project from @url.', array('@project' => $name, '@url' => $url))); - return FALSE; - } - - drush_log(dt('@project cloned from @url.', array('@project' => $name, '@url' => $url)), LogLevel::OK); - - if ($checkout_after_clone) { - // Get the current directory (so we can move back later). - $cwd = getcwd(); - // Change into the working copy of the cloned repo. - chdir($tmp_location); - - // We want to use the most specific target possible, so first try a refspec. - if (!empty($download['refspec'])) { - if (drush_shell_exec("git fetch %s %s", $url, $download['refspec'])) { - drush_log(dt("Fetched refspec !refspec.", array('!refspec' => $download['refspec'])), LogLevel::OK); - - if (drush_shell_exec("git checkout FETCH_HEAD")) { - drush_log(dt("Checked out FETCH_HEAD."), LogLevel::INFO); - } - } - else { - make_error('DOWNLOAD_ERROR', dt("Unable to fetch the refspec @refspec from @project.", array('@refspec' => $download['refspec'], '@project' => $name))); - } - } - - // If there wasn't a refspec, try a tag. - elseif (!empty($download['tag'])) { - // @TODO: change checkout to refs path. - if (drush_shell_exec("git checkout %s", 'refs/tags/' . $download['tag'])) { - drush_log(dt("Checked out tag @tag.", array('@tag' => $download['tag'])), LogLevel::OK); - } - else { - make_error('DOWNLOAD_ERROR', dt("Unable to check out tag @tag.", array('@tag' => $download['tag']))); - } - } - - // If there wasn't a tag, try a specific revision hash. - elseif (!empty($download['revision'])) { - if (drush_shell_exec("git checkout %s", $download['revision'])) { - drush_log(dt("Checked out revision @revision.", array('@revision' => $download['revision'])), LogLevel::OK); - } - else { - make_error('DOWNLOAD_ERROR', dt("Unable to checkout revision @revision", array('@revision' => $download['revision']))); - } - } - - // If not, see if we at least have a branch. - elseif (!empty($download['branch'])) { - if (drush_shell_exec("git checkout %s", $download['branch']) && (trim(implode(drush_shell_exec_output())) != '')) { - drush_log(dt("Checked out branch @branch.", array('@branch' => $download['branch'])), LogLevel::OK); - } - elseif (drush_shell_exec("git checkout -b %s %s", $download['branch'], 'origin/' . $download['branch'])) { - drush_log(dt('Checked out branch origin/@branch.', array('@branch' => $download['branch'])), LogLevel::OK); - } - else { - make_error('DOWNLOAD_ERROR', dt('Unable to check out branch @branch.', array('@branch' => $download['branch']))); - } - } - - if (!empty($download['submodule'])) { - $command = 'git submodule update'; - foreach ($download['submodule'] as $option) { - $command .= ' --%s'; - } - if (call_user_func_array('drush_shell_exec', array_merge(array($command), $download['submodule']))) { - drush_log(dt('Initialized registered submodules.'), LogLevel::OK); - } - else { - make_error('DOWNLOAD_ERROR', dt('Unable to initialize submodules.')); - } - } - - // Move back to last current directory (first line). - chdir($cwd); - } - - // Move the directory into the final resting location. - drush_copy_dir($tmp_location, $download_location, FILE_EXISTS_OVERWRITE); - - return dirname($tmp_location); -} - -/** - * Checks out a Bazaar repository to the specified download location. - * - * @return mixed - * The download location on success, FALSE otherwise. - */ -function make_download_bzr($name, $type, $download, $download_location) { - $tmp_path = make_tmp(); - $tmp_location = drush_tempdir() . '/' . basename($download_location); - $wc = _get_working_copy_option($download); - if (!empty($download['url'])) { - $args = array(); - $command = 'bzr'; - if ($wc) { - $command .= ' branch --use-existing-dir'; - } - else { - $command .= ' export'; - } - if (isset($download['revision'])) { - $command .= ' -r %s'; - $args[] = $download['revision']; - } - $command .= ' %s %s'; - if ($wc) { - $args[] = $download['url']; - $args[] = $tmp_location; - } - else { - $args[] = $tmp_location; - $args[] = $download['url']; - } - array_unshift($args, $command); - if (call_user_func_array('drush_shell_exec', $args)) { - drush_log(dt('@project downloaded from @url.', array('@project' => $name, '@url' => $download['url'])), LogLevel::OK); - drush_copy_dir($tmp_location, $download_location, FILE_EXISTS_OVERWRITE); - return dirname($download_location); - } - } - else { - $download['url'] = dt("unspecified location"); - } - make_error('DOWNLOAD_ERROR', dt('Unable to download @project from @url.', array('@project' => $name, '@url' => $download['url']))); - drush_delete_dir(dirname($tmp_location), TRUE); - return FALSE; -} - -/** - * Checks out an SVN repository to the specified download location. - * - * @return mixed - * The download location on success, FALSE otherwise. - */ -function make_download_svn($name, $type, $download, $download_location) { - $wc = _get_working_copy_option($download); - if (!empty($download['url'])) { - if (!empty($download['interactive'])) { - $function = 'drush_shell_exec_interactive'; - } - else { - $options = ' --non-interactive'; - $function = 'drush_shell_exec'; - } - if (!isset($download['force']) || $download['force']) { - $options = ' --force'; - } - if ($wc) { - $command = 'svn' . $options . ' checkout'; - } - else { - $command = 'svn' . $options . ' export'; - } - - $args = array(); - - if (isset($download['revision'])) { - $command .= ' -r%s'; - $args[] = $download['revision']; - } - - $command .= ' %s %s'; - $args[] = $download['url']; - $args[] = $download_location; - - if (!empty($download['username'])) { - $command .= ' --username %s'; - $args[] = $download['username']; - if (!empty($download['password'])) { - $command .= ' --password %s'; - $args[] = $download['password']; - } - } - array_unshift($args, $command); - $result = call_user_func_array($function, $args); - if ($result) { - $args = array( - '@project' => $name, - '@command' => $command, - '@url' => $download['url'], - ); - drush_log(dt('@project @command from @url.', $args), LogLevel::OK); - return $download_location; - } - else { - $download['url'] = dt("unspecified location"); - } - } - else { - make_error('DOWNLOAD_ERROR', dt('Unable to download @project from @url.', array('@project' => $name, '@url' => $download['url']))); - return FALSE; - } -} - -/** - * Test that any supplied hash values match the hash of the file content. - * - * Unsupported hash algorithms are reported as failure. - */ -function _make_verify_checksums($info, $filename) { - $hash_algos = array('md5', 'sha1', 'sha256', 'sha512'); - // We only have something to do if a key is an - // available function. - if (array_intersect(array_keys($info), $hash_algos)) { - $content = file_get_contents($filename); - foreach ($hash_algos as $algo) { - if (!empty($info[$algo])) { - $hash = _make_hash($algo, $content); - if ($hash !== $info[$algo]) { - $args = array( - '@algo' => $algo, - '@file' => basename($filename), - '@expected' => $info[$algo], - '@hash' => $hash, - ); - make_error('DOWNLOAD_ERROR', dt('Checksum @algo verification failed for @file. Expected @expected, received @hash.', $args)); - return FALSE; - } - } - } - } - return TRUE; -} - -/** - * Calculate the hash of a string for a given algorithm. - */ -function _make_hash($algo, $string) { - switch ($algo) { - case 'md5': - return md5($string); - case 'sha1': - return sha1($string); - default: - return function_exists('hash') ? hash($algo, $string) : ''; - } -} diff --git a/vendor/drush/drush/commands/make/make.drush.inc b/vendor/drush/drush/commands/make/make.drush.inc deleted file mode 100644 index 32e6813627d84b2bb3c6e2a4642c0545065cf4c4..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/make/make.drush.inc +++ /dev/null @@ -1,1237 +0,0 @@ -<?php -/** - * @file - * Drush Make commands. - */ - -use Drush\Log\LogLevel; -use Drush\UpdateService\ReleaseInfo; - -/** - * Default localization server for downloading translations. - */ -define('MAKE_DEFAULT_L10N_SERVER', 'http://ftp.drupal.org/files/translations/l10n_server.xml'); - -/** - * Make refuses to build makefiles whose api version is mismatched - * with make command. - */ -define('MAKE_API', 2); - -include_once 'make.utilities.inc'; -include_once 'make.download.inc'; -include_once 'make.project.inc'; -include_once 'generate.contents.make.inc'; - -/** - * Implements hook_drush_help(). - */ -function make_drush_help($section) { - switch ($section) { - case 'meta:make:title': - return dt('Make commands'); - case 'meta:make:summary': - return dt('Manage Drupal codebases using manifests of projects and libraries.'); - case 'drush:make': - return dt('Turns a makefile into a Drupal codebase. For a full description of options and makefile syntax, see docs/make.txt and examples/example.make.'); - case 'drush:make-generate': - return dt('Generate a makefile from the current Drupal site, specifying project version numbers unless not known or otherwise specified. Unversioned projects will be interpreted later by drush make as "most recent stable release"'); - } -} - -/** - * Implements hook_drush_command(). - */ -function make_drush_command() { - $projects = array( - 'description' => 'Restrict the make to this comma-separated list of projects. To specify all projects, pass *.', - 'example-value' => 'views,ctools', - ); - $libraries = array( - 'description' => 'Restrict the make to this comma-separated list of libraries. To specify all libraries, pass *.', - 'example-value' => 'tinymce', - ); - - $items['make'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'description' => 'Turns a makefile into a working Drupal codebase.', - 'arguments' => array( - 'makefile' => 'Filename of the makefile to use for this build.', - 'build path' => 'The path at which to build the makefile.', - ), - 'examples' => array( - 'drush make example.make example' => 'Build the example.make makefile in the example directory.', - 'drush make --no-core --contrib-destination=. installprofile.make' => 'Build an installation profile within an existing Drupal site', - 'drush make http://example.com/example.make example' => 'Build the remote example.make makefile in the example directory.', - 'drush make example.make --no-build --lock=example.lock' => 'Write a new makefile to example.lock. All project versions will be resolved.', - ), - 'options' => array( - 'version' => 'Print the make API version and exit.', - 'concurrency' => array( - 'description' => 'Set the number of concurrent projects that will be processed at the same time. The default is 1.', - 'example-value' => '1', - ), - 'contrib-destination' => 'Specify a path under which modules and themes should be placed. Defaults to sites/all for Drupal 6,7 and the corresponding directory in the Drupal root for Drupal 8 and above.', - 'force-complete' => 'Force a complete build even if errors occur.', - 'ignore-checksums' => 'Ignore md5 checksums for downloads.', - 'md5' => array( - 'description' => 'Output an md5 hash of the current build after completion. Use --md5=print to print to stdout.', - 'example-value' => 'print', - 'value' => 'optional', - ), - 'make-update-default-url' => 'The default location to load the XML update information from.', - 'no-build' => 'Do not build a codebase. Makes the `build path` argument optional.', - 'no-cache' => 'Do not use the pm-download caching (defaults to cache enabled).', - 'no-clean' => 'Leave temporary build directories in place instead of cleaning up after completion.', - 'no-core' => 'Do not require a Drupal core project to be specified.', - 'no-recursion' => 'Do not recurse into the makefiles of any downloaded projects; you can also set [do_recursion] = 0 on a per-project basis in the makefile.', - 'no-patch-txt' => 'Do not write a PATCHES.txt file in the directory of each patched project.', - 'no-gitinfofile' => 'Do not modify .info files when cloning from Git.', - 'force-gitinfofile' => 'Force a modification of .info files when cloning from Git even if repository isn\'t hosted on Drupal.org.', - 'no-gitprojectinfo' => 'Do not inject project info into .info files when cloning from Git.', - 'overwrite' => 'Overwrite existing directories. Default is to merge.', - 'prepare-install' => 'Prepare the built site for installation. Generate a properly permissioned settings.php and files directory.', - 'tar' => 'Generate a tar archive of the build. The output filename will be [build path].tar.gz.', - 'test' => 'Run a temporary test build and clean up.', - 'translations' => 'Retrieve translations for the specified comma-separated list of language(s) if available for all projects.', - 'working-copy' => 'Preserves VCS directories, like .git, for projects downloaded using such methods.', - 'download-mechanism' => 'How to download files. Should be autodetected, but this is an override if it doesn\'t work. Options are "curl" and "make" (a native download method).', - 'projects' => $projects, - 'libraries' => $libraries, - 'allow-override' => array( - 'description' => 'Restrict the make options to a comma-separated list. Defaults to unrestricted.', - ), - 'lock' => array( - 'description' => 'Generate a makefile, based on the one passed in, with all versions *resolved*. Defaults to printing to the terminal, but an output file may be provided.', - 'example-value' => 'example.make.lock', - ), - 'shallow-clone' => array( - 'description' => 'For makefile entries which use git for downloading, this option will utilize shallow clones where possible (ie. by using the git-clone\'s depth=1 option). If the "working-copy" option is not desired, this option will significantly speed up makes which involve modules stored in very large git repos. In fact, if "working-copy" option is enabled, this option cannot be used.', - ), - 'bundle-lockfile' => array( - 'description' => 'Generate a lockfile for this build and copy it into the codebase (at sites/all/drush/platform.lock). An alternate path (relative to the Drupal root) can also be specified', - 'example-value' => 'sites/all/drush/example.make.lock', - ), - 'format' => array( - 'description' => 'The format for generated lockfiles. Options are "yaml" or "ini". Defaults to "yaml".', - 'example-value' => 'ini', - ), - 'core-quick-drupal' => array( - 'description' => 'Return project info for use by core-quick-drupal.', - 'hidden' => TRUE, - ), - 'includes' => 'A list of makefiles to include at build-time.', - 'overrides' => 'A list of makefiles to that can override values in other makefiles.', - ), - 'engines' => array('release_info'), - 'topics' => array('docs-make', 'docs-make-example'), - ); - - $items['make-generate'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - 'description' => 'Generate a makefile from the current Drupal site.', - 'examples' => array( - 'drush generate-makefile example.make' => 'Generate a makefile with ALL projects versioned (should a project have a known version number)', - 'drush generate-makefile example.make --exclude-versions' => 'Generate a makefile with NO projects versioned', - 'drush generate-makefile example.make --exclude-versions=drupal,views,cck' => 'Generate a makefile with ALL projects versioned EXCEPT core, Views and CCK', - 'drush generate-makefile example.make --include-versions=admin_menu,og,ctools (--exclude-versions)' => 'Generate a makefile with NO projects versioned EXCEPT Admin Menu, OG and CTools.', - ), - 'options' => array( - 'exclude-versions' => 'Exclude all version numbers (default is include all version numbers) or optionally specify a list of projects to exclude from versioning', - 'include-versions' => 'Include a specific list of projects, while all other projects remain unversioned in the makefile (so implies --exclude-versions)', - 'format' => array( - 'description' => 'The format for generated makefile. Options are "yaml" or "ini". Defaults to "yaml".', - 'example-value' => 'ini', - ), - ), - 'engines' => array('release_info'), - 'aliases' => array('generate-makefile'), - ); - - $items['make-convert'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'description' => 'Convert a legacy makefile into another format. Defaults to converting .make => .make.yml.', - 'arguments' => array( - 'makefile' => 'Filename of the makefile to convert.', - ), - 'options' => array( - 'projects' => $projects, - 'libraries' => $libraries, - 'includes' => 'A list of makefiles to include at build-time.', - 'format' => 'The format to which the make file should be converted. Accepted values include make, composer, and yml.', - ), - 'required-arguments' => TRUE, - 'examples' => array( - 'drush make-convert example.make --format=composer > composer.json' => 'Convert example.make to composer.json', - 'drush make-convert example.make --format=yml > example.make.yml' => 'Convert example.make to example.make.yml', - 'drush make-convert composer.lock --format=make > example.make' => 'Convert composer.lock example.make', - ), - ); - - // Hidden command to build a group of projects. - $items['make-process'] = array( - 'hidden' => TRUE, - 'arguments' => array( - 'directory' => 'The temporary working directory to use', - ), - 'options' => array( - 'projects-location' => 'Name of a temporary file containing json-encoded output of make_projects().', - 'manifest' => 'An array of projects already being processed.', - ), - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'engines' => array('release_info'), - ); - - $items['make-update'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'description' => 'Process a makefile and outputs an equivalent makefile with projects version resolved to latest available.', - 'arguments' => array( - 'makefile' => 'Filename of the makefile to use for this build.', - ), - 'options' => array( - 'result-file' => array( - 'description' => 'Save to a file. If not provided, the updated makefile will be dumped to stdout.', - 'example-value' => 'updated.make', - ), - 'format' => array( - 'description' => 'The format for generated lockfiles. Options are "yaml" or "ini". Defaults to "yaml".', - 'example-value' => 'ini', - ), - 'includes' => 'A list of makefiles to include at build-time.', - ), - 'engines' => array('release_info', 'update_status'), - ); - - $items['make-lock'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'description' => 'Process a makefile and outputs an equivalent makefile with projects version *resolved*. Respects pinned versions.', - 'arguments' => array( - 'makefile' => 'Filename of the makefile to use for this build.', - ), - 'options' => array( - 'result-file' => array( - 'description' => 'Save to a file. If not provided, the lockfile will be dumped to stdout.', - 'example-value' => 'platform.lock', - ), - 'format' => array( - 'description' => 'The format for generated lockfiles. Options are "yaml" or "ini". Defaults to "yaml".', - 'example-value' => 'ini', - ), - 'includes' => 'A list of makefiles to include at build-time.', - ), - 'allow-additional-options' => TRUE, - 'engines' => array('release_info', 'update_status'), - ); - - // Add docs topic. - $docs_dir = drush_get_context('DOC_PREFIX', DRUSH_BASE_PATH); - $items['docs-make'] = array( - 'description' => 'Drush Make overview with examples', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/docs/make.md'), - ); - $items['docs-make-example'] = array( - 'description' => 'Drush Make example makefile', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/examples/example.make.yml'), - ); - return $items; -} - -/** - * Command argument complete callback. - * - * @return array - * Strong glob of files to complete on. - */ -function make_make_complete() { - return array( - 'files' => array( - 'directories' => array( - 'pattern' => '*', - 'flags' => GLOB_ONLYDIR, - ), - 'make' => array( - 'pattern' => '*.make', - ), - ), - ); -} - -/** - * Validation callback for make command. - */ -function drush_make_validate($makefile = NULL, $build_path = NULL) { - // Don't validate if --version option is supplied. - if (drush_get_option('version', FALSE)) { - return; - } - - if (drush_get_option('shallow-clone', FALSE) && drush_get_option('working-copy', FALSE)) { - return drush_set_error('MAKE_SHALLOW_CLONE_WORKING_COPY_CONFLICT', dt('You cannot use "--shallow-clone" and "--working-copy" options together.')); - } - - // Error out if the build path is not valid and --no-build was not supplied. - if (!drush_get_option('no-build', FALSE) && !make_build_path($build_path)) { - return FALSE; - } -} - -/** - * Implements drush_hook_pre_COMMAND(). - * - * If --version option is supplied, print it and prevent execution of the command. - */ -function drush_make_pre_make($makefile = NULL, $build_path = NULL) { - if (drush_get_option('version', FALSE)) { - drush_print(dt('Drush make API version !version', array('!version' => MAKE_API))); - drush_print_pipe(MAKE_API); - // Prevent command execution. - return FALSE; - } -} - -/** - * Drush callback; make based on the makefile. - */ -function drush_make($makefile = NULL, $build_path = NULL) { - // Set the cache option based on our '--no-cache' option. - _make_enable_cache(); - - // Build. - if (!drush_get_option('no-build', FALSE)) { - $info = make_parse_info_file($makefile); - drush_log(dt('Beginning to build !makefile.', array('!makefile' => $makefile)), LogLevel::OK); - - // Default contrib destination depends on Drupal core version. - $core_version = str_replace('.x', '', $info['core'][0]); - $sitewide = drush_drupal_sitewide_directory($core_version); - $contrib_destination = drush_get_option('contrib-destination', $sitewide); - - $build_path = make_build_path($build_path); - $make_dir = realpath(dirname($makefile)); - - $success = make_projects(FALSE, $contrib_destination, $info, $build_path, $make_dir); - if ($success) { - make_libraries(FALSE, $contrib_destination, $info, $build_path, $make_dir); - - if (drush_get_option('prepare-install')) { - make_prepare_install($build_path); - } - if ($option = drush_get_option('md5')) { - $md5 = make_md5(); - if ($option === 'print') { - drush_print($md5); - } - else { - drush_log(dt('Build hash: %md5', array('%md5' => $md5)), LogLevel::OK); - } - } - // Only take final build steps if not in testing mode. - if (!drush_get_option('test')) { - if (drush_get_option('tar')) { - make_tar($build_path); - } - else { - make_move_build($build_path); - } - } - make_clean_tmp(); - } - else { - return make_error('MAKE_PROJECTS_FAILED', dt('Drush Make failed to download all projects. See the log above for the specific errors.')); - } - } - - // Process --lock and --bundle-lockfile - $lockfiles = array(); - if ($result_file = drush_get_option('bundle-lockfile', FALSE)) { - if ($result_file === TRUE) { - $result_file = 'sites/all/drush/platform.make'; - } - $lockfiles[] = $build_path . '/' . $result_file; - } - if ($result_file = drush_get_option('lock', FALSE)) { - $lockfiles[] = $result_file; - } - if (count($lockfiles)) { - foreach ($lockfiles as $lockfile) { - if ($lockfile !== TRUE) { - $result_file = drush_normalize_path($lockfile); - drush_mkdir(dirname($result_file), $required = TRUE); - drush_set_option('result-file', $result_file); - } - drush_invoke('make-lock', $makefile); - drush_unset_option('result-file'); - } - } - - // Used by core-quick-drupal command. - // @see drush_core_quick_drupal(). - if (drush_get_option('core-quick-drupal', FALSE)) { - return $info; - } -} - -/** - * Command callback; convert ini makefile to YAML. - */ -function drush_make_convert($source) { - $dest_format = drush_get_option('format', 'yml'); - - // Load source data. - $source_format = pathinfo($source, PATHINFO_EXTENSION); - - if ($source_format == $dest_format || $source_format == 'lock' && $dest_format == 'composer') { - drush_print('The source format cannot be the same as the destination format.'); - } - - // Obtain drush make $info array, converting if necessary. - switch ($source_format) { - case 'make': - case 'yml': - case 'yaml': - $info = make_parse_info_file($source); - break; - case 'lock': - $composer_json_file = str_replace('lock', 'json', $source); - if (!file_exists($composer_json_file)) { - drush_print('Please ensure that a composer.json file is in the same directory as the specified composer.lock file.'); - return FALSE; - } - $composer_json = json_decode(make_get_data($composer_json_file), TRUE); - $composer_lock = json_decode(make_get_data($source), TRUE); - $info = drush_make_convert_composer_to_make($composer_lock, $composer_json); - break; - case 'json': - drush_print('Please use composer.lock instead of composer.json as source for conversion.'); - return FALSE; - break; - } - - // Output into destination formation. - switch ($dest_format) { - case 'yml': - case 'yaml': - $output = drush_make_convert_make_to_yml($info); - break; - - case 'make': - foreach ($info['projects'] as $key => $project) { - $info['projects'][$key]['_type'] = $info['projects'][$key]['type']; - } - foreach ($info['libraries'] as $key => $library) { - $info['libraries'][$key]['_type'] = 'librarie'; - } - $output = _drush_make_generate_makefile_contents($info['projects'], $info['libraries'], $info['core'], $info['defaults']); - - break; - - case 'composer': - $output = drush_make_convert_make_to_composer($info); - break; - } - - drush_print($output); -} - -/** - * Converts a composer.lock array into a traditional drush make array. - * - * @param array $composer_lock - * An array of composer.lock data. - * - * @param array $composer_json - * An array of composer.json data. - * - * @return array A traditional drush make info array. - * A traditional drush make info array. - */ -function drush_make_convert_composer_to_make($composer_lock, $composer_json) { - $info = array( - 'core' => array(), - 'api' => 2, - 'defaults' => array( - 'projects' => array( - 'subdir' => 'contrib', - ), - ), - 'projects' => array(), - 'libraries' => array(), - ); - - // The make generation function requires that projects be grouped by type, - // or else duplicative project groups will be created. - $core = array(); - $modules = array(); - $themes = array(); - $profiles = array(); - $libraries = array(); - foreach ($composer_lock['packages'] as $key => $package) { - if (strpos($package['name'], 'drupal/') === 0 && in_array($package['type'], array('drupal-core', 'drupal-theme', 'drupal-module', 'drupal-profile'))) { - $project_name = str_replace('drupal/', '', $package['name']); - - switch ($package['type']) { - case 'drupal-core': - $project_name = 'drupal'; - $group =& $core; - $group[$project_name]['type'] = 'core'; - $info['core'] = substr($package['version'], 0, 1) . '.x'; - break; - case 'drupal-theme': - $group =& $themes; - $group[$project_name]['type'] = 'theme'; - break; - case 'drupal-module': - $group =& $modules; - $group[$project_name]['type'] = 'module'; - break; - case 'drupal-profile': - $group =& $profiles; - $group[$project_name]['type'] = 'profile'; - break; - } - - $group[$project_name]['download']['type'] = 'git'; - $group[$project_name]['download']['url'] = $package['source']['url']; - // Dev versions should use git branch + revision, otherwise a tag is used. - if (strstr($package['version'], 'dev')) { - // 'dev-' prefix indicates a branch-alias. Stripping the dev prefix from - // the branch name is sufficient. - // @see https://getcomposer.org/doc/articles/aliases.md - if (strpos($package['version'], 'dev-') === 0) { - $group[$project_name]['download']['branch'] = substr($package['version'], 4); - } - // Otherwise, leave as is. Version may already use '-dev' suffix. - else { - $group[$project_name]['download']['branch'] = $package['version']; - } - $group[$project_name]['download']['revision'] = $package['source']['reference']; - } - elseif ($package['type'] == 'drupal-core') { - // For 7.x tags, replace 7.xx.0 with 7.xx. - if ($info['core'] == '7.x') { - $group[$project_name]['download']['tag']= substr($package['version'], 0, 4); - } - else { - $group[$project_name]['download']['tag'] = $package['version']; - } - } - else { - // Make tag versioning drupal-friendly. 8.1.0-alpha1 => 8.x-1.0-alpha1. - $major_version = substr($package['version'], 0 ,1); - $the_rest = substr($package['version'], 2, strlen($package['version'])); - $group[$project_name]['download']['tag'] = "$major_version.x-$the_rest"; - } - - if (!empty($package['extra']['patches_applied'])) { - foreach ($package['extra']['patches_applied'] as $desc => $url) { - $group[$project_name]['patch'][] = $url; - } - } - } - // Include any non-drupal libraries that exist in both .lock and .json. - elseif (!in_array($package['type'], array('composer-plugin', 'metapackage')) - && array_key_exists($package['name'], $composer_json['require'])) { - $project_name = $package['name']; - $libraries[$project_name]['type'] = 'library'; - $libraries[$project_name]['download']['type'] = 'git'; - $libraries[$project_name]['download']['url'] = $package['source']['url']; - $libraries[$project_name]['download']['branch'] = $package['version']; - $libraries[$project_name]['download']['revision'] = $package['source']['reference']; - } - } - - $info['projects'] = $core + $modules + $themes; - $info['libraries'] = $libraries; - - return $info; -} - -/** - * Converts a drush info array to a composer.json array. - * - * @param array $info - * A drush make info array. - * - * @return string - * A json encoded composer.json schema object. - */ -function drush_make_convert_make_to_composer($info) { - $core_major_version = substr($info['core'], 0, 1); - $core_project_name = $core_major_version == 7 ? 'drupal/drupal' : 'drupal/core'; - - if ($core_major_version == 7) { - // Add PHP version and extension requirements. - $php_reqs = array( - 'php' => '>= 5.2.5', - 'ext-curl' => '*', - 'ext-gd' => '*', - 'ext-json' => '*', - 'ext-openssl' => '*', - 'ext-pdo' => '*', - 'ext-pdo_mysql' => '*', - 'ext-xml' => '*', - ); - - // Add default projects. - $projects = array( - 'composer/installers' => '^1.2', - 'cweagans/composer-patches' => '^1.6', - 'drupal-composer/preserve-paths' => '^0.1', - 'drush/drush' => '~8.0', - $core_project_name => str_replace('x', '*', $info['core']), - ); - - $conflict = array( - 'drupal/core' => '8.*', - ); - - $extra = array( - 'installer-paths' => array( - 'web' => array('type:drupal-core'), - 'web/profiles/{$name}' => array('type:drupal-profile'), - 'web/sites/all/drush/{$name}' => array('type:drupal-drush'), - 'web/sites/all/libraries/{$name}' => array('type:drupal-library'), - 'web/sites/all/modules/contrib/{$name}' => array('type:drupal-module'), - 'web/sites/all/themes/contrib/{$name}' => array('type:drupal-theme'), - ), - 'patches' => array(), - 'preserve-paths' => array( - 'web/sites/all/drush', - 'web/sites/all/libraries', - 'web/sites/all/modules/contrib', - 'web/sites/all/modules/custom', - 'web/sites/all/modules/features', - 'web/sites/all/themes/contrib', - 'web/sites/all/themes/custom', - 'web/sites/all/translations', - 'web/sites/default' - ), - ); - } - else { - $php_reqs = array(); - - // Add default projects. - $projects = array( - 'composer/installers' => '^1.2', - 'cweagans/composer-patches' => '^1.6', - 'drush/drush' => '^9.0.0', - $core_project_name => str_replace('x', '*', $info['core']), - ); - - $conflict = array( - 'drupal/drupal' => '*', - ); - - $extra = array( - 'installer-paths' => array( - 'web/core' => array('type:drupal-core'), - 'web/libraries/{$name}' => array('type:drupal-library'), - 'web/modules/contrib/{$name}' => array('type:drupal-module'), - 'web/profiles/contrib/{$name}' => array('type:drupal-profile'), - 'web/themes/contrib/{$name}' => array('type:drupal-theme'), - 'drush/contrib/{$name}' => array('type:drupal-drush'), - ), - 'patches' => array(), - ); - } - - // Iterate over projects, populating composer-friendly array. - foreach ($info['projects'] as $project_name => $project) { - switch ($project['type']) { - case 'core': - $project['name'] = $core_project_name; - $projects[$project['name']] = '^' . str_replace('x', '*', $project['version']); - break; - - default: - $project['name'] = "drupal/$project_name"; - $projects[$project['name']] = drush_make_convert_project_to_composer($project, $core_major_version); - break; - } - - // Add project patches. - if (!empty($project['patch'])) { - foreach($project['patch'] as $key => $patch) { - $patch_description = "Enter {$project['name']} patch #$key description here"; - $extra['patches'][$project['name']][$patch_description] = $patch; - } - } - } - - // Iterate over libraries, populating composer-friendly array. - if (!empty($info['libraries'])) { - foreach ($info['libraries'] as $library_name => $library) { - $library_name = 'Verify project name: ' . $library_name; - $projects[$library_name] = drush_make_convert_project_to_composer($library, $core_major_version); - } - } - - // Sort the projects to simplify pull requests on composer.json due to the - // sort-packages configuration. - ksort($projects); - - $output = array( - 'name' => 'Enter project name here', - 'description' => 'Enter project description here', - 'type' => 'project', - 'repositories' => array( - array('type' => 'composer', 'url' => 'https://packages.drupal.org/' . $core_major_version), - ), - 'require' => array_merge($php_reqs, $projects), - 'conflict'=> $conflict, - 'minimum-stability' => 'dev', - 'prefer-stable' => TRUE, - 'config' => array( - 'sort-packages' => TRUE, - ), - 'extra' => $extra, - ); - - $output = json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); - - return $output; -} - -/** - * Converts a make file project array into a composer project version string. - * - * @param array $original_project - * A project dependency, as defined in a make file. - * - * @param string $core_major_version - * The major core version. E.g., 6, 7, 8, etc. - * - * @return string - * The project version, in composer syntax. - * - */ -function drush_make_convert_project_to_composer($original_project, $core_major_version) { - // Typical specified version with major version "x" removed. - if (!empty($original_project['version'])) { - $version = drush_make_convert_version_to_composer($original_project['version']); - } - // Git branch or revision. - elseif (!empty($original_project['download'])) { - switch ($original_project['download']['type']) { - case 'git': - if (!empty($original_project['download']['branch'])) { - $version = drush_make_convert_version_to_composer($original_project['download']['branch']); - } - if (!empty($original_project['download']['tag'])) { - $version = drush_make_convert_version_to_composer($original_project['download']['tag']); - } - if (!empty($project['download']['revision'])) { - $version .= '#' . $original_project['download']['revision']; - } - break; - - default: - $version = 'Enter correct project name and version number'; - break; - } - } - - return $version; -} - -/** - * Converts a drush version into a composer version. - * - * @param string $version - * Original drush version. - * - * @return string - * The converted composer version. - */ -function drush_make_convert_version_to_composer($version) { - $cver = '*'; - if (!empty($version)) { - if (substr($version, -3) === 'dev') { - // Dev versions maintain the 7.x-dev syntax. - $cver = $version; - } - else { - // Replace '1.x' with '^1.*'. - $cver = '^' . str_replace('x', '*', $version); - } - } - - return $cver; -} - -/** - * Converts a drush info array to a YAML array. - * - * @param array $info - * A drush make info array. - * - * @return string - * A yaml encoded info array. - */ -function drush_make_convert_make_to_yml($info) { - // Remove incorrect value. - unset($info['format']); - - // Replace "*" with "~" for project versions. - foreach ($info['projects'] as $key => $project) { - if ($project['version'] == '*') { - $info['projects'][$key]['version'] = '~'; - } - } - - $dumper = drush_load_engine('outputformat', 'yaml'); - $output = $dumper->format($info, array()); - - return $output; -} - -/** - * Drush callback: hidden file to process an individual project. - * - * @param string $directory - * Directory where the project is being built. - */ -function drush_make_process($directory) { - drush_get_engine('release_info'); - - // Set the temporary directory. - make_tmp(TRUE, $directory); - if (!$projects_location = drush_get_option('projects-location')) { - return drush_set_error('MAKE-PROCESS', dt('No projects passed to drush_make_process')); - } - $projects = json_decode(file_get_contents($projects_location), TRUE); - $manifest = drush_get_option('manifest', array()); - - foreach ($projects as $project) { - if ($instance = DrushMakeProject::getInstance($project['type'], $project)) { - $instance->setManifest($manifest); - $instance->make(); - } - else { - make_error('PROJECT-TYPE', dt('Non-existent project type %type on project %project.', array('%type' => $project['type'], '%project' => $project['name']))); - } - } -} - -/** - * Gather additional data on all projects specified in the make file. - */ -function make_prepare_projects($recursion, $info, $contrib_destination = '', $build_path = '', $make_dir = '') { - $release_info = drush_get_engine('release_info'); - - // Nothing to make if the project list is empty. Maybe complain about it. - if (empty($info['projects'])) { - if (drush_get_option('no-core') || $recursion) { - return TRUE; - } - else { - return drush_set_error('MAKE_NO_CORE', dt('No core project specified.')); - } - } - - // Obtain translations to download along with the projects. - $translations = array(); - if (isset($info['translations'])) { - $translations = $info['translations']; - } - if ($arg_translations = drush_get_option('translations', FALSE)) { - $translations = array_merge(explode(',', $arg_translations), $translations); - } - - // Normalize projects. - $projects = array(); - $ignore_checksums = drush_get_option('ignore-checksums'); - foreach ($info['projects'] as $key => $project) { - // Merge the known data onto the project info. - $project += array( - 'name' => $key, - 'type' => 'module', - 'core' => $info['core'], - 'translations' => $translations, - 'build_path' => $build_path, - 'contrib_destination' => $contrib_destination, - 'version' => '', - 'location' => drush_get_option('make-update-default-url', ReleaseInfo::DEFAULT_URL), - 'subdir' => '', - 'directory_name' => '', - 'make_directory' => $make_dir, - 'options' => array(), - ); - // MD5 Checksum. - if ($ignore_checksums) { - unset($project['download']['md5']); - } - elseif (!empty($project['md5'])) { - $project['download']['md5'] = $project['md5']; - } - - // If download components are specified, but not the download - // type, default to git. - if (isset($project['download']) && !isset($project['download']['type'])) { - $project['download']['type'] = 'git'; - } - // Localization server. - if (!isset($project['l10n_url']) && ($project['location'] == ReleaseInfo::DEFAULT_URL)) { - $project['l10n_url'] = MAKE_DEFAULT_L10N_SERVER; - } - // Classify projects in core or contrib. - if ($project['type'] == 'core') { - $project['download_type'] = 'core'; - } - elseif ($project['location'] != ReleaseInfo::DEFAULT_URL || !isset($project['download'])) { - $request = make_prepare_request($project); - $is_core = $release_info->checkProject($request, 'core'); - $project['download_type'] = ($is_core ? 'core' : 'contrib'); - $project['type'] = $is_core ? 'core' : $project['type']; - } - else { - $project['download_type'] = ($project['name'] == 'drupal' ? 'core' : 'contrib'); - } - $projects[$project['download_type']][$project['name']] = $project; - } - - // Verify there're enough cores, but not too many. - $cores = !empty($projects['core']) ? count($projects['core']) : 0; - if (drush_get_option('no-core')) { - unset($projects['core']); - } - elseif ($cores == 0 && !$recursion) { - return drush_set_error('MAKE_NO_CORE', dt('No core project specified.')); - } - elseif ($cores == 1 && $recursion) { - unset($projects['core']); - } - elseif ($cores > 1) { - return drush_set_error('MAKE_MULTIPLE_CORES', dt('More than one core project specified.')); - } - - // Set download type = pm for suitable projects. - foreach (array_keys($projects) as $project_type) { - foreach ($projects[$project_type] as $project) { - if (make_project_needs_release_info($project)) { - $request = make_prepare_request($project, $project_type); - $release = $release_info->selectReleaseBasedOnStrategy($request, '', 'ignore'); - if ($release === FALSE) { - return FALSE; - } - // Override default project type with data from update service. - if (!isset($info['projects'][$project['name']]['type'])) { - $project['type'] = $release_info->get($request)->getType(); - } - - if (!isset($project['download'])) { - $project['download'] = array( - 'type' => 'pm', - 'full_version' => $release['version'], - 'download_link' => $release['download_link'], - 'status url' => $request['status url'], - ); - } - } - $projects[$project_type][$project['name']] = $project; - } - } - if (!$recursion) { - $projects += array( - 'core' => array(), - 'contrib' => array(), - ); - drush_set_option('DRUSH_MAKE_PROJECTS', array_merge($projects['core'], $projects['contrib'])); - } - return $projects; -} - -/** - * Process all projects specified in the make file. - */ -function make_projects($recursion, $contrib_destination, $info, $build_path, $make_dir) { - $projects = make_prepare_projects($recursion, $info, $contrib_destination, $build_path, $make_dir); - // Abort if there was an error processing projects. - if ($projects === FALSE) { - return FALSE; - } - - // Core is built in place, rather than using make-process. - if (!empty($projects['core']) && count($projects['core'])) { - $project = current($projects['core']); - $project = DrushMakeProject::getInstance('core', $project); - $project->make(); - } - - // Process all projects concurrently using make-process. - if (isset($projects['contrib'])) { - $concurrency = drush_get_option('concurrency', 1); - // Generate $concurrency sub-processes to do the actual work. - $invocations = array(); - $thread = 0; - foreach ($projects['contrib'] as $project) { - $thread = ++$thread % $concurrency; - // Ensure that we've set this sub-process up. - if (!isset($invocations[$thread])) { - $invocations[$thread] = array( - 'args' => array( - make_tmp(), - ), - 'options' => array( - 'projects' => array(), - ), - 'site' => array(), - ); - } - // Add the project to this sub-process. - $invocations[$thread]['options']['projects'][] = $project; - // Add the manifest so recursive downloads do not override projects. - $invocations[$thread]['options']['manifest'] = array_keys($projects['contrib']); - } - if (!empty($invocations)) { - // Backend options. - $backend_options = array( - 'concurrency' => $concurrency, - 'method' => 'POST', - ); - - // Store projects in temporary files since passing this much data on the - // pipe buffer can break on certain systems. - _make_write_project_json($invocations); - - $common_options = drush_redispatch_get_options(); - // Merge in stdin options since we process makefiles recursively. See http://drupal.org/node/1510180. - $common_options = array_merge($common_options, drush_get_context('stdin')); - // Package handler should use 'wget'. - $common_options['package-handler'] = 'wget'; - - // Avoid any prompts from CLI. - $common_options['yes'] = TRUE; - - // Use cache unless explicitly turned off. - if (!drush_get_option('no-cache', FALSE)) { - $common_options['cache'] = TRUE; - } - // Unless --verbose or --debug are passed, quiter backend output. - if (empty($common_options['verbose']) && empty($common_options['debug'])) { - $backend_options['#output-label'] = FALSE; - $backend_options['integrate'] = TRUE; - } - $results = drush_backend_invoke_concurrent($invocations, $common_options, $backend_options, 'make-process', '@none'); - if (!empty($results['error_log'])) { - return FALSE; - } - } - } - return TRUE; -} - -/** - * Writes out project data to temporary files. - * - * @param array &$invocations - * An array containing projects sorted by thread. - */ -function _make_write_project_json(array &$invocations) { - foreach ($invocations as $thread => $info) { - $projects = $info['options']['projects']; - unset($invocations[$thread]['options']['projects']); - $temp_file = drush_tempnam('make_projects'); - file_put_contents($temp_file, json_encode($projects)); - $invocations[$thread]['options']['projects-location'] = $temp_file; - } -} - -/** - * Gather additional data on all libraries specified in the make file. - */ -function make_prepare_libraries($recursion, $info, $contrib_destination = '', $build_path = '', $make_dir = '') { - // Nothing to make if the libraries list is empty. - if (empty($info['libraries'])) { - return; - } - - $libraries = array(); - $ignore_checksums = drush_get_option('ignore-checksums'); - foreach ($info['libraries'] as $key => $library) { - if (!is_string($key) || !is_array($library)) { - // TODO Print a prettier message. - continue; - } - // Merge the known data onto the library info. - $library += array( - 'name' => $key, - 'core' => $info['core'], - 'build_path' => $build_path, - 'contrib_destination' => $contrib_destination, - 'subdir' => '', - 'directory_name' => $key, - 'make_directory' => $make_dir, - ); - if ($ignore_checksums) { - unset($library['download']['md5']); - } - $libraries[$key] = $library; - } - if (!$recursion) { - drush_set_option('DRUSH_MAKE_LIBRARIES', $info['libraries']); - } - return $libraries; -} - -/** - * Process all libraries specified in the make file. - */ -function make_libraries($recursion, $contrib_destination, $info, $build_path, $make_dir) { - $libraries = make_prepare_libraries($recursion, $info, $contrib_destination, $build_path, $make_dir); - if (empty($libraries)) { - return; - } - foreach ($libraries as $key => $library) { - $class = DrushMakeProject::getInstance('library', $library); - $class->make(); - } -} - -/** - * The path where the final build will be placed. - */ -function make_build_path($build_path) { - static $saved_path; - if (isset($saved_path)) { - return $saved_path; - } - - // Determine the base of the build. - if (drush_get_option('tar')) { - $build_path = dirname($build_path) . '/' . basename($build_path, '.tar.gz') . '.tar.gz'; - } - elseif (isset($build_path) && (!empty($build_path) || $build_path == '.')) { - $build_path = rtrim($build_path, '/'); - } - // Allow tests to run without a specified base path. - elseif (drush_get_option('test') || drush_confirm(dt("Make new site in the current directory?"))) { - $build_path = '.'; - } - else { - return drush_user_abort(dt('Build aborted.')); - } - if ($build_path != '.' && file_exists($build_path) && !drush_get_option('no-core', FALSE)) { - return drush_set_error('MAKE_PATH_EXISTS', dt('Base path %path already exists.', array('%path' => $build_path))); - } - $saved_path = $build_path; - return $build_path; -} - -/** - * Move the completed build into place. - */ -function make_move_build($build_path) { - $tmp_path = make_tmp(); - $ret = TRUE; - if ($build_path == '.' || (drush_get_option('no-core', FALSE) && file_exists($build_path))) { - $info = drush_scan_directory($tmp_path . DIRECTORY_SEPARATOR . '__build__', '/./', array('.', '..'), 0, FALSE, 'filename', 0, TRUE); - foreach ($info as $file) { - $destination = $build_path . DIRECTORY_SEPARATOR . $file->basename; - if (file_exists($destination)) { - // To prevent the removal of top-level directories such as 'modules' or - // 'themes', descend in a level if the file exists. - // TODO: This only protects one level of directories from being removed. - $overwrite = drush_get_option('overwrite', FALSE) ? FILE_EXISTS_OVERWRITE : FILE_EXISTS_MERGE; - if (is_dir($destination)) { - $files = drush_scan_directory($file->filename, '/./', array('.', '..'), 0, FALSE); - foreach ($files as $file) { - $ret = $ret && drush_copy_dir($file->filename, $destination . DIRECTORY_SEPARATOR . $file->basename, $overwrite); - } - } - else { - $ret = $ret && drush_copy_dir($file->filename, $destination, $overwrite); - } - } - else { - $ret = $ret && drush_copy_dir($file->filename, $destination); - } - } - } - else { - drush_mkdir(dirname($build_path)); - $ret = drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . '__build__', $tmp_path . DIRECTORY_SEPARATOR . basename($build_path), TRUE); - $ret = $ret && drush_copy_dir($tmp_path . DIRECTORY_SEPARATOR . basename($build_path), $build_path); - } - - // Copying to final destination resets write permissions. Re-apply. - if (drush_get_option('prepare-install')) { - $default = $build_path . '/sites/default'; - chmod($default . '/settings.php', 0666); - chmod($default . '/files', 0777); - } - - if (!$ret) { - return drush_set_error('MAKE_CANNOT_MOVE_BUILD', dt("Cannot move build into place.")); - } - return $ret; -} - -/** - * Create a request array suitable for release_info engine. - * - * This is a convenience function to easily integrate drush_make - * with drush release_info engine. - * - * @todo: refactor 'make' to internally work with release_info keys. - * - * @param array $project - * Project array. - * @param string $type - * 'contrib' or 'core'. - */ -function make_prepare_request($project, $type = 'contrib') { - $request = array( - 'name' => $project['name'], - 'drupal_version' => $project['core'], - 'status url' => $project['location'], - ); - if ($project['version'] != '') { - $request['project_version'] = $project['version']; - $request['version'] = $type == 'core' ? $project['version'] : $project['core'] . '-' . $project['version']; - } - return $request; -} - -/** - * Determine if the release information is required for this - * project. When it is determined that it is, this potentially results - * in the use of pm-download to process the project. - * - * If the location of the project is not customized (uses d.o), and - * one of the following is true, then release information is required: - * - * - $project['type'] has not been specified - * - $project['download'] has not been specified - * - * @see make_projects() - */ -function make_project_needs_release_info($project) { - return isset($project['location']) - // Only fetch release info if the project type is unknown OR if - // download attributes are unspecified. - && (!isset($project['type']) || !isset($project['download'])); -} - -/** - * Enables caching if not explicitly disabled. - * - * @return bool - * The previous value of the 'cache' option. - */ -function _make_enable_cache() { - $cache_before = drush_get_option('cache'); - if (!drush_get_option('no-cache', FALSE)) { - drush_set_option('cache', TRUE); - } - return $cache_before; -} diff --git a/vendor/drush/drush/commands/make/make.project.inc b/vendor/drush/drush/commands/make/make.project.inc deleted file mode 100644 index 60e73257c73aa32394fcee1c117bdceb0abbddc1..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/make/make.project.inc +++ /dev/null @@ -1,740 +0,0 @@ -<?php -/** - * @file - * Drush Make processing classes. - */ - -use Drush\Log\LogLevel; - -/** - * The base project class. - */ -class DrushMakeProject { - - /** - * TRUE if make() has been called, otherwise FALSE. - */ - protected $made = FALSE; - - /** - * TRUE if download() method has been called successfully, otherwise FALSE. - */ - protected $downloaded = NULL; - - /** - * Download location to use. - */ - protected $download_location = NULL; - - /** - * Keep track of instances. - * - * @see DrushMakeProject::getInstance() - */ - protected static $self = array(); - - /** - * Keeps track of projects being processed to prevent recursive conflicts. - * - * Simple array of machine names. - * - * @var array - */ - protected $manifest = array(); - - /** - * Default to overwrite to allow recursive builds to process properly. - * - * TODO refactor this to be more selective. Ideally a merge would take place - * instead of an overwrite. - */ - protected $overwrite = TRUE; - - /** - * Recursively process any makefiles found in downloaded projects. - */ - protected $do_recursion = TRUE; - - /** - * Which variant of profiles to download. - */ - protected $variant = 'profile-only'; - - /** - * Set attributes and retrieve project information. - */ - protected function __construct($project) { - $project['base_contrib_destination'] = $project['contrib_destination']; - foreach ($project as $key => $value) { - $this->{$key} = $value; - } - if (!empty($this->options['working-copy'])) { - $this->download['working-copy'] = TRUE; - } - // Don't recurse when we're using a pre-built profile tarball. - if ($this->variant == 'projects') { - $this->do_recursion = FALSE; - } - } - - /** - * Get an instance for the type and project. - * - * @param string $type - * Type of project: core, library, module, profile, or translation. - * @param array $project - * Project information. - * - * @return mixed - * An instance for the project or FALSE if invalid type. - */ - public static function getInstance($type, $project) { - if (!isset(self::$self[$type][$project['name']])) { - $class = 'DrushMakeProject_' . $type; - self::$self[$type][$project['name']] = class_exists($class) ? new $class($project) : FALSE; - } - return self::$self[$type][$project['name']]; - } - - /** - * Set the manifest array. - * - * @param array $manifest - * An array of projects as generated by `make_projects`. - */ - public function setManifest($manifest) { - $this->manifest = $manifest; - } - - /** - * Download a project. - */ - function download() { - $this->downloaded = TRUE; - - // In some cases, make_download_factory() is going to need to know the - // full version string of the project we're trying to download. However, - // the version is a project-level attribute, not a download-level - // attribute. So, if we don't already have a full version string in the - // download array (e.g. if it was initialized via the release history XML - // for the PM case), we take the version info from the project-level - // attribute, convert it into a full version string, and stuff it into - // $this->download so that the download backend has access to it, too. - if (!empty($this->version) && empty($this->download['full_version'])) { - $full_version = ''; - $matches = array(); - // Core needs different conversion rules than contrib. - if (!empty($this->type) && $this->type == 'core') { - // Generally, the version for core is already set properly. - $full_version = $this->version; - // However, it might just be something like '7' or '7.x', in which - // case we need to turn that into '7.x-dev'; - if (preg_match('/^\d+(\.x)?$/', $this->version, $matches)) { - // If there's no '.x' already, append it. - if (empty($matches[1])) { - $full_version .= '.x'; - } - $full_version .= '-dev'; - } - } - // Contrib. - else { - // If the version doesn't already define a core version, prepend it. - if (!preg_match('/^\d+\.x-\d+.*$/', $this->version)) { - // Just find the major version from $this->core so we don't end up - // with version strings like '7.12-2.0'. - $core_parts = explode('.', $this->core); - $full_version = $core_parts[0] . '.x-'; - } - $full_version .= $this->version; - // If the project-level version attribute is just a number it's a major - // version. - if (preg_match('/^\d+(\.x)?$/', $this->version, $matches)) { - // If there's no '.x' already, append it. - if (empty($matches[1])) { - $full_version .= '.x'; - } - $full_version .= '-dev'; - } - } - $this->download['full_version'] = $full_version; - } - - $this->download['variant'] = $this->variant; - - if (make_download_factory($this->name, $this->type, $this->download, $this->download_location) === FALSE) { - $this->downloaded = FALSE; - } - return $this->downloaded; - } - - /** - * Build a project. - */ - function make() { - if ($this->made) { - drush_log(dt('Attempt to build project @project more then once prevented.', array('@project' => $this->name))); - return TRUE; - } - $this->made = TRUE; - - if (!isset($this->download_location)) { - $this->download_location = $this->findDownloadLocation(); - } - if ($this->download() === FALSE) { - return FALSE; - } - if (!$this->addLockfile($this->download_location)) { - return FALSE; - } - if (!$this->applyPatches($this->download_location)) { - return FALSE; - } - if (!$this->getTranslations($this->download_location)) { - return FALSE; - } - // Handle .info file re-writing (if so desired). - if (!drush_get_option('no-gitinfofile', FALSE) && isset($this->download['type']) && $this->download['type'] == 'git') { - $this->processGitInfoFiles(); - } - // Clean-up .git directories. - if (!_get_working_copy_option($this->download)) { - $this->removeGitDirectory(); - } - if (!$this->recurse($this->download_location)) { - return FALSE; - } - return TRUE; - } - - /** - * Determine the location to download project to. - */ - function findDownloadLocation() { - $this->path = $this->generatePath(); - $this->project_directory = !empty($this->directory_name) ? $this->directory_name : $this->name; - $this->download_location = $this->path . '/' . $this->project_directory; - // This directory shouldn't exist yet -- if it does, stop, - // unless overwrite has been set to TRUE. - if (is_dir($this->download_location) && !$this->overwrite) { - return drush_set_error('MAKE_DIRECTORY_EXISTS', dt('Directory not empty: !directory', array('!directory' => $this->download_location))); - } - elseif ($this->download['type'] === 'pm') { - // pm-download will create the final contrib directory. - drush_mkdir(dirname($this->download_location)); - } - else { - drush_mkdir($this->download_location); - } - return $this->download_location; - } - - /** - * Rewrite relative URLs and file:/// URLs - * - * relative path -> absolute path using the make_directory - * local file:/// urls -> local paths - * - * @param mixed &$info - * Either an array or a simple url string. The `$info` variable will be - * transformed into an array. - */ - protected function preprocessLocalFileUrl(&$info) { - if (is_string($info)) { - $info = array('url' => $info, 'local' => FALSE); - } - - if (!_drush_is_url($info['url']) && !drush_is_absolute_path($info['url'])) { - $info['url'] = $this->make_directory . '/' . $info['url']; - $info['local'] = TRUE; - } elseif (substr($info['url'], 0, 8) == 'file:///') { - $info['url'] = substr($info['url'], 7); - $info['local'] = TRUE; - } - } - - /** - * Retrieve and apply any patches specified by the makefile to this project. - */ - function applyPatches($project_directory) { - if (empty($this->patch)) { - return TRUE; - } - - $patches_txt = ''; - $local_patches = array(); - $ignore_checksums = drush_get_option('ignore-checksums'); - foreach ($this->patch as $info) { - $this->preprocessLocalFileUrl($info); - - // Download the patch. - if ($filename = _make_download_file($info['url'])) { - $patched = FALSE; - $output = ''; - // Test each patch style; -p1 is the default with git. See - // http://drupal.org/node/1054616 - $patch_levels = array('-p1', '-p0'); - foreach ($patch_levels as $patch_level) { - $checked = drush_shell_cd_and_exec($project_directory, 'git --git-dir=. apply --check %s %s --verbose', $patch_level, $filename); - if ($checked) { - // Apply the first successful style. - $patched = drush_shell_cd_and_exec($project_directory, 'git --git-dir=. apply %s %s --verbose', $patch_level, $filename); - break; - } - } - - // In some rare cases, git will fail to apply a patch, fallback to using - // the 'patch' command. - if (!$patched) { - foreach ($patch_levels as $patch_level) { - // --no-backup-if-mismatch here is a hack that fixes some - // differences between how patch works on windows and unix. - if ($patched = drush_shell_exec("patch %s --no-backup-if-mismatch -d %s < %s", $patch_level, $project_directory, $filename)) { - break; - } - } - } - - if ($output = drush_shell_exec_output()) { - // Log any command output, visible only in --verbose or --debug mode. - drush_log(implode("\n", $output)); - } - - // Set up string placeholders to pass to dt(). - $dt_args = array( - '@name' => $this->name, - '@filename' => basename($filename), - ); - - if ($patched) { - if (!$ignore_checksums && !_make_verify_checksums($info, $filename)) { - return FALSE; - } - $patch_url = $info['url']; - - // If this is a local patch, copy that into place as well. - if ($info['local']) { - $local_patches[] = $info['url']; - // Use a local path for the PATCHES.txt file. - $pathinfo = pathinfo($patch_url); - $patch_url = $pathinfo['basename']; - } - $patches_txt .= '- ' . $patch_url . "\n"; - - drush_log(dt('@name patched with @filename.', $dt_args), LogLevel::OK); - } - else { - make_error('PATCH_ERROR', dt("Unable to patch @name with @filename.", $dt_args)); - } - drush_op('unlink', $filename); - } - else { - make_error('DOWNLOAD_ERROR', 'Unable to download ' . $info['url'] . '.'); - return FALSE; - } - } - if (!empty($patches_txt) && !drush_get_option('no-patch-txt') && !file_exists($project_directory . '/PATCHES.txt')) { - $patches_txt = "The following patches have been applied to this project:\n" . - $patches_txt . - "\nThis file was automatically generated by Drush Make (http://drupal.org/project/drush).\n"; - file_put_contents($project_directory . '/PATCHES.txt', $patches_txt); - drush_log('Generated PATCHES.txt file for ' . $this->name, LogLevel::OK); - - // Copy local patches into place. - foreach ($local_patches as $url) { - $pathinfo = pathinfo($url); - drush_copy_dir($url, $project_directory . '/' . $pathinfo['basename']); - } - } - return TRUE; - } - - /** - * Process info files when downloading things from git. - */ - function processGitInfoFiles() { - // Bail out if this isn't hosted on Drupal.org (unless --force-gitinfofile option was specified). - if (!drush_get_option('force-gitinfofile', FALSE) && isset($this->download['url']) && strpos($this->download['url'], 'drupal.org') === FALSE) { - return; - } - - // Figure out the proper version string to use based on the .make file. - // Best case is the .make file author told us directly. - if (!empty($this->download['full_version'])) { - $full_version = $this->download['full_version']; - } - // Next best is if we have a tag, since those are identical to versions. - elseif (!empty($this->download['tag'])) { - $full_version = $this->download['tag']; - } - // If we have a branch, append '-dev'. - elseif (!empty($this->download['branch'])) { - $full_version = $this->download['branch'] . '-dev'; - } - // Ugh. Not sure what else we can do in this case. - elseif (!empty($this->download['revision'])) { - $full_version = $this->download['revision']; - } - // Probably can never reach this case. - else { - $full_version = 'unknown'; - } - - // If the version string ends in '.x-dev' do the Git magic to figure out - // the appropriate 'rebuild version' string, e.g. '7.x-1.2+7-dev'. - $matches = array(); - if (preg_match('/^(.+).x-dev$/', $full_version, $matches)) { - require_once dirname(__FILE__) . '/../pm/package_handler/git_drupalorg.inc'; - $rebuild_version = drush_pm_git_drupalorg_compute_rebuild_version($this->download_location, $matches[1]); - if ($rebuild_version) { - $full_version = $rebuild_version; - } - } - require_once dirname(__FILE__) . '/../pm/pm.drush.inc'; - if (drush_shell_cd_and_exec($this->download_location, 'git log -1 --pretty=format:%ct')) { - $output = drush_shell_exec_output(); - $datestamp = $output[0]; - } - else { - $datestamp = time(); - } - drush_pm_inject_info_file_metadata($this->download_location, $this->name, $full_version, $datestamp); - } - - /** - * Remove the .git directory from a project. - */ - function removeGitDirectory() { - if (isset($this->download['type']) && $this->download['type'] == 'git' && file_exists($this->download_location . '/.git')) { - drush_delete_dir($this->download_location . '/.git', TRUE); - } - } - - /** - * Add a lock file. - */ - function addLockfile($project_directory) { - if (!empty($this->lock)) { - file_put_contents($project_directory . '/.drush-lock-update', $this->lock); - } - return TRUE; - } - - /** - * Retrieve translations for this project. - */ - function getTranslations($project_directory) { - static $cache = array(); - $langcodes = $this->translations; - if ($langcodes && in_array($this->type, array('core', 'module', 'profile', 'theme'), TRUE)) { - // Support the l10n_path, l10n_url keys from l10n_update. Note that the - // l10n_server key is not supported. - if (isset($this->l10n_path)) { - $update_url = $this->l10n_path; - } - else { - if (isset($this->l10n_url)) { - $l10n_server = $this->l10n_url; - } - else { - $l10n_server = FALSE; - } - if ($l10n_server) { - if (!isset($cache[$l10n_server])) { - $this->preprocessLocalFileUrl($l10n_server); - $l10n_server = $l10n_server['url']; - if ($filename = _make_download_file($l10n_server)) { - $server_info = simplexml_load_string(file_get_contents($filename)); - $cache[$l10n_server] = !empty($server_info->update_url) ? $server_info->update_url : FALSE; - } - } - if ($cache[$l10n_server]) { - $update_url = $cache[$l10n_server]; - } - else { - make_error('XML_ERROR', dt("Could not retrieve l10n update url for !project.", array('!project' => $this->name))); - return FALSE; - } - } - } - if ($update_url) { - $failed = array(); - foreach ($langcodes as $langcode) { - $variables = array( - '%project' => $this->name, - '%release' => $this->download['full_version'], - '%core' => $this->core, - '%language' => $langcode, - '%filename' => '%filename', - ); - $url = strtr($update_url, $variables); - - // Download the translation file. Since its contents are volatile, - // cache for only 4 hours. - if ($filename = _make_download_file($url, 3600 * 4)) { - // If this is the core project type, download the translation file - // and place it in every profile and an additional copy in - // modules/system/translations where it can be detected for import - // by other non-default install profiles. - if ($this->type === 'core') { - $profiles = drush_scan_directory($project_directory . '/profiles', '/.*/', array(), 0, FALSE, 'filename', 0, TRUE); - foreach ($profiles as $profile) { - if (is_dir($project_directory . '/profiles/' . $profile->basename)) { - drush_mkdir($project_directory . '/profiles/' . $profile->basename . '/translations'); - drush_copy_dir($filename, $project_directory . '/profiles/' . $profile->basename . '/translations/' . $langcode . '.po'); - } - } - drush_mkdir($project_directory . '/modules/system/translations'); - drush_copy_dir($filename, $project_directory . '/modules/system/translations/' . $langcode . '.po'); - } - else { - drush_mkdir($project_directory . '/translations'); - drush_copy_dir($filename, $project_directory . '/translations/' . $langcode . '.po', FILE_EXISTS_OVERWRITE); - } - } - else { - $failed[] = $langcode; - } - } - if (empty($failed)) { - drush_log('All translations downloaded for ' . $this->name, LogLevel::OK); - } - else { - drush_log('Unable to download translations for ' . $this->name . ': ' . implode(', ', $failed), LogLevel::WARNING); - } - } - } - return TRUE; - } - - /** - * Generate the proper path for this project type. - * - * @param boolean $base - * Whether include the base part (tmp dir). Defaults to TRUE. - */ - protected function generatePath($base = TRUE) { - $path = array(); - if ($base) { - $path[] = make_tmp(); - $path[] = '__build__'; - } - if (!empty($this->contrib_destination)) { - $path[] = $this->contrib_destination; - } - if (!empty($this->subdir)) { - $path[] = $this->subdir; - } - return implode('/', $path); - } - - /** - * Return the proper path for dependencies to be placed in. - * - * @return string - * The path that dependencies will be placed in. - */ - protected function buildPath($directory) { - return $this->base_contrib_destination; - } - - /** - * Recurse to process additional makefiles that may be found during - * processing. - */ - function recurse($path) { - if (!$this->do_recursion || drush_get_option('no-recursion')) { - drush_log(dt("Preventing recursive makefile parsing for !project", - array("!project" => $this->name)), LogLevel::NOTICE); - return TRUE; - } - $candidates = array( - $this->name . '.make.yml', - $this->name . '.make', - 'drupal-org.make.yml', - 'drupal-org.make', - ); - $makefile = FALSE; - foreach ($candidates as $filename) { - if (file_exists($this->download_location . '/' . $filename)) { - $makefile = $this->download_location . '/' . $filename; - break; - } - } - - if (!$makefile) { - return TRUE; - } - - drush_log(dt("Found makefile: !makefile", array("!makefile" => basename($makefile))), LogLevel::OK); - - // Save the original state of the 'custom' context. - $custom_context = &drush_get_context('custom'); - $original_custom_context_values = $custom_context; - - $info = make_parse_info_file($makefile, TRUE, $this->options); - if (!($info = make_validate_info_file($info))) { - $result = FALSE; - } - else { - // Inherit the translations specified in the extender makefile. - if (!empty($this->translations)) { - $info['translations'] = $this->translations; - } - // Strip out any modules that have already been processed before this. - foreach ($this->manifest as $name) { - unset($info['projects'][$name]); - } - $build_path = $this->buildPath($this->name); - make_projects(TRUE, trim($build_path, '/'), $info, $this->build_path, $this->download_location); - make_libraries(TRUE, trim($build_path, '/'), $info, $this->build_path, $this->download_location); - $result = TRUE; - } - // Restore original 'custom' context so that any - // settings changes made are used. - $custom_context = $original_custom_context_values; - - return $result; - } -} - -/** - * For processing Drupal core projects. - */ -class DrushMakeProject_Core extends DrushMakeProject { - /** - * Override constructor for core to adjust project info. - */ - protected function __construct(&$project) { - parent::__construct($project); - // subdir and contrib_destination are not allowed for core. - $this->subdir = ''; - $this->contrib_destination = ''; - } - - /** - * Determine the location to download project to. - */ - function findDownloadLocation() { - $this->path = $this->download_location = $this->generatePath(); - $this->project_directory = ''; - if (is_dir($this->download_location)) { - return drush_set_error('MAKE_DIRECTORY_EXISTS', dt('Directory not empty: !directory', array('!directory' => $this->download_location))); - } - elseif ($this->download['type'] === 'pm') { - // pm-download will create the final __build__ directory, so nothing to do - // here. - } - else { - drush_mkdir($this->download_location); - } - return $this->download_location; - } -} - -/** - * For processing libraries. - */ -class DrushMakeProject_Library extends DrushMakeProject { - /** - * Override constructor for libraries to properly set contrib destination. - */ - protected function __construct(&$project) { - parent::__construct($project); - // Allow libraries to specify where they should live in the build path. - if (isset($project['destination'])) { - $project_path = $project['destination']; - } - else { - $project_path = 'libraries'; - } - - $this->contrib_destination = ($this->base_contrib_destination != '.' ? $this->base_contrib_destination . '/' : '') . $project_path; - } - - /** - * No recursion for libraries, sorry :-( - */ - function recurse($path) { - // Return TRUE so that processing continues in the make() method. - return TRUE; - } - - /** - * No translations for libraries. - */ - function getTranslations($download_location) { - // Return TRUE so that processing continues in the make() method. - return TRUE; - } -} - -/** - * For processing modules. - */ -class DrushMakeProject_Module extends DrushMakeProject { - /** - * Override constructor for modules to properly set contrib destination. - */ - protected function __construct(&$project) { - parent::__construct($project); - $this->contrib_destination = ($this->base_contrib_destination != '.' ? $this->base_contrib_destination . '/' : '') . 'modules'; - } -} - -/** - * For processing installation profiles. - */ -class DrushMakeProject_Profile extends DrushMakeProject { - /** - * Override contructor for installation profiles to properly set contrib - * destination. - */ - protected function __construct(&$project) { - parent::__construct($project); - $this->contrib_destination = (!empty($this->destination) ? $this->destination : 'profiles'); - } - - /** - * Find the build path. - */ - protected function buildPath($directory) { - return $this->generatePath(FALSE) . '/' . $directory; - } -} - -/** - * For processing themes. - */ -class DrushMakeProject_Theme extends DrushMakeProject { - /** - * Override contructor for themes to properly set contrib destination. - */ - protected function __construct(&$project) { - parent::__construct($project); - $this->contrib_destination = ($this->base_contrib_destination != '.' ? $this->base_contrib_destination . '/' : '') . 'themes'; - } -} - -/** - * For processing translations. - */ -class DrushMakeProject_Translation extends DrushMakeProject { - /** - * Override constructor for translations to properly set contrib destination. - */ - protected function __construct(&$project) { - parent::__construct($project); - switch ($project['core']) { - case '5.x': - // Don't think there's an automatic place we can put 5.x translations, - // so we'll toss them in a translations directory in the Drupal root. - $this->contrib_destination = ($this->base_contrib_destination != '.' ? $this->base_contrib_destination . '/' : '') . 'translations'; - break; - - default: - $this->contrib_destination = ''; - break; - } - } -} diff --git a/vendor/drush/drush/commands/make/make.utilities.inc b/vendor/drush/drush/commands/make/make.utilities.inc deleted file mode 100644 index c477742d5bfc62f6830fb78d3d44f90c1444d98f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/make/make.utilities.inc +++ /dev/null @@ -1,698 +0,0 @@ -<?php -/** - * @file - * General utility functions for Drush Make. - */ - -use Drush\Log\LogLevel; -use Drush\Make\Parser\ParserIni; -use Drush\Make\Parser\ParserYaml; - -/** - * Helper function to parse a makefile and prune projects. - */ -function make_parse_info_file($makefile) { - $info = _make_parse_info_file($makefile); - - // Support making just a portion of a make file. - $include_only = array( - 'projects' => array_filter(drush_get_option_list('projects')), - 'libraries' => array_filter(drush_get_option_list('libraries')), - ); - $info = make_prune_info_file($info, $include_only); - - if ($info === FALSE || ($info = make_validate_info_file($info)) === FALSE) { - return FALSE; - } - - return $info; -} - -/** - * Parse makefile recursively. - */ -function _make_parse_info_file($makefile, $element = 'includes') { - if (!($data = make_get_data($makefile))) { - return drush_set_error('MAKE_INVALID_MAKE_FILE', dt('Invalid or empty make file: !makefile', array('!makefile' => $makefile))); - } - - // $info['format'] will specify the determined format. - $info = _make_determine_format($data); - - // Set any allowed options. - if (!empty($info['options'])) { - foreach ($info['options'] as $key => $value) { - if (_make_is_override_allowed($key)) { - // n.b. 'custom' context has lower priority than 'cli', so - // options entered on the command line will "mask" makefile options. - drush_set_option($key, $value, 'custom'); - } - } - } - - // Include any makefiles specified on the command line. - if ($include_makefiles = drush_get_option_list('includes', FALSE)) { - drush_unset_option('includes'); // Avoid infinite loop. - $info['includes'] = is_array($info['includes']) ? $info['includes'] : array(); - foreach ($include_makefiles as $include_make) { - if (!array_search($include_make, $info['includes'])) { - $info['includes'][] = $include_make; - } - } - } - - // Override elements with values from makefiles specified on the command line. - if ($overrides = drush_get_option_list('overrides', FALSE)) { - drush_unset_option('overrides'); // Avoid infinite loop. - $info['overrides'] = is_array($info['overrides']) ? $info['overrides'] : array(); - foreach ($overrides as $override) { - if (!array_search($override, $info['overrides'])) { - $info['overrides'][] = $override; - } - } - } - - $info = _make_merge_includes_recursively($info, $makefile); - $info = _make_merge_includes_recursively($info, $makefile, 'overrides'); - - return $info; -} - -/** - * Helper function to merge includes recursively. - */ -function _make_merge_includes_recursively($info, $makefile, $element = 'includes') { - if (!empty($info[$element])) { - if (is_array($info[$element])) { - $includes = array(); - foreach ($info[$element] as $key => $include) { - if (!empty($include)) { - if (!$include_makefile = _make_get_include_path($include, $makefile)) { - return make_error('BUILD_ERROR', dt("Cannot determine include file location: !include", array('!include' => $include))); - } - - if ($element == 'overrides') { - $info = array_replace_recursive($info, _make_parse_info_file($include_makefile, $element)); - } - else { - $info = array_replace_recursive(_make_parse_info_file($include_makefile), $info); - } - unset($info[$element][$key]); - // Move core back to the top of the list, where - // make_generate_from_makefile() expects it. - if (!empty($info['projects'])) { - array_reverse($info['projects']); - } - } - } - } - } - // Ensure $info['projects'] is an associative array, so that we can merge - // includes properly. - make_normalize_info($info); - - return $info; -} - -/** - * Helper function to determine the proper path for an include makefile. - */ -function _make_get_include_path($include, $makefile) { - if (is_array($include) && $include['download']['type'] = 'git') { - $tmp_dir = make_tmp(); - make_download_git($include['makefile'], $include['download']['type'], $include['download'], $tmp_dir); - $include_makefile = $tmp_dir . '/' . $include['makefile']; - } - elseif (is_string($include)) { - $include_path = dirname($makefile); - if (make_valid_url($include, TRUE)) { - $include_makefile = $include; - } - elseif (file_exists($include_path . '/' . $include)) { - $include_makefile = $include_path . '/' . $include; - } - elseif (file_exists($include)) { - $include_makefile = $include; - } - else { - return make_error('BUILD_ERROR', dt("Include file missing: !include", array('!include' => $include))); - } - } - else { - return FALSE; - } - return $include_makefile; -} - -/** - * Expand shorthand elements, so that we have an associative array. - */ -function make_normalize_info(&$info) { - if (isset($info['projects'])) { - foreach($info['projects'] as $key => $project) { - if (is_numeric($key) && is_string($project)) { - unset($info['projects'][$key]); - $info['projects'][$project] = array( - 'version' => '', - ); - } - if (is_string($key) && is_numeric($project)) { - $info['projects'][$key] = array( - 'version' => $project, - ); - } - } - } -} - -/** - * Remove entries in the info file in accordance with the options passed in. - * Entries are either explicitly 'allowed' (with the $include_only parameter) in - * which case all *other* entries will be excluded. - * - * @param array $info - * A parsed info file. - * - * @param array $include_only - * (Optional) Array keyed by entry type (e.g. 'libraries') against an array of - * allowed keys for that type. The special value '*' means 'all entries of - * this type'. If this parameter is omitted, no entries will be excluded. - * - * @return array - * The $info array, pruned if necessary. - */ -function make_prune_info_file($info, $include_only = array()) { - - // We may get passed FALSE in some cases. - // Also we cannot prune an empty array, so no point in this code running! - if (empty($info)) { - return $info; - } - - // We will accrue an explanation of our activities here. - $msg = array(); - $msg['scope'] = dt("Drush make restricted to the following entries:"); - - $pruned = FALSE; - - if (count(array_filter($include_only))) { - $pruned = TRUE; - foreach ($include_only as $type => $keys) { - - if (!isset($info[$type])) { - continue; - } - // For translating - // dt("Projects"); - // dt("Libraries"); - $type_title = dt(ucfirst($type)); - - // Handle the special '*' value. - if (in_array('*', $keys)) { - $msg[$type] = dt("!entry_type: <All>", array('!entry_type' => $type_title)); - } - - // Handle a (possibly empty) array of keys to include/exclude. - else { - $info[$type] = array_intersect_key($info[$type], array_fill_keys($keys, 1)); - unset($msg[$type]); - if (!empty($info[$type])) { - $msg[$type] = dt("!entry_type: !make_entries", array('!entry_type' => $type_title, '!make_entries' => implode(', ', array_keys($info[$type])))); - } - } - } - } - - if ($pruned) { - // Make it clear to the user what's going on. - drush_log(implode("\n", $msg), LogLevel::OK); - - // Throw an error if these restrictions reduced the make to nothing. - if (empty($info['projects']) && empty($info['libraries'])) { - // This error mentions the options explicitly to make it as clear as - // possible to the user why this error has occurred. - make_error('BUILD_ERROR', dt("All projects and libraries have been excluded. Review the 'projects' and 'libraries' options.")); - } - } - - return $info; -} - -/** - * Validate the make file. - */ -function make_validate_info_file($info) { - // Assume no errors to start. - $errors = FALSE; - - if (empty($info['core'])) { - make_error('BUILD_ERROR', dt("The 'core' attribute is required")); - $errors = TRUE; - } - // Standardize on core. - elseif (preg_match('/^(\d+)(\.(x|(\d+)(-[a-z0-9]+)?))?$/', $info['core'], $matches)) { - // An exact version of core has been specified, so pass that to an - // internal variable for storage. - if (isset($matches[4])) { - $info['core_release'] = $info['core']; - } - // Format the core attribute consistently. - $info['core'] = $matches[1] . '.x'; - } - else { - make_error('BUILD_ERROR', dt("The 'core' attribute !core has an incorrect format.", array('!core' => $info['core']))); - $errors = TRUE; - } - - if (!isset($info['api'])) { - $info['api'] = MAKE_API; - drush_log(dt("You need to specify an API version of two in your makefile:\napi = !api", array("!api" => MAKE_API)), LogLevel::WARNING); - } - elseif ($info['api'] != MAKE_API) { - make_error('BUILD_ERROR', dt("The specified API attribute is incompatible with this version of Drush Make.")); - $errors = TRUE; - } - - $names = array(); - - // Process projects. - if (isset($info['projects'])) { - if (!is_array($info['projects'])) { - make_error('BUILD_ERROR', dt("'projects' attribute must be an array.")); - $errors = TRUE; - } - else { - // Filter out entries that have been forcibly removed via [foo] = FALSE. - $info['projects'] = array_filter($info['projects']); - - foreach ($info['projects'] as $project => $project_data) { - // Project has an attributes array. - if (is_string($project) && is_array($project_data)) { - if (in_array($project, $names)) { - make_error('BUILD_ERROR', dt("Project !project defined twice (remove the first projects[] = !project).", array('!project' => $project))); - $errors = TRUE; - } - $names[] = $project; - foreach ($project_data as $attribute => $value) { - // Prevent malicious attempts to access other areas of the - // filesystem. - if (in_array($attribute, array('subdir', 'directory_name', 'contrib_destination')) && !make_safe_path($value)) { - $args = array( - '!path' => $value, - '!attribute' => $attribute, - '!project' => $project, - ); - make_error('BUILD_ERROR', dt("Illegal path !path for '!attribute' attribute in project !project.", $args)); - $errors = TRUE; - } - } - } - // Cover if there is no project info, it's just a project name. - elseif (is_numeric($project) && is_string($project_data)) { - if (in_array($project_data, $names)) { - make_error('BUILD_ERROR', dt("Project !project defined twice (remove the first projects[] = !project).", array('!project' => $project_data))); - $errors = TRUE; - } - $names[] = $project_data; - unset($info['projects'][$project]); - $info['projects'][$project_data] = array(); - } - // Convert shorthand project version style to array format. - elseif (is_string($project_data)) { - if (in_array($project, $names)) { - make_error('BUILD_ERROR', dt("Project !project defined twice (remove the first projects[] = !project).", array('!project' => $project))); - $errors = TRUE; - } - $names[] = $project; - $info['projects'][$project] = array('version' => $project_data); - } - else { - make_error('BUILD_ERROR', dt('Project !project incorrectly specified.', array('!project' => $project))); - $errors = TRUE; - } - } - } - } - if (isset($info['libraries'])) { - if (!is_array($info['libraries'])) { - make_error('BUILD_ERROR', dt("'libraries' attribute must be an array.")); - $errors = TRUE; - } - else { - // Filter out entries that have been forcibly removed via [foo] = FALSE. - $info['libraries'] = array_filter($info['libraries']); - - foreach ($info['libraries'] as $library => $library_data) { - if (is_array($library_data)) { - foreach ($library_data as $attribute => $value) { - // Unset disallowed attributes. - if (in_array($attribute, array('contrib_destination'))) { - unset($info['libraries'][$library][$attribute]); - } - // Prevent malicious attempts to access other areas of the - // filesystem. - elseif (in_array($attribute, array('contrib_destination', 'directory_name')) && !make_safe_path($value)) { - $args = array( - '!path' => $value, - '!attribute' => $attribute, - '!library' => $library, - ); - make_error('BUILD_ERROR', dt("Illegal path !path for '!attribute' attribute in library !library.", $args)); - $errors = TRUE; - } - } - } - } - } - } - - // Convert shorthand project/library download style to array format. - foreach (array('projects', 'libraries') as $type) { - if (isset($info[$type]) && is_array($info[$type])) { - foreach ($info[$type] as $name => $item) { - if (!empty($item['download']) && is_string($item['download'])) { - $info[$type][$name]['download'] = array('url' => $item['download']); - } - } - } - } - - // Apply defaults after projects[] array has been expanded, but prior to - // external validation. - make_apply_defaults($info); - - foreach (drush_command_implements('make_validate_info') as $module) { - $function = $module . '_make_validate_info'; - $return = $function($info); - if ($return) { - $info = $return; - } - else { - $errors = TRUE; - } - } - - if ($errors) { - return FALSE; - } - return $info; -} - -/** - * Verify the syntax of the given URL. - * - * Copied verbatim from includes/common.inc - * - * @see valid_url - */ -function make_valid_url($url, $absolute = FALSE) { - if ($absolute) { - return (bool) preg_match(" - /^ # Start at the beginning of the text - (?:ftp|https?):\/\/ # Look for ftp, http, or https schemes - (?: # Userinfo (optional) which is typically - (?:(?:[\w\.\-\+!$&'\(\)*\+,;=]|%[0-9a-f]{2})+:)* # a username or a username and password - (?:[\w\.\-\+%!$&'\(\)*\+,;=]|%[0-9a-f]{2})+@ # combination - )? - (?: - (?:[a-z0-9\-\.]|%[0-9a-f]{2})+ # A domain name or a IPv4 address - |(?:\[(?:[0-9a-f]{0,4}:)*(?:[0-9a-f]{0,4})\]) # or a well formed IPv6 address - ) - (?::[0-9]+)? # Server port number (optional) - (?:[\/|\?] - (?:[\w#!:\.\?\+=&@$'~*,;\/\(\)\[\]\-]|%[0-9a-f]{2}) # The path and query (optional) - *)? - $/xi", $url); - } - else { - return (bool) preg_match("/^(?:[\w#!:\.\?\+=&@$'~*,;\/\(\)\[\]\-]|%[0-9a-f]{2})+$/i", $url); - } -} - -/** - * Find, and possibly create, a temporary directory. - * - * @param boolean $set - * Must be TRUE to create a directory. - * @param string $directory - * Pass in a directory to use. This is required if using any - * concurrent operations. - * - * @todo Merge with drush_tempdir(). - */ -function make_tmp($set = TRUE, $directory = NULL) { - static $tmp_dir; - - if (isset($directory) && !isset($tmp_dir)) { - $tmp_dir = $directory; - } - - if (!isset($tmp_dir) && $set) { - $tmp_dir = drush_find_tmp(); - if (strrpos($tmp_dir, '/') == strlen($tmp_dir) - 1) { - $tmp_dir .= 'make_tmp_' . time() . '_' . uniqid(); - } - else { - $tmp_dir .= '/make_tmp_' . time() . '_' . uniqid(); - } - if (!drush_get_option('no-clean', FALSE)) { - drush_register_file_for_deletion($tmp_dir); - } - if (file_exists($tmp_dir)) { - return make_tmp(TRUE); - } - // Create the directory. - drush_mkdir($tmp_dir); - } - return $tmp_dir; -} - -/** - * Removes the temporary build directory. On failed builds, this is handled by - * drush_register_file_for_deletion(). - */ -function make_clean_tmp() { - if (!($tmp_dir = make_tmp(FALSE))) { - return; - } - if (!drush_get_option('no-clean', FALSE)) { - drush_delete_dir($tmp_dir); - } - else { - drush_log(dt('Temporary directory: !dir', array('!dir' => $tmp_dir)), LogLevel::OK); - } -} - -/** - * Prepare a Drupal installation, copying default.settings.php to settings.php. - */ -function make_prepare_install($build_path) { - $default = make_tmp() . '/__build__/sites/default'; - drush_copy_dir($default . DIRECTORY_SEPARATOR . 'default.settings.php', $default . DIRECTORY_SEPARATOR . 'settings.php', FILE_EXISTS_OVERWRITE); - drush_mkdir($default . '/files'); - chmod($default . DIRECTORY_SEPARATOR . 'settings.php', 0666); - chmod($default . DIRECTORY_SEPARATOR . 'files', 0777); -} - -/** - * Calculate a cksum on each file in the build, and md5 the resulting hashes. - */ -function make_md5() { - return drush_dir_md5(make_tmp()); -} - -/** - * @todo drush_archive_dump() also makes a tar. Consolidate? - */ -function make_tar($build_path) { - $tmp_path = make_tmp(); - - drush_mkdir(dirname($build_path)); - $filename = basename($build_path); - $dirname = basename($build_path, '.tar.gz'); - // Move the build directory to a more human-friendly name, so that tar will - // use it instead. - drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . '__build__', $tmp_path . DIRECTORY_SEPARATOR . $dirname, TRUE); - // Only move the tar file to it's final location if it's been built - // successfully. - if (drush_shell_exec("%s -C %s -Pczf %s %s", drush_get_tar_executable(), $tmp_path, $tmp_path . '/' . $filename, $dirname)) { - drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . $filename, $build_path, TRUE); - }; - // Move the build directory back to it's original location for consistency. - drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . $dirname, $tmp_path . DIRECTORY_SEPARATOR . '__build__'); -} - -/** - * Logs an error unless the --force-complete command line option is specified. - */ -function make_error($error_code, $message) { - if (drush_get_option('force-complete')) { - drush_log("$error_code: $message -- build forced", LogLevel::WARNING); - } - else { - return drush_set_error($error_code, $message); - } -} - -/** - * Checks an attribute's path to ensure it's not maliciously crafted. - * - * @param string $path - * The path to check. - */ -function make_safe_path($path) { - return !preg_match("+^/|^\.\.|/\.\./+", $path); -} -/** - * Get data based on the source. - * - * This is a helper function to abstract the retrieval of data, so that it can - * come from files, STDIN, etc. Currently supports filepath and STDIN. - * - * @param string $data_source - * The path to a file, or '-' for STDIN. - * - * @return string - * The raw data as a string. - */ -function make_get_data($data_source) { - if ($data_source == '-') { - // See http://drupal.org/node/499758 before changing this. - $stdin = fopen('php://stdin', 'r'); - $data = ''; - $has_input = FALSE; - - while ($line = fgets($stdin)) { - $has_input = TRUE; - $data .= $line; - } - - if ($has_input) { - return $data; - } - return FALSE; - } - // Local file. - elseif (!strpos($data_source, '://')) { - $data = file_get_contents($data_source); - } - // Remote file. - else { - $file = _make_download_file($data_source); - $data = file_get_contents($file); - drush_op('unlink', $file); - } - return $data; -} - -/** - * Apply any defaults. - * - * @param array &$info - * A parsed make array. - */ -function make_apply_defaults(&$info) { - if (isset($info['defaults'])) { - $defaults = $info['defaults']; - - foreach ($defaults as $type => $default_data) { - if (isset($info[$type])) { - foreach ($info[$type] as $project => $data) { - $info[$type][$project] = _drush_array_overlay_recursive($default_data, $info[$type][$project]); - } - } - else { - drush_log(dt("Unknown attribute '@type' in defaults array", array('@type' => $type)), LogLevel::WARNING); - } - } - } -} - -/** - * Check if makefile overrides are allowed - * - * @param array $option - * The option to check. - */ -function _make_is_override_allowed ($option) { - $allow_override = drush_get_option('allow-override', 'all'); - - if ($allow_override == 'all') { - $allow_override = array(); - } - elseif (!is_array($allow_override)) { - $allow_override = _convert_csv_to_array($allow_override); - } - - if ((empty($allow_override)) || ((in_array($option, $allow_override)) && (!in_array('none', $allow_override)))) { - return TRUE; - } - drush_log(dt("'!option' not allowed; use --allow-override=!option or --allow-override=all to permit", array("!option" => $option)), LogLevel::WARNING); - return FALSE; -} - -/** - * Gather any working copy options. - * - * @param array $download - * The download array. - */ -function _get_working_copy_option($download) { - $wc = ''; - - if (_make_is_override_allowed('working-copy') && isset ($download['working-copy'])) { - $wc = $download['working-copy']; - } - else { - $wc = drush_get_option('working-copy'); - } - return $wc; -} - -/** - * Given data from stdin, determine format. - * - * @return array|bool - * Returns parsed data if it matches any known format. - */ -function _make_determine_format($data) { - // Most .make files will have a `core` attribute. Use this to determine - // the format. - if (preg_match('/^\s*core:/m', $data)) { - $parsed = ParserYaml::parse($data); - $parsed['format'] = 'yaml'; - return $parsed; - } - elseif (preg_match('/^\s*core\s*=/m', $data)) { - $parsed = ParserIni::parse($data); - $parsed['format'] = 'ini'; - return $parsed; - } - - // If the .make file did not have a core attribute, it is being included - // by another .make file. Test YAML first to avoid segmentation faults from - // preg_match in INI parser. - $yaml_parse_exception = FALSE; - try { - if ($parsed = ParserYaml::parse($data)) { - $parsed['format'] = 'yaml'; - return $parsed; - } - } - catch (\Symfony\Component\Yaml\Exception\ParseException $e) { - // Note that an exception was thrown, and display after .ini parsing. - $yaml_parse_exception = $e; - } - - // Try INI format. - if ($parsed = ParserIni::parse($data)) { - $parsed['format'] = 'ini'; - return $parsed; - } - - if ($yaml_parse_exception) { - throw $e; - } - - return drush_set_error('MAKE_STDIN_ERROR', dt('Unknown make file format')); -} diff --git a/vendor/drush/drush/commands/make/update.make.inc b/vendor/drush/drush/commands/make/update.make.inc deleted file mode 100644 index 8dba72eb0ef4c6eec06f16b237ef603eec2e125a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/make/update.make.inc +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -/** - * @file - * make-update command implementation. - */ - -/** - * Command callback for make-update. - */ -function drush_make_update($makefile = NULL) { - // Process makefile and get projects array. - $info = _make_parse_info_file($makefile); - - make_prepare_projects(FALSE, $info); - $make_projects = drush_get_option('DRUSH_MAKE_PROJECTS', FALSE); - - // Pick projects coming from drupal.org and adjust its structure - // to feed update_status engine. - // We provide here some heuristics to determine if a git clone comes - // from drupal.org and also guess its version. - // #TODO# move git checks to make_prepare_projects() and use it to leverage - // git_drupalorg engine. - $projects = array(); - foreach ($make_projects as $project_name => $project) { - if (($project['download']['type'] == 'git') && !empty($project['download']['url'])) { - // TODO check that tag or branch are valid version strings (with pm_parse_version()). - if (!empty($project['download']['tag'])) { - $version = $project['download']['tag']; - } - elseif (!empty($project['download']['branch'])) { - $version = $project['download']['branch'] . '-dev'; - } - /* - elseif (!empty($project['download']['refspec'])) { - #TODO# Parse refspec. - } - */ - else { - // If no tag or branch, we can't match a d.o version. - continue; - } - $projects[$project_name] = $project + array( - 'path' => '', - 'label' => $project_name, - 'version' => $version, - ); - } - elseif ($project['download']['type'] == 'pm') { - $projects[$project_name] = $project + array( - 'path' => '', - 'label' => $project_name, - ); - } - } - - // Check for updates. - $update_status = drush_get_engine('update_status'); - $update_info = $update_status->getStatus($projects, TRUE); - - $security_only = drush_get_option('security-only', FALSE); - foreach ($update_info as $project_name => $project_update_info) { - if (!$security_only || ($security_only && $project_update_info['status'] == DRUSH_UPDATESTATUS_NOT_SECURE)) { - $make_projects[$project_name]['download']['full_version'] = $project_update_info['recommended']; - } - } - - // Inject back make projects and generate the updated makefile. - drush_set_option('DRUSH_MAKE_PROJECTS', $make_projects); - make_generate_from_makefile(drush_get_option('result-file'), $makefile); -} - diff --git a/vendor/drush/drush/commands/pm/download.pm.inc b/vendor/drush/drush/commands/pm/download.pm.inc deleted file mode 100644 index 71745df8a5ef5f08ec0aa82d0d44a6ab96c6367d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/download.pm.inc +++ /dev/null @@ -1,394 +0,0 @@ -<?php - -/** - * @file - * pm-download command implementation. - */ - -use Drush\Log\LogLevel; -use Drush\UpdateService\ReleaseInfo; - -/** - * Implements drush_hook_COMMAND_validate(). - */ -function drush_pm_download_validate() { - // Accomodate --select to the values accepted by release_info. - $select = drush_get_option('select', 'auto'); - if ($select === TRUE) { - drush_set_option('select', 'always'); - } - else if ($select === FALSE) { - drush_set_option('select', 'never'); - } - - // Validate the user specified destination directory. - $destination = drush_get_option('destination'); - if (!empty($destination)) { - $destination = rtrim($destination, DIRECTORY_SEPARATOR); - if (!is_dir($destination)) { - drush_print(dt("The directory !destination does not exist.", array('!destination' => $destination))); - if (!drush_get_context('DRUSH_SIMULATE')) { - if (drush_confirm(dt('Would you like to create it?'))) { - drush_mkdir($destination, TRUE); - } - if (!is_dir($destination)) { - return drush_set_error('DRUSH_PM_NO_DESTINATION', dt('Unable to create destination directory !destination.', array('!destination' => $destination))); - } - } - } - if (!is_writable($destination)) { - return drush_set_error('DRUSH_PM_NO_DESTINATION', dt('Destination directory !destination is not writable.', array('!destination' => $destination))); - } - // Ignore --use-site-dir, if given. - if (drush_get_option('use-site-dir', FALSE)) { - drush_set_option('use-site-dir', FALSE); - } - } - - // Validate --variant or enforce a sane default. - $variant = drush_get_option('variant', FALSE); - if ($variant) { - $variants = array('full', 'projects', 'profile-only'); - if (!in_array($variant, $variants)) { - return drush_set_error('DRUSH_PM_PROFILE_INVALID_VARIANT', dt('Invalid variant !variant. Valid values: !variants.', array('!variant' => $variant, '!variants' => implode(', ', $variants)))); - } - } - // 'full' and 'projects' variants are only valid for wget package handler. - $package_handler = drush_get_option('package-handler', 'wget'); - if (($package_handler != 'wget') && ($variant != 'profile-only')) { - $new_variant = 'profile-only'; - if ($variant) { - drush_log(dt('Variant !variant is incompatible with !ph package-handler.', array('!variant' => $variant, '!ph' => $package_handler)), LogLevel::WARNING); - } - } - // If we are working on a drupal root, full variant is not an option. - else if (drush_get_context('DRUSH_BOOTSTRAP_PHASE') >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) { - if ((!$variant) || (($variant == 'full') && (!isset($new_variant)))) { - $new_variant = 'projects'; - } - if ($variant == 'full') { - drush_log(dt('Variant full is not a valid option within a Drupal root.'), LogLevel::WARNING); - } - } - - if (isset($new_variant)) { - drush_set_option('variant', $new_variant); - if ($variant) { - drush_log(dt('Switching to --variant=!variant.', array('!variant' => $new_variant)), LogLevel::OK); - } - } -} - -/** - * Command callback. Download Drupal core or any project. - */ -function drush_pm_download() { - $release_info = drush_get_engine('release_info'); - - if (!$requests = pm_parse_arguments(func_get_args(), FALSE)) { - $requests = array('drupal'); - } - - // Pick cli options. - $status_url = drush_get_option('source', ReleaseInfo::DEFAULT_URL); - $restrict_to = drush_get_option('dev', ''); - $select = drush_get_option('select', 'auto'); - $all = drush_get_option('all', FALSE); - // If we've bootstrapped a Drupal site and the user may have the chance - // to select from a list of filtered releases, we want to pass - // the installed project version, if any. - $projects = array(); - if (drush_get_context('DRUSH_BOOTSTRAP_PHASE') >= DRUSH_BOOTSTRAP_DRUPAL_FULL) { - if (!$all and in_array($select, array('auto', 'always'))) { - $projects = drush_get_projects(); - } - } - - // Get release history for each request and download the project. - foreach ($requests as $request) { - $request = pm_parse_request($request, $status_url, $projects); - $version = isset($projects[$request['name']]) ? $projects[$request['name']]['version'] : NULL; - $release = $release_info->selectReleaseBasedOnStrategy($request, $restrict_to, $select, $all, $version); - if ($release == FALSE) { - // Stop working on the first failure. Return silently on user abort. - if (drush_get_context('DRUSH_USER_ABORT', FALSE)) { - return FALSE; - } - // Signal that the command failed for all other problems. - return drush_set_error('DRUSH_DOWNLOAD_FAILED', dt("Could not download requested project(s).")); - } - $request['version'] = $release['version']; - - $project_release_info = $release_info->get($request); - $request['project_type'] = $project_release_info->getType(); - - // Determine the name of the directory that will contain the project. - // We face here all the assymetries to make it smooth for package handlers. - // For Drupal core: --drupal-project-rename or drupal-x.y - if (($request['project_type'] == 'core') || - (($request['project_type'] == 'profile') && (drush_get_option('variant', 'full') == 'full'))) { - // Avoid downloading core into existing core. - if (drush_get_context('DRUSH_BOOTSTRAP_PHASE') >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) { - if (strpos(realpath(drush_get_option('destination')), DRUPAL_ROOT) !== FALSE) { - return drush_set_error('DRUSH_PM_DOWNLOAD_TRANSLATIONS_FORBIDDEN', dt('It\'s forbidden to download !project core into an existing core.', array('!project' => $request['name']))); - } - } - - if ($rename = drush_get_option('drupal-project-rename', FALSE)) { - if ($rename === TRUE) { - $request['project_dir'] = $request['name']; - } - else { - $request['project_dir'] = $rename; - } - } - else { - // Set to drupal-x.y, the expected name for .tar.gz contents. - // Explicitly needed for cvs package handler. - $request['project_dir'] = strtolower(strtr($release['name'], ' ', '-')); - } - } - // For the other project types we want the project name. Including core - // variant for profiles. Note those come with drupal-x.y in the .tar.gz. - else { - $request['project_dir'] = $request['name']; - } - - // Download the project to a temporary location. - drush_log(dt('Downloading project !name ...', array('!name' => $request['name']))); - $request['full_project_path'] = package_handler_download_project($request, $release); - if (!$request['full_project_path']) { - // Delete the cached update service file since it may be invalid. - $release_info->clearCached($request); - drush_log(dt('Error downloading !name', array('!name' => $request['name']), LogLevel::ERROR)); - continue; - } - - // Determine the install location for the project. User provided - // --destination has preference. - $destination = drush_get_option('destination'); - if (!empty($destination)) { - if (!file_exists($destination)) { - drush_mkdir($destination); - } - $request['project_install_location'] = realpath($destination); - } - else { - $request['project_install_location'] = _pm_download_destination($request['project_type']); - } - - // If user did not provide --destination, then call the - // download-destination-alter hook to give the chance to any commandfiles - // to adjust the install location or abort it. - if (empty($destination)) { - $result = drush_command_invoke_all_ref('drush_pm_download_destination_alter', $request, $release); - if (array_search(FALSE, $result, TRUE) !== FALSE) { - return FALSE; - } - } - - // Load version control engine and detect if (the parent directory of) the - // project install location is under a vcs. - if (!$version_control = drush_pm_include_version_control($request['project_install_location'])) { - continue; - } - - $request['project_install_location'] .= '/' . $request['project_dir']; - - if ($version_control->engine == 'backup') { - // Check if install location already exists. - if (is_dir($request['project_install_location'])) { - if (drush_confirm(dt('Install location !location already exists. Do you want to overwrite it?', array('!location' => $request['project_install_location'])))) { - drush_delete_dir($request['project_install_location'], TRUE); - } - else { - drush_log(dt("Skip installation of !project to !dest.", array('!project' => $request['name'], '!dest' => $request['project_install_location'])), LogLevel::WARNING); - continue; - } - } - } - else { - // Find and unlink all files but the ones in the vcs control directories. - $skip_list = array('.', '..'); - $skip_list = array_merge($skip_list, drush_version_control_reserved_files()); - drush_scan_directory($request['project_install_location'], '/.*/', $skip_list, 'unlink', TRUE, 'filename', 0, TRUE); - } - - // Copy the project to the install location. - if (drush_op('_drush_recursive_copy', $request['full_project_path'], $request['project_install_location'])) { - drush_log(dt("Project !project (!version) downloaded to !dest.", array('!project' => $request['name'], '!version' => $release['version'], '!dest' => $request['project_install_location'])), LogLevel::SUCCESS); - // Adjust full_project_path to the final project location. - $request['full_project_path'] = $request['project_install_location']; - - // If the version control engine is a proper vcs we also need to remove - // orphan directories. - if ($version_control->engine != 'backup') { - $empty_dirs = drush_find_empty_directories($request['full_project_path'], $version_control->reserved_files()); - foreach ($empty_dirs as $empty_dir) { - // Some VCS files are read-only on Windows (e.g., .svn/entries). - drush_delete_dir($empty_dir, TRUE); - } - } - - // Post download actions. - package_handler_post_download($request, $release); - drush_command_invoke_all('drush_pm_post_download', $request, $release); - $version_control->post_download($request); - - // Print release notes if --notes option is set. - if (drush_get_option('notes') && !drush_get_context('DRUSH_PIPE')) { - $project_release_info->getReleaseNotes($release['version'], FALSE); - } - - // Inform the user about available modules a/o themes in the downloaded project. - drush_pm_extensions_in_project($request); - } - else { - // We don't `return` here in order to proceed with downloading additional projects. - drush_set_error('DRUSH_PM_DOWNLOAD_FAILED', dt("Project !project (!version) could not be downloaded to !dest.", array('!project' => $request['name'], '!version' => $release['version'], '!dest' => $request['project_install_location']))); - } - - // Notify about this project. - if (drush_notify_allowed('pm-download')) { - $msg = dt('Project !project (!version) downloaded to !install.', array( - '!project' => $name, - '!version' => $release['version'], - '!install' => $request['project_install_location'], - )); - drush_notify_send(drush_notify_command_message('pm-download', $msg)); - } - } -} - -/** - * Implementation of hook_drush_pm_download_destination_alter(). - * - * Built-in download-destination-alter hook. This particular version of - * the hook will move modules that contain only Drush commands to - * /usr/share/drush/commands if it exists, or $HOME/.drush if the - * site-wide location does not exist. - */ -function pm_drush_pm_download_destination_alter(&$request, $release) { - // A module is a pure Drush command if it has no .info.yml (8+) and contains no - // .drush.inc files. Skip this test for Drush itself, though; we do - // not want to download Drush to the ~/.drush folder. - if (in_array($request['project_type'], array('module', 'utility')) && ($request['name'] != 'drush')) { - $drush_command_files = drush_scan_directory($request['full_project_path'], '/.*\.drush.inc/'); - if (!empty($drush_command_files)) { - $pattern = drush_drupal_major_version() >= 8 ? '/.*\.info/' : '/.*\.module/'; - $module_files = drush_scan_directory($request['full_project_path'], $pattern); - if (empty($module_files)) { - $install_dir = drush_get_context('DRUSH_SITE_WIDE_COMMANDFILES'); - if (!is_dir($install_dir) || !is_writable($install_dir)) { - $install_dir = drush_get_context('DRUSH_PER_USER_CONFIGURATION'); - } - // Make the .drush dir if it does not already exist. - if (!is_dir($install_dir)) { - drush_mkdir($install_dir, FALSE); - } - // Change the location if the mkdir worked. - if (is_dir($install_dir)) { - $request['project_install_location'] = $install_dir; - } - } - // We need to clear the Drush commandfile cache so that - // our newly-downloaded Drush extension commandfiles can be found. - drush_cache_clear_all(); - } - } -} - -/** - * Determines a candidate destination directory for a particular site path. - * - * Optionally attempts to create the directory. - * - * @return String the candidate destination if it exists. - */ -function _pm_download_destination_lookup($type, $drupal_root, $sitepath, $create = FALSE) { - // Profiles in Drupal < 8 - if (($type == 'profile') && (drush_drupal_major_version() < 8)) { - $destination = 'profiles'; - } - // Type: module, theme or profile. - else { - if ($type == 'theme engine') { - $destination = 'themes/engines'; - } else { - $destination = $type . 's'; - } - // Prefer /contrib if it exists. - if ($sitepath) { - $destination = $sitepath . '/' . $destination; - } - $contrib = $destination . '/contrib'; - if (is_dir($contrib)) { - $destination = $contrib; - } - } - if ($create) { - drush_log(dt('Attempting to create destination directory at !dir', array('!dir' => $destination))); - drush_mkdir($destination, TRUE); - } - if (is_dir($destination)) { - drush_log(dt('Using destination directory !dir', array('!dir' => $destination))); - return $destination; - } - drush_log(dt('Could not find destination directory at !dir', array('!dir' => $destination))); - return FALSE; -} - -/** - * Returns the best destination for a particular download type we can find. - * - * It is based on the project type and drupal and site contexts. - */ -function _pm_download_destination($type) { - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - $site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT'); - $full_site_root = (empty($drupal_root) || empty($site_root)) ? '' : $drupal_root .'/'. $site_root; - $sitewide = empty($drupal_root) ? '' : $drupal_root . '/' . drush_drupal_sitewide_directory(); - - $in_site_directory = FALSE; - // Check if we are running within the site directory. - if (strpos(realpath(drush_cwd()), realpath($full_site_root)) !== FALSE || (drush_get_option('use-site-dir', FALSE))) { - $in_site_directory = TRUE; - } - - $destination = ''; - if ($type != 'core') { - // Attempt 1: If we are in a specific site directory, and the destination - // directory already exists, then we use that. - if (empty($destination) && $site_root && $in_site_directory) { - $create_dir = drush_get_option('use-site-dir', FALSE); - $destination = _pm_download_destination_lookup($type, $drupal_root, $full_site_root, $create_dir); - } - // Attempt 2: If the destination directory already exists for - // the sitewide directory, use that. - if (empty($destination) && $drupal_root) { - $destination = _pm_download_destination_lookup($type, $drupal_root, $sitewide); - } - // Attempt 3: If a specific (non default) site directory exists and - // the sitewide directory does not exist, then create destination - // in the site specific directory. - if (empty($destination) && $site_root && $site_root !== 'sites/default' && is_dir($full_site_root) && !is_dir($sitewide)) { - $destination = _pm_download_destination_lookup($type, $drupal_root, $full_site_root, TRUE); - } - // Attempt 4: If sitewide directory exists, then create destination there. - if (empty($destination) && is_dir($sitewide)) { - $destination = _pm_download_destination_lookup($type, $drupal_root, $sitewide, TRUE); - } - // Attempt 5: If site directory exists (even default), then create - // destination in that directory. - if (empty($destination) && $site_root && is_dir($full_site_root)) { - $destination = _pm_download_destination_lookup($type, $drupal_root, $full_site_root, TRUE); - } - } - // Attempt 6: If we didn't find a valid directory yet (or we somehow found - // one that doesn't exist) we always fall back to the current directory. - if (empty($destination) || !is_dir($destination)) { - $destination = drush_cwd(); - } - - return $destination; -} diff --git a/vendor/drush/drush/commands/pm/info.pm.inc b/vendor/drush/drush/commands/pm/info.pm.inc deleted file mode 100644 index f55fc672e2a7a8c942ea12f373423cbbf43561f4..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/info.pm.inc +++ /dev/null @@ -1,152 +0,0 @@ -<?php - -/** - * @file - * pm-info command implementation. - */ - -use Drush\Log\LogLevel; - -/** - * Command callback. Show detailed info for one or more extensions. - */ -function drush_pm_info() { - $result = array(); - $args = pm_parse_arguments(func_get_args()); - - $extension_info = drush_get_extensions(FALSE); - _drush_pm_expand_extensions($args, $extension_info); - // If no extensions are provided, show all. - if (count($args) == 0) { - $args = array_keys($extension_info); - } - - foreach ($args as $extension) { - if (isset($extension_info[$extension])) { - $info = $extension_info[$extension]; - } - else { - drush_log(dt('!extension was not found.', array('!extension' => $extension)), LogLevel::WARNING); - continue; - } - if (drush_extension_get_type($info) == 'module') { - $data = _drush_pm_info_module($info); - } - else { - $data = _drush_pm_info_theme($info); - } - $result[$extension] = $data; - } - return $result; -} - -/** - * Output format formatter-filter callback. - * - * @see drush_parse_command() - * @see drush_outputformat - */ -function _drush_pm_info_format_table_data($data) { - $result = array(); - foreach ($data as $extension => $info) { - foreach($info as $key => $value) { - if (is_array($value)) { - if (empty($value)) { - $value = 'none'; - } - else { - $value = implode(', ', $value); - } - } - $result[$extension][$key] = $value; - } - } - return $result; -} - -/** - * Return an array with general info of an extension. - */ -function _drush_pm_info_extension($info) { - $data['extension'] = drush_extension_get_name($info); - $data['project'] = isset($info->info['project'])?$info->info['project']:dt('Unknown'); - $data['type'] = drush_extension_get_type($info); - $data['title'] = $info->info['name']; - $data['config'] = isset($info->info['configure']) ? $info->info['configure'] : dt('None'); - $data['description'] = $info->info['description']; - $data['version'] = $info->info['version']; - $data['date'] = isset($info->info['datestamp']) ? format_date($info->info['datestamp'], 'custom', 'Y-m-d') : NULL; - $data['package'] = $info->info['package']; - $data['core'] = $info->info['core']; - $data['php'] = $info->info['php']; - $data['status'] = drush_get_extension_status($info); - $data['path'] = drush_extension_get_path($info); - - return $data; -} - -/** - * Return an array with info of a module. - */ -function _drush_pm_info_module($info) { - $major_version = drush_drupal_major_version(); - - $data = _drush_pm_info_extension($info); - if ($info->schema_version > 0) { - $schema_version = $info->schema_version; - } - elseif ($info->schema_version == -1) { - $schema_version = "no schema installed"; - } - else { - $schema_version = "module has no schema"; - } - $data['schema_version'] = $schema_version; - if ($major_version == 7) { - $data['files'] = $info->info['files']; - } - $data['requires'] = $info->info['dependencies']; - - if ($major_version == 6) { - $requiredby = $info->info['dependents']; - } - else { - $requiredby = array_keys($info->required_by); - } - $data['required_by'] = $requiredby; - if ($info->status == 1) { - $role = drush_role_get_class(); - $data['permissions'] = $role->getModulePerms(drush_extension_get_name($info)); - } - return $data; -} - -/** - * Return an array with info of a theme. - */ -function _drush_pm_info_theme($info) { - $major_version = drush_drupal_major_version(); - - $data = _drush_pm_info_extension($info); - - $data['core'] = $info->info['core']; - $data['php'] = $info->info['php']; - $data['engine'] = $info->info['engine']; - $data['base_theme'] = isset($info->base_themes) ? implode($info->base_themes, ', ') : ''; - $regions = $info->info['regions']; - $data['regions'] = $regions; - $features = $info->info['features']; - $data['features'] = $features; - if (count($info->info['stylesheets']) > 0) { - $data['stylesheets'] = ''; - foreach ($info->info['stylesheets'] as $media => $files) { - $files = array_keys($files); - $data['media '.$media] = $files; - } - } - if (count($info->info['scripts']) > 0) { - $scripts = array_keys($info->info['scripts']); - $data['scripts'] = $scripts; - } - return $data; -} diff --git a/vendor/drush/drush/commands/pm/package_handler/git_drupalorg.inc b/vendor/drush/drush/commands/pm/package_handler/git_drupalorg.inc deleted file mode 100644 index 0203db7ff72079c1ef4db0275ad714b634bd31a5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/package_handler/git_drupalorg.inc +++ /dev/null @@ -1,275 +0,0 @@ -<?php - -/** - * @file - * Drush PM drupal.org Git extension. - */ - -use Drush\Log\LogLevel; - -/** - * Validate this package handler can run. - */ -function package_handler_validate() { - // Check git command exists. Disable possible output. - $debug = drush_get_context('DRUSH_DEBUG'); - drush_set_context('DRUSH_DEBUG', FALSE); - - // We need to check for a git executable and then make sure version is >=1.7 - // (avoid drush_shell_exec because we want to run this even in --simulated mode.) - $success = exec('git --version', $git); - $git_version_array = explode(" ", $git[0]); - $git_version = $git_version_array[2]; - - drush_set_context('DRUSH_DEBUG', $debug); - if (!$success) { - return drush_set_error('DRUSH_SHELL_COMMAND_NOT_FOUND', dt('git executable not found.')); - } elseif ($git_version < '1.7') { - return drush_set_error('GIT_VERSION_UNSUPPORTED', dt('Your git version !git_version is not supported; please upgrade to git 1.7 or later.', array('!git_version' => $git_version))); - } - // Check git_deploy is enabled. Only for bootstrapped sites. - if (drush_get_context('DRUSH_BOOTSTRAP_PHASE') >= DRUSH_BOOTSTRAP_DRUPAL_FULL) { - drush_include_engine('drupal', 'environment'); - if (!drush_get_option('gitinfofile') && !drush_module_exists('git_deploy')) { - drush_log(dt('git package handler needs git_deploy module enabled to work properly.'), LogLevel::WARNING); - } - } - - return TRUE; -} - -/** - * Download a project. - * - * @param $request - * The project array with name, base and full (final) paths. - * @param $release - * The release details array from drupal.org. - */ -function package_handler_download_project(&$request, $release) { - if ($username = drush_get_option('gitusername')) { - // Uses SSH, which enables pushing changes back to git.drupal.org. - $repository = 'git@git.drupal.org:project/' . $request['name'] . '.git'; - } - else { - $repository = 'https://git.drupal.org/project/' . $request['name'] . '.git'; - } - $request['repository'] = $repository; - $tag = $release['tag']; - - // If the --cache option was given, create a new git reference cache of the - // remote repository, or update the existing cache to fetch recent changes. - if (drush_get_option('cache') && ($cachedir = drush_directory_cache())) { - $gitcache = $cachedir . '/git'; - $projectcache = $gitcache . '/' . $request['name'] . '.git'; - drush_mkdir($gitcache); - // Setup a new cache, if we don't have this project yet. - if (!file_exists($projectcache)) { - // --mirror works similar to --bare, but retrieves all tags, local - // branches, remote branches, and any other refs (notes, stashes, etc). - // @see http://stackoverflow.com/questions/3959924 - $command = 'git clone --mirror'; - if (drush_get_context('DRUSH_VERBOSE')) { - $command .= ' --verbose --progress'; - } - $command .= ' %s %s'; - drush_shell_cd_and_exec($gitcache, $command, $repository, $request['name'] . '.git'); - } - // If we already have this project, update it to speed up subsequent clones. - else { - // A --mirror clone is fully synchronized with `git remote update` instead - // of `git fetch --all`. - // @see http://stackoverflow.com/questions/6150188 - drush_shell_cd_and_exec($projectcache, 'git remote update'); - } - $gitcache = $projectcache; - } - - // Clone the repo into a temporary path. - $clone_path = drush_tempdir(); - - $command = 'git clone'; - $command .= ' ' . drush_get_option('gitcloneparams'); - if (drush_get_option('cache')) { - $command .= ' --reference ' . drush_escapeshellarg($gitcache); - } - if (drush_get_context('DRUSH_VERBOSE')) { - $command .= ' --verbose --progress'; - } - $command .= ' ' . drush_escapeshellarg($repository); - $command .= ' ' . drush_escapeshellarg($clone_path); - if (!drush_shell_exec($command)) { - return drush_set_error('DRUSH_PM_GIT_CHECKOUT_PROBLEMS', dt('Unable to clone project !name from git.drupal.org.', array('!name' => $request['name']))); - } - - // Check if the 'tag' from the release feed is a tag or a branch. - // If the tag exists, git will return it - if (!drush_shell_cd_and_exec($clone_path, 'git tag -l ' . drush_escapeshellarg($tag))) { - return drush_set_error('DRUSH_PM_GIT_CHECKOUT_PROBLEMS', dt('Unable to clone project !name from git.drupal.org.', array('!name' => $request['name']))); - } - $output = drush_shell_exec_output(); - - if (isset($output[0]) && ($output[0] == $tag)) { - // If we want a tag, simply checkout it. The checkout will end up in - // "detached head" state. - $command = 'git checkout ' . drush_get_option('gitcheckoutparams'); - $command .= ' ' . drush_escapeshellarg($tag); - if (!drush_shell_cd_and_exec($clone_path, $command)) { - return drush_set_error('DRUSH_PM_UNABLE_CHECKOUT', 'Unable to retrieve ' . $request['name'] . ' from git.drupal.org.'); - } - } - else { - // Else, we want to checkout a branch. - // First check if we are not already in the correct branch. - if (!drush_shell_cd_and_exec($clone_path, 'git symbolic-ref HEAD')) { - return drush_set_error('DRUSH_PM_UNABLE_CHECKOUT', 'Unable to retrieve ' . $request['name'] . ' from git.drupal.org.'); - } - $output = drush_shell_exec_output(); - $current_branch = preg_replace('@^refs/heads/@', '', $output[0]); - - // If we are not on the correct branch already, switch to the correct one. - if ($current_branch != $tag) { - $command = 'git checkout'; - $command .= ' ' . drush_get_option('gitcheckoutparams'); - $command .= ' --track ' . drush_escapeshellarg('origin/' . $tag) . ' -b ' . drush_escapeshellarg($tag); - if (!drush_shell_cd_and_exec($clone_path, $command)) { - return drush_set_error('DRUSH_PM_UNABLE_CHECKOUT', 'Unable to retrieve ' . $request['name'] . ' from git.drupal.org.'); - } - } - } - - return $clone_path; -} - -/** - * Update a project (so far, only modules are supported). - * - * @param $request - * The project array with name, base and full (final) paths. - * @param $release - * The release details array from drupal.org. - */ -function package_handler_update_project($request, $release) { - drush_log('Updating project ' . $request['name'] . ' ...'); - - $commands = array(); - if ((!empty($release['version_extra'])) && ($release['version_extra'] == 'dev')) { - // Update the branch of the development repository. - $commands[] = 'git pull'; - $commands[] = drush_get_option('gitpullparams'); - } - else { - // Use a stable repository. - $commands[] = 'git fetch'; - $commands[] = drush_get_option('gitfetchparams'); - $commands[] = ';'; - $commands[] = 'git checkout'; - $commands[] = drush_get_option('gitcheckoutparams'); - $commands[] = $release['version']; - } - - if (!drush_shell_cd_and_exec($request['full_project_path'], implode(' ', $commands))) { - return drush_set_error('DRUSH_PM_UNABLE_CHECKOUT', 'Unable to update ' . $request['name'] . ' from git.drupal.org.'); - } - - return TRUE; -} - -/** - * Post download action. - * - * This action take place once the project is placed in its final location. - * - * Here we add the project as a git submodule. - */ -function package_handler_post_download($project, $release) { - if (drush_get_option('gitsubmodule', FALSE)) { - // Obtain the superproject path, then add as submodule. - if (drush_shell_cd_and_exec(dirname($project['full_project_path']), 'git rev-parse --show-toplevel')) { - $output = drush_shell_exec_output(); - $superproject = $output[0]; - // Add the downloaded project as a submodule of its git superproject. - $command = array(); - $command[] = 'git submodule add'; - $command[] = drush_get_option('gitsubmoduleaddparams'); - $command[] = $project['repository']; - // We need the submodule relative path. - $command[] = substr(realpath($project['full_project_path']), strlen(realpath($superproject)) + 1); - if (!drush_shell_cd_and_exec($superproject, implode(' ', $command))) { - return drush_set_error('DRUSH_PM_GIT_CHECKOUT_PROBLEMS', dt('Unable to add !name as a git submodule of !super.', array('!name' => $project['name'], '!super' => $superproject))); - } - } - else { - return drush_set_error('DRUSH_PM_GIT_SUBMODULE_PROBLEMS', dt('Unable to create !project as a git submodule: !dir is not in a Git repository.', array('!project' => $project['name'], '!dir' => dirname($project['full_project_path'])))); - } - } - - if (drush_get_option('gitinfofile', FALSE)) { - $matches = array(); - if (preg_match('/^(.+).x-dev$/', $release['version'], $matches)) { - $full_version = drush_pm_git_drupalorg_compute_rebuild_version($project['full_project_path'], $matches[1]); - } - else { - $full_version = $release['version']; - } - if (drush_shell_cd_and_exec(dirname($project['full_project_path']), 'git log -1 --pretty=format:%ct')) { - $output = drush_shell_exec_output(); - $datestamp = $output[0]; - } - else { - $datestamp = time(); - } - drush_pm_inject_info_file_metadata($project['full_project_path'], $project['name'], $full_version, $datestamp); - } - -} - -/** - * Helper function to compute the rebulid version string for a project. - * - * This does some magic in Git to find the latest release tag along - * the branch we're packaging from, count the number of commits since - * then, and use that to construct this fancy alternate version string - * which is useful for the version-specific dependency support in Drupal - * 7 and higher. - * - * NOTE: A similar function lives in git_deploy and in the drupal.org - * packaging script (see DrupalorgProjectPackageRelease.class.php inside - * drupalorg/drupalorg_project/plugins/release_packager). Any changes to the - * actual logic in here should probably be reflected in the other places. - * - * @param string $project_dir - * The full path to the root directory of the project to operate on. - * @param string $branch - * The branch that we're using for -dev. This should only include the - * core version, the dash, and the branch's major version (eg. '7.x-2'). - * - * @return string - * The full 'rebuild version string' in the given Git checkout. - */ -function drush_pm_git_drupalorg_compute_rebuild_version($project_dir, $branch) { - $rebuild_version = ''; - $branch_preg = preg_quote($branch); - - if (drush_shell_cd_and_exec($project_dir, 'git describe --tags')) { - $shell_output = drush_shell_exec_output(); - $last_tag = $shell_output[0]; - // Make sure the tag starts as Drupal formatted (for eg. - // 7.x-1.0-alpha1) and if we are on a proper branch (ie. not master) - // then it's on that branch. - if (preg_match('/^(?<drupalversion>' . $branch_preg . '\.\d+(?:-[^-]+)?)(?<gitextra>-(?<numberofcommits>\d+-)g[0-9a-f]{7})?$/', $last_tag, $matches)) { - // If we found additional git metadata (in particular, number of commits) - // then use that info to build the version string. - if (isset($matches['gitextra'])) { - $rebuild_version = $matches['drupalversion'] . '+' . $matches['numberofcommits'] . 'dev'; - } - // Otherwise, the branch tip is pointing to the same commit as the - // last tag on the branch, in which case we use the prior tag and - // add '+0-dev' to indicate we're still on a -dev branch. - else { - $rebuild_version = $last_tag . '+0-dev'; - } - } - } - return $rebuild_version; -} diff --git a/vendor/drush/drush/commands/pm/package_handler/wget.inc b/vendor/drush/drush/commands/pm/package_handler/wget.inc deleted file mode 100644 index e263940c5b24b668791ffb4148104c9adc49b78d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/package_handler/wget.inc +++ /dev/null @@ -1,116 +0,0 @@ -<?php - -/** - * @file - * Drush PM Wget extension - */ - -/** - * Validate this package handler can run. - */ -function package_handler_validate() { - // Check wget or curl command exists. Disable possible output. - $debug = drush_get_context('DRUSH_DEBUG'); - drush_set_context('DRUSH_DEBUG', FALSE); - $success = drush_shell_exec('wget --version'); - if (!$success) { - $success = drush_shell_exec('curl --version'); - // Old version of curl shipped in darwin returns error status for --version - // and --help. Give the chance to use it. - if (!$success) { - $success = drush_shell_exec('which curl'); - } - } - drush_set_context('DRUSH_DEBUG', $debug); - if (!$success) { - return drush_set_error('DRUSH_SHELL_COMMAND_NOT_FOUND', dt('wget nor curl executables found.')); - } - - return TRUE; -} - -/** - * Download a project. - * - * @param $request Array with information on the request to download. - * @param $release The release details array from drupal.org. - */ -function package_handler_download_project(&$request, $release) { - // Install profiles come in several variants. User may specify which one she wants. - if ($request['project_type'] == 'profile') { - $variant = drush_get_option('variant', 'full'); - foreach ($release['files'] as $file) { - if ($file['variant'] == $variant && $file['archive_type'] == 'tar.gz') { - $release = array_merge($release, $file); - break; - } - } - } - - // Add <date> to download link, so it is part of the cache key. Dev snapshots can then be cached forever. - $download_link = $release['download_link']; - if (strpos($release['download_link'], '-dev') !== FALSE) { - $download_link .= '?date=' . $release['date']; - } - // Cache for a year by default. - $cache_duration = (drush_get_option('cache', TRUE)) ? 86400*365 : 0; - - // Prepare download path. On Windows file name cannot contain '?'. - // See http://drupal.org/node/1782444 - $filename = str_replace('?', '_', basename($download_link)); - $download_path = drush_tempdir() . '/' . $filename; - - // Download the tarball. - $download_path = drush_download_file($download_link, $download_path, $cache_duration); - if ($download_path || drush_get_context('DRUSH_SIMULATE')) { - drush_log(dt('Downloading !filename was successful.', array('!filename' => $filename))); - } - else { - return drush_set_error('DRUSH_PM_DOWNLOAD_FAILED', dt('Unable to download !project to !path from !url.', array('!project' => $request['name'], '!path' => $download_path, '!url' => $download_link))); - } - - // Check Md5 hash. - if (!drush_get_option('no-md5')) { - if (drush_op('md5_file', $download_path) !== $release['mdhash'] && !drush_get_context('DRUSH_SIMULATE')) { - drush_delete_dir(drush_download_file_name($download_link, TRUE)); - return drush_set_error('DRUSH_PM_FILE_CORRUPT', dt('File !filename is corrupt (wrong md5 checksum).', array('!filename' => $filename))); - } - else { - drush_log(dt('Md5 checksum of !filename verified.', array('!filename' => $filename))); - } - } - - // Extract the tarball in place and return the full path to the untarred directory. - $download_base = dirname($download_path); - if (!$tar_file_list = drush_tarball_extract($download_path, $download_base, TRUE)) { - // An error has been logged. - return FALSE; - } - $tar_directory = drush_trim_path($tar_file_list[0]); - - return $download_base . '/' . $tar_directory; -} - -/** - * Update a project. - * - * @return bool - * Success or failure. An error message will be logged. - */ -function package_handler_update_project(&$request, $release) { - $download_path = package_handler_download_project($request, $release); - if ($download_path) { - return drush_move_dir($download_path, $request['full_project_path']); - } - else { - return FALSE; - } -} - -/** - * Post download action. - * - * This action take place once the project is placed in its final location. - */ -function package_handler_post_download($project) { -} diff --git a/vendor/drush/drush/commands/pm/pm.drush.inc b/vendor/drush/drush/commands/pm/pm.drush.inc deleted file mode 100644 index abdbf6a21594c1c29521d045ad2c86f4a2c8d75c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/pm.drush.inc +++ /dev/null @@ -1,2296 +0,0 @@ -<?php - -/** - * @file - * The drush Project Manager - * - * Terminology: - * - Request: a requested project (string or keyed array), with a name and (optionally) version. - * - Project: a drupal.org project (i.e drupal.org/project/*), such as cck or zen. - * - Extension: a drupal.org module, theme or profile. - * - Version: a requested version, such as 1.0 or 1.x-dev. - * - Release: a specific release of a project, with associated metadata (from the drupal.org update service). - */ - -use Drush\Log\LogLevel; - -/** - * @defgroup update_status_constants Update Status Constants - * @{ - * Represents update status of projects. - * - * The first set is a mapping of some constants declared in update.module. - * We only declare the ones we're interested in. - * The rest of the constants are used by pm-updatestatus to represent - * a status when the user asked for updates to specific versions or - * other circumstances not managed by Drupal. - */ - -/** - * Project is missing security update(s). - * - * Maps UPDATE_NOT_SECURE. - */ -const DRUSH_UPDATESTATUS_NOT_SECURE = 1; - -/** - * Current release has been unpublished and is no longer available. - * - * Maps UPDATE_REVOKED. - */ -const DRUSH_UPDATESTATUS_REVOKED = 2; - -/** - * Current release is no longer supported by the project maintainer. - * - * Maps UPDATE_NOT_SUPPORTED. - */ -const DRUSH_UPDATESTATUS_NOT_SUPPORTED = 3; - -/** - * Project has a new release available, but it is not a security release. - * - * Maps UPDATE_NOT_CURRENT. - */ -const DRUSH_UPDATESTATUS_NOT_CURRENT = 4; - -/** - * Project is up to date. - * - * Maps UPDATE_CURRENT. - */ -const DRUSH_UPDATESTATUS_CURRENT = 5; - -/** - * Project's status cannot be checked. - * - * Maps UPDATE_NOT_CHECKED. - */ -const DRUSH_UPDATESTATUS_NOT_CHECKED = -1; - -/** - * No available update data was found for project. - * - * Maps UPDATE_UNKNOWN. - */ -const DRUSH_UPDATESTATUS_UNKNOWN = -2; - -/** - * There was a failure fetching available update data for this project. - * - * Maps UPDATE_NOT_FETCHED. - */ -const DRUSH_UPDATESTATUS_NOT_FETCHED = -3; - -/** - * We need to (re)fetch available update data for this project. - * - * Maps UPDATE_FETCH_PENDING. - */ -const DRUSH_UPDATESTATUS_FETCH_PENDING = -4; - -/** - * Project was not packaged by drupal.org. - */ -const DRUSH_UPDATESTATUS_PROJECT_NOT_PACKAGED = 101; - -/** - * Requested project is not updateable. - */ -const DRUSH_UPDATESTATUS_REQUESTED_PROJECT_NOT_UPDATEABLE = 102; - -/** - * Requested project not found. - */ -const DRUSH_UPDATESTATUS_REQUESTED_PROJECT_NOT_FOUND = 103; - -/** - * Requested version not found. - */ -const DRUSH_UPDATESTATUS_REQUESTED_VERSION_NOT_FOUND = 104; - -/** - * Requested version available. - */ -const DRUSH_UPDATESTATUS_REQUESTED_VERSION_NOT_CURRENT = 105; - -/** - * Requested version already installed. - */ -const DRUSH_UPDATESTATUS_REQUESTED_VERSION_CURRENT = 106; - -/** - * @} End of "defgroup update_status_constants". - */ - -/** - * Implementation of hook_drush_help(). - */ -function pm_drush_help($section) { - switch ($section) { - case 'meta:pm:title': - return dt('Project manager commands'); - case 'meta:pm:summary': - return dt('Download, enable, examine and update your modules and themes.'); - case 'drush:pm-enable': - return dt('Enable one or more extensions (modules or themes). Enable dependant extensions as well.'); - case 'drush:pm-disable': - return dt('Disable one or more extensions (modules or themes). Disable dependant extensions as well.'); - case 'drush:pm-updatecode': - case 'drush:pm-update': - $message = dt("Display available update information for Drupal core and all enabled projects and allow updating to latest recommended releases."); - if ($section == 'drush:pm-update') { - $message .= ' '.dt("Also apply any database updates required (same as pm-updatecode + updatedb)."); - } - $message .= ' '.dt("Note: The user is asked to confirm before the actual update. Backups are performed unless directory is already under version control. Updated projects can potentially break your site. It is NOT recommended to update production sites without prior testing."); - return $message; - case 'drush:pm-updatecode-postupdate': - return dt("This is a helper command needed by updatecode. It is used to check for db updates in a backend process after code updated have been performed. We need to run this task in a separate process to not conflict with old code already in memory."); - case 'drush:pm-download': - return dt("Download Drupal core or projects from drupal.org (Drupal core, modules, themes or profiles) and other sources. It will automatically figure out which project version you want based on its recommended release, or you may specify a particular version. - -If no --destination is provided, then destination depends on the project type: - - Profiles will be downloaded to profiles/ in your Drupal root. - - Modules and themes will be downloaded to the site specific directory (sites/example.com/modules|themes) if available, or to the site wide directory otherwise. - - If you're downloading drupal core or you are not running the command within a bootstrapped drupal site, the default location is the current directory. - - Drush commands will be relocated to @site_wide_location (if available) or ~/.drush. Relocation is determined once the project is downloaded by examining its content. Note you can provide your own function in a commandfile to determine the relocation of any project.", array('@site_wide_location' => drush_get_context('DRUSH_SITE_WIDE_COMMANDFILES'))); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function pm_drush_command() { - $update_options = array( - 'lock' => array( - 'description' => 'Add a persistent lock to remove the specified projects from consideration during updates. Locks may be removed with the --unlock parameter, or overridden by specifically naming the project as a parameter to pm-update or pm-updatecode. The lock does not affect pm-download. See also the update_advanced project for similar and improved functionality.', - 'example-value' => 'foo,bar', - ), - ); - $update_suboptions = array( - 'lock' => array( - 'lock-message' => array( - 'description' => 'A brief message explaining why a project is being locked; displayed during pm-updatecode. Optional.', - 'example-value' => 'message', - ), - 'unlock' => array( - 'description' => 'Remove the persistent lock from the specified projects so that they may be updated again.', - 'example-value' => 'foo,bar', - ), - ), - ); - - $items['pm-enable'] = array( - 'description' => 'Enable one or more extensions (modules or themes).', - 'arguments' => array( - 'extensions' => 'A list of modules or themes. You can use the * wildcard at the end of extension names to enable all matches.', - ), - 'options' => array( - 'resolve-dependencies' => 'Attempt to download any missing dependencies. At the moment, only works when the module name is the same as the project name.', - 'skip' => 'Skip automatic downloading of libraries (c.f. devel).', - ), - 'aliases' => array('en', 'pm:enable'), - 'engines' => array( - 'release_info' => array( - 'add-options-to-command' => FALSE, - ), - ), - ); - $items['pm-disable'] = array( - 'description' => 'Disable one or more extensions (modules or themes).', - 'arguments' => array( - 'extensions' => 'A list of modules or themes. You can use the * wildcard at the end of extension names to disable multiple matches.', - ), - 'aliases' => array('dis', 'pm:disable'), - 'engines' => array( - 'version_control', - 'package_handler', - 'release_info' => array( - 'add-options-to-command' => FALSE, - ), - ), - ); - $items['pm-info'] = array( - 'description' => 'Show detailed info for one or more extensions (modules or themes).', - 'arguments' => array( - 'extensions' => 'A list of modules or themes. You can use the * wildcard at the end of extension names to show info for multiple matches. If no argument is provided it will show info for all available extensions.', - ), - 'aliases' => array('pmi', 'pm:info'), - 'outputformat' => array( - 'default' => 'key-value-list', - 'pipe-format' => 'json', - 'formatted-filter' => '_drush_pm_info_format_table_data', - 'field-labels' => array( - 'extension' => 'Extension', - 'project' => 'Project', - 'type' => 'Type', - 'title' => 'Title', - 'description' => 'Description', - 'version' => 'Version', - 'date' => 'Date', - 'package' => 'Package', - 'core' => 'Core', - 'php' => 'PHP', - 'status' => 'Status', - 'path' => 'Path', - 'schema_version' => 'Schema version', - 'files' => 'Files', - 'requires' => 'Requires', - 'required_by' => 'Required by', - 'permissions' => 'Permissions', - 'config' => 'Configure', - 'engine' => 'Engine', - 'base_theme' => 'Base theme', - 'regions' => 'Regions', - 'features' => 'Features', - 'stylesheets' => 'Stylesheets', - // 'media_' . $media => 'Media '. $media for each $info->info['stylesheets'] as $media => $files - 'scripts' => 'Scripts', - ), - 'output-data-type' => 'format-table', - ), - ); - - $items['pm-projectinfo'] = array( - 'description' => 'Show a report of available projects and their extensions.', - 'arguments' => array( - 'projects' => 'Optional. A list of installed projects to show.', - ), - 'options' => array( - 'drush' => 'Optional. Only incude projects that have one or more Drush commands.', - 'status' => array( - 'description' => 'Filter by project status. Choices: enabled, disabled. A project is considered enabled when at least one of its extensions is enabled.', - 'example-value' => 'enabled', - ), - ), - 'outputformat' => array( - 'default' => 'key-value-list', - 'pipe-format' => 'json', - 'field-labels' => array( - 'label' => 'Name', - 'type' => 'Type', - 'version' => 'Version', - 'status' => 'Status', - 'extensions' => 'Extensions', - 'drush' => 'Drush Commands', - 'datestamp' => 'Datestamp', - 'path' => 'Path', - ), - 'fields-default' => array('label', 'type', 'version', 'status', 'extensions', 'drush', 'datestamp', 'path'), - 'fields-pipe' => array('label'), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('pmpi', 'pm:projectinfo'), - ); - - // Install command is reserved for the download and enable of projects including dependencies. - // @see http://drupal.org/node/112692 for more information. - // $items['install'] = array( - // 'description' => 'Download and enable one or more modules', - // ); - $items['pm-uninstall'] = array( - 'description' => 'Uninstall one or more modules and their dependent modules.', - 'arguments' => array( - 'modules' => 'A list of modules.', - ), - 'aliases' => array('pmu', 'pm:uninstall'), - ); - $items['pm-list'] = array( - 'description' => 'Show a list of available extensions (modules and themes).', - 'callback arguments' => array(array(), FALSE), - 'options' => array( - 'type' => array( - 'description' => 'Filter by extension type. Choices: module, theme.', - 'example-value' => 'module', - ), - 'status' => array( - 'description' => 'Filter by extension status. Choices: enabled, disabled and/or \'not installed\'. You can use multiple comma separated values. (i.e. --status="disabled,not installed").', - 'example-value' => 'disabled', - ), - 'package' => 'Filter by project packages. You can use multiple comma separated values. (i.e. --package="Core - required,Other").', - 'core' => 'Filter out extensions that are not in drupal core.', - 'no-core' => 'Filter out extensions that are provided by drupal core.', - ), - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'list', - 'field-labels' => array('package' => 'Package', 'name' => 'Name', 'type' => 'Type', 'status' => 'Status', 'version' => 'Version'), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('pml', 'pm:list'), - ); - $items['pm-refresh'] = array( - 'description' => 'Refresh update status information.', - 'engines' => array( - 'update_status' => array( - 'add-options-to-command' => FALSE, - ), - ), - 'aliases' => array('rf', 'pm:refresh'), - ); - $items['pm-updatestatus'] = array( - 'description' => 'Show a report of available minor updates to Drupal core and contrib projects.', - 'arguments' => array( - 'projects' => 'Optional. A list of installed projects to show.', - ), - 'options' => array( - 'pipe' => 'Return a list of the projects with any extensions enabled that need updating, one project per line.', - ) + $update_options, - 'sub-options' => $update_suboptions, - 'engines' => array( - 'update_status', - ), - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'list', - 'field-labels' => array('name' => 'Short Name', 'label' => 'Name', 'existing_version' => 'Installed Version', 'status' => 'Status', 'status_msg' => 'Message', 'candidate_version' => 'Proposed version'), - 'fields-default' => array('label', 'existing_version', 'candidate_version', 'status_msg' ), - 'fields-pipe' => array('name', 'existing_version', 'candidate_version', 'status_msg'), - 'output-data-type' => 'format-table', - ), - 'aliases' => array('ups', 'pm:updatestatus'), - ); - $items['pm-updatecode'] = array( - 'description' => 'Update Drupal core and contrib projects to latest recommended releases.', - 'examples' => array( - 'drush pm-updatecode --no-core' => 'Update contrib projects, but skip core.', - 'drush pm-updatestatus --format=csv --list-separator=" " --fields="name,existing_version,candidate_version,status_msg"' => 'To show a list of projects with their update status, use pm-updatestatus instead of pm-updatecode.', - ), - 'arguments' => array( - 'projects' => 'Optional. A list of installed projects to update.', - ), - 'options' => array( - 'notes' => 'Show release notes for each project to be updated.', - 'no-core' => 'Only update modules and skip the core update.', - 'check-updatedb' => 'Check to see if an updatedb is needed after updating the code. Default is on; use --check-updatedb=0 to disable.', - ) + $update_options, - 'sub-options' => $update_suboptions, - 'aliases' => array('upc', 'pm:updatecode'), - 'topics' => array('docs-policy'), - 'engines' => array( - 'version_control', - 'package_handler', - 'release_info' => array( - 'add-options-to-command' => FALSE, - ), - 'update_status', - ), - ); - // Merge all items from above. - $items['pm-update'] = array( - 'description' => 'Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb).', - 'aliases' => array('up', 'pm:update'), - 'allow-additional-options' => array('pm-updatecode', 'updatedb'), - ); - $items['pm-updatecode-postupdate'] = array( - 'description' => 'Notify of pending db updates.', - 'hidden' => TRUE, - 'aliases' => array('pm:updatecode:postupdate'), - ); - $items['pm-releasenotes'] = array( - 'description' => 'Print release notes for given projects.', - 'arguments' => array( - 'projects' => 'A list of project names, with optional version. Defaults to \'drupal\'', - ), - 'options' => array( - 'html' => dt('Display release notes in HTML rather than plain text.'), - ), - 'examples' => array( - 'drush rln cck' => 'Prints the release notes for the recommended version of CCK project.', - 'drush rln token-1.13' => 'View release notes of a specfic version of the Token project for my version of Drupal.', - 'drush rln pathauto zen' => 'View release notes for the recommended version of Pathauto and Zen projects.', - ), - 'aliases' => array('rln', 'pm:releasenotes'), - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'engines' => array( - 'release_info', - ), - ); - $items['pm-releases'] = array( - 'description' => 'Print release information for given projects.', - 'arguments' => array( - 'projects' => 'A list of drupal.org project names. Defaults to \'drupal\'', - ), - 'examples' => array( - 'drush pm-releases cck zen' => 'View releases for cck and Zen projects for your Drupal version.', - ), - 'options' => array( - 'default-major' => 'Show releases compatible with the specified major version of Drupal.', - ), - 'aliases' => array('rl', 'pm:releases'), - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'csv', - 'field-labels' => array( - 'project' => 'Project', - 'version' => 'Release', - 'date' => 'Date', - 'status' => 'Status', - 'release_link' => 'Release link', - 'download_link' => 'Download link', - ), - 'fields-default' => array('project', 'version', 'date', 'status'), - 'fields-pipe' => array('project', 'version', 'date', 'status'), - 'output-data-type' => 'format-table', - ), - 'engines' => array( - 'release_info', - ), - ); - $items['pm-download'] = array( - 'description' => 'Download projects from drupal.org or other sources.', - 'examples' => array( - 'drush dl drupal' => 'Download latest recommended release of Drupal core.', - 'drush dl drupal-7.x' => 'Download latest 7.x development version of Drupal core.', - 'drush dl drupal-6' => 'Download latest recommended release of Drupal 6.x.', - 'drush dl cck zen' => 'Download latest versions of CCK and Zen projects.', - 'drush dl og-1.3' => 'Download a specfic version of Organic groups module for my version of Drupal.', - 'drush dl diff-6.x-2.x' => 'Download a specific development branch of diff module for a specific Drupal version.', - 'drush dl views --select' => 'Show a list of recent releases of the views project, prompt for which one to download.', - 'drush dl webform --dev' => 'Download the latest dev release of webform.', - 'drush dl webform --cache' => 'Download webform. Fetch and populate the download cache as needed.', - ), - 'arguments' => array( - 'projects' => 'A comma delimited list of drupal.org project names, with optional version. Defaults to \'drupal\'', - ), - 'options' => array( - 'destination' => array( - 'description' => 'Path to which the project will be copied. If you\'re providing a relative path, note it is relative to the drupal root (if bootstrapped).', - 'example-value' => 'path', - ), - 'use-site-dir' => 'Force to use the site specific directory. It will create the directory if it doesn\'t exist. If --destination is also present this option will be ignored.', - 'notes' => 'Show release notes after each project is downloaded.', - 'variant' => array( - 'description' => "Only useful for install profiles. Possible values: 'full', 'projects', 'profile-only'.", - 'example-value' => 'full', - ), - 'select' => "Select the version to download interactively from a list of available releases.", - 'drupal-project-rename' => 'Alternate name for "drupal-x.y" directory when downloading Drupal project. Defaults to "drupal".', - 'default-major' => array( - 'description' => 'Specify the default major version of modules to download when there is no bootstrapped Drupal site. Defaults to "8".', - 'example-value' => '7', - ), - 'skip' => 'Skip automatic downloading of libraries (c.f. devel).', - 'pipe' => 'Returns a list of the names of the extensions (modules and themes) contained in the downloaded projects.', - ), - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'aliases' => array('dl', 'pm:download'), - 'engines' => array( - 'version_control', - 'package_handler', - 'release_info', - ), - ); - return $items; -} - -/** - * @defgroup extensions Extensions management. - * @{ - * Functions to manage extensions. - */ - -/** - * Command argument complete callback. - */ -function pm_pm_enable_complete() { - return pm_complete_extensions(); -} - -/** - * Command argument complete callback. - */ -function pm_pm_disable_complete() { - return pm_complete_extensions(); -} - -/** - * Command argument complete callback. - */ -function pm_pm_uninstall_complete() { - return pm_complete_extensions(); -} - -/** - * Command argument complete callback. - */ -function pm_pm_info_complete() { - return pm_complete_extensions(); -} - -/** - * Command argument complete callback. - */ -function pm_pm_releasenotes_complete() { - return pm_complete_projects(); -} - -/** - * Command argument complete callback. - */ -function pm_pm_releases_complete() { - return pm_complete_projects(); -} - -/** - * Command argument complete callback. - */ -function pm_pm_updatecode_complete() { - return pm_complete_projects(); -} - -/** - * Command argument complete callback. - */ -function pm_pm_update_complete() { - return pm_complete_projects(); -} - -/** - * List extensions for completion. - * - * @return - * Array of available extensions. - */ -function pm_complete_extensions() { - if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - $extension_info = drush_get_extensions(FALSE); - return array('values' => array_keys($extension_info)); - } -} - -/** - * List projects for completion. - * - * @return - * Array of installed projects. - */ -function pm_complete_projects() { - if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - return array('values' => array_keys(drush_get_projects())); - } -} - -/** - * Sort callback function for sorting extensions. - * - * It will sort first by type, second by package and third by name. - */ -function _drush_pm_sort_extensions($a, $b) { - $a_type = drush_extension_get_type($a); - $b_type = drush_extension_get_type($b); - if ($a_type == 'module' && $b_type == 'theme') { - return -1; - } - if ($a_type == 'theme' && $b_type == 'module') { - return 1; - } - $cmp = strcasecmp($a->info['package'], $b->info['package']); - if ($cmp == 0) { - $cmp = strcasecmp($a->info['name'], $b->info['name']); - } - return $cmp; -} - -/** - * Calculate an extension status based on current status and schema version. - * - * @param $extension - * Object of a single extension info. - * - * @return - * String describing extension status. Values: enabled|disabled|not installed - */ -function drush_get_extension_status($extension) { - if ((drush_extension_get_type($extension) == 'module') && ($extension->schema_version == -1)) { - $status = "not installed"; - } - else { - $status = ($extension->status == 1)?'enabled':'disabled'; - } - - return $status; -} - -/** - * Classify extensions as modules, themes or unknown. - * - * @param $extensions - * Array of extension names, by reference. - * @param $modules - * Empty array to be filled with modules in the provided extension list. - * @param $themes - * Empty array to be filled with themes in the provided extension list. - */ -function drush_pm_classify_extensions(&$extensions, &$modules, &$themes, $extension_info) { - _drush_pm_expand_extensions($extensions, $extension_info); - foreach ($extensions as $extension) { - if (!isset($extension_info[$extension])) { - continue; - } - $type = drush_extension_get_type($extension_info[$extension]); - if ($type == 'module') { - $modules[$extension] = $extension; - } - else if ($type == 'theme') { - $themes[$extension] = $extension; - } - } -} - -/** - * Obtain an array of installed projects off the extensions available. - * - * A project is considered to be 'enabled' when any of its extensions is - * enabled. - * If any extension lacks project information and it is found that the - * extension was obtained from drupal.org's cvs or git repositories, a new - * 'vcs' attribute will be set on the extension. Example: - * $extensions[name]->vcs = 'cvs'; - * - * @param array $extensions - * Array of extensions as returned by drush_get_extensions(). - * - * @return - * Array of installed projects with info of version, status and provided - * extensions. - */ -function drush_get_projects(&$extensions = NULL) { - if (!isset($extensions)) { - $extensions = drush_get_extensions(); - } - $projects = array( - 'drupal' => array( - 'label' => 'Drupal', - 'version' => drush_drupal_version(), - 'type' => 'core', - 'extensions' => array(), - ) - ); - if (isset($extensions['system']->info['datestamp'])) { - $projects['drupal']['datestamp'] = $extensions['system']->info['datestamp']; - } - foreach ($extensions as $extension) { - $extension_name = drush_extension_get_name($extension); - $extension_path = drush_extension_get_path($extension); - - // Obtain the project name. It is not available in this cases: - // 1. the extension is part of drupal core. - // 2. the project was checked out from CVS/git and cvs_deploy/git_deploy - // is not installed. - // 3. it is not a project hosted in drupal.org. - if (empty($extension->info['project'])) { - if (isset($extension->info['version']) && ($extension->info['version'] == drush_drupal_version())) { - $project = 'drupal'; - } - else { - if (is_dir($extension_path . '/CVS') && (!drush_module_exists('cvs_deploy'))) { - $extension->vcs = 'cvs'; - drush_log(dt('Extension !extension is fetched from cvs. Ignoring.', array('!extension' => $extension_name)), LogLevel::DEBUG); - } - elseif (is_dir($extension_path . '/.git') && (!drush_module_exists('git_deploy'))) { - $extension->vcs = 'git'; - drush_log(dt('Extension !extension is fetched from git. Ignoring.', array('!extension' => $extension_name)), LogLevel::DEBUG); - } - continue; - } - } - else { - $project = $extension->info['project']; - } - - // Create/update the project in $projects with the project data. - if (!isset($projects[$project])) { - $projects[$project] = array( - // If there's an extension with matching name, pick its label. - // Otherwise use just the project name. We avoid $extension->label - // for the project label because the extension's label may have - // no direct relation with the project name. For example, - // "Text (text)" or "Number (number)" for the CCK project. - 'label' => isset($extensions[$project]) ? $extensions[$project]->label : $project, - 'type' => drush_extension_get_type($extension), - 'version' => $extension->info['version'], - 'status' => $extension->status, - 'extensions' => array(), - ); - if (isset($extension->info['datestamp'])) { - $projects[$project]['datestamp'] = $extension->info['datestamp']; - } - if (isset($extension->info['project status url'])) { - $projects[$project]['status url'] = $extension->info['project status url']; - } - } - else { - // If any of the extensions is enabled, consider the project is enabled. - if ($extension->status != 0) { - $projects[$project]['status'] = $extension->status; - } - } - $projects[$project]['extensions'][] = drush_extension_get_name($extension); - } - - // Obtain each project's path and try to provide a better label for ones - // with machine name. - $reserved = array('modules', 'sites', 'themes'); - foreach ($projects as $name => $project) { - if ($name == 'drupal') { - continue; - } - - // If this project has no human label, see if we can find - // one "main" extension whose label we could use. - if ($project['label'] == $name) { - // If there is only one extension, construct a label based on - // the extension name. - if (count($project['extensions']) == 1) { - $extension = $extensions[$project['extensions'][0]]; - $projects[$name]['label'] = $extension->info['name'] . ' (' . $name . ')'; - } - else { - // Make a list of all of the extensions in this project - // that do not depend on any other extension in this - // project. - $candidates = array(); - foreach ($project['extensions'] as $e) { - $has_project_dependency = FALSE; - if (isset($extensions[$e]->info['dependencies']) && is_array($extensions[$e]->info['dependencies'])) { - foreach ($extensions[$e]->info['dependencies'] as $dependent) { - if (in_array($dependent, $project['extensions'])) { - $has_project_dependency = TRUE; - } - } - } - if ($has_project_dependency === FALSE) { - $candidates[] = $extensions[$e]->info['name']; - } - } - // If only one of the modules is a candidate, use its name in the label - if (count($candidates) == 1) { - $projects[$name]['label'] = reset($candidates) . ' (' . $name . ')'; - } - } - } - - drush_log(dt('Obtaining !project project path.', array('!project' => $name)), LogLevel::DEBUG); - $path = _drush_pm_find_common_path($project['type'], $project['extensions']); - // Prevent from setting a reserved path. For example it may happen in a case - // where a module and a theme are declared as part of a same project. - // There's a special case, a project called "sites", this is the reason for - // the second condition here. - if ($path == '.' || (in_array(basename($path), $reserved) && !in_array($name, $reserved))) { - drush_log(dt('Error while trying to find the common path for enabled extensions of project !project. Extensions are: !extensions.', array('!project' => $name, '!extensions' => implode(', ', $project['extensions']))), LogLevel::ERROR); - } - else { - $projects[$name]['path'] = $path; - } - } - - return $projects; -} - -/** - * Helper function to find the common path for a list of extensions in the aim to obtain the project name. - * - * @param $project_type - * Type of project we're trying to find. Valid values: module, theme. - * @param $extensions - * Array of extension names. - */ -function _drush_pm_find_common_path($project_type, $extensions) { - // Select the first path as the candidate to be the common prefix. - $extension = array_pop($extensions); - while (!($path = drupal_get_path($project_type, $extension))) { - drush_log(dt('Unknown path for !extension !type.', array('!extension' => $extension, '!type' => $project_type)), LogLevel::WARNING); - $extension = array_pop($extensions); - } - - // If there's only one extension we are done. Otherwise, we need to find - // the common prefix for all of them. - if (count($extensions) > 0) { - // Iterate over the other projects. - while($extension = array_pop($extensions)) { - $path2 = drupal_get_path($project_type, $extension); - if (!$path2) { - drush_log(dt('Unknown path for !extension !type.', array('!extension' => $extension, '!type' => $project_type)), LogLevel::DEBUG); - continue; - } - // Option 1: same path. - if ($path == $path2) { - continue; - } - // Option 2: $path is a prefix of $path2. - if (strpos($path2, $path) === 0) { - continue; - } - // Option 3: $path2 is a prefix of $path. - if (strpos($path, $path2) === 0) { - $path = $path2; - continue; - } - // Option 4: no one is a prefix of the other. Find the common - // prefix by iteratively strip the rigthtmost piece of $path. - // We will iterate until a prefix is found or path = '.', that on the - // other hand is a condition theorically impossible to reach. - do { - $path = dirname($path); - if (strpos($path2, $path) === 0) { - break; - } - } while ($path != '.'); - } - } - - return $path; -} - -/** - * @} End of "defgroup extensions". - */ - -/** - * Command callback. Show a list of extensions with type and status. - */ -function drush_pm_list() { - //--package - $package_filter = array(); - $package = strtolower(drush_get_option('package')); - if (!empty($package)) { - $package_filter = explode(',', $package); - } - if (!empty($package_filter) && (count($package_filter) == 1)) { - drush_hide_output_fields('package'); - } - - //--type - $all_types = array('module', 'theme'); - $type_filter = strtolower(drush_get_option('type')); - if (!empty($type_filter)) { - $type_filter = explode(',', $type_filter); - } - else { - $type_filter = $all_types; - } - - if (count($type_filter) == 1) { - drush_hide_output_fields('type'); - } - foreach ($type_filter as $type) { - if (!in_array($type, $all_types)) { //TODO: this kind of check can be implemented drush-wide - return drush_set_error('DRUSH_PM_INVALID_PROJECT_TYPE', dt('!type is not a valid project type.', array('!type' => $type))); - } - } - - //--status - $all_status = array('enabled', 'disabled', 'not installed'); - $status_filter = strtolower(drush_get_option('status')); - if (!empty($status_filter)) { - $status_filter = explode(',', $status_filter); - } - else { - $status_filter = $all_status; - } - if (count($status_filter) == 1) { - drush_hide_output_fields('status'); - } - - foreach ($status_filter as $status) { - if (!in_array($status, $all_status)) { //TODO: this kind of check can be implemented drush-wide - return drush_set_error('DRUSH_PM_INVALID_PROJECT_STATUS', dt('!status is not a valid project status.', array('!status' => $status))); - } - } - - $result = array(); - $extension_info = drush_get_extensions(FALSE); - uasort($extension_info, '_drush_pm_sort_extensions'); - - $major_version = drush_drupal_major_version(); - foreach ($extension_info as $key => $extension) { - if (!in_array(drush_extension_get_type($extension), $type_filter)) { - unset($extension_info[$key]); - continue; - } - $status = drush_get_extension_status($extension); - if (!in_array($status, $status_filter)) { - unset($extension_info[$key]); - continue; - } - - // Filter out core if --no-core specified. - if (drush_get_option('no-core', FALSE)) { - if ((($major_version >= 8) && ($extension->origin == 'core')) || (($major_version <= 7) && (strpos($extension->info['package'], 'Core') === 0))) { - unset($extension_info[$key]); - continue; - } - } - - // Filter out non-core if --core specified. - if (drush_get_option('core', FALSE)) { - if ((($major_version >= 8) && ($extension->origin != 'core')) || (($major_version <= 7) && (strpos($extension->info['package'], 'Core') !== 0))) { - unset($extension_info[$key]); - continue; - } - } - - // Filter by package. - if (!empty($package_filter)) { - if (!in_array(strtolower($extension->info['package']), $package_filter)) { - unset($extension_info[$key]); - continue; - } - } - - $row['package'] = $extension->info['package']; - $row['name'] = $extension->label; - $row['type'] = ucfirst(drush_extension_get_type($extension)); - $row['status'] = ucfirst($status); - // Suppress notice when version is not present. - $row['version'] = @$extension->info['version']; - - $result[$key] = $row; - unset($row); - } - // In Drush-5, we used to return $extension_info here. - return $result; -} - -/** - * Helper function for pm-enable. - */ -function drush_pm_enable_find_project_from_extension($extension) { - $result = drush_pm_lookup_extension_in_cache($extension); - - if (!isset($result)) { - $release_info = drush_get_engine('release_info'); - - // If we can find info on a project that has the same name - // as the requested extension, then we'll call that a match. - $request = pm_parse_request($extension); - if ($release_info->checkProject($request)) { - $result = $extension; - } - } - - return $result; -} - -/** - * Validate callback. Determine the modules and themes that the user would like enabled. - */ -function drush_pm_enable_validate() { - $args = pm_parse_arguments(func_get_args()); - - $extension_info = drush_get_extensions(); - - $recheck = TRUE; - $last_download = NULL; - while ($recheck) { - $recheck = FALSE; - - // Classify $args in themes, modules or unknown. - $modules = array(); - $themes = array(); - $download = array(); - drush_pm_classify_extensions($args, $modules, $themes, $extension_info); - $extensions = array_merge($modules, $themes); - $unknown = array_diff($args, $extensions); - - // If there're unknown extensions, try and download projects - // with matching names. - if (!empty($unknown)) { - $found = array(); - foreach ($unknown as $name) { - drush_log(dt('!extension was not found.', array('!extension' => $name)), LogLevel::WARNING); - $project = drush_pm_enable_find_project_from_extension($name); - if (!empty($project)) { - $found[] = $project; - } - } - if (!empty($found)) { - // Prevent from looping if last download failed. - if ($found === $last_download) { - drush_log(dt("Unable to download some or all of the extensions."), LogLevel::WARNING); - break; - } - drush_log(dt("The following projects provide some or all of the extensions not found:\n@list", array('@list' => implode("\n", $found))), LogLevel::OK); - if (drush_get_option('resolve-dependencies')) { - drush_log(dt("They are being downloaded."), LogLevel::OK); - } - if ((drush_get_option('resolve-dependencies')) || (drush_confirm("Would you like to download them?"))) { - $download = $found; - } - } - } - - // Discard already enabled and incompatible extensions. - foreach ($extensions as $name) { - if ($extension_info[$name]->status) { - drush_log(dt('!extension is already enabled.', array('!extension' => $name)), LogLevel::OK); - } - // Check if the extension is compatible with Drupal core and php version. - if ($component = drush_extension_check_incompatibility($extension_info[$name])) { - drush_set_error('DRUSH_PM_ENABLE_MODULE_INCOMPATIBLE', dt('!name is incompatible with the !component version.', array('!name' => $name, '!component' => $component))); - if (drush_extension_get_type($extension_info[$name]) == 'module') { - unset($modules[$name]); - } - else { - unset($themes[$name]); - } - } - } - - if (!empty($modules)) { - // Check module dependencies. - $dependencies = drush_check_module_dependencies($modules, $extension_info); - $unmet_dependencies = array(); - foreach ($dependencies as $module => $info) { - if (!empty($info['unmet-dependencies'])) { - foreach ($info['unmet-dependencies'] as $unmet) { - $unmet_project = (!empty($info['dependencies'][$unmet]['project'])) ? $info['dependencies'][$unmet]['project'] : drush_pm_enable_find_project_from_extension($unmet); - if (!empty($unmet_project)) { - $unmet_dependencies[$module][$unmet_project] = $unmet_project; - } - } - } - } - if (!empty($unmet_dependencies)) { - $msgs = array(); - $unmet_project_list = array(); - foreach ($unmet_dependencies as $module => $unmet_projects) { - $unmet_project_list = array_merge($unmet_project_list, $unmet_projects); - $msgs[] = dt("!module requires !unmet-projects", array('!unmet-projects' => implode(', ', $unmet_projects), '!module' => $module)); - } - $found = array_merge($download, $unmet_project_list); - // Prevent from looping if last download failed. - if ($found === $last_download) { - drush_log(dt("Unable to download some or all of the extensions."), LogLevel::WARNING); - break; - } - drush_log(dt("The following projects have unmet dependencies:\n!list", array('!list' => implode("\n", $msgs))), LogLevel::OK); - if (drush_get_option('resolve-dependencies')) { - drush_log(dt("They are being downloaded."), LogLevel::OK); - } - if (drush_get_option('resolve-dependencies') || drush_confirm(dt("Would you like to download them?"))) { - $download = $found; - } - } - } - - if (!empty($download)) { - // Disable DRUSH_AFFIRMATIVE context temporarily. - $drush_affirmative = drush_get_context('DRUSH_AFFIRMATIVE'); - drush_set_context('DRUSH_AFFIRMATIVE', FALSE); - // Invoke a new process to download dependencies. - $result = drush_invoke_process('@self', 'pm-download', $download, array(), array('interactive' => TRUE)); - // Restore DRUSH_AFFIRMATIVE context. - drush_set_context('DRUSH_AFFIRMATIVE', $drush_affirmative); - // Refresh module cache after downloading the new modules. - if (drush_drupal_major_version() >= 8) { - \Drush\Drupal\ExtensionDiscovery::reset(); - system_list_reset(); - } - $extension_info = drush_get_extensions(); - $last_download = $download; - $recheck = TRUE; - } - } - - if (!empty($modules)) { - $all_dependencies = array(); - $dependencies_ok = TRUE; - foreach ($dependencies as $key => $info) { - if (isset($info['error'])) { - unset($modules[$key]); - $dependencies_ok = drush_set_error($info['error']['code'], $info['error']['message']); - } - elseif (!empty($info['dependencies'])) { - // Make sure we have an assoc array. - $dependencies_list = array_keys($info['dependencies']); - $assoc = array_combine($dependencies_list, $dependencies_list); - $all_dependencies = array_merge($all_dependencies, $assoc); - } - } - if (!$dependencies_ok) { - return FALSE; - } - $modules = array_diff(array_merge($modules, $all_dependencies), drush_module_list()); - // Discard modules which doesn't meet requirements. - require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; - foreach ($modules as $key => $module) { - // Check to see if the module can be installed/enabled (hook_requirements). - // See @system_modules_submit - if (!drupal_check_module($module)) { - unset($modules[$key]); - drush_set_error('DRUSH_PM_ENABLE_MODULE_UNMEET_REQUIREMENTS', dt('Module !module doesn\'t meet the requirements to be enabled.', array('!module' => $module))); - _drush_log_drupal_messages(); - return FALSE; - } - } - } - - $searchpath = array(); - foreach (array_merge($modules, $themes) as $name) { - $searchpath[] = drush_extension_get_path($extension_info[$name]); - } - // Add all modules that passed validation to the drush - // list of commandfiles (if they have any). This - // will allow these newly-enabled modules to participate - // in the pre-pm_enable and post-pm_enable hooks. - if (!empty($searchpath)) { - _drush_add_commandfiles($searchpath); - } - - drush_set_context('PM_ENABLE_EXTENSION_INFO', $extension_info); - drush_set_context('PM_ENABLE_MODULES', $modules); - drush_set_context('PM_ENABLE_THEMES', $themes); - - return TRUE; -} - -/** - * Command callback. Enable one or more extensions from downloaded projects. - * Note that the modules and themes to be enabled were evaluated during the - * pm-enable validate hook, above. - */ -function drush_pm_enable() { - // Get the data built during the validate phase - $extension_info = drush_get_context('PM_ENABLE_EXTENSION_INFO'); - $modules = drush_get_context('PM_ENABLE_MODULES'); - $themes = drush_get_context('PM_ENABLE_THEMES'); - - // Inform the user which extensions will finally be enabled. - $extensions = array_merge($modules, $themes); - if (empty($extensions)) { - return drush_log(dt('There were no extensions that could be enabled.'), LogLevel::OK); - } - else { - drush_print(dt('The following extensions will be enabled: !extensions', array('!extensions' => implode(', ', $extensions)))); - if(!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - } - - // Enable themes. - if (!empty($themes)) { - drush_theme_enable($themes); - } - - // Enable modules and pass dependency validation in form submit. - if (!empty($modules)) { - drush_include_engine('drupal', 'environment'); - drush_module_enable($modules); - } - - // Inform the user of final status. - $result_extensions = drush_get_named_extensions_list($extensions); - $problem_extensions = array(); - $role = drush_role_get_class(); - foreach ($result_extensions as $name => $extension) { - if ($extension->status) { - drush_log(dt('!extension was enabled successfully.', array('!extension' => $name)), LogLevel::OK); - $perms = $role->getModulePerms($name); - if (!empty($perms)) { - drush_print(dt('!extension defines the following permissions: !perms', array('!extension' => $name, '!perms' => implode(', ', $perms)))); - } - } - else { - $problem_extensions[] = $name; - } - } - if (!empty($problem_extensions)) { - return drush_set_error('DRUSH_PM_ENABLE_EXTENSION_ISSUE', dt('There was a problem enabling !extension.', array('!extension' => implode(',', $problem_extensions)))); - } - // Return the list of extensions enabled - return $extensions; -} - -/** - * Command callback. Disable one or more extensions. - */ -function drush_pm_disable() { - $args = pm_parse_arguments(func_get_args()); - drush_include_engine('drupal', 'pm'); - _drush_pm_disable($args); -} - -/** - * Add extensions that match extension_name*. - * - * A helper function for commands that take a space separated list of extension - * names. It will identify extensions that have been passed in with a - * trailing * and add all matching extensions to the array that is returned. - * - * @param $extensions - * An array of extensions, by reference. - * @param $extension_info - * Optional. An array of extension info as returned by drush_get_extensions(). - */ -function _drush_pm_expand_extensions(&$extensions, $extension_info = array()) { - if (empty($extension_info)) { - $extension_info = drush_get_extensions(); - } - foreach ($extensions as $key => $extension) { - if (($wildcard = rtrim($extension, '*')) !== $extension) { - foreach (array_keys($extension_info) as $extension_name) { - if (substr($extension_name, 0, strlen($wildcard)) == $wildcard) { - $extensions[] = $extension_name; - } - } - unset($extensions[$key]); - continue; - } - } -} - -/** - * Command callback. Uninstall one or more modules. - */ -function drush_pm_uninstall() { - $args = pm_parse_arguments(func_get_args()); - drush_include_engine('drupal', 'pm'); - _drush_pm_uninstall($args); -} - -/** - * Command callback. Show available releases for given project(s). - */ -function drush_pm_releases() { - $release_info = drush_get_engine('release_info'); - - // Obtain requests. - $requests = pm_parse_arguments(func_get_args(), FALSE); - if (!$requests) { - $requests = array('drupal'); - } - - // Get installed projects. - if (drush_get_context('DRUSH_BOOTSTRAP_PHASE') >= DRUSH_BOOTSTRAP_DRUPAL_FULL) { - $projects = drush_get_projects(); - } - else { - $projects = array(); - } - - // Select the filter to apply based on cli options. - if (drush_get_option('dev', FALSE)) { - $filter = 'dev'; - } - elseif (drush_get_option('all', FALSE)) { - $filter = 'all'; - } - else { - $filter = ''; - } - - $status_url = drush_get_option('source'); - - $output = array(); - foreach ($requests as $request) { - $request = pm_parse_request($request, $status_url, $projects); - $project_name = $request['name']; - $project_release_info = $release_info->get($request); - if ($project_release_info) { - $version = isset($projects[$project_name]) ? $projects[$project_name]['version'] : NULL; - $releases = $project_release_info->filterReleases($filter, $version); - foreach ($releases as $key => $release) { - $output["${project_name}-${key}"] = array( - 'project' => $project_name, - 'version' => $release['version'], - 'date' => gmdate('Y-M-d', $release['date']), - 'status' => implode(', ', $release['release_status']), - ) + $release; - } - } - } - if (empty($output)) { - return drush_log(dt('No valid projects given.'), LogLevel::OK); - } - - return $output; -} - -/** - * Command callback. Show release notes for given project(s). - */ -function drush_pm_releasenotes() { - $release_info = drush_get_engine('release_info'); - - // Obtain requests. - if (!$requests = pm_parse_arguments(func_get_args(), FALSE)) { - $requests = array('drupal'); - } - - // Get installed projects. - if (drush_get_context('DRUSH_BOOTSTRAP_PHASE') >= DRUSH_BOOTSTRAP_DRUPAL_FULL) { - $projects = drush_get_projects(); - } - else { - $projects = array(); - } - - $status_url = drush_get_option('source'); - - $output = ''; - foreach($requests as $request) { - $request = pm_parse_request($request, $status_url, $projects); - $project_release_info = $release_info->get($request); - if ($project_release_info) { - $version = empty($request['version']) ? NULL : $request['version']; - $output .= $project_release_info->getReleaseNotes($version); - } - } - return $output; -} - -/** - * Command callback. Refresh update status information. - */ -function drush_pm_refresh() { - $update_status = drush_get_engine('update_status'); - drush_print(dt("Refreshing update status information ...")); - $update_status->refresh(); - drush_print(dt("Done.")); -} - -/** - * Command callback. Execute pm-update. - */ -function drush_pm_update() { - // Call pm-updatecode. updatedb will be called in the post-update process. - $args = pm_parse_arguments(func_get_args(), FALSE); - drush_set_option('check-updatedb', FALSE); - return drush_invoke('pm-updatecode', $args); -} - -/** - * Post-command callback. - * Execute updatedb command after an updatecode - user requested `update`. - */ -function drush_pm_post_pm_update() { - // Use drush_invoke_process to start a subprocess. Cleaner that way. - if (drush_get_context('DRUSH_PM_UPDATED', FALSE) !== FALSE) { - drush_invoke_process('@self', 'updatedb'); - } -} - -/** - * Validate callback for updatecode command. Abort if 'backup' directory exists. - */ -function drush_pm_updatecode_validate() { - $path = drush_get_context('DRUSH_DRUPAL_ROOT') . '/backup'; - if (is_dir($path) && (realpath(drush_get_option('backup-dir', FALSE)) != $path)) { - return drush_set_error('', dt('Backup directory !path found. It\'s a security risk to store backups inside the Drupal tree. Drush now uses by default ~/drush-backups. You need to move !path out of the Drupal tree to proceed. Note: if you know what you\'re doing you can explicitly set --backup-dir to !path and continue.', array('!path' => $path))); - } -} - -/** - * Post-command callback for updatecode. - * - * Execute pm-updatecode-postupdate in a backend process to not conflict with - * old code already in memory. - */ -function drush_pm_post_pm_updatecode() { - // Skip if updatecode was invoked by pm-update. - // This way we avoid being noisy, as updatedb is to be executed. - if (drush_get_option('check-updatedb', TRUE)) { - if (drush_get_context('DRUSH_PM_UPDATED', FALSE)) { - drush_invoke_process('@self', 'pm-updatecode-postupdate'); - } - } -} - -/** - * Command callback. Execute updatecode-postupdate. - */ -function drush_pm_updatecode_postupdate() { - // Clear the cache, since some projects could have moved around. - drush_drupal_cache_clear_all(); - - // Notify of pending database updates. - // Make sure the installation API is available - require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; - - // Load all .install files. - drupal_load_updates(); - - // @see system_requirements(). - foreach (drush_module_list() as $module) { - $updates = drupal_get_schema_versions($module); - if ($updates !== FALSE) { - $default = drupal_get_installed_schema_version($module); - if (max($updates) > $default) { - drush_log(dt("You have pending database updates. Run `drush updatedb` or visit update.php in your browser."), LogLevel::WARNING); - break; - } - } - } -} - -/** - * Sanitize user provided arguments to several pm commands. - * - * Return an array of arguments off a space and/or comma separated values. - */ -function pm_parse_arguments($args, $dashes_to_underscores = TRUE) { - $arguments = _convert_csv_to_array($args); - foreach ($arguments as $key => $argument) { - $argument = ($dashes_to_underscores) ? strtr($argument, '-', '_') : $argument; - } - return $arguments; -} - -/** - * Decompound a version string and returns major, minor, patch and extra parts. - * - * @see _pm_parse_version_compound() - * @see pm_parse_version() - * - * @param string $version - * A version string like X.Y-Z, X.Y.Z-W or a subset. - * - * @return array - * Array with major, patch and extra keys. - */ -function _pm_parse_version_decompound($version) { - $pattern = '/^(\d+)(?:.(\d+))?(?:\.(x|\d+))?(?:-([a-z0-9\.-]*))?(?:\+(\d+)-dev)?$/'; - - $matches = array(); - preg_match($pattern, $version, $matches); - - $parts = array( - 'major' => '', - 'minor' => '', - 'patch' => '', - 'extra' => '', - 'offset' => '', - ); - if (isset($matches[1])) { - $parts['major'] = $matches[1]; - if (isset($matches[2])) { - if (isset($matches[3]) && $matches[3] != '') { - $parts['minor'] = $matches[2]; - $parts['patch'] = $matches[3]; - } - else { - $parts['patch'] = $matches[2]; - } - } - if (!empty($matches[4])) { - $parts['extra'] = $matches[4]; - } - if (!empty($matches[5])) { - $parts['offset'] = $matches[5]; - } - } - - return $parts; -} - -/** - * Build a version string from an array of major, minor and extra parts. - * - * @see _pm_parse_version_decompound() - * @see pm_parse_version() - * - * @param array $parts - * Array of parts. - * - * @return string - * A Version string. - */ -function _pm_parse_version_compound($parts) { - $project_version = ''; - if ($parts['patch'] != '') { - $project_version = $parts['major']; - if ($parts['minor'] != '') { - $project_version = $project_version . '.' . $parts['minor']; - } - if ($parts['patch'] == 'x') { - $project_version = $project_version . '.x-dev'; - } - else { - $project_version = $project_version . '.' . $parts['patch']; - if ($parts['extra'] != '') { - $project_version = $project_version . '-' . $parts['extra']; - } - } - if ($parts['offset'] != '') { - $project_version = $project_version . '+' . $parts['offset'] . '-dev'; - } - } - - return $project_version; -} - -/** - * Parses a version string and returns its components. - * - * It parses both core and contrib version strings. - * - * Core (semantic versioning): - * - 8.0.0-beta3+252-dev - * - 8.0.0-beta2 - * - 8.0.x-dev - * - 8.1.x - * - 8.0.1 - * - 8 - * - * Core (classic drupal scheme): - * - 7.x-dev - * - 7.x - * - 7.33 - * - 7.34+3-dev - * - 7 - * - * Contrib: - * - 7.x-1.0-beta1+30-dev - * - 7.x-1.0-beta1 - * - 7.x-1.0+30-dev - * - 7.x-1.0 - * - 1.0-beta1 - * - 1.0 - * - 7.x-1.x - * - 7.x-1.x-dev - * - 1.x - * - * @see pm_parse_request() - * - * @param string $version - * A core or project version string. - * - * @param bool $is_core - * Whether this is a core version or a project version. - * - * @return array - * Version string in parts. - * Example for a contrib version (ex: 7.x-3.2-beta1): - * - version : Fully qualified version string. - * - drupal_version : Core compatibility version (ex: 7.x). - * - version_major : Major version (ex: 3). - * - version_minor : Minor version. Not applicable. Always empty. - * - version_patch : Patch version (ex: 2). - * - version_extra : Extra version (ex: beta1). - * - project_version : Project specific part of the version (ex: 3.2-beta1). - * - * Example for a core version (ex: 8.1.2-beta2 or 7.0-beta2): - * - version : Fully qualified version string. - * - drupal_version : Core compatibility version (ex: 8.x). - * - version_major : Major version (ex: 8). - * - version_minor : Minor version (ex: 1). Empty if not a semver. - * - version_patch : Patch version (ex: 2). - * - version_extra : Extra version (ex: beta2). - * - project_version : Same as 'version'. - */ -function pm_parse_version($version, $is_core = FALSE) { - $core_parts = _pm_parse_version_decompound($version); - - // If no major version, we have no version at all. Pick a default. - $drupal_version_default = drush_drupal_major_version(); - if ($core_parts['major'] == '') { - $core_parts['major'] = ($drupal_version_default) ? $drupal_version_default : drush_get_option('default-major', 8); - } - - if ($is_core) { - $project_version = _pm_parse_version_compound($core_parts); - $version_parts = array( - 'version' => $project_version, - 'drupal_version' => $core_parts['major'] . '.x', - 'project_version' => $project_version, - 'version_major' => $core_parts['major'], - 'version_minor' => $core_parts['minor'], - 'version_patch' => ($core_parts['patch'] == 'x') ? '' : $core_parts['patch'], - 'version_extra' => ($core_parts['patch'] == 'x') ? 'dev' : $core_parts['extra'], - 'version_offset' => $core_parts['offset'], - ); - } - else { - // If something as 7.x-1.0-beta1, the project specific version is - // in $version['extra'] and we need to parse it. - if (strpbrk($core_parts['extra'], '.-')) { - $nocore_parts = _pm_parse_version_decompound($core_parts['extra']); - $nocore_parts['offset'] = $core_parts['offset']; - $project_version = _pm_parse_version_compound($nocore_parts); - $version_parts = array( - 'version' => $core_parts['major'] . '.x-' . $project_version, - 'drupal_version' => $core_parts['major'] . '.x', - 'project_version' => $project_version, - 'version_major' => $nocore_parts['major'], - 'version_minor' => $core_parts['minor'], - 'version_patch' => ($nocore_parts['patch'] == 'x') ? '' : $nocore_parts['patch'], - 'version_extra' => ($nocore_parts['patch'] == 'x') ? 'dev' : $nocore_parts['extra'], - 'version_offset' => $core_parts['offset'], - ); - } - // At this point we have half a version and must decide if this is a drupal major or a project. - else { - // If working on a bootstrapped site, core_parts has the project version. - if ($drupal_version_default) { - $project_version = _pm_parse_version_compound($core_parts); - $version = ($project_version) ? $drupal_version_default . '.x-' . $project_version : ''; - $version_parts = array( - 'version' => $version, - 'drupal_version' => $drupal_version_default . '.x', - 'project_version' => $project_version, - 'version_major' => $core_parts['major'], - 'version_minor' => $core_parts['minor'], - 'version_patch' => ($core_parts['patch'] == 'x') ? '' : $core_parts['patch'], - 'version_extra' => ($core_parts['patch'] == 'x') ? 'dev' : $core_parts['extra'], - 'version_offset' => $core_parts['offset'], - ); - } - // Not working on a bootstrapped site, core_parts is core version. - else { - $version_parts = array( - 'version' => '', - 'drupal_version' => $core_parts['major'] . '.x', - 'project_version' => '', - 'version_major' => '', - 'version_minor' => '', - 'version_patch' => '', - 'version_extra' => '', - 'version_offset' => '', - ); - } - } - } - - return $version_parts; -} - -/** - * Parse out the project name and version and return as a structured array. - * - * @see pm_parse_version() - * - * @param string $request_string - * Project name with optional version. Examples: 'ctools-7.x-1.0-beta1' - * - * @return array - * Array with all parts of the request info. - */ -function pm_parse_request($request_string, $status_url = NULL, &$projects = array()) { - // Split $request_string in project name and version. Note that hyphens (-) - // are permitted in project names (ex: field-conditional-state). - // We use a regex to split the string. The pattern used matches a string - // starting with hyphen, followed by one or more numbers, any of the valid - // symbols in version strings (.x-) and a catchall for the rest of the - // version string. - $parts = preg_split('/-(?:([\d+\.x].*))?$/', $request_string, NULL, PREG_SPLIT_DELIM_CAPTURE); - - if (count($parts) == 1) { - // No version in the request string. - $project = $request_string; - $version = ''; - } - else { - $project = $parts[0]; - $version = $parts[1]; - } - - $is_core = ($project == 'drupal'); - $request = array( - 'name' => $project, - ) + pm_parse_version($version, $is_core); - - // Set the status url if provided or available in project's info file. - if ($status_url) { - $request['status url'] = $status_url; - } - elseif (!empty($projects[$project]['status url'])) { - $request['status url'] = $projects[$project]['status url']; - } - - return $request; -} - -/** - * @defgroup engines Engine types - * @{ - */ - -/** - * Implementation of hook_drush_engine_type_info(). - */ -function pm_drush_engine_type_info() { - return array( - 'package_handler' => array( - 'option' => 'package-handler', - 'description' => 'Determine how to fetch projects from update service.', - 'default' => 'wget', - 'options' => array( - 'cache' => 'Cache release XML and tarballs or git clones. Git clones use git\'s --reference option. Defaults to 1 for downloads, and 0 for git.', - ), - ), - 'release_info' => array( - 'add-options-to-command' => TRUE, - ), - 'update_status' => array( - 'option' => 'update-backend', - 'description' => 'Determine how to fetch update status information.', - 'default' => 'drush', - 'add-options-to-command' => TRUE, - 'options' => array( - 'update-backend' => 'Backend to obtain available updates.', - 'check-disabled' => 'Check for updates of disabled modules and themes.', - 'security-only' => 'Only update modules that have security updates available.', - ), - 'combine-help' => TRUE, - ), - 'version_control' => array( - 'option' => 'version-control', - 'default' => 'backup', - 'description' => 'Integrate with version control systems.', - ), - ); -} - -/** - * Implements hook_drush_engine_ENGINE_TYPE(). - * - * Package handler engine is used by pm-download and - * pm-updatecode commands to determine how to download/checkout - * new projects and acquire updates to projects. - */ -function pm_drush_engine_package_handler() { - return array( - 'wget' => array( - 'description' => 'Download project packages using wget or curl.', - 'options' => array( - 'no-md5' => 'Skip md5 validation of downloads.', - ), - ), - 'git_drupalorg' => array( - 'description' => 'Use git.drupal.org to checkout and update projects.', - 'options' => array( - 'gitusername' => 'Your git username as shown on user/[uid]/edit/git. Typically, this is set this in drushrc.php. Omitting this prevents users from pushing changes back to git.drupal.org.', - 'gitsubmodule' => 'Use git submodules for checking out new projects. Existing git checkouts are unaffected, and will continue to (not) use submodules regardless of this setting.', - 'gitcheckoutparams' => 'Add options to the `git checkout` command.', - 'gitcloneparams' => 'Add options to the `git clone` command.', - 'gitfetchparams' => 'Add options to the `git fetch` command.', - 'gitpullparams' => 'Add options to the `git pull` command.', - 'gitinfofile' => 'Inject version info into each .info file.', - ), - 'sub-options' => array( - 'gitsubmodule' => array( - 'gitsubmoduleaddparams' => 'Add options to the `git submodule add` command.', - ), - ), - ), - ); -} - -/** - * Implements hook_drush_engine_ENGINE_TYPE(). - * - * Release info engine is used by several pm commands to obtain - * releases info from Drupal's update service or external sources. - */ -function pm_drush_engine_release_info() { - return array( - 'updatexml' => array( - 'description' => 'Drush release info engine for update.drupal.org and compatible services.', - 'options' => array( - 'source' => 'The base URL which provides project release history in XML. Defaults to http://updates.drupal.org/release-history.', - 'dev' => 'Work with development releases solely.', - ), - 'sub-options' => array( - 'cache' => array( - 'cache-duration-releasexml' => 'Expire duration (in seconds) for release XML. Defaults to 86400 (24 hours).', - ), - 'select' => array( - 'all' => 'Shows all available releases instead of a short list of recent releases.', - ), - ), - 'class' => 'Drush\UpdateService\ReleaseInfo', - ), - ); -} - -/** - * Implements hook_drush_engine_ENGINE_TYPE(). - * - * Update status engine is used to check available updates for - * the projects in a Drupal site. - */ -function pm_drush_engine_update_status() { - return array( - 'drupal' => array( - 'description' => 'Check available updates with update.module.', - 'drupal dependencies' => array('update'), - 'class' => 'Drush\UpdateService\StatusInfoDrupal', - ), - 'drush' => array( - 'description' => 'Check available updates without update.module.', - 'class' => 'Drush\UpdateService\StatusInfoDrush', - ), - ); -} - -/** - * Implements hook_drush_engine_ENGINE_TYPE(). - * - * Integration with VCS in order to easily commit your changes to projects. - */ -function pm_drush_engine_version_control() { - return array( - 'backup' => array( - 'description' => 'Backup all project files before updates.', - 'options' => array( - 'no-backup' => 'Do not perform backups. WARNING: Will result in non-core files/dirs being deleted (e.g. .git)', - 'backup-dir' => 'Specify a directory to backup projects into. Defaults to drush-backups within the home directory of the user running the command. It is forbidden to specify a directory inside your drupal root.', - ), - ), - 'bzr' => array( - 'signature' => 'bzr root %s', - 'description' => 'Quickly add/remove/commit your project changes to Bazaar.', - 'options' => array( - 'bzrsync' => 'Automatically add new files to the Bazaar repository and remove deleted files. Caution.', - 'bzrcommit' => 'Automatically commit changes to Bazaar repository. You must also use the --bzrsync option.', - ), - 'sub-options' => array( - 'bzrcommit' => array( - 'bzrmessage' => 'Override default commit message which is: Drush automatic commit. Project <name> <type> Command: <the drush command line used>', - ), - ), - 'examples' => array( - 'drush dl cck --version-control=bzr --bzrsync --bzrcommit' => 'Download the cck project and then add it and commit it to Bazaar.' - ), - ), - 'svn' => array( - 'signature' => 'svn info %s', - 'description' => 'Quickly add/remove/commit your project changes to Subversion.', - 'options' => array( - 'svnsync' => 'Automatically add new files to the SVN repository and remove deleted files. Caution.', - 'svncommit' => 'Automatically commit changes to SVN repository. You must also using the --svnsync option.', - 'svnstatusparams' => "Add options to the 'svn status' command", - 'svnaddparams' => 'Add options to the `svn add` command', - 'svnremoveparams' => 'Add options to the `svn remove` command', - 'svnrevertparams' => 'Add options to the `svn revert` command', - 'svncommitparams' => 'Add options to the `svn commit` command', - ), - 'sub-options' => array( - 'svncommit' => array( - 'svnmessage' => 'Override default commit message which is: Drush automatic commit: <the drush command line used>', - ), - ), - 'examples' => array( - 'drush [command] cck --svncommitparams=\"--username joe\"' => 'Commit changes as the user \'joe\' (Quotes are required).' - ), - ), - ); -} - -/** - * @} End of "Engine types". - */ - -/** - * Interface for version control systems. - * We use a simple object layer because we conceivably need more than one - * loaded at a time. - */ -interface drush_version_control { - function pre_update(&$project); - function rollback($project); - function post_update($project); - function post_download($project); - static function reserved_files(); -} - -/** - * A simple factory function that tests for version control systems, in a user - * specified order, and returns the one that appears to be appropriate for a - * specific directory. - */ -function drush_pm_include_version_control($directory = '.') { - $engine_info = drush_get_engines('version_control'); - $version_controls = drush_get_option('version-control', FALSE); - // If no version control was given, use a list of defaults. - if (!$version_controls) { - // Backup engine is the last option. - $version_controls = array_reverse(array_keys($engine_info['engines'])); - } - else { - $version_controls = array($version_controls); - } - - // Find the first valid engine in the list, checking signatures if needed. - $engine = FALSE; - while (!$engine && count($version_controls)) { - $version_control = array_shift($version_controls); - if (isset($engine_info['engines'][$version_control])) { - if (!empty($engine_info['engines'][$version_control]['signature'])) { - drush_log(dt('Verifying signature for !vcs version control engine.', array('!vcs' => $version_control)), LogLevel::DEBUG); - if (drush_shell_exec($engine_info['engines'][$version_control]['signature'], $directory)) { - $engine = $version_control; - } - } - else { - $engine = $version_control; - } - } - } - if (!$engine) { - return drush_set_error('DRUSH_PM_NO_VERSION_CONTROL', dt('No valid version control or backup engine found (the --version-control option was set to "!version-control").', array('!version-control' => $version_control))); - } - - $instance = drush_include_engine('version_control', $engine); - return $instance; -} - -/** - * Update the locked status of all of the candidate projects - * to be updated. - * - * @param array &$projects - * The projects array from pm_updatecode. $project['locked'] will - * be set for every file where a persistent lockfile can be found. - * The 'lock' and 'unlock' operations are processed first. - * @param array $projects_to_lock - * A list of projects to create peristent lock files for - * @param array $projects_to_unlock - * A list of projects to clear the persistent lock on - * @param string $lock_message - * The reason the project is being locked; stored in the lockfile. - * - * @return array - * A list of projects that are locked. - */ -function drush_pm_update_lock(&$projects, $projects_to_lock, $projects_to_unlock, $lock_message = NULL) { - $locked_result = array(); - - // Warn about ambiguous lock / unlock values - if ($projects_to_lock == array('1')) { - $projects_to_lock = array(); - drush_log(dt('Ignoring --lock with no value.'), LogLevel::WARNING); - } - if ($projects_to_unlock == array('1')) { - $projects_to_unlock = array(); - drush_log(dt('Ignoring --unlock with no value.'), LogLevel::WARNING); - } - - // Log if we are going to lock or unlock anything - if (!empty($projects_to_unlock)) { - drush_log(dt('Unlocking !projects', array('!projects' => implode(',', $projects_to_unlock))), LogLevel::OK); - } - if (!empty($projects_to_lock)) { - drush_log(dt('Locking !projects', array('!projects' => implode(',', $projects_to_lock))), LogLevel::OK); - } - - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - foreach ($projects as $name => $project) { - $message = NULL; - if (isset($project['path'])) { - if ($name == 'drupal') { - $lockfile = $drupal_root . '/.drush-lock-update'; - } - else { - $lockfile = $drupal_root . '/' . $project['path'] . '/.drush-lock-update'; - } - - // Remove the lock file if the --unlock option was specified - if (((in_array($name, $projects_to_unlock)) || (in_array('all', $projects_to_unlock))) && (file_exists($lockfile))) { - drush_op('unlink', $lockfile); - } - - // Create the lock file if the --lock option was specified - if ((in_array($name, $projects_to_lock)) || (in_array('all', $projects_to_lock))) { - drush_op('file_put_contents', $lockfile, $lock_message != NULL ? $lock_message : "Locked via drush."); - // Note that the project is locked. This will work even if we are simulated, - // or if we get permission denied from the file_put_contents. - // If the lock is -not- simulated or transient, then the lock message will be - // read from the lock file below. - $message = drush_get_context('DRUSH_SIMULATE') ? 'Simulated lock.' : 'Transient lock.'; - } - - // If the persistent lock file exists, then mark the project as locked. - if (file_exists($lockfile)) { - $message = trim(file_get_contents($lockfile)); - } - } - - // If there is a message set, then mark the project as locked. - if (isset($message)) { - $projects[$name]['locked'] = !empty($message) ? $message : "Locked."; - $locked_result[$name] = $project; - } - } - - return $locked_result; -} - -/** - * Returns the path to the extensions cache file. - */ -function _drush_pm_extension_cache_file() { - return drush_get_context('DRUSH_PER_USER_CONFIGURATION') . "/drush-extension-cache.inc"; -} - -/** - * Load the extensions cache. - */ -function _drush_pm_get_extension_cache() { - $extension_cache = array(); - $cache_file = _drush_pm_extension_cache_file(); - - if (file_exists($cache_file)) { - include $cache_file; - } - if (!array_key_exists('extension-map', $extension_cache)) { - $extension_cache['extension-map'] = array(); - } - return $extension_cache; -} - -/** - * Lookup an extension in the extensions cache. - */ -function drush_pm_lookup_extension_in_cache($extension) { - $result = NULL; - $extension_cache = _drush_pm_get_extension_cache(); - if (!empty($extension_cache) && array_key_exists($extension, $extension_cache)) { - $result = $extension_cache[$extension]; - } - return $result; -} - -/** - * Persists extensions cache. - * - * #TODO# not implemented. - */ -function drush_pm_put_extension_cache($extension_cache) { -} - -/** - * Store extensions founds within a project in extensions cache. - */ -function drush_pm_cache_project_extensions($project, $found) { - $extension_cache = _drush_pm_get_extension_cache(); - foreach($found as $extension) { - // Simple cache does not handle conflicts - // We could keep an array of projects, and count - // how many times each one has been seen... - $extension_cache[$extension] = $project['name']; - } - drush_pm_put_extension_cache($extension_cache); -} - -/** - * Print out all extensions (modules/themes/profiles) found in specified project. - * - * Find .info.yml files in the project path and identify modules, themes and - * profiles. It handles two kind of projects: drupal core/profiles and - * modules/themes. - * It does nothing with theme engine projects. - */ -function drush_pm_extensions_in_project($project) { - // Mask for drush_scan_directory, to match .info.yml files. - $mask = $project['drupal_version'][0] >= 8 ? '/(.*)\.info\.yml$/' : '/(.*)\.info$/'; - - // Mask for drush_scan_directory, to avoid tests directories. - $nomask = array('.', '..', 'CVS', 'tests'); - - // Drupal core and profiles can contain modules, themes and profiles. - if (in_array($project['project_type'], array('core', 'profile'))) { - $found = array('profile' => array(), 'theme' => array(), 'module' => array()); - // Find all of the .info files - foreach (drush_scan_directory($project['full_project_path'], $mask, $nomask) as $filename => $info) { - // Extract extension name from filename. - $matches = array(); - preg_match($mask, $info->basename, $matches); - $name = $matches[1]; - - // Find the project type corresponding the .info file. - // (Only drupal >=7.x has .info for .profile) - $base = dirname($filename) . '/' . $name; - if (is_file($base . '.module')) { - $found['module'][] = $name; - } - else if (is_file($base . '.profile')) { - $found['profile'][] = $name; - } - else { - $found['theme'][] = $name; - } - } - // Special case: find profiles for drupal < 7.x (no .info) - if ($project['drupal_version'][0] < 7) { - foreach (drush_find_profiles($project['full_project_path']) as $filename => $info) { - $found['profile'][] = $info->name; - } - } - // Log results. - $msg = "Project !project contains:\n"; - $args = array('!project' => $project['name']); - foreach (array_keys($found) as $type) { - if ($count = count($found[$type])) { - $msg .= " - !count_$type !type_$type: !found_$type\n"; - $args += array("!count_$type" => $count, "!type_$type" => $type, "!found_$type" => implode(', ', $found[$type])); - if ($count > 1) { - $args["!type_$type"] = $type.'s'; - } - } - } - drush_log(dt($msg, $args), LogLevel::SUCCESS); - drush_print_pipe(call_user_func_array('array_merge', array_values($found))); - } - // Modules and themes can only contain other extensions of the same type. - elseif (in_array($project['project_type'], array('module', 'theme'))) { - $found = array(); - foreach (drush_scan_directory($project['full_project_path'], $mask, $nomask) as $filename => $info) { - // Extract extension name from filename. - $matches = array(); - preg_match($mask, $info->basename, $matches); - $found[] = $matches[1]; - } - // If there is only one module / theme in the project, only print out - // the message if is different than the project name. - if (count($found) == 1) { - if ($found[0] != $project['name']) { - $msg = "Project !project contains a !type named !found."; - } - } - // If there are multiple modules or themes in the project, list them all. - else { - $msg = "Project !project contains !count !types: !found."; - } - if (isset($msg)) { - drush_print(dt($msg, array('!project' => $project['name'], '!count' => count($found), '!type' => $project['project_type'], '!found' => implode(', ', $found)))); - } - drush_print_pipe($found); - // Cache results. - drush_pm_cache_project_extensions($project, $found); - } -} - -/** - * Return an array of empty directories. - * - * Walk a directory and return an array of subdirectories that are empty. Will - * return the given directory if it's empty. - * If a list of items to exclude is provided, subdirectories will be condidered - * empty even if they include any of the items in the list. - * - * @param string $dir - * Path to the directory to work in. - * @param array $exclude - * Array of files or directory to exclude in the check. - * - * @return array - * A list of directory paths that are empty. A directory is deemed to be empty - * if it only contains excluded files or directories. - */ -function drush_find_empty_directories($dir, $exclude = array()) { - // Skip files. - if (!is_dir($dir)) { - return array(); - } - $to_exclude = array_merge(array('.', '..'), $exclude); - $empty_dirs = array(); - $dir_is_empty = TRUE; - foreach (scandir($dir) as $file) { - // Skip excluded directories. - if (in_array($file, $to_exclude)) { - continue; - } - // Recurse into sub-directories to find potentially empty ones. - $subdir = $dir . '/' . $file; - $empty_dirs += drush_find_empty_directories($subdir, $exclude); - // $empty_dir will not contain $subdir, if it is a file or if the - // sub-directory is not empty. $subdir is only set if it is empty. - if (!isset($empty_dirs[$subdir])) { - $dir_is_empty = FALSE; - } - } - - if ($dir_is_empty) { - $empty_dirs[$dir] = $dir; - } - return $empty_dirs; -} - -/** - * Inject metadata into all .info files for a given project. - * - * @param string $project_dir - * The full path to the root directory of the project to operate on. - * @param string $project_name - * The project machine name (AKA shortname). - * @param string $version - * The version string to inject into the .info file(s). - * @param int $datestamp - * The datestamp of the last commit. - * - * @return boolean - * TRUE on success, FALSE on any failures appending data to .info files. - */ -function drush_pm_inject_info_file_metadata($project_dir, $project_name, $version, $datestamp) { - // `drush_drupal_major_version()` cannot be used here because this may be running - // outside of a Drupal context. - $yaml_format = substr($version, 0, 1) >= 8; - $pattern = preg_quote($yaml_format ? '.info.yml' : '.info'); - $info_files = drush_scan_directory($project_dir, '/.*' . $pattern . '$/'); - if (!empty($info_files)) { - // Construct the string of metadata to append to all the .info files. - if ($yaml_format) { - $info = _drush_pm_generate_info_yaml_metadata($version, $project_name, $datestamp); - } - else { - $info = _drush_pm_generate_info_ini_metadata($version, $project_name, $datestamp); - } - foreach ($info_files as $info_file) { - if (!drush_file_append_data($info_file->filename, $info)) { - return FALSE; - } - } - } - return TRUE; -} - -/** - * Generate version information for `.info` files in ini format. - * - * Taken with some modifications from: - * http://drupalcode.org/project/drupalorg.git/blob/refs/heads/6.x-3.x:/drupalorg_project/plugins/release_packager/DrupalorgProjectPackageRelease.class.php#l192 - */ -function _drush_pm_generate_info_ini_metadata($version, $project_name, $datestamp) { - $matches = array(); - $extra = ''; - if (preg_match('/^((\d+)\.x)-.*/', $version, $matches) && $matches[2] >= 6) { - $extra .= "\ncore = \"$matches[1]\""; - } - if (!drush_get_option('no-gitprojectinfo', FALSE)) { - $extra = "\nproject = \"$project_name\""; - } - $date = date('Y-m-d', $datestamp); - $info = <<<METADATA - -; Information added by drush on {$date} -version = "{$version}"{$extra} -datestamp = "{$datestamp}" -METADATA; - return $info; -} - -/** - * Generate version information for `.info` files in YAML format. - */ -function _drush_pm_generate_info_yaml_metadata($version, $project_name, $datestamp) { - $matches = array(); - $extra = ''; - if (preg_match('/^((\d+)\.x)-.*/', $version, $matches) && $matches[2] >= 6) { - $extra .= "\ncore: '$matches[1]'"; - } - if (!drush_get_option('no-gitprojectinfo', FALSE)) { - $extra = "\nproject: '$project_name'"; - } - $date = date('Y-m-d', $datestamp); - $info = <<<METADATA - -# Information added by drush on {$date} -version: '{$version}'{$extra} -datestamp: {$datestamp} -METADATA; - return $info; -} diff --git a/vendor/drush/drush/commands/pm/projectinfo.pm.inc b/vendor/drush/drush/commands/pm/projectinfo.pm.inc deleted file mode 100644 index bbb5e912404808c1a67225d9a286edcae352c19e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/projectinfo.pm.inc +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -use Drush\Log\LogLevel; - -/** - * Implementation of drush_hook_COMMAND_validate(). - */ -function drush_pm_projectinfo_validate() { - $status = drush_get_option('status'); - if (!empty($status)) { - if (!in_array($status, array('enabled', 'disabled'), TRUE)) { - return drush_set_error('DRUSH_PM_INVALID_PROJECT_STATUS', dt('!status is not a valid project status.', array('!status' => $status))); - } - } -} - -/** - * Implementation of drush_hook_COMMAND(). - */ -function drush_pm_projectinfo() { - // Get specific requests. - $requests = pm_parse_arguments(func_get_args(), FALSE); - - // Get installed extensions and projects. - $extensions = drush_get_extensions(); - $projects = drush_get_projects($extensions); - - // If user did not specify any projects, return them all - if (empty($requests)) { - $result = $projects; - } - else { - $result = array(); - foreach ($requests as $name) { - if (array_key_exists($name, $projects)) { - $result[$name] = $projects[$name]; - } - else { - drush_log(dt('!project was not found.', array('!project' => $name)), LogLevel::WARNING); - continue; - } - } - } - - // Find the Drush commands that belong with each project. - foreach ($result as $name => $project) { - $drush_commands = pm_projectinfo_commands_in_project($project); - if (!empty($drush_commands)) { - $result[$name]['drush'] = $drush_commands; - } - } - - // If user specified --drush, remove projects with no drush extensions - if (drush_get_option('drush')) { - foreach ($result as $name => $project) { - if (!array_key_exists('drush', $project)) { - unset($result[$name]); - } - } - } - - // If user specified --status=1|0, remove projects with a distinct status. - if (($status = drush_get_option('status', FALSE)) !== FALSE) { - $status_code = ($status == 'enabled') ? 1 : 0; - foreach ($result as $name => $project) { - if ($project['status'] != $status_code) { - unset($result[$name]); - } - } - } - - return $result; -} - -function pm_projectinfo_commands_in_project($project) { - $drush_commands = array(); - if (array_key_exists('path', $project)) { - $commands = drush_get_commands(); - foreach ($commands as $commandname => $command) { - if (!array_key_exists("is_alias", $command) && ($command['path'] == $project['path'])) { - $drush_commands[] = $commandname; - } - } - } - return $drush_commands; -} - diff --git a/vendor/drush/drush/commands/pm/updatecode.pm.inc b/vendor/drush/drush/commands/pm/updatecode.pm.inc deleted file mode 100644 index 9567cda0b3e60ca4371273480e7a8cbd2eb5124c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/updatecode.pm.inc +++ /dev/null @@ -1,409 +0,0 @@ -<?php - -/** - * @file - * pm-updatecode command implementation. - */ - -use Drush\Log\LogLevel; - -/** - * Command callback. Displays update status info and allows to update installed projects. - * - * Pass specific projects as arguments, otherwise we update all that have - * candidate releases. - * - * This command prompts for confirmation before updating, so it is safe to run - * just to check on. In this case, say at the confirmation prompt. - */ -function drush_pm_updatecode() { - // In --pipe mode, just run pm-updatestatus and exit. - if (drush_get_context('DRUSH_PIPE')) { - drush_set_option('strict', 0); - return drush_invoke('pm-updatestatus'); - } - - $update_status = drush_get_engine('update_status'); - - // Get specific requests. - $requests = pm_parse_arguments(func_get_args(), FALSE); - - // Print report of modules to update, and record - // result of that function in $update_info. - $updatestatus_options = array(); - foreach (array('lock', 'unlock', 'lock-message', 'update-backend', 'check-disabled', 'security-only') as $option) { - $value = drush_get_option($option, FALSE); - if ($value) { - $updatestatus_options[$option] = $value; - } - } - $backend_options = array( - 'integrate' => FALSE, - ); - $values = drush_invoke_process("@self", 'pm-updatestatus', func_get_args(), $updatestatus_options, $backend_options); - if (!is_array($values) || $values['error_status']) { - return drush_set_error('pm-updatestatus failed.'); - } - $last = $update_status->lastCheck(); - drush_print(dt('Update information last refreshed: ') . ($last ? format_date($last) : dt('Never'))); - drush_print($values['output']); - - $update_info = $values['object']; - - // Prevent update of core if --no-core was specified. - if (isset($update_info['drupal']) && drush_get_option('no-core', FALSE)) { - unset($update_info['drupal']); - drush_print(dt('Skipping core update (--no-core specified).')); - } - - // Remove locked and non-updateable projects. - foreach ($update_info as $name => $project) { - if ((isset($project['locked']) && !isset($requests[$name])) || (!isset($project['updateable']) || !$project['updateable'])) { - unset($update_info[$name]); - } - } - - // Do no updates in simulated mode. - if (drush_get_context('DRUSH_SIMULATE')) { - return drush_log(dt('No action taken in simulated mode.'), LogLevel::OK); - return TRUE; - } - - $tmpfile = drush_tempnam('pm-updatecode.'); - - $core_update_available = FALSE; - if (isset($update_info['drupal'])) { - $drupal_project = $update_info['drupal']; - unset($update_info['drupal']); - - // At present we need to update drupal core after non-core projects - // are updated. - if (empty($update_info)) { - return _pm_update_core($drupal_project, $tmpfile); - } - // If there are modules other than drupal core enabled, then update them - // first. - else { - $core_update_available = TRUE; - if ($drupal_project['status'] == DRUSH_UPDATESTATUS_NOT_SECURE) { - drush_print(dt("NOTE: A security update for the Drupal core is available.")); - } - else { - drush_print(dt("NOTE: A code update for the Drupal core is available.")); - } - drush_print(dt("Drupal core will be updated after all of the non-core projects are updated.\n")); - } - } - - // If there are no releases to update, then print a final - // exit message. - if (empty($update_info)) { - if (drush_get_option('security-only')) { - return drush_log(dt('No security updates available.'), LogLevel::OK); - } - else { - return drush_log(dt('No code updates available.'), LogLevel::OK); - } - } - - // Offer to update to the identified releases. - if (!pm_update_packages($update_info, $tmpfile)) { - return FALSE; - } - - // After projects are updated we can update core. - if ($core_update_available) { - drush_print(); - return _pm_update_core($drupal_project, $tmpfile); - } -} - -/** - * Update drupal core, following interactive confirmation from the user. - * - * @param $project - * The drupal project information from the drupal.org update service, - * copied from $update_info['drupal']. @see drush_pm_updatecode. - * - * @return bool - * Success or failure. An error message will be logged. - */ -function _pm_update_core(&$project, $tmpfile) { - $release_info = drush_get_engine('release_info'); - - drush_print(dt('Code updates will be made to drupal core.')); - drush_print(dt("WARNING: Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt. If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.")); - drush_print(dt("Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.")); - drush_print(); - if (drush_get_option('notes', FALSE)) { - drush_print('Obtaining release notes for above projects...'); - #TODO# Build the $request array from info in $project. - $request = pm_parse_request('drupal'); - $release_info->get($request)->getReleaseNotes(NULL, TRUE, $tmpfile); - } - if(!drush_confirm(dt('Do you really want to continue?'))) { - drush_print(dt('Rolling back all changes. Run again with --no-core to update modules only.')); - return drush_user_abort(); - } - - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - - // We need write permission on $drupal_root. - if (!is_writable($drupal_root)) { - return drush_set_error('DRUSH_PATH_NO_WRITABLE', dt('Drupal root path is not writable.')); - } - - // Create a directory 'core' if it does not already exist. - $project['path'] = 'drupal-' . $project['candidate_version']; - $project['full_project_path'] = $drupal_root . '/' . $project['path']; - if (!is_dir($project['full_project_path'])) { - drush_mkdir($project['full_project_path']); - } - - // Create a list of directories to exclude from the update process. - // On Drupal >=8 skip also directories in the document root. - if (drush_drupal_major_version() >= 8) { - $skip_list = array('sites', $project['path'], 'modules', 'profiles', 'themes'); - } - else { - $skip_list = array('sites', $project['path']); - } - // Add non-writable directories: we can't move them around. - // We will also use $items_to_test later for $version_control check. - $items_to_test = drush_scan_directory($drupal_root, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'basename', 0, TRUE); - foreach (array_keys($items_to_test) as $item) { - if (is_dir($item) && !is_writable($item)) { - $skip_list[] = $item; - unset($items_to_test[$item]); - } - elseif (is_link($item)) { - $skip_list[] = $item; - unset($items_to_test[$item]); - } - } - $project['skip_list'] = $skip_list; - - // Move all files and folders in $drupal_root to the new 'core' directory - // except for the items in the skip list - _pm_update_move_files($drupal_root, $project['full_project_path'], $project['skip_list']); - - // Set a context variable to indicate that rollback should reverse - // the _pm_update_move_files above. - drush_set_context('DRUSH_PM_DRUPAL_CORE', $project); - - if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) { - return FALSE; - } - - // Check we have a version control system, and it clears its pre-flight. - if (!$version_control->pre_update($project, $items_to_test)) { - return FALSE; - } - - // Update core. - if (pm_update_project($project, $version_control) === FALSE) { - return FALSE; - } - - // Take the updated files in the 'core' directory that have been updated, - // and move all except for the items in the skip list back to - // the drupal root. - _pm_update_move_files($project['full_project_path'], $drupal_root, $project['skip_list']); - drush_delete_dir($project['full_project_path']); - $project['full_project_path'] = $drupal_root; - - // If there is a backup target, then find items - // in the backup target that do not exist at the - // drupal root. These are to be moved back. - if (array_key_exists('backup_target', $project)) { - _pm_update_move_files($project['backup_target'], $drupal_root, $project['skip_list'], FALSE); - _pm_update_move_files($project['backup_target'] . '/profiles', $drupal_root . '/profiles', array('default'), FALSE); - } - - pm_update_finish($project, $version_control); - - return TRUE; -} - -/** - * Move some files from one location to another. - */ -function _pm_update_move_files($src_dir, $dest_dir, $skip_list, $remove_conflicts = TRUE) { - $items_to_move = drush_scan_directory($src_dir, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'filename', 0, TRUE); - foreach ($items_to_move as $filename => $info) { - if ($remove_conflicts) { - drush_delete_dir($dest_dir . '/' . basename($filename)); - } - if (!file_exists($dest_dir . '/' . basename($filename))) { - $move_result = drush_move_dir($filename, $dest_dir . '/' . basename($filename)); - } - } - return TRUE; -} - -/** - * Update projects according to an array of releases and print the release notes - * for each project, following interactive confirmation from the user. - * - * @param $update_info - * An array of projects from the drupal.org update service, with an additional - * array key candidate_version that specifies the version to be installed. - */ -function pm_update_packages($update_info, $tmpfile) { - $release_info = drush_get_engine('release_info'); - - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - - $print = ''; - $status = array(); - foreach($update_info as $project) { - $print .= $project['title'] . " [" . $project['name'] . '-' . $project['candidate_version'] . "], "; - $status[$project['status']] = $project['status']; - } - // We print the list of the projects that need to be updated. - if (isset($status[DRUSH_UPDATESTATUS_NOT_SECURE])) { - if (isset($status[DRUSH_UPDATESTATUS_NOT_CURRENT])) { - $title = (dt('Security and code updates will be made to the following projects:')); - } - else { - $title = (dt('Security updates will be made to the following projects:')); - } - } - else { - $title = (dt('Code updates will be made to the following projects:')); - } - $print = "$title " . (substr($print, 0, strlen($print)-2)); - drush_print($print); - file_put_contents($tmpfile, "\n\n$print\n\n", FILE_APPEND); - - // Print the release notes for projects to be updated. - if (drush_get_option('notes', FALSE)) { - drush_print('Obtaining release notes for above projects...'); - #TODO# Build the $request array from info in $project. - foreach (array_keys($update_info) as $project_name) { - $request = pm_parse_request($project_name); - $release_info->get($request)->getReleaseNotes(NULL, TRUE, $tmpfile); - } - } - - // We print some warnings before the user confirms the update. - drush_print(); - if (drush_get_option('no-backup', FALSE)) { - drush_print(dt("Note: You have selected to not store backups.")); - } - else { - drush_print(dt("Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.")); - drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.')); - } - if(!drush_confirm(dt('Do you really want to continue with the update process?'))) { - return drush_user_abort(); - } - - // Now we start the actual updating. - foreach($update_info as $project) { - if (empty($project['path'])) { - return drush_set_error('DRUSH_PM_UPDATING_NO_PROJECT_PATH', dt('The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type']))); - } - drush_log(dt('Starting to update !project code at !dir...', array('!project' => $project['title'], '!dir' => $project['path']))); - - // Define and check the full path to project directory and base (parent) directory. - $project['full_project_path'] = $drupal_root . '/' . $project['path']; - if (stripos($project['path'], $project['project_type']) === FALSE || !is_dir($project['full_project_path'])) { - return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path']))); - } - if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) { - return FALSE; - } - - // Check we have a version control system, and it clears its pre-flight. - if (!$version_control->pre_update($project)) { - return FALSE; - } - - // Run update on one project. - if (pm_update_project($project, $version_control) === FALSE) { - return FALSE; - } - pm_update_finish($project, $version_control); - } - - return TRUE; -} - -/** - * Update one project -- a module, theme or Drupal core. - * - * @param $project - * The project to upgrade. $project['full_project_path'] must be set - * to the location where this project is stored. - * @return bool - * Success or failure. An error message will be logged. - */ -function pm_update_project($project, $version_control) { - // 1. If the version control engine is a proper vcs we need to remove project - // files in order to not have orphan files after update. - // 2. If the package-handler is cvs or git, it will remove upstream removed - // files and no orphans will exist after update. - // So, we must remove all files previous update if the directory is not a - // working copy of cvs or git but we don't need to remove them if the version - // control engine is backup, as it did already move the project out to the - // backup directory. - if (($version_control->engine != 'backup') && (drush_get_option('package-handler', 'wget') == 'wget')) { - // Find and unlink all files but the ones in the vcs control directories. - $skip_list = array('.', '..'); - $skip_list = array_merge($skip_list, drush_version_control_reserved_files()); - drush_scan_directory($project['full_project_path'], '/.*/', $skip_list, 'unlink', TRUE, 'filename', 0, TRUE); - } - - // Add the project to a context so we can roll back if needed. - $updated = drush_get_context('DRUSH_PM_UPDATED'); - $updated[] = $project; - drush_set_context('DRUSH_PM_UPDATED', $updated); - - if (!package_handler_update_project($project, $project['releases'][$project['candidate_version']])) { - return drush_set_error('DRUSH_PM_UPDATING_FAILED', dt('Updating project !project failed. Attempting to roll back to previously installed version.', array('!project' => $project['name']))); - } - - // If the version control engine is a proper vcs we also need to remove - // orphan directories. - if (($version_control->engine != 'backup') && (drush_get_option('package-handler', 'wget') == 'wget')) { - $files = drush_find_empty_directories($project['full_project_path'], $version_control->reserved_files()); - array_map('drush_delete_dir', $files); - } - - return TRUE; -} - -/** - * Run the post-update hooks after updatecode is finished for one project. - */ -function pm_update_finish($project, $version_control) { - drush_print(dt('Project !project was updated successfully. Installed version is now !version.', array('!project' => $project['name'], '!version' => $project['candidate_version']))); - drush_command_invoke_all('pm_post_update', $project['name'], $project['releases'][$project['candidate_version']], $project); - $version_control->post_update($project); -} - -/** - * Rollback the update process. - */ -function drush_pm_updatecode_rollback() { - $projects = array_reverse(drush_get_context('DRUSH_PM_UPDATED', array())); - foreach($projects as $project) { - drush_log(dt('Rolling back update of !project code ...', array('!project' => $project['title']))); - - // Check we have a version control system, and it clears it's pre-flight. - if (!$version_control = drush_pm_include_version_control($project['path'])) { - return FALSE; - } - $version_control->rollback($project); - } - - // Post rollback, we will do additional repair if the project is drupal core. - $drupal_core = drush_get_context('DRUSH_PM_DRUPAL_CORE', FALSE); - if ($drupal_core) { - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - _pm_update_move_files($drupal_core['full_project_path'], $drupal_root, $drupal_core['skip_list']); - drush_delete_dir($drupal_core['full_project_path']); - } -} - diff --git a/vendor/drush/drush/commands/pm/updatestatus.pm.inc b/vendor/drush/drush/commands/pm/updatestatus.pm.inc deleted file mode 100644 index 535d4dc141024580ae6b764d9969b60318129ff1..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/updatestatus.pm.inc +++ /dev/null @@ -1,246 +0,0 @@ -<?php - -/** - * @file - * pm-updatestatus command implementation. - */ - -/** - * Command callback. Displays update status info of installed projects. - * - * Pass specific projects as arguments, otherwise we show all that are - * updateable. - */ -function drush_pm_updatestatus() { - // Get specific requests. - $args = pm_parse_arguments(func_get_args(), FALSE); - - // Get installed extensions and projects. - $extensions = drush_get_extensions(); - $projects = drush_get_projects($extensions); - - // Parse out project name and version. - $requests = array(); - foreach ($args as $request) { - $request = pm_parse_request($request, NULL, $projects); - $requests[$request['name']] = $request; - } - - // Get the engine instance. - $update_status = drush_get_engine('update_status'); - - // If the user doesn't provide a value for check-disabled option, - // and the update backend is 'drupal', use NULL, so the engine - // will respect update.module defaults. - $check_disabled_default = ($update_status->engine == 'drupal') ? NULL : FALSE; - $check_disabled = drush_get_option('check-disabled', $check_disabled_default); - - $update_info = $update_status->getStatus($projects, $check_disabled); - - foreach ($extensions as $name => $extension) { - // Add an item to $update_info for each enabled extension which was obtained - // from cvs or git and its project is unknown (because of cvs_deploy or - // git_deploy is not enabled). - if (!isset($extension->info['project'])) { - if ((isset($extension->vcs)) && ($extension->status)) { - $update_info[$name] = array( - 'name' => $name, - 'label' => $extension->label, - 'existing_version' => 'Unknown', - 'status' => DRUSH_UPDATESTATUS_PROJECT_NOT_PACKAGED, - 'status_msg' => dt('Project was not packaged by drupal.org but obtained from !vcs. You need to enable !vcs_deploy module', array('!vcs' => $extension->vcs)), - ); - // The user may have requested to update a project matching this - // extension. If it was by coincidence or error we don't mind as we've - // already added an item to $update_info. Just clean up $requests. - if (isset($requests[$name])) { - unset($requests[$name]); - } - } - } - // Additionally if the extension name is distinct to the project name and - // the user asked to update the extension, fix the request. - elseif ((isset($requests[$name])) && ($name != $extension->info['project'])) { - $requests[$extension->info['project']] = $requests[$name]; - unset($requests[$name]); - } - } - // If specific project updates were requested then remove releases for all - // others. - $requested = func_get_args(); - if (!empty($requested)) { - foreach ($update_info as $name => $project) { - if (!isset($requests[$name])) { - unset($update_info[$name]); - } - } - } - // Add an item to $update_info for each request not present in $update_info. - foreach ($requests as $name => $request) { - if (!isset($update_info[$name])) { - // Disabled projects. - if ((isset($projects[$name])) && ($projects[$name]['status'] == 0)) { - $update_info[$name] = array( - 'name' => $name, - 'label' => $projects[$name]['label'], - 'existing_version' => $projects[$name]['version'], - 'status' => DRUSH_UPDATESTATUS_REQUESTED_PROJECT_NOT_UPDATEABLE, - ); - unset($requests[$name]); - } - // At this point we are unable to find matching installed project. - // It does not exist at all or it is misspelled,... - else { - $update_info[$name] = array( - 'name' => $name, - 'label' => $name, - 'existing_version' => 'Unknown', - 'status'=> DRUSH_UPDATESTATUS_REQUESTED_PROJECT_NOT_FOUND, - ); - } - } - } - - // If specific versions were requested, match the requested release. - foreach ($requests as $name => $request) { - if (!empty($request['version'])) { - if (empty($update_info[$name]['releases'][$request['version']])) { - $update_info[$name]['status'] = DRUSH_UPDATESTATUS_REQUESTED_VERSION_NOT_FOUND; - } - elseif ($request['version'] == $update_info[$name]['existing_version']) { - $update_info[$name]['status'] = DRUSH_UPDATESTATUS_REQUESTED_VERSION_CURRENT; - } - // TODO: should we warn/reject if this is a downgrade? - else { - $update_info[$name]['status'] = DRUSH_UPDATESTATUS_REQUESTED_VERSION_NOT_CURRENT; - $update_info[$name]['candidate_version'] = $request['version']; - } - } - } - // Process locks specified on the command line. - $locked_list = drush_pm_update_lock($update_info, drush_get_option_list('lock'), drush_get_option_list('unlock'), drush_get_option('lock-message')); - - // Build project updatable messages, set candidate version and mark - // 'updateable' in the project. - foreach ($update_info as $key => $project) { - switch($project['status']) { - case DRUSH_UPDATESTATUS_NOT_SECURE: - $status = dt('SECURITY UPDATE available'); - pm_release_recommended($project); - break; - case DRUSH_UPDATESTATUS_REVOKED: - $status = dt('Installed version REVOKED'); - pm_release_recommended($project); - break; - case DRUSH_UPDATESTATUS_NOT_SUPPORTED: - $status = dt('Installed version not supported'); - pm_release_recommended($project); - break; - case DRUSH_UPDATESTATUS_NOT_CURRENT: - $status = dt('Update available'); - pm_release_recommended($project); - break; - case DRUSH_UPDATESTATUS_CURRENT: - $status = dt('Up to date'); - pm_release_recommended($project); - $project['updateable'] = FALSE; - break; - case DRUSH_UPDATESTATUS_NOT_CHECKED: - case DRUSH_UPDATESTATUS_NOT_FETCHED: - case DRUSH_UPDATESTATUS_FETCH_PENDING: - $status = dt('Unable to check status'); - break; - case DRUSH_UPDATESTATUS_PROJECT_NOT_PACKAGED: - $status = $project['status_msg']; - break; - case DRUSH_UPDATESTATUS_REQUESTED_PROJECT_NOT_UPDATEABLE: - $status = dt('Project has no enabled extensions and can\'t be updated'); - break; - case DRUSH_UPDATESTATUS_REQUESTED_PROJECT_NOT_FOUND: - $status = dt('Specified project not found'); - break; - case DRUSH_UPDATESTATUS_REQUESTED_VERSION_NOT_FOUND: - $status = dt('Specified version not found'); - break; - case DRUSH_UPDATESTATUS_REQUESTED_VERSION_CURRENT: - $status = dt('Specified version already installed'); - break; - case DRUSH_UPDATESTATUS_REQUESTED_VERSION_NOT_CURRENT: - $status = dt('Specified version available'); - $project['updateable'] = TRUE; - break; - default: - $status = dt('Unknown'); - break; - } - - if (isset($project['locked'])) { - $status = $project['locked'] . " ($status)"; - } - // Persist candidate_version in $update_info (plural). - if (empty($project['candidate_version'])) { - $update_info[$key]['candidate_version'] = $project['existing_version']; // Default to no change - } - else { - $update_info[$key]['candidate_version'] = $project['candidate_version']; - } - $update_info[$key]['status_msg'] = $status; - if (isset($project['updateable'])) { - $update_info[$key]['updateable'] = $project['updateable']; - } - } - - // Filter projects to show. - return pm_project_filter($update_info, drush_get_option('security-only')); -} - -/** - * Filter projects based on verbosity level and $security_only flag. - * - * @param array $update_info - * Update info for projects. - * @param bool $security_only - * Whether to select only projects with security updates. - * - * @return - * Array of projects matching filter criteria. - */ -function pm_project_filter($update_info, $security_only) { - $eligible = array(); - foreach ($update_info as $key => $project) { - if ($security_only) { - if ($project['status'] == DRUSH_UPDATESTATUS_NOT_SECURE) { - $eligible[$key] = $project; - } - } - elseif (drush_get_context('DRUSH_VERBOSE')) { - $eligible[$key] = $project; - } - elseif ($project['status'] != DRUSH_UPDATESTATUS_CURRENT) { - $eligible[$key] = $project; - } - } - return $eligible; -} - -/** - * Set a release to a recommended version (if available), and set as updateable. - */ -function pm_release_recommended(&$project) { - if (isset($project['recommended'])) { - $project['candidate_version'] = $project['recommended']; - $project['updateable'] = TRUE; - } - // If installed version is dev and the candidate version is older, choose - // latest dev as candidate. - if (($project['install_type'] == 'dev') && isset($project['candidate_version'])) { - if ($project['releases'][$project['candidate_version']]['date'] < $project['datestamp']) { - $project['candidate_version'] = $project['latest_dev']; - if ($project['releases'][$project['candidate_version']]['date'] <= $project['datestamp']) { - $project['candidate_version'] = $project['existing_version']; - $project['updateable'] = FALSE; - } - } - } -} - diff --git a/vendor/drush/drush/commands/pm/version_control/backup.inc b/vendor/drush/drush/commands/pm/version_control/backup.inc deleted file mode 100644 index 8c17352a031a73107766fceaf93f646f89595505..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/version_control/backup.inc +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -/** - * @file - * Drush pm directory copy backup extension - */ - -use Drush\Log\LogLevel; - -class drush_version_control_backup implements drush_version_control { - - /** - * Implementation of pre_update(). - */ - public function pre_update(&$project, $items_to_test = array()) { - if (drush_get_option('no-backup', FALSE)) { - // Delete the project path to clean up files that should be removed - if (!drush_delete_dir($project['full_project_path'])) { - return FALSE; - } - return TRUE; - } - if ($backup_target = $this->prepare_backup_dir()) { - if ($project['project_type'] != 'core') { - $backup_target .= '/' . $project['project_type'] . 's'; - drush_mkdir($backup_target); - } - $backup_target .= '/'. $project['name']; - // Save for rollback or notifications. - $project['backup_target'] = $backup_target; - - // Move or copy to backup target based in package-handler. - if (drush_get_option('package-handler', 'wget') == 'wget') { - if (drush_move_dir($project['full_project_path'], $backup_target)) { - return TRUE; - } - } - // cvs or git. - elseif (drush_copy_dir($project['full_project_path'], $backup_target)) { - return TRUE; - } - return drush_set_error('DRUSH_PM_BACKUP_FAILED', dt('Failed to backup project directory !project to !backup_target', array('!project' => $project['full_project_path'], '!backup_target' => $backup_target))); - } - } - - /** - * Implementation of rollback(). - */ - public function rollback($project) { - if (drush_get_option('no-backup', FALSE)) { - return; - } - if (drush_move_dir($project['backup_target'], $project['full_project_path'], TRUE)) { - return drush_log(dt("Backups were restored successfully."), LogLevel::OK); - } - return drush_set_error('DRUSH_PM_BACKUP_ROLLBACK_FAILED', dt('Could not restore backup and rollback from failed upgrade. You will need to resolve manually.')); - } - - /** - * Implementation of post_update(). - */ - public function post_update($project) { - if (drush_get_option('no-backup', FALSE)) { - return; - } - if ($project['backup_target']) { - drush_log(dt("Backups were saved into the directory !backup_target.", array('!backup_target' => $project['backup_target'])), LogLevel::OK); - } - } - - /** - * Implementation of post_download(). - */ - public function post_download($project) { - // NOOP - } - - // Helper for pre_update. - public function prepare_backup_dir($subdir = NULL) { - return drush_prepare_backup_dir($subdir); - } - - public static function reserved_files() { - return array(); - } -} diff --git a/vendor/drush/drush/commands/pm/version_control/bzr.inc b/vendor/drush/drush/commands/pm/version_control/bzr.inc deleted file mode 100644 index 22bfb7a412ae8d97ddfd0206fa34d7368e114842..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/version_control/bzr.inc +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -/** - * @file - * Drush pm Bazaar extension - */ - -use Drush\Log\LogLevel; - -class drush_version_control_bzr implements drush_version_control { - - /** - * Implementation of pre_update(). - * - * Check that the project or drupal core directory looks clean - */ - public function pre_update(&$project, $items_to_test = array()) { - // Bazaar needs a list of items to test within the given project. - // If $items_to_test is empty we need to force it to test the project - // directory itself --once we've cd'ed to it. - if (empty($items_to_test)) { - $items_to_test = array('.' => '.'); - } - $args = array_keys($items_to_test); - array_unshift($args, 'bzr status --short' . str_repeat(' %s', count($args))); - array_unshift($args, $project['full_project_path']); - if (call_user_func_array('drush_shell_cd_and_exec', $args)) { - $output = preg_grep('/^[\sRCP][\sNDKM][\s\*]/', drush_shell_exec_output()); - if (!empty($output)) { - return drush_set_error('DRUSH_PM_BZR_LOCAL_CHANGES', dt("The Bazaar working copy at !path appears to have uncommitted changes (see below). Please commit or revert these changes before continuing:\n!output", array('!path' => $project['full_project_path'], '!output' => implode("\n", $output)))); - } - } - else { - return drush_set_error('DRUSH_PM_BZR_NOT_FOUND', dt("Drush was unable to get the bzr status on !path. Check that you have Bazaar \ninstalled and that this directory is a Bazaar working copy.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output())))); - } - return TRUE; - } - - /** - * Implementation of rollback(). - */ - public function rollback($project) { - if (drush_shell_exec('bzr revert %s', $project['full_project_path'])) { - $output = drush_shell_exec_output(); - if (!empty($output)) { - return drush_set_error('DRUSH_PM_BZR_LOCAL_CHANGES', dt("The Bazaar working copy at !path appears to have uncommitted changes (see below). Please commit or revert these changes before continuing:\n!output", array('!path' => $project['full_project_path'], '!output' => implode("\n", $output)))); - } - } - else { - return drush_set_error('DRUSH_PM_BZR_NOT_FOUND', dt("Drush was unable to get the Bazaar status on !path. Check that you have Bazaar \ninstalled and that this directory is a Bazaar working copy.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output())))); - } - } - - /** - * Implementation of post_update(). - */ - public function post_update($project) { - if ($this->sync($project)) { - // Only attempt commit on a sucessful sync - $this->commit($project); - } - } - - /** - * Implementation of post_download(). - */ - public function post_download($project) { - if ($this->sync($project)) { - // Only attempt commit on a sucessful sync - $this->commit($project); - } - } - - /** - * Automatically add any unversioned files to Bazaar and remove any files - * that have been deleted on the file system - */ - private function sync($project) { - if (drush_get_option('bzrsync')) { - $errors = ''; - $root = array(); - if (drush_shell_exec('bzr status --short %s', $project['full_project_path'])) { - $output = drush_shell_exec_output(); - // All paths returned by bzr status are relative to the repository root. - if (drush_shell_exec('bzr root %s', $project['full_project_path'])) { - $root = drush_shell_exec_output(); - } - foreach ($output as $line) { - if (preg_match('/^\?\s+(.*)/', $line, $matches)) { - $path = $root[0] .'/'. $matches[1]; - if (!drush_shell_exec('bzr add --no-recurse %s', $path)) { - $errors .= implode("\n", drush_shell_exec_output()); - } - } - else if (preg_match('/^\s+D\s+(.*)/', $line, $matches)) { - $path = $root[0] .'/'. $matches[1]; - if (!drush_shell_exec('bzr remove %s', $path)) { - $errors .= implode("\n", drush_shell_exec_output()); - } - } - } - if (!empty($errors)) { - return drush_set_error('DRUSH_PM_BZR_SYNC_PROBLEMS', dt("Problems were encountered adding or removing files to/from Bazaar.\nThe specific errors are below:\n!errors", array('!errors' => $errors))); - } - } - else { - return drush_set_error('DRUSH_PM_BZR_NOT_FOUND', dt("Drush was unable to get the bzr status. Check that you have Bazaar \ninstalled and that the site is a Bazaar working copy.\nThe specific errors are below:\n!errors", array('!errors' => implode("\n", drush_shell_exec_output())))); - } - return TRUE; - } - } - - /** - * Automatically commit changes to the repository - */ - private function commit($project) { - if (drush_get_option('bzrcommit')) { - $message = drush_get_option('bzrmessage'); - if (empty($message)) { - $message = dt("Drush automatic commit.\nProject: @name @type\nCommand: @arguments", array('@name' => $project['name'], '@type' => $project['project_type'], '@arguments' => implode(' ', $_SERVER['argv']))); - } - if (drush_shell_exec('bzr commit --message=%s %s', $message, $project['full_project_path'])) { - drush_log(dt('Project committed to Bazaar successfully'), LogLevel::OK); - } - else { - drush_set_error('DRUSH_PM_BZR_COMMIT_PROBLEMS', dt("Problems were encountered committing your changes to Bazaar.\nThe specific errors are below:\n!errors", array('!errors' => implode("\n", drush_shell_exec_output())))); - } - } - else { - drush_print(dt("You should consider committing the new code to your Bazaar repository.\nIf this version becomes undesireable, use Bazaar to roll back.")); - } - } - - public static function reserved_files() { - return array('.bzr', '.bzrignore', '.bzrtags'); - } -} diff --git a/vendor/drush/drush/commands/pm/version_control/svn.inc b/vendor/drush/drush/commands/pm/version_control/svn.inc deleted file mode 100644 index 42aafa9a4340ee6b1b8a8a534bc97cf247dcadda..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/pm/version_control/svn.inc +++ /dev/null @@ -1,138 +0,0 @@ -<?php - -/** - * @file - * Drush pm SVN extension - */ - -use Drush\Log\LogLevel; - -class drush_version_control_svn implements drush_version_control { - - /** - * Implementation of pre_update(). - */ - public function pre_update(&$project, $items_to_test = array()) { - // If items to test is empty, test everything; otherwise, pass just - // the list of files to test to svn status. - $args = array_keys($items_to_test); - array_unshift($args, 'svn status '. drush_get_option('svnstatusparams') . str_repeat('%s ', count($args))); - array_unshift($args, $project['full_project_path']); - if (call_user_func_array('drush_shell_cd_and_exec', $args)) { - $output = preg_grep('/^[ ACDMRX?!~][ CM][ L][ +][ SX][ K]/', drush_shell_exec_output()); - if (!empty($output)) { - return drush_set_error('DRUSH_PM_SVN_LOCAL_CHANGES', dt("The SVN working copy at !path appears to have uncommitted changes (see below). Please commit or revert these changes before continuing:\n!output", array('!path' => $project['full_project_path'], '!output' => implode("\n", $output)))); - } - } - else { - return drush_set_error('DRUSH_PM_SVN_NOT_FOUND', dt("Drush was unable to get the svn status on !path.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output())))); - } - - // Check for incoming updates - $args = array_keys($items_to_test); - array_unshift($args, 'svn status -u '. drush_get_option('svnstatusparams') . str_repeat('%s ', count($args))); - array_unshift($args, $project['full_project_path']); - if (call_user_func_array('drush_shell_cd_and_exec', $args)) { - $output = preg_grep('/\*/', drush_shell_exec_output()); - if (!empty($output)) { - return drush_set_error('DRUSH_PM_SVN_REMOTE_CHANGES', dt("The SVN working copy at !path appears to be out of date with the repository (see below). Please run 'svn update' to pull down changes before continuing:\n!output", array('!path' => $project['full_project_path'], '!output' => implode("\n", $output)))); - } - } - else { - return drush_set_error('DRUSH_PM_SVN_NOT_FOUND', dt("Drush was unable to get the svn remote status on !path. Check that you have connectivity to the repository.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output())))); - } - return TRUE; - } - - /** - * Implementation of rollback(). - */ - public function rollback($project) { - if (drush_shell_exec('svn revert '. drush_get_option('svnrevertparams') .' '. $project['full_project_path'])) { - $output = drush_shell_exec_output(); - if (!empty($output)) { - return drush_set_error('DRUSH_PM_SVN_LOCAL_CHANGES', dt("The SVN working copy at !path appears to have uncommitted changes (see below). Please commit or revert these changes before continuing:\n!output", array('!path' => $project['full_project_path'], '!output' => implode("\n", $output)))); - } - } - else { - return drush_set_error('DRUSH_PM_SVN_NOT_FOUND', dt("Drush was unable to get the svn status on !path. Check that you have Subversion \ninstalled and that this directory is a subversion working copy.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output())))); - } - } - - /** - * Implementation of post_update(). - */ - public function post_update($project) { - if ($this->sync($project)) { - // Only attempt commit on a sucessful sync - $this->commit($project); - } - } - - /** - * Implementation of post_download(). - */ - public function post_download($project) { - if ($this->sync($project)) { - // Only attempt commit on a sucessful sync - $this->commit($project); - } - } - - /** - * Automatically add any unversioned files to Subversion and remove any files - * that have been deleted on the file system - */ - private function sync($project) { - if (drush_get_option('svnsync')) { - $errors = ''; - if (drush_shell_exec('svn status '. drush_get_option('svnstatusparams') .' '. $project['full_project_path'])) { - $output = drush_shell_exec_output(); - foreach ($output as $line) { - if (preg_match('/^\? *(.*)/', $line, $matches)) { - if (!drush_shell_exec('svn add '. drush_get_option('svnaddparams') .' '. $matches[1])) { - $errors .= implode("\n", drush_shell_exec_output()); - } - } - if (preg_match('/^\! *(.*)/', $line, $matches)) { - if (!drush_shell_exec('svn remove '. drush_get_option('svnremoveparams') .' '. $matches[1])) { - $errors .= implode("\n", drush_shell_exec_output()); - } - } - } - if (!empty($errors)) { - return drush_set_error('DRUSH_PM_SVN_SYNC_PROBLEMS', dt("Problems were encountered adding or removing files to/from this SVN working copy.\nThe specific errors are below:\n!errors", array('!errors' => $errors))); - } - } - else { - return drush_set_error('DRUSH_PM_SVN_NOT_FOUND', dt("Drush was unable to get the svn status on !path. Check that you have Subversion \ninstalled and that this directory is a subversion working copy.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output())))); - } - return TRUE; - } - } - - /** - * Automatically commit changes to the repository - */ - private function commit($project) { - if (drush_get_option('svncommit')) { - $message = drush_get_option('svnmessage'); - if (empty($message)) { - $message = dt("Drush automatic commit: \n") . implode(' ', $_SERVER['argv']); - } - if (drush_shell_exec('svn commit '. drush_get_option('svncommitparams') .' -m "'. $message .'" '. $project['full_project_path'])) { - drush_log(dt('Project committed to Subversion successfully'), LogLevel::OK); - } - else { - drush_set_error('DRUSH_PM_SVN_COMMIT_PROBLEMS', dt("Problems were encountered committing your changes to Subversion.\nThe specific errors are below:\n!errors", array('!errors' => implode("\n", drush_shell_exec_output())))); - } - } - else { - drush_print(dt("You should consider committing the new code to your Subversion repository.\nIf this version becomes undesireable, use Subversion to roll back.")); - } - } - - public static function reserved_files() { - return array('.svn'); - } -} diff --git a/vendor/drush/drush/commands/runserver/d7-rs-router.php b/vendor/drush/drush/commands/runserver/d7-rs-router.php deleted file mode 100644 index 26095de8b9299e746f7fccef84e3e42e016f21c9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/runserver/d7-rs-router.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -// We hijack filter_init (which core filter module does not implement) as -// a convenient place to affect early changes. -if (!function_exists('filter_init')) { - // Check function_exists as a safety net in case it is added in future. - function filter_init() { - global $conf, $user; - // Inject values into the $conf array - will apply to all sites. - // This can be a useful place to apply generic development settings. - $conf_inject = unserialize(urldecode(runserver_env('RUNSERVER_CONF'))); - // Merge in the injected conf, overriding existing items. - $conf = array_merge($conf, $conf_inject); - } -} - -// We hijack system_watchdog (which core system module does not implement) as -// a convenient place to capture logs. -if (!function_exists('system_watchdog')) { - // Check function_exists as a safety net in case it is added in future. - function system_watchdog($log_entry = array()) { - $uid = $log_entry['user']->uid; - $message = strtr('Watchdog: !message | severity: !severity | type: !type | uid: !uid | !ip | !request_uri | !referer | !link', array( - '!message' => strip_tags(!isset($log_entry['variables']) ? $log_entry['message'] : strtr($log_entry['message'], $log_entry['variables'])), - '!severity' => $log_entry['severity'], - '!type' => $log_entry['type'], - '!ip' => $log_entry['ip'], - '!request_uri' => $log_entry['request_uri'], - '!referer' => $log_entry['referer'], - '!uid' => $uid, - '!link' => strip_tags($log_entry['link']), - )); - error_log($message); - } -} - -// Get a $_SERVER key, or equivalent environment variable -// if it is not set in $_SERVER. -function runserver_env($key) { - if (isset($_SERVER[$key])) { - return $_SERVER[$key]; - } - else { - return getenv($key); - } -} - -$url = parse_url($_SERVER["REQUEST_URI"]); -if (file_exists('.' . urldecode($url['path']))) { - // Serve the requested resource as-is. - return FALSE; -} - -// Populate the "q" query key with the path, skip the leading slash. -$_GET['q'] = $_REQUEST['q'] = substr($url['path'], 1); - -// We set the base_url so that Drupal generates correct URLs for runserver -// (e.g. http://127.0.0.1:8888/...), but can still select and serve a specific -// site in a multisite configuration (e.g. http://mysite.com/...). -$base_url = runserver_env('RUNSERVER_BASE_URL'); - -// The built in webserver incorrectly sets $_SERVER['SCRIPT_NAME'] when URLs -// contain multiple dots (such as config entity IDs) in the path. Since this is -// a virtual resource, served by index.php set the script name explicitly. -// See https://github.com/drush-ops/drush/issues/2033 for more information. -$_SERVER['SCRIPT_NAME'] = '/index.php'; - -// Include the main index.php and let Drupal take over. -// n.b. Drush sets the cwd to the Drupal root during bootstrap. -include 'index.php'; diff --git a/vendor/drush/drush/commands/runserver/d8-rs-router.php b/vendor/drush/drush/commands/runserver/d8-rs-router.php deleted file mode 100644 index dc47a9a52e3d850b9974fc2463a911610a4a7944..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/runserver/d8-rs-router.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php - -// We hijack filter_init (which core filter module does not implement) as -// a convenient place to affect early changes. -if (!function_exists('filter_init')) { - // Check function_exists as a safety net in case it is added in future. - function filter_init() { - global $conf, $user; - // Inject values into the $conf array - will apply to all sites. - // This can be a useful place to apply generic development settings. - $conf_inject = unserialize(urldecode(runserver_env('RUNSERVER_CONF'))); - // Merge in the injected conf, overriding existing items. - $conf = array_merge($conf, $conf_inject); - } -} - -// We hijack system_watchdog (which core system module does not implement) as -// a convenient place to capture logs. -if (!function_exists('system_watchdog')) { - // Check function_exists as a safety net in case it is added in future. - function system_watchdog($log_entry = array()) { - $uid = $log_entry['user']->id(); - $message = strtr('Watchdog: !message | severity: !severity | type: !type | uid: !uid | !ip | !request_uri | !referer | !link', array( - '!message' => strip_tags(!isset($log_entry['variables']) ? $log_entry['message'] : strtr($log_entry['message'], $log_entry['variables'])), - '!severity' => $log_entry['severity'], - '!type' => $log_entry['type'], - '!ip' => $log_entry['ip'], - '!request_uri' => $log_entry['request_uri'], - '!referer' => $log_entry['referer'], - '!uid' => $uid, - '!link' => strip_tags($log_entry['link']), - )); - error_log($message); - } -} - -// Get a $_SERVER key, or equivalent environment variable -// if it is not set in $_SERVER. -function runserver_env($key) { - if (isset($_SERVER[$key])) { - return $_SERVER[$key]; - } - else { - return getenv($key); - } -} - -$url = parse_url($_SERVER["REQUEST_URI"]); -if (file_exists('.' . urldecode($url['path']))) { - // Serve the requested resource as-is. - return FALSE; -} - -// We set the base_url so that Drupal generates correct URLs for runserver -// (e.g. http://127.0.0.1:8888/...), but can still select and serve a specific -// site in a multisite configuration (e.g. http://mysite.com/...). -$base_url = runserver_env('RUNSERVER_BASE_URL'); - -// The built in webserver incorrectly sets $_SERVER['SCRIPT_NAME'] when URLs -// contain multiple dots (such as config entity IDs) in the path. Since this is -// a virtual resource, served by index.php set the script name explicitly. -// See https://github.com/drush-ops/drush/issues/2033 for more information. -// Work around the PHP bug. Update $_SERVER variables to point to the correct -// index-file. -$path = $url['path']; -$script = 'index.php'; -if (strpos($path, '.php') !== FALSE) { - // Work backwards through the path to check if a script exists. Otherwise - // fallback to index.php. - do { - $path = dirname($path); - if (preg_match('/\.php$/', $path) && is_file('.' . $path)) { - // Discovered that the path contains an existing PHP file. Use that as the - // script to include. - $script = ltrim($path, '/'); - break; - } - } while ($path !== '/' && $path !== '.'); -} - -// Update $_SERVER variables to point to the correct index-file. -$index_file_absolute = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $script; -$index_file_relative = DIRECTORY_SEPARATOR . $script; - -// SCRIPT_FILENAME will point to the router script itself, it should point to -// the full path of index.php. -$_SERVER['SCRIPT_FILENAME'] = $index_file_absolute; - -// SCRIPT_NAME and PHP_SELF will either point to index.php or contain the full -// virtual path being requested depending on the URL being requested. They -// should always point to index.php relative to document root. -$_SERVER['SCRIPT_NAME'] = $index_file_relative; -$_SERVER['PHP_SELF'] = $index_file_relative; - -// Require the script and let core take over. -require $_SERVER['SCRIPT_FILENAME']; \ No newline at end of file diff --git a/vendor/drush/drush/commands/runserver/runserver-prepend.php b/vendor/drush/drush/commands/runserver/runserver-prepend.php deleted file mode 100644 index 48802ee23267a01eac8cbfe6d72f1a6e434c0348..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/runserver/runserver-prepend.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -// We set the base_url so that Drupal generates correct URLs for runserver -// (e.g. http://127.0.0.1:8888/...), but can still select and serve a specific -// site in a multisite configuration (e.g. http://mysite.com/...). -$base_url = runserver_env('RUNSERVER_BASE_URL'); - -// Complete $_GET['q'] for Drupal 6 with built in server -// - this uses the Drupal 7 method. -if (!isset($_GET['q']) && isset($_SERVER['REQUEST_URI'])) { - // This request is either a clean URL, or 'index.php', or nonsense. - // Extract the path from REQUEST_URI. - $request_path = strtok($_SERVER['REQUEST_URI'], '?'); - $base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/')); - // Unescape and strip $base_path prefix, leaving q without a leading slash. - $_GET['q'] = substr(urldecode($request_path), $base_path_len + 1); -} - -// We hijack filter_init (which core filter module does not implement) as -// a convenient place to affect early changes. -if (!function_exists('filter_init')) { - // Check function_exists as a safety net in case it is added in future. - function filter_init() { - global $conf, $user; - // Inject values into the $conf array - will apply to all sites. - // This can be a useful place to apply generic development settings. - $conf_inject = unserialize(urldecode(runserver_env('RUNSERVER_CONF'))); - // Merge in the injected conf, overriding existing items. - $conf = array_merge($conf, $conf_inject); - } -} - -// We hijack system_watchdog (which core system module does not implement) as -// a convenient place to capture logs. -if (!function_exists('system_watchdog')) { - // Check function_exists as a safety net in case it is added in future. - function system_watchdog($log_entry = array()) { - // Drupal <= 7.x defines VERSION. Drupal 8 defines \Drupal::VERSION instead. - if (defined('VERSION')) { - $uid = $log_entry['user']->uid; - } - else { - $uid = $log_entry['user']->id(); - } - $message = strtr('Watchdog: !message | severity: !severity | type: !type | uid: !uid | !ip | !request_uri | !referer | !link', array( - '!message' => strip_tags(!isset($log_entry['variables']) ? $log_entry['message'] : strtr($log_entry['message'], $log_entry['variables'])), - '!severity' => $log_entry['severity'], - '!type' => $log_entry['type'], - '!ip' => $log_entry['ip'], - '!request_uri' => $log_entry['request_uri'], - '!referer' => $log_entry['referer'], - '!uid' => $uid, - '!link' => strip_tags($log_entry['link']), - )); - error_log($message); - } -} - -// Get a $_SERVER key, or equivalent environment variable -// if it is not set in $_SERVER. -function runserver_env($key) { - if (isset($_SERVER[$key])) { - return $_SERVER[$key]; - } - else { - return getenv($key); - } -} diff --git a/vendor/drush/drush/commands/runserver/runserver.drush.inc b/vendor/drush/drush/commands/runserver/runserver.drush.inc deleted file mode 100644 index 13103f2acbb9eecb8255ec98e1de5796b0522a0f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/runserver/runserver.drush.inc +++ /dev/null @@ -1,220 +0,0 @@ -<?php - -/** - * @file - * Built in http server commands. - */ - -/** - * Implements hook_drush_help(). - */ -function runserver_drush_help($section) { - switch ($section) { - case 'meta:runserver:title': - return dt("Runserver commands"); - case 'meta:runserver:summary': - return dt('Launch the built-in PHP webserver.'); - case 'drush:runserver': - return dt("Runs a lightweight built in http server for development. - - Don't use this for production, it is neither scalable nor secure for this use. - - If you run multiple servers simultaneously, you will need to assign each a unique port. - - Use Ctrl-C or equivalent to stop the server when complete."); - } -} - -/** - * Implements hook_drush_command(). - */ -function runserver_drush_command() { - $items = array(); - - $items['runserver'] = array( - 'description' => 'Runs PHP\'s built-in http server for development.', - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - 'arguments' => array( - 'addr:port/path' => 'Host IP address and port number to bind to and path to open in web browser. Format is addr:port/path, default 127.0.0.1:8888, all elements optional. See examples for shorthand. Only opens a browser if a path is specified.', - ), - 'options' => array( - 'variables' => 'Key-value array of variables to override in the $conf array for the running site. By default disables drupal_http_request_fails to avoid errors on Windows (which supports only one connection at a time). Comma delimited list of name=value pairs (or array in drushrc).', - 'default-server' => 'A default addr:port/path to use for any values not specified as an argument.', - 'user' => 'If opening a web browser, automatically log in as this user (user ID or username). Default is to log in as uid 1.', - 'browser' => 'If opening a web browser, which browser to user (defaults to operating system default). Use --no-browser to avoid opening a browser.', - 'dns' => 'Resolve hostnames/IPs using DNS/rDNS (if possible) to determine binding IPs and/or human friendly hostnames for URLs and browser.', - ), - 'aliases' => array('rs'), - 'examples' => array( - 'drush rs 8080' => 'Start runserver on 127.0.0.1, port 8080.', - 'drush rs 10.0.0.28:80' => 'Start runserver on 10.0.0.28, port 80.', - 'drush rs [::1]:80' => 'Start runserver on IPv6 localhost ::1, port 80.', - 'drush rs --dns localhost:8888/user' => 'Start runserver on localhost (using rDNS to determine binding IP), port 8888, and open /user in browser.', - 'drush rs /' => 'Start runserver on default IP/port (127.0.0.1, port 8888), and open / in browser.', - 'drush rs --default-server=127.0.0.1:8080/ -' => 'Use a default (would be specified in your drushrc) that starts runserver on port 8080, and opens a browser to the front page. Set path to a single hyphen path in argument to prevent opening browser for this session.', - 'drush rs :9000/admin' => 'Start runserver on 127.0.0.1, port 9000, and open /admin in browser. Note that you need a colon when you specify port and path, but no IP.', - ), - ); - return $items; -} - -/** - * Callback for runserver command. - */ -function drush_core_runserver($uri = NULL) { - global $user, $base_url; - - // Determine active configuration. - $uri = runserver_uri($uri); - if (!$uri) { - return FALSE; - } - - // Remove any leading slashes from the path, since that is what url() expects. - $path = ltrim($uri['path'], '/'); - - // $uri['addr'] is a special field set by runserver_uri() - $hostname = $uri['host']; - $addr = $uri['addr']; - - drush_set_context('DRUSH_URI', 'http://' . $hostname . ':' . $uri['port']); - - // We pass in the currently logged in user (if set via the --user option), - // which will automatically log this user in the browser during the first - // request. - if (drush_get_option('user', FALSE) === FALSE) { - drush_set_option('user', 1); - } - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_LOGIN); - - // We delete any registered files here, since they are not caught by Ctrl-C. - _drush_delete_registered_files(); - - // We set the effective base_url, since we have now detected the current site, - // and need to ensure generated URLs point to our runserver host. - // We also pass in the effective base_url to our auto_prepend_script via the - // CGI environment. This allows Drupal to generate working URLs to this http - // server, whilst finding the correct multisite from the HTTP_HOST header. - $base_url = 'http://' . $addr . ':' . $uri['port']; - $env['RUNSERVER_BASE_URL'] = $base_url; - - // We pass in an array of $conf overrides using the same approach. - // This is available as an option for developers to pass in their own - // favorite $conf overrides (e.g. disabling css aggregation). - $current_override = drush_get_option_list('variables', array()); - $override = array(); - foreach ($current_override as $name => $value) { - if (is_numeric($name) && (strpos($value, '=') !== FALSE)) { - list($name, $value) = explode('=', $value, 2); - } - $override[$name] = $value; - } - $env['RUNSERVER_CONF'] = urlencode(serialize($override)); - - // We log in with the specified user ID (if set) via the password reset URL. - $user_message = ''; - $usersingle = drush_user_get_class()->getCurrentUserAsSingle(); - if ($usersingle->id()) { - $browse = $usersingle->passResetUrl($path); - $user_message = ', logged in as ' . $usersingle->getUsername(); - } - else { - $browse = drush_url($path); - } - - drush_print(dt('HTTP server listening on !addr, port !port (see http://!hostname:!port/!path), serving site !site!user...', array('!addr' => $addr, '!hostname' => $hostname, '!port' => $uri['port'], '!path' => $path, '!site' => drush_get_context('DRUSH_DRUPAL_SITE', 'default'), '!user' => $user_message))); - // Start php 5.4 builtin server. - // Store data used by runserver-prepend.php in the shell environment. - foreach ($env as $key => $value) { - putenv($key . '=' . $value); - } - if (!empty($uri['path'])) { - // Start a browser if desired. Include a 2 second delay to allow the - // server to come up. - drush_start_browser($browse, 2); - } - // Start the server using 'php -S'. - if (drush_drupal_major_version() >= 8) { - $extra = ' "' . __DIR__ . '/d8-rs-router.php"'; - } - elseif (drush_drupal_major_version() == 7) { - $extra = ' "' . __DIR__ . '/d7-rs-router.php"'; - } - else { - $extra = ' --define auto_prepend_file="' . __DIR__ . '/runserver-prepend.php"'; - } - $root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - drush_shell_exec_interactive('cd %s && %s -S ' . $addr . ':' . $uri['port']. $extra, $root, drush_get_option('php', 'php')); -} - -/** - * Determine the URI to use for this server. - */ -function runserver_uri($uri) { - $drush_default = array( - 'host' => '127.0.0.1', - 'port' => '8888', - 'path' => '', - ); - $user_default = runserver_parse_uri(drush_get_option('default-server', '')); - $site_default = runserver_parse_uri(drush_get_option('uri', '')); - $uri = runserver_parse_uri($uri); - if (is_array($uri)) { - // Populate defaults. - $uri = $uri + $user_default + $site_default + $drush_default; - if (ltrim($uri['path'], '/') == '-') { - // Allow a path of a single hyphen to clear a default path. - $uri['path'] = ''; - } - // Determine and set the new URI. - $uri['addr'] = $uri['host']; - if (drush_get_option('dns', FALSE)) { - if (ip2long($uri['host'])) { - $uri['host'] = gethostbyaddr($uri['host']); - } - else { - $uri['addr'] = gethostbyname($uri['host']); - } - } - } - return $uri; -} - -/** - * Parse a URI or partial URI (including just a port, host IP or path). - * - * @param string $uri - * String that can contain partial URI. - * - * @return array - * URI array as returned by parse_url. - */ -function runserver_parse_uri($uri) { - if (empty($uri)) { - return array(); - } - if ($uri[0] == ':') { - // ':port/path' shorthand, insert a placeholder hostname to allow parsing. - $uri = 'placeholder-hostname' . $uri; - } - // FILTER_VALIDATE_IP expects '[' and ']' to be removed from IPv6 addresses. - // We check for colon from the right, since IPv6 addresses contain colons. - $to_path = trim(substr($uri, 0, strpos($uri, '/')), '[]'); - $to_port = trim(substr($uri, 0, strrpos($uri, ':')), '[]'); - if (filter_var(trim($uri, '[]'), FILTER_VALIDATE_IP) || filter_var($to_path, FILTER_VALIDATE_IP) || filter_var($to_port, FILTER_VALIDATE_IP)) { - // 'IP', 'IP/path' or 'IP:port' shorthand, insert a schema to allow parsing. - $uri = 'http://' . $uri; - } - $uri = parse_url($uri); - if (empty($uri)) { - return drush_set_error('RUNSERVER_INVALID_ADDRPORT', dt('Invalid argument - should be in the "host:port/path" format, numeric (port only) or non-numeric (path only).')); - } - if (count($uri) == 1 && isset($uri['path'])) { - if (is_numeric($uri['path'])) { - // Port only shorthand. - $uri['port'] = $uri['path']; - unset($uri['path']); - } - } - if (isset($uri['host']) && $uri['host'] == 'placeholder-hostname') { - unset($uri['host']); - } - return $uri; -} diff --git a/vendor/drush/drush/commands/sql/sql.drush.inc b/vendor/drush/drush/commands/sql/sql.drush.inc deleted file mode 100644 index 7f59f5d4db9b1478ff491c75541af72945f07275..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/sql/sql.drush.inc +++ /dev/null @@ -1,662 +0,0 @@ -<?php - -/** - * @file - * Drush sql commands - */ - -/** - * Implementation of hook_drush_help(). - */ -function sql_drush_help($section) { - switch ($section) { - case 'meta:sql:title': - return dt('SQL commands'); - case 'meta:sql:summary': - return dt('Examine and modify your Drupal database.'); - case 'drush:sql-sanitize': - return dt('Run sanitization operations on the current database. You can add more sanitization to this command by implementing hook_drush_sql_sync_sanitize().'); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function sql_drush_command() { - $options['database'] = array( - 'description' => 'The DB connection key if using multiple connections in settings.php.', - 'example-value' => 'key', - ); - $db_url['db-url'] = array( - 'description' => 'A Drupal 6 style database URL.', - 'example-value' => 'mysql://root:pass@127.0.0.1/db', - ); - $options['target'] = array( - 'description' => 'The name of a target within the specified database connection. Defaults to \'default\'.', - 'example-value' => 'key', - // Gets unhidden in help_alter(). We only want to show this to D7 users but have to - // declare it here since some commands do not bootstrap fully. - 'hidden' => TRUE, - ); - - $items['sql-drop'] = array( - 'description' => 'Drop all tables in a given database.', - 'arguments' => array( - ), - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'options' => array( - 'yes' => 'Skip confirmation and proceed.', - 'result-file' => array( - 'description' => 'Save to a file. The file should be relative to Drupal root. Recommended.', - 'example-value' => '/path/to/file', - ), - ) + $options + $db_url, - 'topics' => array('docs-policy'), - 'aliases' => array('sql:drop'), - ); - $items['sql-conf'] = array( - 'description' => 'Print database connection details using print_r().', - 'hidden' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'options' => array( - 'all' => 'Show all database connections, instead of just one.', - 'show-passwords' => 'Show database password.', - ) + $options, - 'outputformat' => array( - 'default' => 'print-r', - 'pipe-format' => 'var_export', - 'private-fields' => 'password', - ), - 'aliases' => array('sql:conf'), - ); - $items['sql-connect'] = array( - 'description' => 'A string for connecting to the DB.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'options' => $options + $db_url + array( - 'extra' => array( - 'description' => 'Add custom options to the connect string.', - 'example-value' => '--skip-column-names', - ), - ), - 'examples' => array( - '`drush sql-connect` < example.sql' => 'Bash: Import SQL statements from a file into the current database.', - 'eval (drush sql-connect) < example.sql' => 'Fish: Import SQL statements from a file into the current database.', - ), - 'aliases' => array('sql:connect'), - ); - $items['sql-create'] = array( - 'description' => 'Create a database.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'examples' => array( - 'drush sql-create' => 'Create the database for the current site.', - 'drush @site.test sql-create' => 'Create the database as specified for @site.test.', - 'drush sql-create --db-su=root --db-su-pw=rootpassword --db-url="mysql://drupal_db_user:drupal_db_password@127.0.0.1/drupal_db"' => - 'Create the database as specified in the db-url option.' - ), - 'options' => array( - 'db-su' => 'Account to use when creating a new database. Optional.', - 'db-su-pw' => 'Password for the "db-su" account. Optional.', - ) + $options + $db_url, - 'aliases' => array('sql:create'), - ); - $items['sql-dump'] = array( - 'description' => 'Exports the Drupal DB as SQL using mysqldump or equivalent.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'examples' => array( - 'drush sql-dump --result-file=../18.sql' => 'Save SQL dump to the directory above Drupal root.', - 'drush sql-dump --skip-tables-key=common' => 'Skip standard tables. @see example.drushrc.php', - 'drush sql-dump --extra=--no-data' => 'Pass extra option to dump command.', - ), - 'options' => drush_sql_get_table_selection_options() + array( - 'result-file' => array( - 'description' => 'Save to a file. The file should be relative to Drupal root. If --result-file is provided with no value, then date based filename will be created under ~/drush-backups directory.', - 'example-value' => '/path/to/file', - 'value' => 'optional', - ), - 'create-db' => array('hidden' => TRUE, 'description' => 'Omit DROP TABLE statements. Postgres and Oracle only. Used by sql-sync, since including the DROP TABLE statements interfere with the import when the database is created.'), - 'data-only' => 'Dump data without statements to create any of the schema.', - 'ordered-dump' => 'Order by primary key and add line breaks for efficient diff in revision control. Slows down the dump. Mysql only.', - 'gzip' => 'Compress the dump using the gzip program which must be in your $PATH.', - 'extra' => 'Add custom options to the dump command.', - ) + $options + $db_url, - 'aliases' => array('sql:dump'), - ); - $items['sql-query'] = array( - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'description' => 'Execute a query against a database.', - 'examples' => array( - 'drush sql-query "SELECT * FROM users WHERE uid=1"' => 'Browse user record. Table prefixes, if used, must be added to table names by hand.', - 'drush sql-query --db-prefix "SELECT * FROM {users} WHERE uid=1"' => 'Browse user record. Table prefixes are honored. Caution: curly-braces will be stripped from all portions of the query.', - '`drush sql-connect` < example.sql' => 'Import sql statements from a file into the current database.', - 'drush sql-query --file=example.sql' => 'Alternate way to import sql statements from a file.', - ), - 'arguments' => array( - 'query' => 'An SQL query. Ignored if \'file\' is provided.', - ), - 'options' => array( - 'result-file' => array( - 'description' => 'Save to a file. The file should be relative to Drupal root. Optional.', - 'example-value' => '/path/to/file', - ), - 'file' => 'Path to a file containing the SQL to be run. Gzip files are accepted.', - 'extra' => array( - 'description' => 'Add custom options to the database connection command.', - 'example-value' => '--skip-column-names', - ), - 'db-prefix' => 'Enable replacement of braces in your query.', - 'db-spec' => array( - 'description' => 'A database specification', - 'hidden' => TRUE, // Hide since this is only used with --backend calls. - ) - ) + $options + $db_url, - 'aliases' => array('sqlq', 'sql:query'), - ); - $items['sql-cli'] = array( - 'description' => "Open a SQL command-line interface using Drupal's credentials.", - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - // 'options' => $options + $db_url, - 'allow-additional-options' => array('sql-connect'), - 'aliases' => array('sqlc', 'sql:cli'), - 'examples' => array( - 'drush sql-cli' => "Open a SQL command-line interface using Drupal's credentials.", - 'drush sql-cli --extra=-A' => "Open a SQL CLI and skip reading table information.", - ), - 'remote-tty' => TRUE, - ); - return $items; -} - -/** - * Implements hook_drush_help_alter(). - */ -function sql_drush_help_alter(&$command) { - // Drupal 7+ only options. - if (drush_drupal_major_version() >= 7) { - if ($command['commandfile'] == 'sql') { - unset($command['options']['target']['hidden']); - } - } -} - -/** - * Safely bootstrap Drupal to the point where we can - * access the database configuration. - */ -function drush_sql_bootstrap_database_configuration() { - // Under Drupal 7, if the database is configured but empty, then - // DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION will throw an exception. - // If this happens, we'll just catch it and continue. - // TODO: Fix this in the bootstrap, per http://drupal.org/node/1996004 - try { - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION); - } - catch (Exception $e) { - } -} - -/** - * Check whether further bootstrap is needed. If so, do it. - */ -function drush_sql_bootstrap_further() { - if (!drush_get_option(array('db-url', 'db-spec'))) { - drush_sql_bootstrap_database_configuration(); - } -} - -/** - * Command callback. Displays the Drupal site's database connection string. - */ -function drush_sql_conf() { - drush_sql_bootstrap_database_configuration(); - if (drush_get_option('all')) { - $sqlVersion = drush_sql_get_version(); - return $sqlVersion->getAll(); - } - else { - $sql = drush_sql_get_class(); - return $sql->db_spec(); - } -} - -/** - * Command callback. Emits a connect string. - */ -function drush_sql_connect() { - drush_sql_bootstrap_further(); - $sql = drush_sql_get_class(); - return $sql->connect(FALSE); -} - -/** - * Command callback. Create a database. - */ -function drush_sql_create() { - drush_sql_bootstrap_further(); - $sql = drush_sql_get_class(); - $db_spec = $sql->db_spec(); - // Prompt for confirmation. - if (!drush_get_context('DRUSH_SIMULATE')) { - // @todo odd - maybe for sql-sync. - $txt_destination = (isset($db_spec['remote-host']) ? $db_spec['remote-host'] . '/' : '') . $db_spec['database']; - drush_print(dt("Creating database !target. Any possible existing database will be dropped!", array('!target' => $txt_destination))); - - if (!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - } - - $result = $sql->createdb(TRUE); - if (!$result) { - drush_set_error('DRUSH_SQL_CREATE_ERROR', dt('SQL create database error occurred.')); - } - return $result; -} - - -/** - * Command callback. Outputs the entire Drupal database in SQL format using mysqldump or equivalent. - */ -function drush_sql_dump() { - drush_sql_bootstrap_further(); - $sql = drush_sql_get_class(); - return $sql->dump(drush_get_option('result-file', FALSE)); -} - -/** - * Construct an array that places table names in appropriate - * buckets based on whether the table is to be skipped, included - * for structure only, or have structure and data dumped. - * The keys of the array are: - * - skip: tables to be skipped completed in the dump - * - structure: tables to only have their structure i.e. DDL dumped - * - tables: tables to have structure and data dumped - * - * @return array - * An array of table names with each table name in the appropriate - * element of the array. - */ -function drush_sql_get_table_selection() { - // Skip large core tables if instructed. Used by 'sql-drop/sql-dump/sql-sync' commands. - $skip_tables = _drush_sql_get_raw_table_list('skip-tables'); - // Skip any structure-tables as well. - $structure_tables = _drush_sql_get_raw_table_list('structure-tables'); - // Dump only the specified tables. Takes precedence over skip-tables and structure-tables. - $tables = _drush_sql_get_raw_table_list('tables'); - - return array('skip' => $skip_tables, 'structure' => $structure_tables, 'tables' => $tables); -} - -function drush_sql_get_table_selection_options() { - return array( - 'skip-tables-key' => 'A key in the $skip_tables array. @see example.drushrc.php. Optional.', - 'structure-tables-key' => 'A key in the $structure_tables array. @see example.drushrc.php. Optional.', - 'tables-key' => 'A key in the $tables array. Optional.', - 'skip-tables-list' => 'A comma-separated list of tables to exclude completely. Optional.', - 'structure-tables-list' => 'A comma-separated list of tables to include for structure, but not data. Optional.', - 'tables-list' => 'A comma-separated list of tables to transfer. Optional.', - ); -} - -/** - * Expand wildcard tables. - * - * @param array $tables - * An array of table names, some of which may contain wildcards (`*`). - * @param array $db_tables - * An array with all the existing table names in the current database. - * @return - * $tables array with wildcards resolved to real table names. - */ -function drush_sql_expand_wildcard_tables($tables, $db_tables) { - // Table name expansion based on `*` wildcard. - $expanded_db_tables = array(); - foreach ($tables as $k => $table) { - // Only deal with table names containing a wildcard. - if (strpos($table, '*') !== FALSE) { - $pattern = '/^' . str_replace('*', '.*', $table) . '$/i'; - // Merge those existing tables which match the pattern with the rest of - // the expanded table names. - $expanded_db_tables += preg_grep($pattern, $db_tables); - } - } - return $expanded_db_tables; -} - -/** - * Filters tables. - * - * @param array $tables - * An array of table names to filter. - * @param array $db_tables - * An array with all the existing table names in the current database. - * @return - * An array with only valid table names (i.e. all of which actually exist in - * the database). - */ -function drush_sql_filter_tables($tables, $db_tables) { - // Ensure all the tables actually exist in the database. - foreach ($tables as $k => $table) { - if (!in_array($table, $db_tables)) { - unset($tables[$k]); - } - } - - return $tables; -} - -/** - * Given the table names in the input array that may contain wildcards (`*`), - * expand the table names so that the array returned only contains table names - * that exist in the database. - * - * @param array $tables - * An array of table names where the table names may contain the - * `*` wildcard character. - * @param array $db_tables - * The list of tables present in a database. - * @return array - * An array of tables with non-existant tables removed. - */ -function _drush_sql_expand_and_filter_tables($tables, $db_tables) { - $expanded_tables = drush_sql_expand_wildcard_tables($tables, $db_tables); - $tables = drush_sql_filter_tables(array_merge($tables, $expanded_tables), $db_tables); - $tables = array_unique($tables); - sort($tables); - return $tables; -} - -/** - * Consult the specified options and return the list of tables - * specified. - * - * @param option_name - * The option name to check: skip-tables, structure-tables - * or tables. This function will check both *-key and *-list, - * and, in the case of sql-sync, will also check target-* - * and source-*, to see if an alias set one of these options. - * @returns array - * Returns an array of tables based on the first option - * found, or an empty array if there were no matches. - */ -function _drush_sql_get_raw_table_list($option_name) { - foreach(array('' => 'cli', 'target-,,source-' => NULL) as $prefix_list => $context) { - foreach(explode(',',$prefix_list) as $prefix) { - $key_list = drush_get_option($prefix . $option_name . '-key', NULL, $context); - foreach(explode(',', $key_list) as $key) { - $all_tables = drush_get_option($option_name, array()); - if (array_key_exists($key, $all_tables)) { - return $all_tables[$key]; - } - if ($option_name != 'tables') { - $all_tables = drush_get_option('tables', array()); - if (array_key_exists($key, $all_tables)) { - return $all_tables[$key]; - } - } - } - $table_list = drush_get_option($prefix . $option_name . '-list', NULL, $context); - if (isset($table_list)) { - return empty($table_list) ? array() : explode(',', $table_list); - } - } - } - - return array(); -} - -/** - * Command callback. Executes the given SQL query on the Drupal database. - */ -function drush_sql_query($query = NULL) { - drush_sql_bootstrap_further(); - $filename = drush_get_option('file', NULL); - // Enable prefix processing when db-prefix option is used. - if (drush_get_option('db-prefix')) { - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_DATABASE); - } - if (drush_get_context('DRUSH_SIMULATE')) { - if ($query) { - drush_print(dt('Simulating sql-query: !q', array('!q' => $query))); - } - else { - drush_print(dt('Simulating sql-import from !f', array('!f' => drush_get_option('file')))); - } - } - else { - $sql = drush_sql_get_class(drush_get_option('db-spec')); - $result = $sql->query($query, $filename, drush_get_option('result-file')); - if (!$result) { - return drush_set_error('DRUSH_SQL_NO_QUERY', dt('Query failed.')); - } - drush_print(implode("\n", drush_shell_exec_output())); - } - return TRUE; -} - -/** - * Command callback. Drops all tables in the database. - */ -function drush_sql_drop() { - drush_sql_bootstrap_further(); - $sql = drush_sql_get_class(); - $db_spec = $sql->db_spec(); - if (!drush_confirm(dt('Do you really want to drop all tables in the database !db?', array('!db' => $db_spec['database'])))) { - return drush_user_abort(); - } - $tables = $sql->listTables(); - return $sql->drop($tables); -} - -/** - * Command callback. Launches console a DB backend. - */ -function drush_sql_cli() { - drush_sql_bootstrap_further(); - $sql = drush_sql_get_class(); - $result = !drush_shell_proc_open($sql->connect()); - if (!$result) { - drush_set_error('DRUSH_SQL_CLI_ERROR', dt('SQL client error occurred.')); - } - return $result; -} - -/** - * Call from a pre-sql-sync hook to register an sql - * query to be executed in the post-sql-sync hook. - * @see drush_sql_pre_sql_sync() and @see drush_sql_post_sql_sync(). - * - * @param $id - * String containing an identifier representing this - * operation. This id is not actually used at the - * moment, it is just used to fufill the contract - * of drush contexts. - * @param $message - * String with the confirmation message that describes - * to the user what the post-sync operation is going - * to do. This confirmation message is printed out - * just before the user is asked whether or not the - * sql-sync operation should be continued. - * @param $query - * String containing the sql query to execute. If no - * query is provided, then the confirmation message will - * be displayed to the user, but no action will be taken - * in the post-sync hook. This is useful for drush modules - * that wish to provide their own post-sync hooks to fix - * up the target database in other ways (e.g. through - * Drupal APIs). - */ -function drush_sql_register_post_sync_op($id, $message, $query = NULL) { - $options = drush_get_context('post-sync-ops'); - - $options[$id] = array('message' => $message, 'query' => $query); - - drush_set_context('post-sync-ops', $options); -} - -/** - * Builds a confirmation message for all post-sync operations. - * - * @return string - * All post-sync operation messages concatenated together. - */ -function _drush_sql_get_post_sync_messages() { - $messages = ''; - $operations = drush_get_context('post-sync-ops'); - if (!empty($operations)) { - $messages = dt('The following operations will be done on the target database:') . "\n"; - - $bullets = array_column($operations, 'message'); - $messages .= " * " . implode("\n * ", $bullets) . "\n"; - } - return $messages; -} - -/** - * Wrapper for drush_get_class; instantiates an driver-specific instance - * of SqlBase class. - * - * @param array $db_spec - * If known, specify a $db_spec that the class can operate with. - * - * @throws \Drush\Sql\SqlException - * - * @return Drush\Sql\SqlBase - */ -function drush_sql_get_class($db_spec = NULL) { - $database = drush_get_option('database', 'default'); - $target = drush_get_option('target', 'default'); - - // Try a few times to quickly get $db_spec. - if (!empty($db_spec)) { - if (!empty($db_spec['driver'])) { - return drush_get_class(array('Drush\Sql\Sql', 'Drupal\Driver\Database\\' . $db_spec['driver'] . '\Drush'), array($db_spec), array($db_spec['driver'])); - } - } - elseif ($url = drush_get_option('db-url')) { - $url = is_array($url) ? $url[$database] : $url; - $db_spec = drush_convert_db_from_db_url($url); - $db_spec['db_prefix'] = drush_get_option('db-prefix'); - return drush_sql_get_class($db_spec); - } - elseif (($databases = drush_get_option('databases')) && (array_key_exists($database, $databases)) && (array_key_exists($target, $databases[$database]))) { - $db_spec = $databases[$database][$target]; - return drush_sql_get_class($db_spec); - } - else { - // No parameter or options provided. Determine $db_spec ourselves. - if ($sqlVersion = drush_sql_get_version()) { - if ($db_spec = $sqlVersion->get_db_spec()) { - return drush_sql_get_class($db_spec); - } - } - } - - throw new \Drush\Sql\SqlException('Unable to find a matching SQL Class. Drush cannot find your database connection details.'); -} - -/** - * Wrapper for drush_get_class; instantiates a Drupal version-specific instance - * of SqlVersion class. - * - * @return Drush\Sql\SqlVersion - */ -function drush_sql_get_version() { - return drush_get_class('Drush\Sql\Sql', array(), array(drush_drupal_major_version())) ?: NULL; -} - -/** - * Implements hook_drush_sql_sync_sanitize(). - * - * Sanitize usernames, passwords, and sessions when the --sanitize option is used. - * It is also an example of how to write a database sanitizer for sql sync. - * - * To write your own sync hook function, define mymodule_drush_sql_sync_sanitize() - * in mymodule.drush.inc and follow the form of this function to add your own - * database sanitization operations via the register post-sync op function; - * @see drush_sql_register_post_sync_op(). This is the only thing that the - * sync hook function needs to do; sql-sync takes care of the rest. - * - * The function below has a lot of logic to process user preferences and - * generate the correct SQL regardless of whether Postgres, Mysql, - * Drupal 6/7/8 is in use. A simpler sanitize function that - * always used default values and only worked with Drupal 6 + mysql - * appears in the drush.api.php. @see hook_drush_sql_sync_sanitize(). - */ -function sql_drush_sql_sync_sanitize($site) { - $site_settings = drush_sitealias_get_record($site); - $databases = sitealias_get_databases_from_record($site_settings); - $major_version = drush_drupal_major_version(); - $wrap_table_name = (bool) drush_get_option('db-prefix'); - $user_table_updates = array(); - $message_list = array(); - - // Sanitize passwords. - $newpassword = drush_get_option(array('sanitize-password', 'destination-sanitize-password'), drush_generate_password()); - if ($newpassword != 'no' && $newpassword !== 0) { - $pw_op = ""; - - // In Drupal 6, passwords are hashed via the MD5 algorithm. - if ($major_version == 6) { - $pw_op = "MD5('$newpassword')"; - } - // In Drupal 7, passwords are hashed via a more complex algorithm, - // available via the user_hash_password function. - elseif ($major_version == 7) { - $core = DRUSH_DRUPAL_CORE; - include_once $core . '/includes/password.inc'; - include_once $core . '/includes/bootstrap.inc'; - $hash = user_hash_password($newpassword); - $pw_op = "'$hash'"; - } - else { - // D8+. Mimic Drupal's /scripts/password-hash.sh - drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL); - $password_hasher = \Drupal::service('password'); - $hash = $password_hasher->hash($newpassword); - $pw_op = "'$hash'"; - } - if (!empty($pw_op)) { - $user_table_updates[] = "pass = $pw_op"; - $message_list[] = "passwords"; - } - } - - // Sanitize email addresses. - $newemail = drush_get_option(array('sanitize-email', 'destination-sanitize-email'), 'user+%uid@localhost.localdomain'); - if ($newemail != 'no' && $newemail !== 0) { - if (strpos($newemail, '%') !== FALSE) { - // We need a different sanitization query for Postgres and Mysql. - - $db_driver = $databases['default']['default']['driver']; - if ($db_driver == 'pgsql') { - $email_map = array('%uid' => "' || uid || '", '%mail' => "' || replace(mail, '@', '_') || '", '%name' => "' || replace(name, ' ', '_') || '"); - $newmail = "'" . str_replace(array_keys($email_map), array_values($email_map), $newemail) . "'"; - } - elseif ($db_driver == 'mssql') { - $email_map = array('%uid' => "' + uid + '", '%mail' => "' + replace(mail, '@', '_') + '", '%name' => "' + replace(name, ' ', '_') + '"); - $newmail = "'" . str_replace(array_keys($email_map), array_values($email_map), $newemail) . "'"; - } - else { - $email_map = array('%uid' => "', uid, '", '%mail' => "', replace(mail, '@', '_'), '", '%name' => "', replace(name, ' ', '_'), '"); - $newmail = "concat('" . str_replace(array_keys($email_map), array_values($email_map), $newemail) . "')"; - } - $user_table_updates[] = "mail = $newmail, init = $newmail"; - } - else { - $user_table_updates[] = "mail = '$newemail', init = '$newemail'"; - } - $message_list[] = 'email addresses'; - } - - if (!empty($user_table_updates)) { - $table = $major_version >= 8 ? 'users_field_data' : 'users'; - if ($wrap_table_name) { - $table = "{{$table}}"; - } - $sanitize_query = "UPDATE {$table} SET " . implode(', ', $user_table_updates) . " WHERE uid > 0;"; - drush_sql_register_post_sync_op('user-email', dt('Reset !message in !table table', array('!message' => implode(' and ', $message_list), '!table' => $table)), $sanitize_query); - } - - $sanitizer = new \Drush\Commands\core\SanitizeCommands(); - $sanitizer->doSanitize($major_version); -} diff --git a/vendor/drush/drush/commands/sql/sqlsync.drush.inc b/vendor/drush/drush/commands/sql/sqlsync.drush.inc deleted file mode 100644 index 8cc1a687f1091b7e6c17e3fe72a42f8168f5976f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/sql/sqlsync.drush.inc +++ /dev/null @@ -1,283 +0,0 @@ -<?php - -use Drush\Log\LogLevel; -use Webmozart\PathUtil\Path; - -/** - * Implementation of hook_drush_command(). - */ -function sqlsync_drush_command() { - $items['sql-sync'] = array( - 'description' => 'Copies the database contents from a source site to a target site. Transfers the database dump via rsync.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'drush dependencies' => array('sql', 'core'), // core-rsync. - 'package' => 'sql', - 'examples' => array( - 'drush sql-sync @source @target' => 'Copy the database from the site with the alias "source" to the site with the alias "target".', - 'drush sql-sync prod dev' => 'Copy the database from the site in /sites/prod to the site in /sites/dev (multisite installation).', - ), - 'arguments' => array( - 'source' => 'A site-alias or the name of a subdirectory within /sites whose database you want to copy from.', - 'target' => 'A site-alias or the name of a subdirectory within /sites whose database you want to replace.', - ), - 'required-arguments' => TRUE, - 'options' => drush_sql_get_table_selection_options() + array( - // 'cache' => 'Skip dump if result file exists and is less than "cache" hours old. Optional; default is 24 hours.', - // 'no-cache' => 'Do not cache the sql-dump file.', - 'no-dump' => 'Do not dump the sql database; always use an existing dump file.', - 'no-sync' => 'Do not rsync the database dump file from source to target.', - 'runner' => 'Where to run the rsync command; defaults to the local site. Can also be "source" or "destination".', - 'source-db-url' => 'Database specification for source system to dump from.', - 'source-remote-port' => 'Override sql database port number in source-db-url. Optional.', - 'source-remote-host' => 'Remote machine to run sql-dump file on. Optional; default is local machine.', - 'source-dump' => array( - 'description' => 'The destination for the dump file, or the path to the dump file when --no-dump is specified.', - 'example-value' => '/dumpdir/db.sql', - ), - 'source-database' => 'A key in the $db_url (D6) or $databases (D7+) array which provides the data.', - 'source-target' => array( - 'description' => 'A key within the SOURCE database identifying a particular server in the database group.', - 'example-value' => 'key', - // Gets unhidden in help_alter(). We only want to show to D7+ users but have to - // declare it here since this command does not bootstrap fully. - 'hidden' => TRUE, - ), - 'target-db-url' => '', - 'target-remote-port' => '', - 'target-remote-host' => '', - 'target-dump' => array( - 'description' => 'A path for saving the dump file on target. Mandatory when using --no-sync.', - 'example-value' => '/dumpdir/db.sql.gz', - ), - 'target-database' => 'A key in the $db_url (D6) or $databases (D7+) array which shall receive the data.', - 'target-target' => array( - 'description' => 'Oy. A key within the TARGET database identifying a particular server in the database group.', - 'example-value' => 'key', - // Gets unhidden in help_alter(). We only want to show to D7+ users but have to - // declare it here since this command does not bootstrap fully. - 'hidden' => TRUE, - ), - 'create-db' => 'Create a new database before importing the database dump on the target machine.', - 'db-su' => array( - 'description' => 'Account to use when creating a new database. Optional.', - 'example-value' => 'root', - ), - 'db-su-pw' => array( - 'description' => 'Password for the "db-su" account. Optional.', - 'example-value' => 'pass', - ), - // 'no-ordered-dump' => 'Do not pass --ordered-dump to sql-dump. sql-sync orders the dumpfile by default in order to increase the efficiency of rsync.', - 'sanitize' => 'Obscure email addresses and reset passwords in the user table post-sync.', - ), - 'sub-options' => array( - 'sanitize' => drupal_sanitize_options() + array( - 'confirm-sanitizations' => 'Prompt yes/no after importing the database, but before running the sanitizations', - ), - ), - 'topics' => array('docs-aliases', 'docs-policy', 'docs-example-sync-via-http', 'docs-example-sync-extension'), - ); - return $items; -} - -/** - * Implements hook_drush_help_alter(). - */ -function sqlsync_drush_help_alter(&$command) { - // Drupal 7+ only options. - if (drush_drupal_major_version() >= 7) { - if ($command['command'] == 'sql-sync') { - unset($command['options']['source-target']['hidden'], $command['options']['target-target']['hidden']); - } - } -} - -/** - * Command argument complete callback. - * - * @return - * Array of available site aliases. - */ -function sql_sql_sync_complete() { - return array('values' => array_keys(_drush_sitealias_all_list())); -} - -/* - * Implements COMMAND hook init. - */ -function drush_sql_sync_init($source, $destination) { - // Try to get @self defined when --uri was not provided. - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_SITE); - - // Preflight destination in case it defines the alias used by the source - _drush_sitealias_get_record($destination); - - // After preflight, get source and destination settings - $source_settings = drush_sitealias_get_record($source); - $destination_settings = drush_sitealias_get_record($destination); - - // Apply command-specific options. - drush_sitealias_command_default_options($source_settings, 'source-'); - drush_sitealias_command_default_options($destination_settings, 'target-'); -} - -/* - * A command validate callback. - */ -function drush_sqlsync_sql_sync_validate($source, $destination) { - // Get destination info for confirmation prompt. - $source_settings = drush_sitealias_overlay_options(drush_sitealias_get_record($source), 'source-'); - $destination_settings = drush_sitealias_overlay_options(drush_sitealias_get_record($destination), 'target-'); - $source_db_spec = drush_sitealias_get_db_spec($source_settings, FALSE, 'source-'); - $target_db_spec = drush_sitealias_get_db_spec($destination_settings, FALSE, 'target-'); - $txt_source = (isset($source_db_spec['remote-host']) ? $source_db_spec['remote-host'] . '/' : '') . $source_db_spec['database']; - $txt_destination = (isset($target_db_spec['remote-host']) ? $target_db_spec['remote-host'] . '/' : '') . $target_db_spec['database']; - - // Validate. - if (empty($source_db_spec)) { - if (empty($source_settings)) { - return drush_set_error('DRUSH_ALIAS_NOT_FOUND', dt('Error: no alias record could be found for source !source', array('!source' => $source))); - } - return drush_set_error('DRUSH_DATABASE_NOT_FOUND', dt('Error: no database record could be found for source !source', array('!source' => $source))); - } - if (empty($target_db_spec)) { - if (empty($destination_settings)) { - return drush_set_error('DRUSH_ALIAS_NOT_FOUND', dt('Error: no alias record could be found for target !destination', array('!destination' => $destination))); - } - return drush_set_error('DRUSH_DATABASE_NOT_FOUND', dt('Error: no database record could be found for target !destination', array('!destination' => $destination))); - } - - if (drush_get_option('no-dump') && !drush_get_option('source-dump')) { - return drush_set_error('DRUSH_SOURCE_DUMP_MISSING', dt('The --source-dump option must be supplied when --no-dump is specified.')); - } - - if (drush_get_option('no-sync') && !drush_get_option('target-dump')) { - return drush_set_error('DRUSH_TARGET_DUMP_MISSING', dt('The --target-dump option must be supplied when --no-sync is specified.')); - } - - if (!drush_get_context('DRUSH_SIMULATE')) { - drush_print(dt("You will destroy data in !target and replace with data from !source.", array('!source' => $txt_source, '!target' => $txt_destination))); - // @todo Move sanitization prompts to here. They currently show much later. - if (!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort(); - } - } -} - -/* - * A command callback. - */ -function drush_sqlsync_sql_sync($source, $destination) { - $source_settings = drush_sitealias_overlay_options(drush_sitealias_get_record($source), 'source-'); - $destination_settings = drush_sitealias_overlay_options(drush_sitealias_get_record($destination), 'target-'); - $source_is_local = !array_key_exists('remote-host', $source_settings) || drush_is_local_host($source_settings); - $destination_is_local = !array_key_exists('remote-host', $destination_settings) || drush_is_local_host($destination_settings); - - // These options are passed along to subcommands like sql-create, sql-dump, sql-query, sql-sanitize, ... - $source_options = drush_get_merged_prefixed_options('source-'); - $target_options = drush_get_merged_prefixed_options('target-'); - - $backend_options = array(); - // @todo drush_redispatch_get_options() assumes you will execute same command. Not good. - $global_options = drush_redispatch_get_options() + array( - 'strict' => 0, - ); - // We do not want to include root or uri here. If the user - // provided -r or -l, their key has already been remapped to - // 'root' or 'uri' by the time we get here. - unset($global_options['root']); - unset($global_options['uri']); - - if (drush_get_context('DRUSH_SIMULATE')) { - $backend_options['backend-simulate'] = TRUE; - } - - // Create destination DB if needed. - if (drush_get_option('create-db')) { - drush_log(dt('Starting to create database on Destination.'), LogLevel::OK); - $return = drush_invoke_process($destination, 'sql-create', array(), $global_options + $target_options, $backend_options); - if ($return['error_status']) { - return drush_set_error('DRUSH_SQL_CREATE_FAILED', dt('sql-create failed.')); - } - } - - // Perform sql-dump on source unless told otherwise. - $options = $global_options + $source_options + array( - 'gzip' => TRUE, - 'result-file' => drush_get_option('source-dump', TRUE), - // 'structure-tables-list' => 'cache*', // Do we want to default to this? - ); - if (!drush_get_option('no-dump')) { - drush_log(dt('Starting to dump database on Source.'), LogLevel::OK); - $return = drush_invoke_process($source, 'sql-dump', array(), $options, $backend_options); - if ($return['error_status']) { - return drush_set_error('DRUSH_SQL_DUMP_FAILED', dt('sql-dump failed.')); - } - else { - $source_dump_path = $return['object']; - if (!is_string($source_dump_path)) { - return drush_set_error('DRUSH_SQL_DUMP_FILE_NOT_REPORTED', dt('The Drush sql-dump command did not report the path to the dump file produced. Try upgrading the version of Drush you are using on the source machine.')); - } - } - } - else { - $source_dump_path = drush_get_option('source-dump'); - } - - $do_rsync = !drush_get_option('no-sync'); - // Determine path/to/dump on destination. - if (drush_get_option('target-dump')) { - $destination_dump_path = drush_get_option('target-dump'); - $rsync_options['yes'] = TRUE; // @temporary: See https://github.com/drush-ops/drush/pull/555 - } - elseif ($source_is_local && $destination_is_local) { - $destination_dump_path = $source_dump_path; - $do_rsync = FALSE; - } - else { - $tmp = '/tmp'; // Our fallback plan. - drush_log(dt('Starting to discover temporary files directory on Destination.'), LogLevel::OK); - $return = drush_invoke_process($destination, 'core-status', array(), array(), array('integrate' => FALSE, 'override-simulated' => TRUE)); - if (!$return['error_status'] && isset($return['object']['drush-temp'])) { - $tmp = $return['object']['drush-temp']; - } - $destination_dump_path = Path::join($tmp, basename($source_dump_path)); - $rsync_options['yes'] = TRUE; // No need to prompt as destination is a tmp file. - } - - if ($do_rsync) { - if (!drush_get_option('no-dump')) { - // Cleanup if this command created the dump file. - $rsync_options['remove-source-files'] = TRUE; - } - $runner = drush_get_runner($source_settings, $destination_settings, drush_get_option('runner', FALSE)); - // Since core-rsync is a strict-handling command and drush_invoke_process() puts options at end, we can't send along cli options to rsync. - // Alternatively, add options like --ssh-options to a site alias (usually on the machine that initiates the sql-sync). - $return = drush_invoke_process($runner, 'core-rsync', array("$source:$source_dump_path", "$destination:$destination_dump_path"), $rsync_options); - drush_log(dt('Copying dump file from Source to Destination.'), LogLevel::OK); - if ($return['error_status']) { - return drush_set_error('DRUSH_RSYNC_FAILED', dt('core-rsync failed.')); - } - } - - // Import file into destination. - drush_log(dt('Starting to import dump file onto Destination database.'), LogLevel::OK); - $options = $global_options + $target_options + array( - 'file' => $destination_dump_path, - 'file-delete' => TRUE, - ); - $return = drush_invoke_process($destination, 'sql-query', array(), $options, $backend_options); - if ($return['error_status']) { - // An error was already logged. - return FALSE; - } - - // Run Sanitize if needed. - $options = $global_options + $target_options; - if (drush_get_option('sanitize')) { - drush_log(dt('Starting to sanitize target database on Destination.'), LogLevel::OK); - $return = drush_invoke_process($destination, 'sql-sanitize', array(), $options, $backend_options); - if ($return['error_status']) { - return drush_set_error('DRUSH_SQL_SANITIZE_FAILED', dt('sql-sanitize failed.')); - } - } -} diff --git a/vendor/drush/drush/commands/user/user.drush.inc b/vendor/drush/drush/commands/user/user.drush.inc deleted file mode 100644 index cb6e77a674da8db5df90a80fd1581ce4b6057592..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/user/user.drush.inc +++ /dev/null @@ -1,420 +0,0 @@ -<?php - -use Drush\Log\LogLevel; -use Drush\User\UserList; -use Drush\User\UserListException; - -/** - * @file - * Drush User Management commands - */ - -function user_drush_help($section) { - switch ($section) { - case 'meta:user:title': - return dt('User commands'); - case 'meta:user:summary': - return dt('Add, modify and delete users.'); - } -} - -/** - * Implementation of hook_drush_command(). - */ -function user_drush_command() { - $options_common = array( - 'uid' => array( - 'description' => 'A comma delimited list of uids of users to operate on.', - 'example-value' => '3,5', - 'value' => 'required', - ), - 'name' => array( - 'description' => 'A comma delimited list of user names of users to operate on.', - 'example-value' => 'foo', - 'value' => 'required', - ), - 'mail' => array( - 'description' => 'A comma delimited list of user mail addresses of users to operate on.', - 'example-value' => 'me@example.com', - 'value' => 'required', - ) - ); - - $items['user-information'] = array( - 'description' => 'Print information about the specified user(s).', - 'aliases' => array('uinf', 'user:information'), - 'examples' => array( - 'drush user-information 2,3,someguy,somegal,billgates@microsoft.com' => - 'Display information about the listed users.', - ), - 'arguments' => array( - 'users' => 'A comma delimited list of uids, user names, or email addresses.', - ), - 'required-arguments' => TRUE, - 'outputformat' => array( - 'default' => 'key-value-list', - 'pipe-format' => 'csv', - 'field-labels' => array( - 'uid' => 'User ID', - 'name' => 'User name', - 'pass' => 'Password', - 'mail' => 'User mail', - 'theme' => 'User theme', - 'signature' => 'Signature', - 'signature_format' => 'Signature format', - 'user_created' => 'User created', - 'created' => 'Created', - 'user_access' => 'User last access', - 'access' => 'Last access', - 'user_login' => 'User last login', - 'login' => 'Last login', - 'user_status' => 'User status', - 'status' => 'Status', - 'timezone' => 'Time zone', - 'picture' => 'User picture', - 'init' => 'Initial user mail', - 'roles' => 'User roles', - 'group_audience' => 'Group Audience', - 'langcode' => 'Language code', - 'uuid' => 'Uuid', - ), - 'format-cell' => 'csv', - 'fields-default' => array('uid', 'name', 'mail', 'roles', 'user_status'), - 'fields-pipe' => array('name', 'uid', 'mail', 'status', 'roles'), - 'fields-full' => array('uid', 'name', 'pass', 'mail', 'theme', 'signature', 'user_created', 'user_access', 'user_login', 'user_status', 'timezone', 'roles', 'group_audience', 'langcode', 'uuid'), - 'output-data-type' => 'format-table', - ), - ); - $items['user-block'] = array( - 'description' => 'Block the specified user(s).', - 'aliases' => array('ublk', 'user:block'), - 'arguments' => array( - 'users' => 'A comma delimited list of uids, user names, or email addresses.', - ), - 'examples' => array( - 'drush user-block 5,user3 --uid=2,3 --name=someguy,somegal --mail=billgates@microsoft.com' => - 'Block the users with name, id, or email 5 or user3, uids 2 and 3, names someguy and somegal, and email address of billgates@microsoft.com', - ), - 'options' => $options_common, - ); - $items['user-unblock'] = array( - 'description' => 'Unblock the specified user(s).', - 'aliases' => array('uublk', 'user:unblock'), - 'arguments' => array( - 'users' => 'A comma delimited list of uids, user names, or email addresses.', - ), - 'examples' => array( - 'drush user-unblock 5,user3 --uid=2,3 --name=someguy,somegal --mail=billgates@microsoft.com' => - 'Unblock the users with name, id, or email 5 or user3, uids 2 and 3, names someguy and somegal, and email address of billgates@microsoft.com', - ), - 'options' => $options_common, - ); - $items['user-add-role'] = array( - 'description' => 'Add a role to the specified user accounts.', - 'aliases' => array('urol', 'user:add:role'), - 'arguments' => array( - 'role' => 'The name of the role to add', - 'users' => '(optional) A comma delimited list of uids, user names, or email addresses.', - ), - 'required-arguments' => 1, - 'examples' => array( - 'drush user-add-role "power user" 5,user3 --uid=2,3 --name=someguy,somegal --mail=billgates@microsoft.com' => - 'Add the "power user" role to the accounts with name, id, or email 5 or user3, uids 2 and 3, names someguy and somegal, and email address of billgates@microsoft.com', - ), - 'options' => $options_common, - ); - $items['user-remove-role'] = array( - 'description' => 'Remove a role from the specified user accounts.', - 'aliases' => array('urrol', 'user:remove:role'), - 'arguments' => array( - 'role' => 'The name of the role to remove', - 'users' => '(optional) A comma delimited list of uids, user names, or email addresses.', - ), - 'required-arguments' => 1, - 'examples' => array( - 'drush user-remove-role "power user" 5,user3 --uid=2,3 --name=someguy,somegal --mail=billgates@microsoft.com' => - 'Remove the "power user" role from the accounts with name, id, or email 5 or user3, uids 2 and 3, names someguy and somegal, and email address of billgates@microsoft.com', - ), - 'options' => $options_common, - ); - $items['user-create'] = array( - 'description' => 'Create a user account with the specified name.', - 'aliases' => array('ucrt', 'user:create'), - 'arguments' => array( - 'name' => 'The name of the account to add' - ), - 'required-arguments' => TRUE, - 'examples' => array( - 'drush user-create newuser --mail="person@example.com" --password="letmein"' => - 'Create a new user account with the name newuser, the email address person@example.com, and the password letmein', - ), - 'options' => array( - 'password' => 'The password for the new account', - 'mail' => 'The email address for the new account', - ), - 'outputformat' => $items['user-information']['outputformat'], - ); - $items['user-cancel'] = array( - 'description' => 'Cancel a user account with the specified name.', - 'aliases' => array('ucan', 'user:cancel'), - 'arguments' => array( - 'name' => 'The name of the account to cancel', - ), - // The `_user_cancel` method still references global $user. - // @todo remove once https://www.drupal.org/node/2163205 is in. - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN, - 'required-arguments' => TRUE, - 'examples' => array( - 'drush user-cancel username' => - 'Cancel the user account with the name username and anonymize all content created by that user.', - ), - ); - $items['user-password'] = array( - 'description' => '(Re)Set the password for the user account with the specified name.', - 'aliases' => array('upwd', 'user:password'), - 'arguments' => array( - 'name' => 'The name of the account to modify.' - ), - 'required-arguments' => TRUE, - 'options' => array( - 'password' => array( - 'description' => 'The new password for the account.', - 'required' => TRUE, - 'example-value' => 'foo', - ), - ), - 'examples' => array( - 'drush user-password someuser --password="correct horse battery staple"' => - 'Set the password for the username someuser. @see xkcd.com/936', - ), - ); - $items['user-login'] = array( - 'description' => 'Display a one time login link for the given user account (defaults to uid 1).', - 'aliases' => array('uli', 'user:login'), - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'handle-remote-commands' => TRUE, - 'arguments' => array( - 'user' => 'An optional uid, user name, or email address for the user to log in as. Default is to log in as uid 1. The uid/name/mail options take priority if specified.', - 'path' => 'Optional path to redirect to after logging in.', - ), - 'options' => array( - 'browser' => 'Optional value denotes which browser to use (defaults to operating system default). Use --no-browser to suppress opening a browser.', - 'uid' => 'A uid to log in as.', - 'redirect-port' => 'A custom port for redirecting to (e.g. when running within a Vagrant environment)', - 'name' => 'A user name to log in as.', - 'mail' => 'A user mail address to log in as.', - ), - 'examples' => array( - 'drush user-login ryan node/add/blog' => 'Displays and opens default web browser (if configured or detected) for a one-time login link for the user with the username ryan and redirect to the path node/add/blog.', - 'drush user-login --browser=firefox --mail=drush@example.org admin/settings/performance' => 'Open firefox web browser, login as the user with the e-mail address drush@example.org and redirect to the path admin/settings/performance.', - ), - ); - return $items; -} - -/** - * Implements hook_drush_help_alter(). - */ -function user_drush_help_alter(&$command) { - // Drupal 7+ only options. - if ($command['command'] == 'user-cancel' && drush_drupal_major_version() >= 7) { - $command['options']['delete-content'] = 'Delete all content created by the user'; - $command['examples']['drush user-cancel --delete-content username'] = - 'Cancel the user account with the name username and delete all content created by that user.'; - } -} - -/** - * Get a version specific UserSingle class. - * - * @param $account - * @return \Drush\User\UserSingleBase - * - * @see drush_get_class(). - */ -function drush_usersingle_get_class($account) { - return drush_get_class('Drush\User\UserSingle', array($account)); -} - -/** - * Get a version specific User class. - * - * @return \Drush\User\UserVersion - * - * @see drush_get_class(). - */ -function drush_user_get_class() { - return drush_get_class('Drush\User\User'); -} - -/** - * Command callback. Prints information about the specified user(s). - */ -function drush_user_information($users) { - $userlist = new UserList($users); - $info = $userlist->each('info'); - return $info; -} - -/** - * Block the specified user(s). - */ -function drush_user_block($users = '') { - $userlist = new UserList($users); - $userlist->each('block'); - drush_log(dt('Blocked user(s): !users', array('!users' => $userlist->names())), LogLevel::SUCCESS); -} - -/** - * Unblock the specified user(s). - */ -function drush_user_unblock($users = '') { - $userlist = new UserList($users); - $userlist->each('unblock'); - drush_log(dt('Unblocked user(s): !users', array('!users' => $userlist->names())), LogLevel::SUCCESS); -} - -/** - * Add a role to the specified user accounts. - */ -function drush_user_add_role($role, $users = '') { - // If role is not found, an exception gets thrown and handled by command invoke. - $role_object = drush_role_get_class($role); - $userlist = new UserList($users); - $userlist->each('addRole', array($role_object->rid)); - drush_log(dt('Added role !role role to !users', array('!role' => $role, '!users' => $userlist->names())),LogLevel::SUCCESS); -} - -/** - * Remove a role from the specified user accounts. - */ -function drush_user_remove_role($role, $users = '') { - // If role is not found, an exception gets thrown and handled by command invoke. - $role_object = drush_role_get_class($role); - $userlist = new UserList($users); - $userlist->each('removeRole', array($role_object->rid)); - drush_log(dt('Removed !role role from !users', array('!role' => $role, '!users' => $userlist->names())),LogLevel::SUCCESS); -} - -/** - * Creates a new user account. - */ -function drush_user_create($name) { - $userversion = drush_user_get_class(); - $mail = drush_get_option('mail'); - $pass = drush_get_option('password'); - $new_user = array( - 'name' => $name, - 'pass' => $pass, - 'mail' => $mail, - 'access' => '0', - 'status' => 1, - ); - if (!drush_get_context('DRUSH_SIMULATE')) { - if ($account = $userversion->create($new_user)) { - return array($account->id() => $account->info()); - } - else { - return drush_set_error("Could not create a new user account with the name " . $name . "."); - } - } -} - -function drush_user_create_validate($name) { - $userversion = drush_user_get_class(); - if ($mail = drush_get_option('mail')) { - if ($userversion->load_by_mail($mail)) { - return drush_set_error(dt('There is already a user account with the email !mail', array('!mail' => $mail))); - } - } - if ($userversion->load_by_name($name)) { - return drush_set_error(dt('There is already a user account with the name !name', array('!name' => $name))); - } -} - -/** - * Cancels a user account. - */ -function drush_user_cancel($inputs) { - $userlist = new UserList($inputs); - foreach ($userlist->accounts as $account) { - if (drush_get_option('delete-content') && drush_drupal_major_version() >= 7) { - drush_print(dt('All content created by !name will be deleted.', array('!name' => $account->getUsername()))); - } - if (drush_confirm('Cancel user account?: ')) { - $account->cancel(); - } - } - drush_log(dt('Cancelled user(s): !users', array('!users' => $userlist->names())),LogLevel::SUCCESS); -} - -/** - * Sets the password for the account with the given username - */ -function drush_user_password($inputs) { - $userlist = new UserList($inputs); - if (!drush_get_context('DRUSH_SIMULATE')) { - $pass = drush_get_option('password'); - // If no password has been provided, prompt for one. - if (empty($pass)) { - $pass = drush_prompt(dt('Password'), NULL, TRUE, TRUE); - } - foreach ($userlist->accounts as $account) { - $userlist->each('password', array($pass)); - } - drush_log(dt('Changed password for !users', array('!users' => $userlist->names())), LogLevel::SUCCESS); - } -} - -/** - * Displays a one time login link for the given user. - */ -function drush_user_login($inputs = '', $path = NULL) { - $args = func_get_args(); - - // Redispatch if called against a remote-host so a browser is started on the - // the *local* machine. - $alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS'); - if (drush_sitealias_is_remote_site($alias)) { - $return = drush_invoke_process($alias, 'user-login', $args, drush_redispatch_get_options(), array('integrate' => FALSE)); - if ($return['error_status']) { - return drush_set_error('Unable to execute user login.'); - } - else { - // Prior versions of Drupal returned a string so cast to an array if needed. - $links = is_string($return['object']) ? array($return['object']) : $return['object']; - } - } - else { - if (!drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - // Fail gracefully if unable to bootstrap Drupal. - // drush_bootstrap() has already logged an error. - return FALSE; - } - - if (drush_get_option('uid', FALSE) || drush_get_option('name', FALSE) || drush_get_option('mail', FALSE)) { - // If we only have a single argument and one of the user options is passed, - // then we assume the argument is the path to open. - if (count($args) == 1) { - $path = $args[0]; - } - } - - // Try to load a user from provided options and arguments. - try { - $userlist = new UserList($inputs); - } - catch (UserListException $e) { - // No user option or argument was passed, so we default to uid 1. - $userlist = new UserList(1); - } - $links = $userlist->each('passResetUrl', array($path)); - } - $port = drush_get_option('redirect-port', FALSE); - // There is almost always only one link so pick the first one for display and browser. - // The full array is sent on backend calls. - $first = current($links); - drush_start_browser($first, FALSE, $port); - drush_backend_set_result($links); - return $first; -} diff --git a/vendor/drush/drush/commands/xh.drush.inc b/vendor/drush/drush/commands/xh.drush.inc deleted file mode 100644 index 7a3cfef53f3fd01454b09fe2c0faf5182f476038..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/commands/xh.drush.inc +++ /dev/null @@ -1,103 +0,0 @@ -<?php - -/** - * @file - */ - -use Drush\Log\LogLevel; - -define('XH_PROFILE_MEMORY', FALSE); - -define('XH_PROFILE_CPU', FALSE); - -define('XH_PROFILE_BUILTINS', TRUE); - -/** - * Implements hook_drush_help_alter(). - */ -function xh_drush_help_alter(&$command) { - if ($command['command'] == 'global-options') { - // Do not include these in options in standard help. - if ($command['#brief'] === FALSE) { - $command['options']['xh'] = array( - 'description' => 'Enable profiling via XHProf', - ); - $command['sub-options']['xh']['xh-link'] = 'URL to your XHProf report site.'; - $command['sub-options']['xh']['xh-path'] = 'Absolute path to the xhprof project.'; - $command['sub-options']['xh']['xh-profile-builtins'] = 'Profile built-in PHP functions (defaults to TRUE).'; - $command['sub-options']['xh']['xh-profile-cpu'] = 'Profile CPU (defaults to FALSE).'; - $command['sub-options']['xh']['xh-profile-memory'] = 'Profile Memory (defaults to FALSE).'; - } - } -} - -function xh_enabled() { - if (drush_get_option('xh')) { - if (!extension_loaded('xhprof')) { - return drush_set_error('You must enable the xhprof PHP extension in your CLI PHP in order to profile.'); - } - if (!drush_get_option('xh-path', '')) { - return drush_set_error('You must provide the xh-path option in your drushrc or on the CLI in order to profile.'); - } - return TRUE; - } -} - -/** - * Determines flags for xhprof_enable based on drush options. - */ -function xh_flags() { - $flags = 0; - if (!drush_get_option('xh-profile-builtins', XH_PROFILE_BUILTINS)) { - $flags |= XHPROF_FLAGS_NO_BUILTINS; - } - if (drush_get_option('xh-profile-cpu', XH_PROFILE_CPU)) { - $flags |= XHPROF_FLAGS_CPU; - } - if (drush_get_option('xh-profile-memory', XH_PROFILE_MEMORY)) { - $flags |= XHPROF_FLAGS_MEMORY; - } - return $flags; -} - -/** - * Implements hook_drush_init(). - */ -function xh_drush_init() { - if (xh_enabled()) { - if ($path = drush_get_option('xh-path', '')) { - include_once $path . '/xhprof_lib/utils/xhprof_lib.php'; - include_once $path . '/xhprof_lib/utils/xhprof_runs.php'; - xhprof_enable(xh_flags()); - } - } -} - -/** - * Implements hook_drush_exit(). - */ -function xh_drush_exit() { - if (xh_enabled()) { - $args = func_get_args(); - $namespace = 'Drush'; // variable_get('site_name', ''); - $xhprof_data = xhprof_disable(); - $xhprof_runs = new XHProfRuns_Default(); - $run_id = $xhprof_runs->save_run($xhprof_data, $namespace); - if ($url = xh_link($run_id)) { - drush_log(dt('XHProf run saved. View report at !url', array('!url' => $url)), LogLevel::OK); - } - } -} - -/** - * Returns the XHProf link. - */ -function xh_link($run_id) { - if ($xhprof_url = trim(drush_get_option('xh-link'))) { - $namespace = 'Drush'; //variable_get('site_name', ''); - return $xhprof_url . '/index.php?run=' . urlencode($run_id) . '&source=' . urlencode($namespace); - } - else { - drush_log('Configure xh_link in order to see a link to the XHProf report for this request instead of this message.'); - } -} diff --git a/vendor/drush/drush/composer.json b/vendor/drush/drush/composer.json index 5f9d0843f66a5100e3d0bf6de8d8dba1e972a186..d560da1e54a51cdfe008de6bcf90aca890174df1 100644 --- a/vendor/drush/drush/composer.json +++ b/vendor/drush/drush/composer.json @@ -3,13 +3,11 @@ "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", "homepage": "http://www.drush.org", "license": "GPL-2.0-or-later", - "minimum-stability": "stable", + "minimum-stability": "dev", "prefer-stable": true, "authors": [ { "name": "Moshe Weitzman", "email": "weitzman@tejasa.com" }, { "name": "Owen Barton", "email": "drupal@owenbarton.com" }, - { "name": "Mark Sonnabaum", "email": "marksonnabaum@gmail.com" }, - { "name": "Antoine Beaupré", "email": "anarcat@koumbit.org" }, { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" }, { "name": "Jonathan Araña Cruz", "email": "jonhattan@faita.net" }, { "name": "Jonathan Hedstrom", "email": "jhedstrom@gmail.com" }, @@ -19,70 +17,126 @@ ], "support": { "forum": "http://drupal.stackexchange.com/questions/tagged/drush", - "irc": "irc://irc.freenode.org/drush" + "irc": "irc://irc.freenode.org/drush", + "slack": "https://drupal.slack.com/messages/C62H9CWQM" }, "bin": [ - "drush", - "drush.launcher", - "drush.php", - "drush.complete.sh" + "drush" ], - "config": { - "platform": { - "php": "5.4.5" + "repositories": { + "drupal_org": { + "type": "composer", + "url": "https://packages.drupal.org/8" } }, "require": { - "php": ">=5.4.5", + "php": ">=5.6.0", + "ext-dom": "*", + "chi-teck/drupal-code-generator": "^1.28.1", + "composer/semver": "^1.4", + "consolidation/annotated-command": "^2.12", + "consolidation/config": "^1.2", + "consolidation/filter-via-dot-access-data": "^1", + "consolidation/output-formatters": "^3.3.1", + "consolidation/robo": "^1.4.6", + "consolidation/site-alias": "^3.0.0@stable", + "consolidation/site-process": "^2.0.3", + "grasmash/yaml-expander": "^1.1.1", + "league/container": "~2", "psr/log": "~1.0", "psy/psysh": "~0.6", - "consolidation/annotated-command": "^2.12.0", - "consolidation/output-formatters": "~3", - "symfony/yaml": "~2.3|^3", - "symfony/var-dumper": "~2.7|^3", - "symfony/console": "~2.7|^3", - "symfony/event-dispatcher": "~2.7|^3", - "symfony/finder": "~2.7|^3", - "pear/console_table": "~1.3.1", - "webflo/drupal-finder": "^1.1.0", - "webmozart/path-util": "~2" + "symfony/console": "^3.4", + "symfony/event-dispatcher": "^3.4", + "symfony/finder": "^3.4 || ^4.0", + "symfony/process": "^3.4", + "symfony/var-dumper": "^3.4 || ^4.0", + "symfony/yaml": "^3.4", + "webflo/drupal-finder": "^1.1", + "webmozart/path-util": "^2.1.0" }, "require-dev": { - "symfony/var-dumper": "~2.7", - "symfony/console": "~2.7", - "symfony/event-dispatcher": "~2.7", - "symfony/finder": "~2.7", - "symfony/yaml": "~2.3", - "phpunit/phpunit": "4.*", - "symfony/process": "2.7.*" - }, - "suggest": { - "ext-pcntl": "*", - "drush/config-extra": "Provides configuration workflow commands, such as config-merge." + "lox/xhprof": "dev-master", + "g1a/composer-test-scenarios": "^3", + "phpunit/phpunit": "^4.8.36 || ^6.1", + "squizlabs/php_codesniffer": "^2.7 || ^3", + "composer/installers": "^1.2", + "cweagans/composer-patches": "~1.0", + "webflo/drupal-core-strict": "8.7.x-dev", + "webflo/drupal-core-require-dev": "8.7.x-dev", + "drupal/empty_theme": "1.0", + "drupal/devel": "^2", + "drupal/alinks": "1.0.0", + "vlucas/phpdotenv": "^2.4" }, "autoload": { - "psr-0": { - "Drush": "lib/", - "Consolidation": "lib/" - }, "psr-4": { - "Drush\\": "src/" + "Drush\\": "src/", + "Drush\\Internal\\": "src/internal-forks" } }, "autoload-dev": { - "psr-0": { - "Unish": "tests/" + "psr-4": { + "Unish\\": "tests/unish" + }, + "files": ["tests/load.environment.php"] + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true, + "process-timeout": 9600, + "platform": { + "php": "7.0.11" } }, "scripts": { + "cs": "phpcs", + "cbf": "phpcbf", "lint": [ "find includes -name '*.inc' -print0 | xargs -0 -n1 php -l", - "find lib/Drush -name '*.php' -print0 | xargs -0 -n1 php -l" - ] + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@phpunit", + "@cs" + ], + "api": "PATH=$HOME/bin:$PATH sami.phar --ansi update sami-config.php", + "sami-install": "mkdir -p $HOME/bin && curl --output $HOME/bin/sami.phar http://get.sensiolabs.org/sami.phar && chmod +x $HOME/bin/sami.phar", + "sut": "./drush --uri=dev", + "sut:si": "./drush site:install testing --uri=dev --sites-subdir=dev --db-url=${UNISH_DB_URL:-mysql://root:password@mariadb}/unish_dev -v", + "phpunit": "php -d sendmail_path='true' vendor/bin/phpunit --colors=always --configuration tests", + "unit": "composer phpunit -- --testsuite unit", + "integration": "composer phpunit -- --testsuite integration", + "functional": "composer phpunit -- --testsuite functional" }, "extra": { + "installer-paths": { + "sut/core": ["type:drupal-core"], + "sut/libraries/{$name}": ["type:drupal-library"], + "sut/modules/unish/{$name}": ["drupal/devel"], + "sut/themes/unish/{$name}": ["drupal/empty_theme"], + "sut/modules/contrib/{$name}": ["type:drupal-module"], + "sut/profiles/contrib/{$name}": ["type:drupal-profile"], + "sut/themes/contrib/{$name}": ["type:drupal-theme"], + "sut/drush/contrib/{$name}": ["type:drupal-drush"] + }, + "scenarios": { + "php5": { + "config": { + "platform": { + "php": "5.6.38" + } + }, + "require-dev": { + "webflo/drupal-core-strict": "8.6.x-dev", + "webflo/drupal-core-require-dev": "8.6.x-dev" + } + } + }, "branch-alias": { - "dev-master": "8.0.x-dev" + "dev-master": "9.x-dev" } } } diff --git a/vendor/drush/drush/composer.lock b/vendor/drush/drush/composer.lock index 294e40adc29cb7c3fe0c7dc234e51abbd210bdda..45b1460fcae034c41c2a37c280e178100f1a9dbd 100644 --- a/vendor/drush/drush/composer.lock +++ b/vendor/drush/drush/composer.lock @@ -4,8 +4,115 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6350957e1c82365d6a7199dd8d1289b1", + "content-hash": "69702ffaac43e1fe89a91880704d07f6", "packages": [ + { + "name": "chi-teck/drupal-code-generator", + "version": "1.29.0", + "source": { + "type": "git", + "url": "https://github.com/Chi-teck/drupal-code-generator.git", + "reference": "79768f0c9a50337ecce81de1fdfa48d837b9b341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/79768f0c9a50337ecce81de1fdfa48d837b9b341", + "reference": "79768f0c9a50337ecce81de1fdfa48d837b9b341", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.5.9", + "symfony/console": "^3.4 || ^4.0", + "symfony/filesystem": "^2.7 || ^3.4 || ^4.0", + "twig/twig": "^1.35" + }, + "bin": [ + "bin/dcg" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "files": [ + "src/bootstrap.php" + ], + "psr-4": { + "DrupalCodeGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Drupal code generator", + "time": "2019-04-13T14:36:40+00:00" + }, + { + "name": "composer/semver", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2019-03-19T17:25:45+00:00" + }, { "name": "consolidation/annotated-command", "version": "2.12.0", @@ -103,46 +210,71 @@ "time": "2019-03-08T16:55:03+00:00" }, { - "name": "consolidation/output-formatters", - "version": "3.4.0", + "name": "consolidation/config", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/consolidation/output-formatters.git", - "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + "url": "https://github.com/consolidation/config.git", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", - "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", "shasum": "" }, "require": { "dflydev/dot-access-data": "^1.1.0", - "php": ">=5.4.0", - "symfony/console": "^2.8|^3|^4", - "symfony/finder": "^2.5|^3|^4" + "grasmash/expander": "^1", + "php": ">=5.4.0" }, "require-dev": { - "g1a/composer-test-scenarios": "^2", - "phpunit/phpunit": "^5.7.27", - "satooshi/php-coveralls": "^2", - "squizlabs/php_codesniffer": "^2.7", - "symfony/console": "3.2.3", - "symfony/var-dumper": "^2.8|^3|^4", - "victorjonsson/markdowndocs": "^1.3" + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" }, "suggest": { - "symfony/var-dumper": "For using the var_dump formatter" + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" }, "type": "library", "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "Consolidation\\OutputFormatters\\": "src" + "Consolidation\\Config\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -155,35 +287,61 @@ "email": "greg.1.anderson@greenknowe.org" } ], - "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2018-10-19T22:35:38+00:00" + "description": "Provide configuration services for a commandline tool.", + "time": "2019-03-03T19:37:04+00:00" }, { - "name": "dflydev/dot-access-data", - "version": "v1.1.0", + "name": "consolidation/filter-via-dot-access-data", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/dflydev/dflydev-dot-access-data.git", - "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + "url": "https://github.com/consolidation/filter-via-dot-access-data.git", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", - "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "url": "https://api.github.com/repos/consolidation/filter-via-dot-access-data/zipball/a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6", "shasum": "" }, "require": { - "php": ">=5.3.2" + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4" }, "type": "library", "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.x-dev" } }, "autoload": { - "psr-0": { - "Dflydev\\DotAccessData": "src" + "psr-4": { + "Consolidation\\Filter\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -192,186 +350,5366 @@ ], "authors": [ { - "name": "Dragonfly Development Inc.", - "email": "info@dflydev.com", - "homepage": "http://dflydev.com" - }, - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" - }, - { - "name": "Carlos Frutos", - "email": "carlos@kiwing.it", - "homepage": "https://github.com/cfrutos" + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" } ], - "description": "Given a deep data structure, access data by dot notation.", - "homepage": "https://github.com/dflydev/dflydev-dot-access-data", - "keywords": [ - "access", - "data", - "dot", - "notation" - ], - "time": "2017-01-20T21:14:22+00:00" + "description": "This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.", + "time": "2019-01-18T06:05:07+00:00" }, { - "name": "dnoegel/php-xdg-base-dir", - "version": "0.1", + "name": "consolidation/log", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" + "url": "https://github.com/consolidation/log.git", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", + "url": "https://api.github.com/repos/consolidation/log/zipball/b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", + "reference": "b2e887325ee90abc96b0a8b7b474cd9e7c896e3a", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.4.5", + "psr/log": "^1.0", + "symfony/console": "^2.8|^3|^4" }, "require-dev": { - "phpunit/phpunit": "@stable" + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } }, - "type": "project", "autoload": { "psr-4": { - "XdgBaseDir\\": "src/" + "Consolidation\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "implementation of xdg base directory specification for php", - "time": "2014-10-24T07:27:01+00:00" + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2019-01-01T17:30:51+00:00" }, { - "name": "jakub-onderka/php-console-color", - "version": "v0.2", + "name": "consolidation/output-formatters", + "version": "3.4.1", "source": { "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", - "reference": "d5deaecff52a0d61ccb613bb3804088da0307191" + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "0881112642ad9059071f13f397f571035b527cb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", - "reference": "d5deaecff52a0d61ccb613bb3804088da0307191", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/0881112642ad9059071f13f397f571035b527cb9", + "reference": "0881112642ad9059071f13f397f571035b527cb9", "shasum": "" }, "require": { - "php": ">=5.4.0" + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { - "jakub-onderka/php-code-style": "1.0", - "jakub-onderka/php-parallel-lint": "1.0", - "jakub-onderka/php-var-dump-check": "0.*", - "phpunit/phpunit": "~4.3", - "squizlabs/php_codesniffer": "1.*" + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5.7.27", + "squizlabs/php_codesniffer": "^2.7", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" }, "type": "library", - "autoload": { - "psr-4": { + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony3": { + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "config": { + "platform": { + "php": "5.6.32" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2019-03-14T03:45:44+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.4.9", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.10.2", + "consolidation/config": "^1.2", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "g1a/composer-test-scenarios": "^3", + "goaop/framework": "~2.1.2", + "goaop/parser-reflection": "^1.1.0", + "natxet/cssmin": "3.0.4", + "nikic/php-parser": "^3.1.5", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.4", + "php-coveralls/php-coveralls": "^1", + "phpunit/php-code-coverage": "~2|~4", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "remove": [ + "goaop/framework" + ], + "config": { + "platform": { + "php": "5.5.9" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2019-03-19T18:07:19+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-10-28T01:52:03+00:00" + }, + { + "name": "consolidation/site-alias", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-alias.git", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-alias/zipball/8cfd3b6ab6d541086fc970bf850864293b284e6f", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4", + "symfony/yaml": "~2.3|^3" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\SiteAlias\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Manage alias records for local and remote sites.", + "time": "2019-03-12T17:31:48+00:00" + }, + { + "name": "consolidation/site-process", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-process.git", + "reference": "e25265f4a48c13284ebb6f9e0906ecd415d451df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-process/zipball/e25265f4a48c13284ebb6f9e0906ecd415d451df", + "reference": "e25265f4a48c13284ebb6f9e0906ecd415d451df", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "consolidation/site-alias": "^3", + "php": ">=5.6.0", + "symfony/process": "^3.4" + }, + "require-dev": { + "consolidation/robo": "^1.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\SiteProcess\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.", + "time": "2019-06-04T22:23:52+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "0.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", + "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "@stable" + }, + "type": "project", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "time": "2014-10-24T07:27:01+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "jakub-onderka/php-console-color", + "version": "v0.2", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", + "reference": "d5deaecff52a0d61ccb613bb3804088da0307191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", + "reference": "d5deaecff52a0d61ccb613bb3804088da0307191", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "1.0", + "jakub-onderka/php-parallel-lint": "1.0", + "jakub-onderka/php-var-dump-check": "0.*", + "phpunit/phpunit": "~4.3", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { "JakubOnderka\\PhpConsoleColor\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com" + } + ], + "time": "2018-09-29T17:23:10+00:00" + }, + { + "name": "jakub-onderka/php-console-highlighter", + "version": "v0.4", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", + "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/9f7a229a69d52506914b4bc61bfdb199d90c5547", + "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "jakub-onderka/php-console-color": "~0.2", + "php": ">=5.4.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "~1.0", + "jakub-onderka/php-parallel-lint": "~1.0", + "jakub-onderka/php-var-dump-check": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "JakubOnderka\\PhpConsoleHighlighter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "acci@acci.cz", + "homepage": "http://www.acci.cz/" + } + ], + "description": "Highlight PHP code in terminal", + "time": "2018-09-29T18:48:56+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.2.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/5221f49a608808c1e4d436df32884cbc1b821ac0", + "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^7.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2019-02-16T20:54:15+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.9.9", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", + "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", + "shasum": "" + }, + "require": { + "dnoegel/php-xdg-base-dir": "0.1", + "ext-json": "*", + "ext-tokenizer": "*", + "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*", + "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", + "php": ">=5.4.0", + "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", + "symfony/var-dumper": "~2.7|~3.0|~4.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "hoa/console": "~2.15|~3.16", + "phpunit/phpunit": "~4.8.35|~5.0|~6.0|~7.0" + }, + "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-develop": "0.9.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" + ], + "time": "2018-10-13T15:16:03+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "15a9104356436cb26e08adab97706654799d31d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8", + "reference": "15a9104356436cb26e08adab97706654799d31d8", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.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" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2019-04-08T09:29:13+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9", + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2019-04-11T09:48:14+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a088aafcefb4eef2520a290ed82e4374092a6dff", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-04-02T08:51:52+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-02-04T21:34:32+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/61af5ce0b34b942d414fe8f1b11950d0e9a90e98", + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-04-02T19:54:57+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "82ebae02209c21113908c229e9883c419720738a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "backendtea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-02-06T07:57:58+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2019-02-06T07:57:58+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/a9c4dfbf653023b668c282e4e02609d131f4057a", + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-04-08T16:15:54+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "f0883812642a6d6583a9e2ae6aec4ba134436f40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f0883812642a6d6583a9e2ae6aec4ba134436f40", + "reference": "f0883812642a6d6583a9e2ae6aec4ba134436f40", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, + "require-dev": { + "ext-iconv": "*", + "twig/twig": "~1.34|~2.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "ext-symfony_debug": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "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": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2019-04-16T13:58:17+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "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" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-03-25T07:48:46+00:00" + }, + { + "name": "twig/twig", + "version": "v1.38.4", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "7732e9e7017d751313811bd118de61302e9c8b35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/7732e9e7017d751313811bd118de61302e9c8b35", + "reference": "7732e9e7017d751313811bd118de61302e9c8b35", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "^2.7", + "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.38-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "https://twig.symfony.com/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "time": "2019-03-23T14:27:19+00:00" + }, + { + "name": "webflo/drupal-finder", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-finder.git", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/8a7886c575d6eaa67a425dceccc84e735c0b9637", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637", + "shasum": "" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/DrupalFinder.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Florian Weber", + "email": "florian@webflo.org" + } + ], + "description": "Helper class to locate a Drupal installation from a given path.", + "time": "2017-10-24T08:12:11+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "time": "2015-12-17T08:42:14+00:00" + } + ], + "packages-dev": [ + { + "name": "asm89/stack-cors", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/asm89/stack-cors.git", + "reference": "c163e2b614550aedcf71165db2473d936abbced6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/asm89/stack-cors/zipball/c163e2b614550aedcf71165db2473d936abbced6", + "reference": "c163e2b614550aedcf71165db2473d936abbced6", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/http-foundation": "~2.7|~3.0|~4.0", + "symfony/http-kernel": "~2.7|~3.0|~4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8.10", + "squizlabs/php_codesniffer": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Asm89\\Stack\\": "src/Asm89/Stack/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander", + "email": "iam.asm89@gmail.com" + } + ], + "description": "Cross-origin resource sharing library and stack middleware", + "homepage": "https://github.com/asm89/stack-cors", + "keywords": [ + "cors", + "stack" + ], + "time": "2017-12-20T14:37:45+00:00" + }, + { + "name": "behat/mink", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "d5ee350c40baff5f331a05ebdbe1927345c9ac8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/d5ee350c40baff5f331a05ebdbe1927345c9ac8b", + "reference": "d5ee350c40baff5f331a05ebdbe1927345c9ac8b", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "^2.7|^3.0|^4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3|^4.0" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)", + "dmore/chrome-mink-driver": "fast and JS-enabled driver for any app (requires chromium or google chrome)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Browser controller/emulator abstraction for PHP", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ], + "time": "2018-06-24T20:08:51+00:00" + }, + { + "name": "behat/mink-browserkit-driver", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", + "reference": "1b9a7ce903cfdaaec5fb32bfdbb26118343662eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/1b9a7ce903cfdaaec5fb32bfdbb26118343662eb", + "reference": "1b9a7ce903cfdaaec5fb32bfdbb26118343662eb", + "shasum": "" + }, + "require": { + "behat/mink": "^1.7.1@dev", + "php": ">=5.3.6", + "symfony/browser-kit": "~2.3|~3.0|~4.0", + "symfony/dom-crawler": "~2.3|~3.0|~4.0" + }, + "require-dev": { + "mink/driver-testsuite": "dev-master", + "symfony/http-kernel": "~2.3|~3.0|~4.0" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Symfony2 BrowserKit driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "Mink", + "Symfony2", + "browser", + "testing" + ], + "time": "2018-05-02T09:25:31+00:00" + }, + { + "name": "behat/mink-goutte-driver", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkGoutteDriver.git", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "shasum": "" + }, + "require": { + "behat/mink": "~1.6@dev", + "behat/mink-browserkit-driver": "~1.2@dev", + "fabpot/goutte": "~1.0.4|~2.0|~3.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7|~3.0" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Goutte driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "goutte", + "headless", + "testing" + ], + "time": "2016-03-05T09:04:22+00:00" + }, + { + "name": "behat/mink-selenium2-driver", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkSelenium2Driver.git", + "reference": "8684ee4e634db7abda9039ea53545f86fc1e105a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/8684ee4e634db7abda9039ea53545f86fc1e105a", + "reference": "8684ee4e634db7abda9039ea53545f86fc1e105a", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1", + "php": ">=5.3.1" + }, + "require-dev": { + "mink/driver-testsuite": "dev-master" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ], + "time": "2018-10-10T12:39:06+00:00" + }, + { + "name": "brumann/polyfill-unserialize", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/dbrumann/polyfill-unserialize.git", + "reference": "844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dbrumann/polyfill-unserialize/zipball/844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b", + "reference": "844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brumann\\Polyfill\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Denis Brumann", + "email": "denis.brumann@sensiolabs.de" + } + ], + "description": "Backports unserialize options introduced in PHP 7.0 to older PHP versions.", + "time": "2017-02-03T09:55:47+00:00" + }, + { + "name": "composer/installers", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "^4.8.36" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Thelia", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "modulework", + "modx", + "moodle", + "osclass", + "phpbb", + "piwik", + "ppi", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "time": "2018-08-27T06:10:37+00:00" + }, + { + "name": "cweagans/composer-patches", + "version": "1.6.5", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "2ec4f00ff5fb64de584c8c4aea53bf9053ecb0b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/2ec4f00ff5fb64de584c8c4aea53bf9053ecb0b3", + "reference": "2ec4f00ff5fb64de584c8c4aea53bf9053ecb0b3", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0", + "phpunit/phpunit": "~4.6" + }, + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "time": "2018-05-11T18:00:16+00:00" + }, + { + "name": "doctrine/annotations", + "version": "v1.2.7", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Annotations\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2015-08-31T12:32:49+00:00" + }, + { + "name": "doctrine/cache", + "version": "v1.6.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", + "shasum": "" + }, + "require": { + "php": "~5.5|~7.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": "~4.8|~5.0", + "predis/predis": "~1.0", + "satooshi/php-coveralls": "~0.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2017-07-22T12:49:21+00:00" + }, + { + "name": "doctrine/collections", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ], + "time": "2015-04-14T22:21:58+00:00" + }, + { + "name": "doctrine/common", + "version": "v2.6.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3", + "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": "~5.5|~7.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8|~5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ], + "time": "2016-11-30T16:50:46+00:00" + }, + { + "name": "doctrine/inflector", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Inflector\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2015-11-06T14:35:42+00:00" + }, + { + "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-14T21:17:01+00:00" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, + { + "name": "drupal/alinks", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/alinks.git", + "reference": "8.x-1.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/alinks-8.x-1.0.zip", + "reference": "8.x-1.0", + "shasum": "299713497d4d88136b2a7212ee0cbb851e97848f" + }, + "require": { + "drupal/core": "*", + "wamania/php-stemmer": "^1.0" + }, + "type": "drupal-module", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + }, + "drupal": { + "version": "8.x-1.0", + "datestamp": "1533185792", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Greg Boggs", + "homepage": "https://www.drupal.org/user/153069" + }, + { + "name": "Ivo.Radulovski", + "homepage": "https://www.drupal.org/user/337498" + }, + { + "name": "chinajason", + "homepage": "https://www.drupal.org/user/276946" + }, + { + "name": "gaurav.goyal", + "homepage": "https://www.drupal.org/user/2497208" + }, + { + "name": "joebachana", + "homepage": "https://www.drupal.org/user/113430" + }, + { + "name": "rsvelko", + "homepage": "https://www.drupal.org/user/337401" + }, + { + "name": "tic2000", + "homepage": "https://www.drupal.org/user/103877" + } + ], + "description": "Allows editors to automatically transform keyword phrases into links", + "homepage": "https://www.drupal.org/project/alinks", + "keywords": [ + "Drupal" + ], + "support": { + "source": "http://cgit.drupalcode.org/alinks", + "issues": "https://www.drupal.org/project/issues/alinks" + } + }, + { + "name": "drupal/coder", + "version": "8.3.3", + "source": { + "type": "git", + "url": "https://git.drupal.org/project/coder.git", + "reference": "a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.5.9", + "squizlabs/php_codesniffer": "^3.4.1", + "symfony/yaml": ">=2.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=3.7 <6" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-0": { + "Drupal\\": "coder_sniffer/Drupal/", + "DrupalPractice\\": "coder_sniffer/DrupalPractice/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "Coder is a library to review Drupal code.", + "homepage": "https://www.drupal.org/project/coder", + "keywords": [ + "code review", + "phpcs", + "standards" + ], + "time": "2019-04-16T18:56:06+00:00" + }, + { + "name": "drupal/core", + "version": "8.7.x-dev", + "source": { + "type": "git", + "url": "https://github.com/drupal/core.git", + "reference": "f0f3b17bbc7327ded84cad4a42ddbe0bf025f38a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/drupal/core/zipball/f0f3b17bbc7327ded84cad4a42ddbe0bf025f38a", + "reference": "f0f3b17bbc7327ded84cad4a42ddbe0bf025f38a", + "shasum": "" + }, + "require": { + "asm89/stack-cors": "^1.1", + "composer/semver": "^1.0", + "doctrine/annotations": "^1.2", + "doctrine/common": "^2.5", + "easyrdf/easyrdf": "^0.9", + "egulias/email-validator": "^2.0", + "ext-date": "*", + "ext-dom": "*", + "ext-filter": "*", + "ext-gd": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-pdo": "*", + "ext-session": "*", + "ext-simplexml": "*", + "ext-spl": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "guzzlehttp/guzzle": "^6.2.1", + "masterminds/html5": "^2.1", + "paragonie/random_compat": "^1.0|^2.0", + "pear/archive_tar": "^1.4", + "php": "^5.5.9|>=7.0.8", + "stack/builder": "^1.0", + "symfony-cmf/routing": "^1.4", + "symfony/class-loader": "~3.4.0", + "symfony/console": "~3.4.0", + "symfony/dependency-injection": "~3.4.26", + "symfony/event-dispatcher": "~3.4.0", + "symfony/http-foundation": "~3.4.26", + "symfony/http-kernel": "~3.4.14", + "symfony/polyfill-iconv": "^1.0", + "symfony/process": "~3.4.0", + "symfony/psr-http-message-bridge": "^1.0", + "symfony/routing": "~3.4.0", + "symfony/serializer": "~3.4.0", + "symfony/translation": "~3.4.0", + "symfony/validator": "~3.4.0", + "symfony/yaml": "~3.4.5", + "twig/twig": "^1.38.2", + "typo3/phar-stream-wrapper": "^2.0.1", + "zendframework/zend-diactoros": "^1.1", + "zendframework/zend-feed": "^2.4" + }, + "conflict": { + "drush/drush": "<8.1.10" + }, + "replace": { + "drupal/action": "self.version", + "drupal/aggregator": "self.version", + "drupal/automated_cron": "self.version", + "drupal/ban": "self.version", + "drupal/bartik": "self.version", + "drupal/basic_auth": "self.version", + "drupal/big_pipe": "self.version", + "drupal/block": "self.version", + "drupal/block_content": "self.version", + "drupal/block_place": "self.version", + "drupal/book": "self.version", + "drupal/breakpoint": "self.version", + "drupal/ckeditor": "self.version", + "drupal/classy": "self.version", + "drupal/color": "self.version", + "drupal/comment": "self.version", + "drupal/config": "self.version", + "drupal/config_translation": "self.version", + "drupal/contact": "self.version", + "drupal/content_moderation": "self.version", + "drupal/content_translation": "self.version", + "drupal/contextual": "self.version", + "drupal/core-annotation": "self.version", + "drupal/core-assertion": "self.version", + "drupal/core-bridge": "self.version", + "drupal/core-class-finder": "self.version", + "drupal/core-datetime": "self.version", + "drupal/core-dependency-injection": "self.version", + "drupal/core-diff": "self.version", + "drupal/core-discovery": "self.version", + "drupal/core-event-dispatcher": "self.version", + "drupal/core-file-cache": "self.version", + "drupal/core-filesystem": "self.version", + "drupal/core-gettext": "self.version", + "drupal/core-graph": "self.version", + "drupal/core-http-foundation": "self.version", + "drupal/core-php-storage": "self.version", + "drupal/core-plugin": "self.version", + "drupal/core-proxy-builder": "self.version", + "drupal/core-render": "self.version", + "drupal/core-serialization": "self.version", + "drupal/core-transliteration": "self.version", + "drupal/core-utility": "self.version", + "drupal/core-uuid": "self.version", + "drupal/core-version": "self.version", + "drupal/datetime": "self.version", + "drupal/datetime_range": "self.version", + "drupal/dblog": "self.version", + "drupal/dynamic_page_cache": "self.version", + "drupal/editor": "self.version", + "drupal/entity_reference": "self.version", + "drupal/field": "self.version", + "drupal/field_layout": "self.version", + "drupal/field_ui": "self.version", + "drupal/file": "self.version", + "drupal/filter": "self.version", + "drupal/forum": "self.version", + "drupal/hal": "self.version", + "drupal/help": "self.version", + "drupal/history": "self.version", + "drupal/image": "self.version", + "drupal/inline_form_errors": "self.version", + "drupal/jsonapi": "self.version", + "drupal/language": "self.version", + "drupal/layout_builder": "self.version", + "drupal/layout_discovery": "self.version", + "drupal/link": "self.version", + "drupal/locale": "self.version", + "drupal/media": "self.version", + "drupal/media_library": "self.version", + "drupal/menu_link_content": "self.version", + "drupal/menu_ui": "self.version", + "drupal/migrate": "self.version", + "drupal/migrate_drupal": "self.version", + "drupal/migrate_drupal_multilingual": "self.version", + "drupal/migrate_drupal_ui": "self.version", + "drupal/minimal": "self.version", + "drupal/node": "self.version", + "drupal/options": "self.version", + "drupal/page_cache": "self.version", + "drupal/path": "self.version", + "drupal/quickedit": "self.version", + "drupal/rdf": "self.version", + "drupal/responsive_image": "self.version", + "drupal/rest": "self.version", + "drupal/search": "self.version", + "drupal/serialization": "self.version", + "drupal/settings_tray": "self.version", + "drupal/seven": "self.version", + "drupal/shortcut": "self.version", + "drupal/simpletest": "self.version", + "drupal/standard": "self.version", + "drupal/stark": "self.version", + "drupal/statistics": "self.version", + "drupal/syslog": "self.version", + "drupal/system": "self.version", + "drupal/taxonomy": "self.version", + "drupal/telephone": "self.version", + "drupal/text": "self.version", + "drupal/toolbar": "self.version", + "drupal/tour": "self.version", + "drupal/tracker": "self.version", + "drupal/update": "self.version", + "drupal/user": "self.version", + "drupal/views": "self.version", + "drupal/views_ui": "self.version", + "drupal/workflows": "self.version", + "drupal/workspaces": "self.version" + }, + "require-dev": { + "behat/mink": "1.7.x-dev", + "behat/mink-goutte-driver": "^1.2", + "behat/mink-selenium2-driver": "1.3.x-dev", + "drupal/coder": "^8.3.1", + "jcalderonzumba/gastonjs": "^1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "justinrainbow/json-schema": "^5.2", + "mikey179/vfsstream": "^1.2", + "phpspec/prophecy": "^1.7", + "phpunit/phpunit": "^4.8.35 || ^6.5", + "symfony/css-selector": "^3.4.0", + "symfony/debug": "^3.4.0", + "symfony/phpunit-bridge": "^3.4.3" + }, + "type": "drupal-core", + "extra": { + "merge-plugin": { + "require": [ + "core/lib/Drupal/Component/Annotation/composer.json", + "core/lib/Drupal/Component/Assertion/composer.json", + "core/lib/Drupal/Component/Bridge/composer.json", + "core/lib/Drupal/Component/ClassFinder/composer.json", + "core/lib/Drupal/Component/Datetime/composer.json", + "core/lib/Drupal/Component/DependencyInjection/composer.json", + "core/lib/Drupal/Component/Diff/composer.json", + "core/lib/Drupal/Component/Discovery/composer.json", + "core/lib/Drupal/Component/EventDispatcher/composer.json", + "core/lib/Drupal/Component/FileCache/composer.json", + "core/lib/Drupal/Component/FileSystem/composer.json", + "core/lib/Drupal/Component/Gettext/composer.json", + "core/lib/Drupal/Component/Graph/composer.json", + "core/lib/Drupal/Component/HttpFoundation/composer.json", + "core/lib/Drupal/Component/PhpStorage/composer.json", + "core/lib/Drupal/Component/Plugin/composer.json", + "core/lib/Drupal/Component/ProxyBuilder/composer.json", + "core/lib/Drupal/Component/Render/composer.json", + "core/lib/Drupal/Component/Serialization/composer.json", + "core/lib/Drupal/Component/Transliteration/composer.json", + "core/lib/Drupal/Component/Utility/composer.json", + "core/lib/Drupal/Component/Uuid/composer.json", + "core/lib/Drupal/Component/Version/composer.json" + ], + "recurse": false, + "replace": false, + "merge-extra": false + } + }, + "autoload": { + "psr-4": { + "Drupal\\Core\\": "lib/Drupal/Core", + "Drupal\\Component\\": "lib/Drupal/Component", + "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver" + }, + "classmap": [ + "lib/Drupal.php", + "lib/Drupal/Component/Utility/Timer.php", + "lib/Drupal/Component/Utility/Unicode.php", + "lib/Drupal/Core/Database/Database.php", + "lib/Drupal/Core/DrupalKernel.php", + "lib/Drupal/Core/DrupalKernelInterface.php", + "lib/Drupal/Core/Site/Settings.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Drupal is an open source content management platform powering millions of websites and applications.", + "time": "2019-04-23T11:47:43+00:00" + }, + { + "name": "drupal/devel", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/devel.git", + "reference": "8.x-2.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/devel-8.x-2.0.zip", + "reference": "8.x-2.0", + "shasum": "cf5fb816f767f3cac4f2e170ab39e982d5e0698b" + }, + "require": { + "drupal/core": "~8.0", + "symfony/var-dumper": "~2.7|^3" + }, + "type": "drupal-module", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + }, + "drupal": { + "version": "8.x-2.0", + "datestamp": "1556799496", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + }, + "drush": { + "services": { + "drush.services.yml": "^9" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "homepage": "https://github.com/weitzman", + "email": "weitzman@tejasa.com", + "role": "Maintainer" + }, + { + "name": "Hans Salvisberg", + "homepage": "https://www.drupal.org/u/salvis", + "email": "drupal@salvisberg.com", + "role": "Maintainer" + }, + { + "name": "Luca Lusso", + "homepage": "https://www.drupal.org/u/lussoluca", + "role": "Maintainer" + }, + { + "name": "Marco (willzyx)", + "homepage": "https://www.drupal.org/u/willzyx", + "role": "Maintainer" + }, + { + "name": "See contributors", + "homepage": "https://www.drupal.org/node/3236/committers" + }, + { + "name": "salvis", + "homepage": "https://www.drupal.org/user/82964" + }, + { + "name": "willzyx", + "homepage": "https://www.drupal.org/user/1043862" + } + ], + "description": "Various blocks, pages, and functions for developers.", + "homepage": "http://drupal.org/project/devel", + "support": { + "source": "http://cgit.drupalcode.org/devel", + "issues": "http://drupal.org/project/devel", + "irc": "irc://irc.freenode.org/drupal-contribute" + } + }, + { + "name": "drupal/empty_theme", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/empty_theme.git", + "reference": "8.x-1.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/empty_theme-8.x-1.0.zip", + "reference": "8.x-1.0", + "shasum": "04e6d2493d2ed9f84cde3d01c3442a34dcbeea18" + }, + "require": { + "drupal/core": "~8.0" + }, + "type": "drupal-theme", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + }, + "drupal": { + "version": "8.x-1.0", + "datestamp": "1488718983", + "security-coverage": { + "status": "not-covered", + "message": "Project has not opted into security advisory coverage!" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Dave Reid", + "homepage": "https://www.drupal.org/user/53892" + }, + { + "name": "moshe weitzman", + "homepage": "https://www.drupal.org/user/23" + } + ], + "description": "An empty theme to use for testing.", + "homepage": "https://www.drupal.org/project/empty_theme", + "support": { + "source": "http://cgit.drupalcode.org/empty_theme" + } + }, + { + "name": "easyrdf/easyrdf", + "version": "0.9.1", + "source": { + "type": "git", + "url": "https://github.com/njh/easyrdf.git", + "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/njh/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566", + "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-pcre": "*", + "php": ">=5.2.8" + }, + "require-dev": { + "phpunit/phpunit": "~3.5", + "sami/sami": "~1.4", + "squizlabs/php_codesniffer": "~1.4.3" + }, + "suggest": { + "ml/json-ld": "~1.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "EasyRdf_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nicholas Humfrey", + "email": "njh@aelius.com", + "homepage": "http://www.aelius.com/njh/", + "role": "Developer" + }, + { + "name": "Alexey Zakhlestin", + "email": "indeyets@gmail.com", + "role": "Developer" + } + ], + "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", + "homepage": "http://www.easyrdf.org/", + "keywords": [ + "Linked Data", + "RDF", + "Semantic Web", + "Turtle", + "rdfa", + "sparql" + ], + "time": "2015-02-27T09:45:49+00:00" + }, + { + "name": "egulias/email-validator", + "version": "2.1.7", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "709f21f92707308cdf8f9bcfa1af4cb26586521e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/709f21f92707308cdf8f9bcfa1af4cb26586521e", + "reference": "709f21f92707308cdf8f9bcfa1af4cb26586521e", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^1.0.1", + "php": ">= 5.5" + }, + "require-dev": { + "dominicsayers/isemail": "dev-master", + "phpunit/phpunit": "^4.8.35||^5.7||^6.0", + "satooshi/php-coveralls": "^1.0.1" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Egulias\\EmailValidator\\": "EmailValidator" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails against several RFCs", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "time": "2018-12-04T22:38:24+00:00" + }, + { + "name": "fabpot/goutte", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "3f0eaf0a40181359470651f1565b3e07e3dd31b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/3f0eaf0a40181359470651f1565b3e07e3dd31b8", + "reference": "3f0eaf0a40181359470651f1565b3e07e3dd31b8", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1|~3.0|~4.0", + "symfony/css-selector": "~2.1|~3.0|~4.0", + "symfony/dom-crawler": "~2.1|~3.0|~4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3 || ^4" + }, + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Goutte\\": "Goutte" + }, + "exclude-from-classmap": [ + "Goutte/Tests" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", + "keywords": [ + "scraper" + ], + "time": "2018-06-29T15:13:57+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/28f932580981e912ab8f01d15788f1dee06550c8", + "reference": "28f932580981e912ab8f01d15788f1dee06550c8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2019-02-11T20:22:44+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "instaclick/php-webdriver", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "6fa959452e774dcaed543faad3a9d1a37d803327" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/6fa959452e774dcaed543faad3a9d1a37d803327", + "reference": "6fa959452e774dcaed543faad3a9d1a37d803327", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "satooshi/php-coveralls": "^1.0||^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ], + "time": "2017-06-30T04:02:48+00:00" + }, + { + "name": "jcalderonzumba/gastonjs", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/jcalderonzumba/gastonjs.git", + "reference": "575a9c18d8b87990c37252e8d9707b29f0a313f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/575a9c18d8b87990c37252e8d9707b29f0a313f3", + "reference": "575a9c18d8b87990c37252e8d9707b29f0a313f3", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~5.0|~6.0", + "php": ">=5.4" + }, + "require-dev": { + "phpunit/phpunit": "~4.6", + "silex/silex": "~1.2", + "symfony/phpunit-bridge": "~2.7", + "symfony/process": "~2.1" + }, + "type": "phantomjs-api", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zumba\\GastonJS\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Juan Francisco Calderón Zumba", + "email": "juanfcz@gmail.com", + "homepage": "http://github.com/jcalderonzumba" + } + ], + "description": "PhantomJS API based server for webpage automation", + "homepage": "https://github.com/jcalderonzumba/gastonjs", + "keywords": [ + "api", + "automation", + "browser", + "headless", + "phantomjs" + ], + "time": "2017-03-31T07:31:47+00:00" + }, + { + "name": "jcalderonzumba/mink-phantomjs-driver", + "version": "v0.3.3", + "source": { + "type": "git", + "url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git", + "reference": "008f43670e94acd39273d15add1e7348eb23848d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/008f43670e94acd39273d15add1e7348eb23848d", + "reference": "008f43670e94acd39273d15add1e7348eb23848d", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7", + "jcalderonzumba/gastonjs": "~1.0", + "php": ">=5.4", + "twig/twig": "~1.20|~2.0" + }, + "require-dev": { + "mink/driver-testsuite": "dev-master", + "phpunit/phpunit": "~4.6" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "0.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zumba\\Mink\\Driver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Juan Francisco Calderón Zumba", + "email": "juanfcz@gmail.com", + "homepage": "http://github.com/jcalderonzumba" + } + ], + "description": "PhantomJS driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "headless", + "javascript", + "phantomjs", + "testing" + ], + "time": "2016-12-01T10:57:30+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.8", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "dcb6e1006bb5fd1e392b4daa68932880f37550d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/dcb6e1006bb5fd1e392b4daa68932880f37550d4", + "reference": "dcb6e1006bb5fd1e392b4daa68932880f37550d4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2019-01-14T23:55:14+00:00" + }, + { + "name": "lox/xhprof", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/lox/xhprof.git", + "reference": "c64571f892bda1298bad9c5e94ede0bc3f0e4627" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lox/xhprof/zipball/c64571f892bda1298bad9c5e94ede0bc3f0e4627", + "reference": "c64571f892bda1298bad9c5e94ede0bc3f0e4627", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "bin": [ + "bin/xhprofile" + ], + "type": "library", + "autoload": { + "files": [ + "xhprof_lib/utils/xhprof_lib.php", + "xhprof_lib/utils/xhprof_runs.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "XHProf: A Hierarchical Profiler for PHP", + "homepage": "http://pecl.php.net/package/xhprof", + "keywords": [ + "performance", + "profiling" + ], + "time": "2015-08-31T22:07:48+00:00" + }, + { + "name": "masterminds/html5", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "2c37c6c520b995b761674de3be8455a381679067" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/2c37c6c520b995b761674de3be8455a381679067", + "reference": "2c37c6c520b995b761674de3be8455a381679067", + "shasum": "" + }, + "require": { + "ext-libxml": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "sami/sami": "~2.0", + "satooshi/php-coveralls": "1.0.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "time": "2017-09-04T12:26:28+00:00" + }, + { + "name": "mikey179/vfsStream", + "version": "v1.6.6", + "source": { + "type": "git", + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "org\\bovigo\\vfs\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Frank Kleine", + "homepage": "http://frankkleine.de/", + "role": "Developer" + } + ], + "description": "Virtual file system to mock the real file system in unit tests.", + "homepage": "http://vfs.bovigo.org/", + "time": "2019-04-08T13:54:32+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.18", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2019-01-03T20:59:08+00:00" + }, + { + "name": "pear/archive_tar", + "version": "1.4.6", + "source": { + "type": "git", + "url": "https://github.com/pear/Archive_Tar.git", + "reference": "b8e33f9063a7cd1d20f079014f8382b3a7aee47e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/b8e33f9063a7cd1d20f079014f8382b3a7aee47e", + "reference": "b8e33f9063a7cd1d20f079014f8382b3a7aee47e", + "shasum": "" + }, + "require": { + "pear/pear-core-minimal": "^1.10.0alpha2", + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-bz2": "Bz2 compression support.", + "ext-xz": "Lzma2 compression support.", + "ext-zlib": "Gzip compression support." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Archive_Tar": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Vincent Blavet", + "email": "vincent@phpconcept.net" + }, + { + "name": "Greg Beaver", + "email": "greg@chiaraquartet.net" + }, + { + "name": "Michiel Rook", + "email": "mrook@php.net" + } + ], + "description": "Tar file management class with compression support (gzip, bzip2, lzma2)", + "homepage": "https://github.com/pear/Archive_Tar", + "keywords": [ + "archive", + "tar" + ], + "time": "2019-02-01T11:10:38+00:00" + }, + { + "name": "pear/console_getopt", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/pear/Console_Getopt.git", + "reference": "82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f", + "reference": "82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Console": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Greg Beaver", + "email": "cellog@php.net", + "role": "Helper" + }, + { + "name": "Andrei Zmievski", + "email": "andrei@php.net", + "role": "Lead" + }, + { + "name": "Stig Bakken", + "email": "stig@php.net", + "role": "Developer" + } + ], + "description": "More info available on: http://pear.php.net/package/Console_Getopt", + "time": "2015-07-20T20:28:12+00:00" + }, + { + "name": "pear/pear-core-minimal", + "version": "v1.10.7", + "source": { + "type": "git", + "url": "https://github.com/pear/pear-core-minimal.git", + "reference": "19a3e0fcd50492c4357372f623f55f1b144346da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/19a3e0fcd50492c4357372f623f55f1b144346da", + "reference": "19a3e0fcd50492c4357372f623f55f1b144346da", + "shasum": "" + }, + "require": { + "pear/console_getopt": "~1.4", + "pear/pear_exception": "~1.0" + }, + "replace": { + "rsky/pear-core-min": "self.version" + }, + "type": "library", + "autoload": { + "psr-0": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "src/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@php.net", + "role": "Lead" + } + ], + "description": "Minimal set of PEAR core files to be used as composer dependency", + "time": "2018-12-05T20:03:52+00:00" + }, + { + "name": "pear/pear_exception", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/pear/PEAR_Exception.git", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b", + "shasum": "" + }, + "require": { + "php": ">=4.4.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "class", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "PEAR": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "." + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Helgi Thormar", + "email": "dufuz@php.net" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net" + } + ], + "description": "The PEAR Exception base class.", + "homepage": "https://github.com/pear/PEAR_Exception", + "keywords": [ + "exception" + ], + "time": "2015-02-10T20:07:52+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "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": "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)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.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", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.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": "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": "2018-04-06T15:36:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.14", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.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": "2019-02-01T05:22:47+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" ], "authors": [ { - "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com" + "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" } ], - "time": "2018-09-29T17:23:10+00:00" + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" }, { - "name": "jakub-onderka/php-console-highlighter", - "version": "v0.4", + "name": "sebastian/diff", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", - "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/9f7a229a69d52506914b4bc61bfdb199d90c5547", - "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "jakub-onderka/php-console-color": "~0.2", - "php": ">=5.4.0" + "php": "^7.0" }, "require-dev": { - "jakub-onderka/php-code-style": "~1.0", - "jakub-onderka/php-parallel-lint": "~1.0", - "jakub-onderka/php-var-dump-check": "~0.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5" + "phpunit/phpunit": "^6.2" }, "type": "library", - "autoload": { - "psr-4": { - "JakubOnderka\\PhpConsoleHighlighter\\": "src/" + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jakub Onderka", - "email": "acci@acci.cz", - "homepage": "http://www.acci.cz/" + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Highlight PHP code in terminal", - "time": "2018-09-29T18:48:56+00:00" + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03T08:09:46+00:00" }, { - "name": "nikic/php-parser", - "version": "v2.1.1", + "name": "sebastian/environment", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4dd659edadffdc2143e4753df655d866dbfeedf0", - "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.4" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^6.1" }, - "bin": [ - "bin/php-parse" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -379,351 +5717,450 @@ ], "authors": [ { - "name": "Nikita Popov" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "A PHP parser written in PHP", + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", "keywords": [ - "parser", - "php" + "Xdebug", + "environment", + "hhvm" ], - "time": "2016-09-16T12:04:44+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { - "name": "pear/console_table", - "version": "v1.3.1", + "name": "sebastian/exporter", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/pear/Console_Table.git", - "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Console_Table/zipball/1930c11897ca61fd24b95f2f785e99e0f36dcdea", - "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.2.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, - "suggest": { - "pear/Console_Color2": ">=0.1.2" + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, "autoload": { "classmap": [ - "Table.php" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "BSD-3-Clause" ], "authors": [ { - "name": "Jan Schneider", - "homepage": "http://pear.php.net/user/yunosh" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" }, { - "name": "Tal Peer", - "homepage": "http://pear.php.net/user/tal" + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" }, { - "name": "Xavier Noguer", - "homepage": "http://pear.php.net/user/xnoguer" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Richard Heyes", - "homepage": "http://pear.php.net/user/richard" + "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": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "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": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "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/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "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": "Library that makes it easy to build console style tables.", - "homepage": "http://pear.php.net/package/Console_Table/", - "keywords": [ - "console" - ], - "time": "2018-01-25T20:47:17+00:00" + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { - "name": "psr/log", - "version": "1.1.0", + "name": "sebastian/recursion-context", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2018-11-20T15:27:04+00:00" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" }, { - "name": "psy/psysh", - "version": "v0.9.9", + "name": "sebastian/resource-operations", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", - "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "shasum": "" }, "require": { - "dnoegel/php-xdg-base-dir": "0.1", - "ext-json": "*", - "ext-tokenizer": "*", - "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*", - "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", - "php": ">=5.4.0", - "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", - "symfony/var-dumper": "~2.7|~3.0|~4.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "hoa/console": "~2.15|~3.16", - "phpunit/phpunit": "~4.8.35|~5.0|~6.0|~7.0" - }, - "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." + "php": ">=5.6.0" }, - "bin": [ - "bin/psysh" - ], "type": "library", "extra": { "branch-alias": { - "dev-develop": "0.9.x-dev" + "dev-master": "1.0.x-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" } ], - "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", - "keywords": [ - "REPL", - "console", - "interactive", - "shell" - ], - "time": "2018-10-13T15:16:03+00:00" + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" }, { - "name": "symfony/console", - "version": "v2.8.49", + "name": "sebastian/version", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2|~3.0.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log-implementation": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" + "php": ">=5.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2018-11-20T15:55:20+00:00" + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" }, { - "name": "symfony/debug", - "version": "v2.8.49", + "name": "squizlabs/php_codesniffer", + "version": "3.4.2", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0" + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", - "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", "shasum": "" }, "require": { - "php": ">=5.3.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" }, "require-dev": { - "symfony/class-loader": "~2.2|~3.0.0", - "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Greg Sherwood", + "role": "lead" } ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2019-04-10T23:49:02+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v2.8.49", + "name": "stack/builder", + "version": "v1.0.5", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" + "url": "https://github.com/stackphp/builder.git", + "reference": "fb3d136d04c6be41120ebf8c0cc71fe9507d750a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", + "url": "https://api.github.com/repos/stackphp/builder/zipball/fb3d136d04c6be41120ebf8c0cc71fe9507d750a", + "reference": "fb3d136d04c6be41120ebf8c0cc71fe9507d750a", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.0", + "symfony/http-foundation": "~2.1|~3.0|~4.0", + "symfony/http-kernel": "~2.1|~3.0|~4.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "silex/silex": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "1.0-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "psr-0": { + "Stack": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -731,48 +6168,56 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2018-11-21T14:20:20+00:00" + "description": "Builder for stack middlewares based on HttpKernelInterface.", + "keywords": [ + "stack" + ], + "time": "2017-11-18T14:57:29+00:00" }, { - "name": "symfony/finder", - "version": "v2.8.49", + "name": "symfony-cmf/routing", + "version": "1.4.1", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "1444eac52273e345d9b95129bf914639305a9ba4" + "url": "https://github.com/symfony-cmf/routing.git", + "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1444eac52273e345d9b95129bf914639305a9ba4", - "reference": "1444eac52273e345d9b95129bf914639305a9ba4", + "url": "https://api.github.com/repos/symfony-cmf/routing/zipball/fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac", + "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.3.9|^7.0", + "psr/log": "1.*", + "symfony/http-kernel": "^2.2|3.*", + "symfony/routing": "^2.2|3.*" + }, + "require-dev": { + "friendsofsymfony/jsrouting-bundle": "^1.1", + "symfony-cmf/testing": "^1.3", + "symfony/config": "^2.2|3.*", + "symfony/dependency-injection": "^2.0.5|3.*", + "symfony/event-dispatcher": "^2.1|3.*" + }, + "suggest": { + "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version (~2.1)" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "1.4-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Cmf\\Component\\Routing\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -780,50 +6225,55 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Symfony CMF Community", + "homepage": "https://github.com/symfony-cmf/Routing/contributors" } ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers", + "homepage": "http://cmf.symfony.com", + "keywords": [ + "database", + "routing" + ], + "time": "2017-05-09T08:10:41+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.10.0", + "name": "symfony/browser-kit", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "url": "https://github.com/symfony/browser-kit.git", + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/7f2b0843d5045468225f9a9b27a0cb171ae81828", + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.5.9|>=7.0.8", + "symfony/dom-crawler": "~2.8|~3.0|~4.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0" }, "suggest": { - "ext-ctype": "For best performance" + "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "3.4-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Component\\BrowserKit\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -832,56 +6282,54 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Gert de Pagter", - "email": "backendtea@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-04-06T19:33:58+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", + "name": "symfony/class-loader", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "url": "https://github.com/symfony/class-loader.git", + "reference": "4459eef5298dedfb69f771186a580062b8516497" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/4459eef5298dedfb69f771186a580062b8516497", + "reference": "4459eef5298dedfb69f771186a580062b8516497", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.5.9|>=7.0.8" + }, + "require-dev": { + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/polyfill-apcu": "~1.1" }, "suggest": { - "ext-mbstring": "For best performance" + "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "3.4-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Component\\ClassLoader\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -890,66 +6338,44 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2019-01-16T09:39:14+00:00" }, { - "name": "symfony/var-dumper", - "version": "v2.8.49", + "name": "symfony/css-selector", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "91abb1e39d14fb7773d25de9c711949ea8502ac1" + "url": "https://github.com/symfony/css-selector.git", + "reference": "8ca29297c29b64fb3a1a135e71cb25f67f9fdccf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/91abb1e39d14fb7773d25de9c711949ea8502ac1", - "reference": "91abb1e39d14fb7773d25de9c711949ea8502ac1", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/8ca29297c29b64fb3a1a135e71cb25f67f9fdccf", + "reference": "8ca29297c29b64fb3a1a135e71cb25f67f9fdccf", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" - }, - "require-dev": { - "ext-iconv": "*", - "twig/twig": "~1.34|~2.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-symfony_debug": "" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { - "files": [ - "Resources/functions/dump.php" - ], "psr-4": { - "Symfony\\Component\\VarDumper\\": "" + "Symfony\\Component\\CssSelector\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -961,49 +6387,70 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony mechanism for exploring and dumping PHP variables", + "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-01-16T09:39:14+00:00" }, { - "name": "symfony/yaml", - "version": "v2.8.49", + "name": "symfony/dependency-injection", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "02c1859112aa779d9ab394ae4f3381911d84052b" + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "dee85a9148399cdb2731603802842bcfd8afe5ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b", - "reference": "02c1859112aa779d9ab394ae4f3381911d84052b", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/dee85a9148399cdb2731603802842bcfd8afe5ab", + "reference": "dee85a9148399cdb2731603802842bcfd8afe5ab", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/polyfill-ctype": "~1.8" + "php": "^5.5.9|>=7.0.8", + "psr/container": "^1.0" + }, + "conflict": { + "symfony/config": "<3.3.7", + "symfony/finder": "<3.3", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0" + }, + "require-dev": { + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Symfony\\Component\\DependencyInjection\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -1023,79 +6470,102 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-04-16T11:13:42+00:00" }, { - "name": "webflo/drupal-finder", - "version": "1.1.0", + "name": "symfony/dom-crawler", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/webflo/drupal-finder.git", - "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637" + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/8a7886c575d6eaa67a425dceccc84e735c0b9637", - "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d40023c057393fb25f7ca80af2a56ed948c45a09", + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09", "shasum": "" }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, "require-dev": { - "mikey179/vfsstream": "^1.6", - "phpunit/phpunit": "^4.8" + "symfony/css-selector": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/css-selector": "" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, "autoload": { - "classmap": [ - "src/DrupalFinder.php" + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "MIT" ], "authors": [ { - "name": "Florian Weber", - "email": "florian@webflo.org" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Helper class to locate a Drupal installation from a given path.", - "time": "2017-10-24T08:12:11+00:00" + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:06:07+00:00" }, { - "name": "webmozart/assert", - "version": "1.4.0", + "name": "symfony/http-foundation", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + "url": "https://github.com/symfony/http-foundation.git", + "reference": "90454ad44c95d75faf3507d56388056001b74baf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/90454ad44c95d75faf3507d56388056001b74baf", + "reference": "90454ad44c95d75faf3507d56388056001b74baf", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php70": "~1.6" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "symfony/expression-language": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { "psr-4": { - "Webmozart\\Assert\\": "src/" - } + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1103,50 +6573,88 @@ ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2018-12-25T11:19:39+00:00" + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2019-04-17T14:51:18+00:00" }, { - "name": "webmozart/path-util", - "version": "2.3.0", + "name": "symfony/http-kernel", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + "url": "https://github.com/symfony/http-kernel.git", + "reference": "14fa41ccd38570b5e3120a3754bbaa144a15f311" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/14fa41ccd38570b5e3120a3754bbaa144a15f311", + "reference": "14fa41ccd38570b5e3120a3754bbaa144a15f311", "shasum": "" }, "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0", + "symfony/debug": "^3.3.3|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~3.4.12|~4.0.12|^4.1.1", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4.10|<4.0.10,>=4", + "symfony/var-dumper": "<3.3", + "twig/twig": "<1.34|<2.4,>=2" + }, + "provide": { + "psr/log-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "psr/cache": "~1.0", + "symfony/browser-kit": "~2.8|~3.0|~4.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/console": "~2.8|~3.0|~4.0", + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "^3.4.10|^4.0.10", + "symfony/dom-crawler": "~2.8|~3.0|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0", + "symfony/templating": "~2.8|~3.0|~4.0", + "symfony/translation": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~3.3|~4.0" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "", + "symfony/var-dumper": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1154,49 +6662,64 @@ ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "time": "2015-12-17T08:42:14+00:00" - } - ], - "packages-dev": [ + "description": "Symfony HttpKernel Component", + "homepage": "https://symfony.com", + "time": "2019-04-17T15:57:07+00:00" + }, { - "name": "doctrine/instantiator", - "version": "1.0.5", + "name": "symfony/phpunit-bridge", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "url": "https://github.com/symfony/phpunit-bridge.git", + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/a43a2f6c465a2d99635fea0addbebddc3864ad97", + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": ">=5.3.3" }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, - "type": "library", + "suggest": { + "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" + }, + "bin": [ + "bin/simple-phpunit" + ], + "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.4-dev" + }, + "thanks": { + "name": "phpunit/phpunit", + "url": "https://github.com/sebastianbergmann/phpunit" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } + "Symfony\\Bridge\\PhpUnit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1204,55 +6727,51 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "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-14T21:17:01+00:00" + "description": "Symfony PHPUnit Bridge", + "homepage": "https://symfony.com", + "time": "2019-04-16T09:03:16+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", + "name": "symfony/polyfill-iconv", + "version": "v1.11.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + "url": "https://github.com/symfony/polyfill-iconv.git", + "reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/f037ea22acfaee983e271dd9c3b8bb4150bd8ad7", + "reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "ext-iconv": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.11-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } + "psr-4": { + "Symfony\\Polyfill\\Iconv\\": "" + }, + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1260,47 +6779,59 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "time": "2016-01-25T08:17:30+00:00" + "description": "Symfony polyfill for the Iconv extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "iconv", + "polyfill", + "portable", + "shim" + ], + "time": "2019-02-06T07:57:58+00:00" }, { - "name": "phpspec/prophecy", - "version": "1.8.0", + "name": "symfony/polyfill-php70", + "version": "v1.11.0", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "bc4858fb611bda58719124ca079baff854149c89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89", + "reference": "bc4858fb611bda58719124ca079baff854149c89", "shasum": "" }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.11-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1308,322 +6839,418 @@ ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "compatibility", + "polyfill", + "portable", + "shim" ], - "time": "2018-08-05T17:53:17+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "name": "symfony/psr-http-message-bridge", + "version": "v1.1.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "a33352af16f78a5ff4f9d90811536abf210df12b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/a33352af16f78a5ff4f9d90811536abf210df12b", + "reference": "a33352af16f78a5ff4f9d90811536abf210df12b", "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" + "php": "^5.3.3 || ^7.0", + "psr/http-message": "^1.0", + "symfony/http-foundation": "^2.3.42 || ^3.4 || ^4.0" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "symfony/phpunit-bridge": "^3.4 || ^4.0" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" }, - "type": "library", + "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "1.1-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Bridge\\PsrHttpMessage\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "PSR HTTP message bridge", + "homepage": "http://symfony.com", "keywords": [ - "coverage", - "testing", - "xunit" + "http", + "http-message", + "psr-17", + "psr-7" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2019-04-03T17:09:40+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "name": "symfony/routing", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "url": "https://github.com/symfony/routing.git", + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/symfony/routing/zipball/ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/config": "<3.3.1", + "symfony/dependency-injection": "<3.3", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "psr/log": "~1.0", + "symfony/config": "^3.3.1|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "3.4-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", "keywords": [ - "filesystem", - "iterator" + "router", + "routing", + "uri", + "url" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2019-03-29T21:58:42+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "symfony/serializer", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/symfony/serializer.git", + "reference": "14b3221cc41dcfef404205f0060cda873f43a534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/symfony/serializer/zipball/14b3221cc41dcfef404205f0060cda873f43a534", + "reference": "14b3221cc41dcfef404205f0060cda873f43a534", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "phpdocumentor/type-resolver": "<0.2.1", + "symfony/dependency-injection": "<3.2", + "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", + "symfony/property-info": "<3.1", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", + "symfony/cache": "~3.1|~4.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.2|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/property-access": "~2.8|~3.0|~4.0", + "symfony/property-info": "~3.1|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/http-foundation": "To use the DataUriNormalizer.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/property-info": "To deserialize relations.", + "symfony/yaml": "For using the default YAML mapping loader." }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" + "description": "Symfony Serializer Component", + "homepage": "https://symfony.com", + "time": "2019-04-11T05:44:34+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "symfony/translation", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/symfony/translation.git", + "reference": "aae26f143da71adc8707eb489f1dc86aef7d376b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/symfony/translation/zipball/aae26f143da71adc8707eb489f1dc86aef7d376b", + "reference": "aae26f143da71adc8707eb489f1dc86aef7d376b", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/var-dumper": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "3.4-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2019-04-10T16:00:48+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.4.12", + "name": "symfony/validator", + "version": "v3.4.26", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "url": "https://github.com/symfony/validator.git", + "reference": "83da5259779aaf9dde220130e62b785f74e2ac49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/symfony/validator/zipball/83da5259779aaf9dde220130e62b785f74e2ac49", + "reference": "83da5259779aaf9dde220130e62b785f74e2ac49", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~2.8|~3.0|~4.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/dependency-injection": "<3.3", + "symfony/http-kernel": "<3.3.5", + "symfony/yaml": "<3.4" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.8|~2.0", + "symfony/cache": "~3.1|~4.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/http-kernel": "^3.3.5|~4.0", + "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/property-access": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~3.3|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "", + "symfony/expression-language": "For using the Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For accessing properties within comparison constraints", + "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.4-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-12-04T08:55:13+00:00" + "description": "Symfony Validator Component", + "homepage": "https://symfony.com", + "time": "2019-04-16T11:21:44+00:00" }, { - "name": "phpunit/phpunit", - "version": "4.8.36", + "name": "theseer/tokenizer", + "version": "1.1.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8", "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.2.2", - "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" + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" }, - "bin": [ - "phpunit" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -1635,109 +7262,88 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2017-06-21T08:07:12+00:00" + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-04-04T09:56:43+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "name": "typo3/phar-stream-wrapper", + "version": "v2.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "url": "https://github.com/TYPO3/phar-stream-wrapper.git", + "reference": "b7a21f0859059ed5d9754af8c11f852d43762334" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/TYPO3/phar-stream-wrapper/zipball/b7a21f0859059ed5d9754af8c11f852d43762334", + "reference": "b7a21f0859059ed5d9754af8c11f852d43762334", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "brumann/polyfill-unserialize": "^1.0", + "ext-fileinfo": "*", + "ext-json": "*", + "php": "^5.3.3|^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "^4.8.36" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "TYPO3\\PharStreamWrapper\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } + "MIT" ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Interceptors for PHP's native phar:// stream handling", + "homepage": "https://typo3.org/", "keywords": [ - "mock", - "xunit" + "phar", + "php", + "security", + "stream-wrapper" ], - "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" + "time": "2019-03-01T17:43:52+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.4", + "name": "vlucas/phpdotenv", + "version": "v2.6.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "2a7dcf7e3e02dc5e701004e51a6f304b713107d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2a7dcf7e3e02dc5e701004e51a6f304b713107d5", + "reference": "2a7dcf7e3e02dc5e701004e51a6f304b713107d5", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": ">=5.3.9", + "symfony/polyfill-ctype": "^1.9" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8.35 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.6-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Dotenv\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1745,399 +7351,480 @@ ], "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": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "http://www.vancelucas.com" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", "keywords": [ - "comparator", - "compare", - "equality" + "dotenv", + "env", + "environment" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2019-01-29T11:11:52+00:00" }, { - "name": "sebastian/diff", - "version": "1.4.3", + "name": "wamania/php-stemmer", + "version": "1.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "url": "https://github.com/wamania/php-stemmer.git", + "reference": "6cc76829bddd46f7ae7678e0bf87a0c872c8cf58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/wamania/php-stemmer/zipball/6cc76829bddd46f7ae7678e0bf87a0c872c8cf58", + "reference": "6cc76829bddd46f7ae7678e0bf87a0c872c8cf58", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^4.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Wamania\\Snowball\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Wamania", + "homepage": "http://wamania.com" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", + "description": "Native PHP5 Stemmer", "keywords": [ - "diff" + "php", + "porter", + "stemmer" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-01-27T17:16:44+00:00" }, { - "name": "sebastian/environment", - "version": "1.3.8", + "name": "webflo/drupal-core-require-dev", + "version": "8.7.x-dev", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "url": "https://github.com/webflo/drupal-core-require-dev.git", + "reference": "5252b01d58630bba69bcbd5973b91e3bb1cf0cb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/webflo/drupal-core-require-dev/zipball/5252b01d58630bba69bcbd5973b91e3bb1cf0cb5", + "reference": "5252b01d58630bba69bcbd5973b91e3bb1cf0cb5", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "behat/mink": "1.7.x-dev", + "behat/mink-goutte-driver": "^1.2", + "behat/mink-selenium2-driver": "1.3.x-dev", + "drupal/coder": "^8.3.1", + "drupal/core": "8.7.x-dev", + "jcalderonzumba/gastonjs": "^1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "justinrainbow/json-schema": "^5.2", + "mikey179/vfsstream": "^1.2", + "phpspec/prophecy": "^1.7", + "phpunit/phpunit": "^4.8.35 || ^6.5", + "symfony/css-selector": "^3.4.0", + "symfony/debug": "^3.4.0", + "symfony/phpunit-bridge": "^3.4.3" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "require-dev dependencies from drupal/core", + "time": "2019-04-18T16:01:39+00:00" + }, + { + "name": "webflo/drupal-core-strict", + "version": "8.7.x-dev", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-core-strict.git", + "reference": "65bd234e7850a1798760df87d1889f7a866e2b84" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-core-strict/zipball/65bd234e7850a1798760df87d1889f7a866e2b84", + "reference": "65bd234e7850a1798760df87d1889f7a866e2b84", + "shasum": "" }, - "autoload": { - "classmap": [ - "src/" - ] + "require": { + "asm89/stack-cors": "1.2.0", + "brumann/polyfill-unserialize": "v1.0.3", + "composer/installers": "v1.6.0", + "composer/semver": "1.5.0", + "doctrine/annotations": "v1.2.7", + "doctrine/cache": "v1.6.2", + "doctrine/collections": "v1.3.0", + "doctrine/common": "v2.6.2", + "doctrine/inflector": "v1.1.0", + "doctrine/lexer": "v1.0.1", + "easyrdf/easyrdf": "0.9.1", + "egulias/email-validator": "2.1.7", + "guzzlehttp/guzzle": "6.3.3", + "guzzlehttp/promises": "v1.3.1", + "guzzlehttp/psr7": "1.4.2", + "masterminds/html5": "2.3.0", + "paragonie/random_compat": "v2.0.18", + "pear/archive_tar": "1.4.6", + "pear/console_getopt": "v1.4.1", + "pear/pear-core-minimal": "v1.10.7", + "pear/pear_exception": "v1.0.0", + "psr/container": "1.0.0", + "psr/http-message": "1.0.1", + "psr/log": "1.0.2", + "stack/builder": "v1.0.5", + "symfony-cmf/routing": "1.4.1", + "symfony/class-loader": "v3.4.26", + "symfony/console": "v3.4.26", + "symfony/debug": "v3.4.26", + "symfony/dependency-injection": "v3.4.26", + "symfony/event-dispatcher": "v3.4.26", + "symfony/http-foundation": "v3.4.26", + "symfony/http-kernel": "v3.4.26", + "symfony/polyfill-ctype": "v1.11.0", + "symfony/polyfill-iconv": "v1.11.0", + "symfony/polyfill-mbstring": "v1.11.0", + "symfony/polyfill-php70": "v1.11.0", + "symfony/process": "v3.4.26", + "symfony/psr-http-message-bridge": "v1.1.2", + "symfony/routing": "v3.4.26", + "symfony/serializer": "v3.4.26", + "symfony/translation": "v3.4.26", + "symfony/validator": "v3.4.26", + "symfony/yaml": "v3.4.26", + "twig/twig": "v1.38.4", + "typo3/phar-stream-wrapper": "v2.1.0", + "wikimedia/composer-merge-plugin": "v1.4.1", + "zendframework/zend-diactoros": "1.4.1", + "zendframework/zend-escaper": "2.5.2", + "zendframework/zend-feed": "2.7.0", + "zendframework/zend-stdlib": "3.0.1" }, + "require-dev": { + "behat/mink": "dev-master#9ea1cebe3dc529ba3861d87c818f045362c40484", + "behat/mink-browserkit-driver": "1.3.3", + "behat/mink-goutte-driver": "v1.2.1", + "behat/mink-selenium2-driver": "dev-master#93474c65a2a7bf959200ab5f7a14cc450645c185", + "doctrine/instantiator": "1.0.5", + "drupal/coder": "8.3.1", + "fabpot/goutte": "v3.2.3", + "instaclick/php-webdriver": "1.4.5", + "ircmaxell/password-compat": "v1.0.4", + "jcalderonzumba/gastonjs": "v1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "v0.3.2", + "justinrainbow/json-schema": "5.2.8", + "mikey179/vfsstream": "v1.6.5", + "phpdocumentor/reflection-docblock": "2.0.4", + "phpspec/prophecy": "v1.7.0", + "phpunit/php-code-coverage": "2.2.4", + "phpunit/php-file-iterator": "1.4.5", + "phpunit/php-text-template": "1.2.1", + "phpunit/php-timer": "1.0.9", + "phpunit/php-token-stream": "1.4.12", + "phpunit/phpunit": "4.8.36", + "phpunit/phpunit-mock-objects": "2.3.8", + "sebastian/comparator": "1.2.4", + "sebastian/diff": "1.4.3", + "sebastian/environment": "1.3.8", + "sebastian/exporter": "1.2.2", + "sebastian/global-state": "1.1.1", + "sebastian/recursion-context": "1.0.5", + "sebastian/version": "1.0.6", + "squizlabs/php_codesniffer": "3.4.1", + "symfony/browser-kit": "v3.4.26", + "symfony/css-selector": "v3.4.26", + "symfony/dom-crawler": "v3.4.26", + "symfony/phpunit-bridge": "v3.4.26" + }, + "type": "metapackage", "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" + "GPL-2.0-or-later" ], - "time": "2016-08-18T05:49:44+00:00" + "description": "Locked core dependencies", + "time": "2019-04-18T16:00:48+00:00" }, { - "name": "sebastian/exporter", - "version": "1.2.2", + "name": "wikimedia/composer-merge-plugin", + "version": "v1.4.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "url": "https://github.com/wikimedia/composer-merge-plugin.git", + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "composer-plugin-api": "^1.0", + "php": ">=5.3.2" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "composer/composer": "~1.0.0", + "jakub-onderka/php-parallel-lint": "~0.8", + "phpunit/phpunit": "~4.8|~5.0", + "squizlabs/php_codesniffer": "~2.1.0" }, - "type": "library", + "type": "composer-plugin", "extra": { "branch-alias": { "dev-master": "1.3.x-dev" - } + }, + "class": "Wikimedia\\Composer\\MergePlugin" }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Wikimedia\\Composer\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "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" + "name": "Bryan Davis", + "email": "bd808@wikimedia.org" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-06-17T09:04:28+00:00" + "description": "Composer plugin to merge multiple composer.json files", + "time": "2017-04-25T02:31:25+00:00" }, { - "name": "sebastian/global-state", - "version": "1.1.1", + "name": "zendframework/zend-diactoros", + "version": "1.4.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "url": "https://github.com/zendframework/zend-diactoros.git", + "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/424a840dc3bedcdeea510b42e056c77c2d6c4bef", + "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.4 || ^7.0", + "psr/http-message": "~1.0" }, - "require-dev": { - "phpunit/phpunit": "~4.2" + "provide": { + "psr/http-message-implementation": "1.0" }, - "suggest": { - "ext-uopz": "*" + "require-dev": { + "ext-dom": "*", + "ext-libxml": "*", + "phpunit/phpunit": "^4.6 || ^5.5", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.4-dev", + "dev-develop": "1.5-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Zend\\Diactoros\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } + "BSD-2-Clause" ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "PSR HTTP Message implementations", + "homepage": "https://github.com/zendframework/zend-diactoros", "keywords": [ - "global state" + "http", + "psr", + "psr-7" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-08-17T21:21:00+00:00" }, { - "name": "sebastian/recursion-context", - "version": "1.0.5", + "name": "zendframework/zend-escaper", + "version": "2.5.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "url": "https://github.com/zendframework/zend-escaper.git", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Zend\\Escaper\\": "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" - } + "homepage": "https://github.com/zendframework/zend-escaper", + "keywords": [ + "escaper", + "zf2" ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2016-06-30T19:48:38+00:00" }, { - "name": "sebastian/version", - "version": "1.0.6", + "name": "zendframework/zend-feed", + "version": "2.7.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "url": "https://github.com/zendframework/zend-feed.git", + "reference": "12b328d382aa5200f1de53d4147033b885776b67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/12b328d382aa5200f1de53d4147033b885776b67", + "reference": "12b328d382aa5200f1de53d4147033b885776b67", "shasum": "" }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-escaper": "^2.5", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "psr/http-message": "^1.0", + "zendframework/zend-cache": "^2.5", + "zendframework/zend-db": "^2.5", + "zendframework/zend-http": "^2.5", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-validator": "^2.5" + }, + "suggest": { + "psr/http-message": "PSR-7 ^1.0, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator", + "zendframework/zend-cache": "Zend\\Cache component, for optionally caching feeds between requests", + "zendframework/zend-db": "Zend\\Db component, for use with PubSubHubbub", + "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for easily extending ExtensionManager implementations", + "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries ehen using the Writer subcomponent" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + } + }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Zend\\Feed\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } + "description": "provides functionality for consuming RSS and Atom feeds", + "homepage": "https://github.com/zendframework/zend-feed", + "keywords": [ + "feed", + "zf2" ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2016-02-11T18:54:29+00:00" }, { - "name": "symfony/process", - "version": "v2.7.50", + "name": "zendframework/zend-stdlib", + "version": "3.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "eda637e05670e2afeec3842dcd646dce94262f6b" + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "8bafa58574204bdff03c275d1d618aaa601588ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/eda637e05670e2afeec3842dcd646dce94262f6b", - "reference": "eda637e05670e2afeec3842dcd646dce94262f6b", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/8bafa58574204bdff03c275d1d618aaa601588ae", + "reference": "8bafa58574204bdff03c275d1d618aaa601588ae", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "~0.1", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Zend\\Stdlib\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2018-08-03T11:24:48+00:00" + "time": "2016-04-12T21:19:36+00:00" } ], "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], + "minimum-stability": "dev", + "stability-flags": { + "consolidation/site-alias": 0, + "lox/xhprof": 20, + "webflo/drupal-core-strict": 20, + "webflo/drupal-core-require-dev": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=5.4.5" + "php": ">=5.6.0", + "ext-dom": "*" }, "platform-dev": [], "platform-overrides": { - "php": "5.4.5" + "php": "7.0.11" } } diff --git a/vendor/drush/drush/docker-compose.yml b/vendor/drush/drush/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..1fec443658bf65ddebb1d1c2b7de8099bb937376 --- /dev/null +++ b/vendor/drush/drush/docker-compose.yml @@ -0,0 +1,52 @@ +version: "3.1" + +services: + # More info at https://github.com/wodby/mariadb + mariadb: + image: wodby/mariadb:${MARIADB_TAG-10.1} + container_name: ${PROJECT_NAME-unish}_mariadb + stop_grace_period: 30s + environment: + MYSQL_ROOT_PASSWORD: password + volumes: + - mariadb-datavolume:/var/lib/mysql + ports: + - '3006:3306' + + # More info at https://github.com/wodby/php + # We don't want their drupal-php image as that ships with a Drush inside. + drupal: + image: wodby/php:${PHP_TAG-7.2-dev} + container_name: ${PROJECT_NAME-unish}_drupal + environment: + PHP_SENDMAIL_PATH: /dev/null + UNISH_DB_URL: ${UNISH_DB_URL-mysql://root:password@mariadb} + COLUMNS: ${COLUMNS-80} # Set 80 columns for docker exec -it. + ## Read instructions at https://wodby.com/docs/stacks/drupal/local/#debugging-cli-requests + PHP_XDEBUG: + PHP_XDEBUG_DEFAULT_ENABLE: + PHP_IDE_CONFIG: + PHP_XDEBUG_REMOTE_HOST: + volumes: + - ./:/var/www/html:${VOLUME_FLAGS-cached} + - ./.docker/zz-php.ini:/usr/local/etc/php/conf.d/zz-php.ini + + # More info at https://github.com/wodby/postgres + postgres: + image: wodby/postgres:${POSTGRES_TAG-10.5} + container_name: unish_postgres + stop_grace_period: 30s + environment: + POSTGRES_PASSWORD: unish + POSTGRES_DB: unish_dev + POSTGRES_USER: unish + volumes: + - postgres-datavolume:/var/lib/postgresql/data + ports: + - '5532:5432' + +#data volumes https://docs.docker.com/storage/volumes/ +volumes: + mariadb-datavolume: + postgres-datavolume: + diff --git a/vendor/drush/drush/docs/bastion.md b/vendor/drush/drush/docs/bastion.md deleted file mode 100644 index 491e691a004f3e7686f90eb9cd7c5dc27d051980..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/docs/bastion.md +++ /dev/null @@ -1,64 +0,0 @@ -# Remote Operations on Drupal Sites via a Bastion Server - -Wikipedia defines a [bastion server](http://en.wikipedia.org/wiki/Bastion_host) as "a special purpose computer on a network specifically designed and configured to withstand attacks." For the purposes of this documentation, though, any server that you can ssh through to reach other servers will do. Using standard ssh and Drush techniques, it is possible to make a two-hop remote command look and act as if the destination machine is on the same network as the source machine. - -## Recap of Remote Site Aliases - -Site aliases can refer to Drupal sites that are running on remote machines simply including 'remote-host' and 'remote-user' attributes: - - $aliases['internal'] = array( - 'remote-host' => 'internal.company.com', - 'remote-user' => 'wwwadmin', - 'uri' => 'http://internal.company.com', - 'root' => '/path/to/remote/drupal/root', - ); - -With this alias defintion, you may use commands such as `drush @internal status`, `drush ssh @internal` and `drush rsync @internal @dev` to operate remotely on the internal machine. What if you cannot reach the server that site is on from your current network? Enter the bastion server. - -## Setting up a Bastion server in .ssh/config - -If you have access to a server, bastion.company.com, which you can ssh to from the open internet, and if the bastion server can in turn reach the internal server, then it is possible to configure ssh to route all traffic to the internal server through the bastion. The .ssh configuration file would look something like this: - -In **.ssh/config:** - - Host internal.company.com - ProxyCommand ssh user@bastion.company.com nc %h %p - -That is all that is necessary; however, if the dev machine you are configuring is a laptop that might sometimes be inside the company intranet, you might want to optimize this setup so that the bastion is not used when the internal server can be reached directly. You could do this by changing the contents of your .ssh/config file when your network settings change -- or you could use Drush. - -# Setting up a Bastion server via Drush configuration - -First, make sure that you do not have any configuration options for the internal machine in your .ssh/config file. The next step after that is to identify when you are connected to your company intranet. I like to determine this by using the `route` command to find my network gateway address, since this is always the same on my intranet, and unlikely to be encountered in other places. - -In **drushrc.php:** - - # Figure out if we are inside our company intranet by testing our gateway address against a known value - exec("route -n | grep '^0\.0\.0\.0' | awk '{ print $2; }' 2> /dev/null", $output); - if ($output[0] == '172.30.10.1') { - drush_set_context('MY_INTRANET', TRUE); - } - -After this code runs, the 'MY\_INTRANET' context will be set if our gateway IP address matches the expected value, and unset otherwise. We can make use of this in our alias files. - -In **aliases.drushrc.php:** - - if (drush_get_context('MY_INTRANET', FALSE) === FALSE) { - $aliases['intranet-proxy'] = array( - 'ssh-options' => ' -o "ProxyCommand ssh user@bastion.company.com nc %h %p"', - ); - } - $aliases['internal-server'] = array( - 'parent' => '@intranet-proxy', - 'remote-host' => 'internal.company.com', - 'remote-user' => 'wwwadmin', - ); - $aliases['internal'] = array( - 'parent' => '@internal-server', - 'uri' => 'http://internal.company.com', - 'root' => '/path/to/remote/drupal/root', - ); - -The 'parent' term of the internal-server alias record is ignored if the alias it references ('@intranet-proxy') is not defined; the result is that 'ssh-options' will only be defined when outside of the intranet, and the ssh ProxyCommand to the bastion server will only be included when it is needed. - -With this setup, you will be able to use your site alias '@internal' to remotely operate on your internal intranet Drupal site seemlessly, regardless of your location -- a handy trick indeed. - diff --git a/vendor/drush/drush/docs/bootstrap.md b/vendor/drush/drush/docs/bootstrap.md index c20b48e44250b597070ac1d8722fcf5b4fa5d543..2473946c64c94a34514f405945e08b18ce42ace7 100644 --- a/vendor/drush/drush/docs/bootstrap.md +++ b/vendor/drush/drush/docs/bootstrap.md @@ -2,37 +2,47 @@ The Drush Bootstrap Process =========================== When preparing to run a command, Drush works by "bootstrapping" the Drupal environment in very much the same way that is done during a normal page request from the web server, so most Drush commands run in the context of a fully-initialized website. -For efficiency and convenience, some Drush commands can work without first bootstrapping a Drupal site, or by only partially bootstrapping a site. This is faster than a full bootstrap. It is also a matter of convenience, because some commands are useful even when you don't have a working Drupal site. For example, you can use Drush to download Drupal with `drush dl drupal`. This obviously does not require any bootstrapping to work. +For efficiency and convenience, some Drush commands can work without first bootstrapping a Drupal site, or by only partially bootstrapping a site. This is faster than a full bootstrap. It is also a matter of convenience, because some commands are useful even when you don't have a working Drupal site. -DRUSH\_BOOTSTRAP\_NONE +Commands may specify their bootstrap level with a `@bootstrap` annotation. Commands supplied by Drupal modules are always `@bootstrap full`. + +Prior to bootstrapping, Drush goes through the "preflight" process, where the following things occur: + +1. Commandline arguments are parsed. +1. Configuration files are read. +1. The site-alias included on the commandline is loaded if present. +1. The local selected site is determined, if any. +1. [Dependency injection](dependency-injection.md) is done. +1. Global commandfiles are loaded. Commandfiles with a drush.services.yml are loaded later, during bootstrap @full. +1. The command is dispatched via the Symfony Console component. + +Bootstrapping is done from a Symfony Console command hook. The different bootstrap levels are discribed below. + +@bootstrap none ----------------------- Only run Drush _preflight_, without considering Drupal at all. Any code that operates on the Drush installation, and not specifically any Drupal directory, should bootstrap to this phase. -DRUSH\_BOOTSTRAP\_DRUPAL\_ROOT +@bootstrap root ------------------------------ Set up and test for a valid Drupal root, either through the --root options, or evaluated based on the current working directory. Any code that interacts with an entire Drupal installation, and not a specific site on the Drupal installation should use this bootstrap phase. -DRUSH\_BOOTSTRAP\_DRUPAL\_SITE +@bootstrap site ------------------------------ -Set up a Drupal site directory and the correct environment variables to allow Drupal to find the configuration file. If no site is specified with the --uri options, Drush will assume the site is 'default', which mimics Drupal's behaviour. Note that it is necessary to specify a full URI, e.g. --uri=http://example.com, in order for certain Drush commands and Drupal modules to behave correctly. See the [example Config file](../examples/example.drushrc.php) for more information. Any code that needs to modify or interact with a specific Drupal site's settings.php file should bootstrap to this phase. +Set up a Drupal site directory and the correct environment variables to allow Drupal to find the configuration file. If no site is specified with the --uri options, Drush will assume the site is 'default', which mimics Drupal's behaviour. Note that it is necessary to specify a full URI, e.g. --uri=http://example.com, in order for certain Drush commands and Drupal modules to behave correctly. See the [example Config file](../examples/example.drush.yml) for more information. Any code that needs to modify or interact with a specific Drupal site's settings.php file should bootstrap to this phase. -DRUSH\_BOOTSTRAP\_DRUPAL\_CONFIGURATION +@bootstrap configuration --------------------------------------- -Load the settings from the Drupal sites directory. This phase is analagous to the DRUPAL\_BOOTSTRAP\_CONFIGURATION bootstrap phase in Drupal itself, and this is also the first step where Drupal specific code is included. This phase is commonly used for code that interacts with the Drupal install API, as both install.php and update.php start at this phase. +Load the settings from the Drupal sites directory. This phase is analogous to the DRUPAL\_BOOTSTRAP\_CONFIGURATION bootstrap phase in Drupal itself, and this is also the first step where Drupal specific code is included. This phase is commonly used for code that interacts with the Drupal install API, as both install.php and update.php start at this phase. -DRUSH\_BOOTSTRAP\_DRUPAL\_DATABASE +@bootstrap database ---------------------------------- Connect to the Drupal database using the database credentials loaded during the previous bootstrap phase. This phase is analogous to the DRUPAL\_BOOTSTRAP\_DATABASE bootstrap phase in Drupal. Any code that needs to interact with the Drupal database API needs to be bootstrapped to at least this phase. -DRUSH\_BOOTSTRAP\_DRUPAL\_FULL +@bootstrap full ------------------------------ Fully initialize Drupal. This is analogous to the DRUPAL\_BOOTSTRAP\_FULL bootstrap phase in Drupal. Any code that interacts with the general Drupal API should be bootstrapped to this phase. -DRUSH\_BOOTSTRAP\_DRUPAL\_LOGIN -------------------------------- -Log in to the initialiazed Drupal site. This bootstrap phase is used after the site has been fully bootstrapped. This is the default bootstrap phase all commands will try to reach, unless otherwise specified. This phase will log you in to the drupal site with the username or user ID specified by the --user/ -u option(defaults to 0, anonymous). Use this bootstrap phase for your command if you need to have access to information for a specific user, such as listing nodes that might be different based on who is logged in. - -DRUSH\_BOOTSTRAP\_MAX +@bootstrap max --------------------- -This is not an actual bootstrap phase. Commands that use DRUSH\_BOOTSTRAP\_MAX will cause Drush to bootstrap as far as possible, and then run the command regardless of the bootstrap phase that was reached. This is useful for Drush commands that work without a bootstrapped site, but that provide additional information or capabilities in the presence of a bootstrapped site. For example, `drush pm-releases modulename` works without a bootstrapped Drupal site, but will include the version number for the installed module if a Drupal site has been bootstrapped. +This is not an actual bootstrap phase. Commands that use the "max" bootstrap level will cause Drush to bootstrap as far as possible, and then run the command regardless of the bootstrap phase that was reached. This is useful for Drush commands that work without a bootstrapped site, but that provide additional information or capabilities in the presence of a bootstrapped site. For example, `drush status` will show progressively more information the farther the site bootstraps. diff --git a/vendor/drush/drush/docs/commands.md b/vendor/drush/drush/docs/commands.md index 3b73ab24039ac43ac2b26ef7f06cea01c0fc2b5e..d9fb626ad2e04457297f95683f5e7482cf46df20 100644 --- a/vendor/drush/drush/docs/commands.md +++ b/vendor/drush/drush/docs/commands.md @@ -1,132 +1,110 @@ Creating Custom Drush Commands ============================== -Creating a new Drush command is very easy. Follow these simple steps: - -1. Create a command file called COMMANDFILE.drush.inc -1. Implement the function COMMANDFILE\_drush\_command() -1. Implement the functions that your commands will call. These will usually be named drush\_COMMANDFILE\_COMMANDNAME(). - -For an example Drush command, see examples/sandwich.drush.inc. The steps for implementing your command are explained in more detail below. - -Create COMMANDFILE.drush.inc ----------------------------- - -The name of your Drush command is very important. It must end in ".drush.inc" to be recognized as a Drush command. The part of the filename that comes before the ".drush.inc" becomes the name of the commandfile. Optionally, the commandfile may be restricted to a particular version of Drupal by adding a ".dVERSION" after the name of the commandfile (e.g. ".d8.drush.inc") Your commandfile name is used by Drush to compose the names of the functions it will call, so choose wisely. - -The example Drush command, 'make-me-a-sandwich', is stored in the 'sandwich' commandfile, 'sandwich.Drush.inc'. You can find this file in the 'examples' directory in the Drush distribution. - -Drush searches for commandfiles in the following locations: - -- Folders listed in the 'include' option (see `drush topic docs-configuration`). -- The system-wide Drush commands folder, e.g. /usr/share/drush/commands -- The ".drush" folder in the user's HOME folder. -- /drush and /sites/all/drush in the current Drupal installation -- All enabled modules in the current Drupal installation -- Folders and files containing other versions of Drush in their names will be \*skipped\* (e.g. devel.drush4.inc or drush4/devel.drush.inc). Names containing the current version of Drush (e.g. devel.drush5.inc) will be loaded. - -Note that modules in the current Drupal installation will only be considered if Drush has bootstrapped to at least the DRUSH\_BOOSTRAP\_SITE level. Usually, when working with a Drupal site, Drush will bootstrap to DRUSH\_BOOTSTRAP\_FULL; in this case, only the Drush commandfiles in enabled modules will be considered eligible for loading. If Drush only bootstraps to DRUSH\_BOOTSTRAP\_SITE, though, then all Drush commandfiles will be considered, whether the module is enabled or not. See `drush topic docs-bootstrap` for more information on bootstrapping. - -Implement COMMANDFILE\_drush\_command() ---------------------------------------- - -The drush\_command hook is the most important part of the commandfile. It returns an array of items that define how your commands should be called, and how they work. Drush commands are very similar to the Drupal menu system. The elements that can appear in a Drush command definition are shown below. - -- **aliases**: Provides a list of shorter names for the command. For example, pm-download may also be called via `drush dl`. If the alias is used, Drush will substitute back in the primary command name, so pm-download will still be used to generate the command hook, etc. -- **command-hook**: Change the name of the function Drush will call to execute the command from drush\_COMMANDFILE\_COMMANDNAME() to drush\_COMMANDFILE\_COMMANDHOOK(), where COMMANDNAME is the original name of the command, and COMMANDHOOK is the value of the 'command-hook' item. -- **callback**: Name of function to invoke for this command. The callback function name \_must\_ begin with "drush\_commandfile\_", where commandfile is from the file "commandfile.drush.inc", which contains the commandfile\_drush\_command() function that returned this command. Note that the callback entry is optional; it is preferable to omit it, in which case drush\_invoke() will generate the hook function name. -- **callback arguments**: An array of arguments to pass to the callback. The command line arguments, if any, will appear after the callback arguments in the function parameters. -- **description**: Description of the command. -- **arguments**: An array of arguments that are understood by the command. Used by `drush help` only. -- **required-arguments**: Defaults to FALSE; TRUE if all of the arguments are required. Set to an integer count of required arguments if only some are required. -- **options**: An array of options that are understood by the command. Any option that the command expects to be able to query via drush\_get\_option \_must\_ be listed in the options array. If it is not, users will get an error about an "Unknown option" when they try to specify the option on the command line. - - The value of each option may be either a simple string containing the option description, or an array containing the following information: - - - **description**: A description of the option. - - **example-value**: An example value to show in help. - - **value**: optional|required. - - **required**: Indicates that an option must be provided. - - **hidden**: The option is not shown in the help output (rare). - -- **allow-additional-options**: If TRUE, then the strict validation to see if options exist is skipped. Examples of where this is done includes the core-rsync command, which passes options along to the rsync shell command. This item may also contain a list of other commands that are invoked as subcommands (e.g. the pm-update command calls pm-updatecode and updatedb commands). When this is done, the options from the subcommand may be used on the commandline, and are also listed in the command's `help` output. Defaults to FALSE. -- **examples**: An array of examples that are understood by the command. Used by `drush help` only. -- **scope**: One of 'system', 'project', 'site'. Not currently used. -- **bootstrap**: Drupal bootstrap level. More info at `drush topic docs-bootstrap`. Valid values are: - - DRUSH\_BOOTSTRAP\_NONE - - DRUSH\_BOOTSTRAP\_DRUPAL\_ROOT - - DRUSH\_BOOTSTRAP\_DRUPAL\_SITE - - DRUSH\_BOOTSTRAP\_DRUPAL\_CONFIGURATION - - DRUSH\_BOOTSTRAP\_DRUPAL\_DATABASE - - DRUSH\_BOOTSTRAP\_DRUPAL\_FULL - - DRUSH\_BOOTSTRAP\_DRUPAL\_LOGIN (default) - - DRUSH\_BOOTSTRAP\_MAX -- **core**: Drupal major version required. Append a '+' to indicate 'and later versions.' -- **drupal dependencies**: Drupal modules required for this command. -- **drush dependencies**: Other Drush commandfiles required for this command. -- **engines**: Provides a list of Drush engines to load with this command. The set of appropriate engines varies by command. - - **outputformat**: One important engine is the 'outputformat' engine. This engine is responsible for formatting the structured data (usually an associative array) that a Drush command returns as its function result into a human-readable or machine-parsable string. Some of the options that may be used with output format engines are listed below; however, each specific output format type can take additional option items that control the way that the output is rendered. See the comment in the output format's implementation for information. The Drush core output format engines can be found in commands/core/outputformat. - - **default**: The default type to render output as. If declared, the command should not print any output on its own, but instead should return a data structure (usually an associative array) that can be rendered by the output type selected. - - **pipe-format**: When the command is executed in --pipe mode, the command output will be rendered by the format specified by the pipe-format item instead of the default format. Note that in either event, the user may specify the format to use via the --format command-line option. - - **formatted-filter** and **pipe-filter**: Specifies a function callback that will be used to filter the command result. The filter is selected based on the type of output format object selected. Most output formatters are 'pipe' formatters, that produce machine-parsable output. A few formatters, such as 'table' and 'key-value' are 'formatted' filter types, that produce human-readable output. -- **topics**: Provides a list of topic commands that are related in some way to this command. Used by `drush help`. -- **topic**: Set to TRUE if this command is a topic, callable from the `drush docs-topics` command. -- **category**: Set this to override the category in which your command is listed in help. - -The 'sandwich' drush\_command hook looks like this: - - function sandwich_drush_command() { - $items = array(); - - $items['make-me-a-sandwich'] = array( - 'description' => "Makes a delicious sandwich.", - 'arguments' => array( - 'filling' => 'The type of the sandwich (turkey, cheese, etc.)', - ), - 'options' => array( - 'spreads' => 'Comma delimited list of spreads (e.g. mayonnaise, mustard)', - ), - 'examples' => array( - 'drush mmas turkey --spreads=ketchup,mustard' => 'Make a terrible-tasting sandwich that is lacking in pickles.', - ), - 'aliases' => array('mmas'), - 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all. - ); - - return $items; - } - -Most of the items in the 'make-me-a-sandwich' command definition have no effect on execution, and are used only by `drush help`. The exceptions are 'aliases' (described above) and 'bootstrap'. As previously mentioned, `drush topic docs-bootstrap` explains the Drush bootstrapping process in detail. - -Implement drush\_COMMANDFILE\_COMMANDNAME() -------------------------------------------- - -The 'make-me-a-sandwich' command in sandwich.drush.inc is defined as follows: - - function drush_sandwich_make_me_a_sandwich($filling = 'ascii') { - // implementation here ... - } - -If a user runs `drush make-me-a-sandwich` with no command line arguments, then Drush will call drush\_sandwich\_make\_me\_a\_sandwich() with no function parameters; in this case, $filling will take on the provided default value, 'ascii'. (If there is no default value provided, then the variable will be NULL, and a warning will be printed.) Running `drush make-me-a-sandwich ham` will cause Drush to call drush\_sandwich\_make\_me\_a\_sandwich('ham'). In the same way, commands that take two command line arguments can simply define two functional parameters, and a command that takes a variable number of command line arguments can use the standard php function func\_get\_args() to get them all in an array for easy processing. - -It is also very easy to query the command options using the function drush\_get\_option(). For example, in the drush\_sandwich\_make\_me\_a\_sandwich() function, the --spreads option is retrieved as follows: - - $str_spreads = ''; - if ($spreads = drush_get_option('spreads')) { - $list = implode(' and ', explode(',', $spreads)); - $str_spreads = ' with just a dash of ' . $list; - } - -Note that Drush will actually call a sequence of functions before and after your Drush command function. One of these hooks is the "validate" hook. The 'sandwich' commandfile provides a validate hook for the 'make-me-a-sandwich' command: - - function drush_sandwich_make_me_a_sandwich_validate() { - $name = posix_getpwuid(posix_geteuid()); - if ($name['name'] !== 'root') { - return drush_set_error('MAKE_IT_YOUSELF', dt('What? Make your own sandwich.')); - } - } - -The validate function should call drush\_set\_error() and return its result if the command cannot be validated for some reason. See `drush topic docs-policy` for more information on defining policy functions with validate hooks, and `drush topic docs-api` for information on how the command hook process works. Also, the list of defined drush error codes can be found in `drush topic docs-errorcodes`. - -To see the full implementation of the sample 'make-me-a-sandwich' command, see `drush topic docs-examplecommand`. +Creating a new Drush command or porting a legacy command is easy. Follow the steps below. + +1. Run `drush generate drush-command-file`. +1. Drush will prompt for the machine name of the module that should "own" the file. + 1. (optional) Drush will also prompt for the path to a legacy command file to port. See [tips on porting command to Drush 9](https://weitzman.github.io/blog/port-to-drush9) + 1. The module selected must already exist and be enabled. Use `drush generate module-standard` to create a new module. +1. Drush will then report that it created a commandfile, a drush.services.yml file and a composer.json file. Edit those files as needed. +1. Use the classes for the core Drush commands at [/src/Drupal/Commands](https://github.com/drush-ops/drush/tree/master/src/Drupal/Commands) as inspiration and documentation. +1. See the [dependency injection docs](dependency-injection.md) for interfaces you can implement to gain access to Drush config, Drupal site aliases, etc. +1. Once your two files are ready, run `drush cr` to get your command recognized by the Drupal container. + +Specifying the Services File +================================ + +A module's composer.json file stipulates the filename where the Drush services (e.g. the Drush command files) are defined. The default services file is `drush.services.yml`, which is defined in the extra section of the composer.json file as follows: +``` + "extra": { + "drush": { + "services": { + "drush.services.yml": "^9" + } + } + } +``` +If for some reason you need to load different services for different versions of Drush, simply define multiple services files in the `services` section. The first one found will be used. For example: +``` + "extra": { + "drush": { + "services": { + "drush-9-99.services.yml": "^9.99", + "drush.services.yml": "^9" + } + } + } +``` +In this example, the file `drush-9-99.services.yml` loads commandfile classes that require features only available in Drush 9.99 and later, and drush.services.yml loads an older commandfile implementation for earlier versions of Drush. + +It is also possible to use [version ranges](https://getcomposer.org/doc/articles/versions.md#version-range) to exactly specify which version of Drush the services file should be used with (e.g. `"drush.services.yml": ">=9 <9.99"`). + +In Drush 9, the default services file, `drush.services.yml`, will be used in instances where there is no `services` section in the Drush extras of the project's composer.json file. In Drush 10, however, the services section must exist, and must name the services file to be used. If a future Drush extension is written such that it only works with Drush 10 and later, then its entry would read `"drush.services.yml": "^10"`, and Drush 9 would not load the extension's commands. It is all the same recommended that Drush 9 extensions explicitly declare their services file with an appropriate version constraint. + +Altering Drush Command Info +=========================== + +Drush command info (annotations) can be altered from other modules. This is done by creating and registering 'command info alterers'. Alterers are class services that are able to intercept and manipulate an existing command annotation. + +In order to alter an existing command info, follow the steps below: + +1. In the module that wants to alter a command info, add a service class that implements the `\Consolidation\AnnotatedCommand\CommandInfoAltererInterface`. +1. In the module `drush.services.yml` declare a service pointing to this class and tag the service with the `drush.command_info_alterer` tag. +1. In that class, implement the alteration logic in the `alterCommandInfo()` method. +1. Along with the alter code, it's strongly recommended to log a debug message explaining what exactly was altered. This makes things easier on others who may need to debug the interaction of the alter code with other modules. Also it's a good practice to inject the the logger in the class constructor. + +For an example, see the alterer class provided by the testing 'woot' module: `tests/functional/resources/modules/d8/woot/src/WootCommandInfoAlterer.php`. + +Site-Wide Drush Commands +============================== + +Commandfiles that are installed in a Drupal site and are not bundled inside a Drupal module are called 'site-wide' commandfiles. Site-wide commands may either be added directly to the Drupal site's repository (e.g. for site-specific policy files), or via `composer require`. See the [examples/Commands](https://github.com/drush-ops/drush/tree/master/examples/Commands) folder for examples. In general, it's better to use modules to carry your Drush commands, as module-based commands may [participate in Drupal's dependency injection via the drush.services.yml](#specifying-the-services-file). + +If you still prefer using site-wide commandfiles, here are some examples of valid commandfile names and namespaces: + +1. Simple + - Filename: $PROJECT_ROOT/drush/Commands/ExampleCommands.php + - Namespace: Drush\Commands +1. Nested in a subdirectory committed to the site's repository + - Filename: $PROJECT_ROOT/drush/Commands/example/ExampleCommands.php + - Namespace: Drush\Commands\example +1. Nested in a subdirectory installed via a Composer package + - Filename: $PROJECT_ROOT/drush/Commands/contrib/dev_modules/ExampleCommands.php + - Namespace: Drush\Commands\dev_modules + +Installing commands as part of a Composer project requires that the project's type be `drupal-drush`, and that the `installer-paths` in the Drupal site's composer.json file contains `"drush/Commands/contrib/{$name}": ["type:drupal-drush"]`. It is also possible to commit projects with a similar layout using a directory named `custom` in place of `contrib`; if this is done, then the directory `custom` will not be considered to be part of the commandfile's namespace. + +If a site-wide commandfile is added via a Composer package, then it may declare any dependencies that it may need in its composer.json file. Site-wide commandfiles that are committed directly to a site's repository only have access to the dependencies already available in the site. Site-wide commandfiles should declare their Drush version compatibility via a `conflict` directive. For example, a Composer-managed site-wide command that works with both Drush 8 and Drush 9 might contain something similar to the following in its composer.json file: +``` + "conflict": { + "drush/drush": "<8.2 || >=9.0 <9.6 || >=10.0", + } +``` +Using `require` in place of `conflict` is not recommended. + +A site-wide commandfile should have tests that run with each (major) version of Drush that is supported. You may model your test suite after the [example drush extension](https://github.com/drush-ops/example-drush-extension) project, which works on Drush ^8.2 and ^9.6. + +Global Drush Commands +============================== + +Commandfiles that are not part of any Drupal site are called 'global' commandfiles. Global commandfiles are not supported by default; in order to enable them, you must configure your `drush.yml` configuration file to add an `include` search location. + +For example: + +drush: + paths: + include: + - '${env.home}/.drush/commands' + +With this configuration in place, global commands may be placed as described in the Site-Wide Drush Commands section above. Global commandfiles may not declare any dependencies of their own; they may only use those dependencies already available via the autoloader. + +##### Tips +1. The filename must be have a name like Commands/ExampleCommands.php + 1. The prefix `Example` can be whatever string you want. + 1. The file must end in `Commands.php` +1. The directory above `Commands` must be one of: + 1. A Folder listed in the 'include' option. Include may be provided via [config](#global-drush-commands) or via CLI. + 1. ../drush, /drush or /sites/all/drush. These paths are relative to Drupal root. +It is recommended that you avoid global Drush commands, and favor site-wide commandfiles instead. If you really need a command or commands that are not part of any Drupal site, consider making a stand-alone script or custom .phar instead. See [ahoy](https://github.com/ahoy-cli/ahoy), [Robo](https://github.com/consolidation/robo) and [g1a/starter](https://github.com/g1a/starter) as potential starting points. diff --git a/vendor/drush/drush/docs/config-exporting.md b/vendor/drush/drush/docs/config-exporting.md index a31428c85d6be3966916c2067b7e92b94a2b0fde..66aa9dcba44a5b310938788d9ad979c7e327fed4 100644 --- a/vendor/drush/drush/docs/config-exporting.md +++ b/vendor/drush/drush/docs/config-exporting.md @@ -29,9 +29,9 @@ a Drush feature. It should be the preferred method for changing configuration values on a per-environment basis; however, it does not work for some things, such as enabling and disabling modules. For configuration changes not handled by the configuration override system, -you can use configuration filters of the Config Filter module. +you can use Drush configuration filters. ## Ignoring Development Modules Use the [Config Split](https://www.drupal.org/project/config_split) module to -split off development configuration in a dedicated config directory. \ No newline at end of file +split off development configuration in a dedicated config directory. diff --git a/vendor/drush/drush/docs/context.md b/vendor/drush/drush/docs/context.md deleted file mode 100644 index 6308c765c8321531ad9eff7e1ff7ce0ad8bfb4da..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/docs/context.md +++ /dev/null @@ -1,55 +0,0 @@ -Drush Contexts -============== - -The drush contexts API acts as a storage mechanism for all options, arguments and configuration settings that are loaded into drush. - -This API also acts as an IPC mechanism between the different drush commands, and provides protection from accidentally overriding settings that are needed by other parts of the system. - -It also avoids the necessity to pass references through the command chain and allows the scripts to keep track of whether any settings have changed since the previous execution. - -This API defines several contexts that are used by default. - -Argument contexts ------------------ - -These contexts are used by Drush to store information on the command. They have their own access functions in the forms of drush\_set\_arguments(), drush\_get\_arguments(), drush\_set\_command(), drush\_get\_command(). - -- command : The drush command being executed. -- arguments : Any additional arguments that were specified. - -Setting contexts ----------------- - -These contexts store options that have been passed to the drush.php script, either through the use of any of the config files, directly from the command line through --option='value' or through a JSON encoded string passed through the STDIN pipe. - -These contexts are accessible through the drush\_get\_option() and drush\_set\_option() functions. See drush\_context\_names() for a description of all of the contexts. - -Drush commands may also choose to save settings for a specific context to the matching configuration file through the drush\_save\_config() function. - -Available Setting contexts --------------------------- - -These contexts are evaluated in a certain order, and the highest priority value is returned by default from drush\_get\_option. This allows scripts to check whether an option was different before the current execution. - -Specified by the script itself : - -- process : Generated in the current process. -- cli : Passed as --option=value to the command line. -- stdin : Passed as a JSON encoded string through stdin. -- alias : Defined in an alias record, and set in the alias context whenever that alias is used. -- specific : Defined in a command-specific option record, and set in the command context whenever that command is used. - -Specified by config files : - -- custom : Loaded from the config file specified by --config or -c -- site : Loaded from the drushrc.php file in the Drupal site directory. -- drupal : Loaded from the drushrc.php file in the Drupal root directory. -- user : Loaded from the drushrc.php file in the user's home directory. -- drush : Loaded from the drushrc.php file in the $HOME/.drush directory. -- system : Loaded from the drushrc.php file in the system's $PREFIX/etc/drush directory. -- drush : Loaded from the drushrc.php file in the same directory as drush.php. - -Specified by the script, but has the lowest priority : - -- default : The script might provide some sensible defaults during init. - diff --git a/vendor/drush/drush/docs/cron.md b/vendor/drush/drush/docs/cron.md index 04ab36d024fa183c1f65bfe75570f21af63fda98..31f3d562f5f16ace1b6add2a728e10e60b4fb093 100644 --- a/vendor/drush/drush/docs/cron.md +++ b/vendor/drush/drush/docs/cron.md @@ -1,16 +1,16 @@ Running Drupal cron tasks from Drush ==================================== -Drupal cron tasks are often set up to be run via a wget call to cron.php; this same task can also be accomplished via the `drush cron` command, which circumvents the need to provide a webserver interface to cron. +Drupal cron tasks are often set up to be run via a wget call to cron.php; this same task can also be accomplished via the `drush cron` command, which circumvents the need to provide a web server interface to cron. Quick start ---------- If you just want to get started quickly, here is a crontab entry that will run cron once every hour at ten minutes after the hour: - 10 * * * * /usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin COLUMNS=72 /usr/local/bin/drush --root=/path/to/your/drupalroot --uri=your.drupalsite.org --quiet cron + 10 * * * * cd [DOCROOT] && /usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin COLUMNS=72 ../vendor/bin/drush --uri=your.drupalsite.org --quiet cron -You should set up crontab to run your cron tasks as the same user that runs the web server; for example, if you run your webserver as the user www-data: +You should set up crontab to run your cron tasks as the same user that runs the web server; for example, if you run your web server as the user www-data: sudo crontab -u www-data -e @@ -33,9 +33,9 @@ Take the value that is output and place it into your crontab entry in the place Setting COLUMNS --------------- -When running Drush in a terminal, the number of columns will be automatically determined by Drush by way of the tput command, which queries the active terminal to determine what the width of the screen is. When running Drush from cron, there will not be any terminal set, and the call to tput will produce an error message. Spurrious error messages are undesirable, as cron is often configured to send email whenever any output is produced, so it is important to make an effort to insure that successful runs of cron complete with no output. +When running Drush in a terminal, the number of columns will be automatically determined by Drush by way of the tput command, which queries the active terminal to determine what the width of the screen is. When running Drush from cron, there will not be any terminal set, and the call to tput will produce an error message. Spurious error messages are undesirable, as cron is often configured to send email whenever any output is produced, so it is important to make an effort to insure that successful runs of cron complete with no output. -In some cases, Drush is smart enough to recognize that there is no terminal -- if the terminal value is empty or "dumb", for example. However, there are some "non-terminal" values that Drush does not recognize, such as "unknown." If you manually set `COLUMNS`, then Drush will repect your setting and will not attempt to call tput. +In some cases, Drush is smart enough to recognize that there is no terminal -- if the terminal value is empty or "dumb", for example. However, there are some "non-terminal" values that Drush does not recognize, such as "unknown." If you manually set `COLUMNS`, then Drush will respect your setting and will not attempt to call tput. Using --quiet ------------- @@ -45,5 +45,5 @@ By default, Drush will print a success message when the run of cron is completed Specifying the Drupal site to run --------------------------------- -There are many ways to tell Drush which Drupal site to select for the active command, and any may be used here. The example uses the --root and --uri flags, but you could also use an alias record. +There are many ways to tell Drush which Drupal site to select for the active command, and any may be used here. The example uses `cd [DOCROOT]`, but you could also use the --root and --uri flags. diff --git a/vendor/drush/drush/docs/dependency-injection.md b/vendor/drush/drush/docs/dependency-injection.md new file mode 100644 index 0000000000000000000000000000000000000000..98658d7fd42c8c34e438e79bb2439b72ac2d31da --- /dev/null +++ b/vendor/drush/drush/docs/dependency-injection.md @@ -0,0 +1,86 @@ +Dependency Injection +================== + +Drush 9 command files obtain references to the resources they need through a technique called _dependency injection_. When using this programing paradigm, a class by convention will never use the `new` operator to instantiate dependencies. Instead, it will store the other objects it needs in class variables, and provide a way for other code to assign an object to that variable. + +Types of Injection +----------------------- + +There are two ways that a class can receive its dependencies. One is called “constructor injection”, and the other is called “setter injection”. + +*Example of constructor injection:* +``` + public function __construct(DependencyType $service) + { + $this->service = $service; + } +``` + +*Example of setter injection:* +``` + public function setService(DependencyType $service) + { + $this->service = $service; + } +``` +A class should use one or the other of these methods. The code that is responsible for providing the dependencies a class need is usually an object called the dependency injection container. + +Services Files +------------------ + +Drush command files can request that Drupal inject services by using a drush.services.yml file. See the document [commands](commands.md) for instructions on how to use the Drupal Code Generator to create a simple command file starter with a drush.services.yml file. An initial services file will look something like this: +``` +services: + my_module.commands: + class: \Drupal\my_module\Commands\MyModuleiCommands + tags: + - { name: drush.command } +``` +See the [Drupal Documentation](https://www.drupal.org/docs/8/api/services-and-dependency-injection/services-and-dependency-injection-in-drupal-8) for details on how to inject Drupal services into your command file. The process is exactly the same as using a Drupal services.yml file to inject services into your module classes. + +Inflection +------------- + +Drush will also inject dependencies that it provides using a technique called inflection. Inflection is a kind of dependency injection that works by way of a set of provided inflection interfaces, one for each available service. Each of these interfaces will define one or more setter methods (usually only one); these will automatically be called by Drush when the commandfile object is instantiated. The command only needs to implement this method and save the provided object in a class field. There is usually a corresponding trait that may be included via a `use` statement to fulfill this requirement. + +For example: + +``` +<?php +namespace Drupal\my_module\Commands; + +use Drush\Commands\DrushCommands; +use Consolidation\OutputFormatters\StructuredData\ListDataFromKeys; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; + +class MyModuleCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + /** + * Prints the currenbt alias name and info. + * + * @command mymodule:myAlias + * @return \Consolidation\OutputFormatters\StructuredData\ListDataFromKeys + */ + public function myAlias() + { + $selfAlias = $this->siteAliasManager()->getSelf(); + $this->logger()->success(‘The current alias is {name}’, [‘name’ => $selfAlias]); + return new ListDataFromKeys($aliasRecord->export()); + } +} +``` + +All Drush command files extend DrushCommands. DrushCommands implements ConfigAwareInterface, IOAwareInterface, LoggerAwareInterface, which gives access to `$this->getConfig()`, `$this->logger()` and other ways to do input and output. See the [IO documentation](io.md) for more information. + +Any additional services that are desired must be injected by implementing the appropriate inflection interface. + +Additional Interfaces: + +- AutoloaderAwareInterface: Provides access to the class loader. +- SiteAliasManagerAwareInterface: The site alias manager [allows alias records to be obtained](site-alias-manager.md). +- CustomEventAwareInterface: Allows command files to [define and fire custom events](hooks.md) that other command files can hook. +- ContainerAwareInterface: Provides Drush's dependency injection container. + +Note that although the autoloader and Drush dependency injection container is available and may be injected into your command file if needed, this should be avoided. Favor using services that can be injected from Drupal or Drush. Some of the objects in the container are not part of the Drush public API, and may not maintain compatibility in minor and patch releases. diff --git a/vendor/drush/drush/docs/examples.md b/vendor/drush/drush/docs/examples.md index 7eca54f53cd1557619e9eeb9436dd8e86f7850cd..c52fe886557afc5617b92405d8f6445382b0b393 100644 --- a/vendor/drush/drush/docs/examples.md +++ b/vendor/drush/drush/docs/examples.md @@ -1,18 +1,14 @@ -The _examples_ folder contains example files which you may copy and edit as needed. Read the documentation right in the file. If you see an opportunity to improve the file, please submit a pull request. +The _examples_ folder contains excellent example files which you may copy and edit as needed. Read the documentation right in the file. If you see an opportunity to improve the file, please submit a pull request. -* [drush.wrapper](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/drush.wrapper). A handy launcher script which calls the Drush located in vendor/bin/drush and can add options like --local, --root, etc. -* [example.aliases.drushrc.php](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.aliases.drushrc.php). Example site alias definitions. -* [example.bashrc](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.bashrc). Enhance your shell with lots of Drush niceties including bash completion. -* [example.drush.ini](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.drush.ini). Configure your PHP just for Drush requests. -* [example.drushrc.php](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.drushrc.php). A Drush configuration file. -* [example.make](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.make). An ini style make file. -* [example.make.yml](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.make.yml). A YML make file. -* [example.prompt.sh](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.prompt.sh). Displays Git repository and Drush alias status in your prompt. -* [git-bisect.example.sh](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/git-bisect.example.sh). Spelunking through Drush's git history with bisect. -* [helloworld.script](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/helloworld.script). An example Drush script. -* [pm_update.drush.inc](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/pm_update.drush.inc). Restore sqlsrv driver after core update. -* [policy.drush.inc](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/policy.drush.inc). A policy file can disallow prohibited commands/options etc. -* [sandwich.drush.inc](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/sandwich.drush.inc). A fun example command inspired by a famous XKCD comic. -* [sync_via_http.drush.inc](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/sync_via_http.drush.inc). sql-sync modification that transfers via http instead of rsync. -* [sync_enable.drush.inc](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/sync_enable.drush.inc). Automatically enable modules after a sql-sync. -* [xkcd.drush.inc](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/xkcd.drush.inc). A fun example command that browses XKCD comics. +* [example.site.yml](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.site.yml). Example site alias definitions. +* [example.bashrc](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.bashrc). Enhance your shell with lots of Drush niceties including bash completion. +* [Example drush extension](https://github.com/drush-ops/example-drush-extension) +* [example.drush.yml](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.drush.yml). A Drush configuration file. +* [example.prompt.sh](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.prompt.sh). Displays Git repository and Drush alias status in your prompt. +* [git-bisect.example.sh](https://raw.githubusercontent.com/drush-ops/drush/master/examples/git-bisect.example.sh). Spelunking through Drush's git history with bisect. +* [helloworld.script](https://raw.githubusercontent.com/drush-ops/drush/master/examples/helloworld.script). An example Drush script. +* [PolicyCommands](https://raw.githubusercontent.com/drush-ops/drush/master/examples/Commands/PolicyCommands.php). A policy file can disallow prohibited commands/options etc. +* [ArtCommands](https://raw.githubusercontent.com/drush-ops/drush/master/examples/Commands/ArtCommands.php). A fun example command inspired by a famous XKCD comic. +* [SiteAliasAlterCommands](https://raw.githubusercontent.com/drush-ops/drush/master/examples/Commands/SiteAliasAlterCommands.php). An example of dynamically changing site alias definition. +* [SyncViaHttpCommands](https://raw.githubusercontent.com/drush-ops/drush/master/examples/Commands/SyncViaHttpCommands.php). sql-sync modification that transfers via http instead of rsync. +* [XkcdCommands](https://raw.githubusercontent.com/drush-ops/drush/master/examples/Commands/XkcdCommands.php). A fun example command that browses XKCD comics. diff --git a/vendor/drush/drush/docs/generators.md b/vendor/drush/drush/docs/generators.md new file mode 100644 index 0000000000000000000000000000000000000000..bb3303c65a021b4599300438282ee1b04a586c22 --- /dev/null +++ b/vendor/drush/drush/docs/generators.md @@ -0,0 +1,29 @@ +Overview +========================== +Generators jump start your coding by building all the boring boilerplate code for you. After running a `drush generate [foo]` command, you have a guide for where to insert your custom logic. + +Drush's generators reuse classes provided by the excellent [Drupal Code Generator](https://github.com/Chi-teck/drupal-code-generator) project. See its [Commands directory](https://github.com/Chi-teck/drupal-code-generator/tree/master/src/Command/Drupal_8) for inspiration. + +Writing Custom Generators +========================== +Drupal modules may supply their own Generators, just like they can supply Commands. + +See [Woot module](https://github.com/drush-ops/drush/blob/master/tests/functional/resources/modules/d8/woot), which Drush uses for testing. Specifically, + + 1. Write a class similar to [ExampleGenerator](https://github.com/drush-ops/drush/tree/master/tests/functional/resources/modules/d8/woot/src/Generators/). Implement your custom logic in the interact() method. Typically this class is placed in the src/Generators directory. + 1. Add a .twig file to the same directory. This template specifies what gets output from the generator. + 1. Add your class to your module's drush.services.yml file ([example](https://github.com/drush-ops/drush/blob/master/tests/functional/resources/modules/d8/woot/drush.services.yml)). Use the tag `drush.generator` instead of `drush.command`. + 1. Perform a `drush cache-rebuild` to compile your drush.services.yml changes into the Drupal container. + +Global Generators +============================== + +Generators that don't ship inside Drupal modules are called 'global' generators. In general, its better to use modules to carry your generators. If you still prefer using a global generator, please note: + +1. The file's namespace should be `\Drush\Generators`. +1. The filename must be have a name like Generators/FooGenerator.php + 1. The prefix `Foo` can be whatever string you want. The file must end in `Generator.php` + 1. The enclosing directory must be named `Generators` +1. The directory above Generators must be one of: + 1. A Folder listed in the 'include' option. include may be provided via config or via CLI. + 1. ../drush, /drush or /sites/all/drush. These paths are relative to Drupal root. \ No newline at end of file diff --git a/vendor/drush/drush/docs/hooks.md b/vendor/drush/drush/docs/hooks.md new file mode 100644 index 0000000000000000000000000000000000000000..df8a363833c3f8aa5fa7893239a15a268b7f1d7a --- /dev/null +++ b/vendor/drush/drush/docs/hooks.md @@ -0,0 +1,47 @@ +Core Hooks +============ +All commandfiles may implement methods that are called by Drush at various times in the request cycle. To implement one, add a `@hook validate` (for example) to the top of your method. + +- [Documentation about available hooks](https://github.com/consolidation/annotated-command#hooks). +- To see how core commands implement a hook, you can [search the Drush source code](https://github.com/drush-ops/drush/search?q=%40hook+validate&type=Code&utf8=%E2%9C%93). This link uses validate hook as an example. + +Custom Hooks +============ + +Drush commands can define custom events that other command files can hook. You can find examples in [CacheCommands](https://github.com/drush-ops/drush/blob/master/src/Commands/core/CacheCommands.php) and [SanitizeCommands](https://github.com/drush-ops/drush/blob/master/src/Drupal/Commands/sql/SanitizeCommands.php) + +First, the command must implement CustomEventAwareInterface and use CustomEventAwareTrait, as described in the [dependency injection](dependency-injection.md) documentation. + +Then, the command may ask the provided hook manager to return a list of handlers with a certain annotation. In the example below, the `my-event` label is used: +``` + /** + * This command uses a custom event 'my-event' to collect data. Note that + * the event handlers will not be found unless the hook manager is + * injected into this command handler object via `setHookManager()` + * (defined in CustomEventAwareTrait). + * + * @command example:command + */ + public function exampleCommand() + { + $myEventHandlers = $this->getCustomEventHandlers('my-event'); + $result = []; + foreach ($myEventHandlers as $handler) { + $result[] = $handler(); + } + sort($result); + return implode(',', $result); + } +``` + +Other command handlers may provide implementations by implementing `@hook on-event my-event`. + +``` + /** + * @hook on-event my-event + */ + public function hookOne() + { + return 'one'; + } +``` diff --git a/vendor/drush/drush/docs/index.md b/vendor/drush/drush/docs/index.md index 1071e6ae4c3c26e8032a95233b5489fdb2023cb6..eee36ab3fcd8f9d297a69a2359c6f157d966811a 100644 --- a/vendor/drush/drush/docs/index.md +++ b/vendor/drush/drush/docs/index.md @@ -2,16 +2,19 @@ Drush is a command line shell and Unix scripting interface for Drupal. Drush cor [](https://packagist.org/packages/drush/drush) [](https://packagist.org/packages/drush/drush) [](https://packagist.org/packages/drush/drush) [](https://packagist.org/packages/drush/drush) +!!! note + + Go to the [Drush 8 docs](https://docs.drush.org/en/8.x) if you want prior version of Drush. + + Resources ----------- -* [Install documentation](http://docs.drush.org/en/8.x/install/) -* [General documentation](http://docs.drush.org) -* [API Documentation](http://api.drush.org) -* [Drush Commands](http://drushcommands.com) -* Subscribe [this atom feed](https://github.com/drush-ops/drush/releases.atom) to receive notification on new releases. Also, [Version eye](https://www.versioneye.com/). -* [Drush packages available via Composer](http://packages.drush.org) +* [Install documentation](https://docs.drush.org/en/master/install/) +* [General documentation](https://docs.drush.org/) +* [API Documentation](https://www.drush.org/api/master/) +* [Drush packages available via Composer](https://packagist.org/?query=drush) * [A list of modules that include Drush integration](https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A4654&solrsort=ds_project_latest_release+desc) -* Drush comes with a [full test suite](https://github.com/drush-ops/drush/blob/8.x/tests/README.md) powered by [PHPUnit](https://github.com/sebastianbergmann/phpunit). Each commit gets tested by the awesome [Travis.ci continuous integration service](https://travis-ci.org/drush-ops/drush). +* [Testing Drush](https://github.com/drush-ops/drush/blob/master/tests/README.md) or your own Drush extensions with [PHPUnit](https://github.com/sebastianbergmann/phpunit). Support ----------- @@ -19,31 +22,6 @@ Support Please take a moment to review the rest of the information in this file before pursuing one of the support options below. -* Post support requests to [Drupal Answers](http://drupal.stackexchange.com/questions/tagged/drush). +* Post support requests to [Drupal Answers](https://drupal.stackexchange.com/questions/tagged/drush). * Bug reports and feature requests should be reported in the [GitHub Drush Issue Queue](https://github.com/drush-ops/drush/issues). * Use pull requests (PRs) to contribute to Drush. -* It is still possible to search the old issue queue on Drupal.org for [fixed bugs](https://drupal.org/project/issues/search/drush?status%5B%5D=7&categories%5B%5D=bug), [unmigrated issues](https://drupal.org/project/issues/search/drush?status%5B%5D=5&issue_tags=needs+migration), [unmigrated bugs](https://drupal.org/project/issues/search/drush?status%5B%5D=5&categories%5B%5D=bug&issue_tags=needs+migration), and so on. - -FAQ ------- - -##### What does the name Drush mean? -The Drupal Shell. - -##### How do I pronounce Drush? - -Some people pronounce the dru with a long u like Drupal. Fidelity points go to them, but they are in the minority. Most pronounce Drush so that it rhymes with hush, rush, flush, etc. This is the preferred pronunciation. - -##### Does Drush have unit tests? - -Drush has an excellent suite of unit tests. See [tests/README.md](https://github.com/drush-ops/drush/blob/8.x/tests/README.md) for more information. - - -Credits ------------ - -* Originally developed by [Arto Bendiken](http://bendiken.net) for Drupal 4.7. -* Redesigned by [Franz Heinzmann](http://unbiskant.org) in May 2007 for Drupal 5. -* Maintained by [Moshe Weitzman](http://drupal.org/moshe) with much help from - Owen Barton, greg.1.anderson, jonhattan, Mark Sonnabaum, Jonathan Hedstrom and - [Christopher Gervais](http://drupal.org/u/ergonlogic). diff --git a/vendor/drush/drush/docs/install-alternative.md b/vendor/drush/drush/docs/install-alternative.md deleted file mode 100644 index 683e2f1427ce3c424e63b66dc29ece3576b08390..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/docs/install-alternative.md +++ /dev/null @@ -1,38 +0,0 @@ -Install a global Drush via Composer ------------------- -Follow the instructions below: - -1. [Install Composer globally](https://getcomposer.org/doc/00-intro.md#globally). -1. Install the [cgr tool](https://github.com/consolidation/cgr) following the [instructions in that project](https://github.com/consolidation/cgr#installation-and-usage). -1. Add composer's `bin` directory to the system path by placing `export PATH="$HOME/.composer/vendor/bin:$PATH"` into your ~/.bash_profile (Mac OS users) or into your ~/.bashrc (Linux users). -1. Install latest stable Drush: `cgr drush/drush`. -1. Verify that Drush works: `drush status` - -Please do not install Drush using `composer global require`. See [Fixing the Composer Global command](https://pantheon.io/blog/fixing-composer-global-command) for more information. - -#### Notes -* Update to latest release (per your specification in ~/.composer/composer.json): `cgr update drush/drush` -* Install a specific version of Drush: - - # Install a specific version of Drush, e.g. Drush 7.1.0 - cgr update drush/drush:7.1.0 - - # Install 8.x branch as a git clone. Great for contributing back to Drush project. - cgr drush/drush:8.x-dev --prefer-source - - -* Alternate way to install for all users via Composer: - - COMPOSER_HOME=/opt/drush COMPOSER_BIN_DIR=/usr/local/bin COMPOSER_VENDOR_DIR=/opt/drush/8 composer require drush/drush:^8 - -* [Documentation for composer's require command.](http://getcomposer.org/doc/03-cli.md#require) -* Uninstall with : `cgr remove drush/drush` - -Windows ------------- -Drush on Windows is experimental, since Drush's test suite is not running there ([help wanted](https://github.com/drush-ops/drush/issues/1612)). - -* [Acquia Dev Desktop](https://www.acquia.com/downloads) is excellent, and includes Drush. See the terminal icon after setting up a web site. -* Or consider running Linux/OSX via Virtualbox. [Drupal VM](http://www.drupalvm.com/) and [Vlad](https://github.com/hashbangcode/vlad) are popular.* These Windows packages include Drush and its dependencies (including MSys). * [7.0.0 (stable)](https://github.com/drush-ops/drush/releases/download/7.0.0/windows-7.0.0.zip). * [6.6.0](https://github.com/drush-ops/drush/releases/download/6.6.0/windows-6.6.0.zip). * [6.0](https://github.com/drush-ops/drush/releases/download/6.0.0/Drush-6.0-2013-08-28-Installer-v1.0.21.msi). -* Or install LAMP on your own, and run Drush via [Git's shell](https://git-for-windows.github.io/), in order to insure that [all depedencies](https://github.com/acquia/DevDesktopCommon/tree/8.x/bintools-win/msys/bin) are available. -* When creating site aliases for Windows remote machines, pay particular attention to information presented in the example.aliases.drushrc.php file, especially when setting values for 'remote-host' and 'os', as these are very important when running Drush rsync and Drush sql-sync commands. diff --git a/vendor/drush/drush/docs/install.md b/vendor/drush/drush/docs/install.md index ec56e33f2fa06404f3cb8d14067f553df84add25..d76c53e27c17030ba916f2a4a3c88b778e24d40c 100644 --- a/vendor/drush/drush/docs/install.md +++ b/vendor/drush/drush/docs/install.md @@ -1,95 +1,78 @@ -Install/Upgrade a global Drush ---------------- -```bash -# Browse to https://github.com/drush-ops/drush/releases and download the drush.phar attached to the latest 8.x release. +!!! note -# Test your install. -php drush.phar core-status - -# Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH. -chmod +x drush.phar -sudo mv drush.phar /usr/local/bin/drush - -# Optional. Enrich the bash startup file with completion and aliases. -drush init -``` + Drush 9 only supports one install method. It requires that your Drupal 8 site be built with Composer and Drush be listed as a dependency. -* MAMP users, and anyone wishing to launch a non-default PHP, needs to [edit ~/.bashrc so that the right PHP is in your $PATH](http://stackoverflow.com/questions/4145667/how-to-override-the-path-of-php-to-use-the-mamp-path/10653443#10653443). -* We have documented [alternative ways to install](http://docs.drush.org/en/8.x/install-alternative/), including [Windows](http://docs.drush.org/en/8.x/install-alternative/#windows). -* If you need to pass custom php.ini values, run `php -d foo=bar drush.phar --php-options=foo=bar` -* Your shell now has [useful bash aliases and tab completion for command names, site aliases, options, and arguments](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.bashrc). -* A [drushrc.php](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.drushrc.php) has been copied to ~/.drush above. Customize it to save typing and standardize options for commands. -* Upgrade using this same procedure. + See the [Drush 8 docs](http://docs.drush.org/en/8.x) for installing prior versions of Drush. -Install a site-local Drush +Install a site-local Drush and Drush Launcher. ----------------- -In addition to the global Drush, it is recommended that Drupal 8 sites be [built using Composer, with Drush listed as a dependency](https://github.com/drupal-composer/drupal-project). +1. It is recommended that Drupal 8 sites be [built using Composer, with Drush listed as a dependency](https://github.com/drupal-composer/drupal-project). That project already includes Drush in its composer.json. If your Composer project doesn't yet depend on Drush, run `composer require drush/drush` to add it. After this step, you may call Drush via `vendor/bin/drush`. +1. Optional. To be able to call `drush` from anywhere, install the [Drush Launcher](https://github.com/drush-ops/drush-launcher). That is a small program which listens on your $PATH and hands control to a site-local Drush that is in the /vendor directory of your Composer project. +1. Optional. Run `drush init`. This edits ~/.bashrc so that Drush's custom prompt and bash integration are active. + +See [Usage](http://docs.drush.org/en/master/usage/) for details on using Drush. + +- Tip: To use a non-default PHP, [edit ~/.bashrc so that the desired PHP is in front of your $PATH](http://stackoverflow.com/questions/4145667/how-to-override-the-path-of-php-to-use-the-mamp-path/10653443#10653443). If that is not desirable, you can change your PATH for just one request: `PATH=/path/to/php:$PATH` drush status ...` +- Tip: To use a custom php.ini for Drush requests, [see this comment](https://github.com/drush-ops/drush/issues/3294#issuecomment-370201342). + +!!! note -1. When you run `drush`, the global Drush is called first and then hands execution to the site-local Drush. This gives you the convenience of running `drush` without specifying the full path to the executable, without sacrificing the safety provided by a site-local Drush. -2. Optional: Copy the [examples/drush.wrapper](https://github.com/drush-ops/drush/blob/8.x/examples/drush.wrapper) file to your project root and modify to taste. This is a handy launcher script; add --local here to turn off all global configuration locations, and maintain consistency over configuration/aliases/commandfiles for your team. -3. Note that if you have multiple Drupal sites on your system, it is possible to use a different version of Drush with each one. + Drush 9 cannot run commandfiles from Drush 8 and below (e.g. example.drush.inc). See our [guide on porting commandfiles](https://weitzman.github.io/blog/port-to-drush9). Also note that alias and config files use a new .yml format in Drush 9. Drupal Compatibility ----------------- <table> <tr> - <th> Drush Version </th> - <th> Drush Branch </th> - <th> PHP </th> - <th> Compatible Drupal versions </th> - <th> Code Style </th> - <th> Isolation Tests </th> - <th> Functional Tests </th> + <th rowspan="2"> Drush Version </th> + <th rowspan="2"> Drush Branch </th> + <th rowspan="2"> PHP </th> + <th colspan="4"> Drupal versions </th> + </tr> + <th>6</th> <th>7</th> <th>-8.3</th> <th>8.4+</th> </tr> <tr> <td> Drush 9 </td> <td> <a href="https://travis-ci.org/drush-ops/drush">master</a> </td> <td> 5.6+ </td> - <td> D8.4+ </td> - <td align="center"> - <img src="https://api.shippable.com/projects/5507addd5ab6cc1352a213b5/badge?branch=master" /> - </td> - <td align="center"> - <img src="https://travis-ci.org/drush-ops/drush.svg?branch=master" /> - </td> - <td align="center"> - <img src="https://circleci.com/gh/drush-ops/drush.svg?style=shield" /> - </td> + <td></td> <td></td> <td></td> <td>✅</td> </tr> <tr> <td> Drush 8 </td> <td> <a href="https://travis-ci.org/drush-ops/drush">8.x</a> </td> <td> 5.4.5+ </td> - <td> D6, D7, D8.3- </td> - <td align="center"> - <img src="https://circleci.com/gh/drush-ops/drush.svg?branch=8.x&style=shield" /> - </td> - <td align="center"> - - - </td> - <td align="center"> - <img src="https://travis-ci.org/drush-ops/drush.svg?branch=8.x" /> - </td> + <td>✅</td> <td>✅</td> <td>✅</td> <td><b>⚠️</b></td> </tr> <tr> <td> Drush 7 </td> <td> <a href="https://travis-ci.org/drush-ops/drush">7.x</a> </td> <td> 5.3.0+ </td> - <td> D6, D7 </td> - <td colspan="3" align="center"> Unsupported </td> + <td>✓</td> <td>✓</td> <td></td> <td></td> </tr> <tr> <td> Drush 6 </td> <td> <a href="https://travis-ci.org/drush-ops/drush">6.x</a> </td> <td> 5.3.0+ </td> - <td> D6, D7 </td> - <td colspan="3" align="center"> Unsupported </td> + <td>✓</td> <td>✓</td> <td></td> <td></td> </tr> <tr> <td> Drush 5 </td> <td> <a href="https://travis-ci.org/drush-ops/drush">5.x</a> </td> <td> 5.2.0+ </td> - <td> D6, D7 </td> - <td colspan="3" align="center"> Unsupported </td> + <td>✓</td> <td>✓</td> <td></td> <td></td> </tr> </table> + +<table> + <tr> + <th colspan="2">Legend</th> + </tr> + <tr> + <td>✅</td> <td>Supported and recommended</td> + </tr> + <tr> + <td><b>⚠️</b></td> <td>Supported but not recommended</td> + </tr> + <tr> + <td>✓</td> <td>Compatible but no longer supported</td> + </tr> +</table> diff --git a/vendor/drush/drush/docs/io.md b/vendor/drush/drush/docs/io.md new file mode 100644 index 0000000000000000000000000000000000000000..edc06e87dd979a7717a684d912644d35bcf05246 --- /dev/null +++ b/vendor/drush/drush/docs/io.md @@ -0,0 +1,14 @@ +Input / Output +============== + +- The Input object holds information about the request such option and argument values. You may need to this information when coding a hook implementation. You don't need this object in your command callback method since these values are passed as parameters. +- The Output object is rarely needed. Instead, return an object that gets formatted via the Output Formatter system. If you want to send additional output, use the io system (see below). + +The io() system +==================== +- If you need to ask the user a question, or print non-object content, use the io() system. +- A command callback gets access via `$this->io()`. +- The main methods for gathering user input are `$this->io->choice()` and `$this->io()->confirm`. +- You may use any of the methods described in the [Symfony Style docs](https://symfony.com/doc/current/console/style.html). + + diff --git a/vendor/drush/drush/docs/make.md b/vendor/drush/drush/docs/make.md deleted file mode 100644 index 91d0fb900605cadc1ae6aa1658807ae570ed7c12..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/docs/make.md +++ /dev/null @@ -1,611 +0,0 @@ - -Drush make ----------- -**Drush make is no longer maintained ([#3946](https://github.com/drush-ops/drush/issues/3946#issuecomment-467861007)), use [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) template for Drupal projects!** - -Drush make is an extension to drush that can create a ready-to-use drupal site, -pulling sources from various locations. It does this by parsing a flat text file -(similar to a drupal `.info` file) and downloading the sources it describes. In -practical terms, this means that it is possible to distribute a complicated -Drupal distribution as a single text file. - -Among Drush make's capabilities are: - -- Downloading Drupal core, as well as contrib modules from drupal.org. -- Checking code out from SVN, git, and bzr repositories. -- Getting plain `.tar.gz` and `.zip` files (particularly useful for libraries - that can not be distributed directly with drupal core or modules). -- Fetching and applying patches. -- Fetching modules, themes, and installation profiles, but also external - libraries. - - -Usage ------ -The `drush make` command can be executed from a path within a Drupal codebase or -independent of any Drupal sites entirely. See the examples below for instances -where `drush make` can be used within an existing Drupal site. - - drush make [-options] [filename.make] [build path] - -The `.make` file format ------------------------ -Each makefile is a plain text file that adheres to YAML syntax. See -the included `examples/example.make.yml` for an example of a working -makefile. - -The older Drupal `.info` INI format is also supported. See -`examples/example.make` for a working example. - -### Core version - -The make file always begins by specifying the core version of Drupal -for which each package must be compatible. Example: - - core: 7.x - -### API version - -The make file must specify which Drush Make API version it uses. This version -of Drush Make uses API version `2` - - api: 2 - - -### Projects - -An array of the projects (e.g. modules, themes, libraries, and drupal) to be -retrieved. Each project name can be specified as a single string value. If -further options need to be provided for a project, the project should be -specified as the key. - -**Project with no further options:** - - projects: - - drupal - -**Project using options (see below):** - - projects: - drupal: - version: "7.33" - -Do not use both types of declarations for a single project in your makefile. - - -### Project options - -- `version` - - Specifies the version of the project to retrieve. - This can be as loose as the major branch number or - as specific as a particular point release. - - projects: - views: - # Picks the latest release. - version: ~ - - projects: - views: - version: "2.8" - - projects: - views: - version: "3.0-alpha2" - - # Shorthand syntax for versions if no other options are to be specified - projects: - views: "3.0-alpha2" - - Note that version numbers should be enclosed in - quotes to ensure they are interpreted correctly - by the YAML parser. - -- `patch` - - One or more patches to apply to this project. An array of patches, - each specified as a URL or local path relative to the makefile. - - projects: - calendar: - patch: - rfc-fixes: - url: "http://drupal.org/files/issues/cal-760316-rfc-fixes-2.diff" - md5: "e4876228f449cb0c37ffa0f2142" - adminrole: - # shorthand syntax if no md5 checksum is specified - patch: - - "http://drupal.org/files/issues/adminrole_exceptions.patch" - - "http://drupal.org/files/issues/adminrole-213212-01.patch" - - "adminrole-customizations.patch" - -- `subdir` - - Place a project within a subdirectory of the `--contrib-destination` - specified. In the example below, `cck` will be placed in - `sites/all/modules/contrib` instead of the default `sites/all/modules`. - - projects: - cck: - subdir: "contrib" - -- `location` - - URL of an alternate project update XML server to use. Allows project XML data - to be retrieved from sites other than `updates.drupal.org`. - - projects: - tao: - location: "http://code.developmentseed.com/fserver" - -- `type` - - The project type. Must be provided if an update XML source is not specified - and/or using version control or direct retrieval for a project. May be one of - the following values: core, module, profile, theme. - - projects: - mytheme: - type: "theme" - -- `directory_name` - - Provide an alternative directory name for this project. By default, the - project name is used. - - projects: - mytheme: - directory_name: "yourtheme" - -- `l10n_path` - - Specific URL (can include tokens) to a translation. Allows translations to be - retrieved from l10n servers other than `localize.drupal.org`. - - projects: - mytheme: - l10n_path: "http://myl10nserver.com/files/translations/%project-%core-%version-%language.po" - -- `l10n_url` - - URL to an l10n server XML info file. Allows translations to be retrieved from - l10n servers other than `localize.drupal.org`. - - projects: - mytheme: - l10n_url: "http://myl10nserver.com/l10n_server.xml" - -- `overwrite` - - Allows the project to be installed in a directory that is not empty. - If not specified this is treated as FALSE, Drush make sets an error when the directory is not empty. - If specified TRUE, Drush make will continue and use the existing directory. - Useful when adding extra files and folders to existing folders in libraries or module extensions. - - projects: - myproject: - overwrite: TRUE - -- `translations` - - Retrieve translations for the specified language, if available, for all projects. - - translations: - - es - - fr - -- `do_recursion` - - Recursively build an included makefile. Defaults to 'true'. - - do_recursion: false - -- `variant` - - Which type of tarball to download for profiles. Valid options include: - - 'full': complete distro including Drupal core, e.g. `distro_name-core.tar.gz` - - 'projects': the fully built profile, projects defined drupal-org.make, etc., e.g. `distro_name-no-core.tar.gz` - - 'profile-only' (just the bare profile, e.g. `distro_name.tar.gz`). - Defaults to 'profile-only'. When using 'projects', `do_recursion: false` will be necessary to avoid recursively making any makefiles included in the profile. - - variant: projects - - - -### Project download options - - Use an alternative download method instead of retrieval through update XML. - - If no download type is specified, make defaults the type to - `git`. Additionally, if no url is specified, make defaults to use - Drupal.org. - - The following methods are available: - -- `download[type] = file` - - Retrieve a project as a direct download. Options: - - `url` - the URL of the file. Required. - The URL can also be a path to a local file either using the bare path or - the file:// protocol. The path may be absolute or relative to the makefile. - - `md5`, `sha1`, `sha256`, or `sha512` - one or more checksums for the file. Optional. - - `request_type` - the request type - get or post. post depends on - http://drupal.org/project/make_post. Optional. - - `data` - The post data to be submitted with the request. Should be a - valid URL query string. Requires http://drupal.org/project/make_post. Optional. - - `filename` - What to name the file, if it's not an archive. Optional. - - `subtree` - if the download is an archive, only this subtree within the - archive will be copied to the target destination. Optional. - -- `download[type] = copy` - - Copies a project from a local folder. Options: - - `url` - the URL of the folder. Required. - The URL must be a path to a local folder either using the bare path or - the file:// protocol. The path may be absolute or relative to the makefile. - - projects[example][type] = "profile" - projects[example][download][type] = "copy" - projects[example][download][url] = "file://./example" - -- `download[type] = bzr` - - Use a bazaar repository as the source for this project. Options: - - `url` - the URL of the repository. Required. - - `working-copy` - If true, the checked out source will be kept as a working copy rather than exported as standalone files - -- `download[type] = git` - - Use a git repository as the source for this project. Options: - - `url` - the URL of the repository. Required. - - `branch` - the branch to be checked out. Optional. - - `revision` - a specific revision identified by commit to check - out. Optional. Note that it is recommended on use `branch` in - combination with `revision` if relying on the .info file rewriting. - - `tag` - the tag to be checked out. Optional. - - projects[mytheme][download][type] = "git" - projects[mytheme][download][url] = "git://github.com/jane_doe/mytheme.git" - - `refspec` - the git reference to fetch and checkout. Optional. - - If this is set, it will have priority over tag, revision and branch options. - - `working-copy` - If true, the checked out source will be kept as a working copy rather than exported as standalone files - -- `download[type] = svn` - - Use an SVN repository as the source for this project. Options: - - `url` - the URL of the repository. Required. - - `interactive` - whether to prompt the user for authentication credentials - when using a private repository. Allows username and/or password options to - be omitted. Optional. - - `username` - the username to use when retrieving an SVN project as a working - copy or from a private repository. Optional. - - `password` - the password to use when retrieving an SVN project as a working - copy or from a private repository. Optional. - - projects: - mytheme: - download: - type: "svn" - url: "http://example.com/svnrepo/cool-theme/" - - `working-copy` - If true, the checked out source will be kept as a working copy rather than exported as standalone files - - Shorthand for `download[url]` available for all download types: - - projects: - mytheme: - download: "git://github.com/jane_doe/mytheme.git" - - is equivalent to: - - projects: - mytheme: - download: - url: "git://github.com/jane_doe/mytheme.git" - -### Libraries - -An array of non-Drupal-specific libraries to be retrieved (e.g. js, PHP or other -Drupal-agnostic components). Each library should be specified as the key of an -array of options in the libraries array. - -**Example:** - - libraries: - jquery_ui: - download: - type: "file" - url: "http://jquery- ui.googlecode.com/files/jquery.ui-1.6.zip" - md5: "c177d38bc7af59d696b2efd7dda5c605" - - -### Library options - -Libraries share the `download`, `subdir`, and `directory_name` options with -projects. Additionally, they may specify a destination: - -- `destination` - - The target path to which this library should be moved. The path is relative to - that specified by the `--contrib-destination` option. By default, libraries - are placed in the `libraries` directory. - - libraries: - jquery_ui: - destination: "modules/contrib/jquery_ui" - - -### Includes - -An array of makefiles to include. Each include may be a local relative path to -the include makefile directory, a direct URL to the makefile, or from a git -repository. Includes are appended in order with the source makefile appended -last. As a result, values in the source makefile take precedence over those in -includes. Use `overrides` for the reverse order of precedence. - -**Example:** - - includes: - # Includes a file in the same directory. - - "example.make" - # Includes a file with a relative path. - - "../example_relative/example_relative.make" - # A remote-hosted file. - - "http://www.example.com/remote.make" - # A file on a git repository. - - makefile: "example_dir/example.make" - download: - type: "git" - url: "git@github.com:organisation/repository.git" - # Branch could be tag or revision, it relies on the standard Drush git download feature. - branch: "master" - -The `--includes` option is available for most make commands, and allows -makefiles to be included at build-time. - -**Example:** - - # Build from a production makefile, but add development and test projects. - $ drush make production.make --includes=dev.make,test.make - - -### Overrides - -Similar to `includes`, `overrides` will include content from other makefiles. -However, the order of precedence is reversed. That is, they override the -keys/values of the source makefile. - -The `--overrides` option is available for most make commands, and allows -overrides to be included at build-time. - -**Example:** - - #production.make.yml: - api: 2 - core: 8.x - includes: - - core.make - - contrib.make - projects: - custom_feature_A: - type: module - download: - branch: production - type: git - url: http://github.com/example/custom_feature_A.git - custom_feature_B: - type: module - download: - branch: production - type: git - url: http://github.com/example/custom_feature_B.git - - # Build production code-base. - $ drush make production.make.yml - - #testing.make - projects: - custom_feature_A: - download: - branch: dev/bug_fix - custom_feature_B: - download: - branch: feature/new_feature - - # Build production code-base using development/feature branches for custom code. - $ drush make /path/to/production.make --overrides=http://url/of/testing.make - - -### Defaults - -If all projects or libraries have identical settings for a given -attribute, the `defaults` array can be used to specify these, -rather than specifying the attribute for each project. - -**Example:** - - # Specify common subdir of "contrib" - defaults: - projects: - subdir: "contrib" - # Projects that don't specify subdir will go to the 'contrib' directory. - projects: - views: - version: "3.3" - # Override a default value. - devel: - subdir: "development" - -### Overriding properties - -Makefiles which include others may override the included makefiles properties. -Properties in the includer takes precedence over the includee. - -**Example:** - -`base.make` - - core: "6.x" - views: - subdir: "contrib" - cck: - subdir: "contrib" - -`extender.make` - - includes: - - "base.make" - projects: - views: - # This line overrides the included makefile's 'subdir' option - subdir: "patched" - - # These lines overrides the included makefile, switching the download type - # to a git clone. - type: "module" - download: - type: "git" - url: "https://git.drupal.org/project/views.git" - -A project or library entry of an included makefile can be removed entirely by -setting the corresponding key to NULL: - - # This line removes CCK entirely which was defined in base.make - cck: ~ - - -Recursion ---------- - -If a project that is part of a build contains a `.make.yml` itself, Drush make will -automatically parse it and recurse into a derivative build. - -For example, a full build tree may look something like this: - - Drush make distro.make distro - - distro.make FOUND - - Drupal core - - Foo bar install profile - + foobar.make.yml FOUND - - CCK - - Token - - Module x - + x.make FOUND - - External library x.js - - Views - - etc. - -Recursion can be used to nest an install profile build in a Drupal site, easily -build multiple install profiles on the same site, fetch library dependencies -for a given module, or bundle a set of module and its dependencies together. -For Drush Make to recognize a makefile embedded within a project, the makefile -itself must have the same name as the project. For instance, the makefile -embedded within the managingnews profile must be called "managingnews.make". If -no makefile matching the project's name is found, Drush Make will look for a -"drupal-org.make.yml" makefile instead. The file must be in the project's root -directory. Subdirectories will be ignored. - -**Build a full Drupal site with the Managing News install profile:** - - core: 6.x - api: 2 - projects: - - drupal - - managingnews - -** Use a distribution as core ** - - core: 7.x - api: 2 - projects: - commerce_kickstart: - type: "core" - version: "7.x-1.19" - -This behavior can be overridden globally using the `--no-recursion` option, or on a project-by-project basis by setting the `do_recursion` project parameter to 'false' in a makefile: - - core: 7.x - api: 2 - projects: - drupal: - type: core - hostmaster: - type: profile - do_recursion: false - - -Testing -------- -Drush make also comes with testing capabilities, designed to test Drush make -itself. Writing a new test is extremely simple. The process is as follows: - -1. Figure out what you want to test. Write a makefile that will test - this out. You can refer to existing test makefiles for - examples. These are located in `DRUSH/tests/makefiles`. -2. Drush make your makefile, and use the --md5 option. You may also use other - options, but be sure to take note of which ones for step 4. -3. Verify that the result you got was in fact what you expected. If so, - continue. If not, tweak it and re-run step 2 until it's what you expected. -4. Using the md5 hash that was spit out from step 2, make a new entry in the - tests clase (DRUSH/tests/makeTest.php), following the example below. - 'machine-readable-name' => array( - 'name' => 'Human readable name', - 'makefile' => 'tests/yourtest.make', - 'messages' => array( - 'Build hash: f68e6510-your-hash-e04fbb4ed', - ), - 'options' => array('any' => TRUE, 'other' => TRUE, 'options' => TRUE), - ), -5. Test! Run Drush test suite (see DRUSH/tests/README.md). To just - run the make tests: - - `./unish.sh --filter=makeMake .` - - -You can check for any messages you want in the message array, but the most -basic tests would just check the build hash. - -Generate --------- - -Drush make has a primitive makefile generation capability. To use it, simply -change your directory to the Drupal installation from which you would like to -generate the file, and run the following command: - -`drush generate-makefile /path/to/make-file.make` - -This will generate a basic makefile. If you have code from other repositories, -the makefile will not complete - you'll have to fill in some information before -it is fully functional. - -Maintainers ------------ -- Jonathan Hedstrom ([jhedstrom](https://www.drupal.org/u/jhedstrom)) -- Christopher Gervais ([ergonlogic](http://drupal.org/u/ergonlogic)) -- [The rest of the Drush maintainers](https://github.com/drush-ops/drush/graphs/contributors) - -Original Author ---------------- -[Dmitri Gaskin (dmitrig01)](https://twitter.com/dmitrig01) diff --git a/vendor/drush/drush/docs/output-formats-filters.md b/vendor/drush/drush/docs/output-formats-filters.md new file mode 100644 index 0000000000000000000000000000000000000000..18756e85aa4273ba41678c08f8a00bb0396c4822 --- /dev/null +++ b/vendor/drush/drush/docs/output-formats-filters.md @@ -0,0 +1,153 @@ +Output Formats, Fields and Filters +================================== + +Drush utilizes a powerful formatting and filtering system that provides the user with a lot of control over how output from various commands is rendered. + +* Output formats may be used to select the data type used to print the output. For example, many commands allow the user to select between a human-readable table, or various machine-parsable formats such as yaml and json. +* Output fields may be used to select and order the data columns. +* Output filters may be used to limit which data rows are printed based on logical expressions. + +Output Formats +============== + +The `--format` option may be used to select the data format used to print the output of a command. Most commands that produce informative output about some object or system can transform their data into different formats. For example, the Drush `version` command may be printed in a human-readable table (the default), or in a json array: +``` +$ drush9 version + Drush version : 9.5.0 +$ drush9 version --format=json +{ + "drush-version": "9.5.0" +} +``` +The available output formats are shown in the `help` for each command: +``` +$ drush help version +Show drush version. + +Options: + --format=<json> Select output format. Available: json, string, var_export, yaml. Default is key-value. +``` + +Output Fields +============= + +If you wish to limit the number of columns produced by a command, use the `--fields` option. List the field names in the order they should be displayed: +``` +$ drush9 views:list --fields=machine-name,status ++-------------------+----------+ +| Machine name | Status | ++-------------------+----------+ +| block_content | Enabled | +| comment | Enabled | +| comments_recent | Enabled | +| content | Enabled | +| content_recent | Enabled | +| files | Enabled | +| frontpage | Enabled | +| taxonomy_term | Enabled | +| user_admin_people | Enabled | +| watchdog | Enabled | +| who_s_new | Enabled | +| who_s_online | Enabled | +| archive | Disabled | +| glossary | Disabled | ++-------------------+----------+ +``` +The available field names are shown in the `help` text: +``` +$ drush9 help views:list +Get a list of all views in the system. + +Options: + --fields=FIELDS Available fields: Machine name (machine-name), + Name (label), Description (description), Status + (status), Tag (tag) [default: + "machine-name,label,description,status"] +``` +Fields may be named either using their human-readable name, or via their machine name. + +Note also that some commands do not display all of their available data columns by default. To show all available fields, use `--fields=*` + +There is also a singluar form `--field` available. If this form is used, it will also force the output format to `string`. +``` +$ drush9 views:list --field=machine-name +block_content +comment +comments_recent +content +content_recent +files +frontpage +taxonomy_term +user_admin_people +watchdog +who_s_new +who_s_online +archive +glossary +``` + +Output Filters +============== + +A number of Drush commands that output tabular data support a `--filter` option that allows rows from the output to be selected with simple logic expressions. + +In its simplest form, the `--filter` option takes a string that indicates the value to filter by in the command's *default filter field*. For example, the `role:list` command's default filter field is `perms`; the output of the `role:list` command may be limited to only those roles that have a specified permission: +``` +$ drush role:list --filter='post comments' +authenticated: + label: 'Authenticated user' + perms: + - 'access comments' + - 'access content' + - 'access shortcuts' + - 'access site-wide contact form' + - 'access user contact forms' + - 'post comments' + - 'search content' + - 'skip comment approval' + - 'use text format basic_html' +``` +Note that not all commands have a default filter field. + +Other fields in the output may be searched by using a simple expression in the `--filter` term. For example, to list only the enabled extensions with the `pm:list` command, you could run: +``` +$ drush pm:list --filter='status=enabled' +``` +To search for fields that contain a string using the operator `*=`, or match a regular expression with the `~=` operator. For example, to find all views whose machine name contains the word "content": +``` +drush views:list --filter='machine-name*=content' +``` +To use a regular expression to find any core requirement notice whose title contains either "php" or "gd" +``` +drush core:requirements --filter='title~=#(php|gd)#i' +``` +Finally, filter expressions may also use logical-and (`&&`) or logical-or (`||`) operations to separate multiple terms. Parenthesis are not supported. For example, to search both the `title` and `severity` fields in the `core:requirements` command: +``` +drush core:requirements --filter='title~=#(php|gd)#i&&severity=warning' +``` + +The `=` and `*=` operators always use case-insensitive comparisons. The `~=` operator is case-sensitive, unless the `i` [PCRE modifier](http://php.net/manual/en/reference.pcre.pattern.modifiers.php) is used, as shown in the previous example. + +Comparison of Filters with Grep +------------------------------- + +Using the `--filter` feature is similar to using `grep`. The main difference is that the filter feature does a semantic search, which is to say that it explicitly compares against the data in specific fields. In comparison, the `grep` command does a line-based search. + +Show only results where the severity is "warning": + +`drush core:requirements --filter='severity=warning'` + +Show only lines that contain the string "warning" (either in the severity field, or somewhere else on the line): + +`drush core:requirements | grep -i warning` + +The table below compares and contrasts the two ways of searching. + +| Feature | --filter | grep | +| ----------------------- | ------------------- | -------------------------- | +| Regular expressions | Yes, with `~=` | Yes | +| Word-wrapped field data | Searched correctly | Might cause false negative | +| Search just one field | Yes | Might get false positives | +| Search multiple fields | Yes, with `||`/`&&` | Yes (line-based searching) | +| Searching hides header | No | Yes (unless it matches) | diff --git a/vendor/drush/drush/docs/output-formats.md b/vendor/drush/drush/docs/output-formats.md deleted file mode 100644 index 1dc37285c8acd8cd82b161121c09e98f17478a1c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/docs/output-formats.md +++ /dev/null @@ -1,20 +0,0 @@ -Drush Output Formats -==================== - -Many Drush commands produce output that may be rendered in a variety of different ways using a pluggable formatting system. Drush commands that support output formats will show a --format option in their help text. The available formats are also listed in the help text, along with the default value for the format option. The list of formats shown is abbreviated; to see the complete list of available formats, run the help command with the --verbose option. - -The --pipe option is a quick, consistent way to get machine readable output from a command, in whatever way the command author thought was helpful. The --pipe option is equivalent to using --format=`<pipe-format>` The pipe format will be shown in the options section of the command help, under the --pipe option. For historic reasons, --pipe also hides all log messages. - -To best understand how the various Drush output formatters work, it is best to first look at the output of the command using the 'var\_export' format. This will show the result of the command using the exact structure that was built by the command, without any reformatting. This is the standard format for the Drush command. Different formatters will take this information and present it in different ways. - -Global Options --------------- - -- --list-separator: Specify how elements in a list should be separated. In lists of lists, this applies to the elements in the inner lists. -- --line-separator: In nested lists of lists, specify how the outer lists ("lines") should be separated. - -Output Formats --------------- - -A list of available formats, and their affect on the output of certain Drush commands, is shown below. - diff --git a/vendor/drush/drush/docs/shellaliases.md b/vendor/drush/drush/docs/shellaliases.md deleted file mode 100644 index 18ab0c41f8c220ce0a67f7c3b00baf81ce750789..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/docs/shellaliases.md +++ /dev/null @@ -1,33 +0,0 @@ -Drush Shell Aliases -=================== - -A Drush shell alias is a shortcut to any Drush command or any shell command. Drush shell aliases are very similar to [git aliases](https://git.wiki.kernel.org/index.php/Aliases\#Advanced). - -A shell alias is defined in a Drush configuration file called drushrc.php. See `drush topic docs-configuration`. There are two kinds of shell aliases: an alias whose value begins with a '!' will execute the rest of the line as bash commands. Aliases that do not start with a '!' will be interpreted as Drush commands. - - $options['shell-aliases']['pull'] = '!git pull'; - $options['shell-aliases']['noncore'] = 'pm-list --no-core'; - -With the above two aliases defined, `drush pull` will then be equivalent to `git pull`, and `drush noncore` will be equivalent to `drush pm-list --no-core`. - -Shell Alias Replacements ------------------------- - -Shell aliases are even more powerful when combined with shell alias replacements and site aliases. Shell alias replacements take the form of {{sitealias-item}} or {{%pathalias-item}}, and also the special {{@target}}, which is replaced with the name of the site alias used, or '@none' if none was used. - -For example, given the following site alias: - - $aliases['dev'] = array ( - 'root' => '/path/to/drupal', - 'uri' => 'http://example.com', - '#live' => '@acme.live', - ); - -The alias below can be used for all your projects to fetch the database and files from the client's live site via `drush @dev pull-data`. Note that these aliases assume that the alias used defines an item named '\#live' (as shown in the above alias). - - $options['shell-aliases'] = array( - 'pull-data' => '!drush sql-sync {{#live}} {{@target}} && drush rsync {{#live}}:%files {{@target}}:%files' - ); - -If the user does not use these shell aliases with any site alias, then an error will be returned and the script will not run. These aliases with replacements can be used to quickly run combinations of drush sql-sync and rsync commands on the "standard" source or target site, reducing the risk of typos that might send information in the wrong direction or to the wrong site. - diff --git a/vendor/drush/drush/docs/shellscripts.md b/vendor/drush/drush/docs/shellscripts.md deleted file mode 100644 index f99955d700c349cac6bd87917a71abdf173d86cc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/docs/shellscripts.md +++ /dev/null @@ -1,50 +0,0 @@ -Drush Shell Scripts -=================== - -A drush shell script is any Unix shell script file that has its "execute" bit set (i.e., via `chmod +x myscript.drush`) and that begins with a specific line: - - #!/usr/bin/env drush - -or - - #!/full/path/to/drush - -The former is the usual form, and is more convenient in that it will allow you to run the script regardless of where drush has been installed on your system, as long as it appears in your PATH. The later form allows you to specify the drush command add options to use, as in: - - #!/full/path/to/drush php-script --some-option - -Adding specific options is important only in certain cases, described later; it is usually not necessary. - -Drush scripts do not need to be named "\*.drush" or "\*.script"; they can be named anything at all. To run them, make sure they are executable (`chmod +x helloworld.script`) and then run them from the shell like any other script. - -There are two big advantages to drush scripts over bash scripts: - -- They are written in php -- drush can bootstrap your Drupal site before running your script. - -To bootstrap a Drupal site, provide an alias to the site to bootstrap as the first commandline argument. - -For example: - - $ helloworld.script @dev a b c - -If the first argument is a valid site alias, drush will remove it from the arument list and bootstrap that site, then run your script. The script itself will not see @dev on its argument list. If you do not want drush to remove the first site alias from your scripts argument list (e.g. if your script wishes to syncronise two sites, specified by the first two arguments, and does not want to bootstrap either of those two sites), then fully specify the drush command (php-script) and options to use, as shown above. By default, if the drush command is not specified, drush will provide the following default line: - - #!/full/path/to/drush php-script --bootstrap-to-first-arg - -It is the option --bootstrap-to-first-arg that causes drush to pull off the first argument and bootstrap it. The way to get rid of that option is to specify the php-script line to run, and leave it off, like so: - - #!/full/path/to/drush php-script - -Note that 'php-script' is the only built-in drush command that makes sense to put on the "shebang" ("\#!" is pronounced "shebang") line. However, if you wanted to, you could implement your own custom version of php-script (e.g. to preprocess the script input, perhaps), and specify that command on the shebang line. - -Drush scripts can access their arguments via the drush\_shift() function: - - while ($arg = drush_shift()) { - drush_print($arg); - } - -Options are available via drush\_get\_option('option-name'). The directory where the script was launched is available via drush_cwd() - -See the example drush script in `drush topic docs-examplescript`, and the list of drush error codes in `drush topic docs-errorcodes`. - diff --git a/vendor/drush/drush/docs/site-alias-manager.md b/vendor/drush/drush/docs/site-alias-manager.md new file mode 100644 index 0000000000000000000000000000000000000000..014f2246b4545e05925e9e06b35af31e5c23ad59 --- /dev/null +++ b/vendor/drush/drush/docs/site-alias-manager.md @@ -0,0 +1,12 @@ +Site Alias Manager +================== + +The [Site Alias Manager (SAM)](https://github.com/consolidation/site-alias/blob/master/src/SiteAliasManager.php) service is used to retrieve information about one or all of the site aliases for the current installation. + +- An informative example is the [browse command](https://github.com/drush-ops/drush/blob/master/src/Commands/core/BrowseCommands.php) +- A commandfile gets access to the SAM by implementing the SiteAliasManagerAwareInterface and *use*ing the SiteAliasManagerAwareTrait trait. Then you gain access via `$this->siteAliasManager()`. +- If an alias was used for the current request, it is available via $this->siteAliasManager()->getself(). +- The SAM generally deals in [AliasRecord](https://github.com/consolidation/site-alias/blob/master/src/AliasRecord.php) objects. That is how any given site alias is represented. See its methods for determining things like whether the alias points to a local host or remote host. +- [An example site alias file](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.site.yml). +- [Dynamically alter site aliases](https://raw.githubusercontent.com/drush-ops/drush/master/examples/Commands/SiteAliasAlterCommands.php). +- The SAM is also available for as [a standalone Composer project](https://github.com/consolidation/site-alias). More information available in the README there. diff --git a/vendor/drush/drush/docs/strict-options.md b/vendor/drush/drush/docs/strict-options.md deleted file mode 100644 index 327aff706516b85a1f6fa6384246533d415f9d78..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/docs/strict-options.md +++ /dev/null @@ -1,15 +0,0 @@ -Strict Option Handling -====================== - -Some Drush commands use strict option handling; these commands require that all Drush global option appear on the command line before the Drush command name. - -One example of this is the core-rsync command: - - drush --simulate core-rsync -v @site1 @site2 - -The --simulate option is a Drush global option that causes Drush to print out what it would do if the command is executed, without actually taking any action. Commands such as core-rsync that use strict option handling require that --simulate, if used, must appear before the command name. Most Drush commands allow the --simulate to be placed anywhere, such as at the end of the command line. - -The -v option above is an rsync option. In this usage, it will cause the rsync command to run in verbose mode. It will not cause Drush to run in verbose mode, though, because it appears after the core-rsync command name. Most Drush commands would be run in verbose mode if a -v option appeared in the same location. - -The advantage of strict option handling is that it allows Drush to pass options and arguments through to a shell command. Some shell commands, such as rsync and ssh, either have options that cannot be represented in Drush. For example, rsync allows the --exclude option to appear multiple times on the command line, but Drush only allows one instance of an option at a time for most Drush commands. Strict option handling overcomes this limitation, plus possible conflict between Drush options and shell command options with the same name, at the cost of greater restriction on where global options can be placed. - diff --git a/vendor/drush/drush/docs/usage.md b/vendor/drush/drush/docs/usage.md index bd996c9a4b137368175bbbcf0f88438cad915e7a..677e79b74cd763c4d4cc16f711ba19b3f10ea0b3 100644 --- a/vendor/drush/drush/docs/usage.md +++ b/vendor/drush/drush/docs/usage.md @@ -1,7 +1,7 @@ Usage ----------- -Drush can be run in your shell by typing "drush" from within any Drupal root directory. +Drush can be run in your shell by typing "drush" from within your project root directory or anywhere within Drupal. $ drush [options] <command> [argument1] [argument2] @@ -13,38 +13,28 @@ For even more documentation, use the 'topic' command: $ drush topic -Options +Using the --uri option and --root options. ----------- -For multisite installations, use the --uri option to target a particular site. If -you are outside the Drupal web root, you might need to use the --root, --uri or other -command line options just for Drush to work. +For multi-site installations, use a site alias or the --uri option to target a particular site. - $ drush --uri=http://example.com pm-updatecode - -If you wish to be able to select your Drupal site implicitly from the -current working directory without using the --uri option, but you need your -base_url to be set correctly, you may force it by setting the uri in -a drushrc.php file located in the same directory as your settings.php file. - -``` -$options['uri'] = "http://example.com"; -``` + $ drush --uri=http://example.com pm:enable + +If you are outside the Composer project and not using a site alias, you need to specify --root and --uri for Drush to locate and bootstrap the right Drupal site. Site Aliases ------------ -Drush lets you run commands on a remote server, or even on a set of remote -servers. Once defined, aliases can be referenced with the @ nomenclature, i.e. +Drush lets you run commands on a remote server. Once defined, aliases can be referenced with the @ nomenclature, i.e. ```bash # Run pending updates on staging site. $ drush @staging updatedb # Synchronize staging files to production $ drush rsync @staging:%files/ @live:%files -# Synchronize database from production to dev, excluding the cache table -$ drush sql-sync --structure-tables-key=custom @live @dev +# Synchronize database from production to local, excluding the cache table +$ drush sql:sync --structure-tables-key=custom @live @self ``` -See [example.aliases.drushrc.php](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.aliases.drushrc.php) for more information. +See [example.site.yml](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.site.yml) for more information. diff --git a/vendor/drush/drush/docs/using-drush-configuration.md b/vendor/drush/drush/docs/using-drush-configuration.md new file mode 100644 index 0000000000000000000000000000000000000000..b5303c9e4cab62494904ec67150b82ff1d4c7f29 --- /dev/null +++ b/vendor/drush/drush/docs/using-drush-configuration.md @@ -0,0 +1,11 @@ +Drush Configuration +=================== + +Drush users may provide configuration via: + +1. yml files that are placed in specific directories. [See our example file](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.drush.yml) for more information. You may also add configuration to a site alias - [see example site alias](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.site.yml). +1. Properly named environment variables are automatically used as configuration. To populate the options.uri config item, create an environment variable like so `DRUSH_OPTIONS_URI=http://example.com`. As you can see, variable names should be uppercased, prefixed with `DRUSH_`, and periods replaced with dashes. + +If you are authoring a commandfile and wish to access the user's configuration, see [Command Authoring](commands.md). + +The Drush configuration system has been factored out of Drush and shared with the world at [https://github.com/consolidation/config](https://github.com/consolidation/config). Feel free to use it for your projects. Lots more usage information is there. diff --git a/vendor/drush/drush/drush b/vendor/drush/drush/drush index 902e66c6bf11bb10c03145ee6215c65ce19ab0cd..5318cb3973fe993a8cb2500da78a02a71ec6bc4b 100755 --- a/vendor/drush/drush/drush +++ b/vendor/drush/drush/drush @@ -1,115 +1,4 @@ #!/usr/bin/env php <?php -/** - * This is the Drush "finder" script, which is one part of the - * Drush dispatching chain. This is the script that - * should appear in your global $PATH, or, if using Composer - * (as usually the case), will be found in your vendor/bin directory. - * - * - * - Never copy this script to your site root. Copy examples/drush instead. - * - * - Never copy this script to a directory other than its install directory. - * Symlink to it instead. - * - * - * OVERVIEW OF DRUSH FINDER / WRAPPER / LAUNCHER SCRIPTS - * - * When the user types "drush", up to three scripts might be - * involved in the initial launch: - * - * "drush finder" -> "drush wrapper" -> "drush launcher". - * - * Brief description of each: - * - * - Drush finder: Finds the right Drush script and calls it. - * - Drush wrapper: Contains user customizations to options. - * - Drush launcher: Excutes drush.php. - * - * A full explanation of each script follows. - * - * - * DRUSH FINDER - * - * - The "drush" script on the user's global $PATH - * - It's goal is to find the correct site-local Drush to run. - * - * The Drush finder will locate the correct site-local Drush to use - * by examining: - * - * a) The --root option - * b) The site set via `drush site set` in the current terminal - * c) The cwd - * - * If no site-local Drush is found, then the global Drush will be - * used. The Drush finder assumes that the global Drush is the - * "Drush launcher" found in the same directory as the Drush finder itself. - * - * If a site-local Drush is found, then the Drush finder will call - * either the "Drush wrapper", if it exists, or the "Drush launcher" if - * there is no wrapper script. - * - * - * DRUSH WRAPPER - * - * - The drush.wrapper script that the user optionally copies and edits. - * - Its goal is to allow the user to add options when --local is in use - * - * The Drush "wrapper" is found at examples/drush.wrapper, and may optionally - * be copied to __ROOT__ by the user. It may be named either - * "drush" or "drush.wrapper". It will call the "Drush launcher" - * for the same site that it is located in. It adds the --local flag; the - * user is encouraged to add other options to the "Drush wrapper", e.g. to set - * the location where aliases and global commandfiles can be found. - * The Drush "finder" script always calls the "Drush wrapper" if it exists; - * however, if the user does not want to customize the early options of - * the site-local Drush (site-alias locations, etc.), then the wrapper does not - * need to be used. - * - * - * DRUSH LAUNCHER - * - * - The "drush.launcher" script in vendor/bin - * - The bash script formerly called "drush" - * - * The "Drush launcher" is the traditional script that identifies PHP and - * sets up to call drush.php. It is called by the "Drush wrapper", or - * directly by the "Drush launcher" if there is no "Drush wrapper" in use. - * - * - * LOCATIONS FOR THESE SCRIPTS - * - * "Drush finder" : __ROOT__/vendor/bin/drush (composer install) - * __DRUSH__/drush (source) - * - * "Drush wrapper" : __ROOT__/drush (copied by user) - * __DRUSH__/examples/drush.wrapper (source) - * - * "Drush launcher" : __ROOT__/vendor/bin/drush.launcher (composer install) - * __DRUSH__/drush.launcher (source) - * - * - * BACKEND CALL DISPATCHING - * - * Backend calls are typically set up to call the "drush" script in the $PATH, - * or perhaps some might call __ROOT__/vendor/bin/drush directly, by way - * of the "drush-script" element in a site alias. In either event, this is - * the "drush finder" script. - * - * The backend call will always set --root. The "Drush finder" script - * always favors the site-local Drush stored with the site indicated by the - * --root option, if it exists. If there is no site-local Drush, then the - * "Drush finder" will behave as usual (i.e., it will end up calling the - * "Drush launcher" located next to it). - * - * This should always get you the correct "Drush" for local and remote calls. - * Note that it is also okay for aliases to specify a path directly to - * drush.launcher, in instances where it is known that a recent version of - * Drush is installed on the remote end. - */ - -if (!function_exists("drush_startup")) { - include __DIR__ . '/includes/startup.inc'; -} -drush_startup($argv); +require __DIR__ . '/drush.php'; diff --git a/vendor/drush/drush/drush.api.php b/vendor/drush/drush/drush.api.php deleted file mode 100644 index 6b99d9ddb074f674492ff3feb4c4710807649dab..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/drush.api.php +++ /dev/null @@ -1,425 +0,0 @@ -<?php - -/** - * @file - * Documentation of the Drush API. - */ - -/** - * Declare a new command. - */ -function hook_drush_command() { - // To learn more, run `drush topic docs-commands` and - // `drush topic docs-examplecommand`. -} - -/** - * All Drush commands are invoked in a specific order, using - * drush-made hooks, very similar to the Drupal hook system. See drush_invoke() - * for the actual implementation. - * - * For any commandfile named "hook", the following hooks are called, in - * order, for the command "COMMAND": - * - * 0. drush_COMMAND_init() - * 1. drush_hook_COMMAND_pre_validate() - * 2. drush_hook_COMMAND_validate() - * 3. drush_hook_pre_COMMAND() - * 4. drush_hook_COMMAND() - * 5. drush_hook_post_COMMAND() - * - * For example, here are the hook opportunities for a mysite.drush.inc file - * that wants to hook into the `pm-download` command. - * - * 1. drush_mysite_pm_download_pre_validate() - * 2. drush_mysite_pm_download_validate() - * 3. drush_mysite_pre_pm_download() - * 4. drush_mysite_pm_download() - * 5. drush_mysite_post_pm_download() - * - * Note that the drush_COMMAND_init() hook is only for use by the - * commandfile that defines the command. - * - * If any of hook function fails, either by calling drush_set_error - * or by returning FALSE as its function result, then the rollback - * mechanism is called. To fail with an error, call drush_set_error: - * - * return drush_set_error('MY_ERROR_CODE', dt('Error message.')); - * - * To allow the user to confirm or cancel a command, use drush_confirm - * and drush_user_abort: - * - * if (!drush_confirm(dt('Are you sure?'))) { - * return drush_user_abort(); - * } - * - * The rollback mechanism will call, in reverse, all _rollback hooks. - * The mysite command file can implement the following rollback hooks: - * - * 1. drush_mysite_post_pm_download_rollback() - * 2. drush_mysite_pm_download_rollback() - * 3. drush_mysite_pre_pm_download_rollback() - * 4. drush_mysite_pm_download_validate_rollback() - * 5. drush_mysite_pm_download_pre_validate_rollback() - * - * Before any command is called, hook_drush_init() is also called. - * hook_drush_exit() is called at the very end of command invocation. - * - * @see includes/command.inc - * - * @see hook_drush_init() - * @see drush_COMMAND_init() - * @see drush_hook_COMMAND_pre_validate() - * @see drush_hook_COMMAND_validate() - * @see drush_hook_pre_COMMAND() - * @see drush_hook_COMMAND() - * @see drush_hook_post_COMMAND() - * @see drush_hook_post_COMMAND_rollback() - * @see drush_hook_COMMAND_rollback() - * @see drush_hook_pre_COMMAND_rollback() - * @see drush_hook_COMMAND_validate_rollback() - * @see drush_hook_COMMAND_pre_validate_rollback() - * @see hook_drush_exit() - */ - -/** - * @addtogroup hooks - * @{ - */ - -/** - * Take action before any command is run. - * - * Logging an error stops command execution. - */ -function hook_drush_init() { - -} - -/** - * Initialize a command prior to validation. - * - * If a command needs to bootstrap to a higher level, this is best done in the - * command init hook. It is permisible to bootstrap in any hook, but note that - * if bootstrapping adds more commandfiles (*.drush.inc) to the commandfile - * list, the newly-added commandfiles will not have any hooks called until the - * next phase. For example, a command that calls drush_bootstrap_max() in - * drush_hook_COMMAND() would only permit commandfiles from modules enabled in - * the site to participate in drush_hook_post_COMMAND() hooks. - */ -function drush_COMMAND_init() { - drush_bootstrap_max(); -} - -/** - * Run before a specific command validates. - * - * Logging an error stops command execution, and the rollback function (if any) - * for each hook implementation is invoked. - * - * @see drush_hook_COMMAND_pre_validate_rollback() - */ -function drush_hook_COMMAND_pre_validate() { - -} - -/** - * Run before a specific command executes. - * - * Logging an error stops command execution, and the rollback function (if any) - * for each hook implementation is invoked. - * - * @see drush_hook_COMMAND_validate_rollback() - */ -function drush_hook_COMMAND_validate() { - -} - -/** - * Run before a specific command executes. - * - * Logging an error stops command execution, and the rollback function (if any) - * for each hook implementation is invoked, in addition to the validate - * rollback. - * - * @see drush_hook_pre_COMMAND_rollback() - * @see drush_hook_COMMAND_validate_rollback() - */ -function drush_hook_pre_COMMAND() { - -} - -/** - * Implementation of the actual drush command. - * - * This is where most of the stuff should happen. - * - * Logging an error stops command execution, and the rollback function (if any) - * for each hook implementation is invoked, in addition to pre and - * validate rollbacks. - * - * @return mixed|false - * The return value will be passed along to the caller if --backend option is - * present. A boolean FALSE indicates failure and rollback will be inititated. - * - * @see drush_hook_COMMAND_rollback() - * @see drush_hook_pre_COMMAND_rollback() - * @see drush_hook_COMMAND_validate_rollback() - */ -function drush_hook_COMMAND() { - -} - -/** - * Run after a specific command executes. - * - * Logging an error stops command execution, and the rollback function (if any) - * for each hook implementation is invoked, in addition to pre, normal - * and validate rollbacks. - * - * @see drush_hook_post_COMMAND_rollback() - * @see drush_hook_COMMAND_rollback() - * @see drush_hook_pre_COMMAND_rollback() - * @see drush_hook_COMMAND_validate_rollback() - */ -function drush_hook_post_COMMAND() { - -} - -/** - * Take action after any command is run. - */ -function hook_drush_exit() { - -} - -/** - * Adjust the contents of any command structure prior to dispatch. - * - * @see core_drush_command_alter() - */ -function hook_drush_command_alter(&$command) { - -} - -/** - * Adjust the contents of a site alias. - */ -function hook_drush_sitealias_alter(&$alias_record) { - // If the alias is "remote", but the remote site is - // the system this command is running on, convert the - // alias record to a local alias. - if (isset($alias_record['remote-host'])) { - $uname = php_uname('n'); - if ($alias_record['remote-host'] == $uname) { - unset($alias_record['remote-host']); - unset($alias_record['remote-user']); - } - } -} - -/** - * Take action after a project has been downloaded. - */ -function hook_drush_pm_post_download($project, $release) { - -} - -/** - * Take action after a project has been updated. - */ -function hook_pm_post_update($project_name, $installed_release, $project) { -} - -/** - * Adjust the location a project should be copied to after being downloaded. - * - * See @pm_drush_pm_download_destination_alter(). - */ -function hook_drush_pm_download_destination_alter(&$project, $release) { - if ($some_condition) { - $project['project_install_location'] = '/path/to/install/to/' . $project['project_dir']; - } -} - -/** - * Automatically download project dependencies at pm-enable time. - * - * Use a pre-pm_enable hook to download before your module is enabled, - * or a post-pm_enable hook (drush_hook_post_pm_enable) to run after - * your module is enabled. - * - * Your hook will be called every time pm-enable is executed; you should - * only download dependencies when your module is being enabled. Respect - * the --skip flag, and take no action if it is present. - */ -function drush_hook_pre_pm_enable() { - // Get the list of modules being enabled; only download dependencies if our - // module name appears in the list. - $modules = drush_get_context('PM_ENABLE_MODULES'); - if (in_array('hook', $modules) && !drush_get_option('skip')) { - $url = 'http://server.com/path/MyLibraryName.tgz'; - $path = drush_get_context('DRUSH_DRUPAL_ROOT'); - drush_include_engine('drupal', 'environment'); - if (drush_module_exists('libraries')) { - $path .= '/' . libraries_get_path('MyLibraryName') . '/MyLibraryName.tgz'; - } - else { - $path .= '/' . drupal_get_path('module', 'hook') . '/MyLibraryName.tgz'; - } - drush_download_file($url, $path) && drush_tarball_extract($path); - } -} - -/** - * Sql-sync sanitization example. - * - * This is equivalent to the built-in --sanitize option of sql-sync, but - * simplified to only work with default values on Drupal 6 + mysql. - * - * @see sql_drush_sql_sync_sanitize() - */ -function hook_drush_sql_sync_sanitize($source) { - $table = drush_get_option('db-prefix') ? '{users}' : 'users'; - drush_sql_register_post_sync_op('my-sanitize-id', - dt('Reset passwords and email addresses in user table.'), - "UPDATE $table SET pass = MD5('password'), mail = concat('user+', uid, '@localhost') WHERE uid > 0;"); -} - -/** - * Add help components to a command. - */ -function hook_drush_help_alter(&$command) { - if ($command['command'] == 'sql-sync') { - $command['options']['myoption'] = "Description of modification of sql-sync done by hook"; - $command['sub-options']['sanitize']['my-sanitize-option'] = "Description of sanitization option added by hook (grouped with --sanitize option)"; - } - if ($command['command'] == 'global-options') { - // Recommended: don't show global hook options in brief global options help. - if ($command['#brief'] === FALSE) { - $command['options']['myglobaloption'] = 'Description of option used globally in all commands (e.g. in a commandfile init hook)'; - } - } -} - -/** - * Add/edit options to cache-clear command. - * - * @param array $types - * Adjust types as needed. Is passed by reference. - * - * @param bool $include_bootstrapped_types - * If FALSE, omit types which require a FULL bootstrap. - */ -function hook_drush_cache_clear(&$types, $include_bootstrapped_types) { - $types['views'] = 'views_invalidate_cache'; -} - -/** - * Inform drush about one or more engine types. - * - * This hook allow to declare available engine types, the cli option to select - * between engine implementatins, which one to use by default, global options - * and other parameters. Commands may override this info when declaring the - * engines they use. - * - * @return array - * An array whose keys are engine type names and whose values describe - * the characteristics of the engine type in relation to command definitions: - * - * - description: The engine type description. - * - topic: If specified, the name of the topic command that will - * display the automatically generated topic for this engine. - * - topic-file: If specified, the path to the file that will be - * displayed at the head of the automatically generated topic for - * this engine. This path is relative to the Drush root directory; - * non-core commandfiles should therefore use: - * 'topic-file' => dirname(__FILE__) . '/mytopic.html'; - * - topics: If set, contains a list of topics that should be added to - * the "Topics" section of any command that uses this engine. Note - * that if 'topic' is set, it will automatically be added to the topics - * list, and therefore does not need to also be listed here. - * - option: The command line option to choose an implementation for - * this engine type. - * FALSE means there's no option. That is, the engine type is for internal - * usage of the command and thus an implementation is not selectable. - * - default: The default implementation to use by the engine type. - * - options: Engine options common to all implementations. - * - add-options-to-command: If there's a single implementation for this - * engine type, add its options as command level options. - * - combine-help: If there are multiple implementations for this engine - * type, then instead of adding multiple help items in the form of - * --engine-option=engine-type [description], instead combine all help - * options into a single --engine-option that lists the different possible - * values that can be used. - * - * @see drush_get_engine_types_info() - * @see pm_drush_engine_type_info() - */ -function hook_drush_engine_type_info() { - return array( - 'dessert' => array( - 'description' => 'Choose a dessert while the sandwich is baked.', - 'option' => 'dessert', - 'default' => 'ice-cream', - 'options' => 'sweetness', - 'add-options-to-command' => FALSE, - ), - ); -} - -/** - * Inform drush about one or more engines implementing a given engine type. - * - * - description: The engine implementation's description. - * - implemented-by: The engine that actually implements this engine. - * This is useful to allow the implementation of similar engines - * in the reference one. - * Defaults to the engine type key (e.g. 'ice-cream'). - * - verbose-only: The engine implementation will only appear in help - * output in --verbose mode. - * - * This hook allow to declare implementations for an engine type. - * - * @see pm_drush_engine_package_handler() - * @see pm_drush_engine_version_control() - */ -function hook_drush_engine_ENGINE_TYPE() { - return array( - 'ice-cream' => array( - 'description' => 'Feature rich ice-cream with all kind of additives.', - 'options' => array( - 'flavour' => 'Choose your favorite flavour', - ), - ), - 'frozen-yogurt' => array( - 'description' => 'Frozen dairy dessert made with yogurt instead of milk and cream.', - 'implemented-by' => 'ice-cream', - ), - ); -} - -/** - * Alter the order that hooks are invoked. - * - * When implementing a given hook we may need to ensure it is invoked before - * or after another implementation of the same hook. For example, let's say - * you want to implement a hook that would be called after drush_make. You'd - * write a drush_MY_MODULE_post_make() function. But if you need your hook to - * be called before drush_make_post_make(), you can ensure this by implemen- - * ting MY_MODULE_drush_invoke_alter(). - * - * @see drush_command_invoke_all_ref() - */ -function hook_drush_invoke_alter($modules, $hook) { - if ($hook == 'some_hook') { - // Take the module who's hooks would normally be called last. - $module = array_pop($modules); - // Ensure it'll be called first for 'some_hook'. - array_unshift($modules, $module); - } -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/vendor/drush/drush/dr.bat b/vendor/drush/drush/drush.bat similarity index 100% rename from vendor/drush/drush/dr.bat rename to vendor/drush/drush/drush.bat diff --git a/vendor/drush/drush/drush.complete.sh b/vendor/drush/drush/drush.complete.sh deleted file mode 100755 index 62ad50743367b242d4e5d9f0e0463f373dd5a35f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/drush.complete.sh +++ /dev/null @@ -1,50 +0,0 @@ -# BASH completion script for Drush. -# -# Place this in your /etc/bash_completion.d/ directory or source it from your -# ~/.bash_completion or ~/.bash_profile files. Alternatively, source -# examples/example.bashrc instead, as it will automatically find and source -# this file. -# -# If you're using ZSH instead of BASH, add the following to your ~/.zshrc file -# and source it. -# -# autoload bashcompinit -# bashcompinit -# source /path/to/your/drush.complete.sh - -# Ensure drush is available. -command -v drush >/dev/null || alias drush &> /dev/null || return - -__drush_ps1() { - f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$" - if [ -f $f ] - then - __DRUPAL_SITE=$(cat "$f") - else - __DRUPAL_SITE="$DRUPAL_SITE" - fi - - # Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a - # __drush_ps1_colorize_alias() function for color hints in your Drush PS1 - # prompt. See example.prompt.sh for an example implementation. - if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then - __drush_ps1_colorize_alias - fi - - [[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE" -} - -# Completion function, uses the "drush complete" command to retrieve -# completions for a specific command line COMP_WORDS. -_drush_completion() { - # Set IFS to newline (locally), since we only use newline separators, and - # need to retain spaces (or not) after completions. - local IFS=$'\n' - # The '< /dev/null' is a work around for a bug in php libedit stdin handling. - # Note that libedit in place of libreadline in some distributions. See: - # https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214 - COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) ) -} - -# Register our completion function. We include common short aliases for Drush. -complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush7 drush8 drush.php diff --git a/vendor/drush/drush/drush.info b/vendor/drush/drush/drush.info index 82b325851c948db637b5b571cc13d23663946b3f..f5951dedb972afb72a9559eedad23fdd100a02ff 100644 --- a/vendor/drush/drush/drush.info +++ b/vendor/drush/drush/drush.info @@ -1 +1 @@ -drush_version=8.2.3 +drush_version=9.7.1 diff --git a/vendor/drush/drush/drush.launcher b/vendor/drush/drush/drush.launcher deleted file mode 100755 index 0136c0df90650344dce2b105484d6134dee1f87b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/drush.launcher +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env sh -# -# This script is a simple launcher that will run Drush with the most appropriate -# php executable it can find. In most cases, the 'drush' script should be -# called first; it will in turn launch this script. -# -# Solaris users: Add /usr/xpg4/bin to the head of your PATH -# - -# Get the absolute path of this executable -SELF_DIRNAME="`dirname -- "$0"`" -SELF_PATH="`cd -P -- "$SELF_DIRNAME" && pwd -P`/`basename -- "$0"`" - -# Decide if we are running a Unix shell on Windows -if `which uname > /dev/null 2>&1`; then - case "`uname -a`" in - CYGWIN*) - CYGWIN=1 ;; - MINGW*) - MINGW=1 ;; - esac -fi - -# Resolve symlinks - this is the equivalent of "readlink -f", but also works with non-standard OS X readlink. -while [ -h "$SELF_PATH" ]; do - # 1) cd to directory of the symlink - # 2) cd to the directory of where the symlink points - # 3) Get the pwd - # 4) Append the basename - DIR="`dirname -- "$SELF_PATH"`" - SYM="`readlink "$SELF_PATH"`" - SYM_DIRNAME="`dirname -- "$SYM"`" - SELF_PATH="`cd "$DIR" && cd "$SYM_DIRNAME" && pwd`/`basename -- "$SYM"`" -done - -# If not exported, try to determine and export the number of columns. -# We do not want to run `tput cols` if $TERM is empty, "unknown", or "dumb", because -# if we do, tput will output an undesirable error message to stderr. If -# we redirect stderr in any way, e.g. `tput cols 2>/dev/null`, then the -# error message is suppressed, but tput cols becomes confused about the -# terminal and prints out the default value (80). -if [ -z $COLUMNS ] && [ -n "$TERM" ] && [ "$TERM" != dumb ] && [ "$TERM" != unknown ] && [ -n "`which tput`" ] ; then - # Note to cygwin/mingw/msys users: install the ncurses package to get tput command. - # Note to mingw/msys users: there is no precompiled ncurses package. - if COLUMNS="`tput cols`"; then - export COLUMNS - fi -fi - -if [ -n "$DRUSH_PHP" ] ; then - # Use the DRUSH_PHP environment variable if it is available. - php="$DRUSH_PHP" -else - # On MSYSGIT, we need to use "php", not the full path to php - if [ -n "$MINGW" ] ; then - php="php" - else - # Default to using the php that we find on the PATH. - # We check for a command line (cli) version of php, and if found use that. - # Note that we need the full path to php here for Dreamhost, which behaves oddly. See http://drupal.org/node/662926 - php="`which php-cli 2>/dev/null`" - - if [ ! -x "$php" ]; then - php="`which php 2>/dev/null`" - fi - - if [ ! -x "$php" ]; then - echo "ERROR: can't find php."; exit 1 - fi - fi -fi - -# Build the path to drush.php. -SCRIPT_PATH="`dirname "$SELF_PATH"`/drush.php" -if [ -n "$CYGWIN" ] ; then - # try to determine if we are running cygwin port php or Windows native php: - if [ -n "`"$php" -i | grep -E '^System => Windows'`" ]; then - SCRIPT_PATH="`cygpath -w -a -- "$SCRIPT_PATH"`" - else - SCRIPT_PATH="`cygpath -u -a -- "$SCRIPT_PATH"`" - fi -fi - -# Check to see if the user has provided a php.ini file or drush.ini file in any conf dir -# Last found wins, so search in reverse priority order -for conf_dir in "`dirname "$SELF_PATH"`" /etc/drush "$HOME/.drush" ; do - if [ ! -d "$conf_dir" ] ; then - continue - fi - # Handle paths that don't start with a drive letter on MinGW shell. Equivalent to cygpath on Cygwin. - if [ -n "$MINGW" ] ; then - conf_dir=`sh -c "cd \"$conf_dir\"; pwd -W"` - fi - if [ -f "$conf_dir/php.ini" ] ; then - drush_php_ini="$conf_dir/php.ini" - fi - if [ -f "$conf_dir/drush.ini" ] ; then - drush_php_override="$conf_dir/drush.ini" - fi -done -# If the PHP_INI environment variable is specified, then tell -# php to use the php.ini file that it specifies. -if [ -n "$PHP_INI" ] ; then - drush_php_ini="$PHP_INI" -fi -# If the DRUSH_INI environment variable is specified, then -# extract all ini variable assignments from it and convert -# them into php '-d' options. These will override similarly-named -# options in the php.ini file -if [ -n "$DRUSH_INI" ] ; then - drush_php_override="$DRUSH_INI" -fi - -# Add in the php file location and/or the php override variables as appropriate -if [ -n "$drush_php_ini" ] ; then - php_options="--php-ini $drush_php_ini" -fi -if [ -n "$drush_php_override" ] ; then - php_options=`grep '^[a-z_A-Z0-9.]\+ *=' $drush_php_override | sed -e 's|\([^ =]*\) *= *\(.*\)|\1="\2"|' -e 's| ||g' -e 's|^|-d |' | tr '\n\r' ' '` -fi -# If the PHP_OPTIONS environment variable is specified, then -# its contents will be passed to php on the command line as -# additional options to use. -if [ -n "$PHP_OPTIONS" ] ; then - php_options="$php_options $PHP_OPTIONS" -fi - -# Pass in the path to php so that drush knows which one to use if it -# re-launches itself to run subcommands. We will also pass in the php options. -# Important note: Any options added here must be removed when Drush processes -# a #! (shebang) script. @see drush_adjust_args_if_shebang_script() -exec "$php" $php_options "$SCRIPT_PATH" --php="$php" --php-options="$php_options" "$@" diff --git a/vendor/drush/drush/drush.php b/vendor/drush/drush/drush.php index f7053d11e5d2eff9c84f20811ae24cb6fa1decff..61275fb2a020163cecd67692375b42f14adb3b4b 100755 --- a/vendor/drush/drush/drush.php +++ b/vendor/drush/drush/drush.php @@ -1,12 +1,74 @@ -#!/usr/bin/env php <?php +use Drush\Drush; +use Drush\Config\Environment; +use Drush\Preflight\Preflight; +use Drush\Runtime\Runtime; +use Drush\Runtime\DependencyInjection; +use Webmozart\PathUtil\Path; + /** - * @file - * drush is a PHP script implementing a command line shell for Drupal. + * This script runs Drush. + * + * Responsibilities of this script: + * - Locate and include the Composer autoload file for Drush. + * - Set up the environment (record user home directory, cwd, etc.). + * - Call the Preflight object to do all necessary setup and execution. + * - Exit with status code returned * - * @requires PHP CLI 5.4.5, or newer. + * It is our goal to put all $_SERVER access and other constructs that are + * difficult to test in this script to reduce the burden on the unit tests. + * This script will only be tested via the functional tests. + * + * The Drush bootstrap goes through the following steps: + * - (ArgsPreprocessor) Preprocess the commandline arguments, considering only: + * - The named alias `@sitealias` (removed from arguments if present) + * - The --root option (read and retained) + * - The --config option (read and retained) + * - The --alias-path option (read and retained) + * - Load the Drush configuration and alias files from the standard + * global locations (including --config and --alias-path) + * - Determine the local Drupal site targeted, if any + * - Include the Composer autoload for Drupal (if different) + * - Extend configuration and alias files to include files in target Drupal site. + * - Create the Robo DI container and Symfony Application et. al. + * - Run the Symfony Application + * - Predispatch: call a remote Drush command if applicable + * - Bootstrap Drupal via @bootstrap command hook + * - Run commands and command hooks via annotated commands library + * - Catch 'command not found' exception, bootstrap Drupal and run again + * - Return status code */ -require __DIR__ . '/includes/preflight.inc'; -exit(drush_main()); +// We use PWD if available because getcwd() resolves symlinks, which could take +// us outside of the Drupal root, making it impossible to find. In addition, +// is_dir() is used as the provided path may not be recognizable by PHP. For +// instance, Cygwin adds a '/cygdrive' prefix to the path which is a virtual +// directory. +$cwd = isset($_SERVER['PWD']) && is_dir($_SERVER['PWD']) ? $_SERVER['PWD'] : getcwd(); + +// Set up autoloader +$loader = false; +if (file_exists($autoloadFile = __DIR__ . '/vendor/autoload.php') + || file_exists($autoloadFile = __DIR__ . '/../autoload.php') + || file_exists($autoloadFile = __DIR__ . '/../../autoload.php') +) { + $loader = include_once($autoloadFile); +} else { + throw new \Exception("Could not locate autoload.php. cwd is $cwd; __DIR__ is " . __DIR__); +} + +// Set up environment +$environment = new Environment(Path::getHomeDirectory(), $cwd, $autoloadFile); +$environment->setConfigFileVariant(Drush::getMajorVersion()); +$environment->setLoader($loader); +$environment->applyEnvironment(); + +// Preflight and run +$preflight = new Preflight($environment); +$di = new DependencyInjection(); +$di->desiredHandlers(['errorHandler', 'shutdownHandler']); +$runtime = new Runtime($preflight, $di); +$status_code = $runtime->run($_SERVER['argv']); + +exit($status_code); diff --git a/vendor/drush/drush/drush.yml b/vendor/drush/drush/drush.yml new file mode 100644 index 0000000000000000000000000000000000000000..63e5b3287a872b3ee447aab148ac0706614403ba --- /dev/null +++ b/vendor/drush/drush/drush.yml @@ -0,0 +1,4 @@ +#This is a Drush config file. Sites may override this config to change minimum PHP. +drush: + php: + minimum-version: 5.6.0 diff --git a/vendor/drush/drush/examples/Commands/ArtCommands.php b/vendor/drush/drush/examples/Commands/ArtCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..796ebb4f6eae9e8bc47d59a5bb7b62a638c9301f --- /dev/null +++ b/vendor/drush/drush/examples/Commands/ArtCommands.php @@ -0,0 +1,187 @@ +<?php +namespace Drush\Commands; + +use Consolidation\AnnotatedCommand\AnnotationData; +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\AnnotatedCommand\Events\CustomEventAwareInterface; +use Consolidation\AnnotatedCommand\Events\CustomEventAwareTrait; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; + +use Drush\Style\DrushStyle; +use Drush\Utils\StringUtils; + +/** + * Run these commands using the --include option - e.g. `drush --include=/path/to/drush/examples art sandwich` + * + * For an example of a Drupal module implementing commands, see + * - http://cgit.drupalcode.org/devel/tree/devel_generate/src/Commands + * - http://cgit.drupalcode.org/devel/tree/devel_generate/drush.services.yml + * + * This file is a good example of the first of those bullets (a commandfile) but + * since it isn't part of a module, it does not implement drush.services.yml. + * + * See [Drush Test Traits](https://github.com/drush-ops/drush/blob/master/tests/README.md#about-the-test-suites) for info on testing Drush commands. + */ + +class ArtCommands extends DrushCommands implements CustomEventAwareInterface +{ + use CustomEventAwareTrait; + + /** @var string[] */ + protected $arts; + + /** + * Show a fabulous picture. + * + * @command artwork:show + * @aliases arts + * @param $art The name of the art to display + * @usage drush art sandwich + * Show a marvelous picture of a sandwich with pickles. + */ + public function art($art = '') + { + $data = $this->getArt(); + $name = $data[$art]['name']; + $description = $data[$art]['description']; + $path = $data[$art]['path']; + $msg = dt( + 'Okay. Here is {art}: {description}', + ['art' => $name, 'description' => $description] + ); + $this->output()->writeln("\n" . $msg . "\n"); + $this->printFile($path); + } + + /** + * Show a table of information about available art. + * + * @command artwork:list + * @aliases artls + * @field-labels + * name: Name + * description: Description + * path: Path + * @default-fields name,description + * + * @filter-default-field name + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function listArt($options = ['format' => 'table']) + { + $data = $this->getArt(); + return new RowsOfFields($data); + } + + /** + * Commandfiles may also add topics. These will appear in + * the list of topics when `drush topic` is executed. + * To view the topic below, run `drush --include=/full/path/to/examples topic` + */ + + /** + * Ruminations on the true meaning and philosophy of artwork. + * + * @command artwork:explain + * @hidden + * @topic + */ + public function ruminate() + { + self::printFile(__DIR__ . '/art-topic.md'); + } + + /** + * Return the available built-in art. Any Drush commandfile may provide + * more art by implementing a 'drush-art' on-event hook. This on-event + * hook is defined in the 'findArt' method beolw. + * + * @hook on-event drush-art + */ + public function builtInArt() + { + return [ + 'drush' => [ + 'name' => 'Drush', + 'description' => 'The Drush logo.', + 'path' => __DIR__ . '/art/drush-nocolor.txt', + ], + 'sandwich' => [ + 'name' => 'Sandwich', + 'description' => 'A tasty meal with bread often consumed at lunchtime.', + 'path' => __DIR__ . '/art/sandwich-nocolor.txt', + ], + ]; + } + + /** + * @hook interact artwork:show + */ + public function interact(InputInterface $input, OutputInterface $output, AnnotationData $annotationData) + { + $io = new DrushStyle($input, $output); + + // If the user did not specify any artwork, then prompt for one. + $art = $input->getArgument('art'); + if (empty($art)) { + $data = $this->getArt(); + $selections = $this->convertArtListToKeyValue($data); + $selection = $io->choice('Select art to display', $selections); + $input->setArgument('art', $selection); + } + } + + /** + * @hook validate artwork:show + */ + public function artValidate(CommandData $commandData) + { + $art = $commandData->input()->getArgument('art'); + $data = $this->getArt(); + if (!isset($data[$art])) { + throw new \Exception(dt('I do not have any art called "{name}".', ['name' => $art])); + } + } + + /** + * Get a list of available artwork. Cache result for future fast access. + */ + protected function getArt() + { + if (!isset($this->arts)) { + $this->arts = $this->findArt(); + } + return $this->arts; + } + + /** + * Use custom defined on-event hook 'drush-art' to find available artwork. + */ + protected function findArt() + { + $arts = []; + $handlers = $this->getCustomEventHandlers('drush-art'); + foreach ($handlers as $handler) { + $handlerResult = $handler(); + $arts = array_merge($arts, $handlerResult); + } + return $arts; + } + + /** + * Given a list of artwork, converte to a 'key' => 'Name: Description' array. + * @param array $data + * @return array + */ + protected function convertArtListToKeyValue($data) + { + $result = []; + foreach ($data as $key => $item) { + $result[$key] = $item['name'] . ': ' . $item['description']; + } + return $result; + } +} diff --git a/vendor/drush/drush/examples/Commands/PolicyCommands.php b/vendor/drush/drush/examples/Commands/PolicyCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..7316f0c426febffe30c31e1cb2f0ffca135fca28 --- /dev/null +++ b/vendor/drush/drush/examples/Commands/PolicyCommands.php @@ -0,0 +1,62 @@ +<?php +namespace Drush\Commands; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Symfony\Component\Console\Input\InputOption; + +/** + * Load this commandfile using the --include option - e.g. `drush --include=/path/to/drush/examples` + * + * See [Drush Test Traits](https://github.com/drush-ops/drush/blob/master/tests/README.md#about-the-test-suites) for info on testing Drush commands. + */ + +class PolicyCommands extends DrushCommands +{ + + /** + * Prevent catastrophic braino. Note that this file has to be local to the + * machine that initiates the sql:sync command. + * + * @hook validate sql:sync + * @throws \Exception + */ + public function sqlSyncValidate(CommandData $commandData) + { + if ($commandData->input()->getArgument('destination') == '@prod') { + throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__])); + } + } + + /** + * Limit rsync operations to production site. + * + * @hook validate core:rsync + */ + public function rsyncValidate(CommandData $commandData) + { + if (preg_match("/^@prod/", $commandData->input()->getArgument('destination'))) { + throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__])); + } + } + + /** + * Unauthorized may not execute updates. + * + * @hook validate updatedb + */ + public function validateUpdateDb(CommandData $commandData) + { + if (!$commandData->input()->getOption('secret') == 'mysecret') { + throw new \Exception(dt('UpdateDb command requires a secret token per site policy.')); + } + } + + /** + * @hook option updatedb + * @option secret A required token else user may not run updatedb command. + */ + public function optionsetUpdateDb($options = ['secret' => self::REQ]) + { + } +} diff --git a/vendor/drush/drush/examples/Commands/SiteAliasAlterCommands.php b/vendor/drush/drush/examples/Commands/SiteAliasAlterCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..28ebdcdc26481b958362cab728c8edaa0d4d1cfe --- /dev/null +++ b/vendor/drush/drush/examples/Commands/SiteAliasAlterCommands.php @@ -0,0 +1,39 @@ +<?php +namespace Drush\Commands; + +use Consolidation\AnnotatedCommand\AnnotationData; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Symfony\Component\Console\Input\InputInterface; + +/** + * Load this example by using the --include option - e.g. `drush --include=/path/to/drush/examples` + */ +class SiteAliasAlterCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + + use SiteAliasManagerAwareTrait; + + /** + * A few example alterations to site aliases. + * + * @hook pre-init * + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param \Consolidation\AnnotatedCommand\AnnotationData $annotationData + */ + public function alter(InputInterface $input, AnnotationData $annotationData) + { + $self = $this->siteAliasManager()->getSelf(); + if ($self->isRemote()) { + // Always pass along ssh keys. + if (!$self->has('ssh.options')) { + // Don't edit the alias - edit the general config service instead. + $this->getConfig()->set('ssh.options', '-o ForwardAgent=yes'); + } + + // Change the SSH user. + $input->setOption('remote-user', 'mw2'); + } + } +} diff --git a/vendor/drush/drush/examples/Commands/SyncViaHttpCommands.php b/vendor/drush/drush/examples/Commands/SyncViaHttpCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..369a47766bab63b42dd1449240a9428d1c129ec7 --- /dev/null +++ b/vendor/drush/drush/examples/Commands/SyncViaHttpCommands.php @@ -0,0 +1,102 @@ +<?php +namespace Drush\Commands; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exec\ExecTrait; +use Symfony\Component\Filesystem\Filesystem; + +/** + * Load this commandfile using the --include option - e.g. `drush --include=/path/to/drush/examples` + */ + +class SyncViaHttpCommands extends DrushCommands +{ + + /** + * When a hook extends a command with additional options, it must + * implement declare those option(s) in a @hook option like this one. Doing so will add + * the option to the help text for the modified command, and will also + * allow the new option to be specified on the command line. Without + * this, Drush will fail with an error when a user attempts to use + * an unknown option. + * + * @hook option sql-sync + * @option http-sync Copy the database via http instead of rsync. Value is the url that the existing database dump can be found at. + * @option http-sync-user Username for the protected directory containing the sql dump. + * @option http-sync-password Password for the same directory. + */ + public function optionsetSqlSync() + { + } + + /** + * During the pre hook, determine if the http-sync option has been + * specified. If it has been, then disable the normal ssh + rsync + * dump-and-transfer that sql-sync usually does, and transfer the + * database dump via an http download. + * + * @hook pre-command sql-sync + */ + public function preSqlSync(CommandData $commandData) + { + $sql_dump_download_url = $commandData->input()->getOption('http-sync'); + if (!empty($sql_dump_download_url)) { + $user = $commandData->input()->getOption('http-sync-user'); + $password = $commandData->input()->getOption('http-sync-password'); + $source_dump_file = $this->downloadFile($sql_dump_download_url, $user, $password); + $commandData->input()->setOption('target-dump', $source_dump_file); + $commandData->input()->setOption('no-dump', true); + $commandData->input()->setOption('no-sync', true); + } + } + + /** + * Downloads a file. + * + * Optionally uses user authentication, using either wget or curl, as available. + */ + protected function downloadFile($url, $user = false, $password = false, $destination = false, $overwrite = true) + { + static $use_wget; + if ($use_wget === null) { + $use_wget = ExecTrait::programExists('wget'); + } + + $destination_tmp = drush_tempnam('download_file'); + if ($use_wget) { + $args = ['wget', '-q', '--timeout=30']; + if ($user && $password) { + $args = array_merge($args, ["--user=$user", "--password=$password", '-O', $destination_tmp, $url]); + } else { + $args = array_merge($args, ['-O', $destination_tmp, $url]); + } + } else { + $args = ['curl', '-s', '-L', '--connect-timeout 30']; + if ($user && $password) { + $args = array_merge($args, ['--user', "$user:$password", '-o', $destination_tmp, $url]); + } else { + $args = array_merge($args, ['-o', $destination_tmp, $url]); + } + } + $process = Drush::process($args); + $process->mustRun(); + + if (!Drush::simulate()) { + if (!drush_file_not_empty($destination_tmp) && $file = @file_get_contents($url)) { + @file_put_contents($destination_tmp, $file); + } + if (!drush_file_not_empty($destination_tmp)) { + // Download failed. + throw new \Exception(dt("The URL !url could not be downloaded.", ['!url' => $url])); + } + } + if ($destination) { + $fs = new Filesystem(); + $fs->rename($destination_tmp, $destination, $overwrite); + return $destination; + } + return $destination_tmp; + } +} diff --git a/vendor/drush/drush/examples/Commands/XkcdCommands.php b/vendor/drush/drush/examples/Commands/XkcdCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..fbd7b4e592c751683c03535cea1b9c83c4399eff --- /dev/null +++ b/vendor/drush/drush/examples/Commands/XkcdCommands.php @@ -0,0 +1,58 @@ +<?php +namespace Drush\Commands; + +use Drush\Exec\ExecTrait; + +/** + * Run these commands using the --include option - e.g. `drush --include=/path/to/drush/examples xkcd` + * + * For an example of a Drush extension with tests for Drush 9 and Drush 8: + * - https://github.com/drush-ops/example-drush-extension + */ + +class XkcdCommands extends DrushCommands +{ + + use ExecTrait; + + /** + * Retrieve and display xkcd cartoons. + * + * @command xkcd:fetch + * @param $search Optional argument to retrieve the cartoons matching an index number, keyword search or "random". If omitted the latest cartoon will be retrieved. + * @option image-viewer Command to use to view images (e.g. xv, firefox). Defaults to "display" (from ImageMagick). + * @option google-custom-search-api-key Google Custom Search API Key, available from https://code.google.com/apis/console/. Default key limited to 100 queries/day globally. + * @usage drush xkcd + * Retrieve and display the latest cartoon. + * @usage drush xkcd sandwich + * Retrieve and display cartoons about sandwiches. + * @usage drush xkcd 123 --image-viewer=eog + * Retrieve and display cartoon #123 in eog. + * @usage drush xkcd random --image-viewer=firefox + * Retrieve and display a random cartoon in Firefox. + * @aliases xkcd + */ + public function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIzaSyDpE01VDNNT73s6CEeJRdSg5jukoG244ek']) + { + if (empty($search)) { + $this->startBrowser('http://xkcd.com'); + } elseif (is_numeric($search)) { + $this->startBrowser('http://xkcd.com/' . $search); + } elseif ($search == 'random') { + $xkcd_response = @json_decode(file_get_contents('http://xkcd.com/info.0.json')); + if (!empty($xkcd_response->num)) { + $this->startBrowser('http://xkcd.com/' . rand(1, $xkcd_response->num)); + } + } else { + // This uses an API key with a limited number of searches per. + $search_response = @json_decode(file_get_contents('https://www.googleapis.com/customsearch/v1?key=' . $options['google-custom-search-api-key'] . '&cx=012652707207066138651:zudjtuwe28q&q=' . $search)); + if (!empty($search_response->items)) { + foreach ($search_response->items as $item) { + $this->startBrowser($item->link); + } + } else { + throw new \Exception(dt('The search failed or produced no results.')); + } + } + } +} diff --git a/vendor/drush/drush/examples/Commands/art-topic.md b/vendor/drush/drush/examples/Commands/art-topic.md new file mode 100644 index 0000000000000000000000000000000000000000..53e3b00f4e38c1272fec8591a5315925c5ecfb04 --- /dev/null +++ b/vendor/drush/drush/examples/Commands/art-topic.md @@ -0,0 +1,6 @@ +I have discovered a truly marvelous proof that it is impossible to +separate a piece of art into two cubes, or four pieces of art into two +fourth of a piece of art, or in general, any artwork larger than the +second into two like artistic expressions. + +This text file is too narrow to contain it. diff --git a/vendor/drush/drush/examples/Commands/art/drush-nocolor.txt b/vendor/drush/drush/examples/Commands/art/drush-nocolor.txt new file mode 100644 index 0000000000000000000000000000000000000000..4c96e0180e72ebcd0c08ef5c0d25236b8fbabe48 --- /dev/null +++ b/vendor/drush/drush/examples/Commands/art/drush-nocolor.txt @@ -0,0 +1,73 @@ + + .` + `++++++++++ + ,'',+++#####++ + ;;,,,,++#######+ + ',,,,,++#######+ + ',,,,,++#######+: + ;,,,,:+########++ + :,,,,'+########++ . + .,,,,,++########++ ,'''';+++. + ,'+++. ;,,,,,++#########+ `',,,,,++#++: + ',++++++ ',,,,,++#########+; :;,,,,;++###++; + ',+++##+++` ';''++++#########+++++,,,,,+++#####++; + ',+++#####++'`'',;++++##############++++,,+++#######++. + ',;++#######+++,:+++'##################+++++##########++ + ',,++#########'++++'#######################+###########++ + ';'+++###########++####################################++ + ':::++#################################################+; + ':::++###############################################++ + ::::;++#############################################++ + ':::+++############################################+' + ':::++###########################################++ + `;:::++##########################################+` + ':::;++#########################################++ + ''''++##########################################+: + ,,,,'+###########################################++ + ',,.++############################################+, + `:,,;+#############################################++ + ',,,++##############################################+ + ',,,++##############################################++;. + :,,,'+###############################################+++++++++: + `;';,,++#####################################################++++' + .'';,,,,,+++########################################################++ +;';,,,,;++++++#########################################################++ +;,;++++++++#############################################################+ +,,,+++#################################################################++ +.,,++###################################################################+ +.,,++#################################################################@#+ +.:,++############################,` .##################################++ +`:,++########################## ################ #######+++++++ + ;,++########################: .############ ###++++++. + ',++#######################; ########## ###+: + '++++##################### :###### :##+ + :++++++++++#############` ###: .#++ + ,+++++############ :#++ + ',,;+############ ##+, + ;,,++########### `###, ##+ + '::++########### ######' #++ + ;:;+########### ########## ##+` + '::++########### :###' `#### #++ + .':;+############ .#### #### ###++ + ',':++############; ###### ##### #####.,#####+, + ',,,:'++####################### ######.###########@++ + :,,,,,++#########################################@@@++ + ',,,,,'+#########################################@@@@#+; + :,,,,,,++################### `########+ #######@@@@@@++` + ',,,,,++##################### #######@@@@@@@@++ + ',,,,,'+#######################+ ;######+#@@@@@@@@@++ + ',,,,++####################################+++++@@@@@@@++ + ',,++####################################++;:'++#@@@@#+; + ''+###########+++#####################+++ '':+++@@#++ + ++#########+++:++++###############++++ ,'+++#++ + .++#######+++ ,++++++##########+++ `'+++ + .++#####++: ':;++++#########+; . + `++###++ ;::::,++#######@+, + +++++ ::::,++#####@@#+ + ++' ;:::,++##@@@@@#+ + '::::;+@@@@@@@++ + '::::,+#@@@@@@++ + ,'::,+#@@@@@@++ + ':,++@@@@@@+; + ':++@##++++. + diff --git a/vendor/drush/drush/examples/sandwich-nocolor.txt b/vendor/drush/drush/examples/Commands/art/sandwich-nocolor.txt similarity index 100% rename from vendor/drush/drush/examples/sandwich-nocolor.txt rename to vendor/drush/drush/examples/Commands/art/sandwich-nocolor.txt diff --git a/vendor/drush/drush/examples/sandwich.txt b/vendor/drush/drush/examples/Commands/art/sandwich.txt similarity index 100% rename from vendor/drush/drush/examples/sandwich.txt rename to vendor/drush/drush/examples/Commands/art/sandwich.txt diff --git a/vendor/drush/drush/examples/drush.wrapper b/vendor/drush/drush/examples/drush.wrapper deleted file mode 100755 index a5acf587cb1b60b01ad3300f8149fbac6e78871c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/drush.wrapper +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env sh -# -# DRUSH WRAPPER -# -# A wrapper script which launches the Drush that is in your project's /vendor -# directory. Copy it to the root of your project and edit as desired. -# You may rename this script to 'drush', if doing so does not cause a conflict -# (e.g. with a folder __ROOT__/drush). -# -# Below are options which you might want to add. More info at -# `drush topic core-global-options`: -# -# --local Only discover commandfiles/site aliases/config that are -# inside your project dir. -# --alias-path A list of directories where Drush will search for site -# alias files. -# --config A list of paths to config files -# --include A list of directories to search for commandfiles. -# -# Note that it is recommended to use --local when using a drush -# wrapper script. -# -# See the 'drush' script in the Drush installation root (../drush) for -# an explanation of the different 'drush' scripts. -# -# IMPORTANT: Modify the path below if your 'vendor' directory has been -# relocated to another location in your composer.json file. -# `../vendor/bin/drush.launcher --local $@` is a common variant for -# composer-managed Drupal sites. -# -cd "`dirname $0`" -../vendor/bin/drush.launcher --local "$@" diff --git a/vendor/drush/drush/examples/example.aliases.drushrc.php b/vendor/drush/drush/examples/example.aliases.drushrc.php deleted file mode 100644 index 7b3abd059250bbcc2b8949e02ef9f52289cd597a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/example.aliases.drushrc.php +++ /dev/null @@ -1,352 +0,0 @@ -<?php - -/** - * @file - * Example of valid statements for an alias file. - * - * Use this file as a guide to creating your own aliases. - * - * Aliases are commonly used to define short names for - * local or remote Drupal installations; however, an alias - * is really nothing more than a collection of options. - * A canonical alias named "dev" that points to a local - * Drupal site named "http://example.com" looks like this: - * - * @code - * $aliases['dev'] = array( - * 'root' => '/path/to/drupal', - * 'uri' => 'http://example.com', - * ); - * @endcode - * - * With this alias definition, then the following commands - * are equivalent: - * - * $ drush @dev status - * $ drush --root=/path/to/drupal --uri=http://example.com status - * - * See the --uri option documentation below for hints on setting its value. - * - * Any option that can be placed on the drush commandline - * can also appear in an alias definition. - * - * There are several ways to create alias files. - * - * + Put each alias in a separate file called ALIASNAME.alias.drushrc.php - * + Put multiple aliases in a single file called aliases.drushrc.php - * + Put groups of aliases into files called GROUPNAME.aliases.drushrc.php - * - * Drush will search for aliases in any of these files using - * the alias search path. The following locations are examined - * for alias files: - * - * 1. In any path set in $options['alias-path'] in drushrc.php, - * or (equivalently) any path passed in via --alias-path=... - * on the command line. - * 2. In one of the default locations: - * a. /etc/drush - * b. $HOME/.drush - * 3. In one of the site-specific locations: - * a. The /drush and /sites/all/drush folders for the current Drupal site - * b. The /drush folder in the directory above the current Drupal site - * - * These locations are searched recursively. If there is a folder called - * 'site-aliases' in any search path, then Drush will search for site aliases - * only inside that directory. - * - * The preferred locations for alias files, then, are: - * - * /etc/drush/site-aliases - * $HOME/.drush/site-aliases - * $ROOT/drush/site-aliases - * $ROOT/sites/all/drush/site-aliases - * $ROOT/../drush/site-aliases - * - * Or any path set in $options['alias-path'] or via --alias-path. - * - * Folders and files containing other versions of drush in their names will - * be *skipped* (e.g. mysite.aliases.drush4rc.php or - * drush4/mysite.aliases.drushrc.php). Names containing the current version of - * Drush (e.g. mysite.aliases.drush5rc.php) will be loaded. - * - * Files stored in these locations can be used to create aliases - * to local and remote Drupal installations. These aliases can be - * used in place of a site specification on the command line, and - * may also be used in arguments to certain commands such as - * "drush rsync" and "drush sql-sync". - * - * Alias files that are named after the single alias they contain - * may use the syntax for the canonical alias shown at the top of - * this file, or they may set values in $options, just - * like a drushrc.php configuration file: - * - * @code - * $options['uri'] = 'http://example.com'; - * $options['root'] = '/path/to/drupal'; - * @endcode - * - * When alias files use this form, then the name of the alias - * is taken from the first part of the alias filename. - * - * Alias groups (aliases stored together in files called - * GROUPNAME.aliases.drushrc.php, as mentioned above) also - * create an implicit namespace that is named after the group - * name. - * - * For example: - * - * @code - * # File: mysite.aliases.drushrc.php - * $aliases['dev'] = array( - * 'root' => '/path/to/drupal', - * 'uri' => 'http://example.com', - * ); - * $aliases['live'] = array( - * 'root' => '/other/path/to/drupal', - * 'uri' => 'http://example.com', - * ); - * @endcode - * - * Then the following special aliases are defined: - * - @mysite: An alias named after the groupname may be used to reference all of - * the aliases in the group (e.g., `drush @mydrupalsite status`). - * - @mysite.dev: A copy of @dev. - * - @mysite.live: A copy of @live. - * - * Thus, aliases defined in an alias group file may be referred to - * either by their simple (short) name, or by their full namespace-qualified - * name. - * - * To see an example alias definition for the current bootstrapped - * site, use the "site-alias" command with the built-in alias "@self": - * - * $ drush site-alias @self - * - * TIP: If you would like to have drush include a 'databases' record - * in the output, include the options --with-db and --show-passwords: - * - * $ drush site-alias @self --with-db --show-passwords - * - * Drush also supports *remote* site aliases. When a site alias is - * defined for a remote site, Drush will use the ssh command to run - * the requested command on the remote machine. The simplest remote - * alias looks like this: - * - * @code - * $aliases['live'] = array( - * 'remote-host' => 'server.domain.com', - * 'remote-user' => 'www-admin', - * ); - * @endcode - * - * The form above requires that Drush be installed on the remote machine, - * and that there also be an alias of the same name defined on that - * machine. The remote alias should define the 'root' and 'uri' elements, - * as shown in the initial example at the top of this file. - * - * If you do not wish to maintain site aliases on the remote machine, - * then you may define an alias that contains all of the elements - * 'remote-host', 'remote-user', 'root' and 'uri'. If you do this, then - * Drush will make the remote call using the --root and --uri options - * to identify the site, so no site alias is required on the remote server. - * - * @code - * $aliases['live'] = array( - * 'remote-host' => 'server.domain.com', - * 'remote-user' => 'www-admin', - * 'root' => '/other/path/to/drupal', - * 'uri' => 'http://example.com', - * ); - * @endcode - * - * If you would like to see all of the Drupal sites at a specified - * root directory, use the built-in alias "@sites": - * - * $ drush -r /path/to/drupal site-alias @sites - * - * It is also possible to define explicit lists of sites using a special - * alias list definition. Alias lists contain a list of alias names in - * the group, and no other information. For example: - * - * @code - * $aliases['mydevsites'] = array( - * 'site-list' => array('@mysite.dev', '@otherside.dev') - * ); - * @endcode - * - * The built-in alias "@none" represents the state of no Drupal site; - * to ignore the site at the cwd and just see default drush status: - * - * $ drush @none status - * - * See `drush help site-alias` for more options for displaying site - * aliases. See `drush topic docs-bastion` for instructions on configuring - * remote access to a Drupal site behind a firewall via a bastion server. - * - * Although most aliases will contain only a few options, a number - * of settings that are commonly used appear below: - * - * - 'uri': In Drupal 7 and 8, the value of --uri should always be the same as - * when the site is being accessed from a web browser (e.g. http://example.com) - * In Drupal 6, the value of --uri should always be the same as the site's folder - * name in the 'sites' folder (e.g. default); it is best if the site folder name - * matches the URI from the browser, and is consistent on every instance of the - * same site (e.g. also use sites/example.com for http://example.com). - * - 'root': The Drupal root; must not be specified as a relative path. - * - 'remote-host': The fully-qualified domain name of the remote system - * hosting the Drupal instance. **Important Note: The remote-host option - * must be omitted for local sites, as this option controls various - * operations, such as whether or not rsync parameters are for local or - * remote machines, and so on. @see hook_drush_sitealias_alter() in drush.api.php - * - 'remote-user': The username to log in as when using ssh or rsync. - * - 'os': The operating system of the remote server. Valid values - * are 'Windows' and 'Linux'. Be sure to set this value for all remote - * aliases because the default value is PHP_OS if 'remote-host' - * is not set, and 'Linux' (or $options['remote-os']) if it is. Therefore, - * if you set a 'remote-host' value, and your remote OS is Windows, if you - * do not set the 'OS' value, it will default to 'Linux' and could cause - * unintended consequences, particularly when running 'drush sql-sync'. - * - 'ssh-options': If the target requires special options, such as a non- - * standard port, alternative identity file, or alternative - * authentication method, ssh-options can contain a string of extra - * options that are used with the ssh command, eg "-p 100" - * - 'parent': Deprecated. See "altering aliases", below. - * - 'path-aliases': An array of aliases for common rsync targets. - * Relative aliases are always taken from the Drupal root. - * - '%drush-script': The path to the 'drush' script, or to 'drush.php'. - * This is used by backend invoke when drush - * runs a drush command. The default is 'drush' on remote machines, or - * the full path to drush.php on the local machine. - * - '%drush': A read-only property: points to the folder that the drush - * script is stored in. - * - '%files': Path to 'files' directory. This will be looked up if not - * specified. - * - '%root': A reference to the Drupal root defined in the 'root' item in the - * site alias record. - * - 'php': path to custom php interpreter. Windows support limited to Cygwin. - * - 'php-options': commandline options for php interpreter, you may - * want to set this to '-d error_reporting="E_ALL^E_DEPRECATED"' - * - 'variables' : An array of name/value pairs which override Drupal - * variables/config. These values take precedence even over settings.php - * overrides. - * - 'command-specific': These options will only be set if the alias - * is used with the specified command. In the example below, the option - * `--no-dump` will be selected whenever the @stage alias - * is used in any of the following ways: - * - `drush @stage sql-sync @self @live` - * - `drush sql-sync @stage @live` - * - `drush sql-sync @live @stage` - * In case of conflicting options, command-specific options in targets - * (source and destination) take precedence over command-specific options - * in the bootstrapped site, and command-specific options in a destination - * alias will take precedence over those in a source alias. - * - 'source-command-specific' and 'target-command-specific': Behaves exactly - * like the 'command-specific' option, but is applied only if the alias - * is used as the source or target, respectively, of an rsync or sql-sync - * command. In the example below, `--skip-tables-list=comments` whenever - * the alias @live is the target of an sql-sync command, but comments will - * be included if @live is the source for the sql-sync command. - * - '#peer': Settings that begin with a '#' are not used directly by Drush, and - * in fact are removed before making a backend invoke call (for example). - * These kinds of values are useful in conjunction with shell aliases. See - * `drush topic docs-shell-aliases` for more information on this. - * - '#env-vars': An associative array of keys and values that should be set on - * the remote side before invoking drush. - * - rsync command options have specific requirements in order to - * be passed through by Drush. See the comments on the sample below: - * - * @code - * 'command-specific' => array ( - * 'core-rsync' => array ( - * - * // single-letter rsync options are placed in the 'mode' key - * // instead of adding '--mode=rultvz' to drush rsync command. - * 'mode' => 'rultvz', - * - * // multi-letter rsync options without values must be set to - * // TRUE or NULL to work (i.e. setting $VALUE to 1, 0, or '' - * // will not work). - * 'delete' => TRUE, - * - * // if you need multiple excludes, use an rsync exclude file - * 'exclude-from' => "'/etc/rsync/exclude.rules'", - * - * // filter options with white space must be wrapped in "" to preserve - * // the inner ''. - * 'filter' => "'exclude *.sql'", - * - * // if you need multple filter options, see rsync merge-file options - * 'filter' => "'merge /etc/rsync/default.rules'", - * ), - * ), - * @endcode - * - * Altering aliases: - * - * Alias records are written in php, so you may use php code to alter - * alias records if you wish. For example: - * - * @code - * $common_live = array( - * 'remote-host' => 'myserver.isp.com', - * 'remote-user' => 'www-admin', - * ); - * - * $aliases['live'] = array( - * 'uri' => 'http://example.com', - * 'root' => '/path.to/root', - * ) + $common_live; - * @endcode - * - * If you wish, you might want to put $common_live in a separate file, - * and include it at the top of each alias file that uses it. - * - * You may also use a policy file to alter aliases in code as they are - * loaded by Drush. See policy_drush_sitealias_alter in - * `drush topic docs-policy` for details. - * - * Some examples appear below. Remove the leading hash signs to enable. - */ - -#$aliases['stage'] = array( -# 'uri' => 'http://stage.example.com', -# 'root' => '/path/to/remote/drupal/root', -# 'remote-host' => 'mystagingserver.myisp.com', -# 'remote-user' => 'publisher', -# 'os' => 'Linux', -# 'path-aliases' => array( -# '%drush' => '/path/to/drush', -# '%drush-script' => '/path/to/drush/drush', -# '%files' => 'sites/mydrupalsite.com/files', -# '%custom' => '/my/custom/path', -# ), -# 'variables' => array( -# 'site_name' => 'My Drupal site', -# ), -# 'command-specific' => array ( -# 'sql-sync' => array ( -# 'no-dump' => TRUE, -# ), -# ), -# # This shell alias will run `mycommand` when executed via -# # `drush @stage site-specific-alias` -# 'shell-aliases' => array ( -# 'site-specific-alias' => '!mycommand', -# ), -# ); -#$aliases['dev'] = array( -# 'uri' => 'http://dev.example.com', -# 'root' => '/path/to/drupal/root', -# 'variables' => array( -# 'mail_system' => array('default-system' => 'DevelMailLog'), -# ), -# ); -#$aliases['server'] = array( -# 'remote-host' => 'mystagingserver.myisp.com', -# 'remote-user' => 'publisher', -# 'os' => 'Linux', -# ); -#$aliases['live'] = array( -# 'uri' => 'http://example.com', -# 'root' => $aliases['dev']['root'], -# ) + $aliases['server']; diff --git a/vendor/drush/drush/examples/example.bashrc b/vendor/drush/drush/examples/example.bashrc index 8f7069f97152fb63849412b0b16ce5c03a7ae6c3..a3120461658ad836fb87247999b20f1391e185e5 100644 --- a/vendor/drush/drush/examples/example.bashrc +++ b/vendor/drush/drush/examples/example.bashrc @@ -8,7 +8,6 @@ # # dr - drush # ddd - drush drupal-directory -# dl - drush pm-download # ev - drush php-eval # sa - drush site-alias # sa - drush site-alias --local-only (show local site aliases) @@ -17,17 +16,10 @@ # # Aliases for Drush commands that work on the current drupal site: # -# cc - drush cache-clear # cr - drush cache-rebuild -# cca - drush cache-clear all -# dis - drush pm-disable # en - drush pm-enable -# i - drush pm-info # pml - drush pm-list -# rf - drush pm-refresh # unin - drush pm-uninstall -# up - drush pm-update -# upc - drush pm-updatecode # updb - drush updatedb # q - drush sql-query # @@ -64,28 +56,19 @@ # Aliases for common Drush commands that work in a global context. alias dr='drush' -alias ddd='drush drupal-directory' -alias dl='drush pm-download' -alias ev='drush php-eval' -alias sa='drush site-alias' -alias lsa='drush site-alias --local-only' -alias st='drush core-status' -alias use='drush site-set' +alias ddd='drush drupal:directory' +alias ev='drush php:eval' +alias sa='drush site:alias' +alias st='drush core:status' +alias use='drush site:set' # Aliases for Drush commands that work on the current drupal site -alias cc='drush cache-clear' -alias cr='drush cache-rebuild' -alias cca='drush cache-clear all' -alias dis='drush pm-disable' -alias en='drush pm-enable' -alias pmi='drush pm-info' -alias pml='drush pm-list' -alias rf='drush pm-refresh' -alias unin='drush pm-uninstall' -alias up='drush pm-update' -alias upc='drush pm-updatecode' +alias cr='drush cache:rebuild' +alias en='drush pm:enable' +alias pml='drush pm:list' +alias unin='drush pm:uninstall' alias updb='drush updatedb' -alias q='drush sql-query' +alias q='drush sql:query' # Overrides for standard shell commands. Uncomment to enable. Alias # cd='cdd' if you want to be able to use cd @remote to ssh to a @@ -125,7 +108,7 @@ function fastcddl() { builtin cd elif [ "${s:0:1}" == "@" ] || [ "${s:0:1}" == "%" ] then - d="$(drush drupal-directory $1 --local-only 2>/dev/null)" + d="$(drush drupal:directory $1 --local-only 2>/dev/null)" if [ $? == 0 ] then echo "cd $d"; @@ -155,8 +138,8 @@ function cdd() { builtin cd elif [ "${s:0:1}" == "@" ] || [ "${s:0:1}" == "%" ] then - d="$(drush drupal-directory $s 2>/dev/null)" - rh="$(drush sa ${s%%:*} --fields=remote-host --format=list)" + d="$(drush drupal:directory $s 2>/dev/null)" + rh="$(drush sa ${s%%:*} --fields=host --format=list)" if [ -z "$rh" ] then echo "cd $d" @@ -183,7 +166,7 @@ function gitd() { if [ -n "$s" ] && [ ${s:0:1} == "@" ] || [ ${s:0:1} == "%" ] then d="$(drush drupal-directory $s 2>/dev/null)" - rh="$(drush sa ${s%%:*} --fields=remote-host --format=list)" + rh="$(drush sa ${s%%:*} --fields=host --format=list)" if [ -n "$rh" ] then drush ${s%%:*} ssh "cd '$d' ; git ${@:2}" @@ -206,10 +189,10 @@ function lsd() { for a in "$@" ; do if [ ${a:0:1} == "@" ] || [ ${a:0:1} == "%" ] then - p[${#p[@]}]="$(drush drupal-directory $a 2>/dev/null)" + p[${#p[@]}]="$(drush drupal:directory $a 2>/dev/null)" if [ ${a:0:1} == "@" ] then - rh="$(drush sa ${a%:*} --fields=remote-host --format=list)" + rh="$(drush sa ${a%:*} --fields=host --format=list)" if [ -n "$rh" ] then r=${a%:*} @@ -234,7 +217,7 @@ function cpd() { for a in "$@" ; do if [ ${a:0:1} == "@" ] || [ ${a:0:1} == "%" ] then - p[${#p[@]}]="$(drush drupal-directory $a --local-only 2>/dev/null)" + p[${#p[@]}]="$(drush drupal:directory $a --local-only 2>/dev/null)" elif [ -n "$a" ] then p[${#p[@]}]="$a" @@ -254,10 +237,3 @@ function dssh() { "ssh" "$@" fi } - -# Drush checks the current PHP version to ensure compatibility, and fails with -# an error if less than the supported minimum (currently 5.4.5). If you would -# like to try to run Drush on a lower version of PHP, you can un-comment the -# line below to skip this check. Note, however, that this is un-supported. - -# DRUSH_NO_MIN_PHP=TRUE diff --git a/vendor/drush/drush/examples/example.drush.ini b/vendor/drush/drush/examples/example.drush.ini deleted file mode 100644 index 96652d7d9a00ccca1844eb8a49177cef3de27fd0..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/example.drush.ini +++ /dev/null @@ -1,85 +0,0 @@ -; -; Example of a drush php settings override file. -; -; IMPORTANT: This file has no effect when using -; drush.phar. It is only effective when used -; a Composer built Drush is used. When a drush.phar -; hands off execution to a Composer built Drush, -; this file is effective. -; -; IMPORTANT: Before following the instructions in -; this file, first check to see that the cli version -; of php is installed on your system. (e.g. On -; debian systems, `sudo apt-get install php5-cli`.) -; -; Use this file in instances when your system is -; -not- configured to use separate php.ini files for -; webserver and cli use. You can determine which -; php.ini file drush is using by running "drush status". -; If the php.ini file shown is your webserver ini -; file, then rename this file, example.drush.ini, -; to drush.ini and copy it to one of the following -; locations: -; -; 1. Drush installation folder -; 2. User's .drush folder (i.e. ~/.drush/drush.ini) -; 3. System wide configuration folder (i.e. /etc/drush/drush.ini) -; -; If the environment variable DRUSH_INI is defined, -; then the file it specified will be used as drush.ini. -; -; export DRUSH_INI='/path/to/drush.ini' -; -; When in use, the variables defined in this file -; will override the setting values that appear in -; your php.ini file. See the examples below for -; some values that may need to be set in order for -; drush to work. -; -; NOTE: There is a certain amount of overhead -; required for each override, so drush.ini should -; only be used for a relatively small number -; of variables. Comment out any variable that -; has the same value as the webserver php.ini -; to keep the size of the override list small. -; -; To fully specify the value of all php.ini variables, -; copy your webserver php.ini file to one of the -; locations mentioned above (e.g. /etc/drush/php.ini) -; and edit it to suit. Alternately, you may use -; the environment variable PHP_INI to point at -; the file that Drush should use. -; -; export PHP_INI='/path/to/php.ini' -; -; The options listed below are particularly relevant -; to drush. -; - -; -; drush needs as much memory as Drupal in order -; to run; make the memory limit setting match -; what you have in your webserver's php.ini. -; -memory_limit = 128M - -; -; Show all errors and direct them to stderr -; when running drush. -; -error_reporting = E_ALL | E_NOTICE | E_STRICT -display_errors = stderr - -; -; If your php.ini for your webserver is too -; restrictive, you can re-enable functionality -; for drush by adjusting values in this file. -; -; Here are some examples of settings that are -; sometimes set to restrictive values in a -; webserver's php.ini: -; -;safe_mode = -;open_basedir = -;disable_functions = -;disable_classes = diff --git a/vendor/drush/drush/examples/example.drush.yml b/vendor/drush/drush/examples/example.drush.yml new file mode 100644 index 0000000000000000000000000000000000000000..0138224fecb9e89f6059ff381fd998eb578da81e --- /dev/null +++ b/vendor/drush/drush/examples/example.drush.yml @@ -0,0 +1,173 @@ +# +# Examples of valid statements for a Drush runtime config (drush.yml) file. +# +# Use this file to cut down on typing out lengthy and repetitive command line +# options in the Drush commands you use and to avoid mistakes. +# +# The Drush configuration system has been factored out and shared with +# the world at https://github.com/consolidation/config. Feel free to use it +# for your projects. Lots more usage information is there. + +# Directories and Discovery +# +# Rename this file to drush.yml and copy it to one of the places listed below +# in order of precedence: +# +# 1. Drupal site folder (e.g. sites/{default|example.com}/drush.yml). +# 2. Drupal /drush and sites/all/drush folders, or the /drush folder +# in the directory above the Drupal root. +# 3. In any location, as specified by the --config (-c) option. +# 4. User's .drush folder (i.e. ~/.drush/drush.yml). +# 5. System wide configuration folder (e.g. /etc/drush/drush.yml or C:\ProgramData\Drush\drush.yml). +# +# If a configuration file is found in any of the above locations, it will be +# loaded and merged with other configuration files in the search list. +# +# Version-specific configuration +# +# Drush started using yml files for configuration in version 9; earlier versions +# of Drush will never attempt to load a drush.yml file. It is also possible +# to limit the version of Drush that will load a configuration file by placing +# the Drush major version number in the filename, e.g. drush9.yml. + +# Environment variables +# +# Your Drush config file may reference environment variables using a syntax like ${env.home}. +# For example see the drush.paths examples below. +# +# An alternative way to populate Drush configuration is to define environment variables that +# correspond to config keys. For example, to populate the options.uri config item, +# create an environment variable `DRUSH_OPTIONS_URI=http://example.com`. +# As you can see, variable names should be uppercased, prefixed with `DRUSH_`, and periods +# replaced with dashes. + +drush: + paths: + # Specify config files to load. + config: + # Load any personal config files. Is silently skipped if not found. Filename must be drush.yml + - ${env.home}/.drush/config/drush.yml + + + # Specify folders to search for Drush command files. These locations + # are always merged with include paths defined on the command line or + # in other configuration files. On the command line, paths may be separated + # by a colon (:) on Unix-based systems or a semi-colon (;) on Windows, + # or multiple --include options may be provided. Drush 8 and earlier did + # a deep search in ~/.drush and /usr/share/drush/commands when loading + # command files. + # + # For testing, specify the namespace component in the key. e.g.: + # + # drush: + # include: + # 'Commands/example_drush_extension': '${env.PWD}' + include: + - '${env.home}/.drush/commands' + - /usr/share/drush/commands + + # Specify the folders to search for Drush alias files (*.site.yml). These + # locations are always merged with alias paths defined on the command line + # or in other configuration files. On the command line, paths may be + # separated by a colon (:) on Unix-based systems or a semi-colon (;) on + # Windows, or multiple --alias-path options may be provided. Note that + # Drush 8 and earlier did a deep search in ~/.drush and /etc/drush when + # loading alias files. + alias-path: + - '${env.home}/.drush/sites' + - /etc/drush/sites + + # Specify a folder where Drush should store its file based caches. If unspecified, defaults to $HOME/.drush. + #cache-directory: /tmp/.drush + +# This section is for setting global options. +options: + # Specify the base_url that should be used when generating links. + # Not recommended if you have more than one Drupal site on your system. +# uri: 'http://example.com/subdir' + + # Specify your Drupal core base directory (useful if you use symlinks). + # Not recommended if you have more than one Drupal root on your system. +# root: '/home/USER/workspace/drupal-6' + + # Enable verbose mode. +# verbose: true + +# This section is for setting command-specific options. +command: + sql: + dump: + options: + # Uncomment to omit cache and similar tables (including during a sql:sync). +# structure-tables-key: common + php: + script: + options: + # Additional folders to search for scripts. +# script-path: 'sites/all/scripts:profiles/myprofile/scripts' + core: + rsync: + options: + # Ensure all rsync commands use verbose output. +# verbose: true + + site: + install: + options: + # Set a predetermined username and password when using site-install. +# account-name: 'alice' +# account-pass: 'secret' + + +# +# The sections below are configuration thats consulted by various commands, outside +# of the option system. +# + +sql: + # An explicit list of tables which should be included in sql-dump and sql-sync. + tables: + common: + - user + - permissions + - role_permissions + - role + # List of tables whose *data* is skipped by the 'sql-dump' and 'sql-sync' + # commands when the "--structure-tables-key=common" option is provided. + # You may add specific tables to the existing array or add a new element. + structure-tables: + common: + - cache + - 'cache_*' + - history + - 'search_*' + - 'sessions' + - 'watchdog' + # List of tables to be omitted entirely from SQL dumps made by the 'sql-dump' + # and 'sql-sync' commands when the "--skip-tables-key=common" option is + # provided on the command line. This is useful if your database contains + # non-Drupal tables used by some other application or during a migration for + # example. You may add new tables to the existing array or add a new element. + skip-tables: + common: + - 'migration_*' + +ssh: + # Specify options to pass to ssh in backend invoke. The default is to prohibit + # password authentication, and is included here, so you may add additional + # parameters without losing the default configuration. + options: '-o PasswordAuthentication=no' + # This string is valid for Bash shell. Override in case you need something different. See https://github.com/drush-ops/drush/issues/3816. + pipefail: 'set -o pipefail; ' + +notify: + # Notify when command takes more than 30 seconds. +# duration: 30 + # Specify a command to run. Defaults to Notification Center (OSX) or libnotify (Linux) +# cmd: /path/to/program + # See src/Commands/core/NotifyCommands.php for more configuration settings. + +xh: + # Start profiling via xhprof/tideways and show a link to the run report. +# link: http://xhprof.local + # See src/Commands/core/XhprofCommands.php for more configuration settings. diff --git a/vendor/drush/drush/examples/example.drushrc.php b/vendor/drush/drush/examples/example.drushrc.php deleted file mode 100644 index 9d54ca8f98efc282f59c7b32e8744d289eba51ef..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/example.drushrc.php +++ /dev/null @@ -1,300 +0,0 @@ -<?php - -/** - * @file - * Examples of valid statements for a Drush runtime config (drushrc) file. - * - * Use this file to cut down on typing out lengthy and repetitive command line - * options in the Drush commands you use and to avoid mistakes. - * - * Rename this file to drushrc.php and optionally copy it to one of the places - * listed below in order of precedence: - * - * 1. Drupal site folder (e.g. sites/{default|example.com}/drushrc.php). - * 2. Drupal /drush and sites/all/drush folders, or the /drush folder - * in the directory above the Drupal root. - * 3. In any location, as specified by the --config (-c) option. - * 4. User's .drush folder (i.e. ~/.drush/drushrc.php). - * 5. System wide configuration folder (e.g. /etc/drush/drushrc.php). - * 6. Drush installation folder. - * - * If a configuration file is found in any of the above locations, it will be - * loaded and merged with other configuration files in the search list. - * - * If you have some configuration options that are specific to a particular - * version of Drush, then you may place them in a file called drush5rc.php. - * The version-specific file is loaded in addition to, and after, the general- - * purpose drushrc file. Version-specific configuration files can be placed - * in any of the locations specified above. - * - * IMPORTANT NOTE regarding configuration file on Windows: - * - * For Windows 7, Windows Vista, Windows Server 2008 and later versions is the - * system window configuration folder C:\ProgramData\Drush. For previous - * versions of Windows is the folder C:\Documents and Settings\All Users\Drush. - * - * IMPORTANT NOTE on configuration file loading: - * - * At its core, Drush works by "bootstrapping" the Drupal environment in very - * much the same way that is done during a normal page request from the web - * server, so most Drush commands run in the context of a fully-initialized - * website. - * - * Configuration files are loaded in the reverse order they are shown above. All - * configuration files are loaded in the first bootstrapping phase, but - * a configuration file in a specific Drupal site folder other than the default - * (eg, sites/example.com/drushrc.php) will not be loaded unless a specific - * Drupal site is selected. However, it _will_ be loaded if a site is selected - * (either via the current working directory or by use of the --uri option), - * even if the Drush command being run does not bootstrap to the Drupal Site - * phase. - * - * The Drush commands 'rsync' and 'sql-sync' are special cases. These commands - * will load the configuration file for the site specified by the source - * parameter; however, they do not load the configuration file for the site - * specified by the destination parameter, nor do they load configuration files - * for remote sites. - * - * See `drush topic docs-bootstrap` for more information on how bootstrapping - * affects the loading of Drush configuration files. - */ - -// Specify the base_url that should be used when generating links -# $options['l'] = 'http://example.com/subdir'; - -// Specify your Drupal core base directory (useful if you use symlinks). -# $options['r'] = '/home/USER/workspace/drupal-6'; - -/** - * Useful shell aliases: - * - * Drush shell aliases act similar to git aliases. For best results, define - * aliases in one of the drushrc file locations between #3 through #6 above. - * More information on shell aliases can be found via: - * `drush topic docs-shell-aliases` on the command line. - * - * @see https://git.wiki.kernel.org/index.php/Aliases#Advanced - */ -# $options['shell-aliases']['pull'] = '!git pull'; // We've all done it. -# $options['shell-aliases']['pulldb'] = '!git pull && drush updatedb'; -# $options['shell-aliases']['noncore'] = 'pm-list --no-core'; -# $options['shell-aliases']['self-alias'] = 'site-alias @self --with-db --alias-name=new'; -# $options['shell-aliases']['site-get'] = '@none php-eval "return drush_sitealias_site_get();"'; -// Add a 'pm-clone' to simplify git cloning from drupal.org. -# $options['shell-aliases']['pm-clone'] = 'pm-download --gitusername=YOURUSERNAME --package-handler=git_drupalorg'; -// Save a sanitized sql dump. Customize alias names and --result-file. -# $options['shell-aliases']['sql-transfer'] = 'drush sql-sync @source @temp --sanitize && drush @temp sql-dump --result-file=/example && drush @temp sql-drop'; - -# Drupal 8. -# $options['shell-aliases']['offline'] = 'drush sset system.maintenance_mode 1 --input-format=integer'; -# $options['shell-aliases']['online'] = 'drush sset system.maintenance_mode 0 --input-format=integer'; -# $options['shell-aliases']['cpull'] = 'config-pull @example.prod @self --label=vcs'; -# $options['shell-aliases']['wipe'] = 'cache-rebuild'; - -#Drupal 7 (and 6). -# $options['shell-aliases']['offline'] = 'variable-set -y --always-set maintenance_mode 1'; -# $options['shell-aliases']['online'] = 'variable-delete -y --exact maintenance_mode'; -# $options['shell-aliases']['wipe'] = 'cache-clear all'; -# $options['shell-aliases']['dis-all'] = '!drush -y dis `drush pml --status=enabled --type=module --no-core --pipe`'; -# $options['shell-aliases']['unsuck'] = 'pm-disable -y overlay,dashboard'; - -/** - * Load a drushrc.php configuration file from the current working directory. - */ -# $options['config'][] = './drushrc.php'; - -/** - * By default, Drush will download projects compatible with the current - * version of Drupal, or, if no Drupal site is specified, then the Drupal-8 - * version of the project is downloaded. Set default-major to select a - * different default version. - */ -# $options['default-major'] = 7; - -// Clone extensions (modules, themes, etc.) from drupal.org via 'pm-download'. -# $options['package-handler'] = 'git_drupalorg'; - -/** - * Specify folders to search for Drush command files (*.drush.inc). These - * values are always merged with include paths defined on the command line or - * in other configuration files. On the command line, paths may be separated - * by a colon (:) on Unix-based systems or a semi-colon (;) on Windows. - */ -# $options['include'] = array('/path/to/commands','/path2/to/more/commands'); - -/** - * Specify the modules to ignore when searching for command files (*.drush.inc) - * inside a Drupal site. - */ -# $options['ignored-modules'] = array('module1', 'module2'); - -/** - * Specify the folders to search for Drush alias files (*.alias.drushrc.php and - * *.aliases.drushrc.php). These values are always merged with alias paths - * defined on the command line or in other configuration files. On the command - * line, paths may be separated by a colon (:) on Unix-based systems or a - * semi-colon (;) on Windows. - */ -# $options['alias-path'] = array('/path/to/aliases','/path2/to/more/aliases'); - -/** - * Specify the filename and path where 'sql-dump' should store backups of - * database dumps. The default is to dump to STDOUT, however if this option is - * set in a drushrc.php file, the default behaviour can be achieved by - * specifying a value of FALSE ("--result-file=0" on the command line). Two - * substitution tokens are available: @DATABASE is replaced with the name of the - * database being dumped, and @DATE is replaced with the current time and date - * of the dump of the form: YYYYMMDD_HHMMSS. A value of TRUE ("--result-file=1" - * on the command line) will cause 'sql-dump' to use the same temporary backup - * location as 'pm-updatecode'. - */ -# $options['result-file'] = TRUE; -# $options['result-file'] = '/path/to/backup/dir/@DATABASE_@DATE.sql'; - -// Notify user via Notification Center (OSX) or libnotify (Linux) when command -// takes more than 30 seconds. See global options for more configuration. -# $options['notify'] = 30; - -// Enable verbose mode. -# $options['v'] = 1; - -// Show database passwords in 'status' and 'sql-conf' commands. -# $options['show-passwords'] = 1; - -/** - * Specify the logging level for PHP notices. Defaults to "notice". Set to - * "warning" when doing Drush development. Also make sure that error_reporting - * is set to E_ALL in your php configuration file. See `drush status` for the - * path to your php.ini file. - */ -# $options['php-notices'] = 'warning'; - -/** - * Specify the error handling of recoverable errors (E_RECOVERABLE_ERROR). - * Defaults to 1 and will stop execution of Drush. - * When set to 0, execution will continue. - */ -# $options['halt-on-error'] = 0; - -/** - * Specify options to pass to ssh in backend invoke. The default is to prohibit - * password authentication, and is included here, so you may add additional - * parameters without losing the default configuration. - */ -# $options['ssh-options'] = '-o PasswordAuthentication=no'; - -// Set 'remote-os' to 'Windows' to make Drush use Windows shell escape rules -// for remote sites that do not have an 'os' item set. -# $options['remote-os'] = 'Linux'; - -// By default, unknown options are disallowed and result in an error. Change -// them to issue only a warning and let command proceed. -# $options['strict'] = FALSE; - -/** - * Drush requires at least rsync version 2.6.9 for some functions to work - * correctly. rsync version 2.6.8 or earlier may give the following error - * message: "--remove-source-files: unknown option". To fix this, set - * $options['rsync-version'] = '2.6.8'; (replace with the lowest version of - * rsync installed on any system you are using with Drush). Note that this - * option can also be set in a site alias, which is the preferred solution if - * newer versions of rsync are available on some of the systems you use. - * See: http://drupal.org/node/955092 - */ -# $options['rsync-version'] = '2.6.9'; - -/** - * The output charset suitable to pass to the iconv PHP function's out_charset - * parameter. - * - * Drush will convert its output from UTF-8 to the charset specified here. It - * is possible to use //TRANSLIT and //IGNORE charset name suffixes (see iconv - * documentation). If not defined, conversion will not be performed. - */ -# $options['output_charset'] = 'ISO-8859-1'; -# $options['output_charset'] = 'KOI8-R//IGNORE'; -# $options['output_charset'] = 'ISO-8859-1//TRANSLIT'; - -/** - * Multiple-site execution options: - * - * Some drush commands such as 'sql-sync' are intended for or capable of being - * executed on multiple sites or server environments and will pass along the - * options specified here to all instances of the command being executed. - */ - -/** - * By default, Drush will prepend the name of the site to the output of any - * multiple-site command execution. To disable this behavior, set the - * "--no-label" option. - */ -# $options['no-label'] = TRUE; - -/** - * An explicit list of tables which should be included in sql-dump and sql-sync. - */ -# $options['tables']['common'] = array('user', 'permissions', 'role_permission', 'role'); - -/** - * List of tables whose *data* is skipped by the 'sql-dump' and 'sql-sync' - * commands when the "--structure-tables-key=common" option is provided. - * You may add specific tables to the existing array or add a new element. - */ -# $options['structure-tables']['common'] = array('cache', 'cache_*', 'history', 'search_*', 'sessions', 'watchdog'); - -/** - * List of tables to be omitted entirely from SQL dumps made by the 'sql-dump' - * and 'sql-sync' commands when the "--skip-tables-key=common" option is - * provided on the command line. This is useful if your database contains - * non-Drupal tables used by some other application or during a migration for - * example. You may add new tables to the existing array or add a new element. - */ -# $options['skip-tables']['common'] = array('migration_*'); - -/** - * Override specific entries in Drupal's variable system or settings.php (D6/D7 only). - */ -# $options['variables']['site_name'] = 'My Drupal site'; -# $options['variables']['theme_default'] = 'minnelli'; -# $options['variables']['anonymous'] = 'Visitor'; - -/** - * Command-specific execution options: - * - * Most execution options can be shared between multiple Drush commands; these - * are specified as top-level elements of the $options array in the prior - * examples above. On the other hand, other options are command-specific, and, - * in some cases, a shared option needs a different configuration depending on - * which command is being executing. - * - * To define options that are only applicable to certain commands, make an entry - * in the $command-specific array as shown below. The name of the command may - * be either the command's full name or any of the command's aliases. - * - * Options defined here will be overridden by options of the same name on the - * command line. Unary flags such as "--verbose" are overridden via special - * "--no-xxx" options (e.g. "--no-verbose"). - * - * Limitation: If 'verbose' is set in a command-specific option, it must be - * cleared by '--no-verbose', not '--no-v', and visa-versa. - */ - -// Ensure all rsync commands use verbose output. -# $command_specific['rsync'] = array('verbose' => TRUE); - -// Prevent drush ssh command from adding a cd to Drupal root before provided command. -# $command_specific['ssh'] = array('cd' => FALSE); - -// Additional folders to search for scripts. -// Separate by : (Unix-based systems) or ; (Windows). -# $command_specific['script']['script-path'] = 'sites/all/scripts:profiles/myprofile/scripts'; - -// Always show release notes when running pm-update or pm-updatecode. -# $command_specific['pm-update'] = array('notes' => TRUE); -# $command_specific['pm-updatecode'] = array('notes' => TRUE); - -// Set a predetermined username and password when using site-install. -# $command_specific['site-install'] = array('account-name' => 'alice', 'account-pass' => 'secret'); - -// Use Drupal version specific CLI history instead of per site. -# $command_specific['core-cli'] = array('version-history' => TRUE); diff --git a/vendor/drush/drush/examples/example.make b/vendor/drush/drush/examples/example.make deleted file mode 100644 index 00ad0dc0059e14e3d1f0f5daccde6fb0ed6a9852..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/example.make +++ /dev/null @@ -1,103 +0,0 @@ -; Example makefile -; ---------------- -; This is an example makefile to introduce new users of drush_make to the -; syntax and options available to drush_make. For a full description of all -; options available, see README.txt. - -; This make file is a working makefile - try it! Any line starting with a `;` -; is a comment. - -; Core version -; ------------ -; Each makefile should begin by declaring the core version of Drupal that all -; projects should be compatible with. - -core = 7.x - -; API version -; ------------ -; Every makefile needs to declare it's Drush Make API version. This version of -; drush make uses API version `2`. - -api = 2 - -; Core project -; ------------ -; In order for your makefile to generate a full Drupal site, you must include -; a core project. This is usually Drupal core, but you can also specify -; alternative core projects like Pressflow. Note that makefiles included with -; install profiles *should not* include a core project. - -; Use Pressflow instead of Drupal core: -; projects[pressflow][type] = "core" -; projects[pressflow][download][type] = "file" -; projects[pressflow][download][url] = "http://launchpad.net/pressflow/6.x/6.15.73/+download/pressflow-6.15.73.tar.gz" - -; Git clone of Drupal 7.x. Requires the `core` property to be set to 7.x. -; projects[drupal][type] = "core" -; projects[drupal][download][type] = git -; projects[drupal][download][url] = https://git.drupal.org/project/drupal.git - -projects[] = drupal - -; Projects -; -------- -; Each project that you would like to include in the makefile should be -; declared under the `projects` key. The simplest declaration of a project -; looks like this: - -; To include the most recent views module: - -projects[] = views - -; This will, by default, retrieve the latest recommended version of the project -; using its update XML feed on Drupal.org. If any of those defaults are not -; desirable for a project, you will want to use the keyed syntax combined with -; some options. - -; If you want to retrieve a specific version of a project: - -; projects[views] = 2.16 - -; Or an alternative, extended syntax: - -projects[ctools][version] = 1.3 - -; Check out the latest version of a project from Git. Note that when using a -; repository as your project source, you must explicitly declare the project -; type so that drush_make knows where to put your project. - -projects[data][type] = module -projects[data][download][type] = git -projects[data][download][url] = https://git.drupal.org/project/views.git -projects[data][download][revision] = DRUPAL-6--3 - -; For projects on drupal.org, some shorthand is available. If any -; download parameters are specified, but not type, the default is git. -projects[cck_signup][download][revision] = "2fe932c" -; It is recommended to also specify the corresponding branch so that -; the .info file rewriting can obtain a version string that works with -; the core update module -projects[cck_signup][download][branch] = "7.x-1.x" - -; Clone a project from github. - -projects[tao][type] = theme -projects[tao][download][type] = git -projects[tao][download][url] = git://github.com/developmentseed/tao.git - -; If you want to install a module into a sub-directory, you can use the -; `subdir` attribute. - -projects[admin_menu][subdir] = custom - -; To apply a patch to a project, use the `patch` attribute and pass in the URL -; of the patch. - -projects[admin_menu][patch][687750] = "http://drupal.org/files/issues/admin_menu.long_.31.patch" - -; If all projects or libraries share common attributes, the `defaults` -; array can be used to specify these globally, rather than -; per-project. - -defaults[projects][subdir] = "contrib" diff --git a/vendor/drush/drush/examples/example.make.yml b/vendor/drush/drush/examples/example.make.yml deleted file mode 100644 index 8bd4d28f80b9f16a9b4f106894d929fb783dda41..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/example.make.yml +++ /dev/null @@ -1,121 +0,0 @@ -# Example makefile -# ---------------- -# This is an example makefile to introduce new users of drush make to the -# syntax and options available to drush make. - -# This make file is a working makefile - try it! Any line starting with a `#` -# is a comment. - -# Core version -# ------------ -# Each makefile should begin by declaring the core version of Drupal that all -# projects should be compatible with. - -core: "7.x" - -# API version -# ------------ -# Every makefile needs to declare it's Drush Make API version. This version of -# drush make uses API version `2`. - -api: 2 - -# Core project -# ------------ -# In order for your makefile to generate a full Drupal site, you must include -# a core project. This is usually Drupal core, but you can also specify -# alternative core projects like Pressflow. Note that makefiles included with -# install profiles *should not* include a core project. - -# Use Pressflow instead of Drupal core: -# projects: -# pressflow: -# type: "core" -# download: -# type: "file" -# url: "http://launchpad.net/pressflow/6.x/6.15.73/+download/pressflow-6.15.73.tar.gz" -# -# Git clone of Drupal 7.x. Requires the `core` property to be set to 7.x. -# projects -# drupal: -# type: "core" -# download: -# url: "https://git.drupal.org/project/drupal.git" - -projects: - drupal: - version: ~ - - # Projects - # -------- - # Each project that you would like to include in the makefile should be - # declared under the `projects` key. The simplest declaration of a project - # looks like this: - - # To include the most recent views module: - - views: - version: ~ - - # This will, by default, retrieve the latest recommended version of the - # project using its update XML feed on Drupal.org. If any of those defaults - # are not desirable for a project, you will want to use the keyed syntax - # combined with some options. - - # If you want to retrieve a specific version of a project: - - # projects: - # views: "2.16" - - # Or an alternative, extended syntax: - - ctools: - version: "1.3" - - # Check out the latest version of a project from Git. Note that when using a - # repository as your project source, you must explicitly declare the project - # type so that drush_make knows where to put your project. - - data: - type: "module" - download: - type: "git" # Note, 'git' is the default, no need to specify. - url: "https://git.drupal.org/project/views.git" - revision: "7.x-3.x" - - # For projects on drupal.org, some shorthand is available. If any - # download parameters are specified, but not type, the default is git. - cck_signup: - download: - revision: "2fe932c" - # It is recommended to also specify the corresponding branch so that - # the .info file rewriting can obtain a version string that works with - # the core update module - branch: "7.x-1.x" - - # Clone a project from github. - - tao: - type: theme - download: - url: "git://github.com/developmentseed/tao.git" - - # If you want to install a module into a sub-directory, you can use the - # `subdir` attribute. - - admin_menu: - subdir: custom - - # To apply patches to a project, use the `patch` attribute and pass in the URL - # of the patch, one per line prefaced with `- `. - - patch: - - "http://drupal.org/files/issues/admin_menu.long_.31.patch" - -# If all projects or libraries share common attributes, the `defaults` -# array can be used to specify these globally, rather than -# per-project. - -defaults: - projects: - subdir: "contrib" diff --git a/vendor/drush/drush/examples/example.prompt.sh b/vendor/drush/drush/examples/example.prompt.sh index fd8fee14dcdc722598b4db5c7d30bdd2e7b42015..9a57347837334f45526b8154eb7b37f3f6e0d86f 100644 --- a/vendor/drush/drush/examples/example.prompt.sh +++ b/vendor/drush/drush/examples/example.prompt.sh @@ -2,11 +2,45 @@ # # Example PS1 prompt. # -# Use `drush init` to copy this to ~/.drush/drush.prompt.sh, and source it in ~/.bashrc +# Note: This file does a lot, and is designed for Bash. If you want to show the +# currently set alias in your prompt, use the first 2 values below as an example. +# This example can be used directly for the POWERLEVEL9K theme for Oh My Zsh. +#FILE="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$" +#POWERLEVEL9K_CUSTOM_DRUSH="[ -r $FILE ] && cat $FILE" +#POWERLEVEL9K_CUSTOM_DRUSH_BACKGROUND="green" +#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs custom_drush) +# +# Use `drush init` to copy this to ~/.drush/drush.prompt.sh, and source it in +# ~/.bashrc or ~/.bash_profile. +# +# Note that your Bash session must already have the __git_ps1 function available. +# Typically this is provided by git-prompt.sh, see instructions for downloading +# and including this file here: +# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh # # Features: # # Displays Git repository and Drush alias status in your prompt. + +__drush_ps1() { + f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$" + if [ -f $f ] + then + __DRUPAL_SITE=$(cat "$f") + else + __DRUPAL_SITE="$DRUPAL_SITE" + fi + + # Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a + # __drush_ps1_colorize_alias() function for color hints in your Drush PS1 + # prompt. See example.prompt.sh for an example implementation. + if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then + __drush_ps1_colorize_alias + fi + + [[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE" +} + if [ -n "$(type -t __git_ps1)" ] && [ "$(type -t __git_ps1)" = function ] && [ "$(type -t __drush_ps1)" ] && [ "$(type -t __drush_ps1)" = function ]; then # This line enables color hints in your Drush prompt. Modify the below diff --git a/vendor/drush/drush/examples/example.site.yml b/vendor/drush/drush/examples/example.site.yml new file mode 100644 index 0000000000000000000000000000000000000000..f759fe76b247d8968c9b85832622331e6e3a16db --- /dev/null +++ b/vendor/drush/drush/examples/example.site.yml @@ -0,0 +1,259 @@ +# +# Example of valid statements for an alias file. + +# Basic Alias File Usage +# +# In its most basic form, the Drush site alias feature provides a way +# for teams to share short names that refer to the live and staging sites +# (usually remote) for a given Drupal site. +# +# 1. Make a local working clone of your Drupal site and then +# `cd` to the project work to select it. +# 2. Add an alias file called $PROJECT/drush/sites/self.site.yml, +# where $PROJECT is the project root (location of composer.json file). +# 3. Run remote commands against the shared live or stage sites +# +# Following these steps, a cache:rebuild on the live environment would be: +# +# $ drush @live cache:rebuild +# +# The site alias file should be named `self.site.yml` because this name is +# special, and is used to define the different environments (usually remote) +# of the current Drupal site. +# +# The contents of the alias file should look something like the example below: +# +# @code +# # File: self.site.yml +# live: +# host: server.domain.com +# user: www-admin +# root: /other/path/to/live/drupal +# uri: http://example.com +# stage: +# host: server.domain.com +# user: www-admin +# root: /other/path/to/stage/drupal +# uri: http://stage.example.com +# @endcode +# +# The top-level element names (`live` and `stage` in the example above) are +# used to identify the different environments available for this site. These +# may be used on the command line to select a different target environment +# to operate on by prepending an `@` character, e.g. `@live` or `@stage`. +# +# All of the available aliases for a site's environments may be listed via: +# +# $ drush site:alias @self +# +# The elements of a site alias environment are: +# +# - 'host': The fully-qualified domain name of the remote system +# hosting the Drupal instance. **Important Note: The remote-host option +# must be omitted for local sites, as this option controls various +# operations, such as whether or not rsync parameters are for local or +# remote machines, and so on. +# - 'user': The username to log in as when using ssh or rsync. If each user +# has to use own username, you can create an environment variable which holds +# the value, and reference via ${env.PROJECT_SSH_USER} (for example). Or you may +# omit the `user:` item and specify a user in the `~/.ssh/config` file. +# - 'root': The Drupal root; must not be specified as a relative path. +# - 'uri': The value of --uri should always be the same as +# when the site is being accessed from a web browser (e.g. http://example.com) +# +# Drush uses ssh to run commands on remote systems; all team members should +# install ssh keys on the target servers (e.g. via ssh-add). + +# Advanced Site Alias File Usage +# +# It is also possible to create site alias files that reference other +# sites on the same local system. Site alias files for other local sites +# are usually stored in the directory `~/.drush/sites`; however, Drush does +# not search this location for alias files by default. To use this location, +# you must add the path in your Drush configuration file. For example, +# to re-add both of the default user alias path from Drush 8, put the following +# in your ~/.drush/drush.yml configuration file: +# +# @code +# drush: +# paths: +# alias-path: +# - '${env.home}/.drush/sites' +# - /etc/drush/sites +# @endcode +# +# The command `drush core:init` will automatically configure your +# ~/.drush/drush.yml configuration file to add `~/.drush/sites` and +# `/etc/drush/sites` as locations where alias files may be placed. +# +# A canonical alias named "example" that points to a local +# Drupal site named "http://example.com" looks like this: +# +# @code +# File: example.site.yml +# dev: +# root: /path/to/drupal +# uri: http://example.com +# @endcode +# +# Note that the first part of the filename (in this case "example") +# defines the name of the site alias, and the top-level key ("dev") +# defines the name of the environment. +# +# With these definitions in place, it is possible to run commands targeting +# the dev environment of the target site via: +# +# $ drush @example.dev status +# +# This command is equivalent to the longer form: +# +# $ drush --root=/path/to/drupal --uri=http://example.com status +# +# See "Additional Site Alias Options" below for more information. + +# Converting Legacy Alias Files +# +# To convert legacy alias (*.aliases.drushrc.php) to yml, run the +# site:alias-convert command. + +# Altering aliases: +# +# See examples/Commands/SiteAliasAlterCommands.php for an example. + +# Environment variables: +# +# Site aliases may reference environment variables, just like any Drush config +# file. For example, ${env.PROJECT_SSH_USER} will be replaced by the value +# of the PROJECT_SSH_USER environment value. +# +# SSH site aliases may no longer _set_ environment variables. +# This is a planned feature. + +# Additional Site Alias Options +# +# Aliases are commonly used to define short names for +# local or remote Drupal installations; however, an alias +# is really nothing more than a collection of options. +# +# - 'docker': When specified, Drush executes via docker-compose exec rather than ssh +# - 'service': the name of the container to run on. +# - 'exec': +# - 'options': Options for the exec subcommand. +# - 'os': The operating system of the remote server. Valid values +# are 'Windows' and 'Linux'. Be sure to set this value for all remote +# aliases because the default value is PHP_OS if 'remote-host' +# is not set, and 'Linux' (or $options['remote-os']) if it is. Therefore, +# if you set a 'remote-host' value, and your remote OS is Windows, if you +# do not set the 'OS' value, it will default to 'Linux' and could cause +# unintended consequences, particularly when running 'drush sql-sync'. +# - 'ssh': Contains settings used to control how ssh commands are generated +# when running remote commands. +# - 'options': Contains additional commandline options for the ssh command +# itself, e.g. "-p 100" +# - 'tty': Usually, Drush will decide whether or not to create a tty (via +# the ssh '--t' option) based on whether the local Drush command is running +# interactively or not. To force Drush to always or never create a tty, +# set the 'ssh.tty' option to 'true' or 'false', respectively. +# - 'paths': An array of aliases for common rsync targets. +# Relative aliases are always taken from the Drupal root. +# - 'files': Path to 'files' directory. This will be looked up if not +# specified. +# - 'drush-script': Path to the remote Drush command. +# - 'command': These options will only be set if the alias +# is used with the specified command. In the example below, the option +# `--no-dump` will be selected whenever the @stage alias +# is used in any of the following ways: +# - `drush @stage sql-sync @self @live` +# - `drush sql-sync @stage @live` +# - `drush sql-sync @live @stage` +# NOTE: Setting boolean options broke with Symfony 3. This will be fixed +# in a future release. See: https://github.com/drush-ops/drush/issues/2956 +# +# Complex example: +# +# @code +# # File: remote.site.yml +# live: +# host: server.domain.com +# user: www-admin +# root: /other/path/to/drupal +# uri: http://example.com +# ssh: +# options: '-p 100' +# paths: +# drush-script: '/path/to/drush' +# command: +# site: +# install: +# options: +# admin-password: 'secret-secret' +# @endcode + +# Site Alias Files for Service Providers +# +# There are a number of service providers that manage Drupal sites as a +# service. Drush allows service providers to create collections of site alias +# files to reference all of the sites available to a single user. In order +# to so this, a new location must be defined in your Drush configuration +# file: +# +# @code +# drush: +# paths: +# alias-path: +# - '${env.home}/.drush/sites/provider-name' +# @endcode +# +# Site aliases stored in this directory may then be referenced by its +# full alias name, including its location, e.g.: +# +# $ drush @provider-name.example.dev +# +# Such alias files may still be referenced by their shorter name, e.g. +# `@example.dev`. Note that it is necessary to individually list every +# location where site alias files may be stored; Drush never does recursive +# (deep) directory searches for alias files. +# +# The `site:alias` command may also be used to list all of the sites and +# environments in a given location, e.g.: +# +# $ drush site:alias @provider-name +# +# Add the option `--format=list` to show only the names of each site and +# environment without also showing the values in each alias record. + +# Developer Information +# +# See https://github.com/consolidation/site-alias for more developer +# information about Site Aliases. +# +# An example appears below. Edit to suit and remove the @code / @endcode and +# leading hashes to enable. +# +# @code +# # File: mysite.site.yml +# local: +# This environment is an example of the DockerCompose transport. +# docker: +# service: drupal +# exec: +# options: --user USER +# stage: +# uri: http://stage.example.com +# root: /path/to/remote/drupal/root +# host: mystagingserver.myisp.com +# user: publisher +# os: Linux +# paths: +# - files: sites/mydrupalsite.com/files +# - custom: /my/custom/path +# command: +# sql: +# sync: +# options: +# no-dump: true +# dev: +# root: /path/to/docroot +# uri: https://dev.example.com +# @endcode + diff --git a/vendor/drush/drush/examples/helloworld.script b/vendor/drush/drush/examples/helloworld.script index 07d079c98b9f923add6fb9999a15f55f1c555016..b57febfb183097a52d63eeb60d8562a880fc6662 100755 --- a/vendor/drush/drush/examples/helloworld.script +++ b/vendor/drush/drush/examples/helloworld.script @@ -1,50 +1,27 @@ -#!/usr/bin/env drush +<?php // // This example demonstrates how to write a drush -// "shebang" script. These scripts start with the -// line "#!/usr/bin/env drush" or "#!/full/path/to/drush". +// script. These scripts are run with the php-script command. // -// See `drush topic docs-scripts` for more information. -// -drush_print("Hello world!"); -drush_print(); -drush_print("The arguments to this command were:"); +use Drush\Drush; + +$this->output()->writeln("Hello world!"); +$this->output()->writeln("The extra options/arguments to this command were:"); +$this->output()->writeln(print_r($extra, true)); -// -// If called with --everything, use drush_get_arguments -// to print the commandline arguments. Note that this -// call will include 'php-script' (the drush command) -// and the path to this script. -// -if (drush_get_option('everything')) { - drush_print(" " . implode("\n ", drush_get_arguments())); -} -// -// If --everything is not included, then use -// drush_shift to pull off the arguments one at -// a time. drush_shift only returns the user -// commandline arguments, and does not include -// the drush command or the path to this script. -// -else { - while ($arg = drush_shift()) { - drush_print(' ' . $arg); - } -} -drush_print(); // // We can check which site was bootstrapped via // the '@self' alias, which is defined only if // there is a bootstrapped site. // -$self_record = drush_sitealias_get_record('@self'); -if (empty($self_record)) { - drush_print('No bootstrapped site.'); +$self = Drush::aliasManager()->getSelf();; +if (!$self->hasRoot()) { + $this->output()->writeln('No bootstrapped site.'); } else { - drush_print('The following site is bootstrapped:'); - _drush_sitealias_print_record($self_record); + $this->output()->writeln('The following site is bootstrapped:'); + $this->output()->writeln(print_r($self->legacyRecord(), true)); } diff --git a/vendor/drush/drush/examples/pm_update.drush.inc b/vendor/drush/drush/examples/pm_update.drush.inc deleted file mode 100644 index 3ba610e195e793d707d466598a55739ab6924f86..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/pm_update.drush.inc +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * Implements hook_pm_post_update(). - * - * Restore sqlsrv driver after core update. - */ -function pm_update_pm_post_update($project_name, $installed_release, $project) { - // Restore sqlsrv database driver. - if ($project_name == 'drupal') { - $sqlsrv_dir = 'includes/database/sqlsrv'; - if (file_exists($project['backup_target'] . '/' . $sqlsrv_dir)) { - if (drush_copy_dir($project['backup_target'] . '/' . $sqlsrv_dir, $project['full_project_path'] . '/' . $sqlsrv_dir)) { - drush_log('SQLSRV database driver has been restored.', 'info'); - } - } - } -} - diff --git a/vendor/drush/drush/examples/policy.drush.inc b/vendor/drush/drush/examples/policy.drush.inc deleted file mode 100644 index a293ade5d712942b7526b82f9cc8e585f0f168fa..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/policy.drush.inc +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -/** - * @file - * Example policy commandfile. Modify as desired. - * - * Validates commands as they are issued and returns an error - * or changes options when policy is violated. - * - * You can copy this file to any of the following - * 1. A .drush folder in your HOME folder. - * 2. Anywhere in a folder tree below an active module on your site. - * 3. /usr/share/drush/commands (configurable) - * 4. In an arbitrary folder specified with the --include option. - * 5. Drupal's /drush or sites/all/drush folder, or in the /drush - * folder in the directory above the Drupal root (note: sql-sync - * validation won't work in any of these locations). - */ - -/** - * Implements drush_hook_COMMAND_validate(). - * - * Prevent catastrophic braino. Note that this file has to be local to the - * machine that intitiates sql-sync command. - */ -function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) { - if ($destination == '@prod') { - return drush_set_error('POLICY_DENY', dt('Per examples/policy.drush.inc, you may never overwrite the production database.')); - } -} - -/** - * Implements drush_hook_COMMAND_validate(). - * - * We can also limit rsync operations to production sites. - */ -function drush_policy_core_rsync_validate($source = NULL, $destination = NULL) { - if (preg_match("/^@prod/", $destination)) { - return drush_set_error('POLICY_DENY', dt('Per examples/policy.drush.inc, you may never rsync to the production site.')); - } -} - -/** - * Implements hook_drush_sitealias_alter - * - * Alter alias record data in code. - */ -function policy_drush_sitealias_alter(&$alias_record) { - // A duplicate of the old implementation of the 'parent' element. - // Keep this if you want to keep using 'parent', but do not want - // to be nagged (or worse, break when it is removed). - if (isset($alias_record['parent'])) { - // Fetch and merge in each parent - foreach (explode(',', $alias_record['parent']) as $parent) { - $parent_record = drush_sitealias_get_record($parent); - unset($parent_record['#name']); - unset($parent_record['#file']); - unset($parent_record['#hidden']); - $array_based_keys = array_merge(drush_get_special_keys(), array('path-aliases')); - foreach ($array_based_keys as $array_based_key) { - if (isset($alias_record[$array_based_key]) && isset($parent_record[$array_based_key])) { - $alias_record[$array_based_key] = array_merge($parent_record[$array_based_key], $alias_record[$array_based_key]); - } - } - $alias_record = array_merge($parent_record, $alias_record); - } - unset($alias_record['parent']); - } -} - -/** - * Implements drush_hook_COMMAND_validate(). - * - * Encourage folks to use `composer` instead of Drush pm commands - */ -function drush_policy_pm_updatecode_validate() { - return _deny_message(); -} - -function drush_policy_pm_update_validate() { - return _deny_message(); -} - -function drush_policy_pm_download_validate() { - return _deny_message(); -} - -function _deny_message() { - if (!drush_get_option('pm-force')) { - $msg = 'This codebase is assembled with Composer instead of Drush. Use `composer update` and `composer require` instead of `drush pm-updatecode` and `drush pm-download`. You may override this error by using the --pm-force option.'; - return drush_set_error('POLICY_PM_DENY', dt($msg)); - } -} - -/** - * Implements hook_drush_help_alter(). - * - * When a hook extends a command with additional options, it must - * implement help alter and declare the option(s). Doing so will add - * the option to the help text for the modified command, and will also - * allow the new option to be specified on the command line. Without - * this, Drush will fail with an error when a user attempts to use - * the option. - */ -function policy_drush_help_alter($command) { - if ($command['command'] == 'updatedb') { - $command['options']['token'] = 'Per site policy, you must specify a token in the --token option for all commands.'; - } - elseif (in_array($command['command'], array('pm-updatecode', 'pm-update', 'pm-download'))) { - $command['options']['pm-force'] = 'Override site policy and allow Drush codebase management (pm-* commands)'; - } -} - -/** - * Implements drush_hook_COMMAND_validate(). - * - * To test this example without copying, execute - * `drush --include=./examples updatedb` from within your drush directory. - * - * Unauthorized users may view pending updates but not execute them. - */ -function drush_policy_updatedb_validate() { - // Check for a token in the request. In this case, we require --token=secret. - if (!drush_get_option('token') == 'secret') { - drush_log(dt('Per site policy, you must add a secret --token complete this command. See examples/policy.drush.inc. If you are running a version of drush prior to 4.3 and are not sure why you are seeing this message, please see http://drupal.org/node/1024824.'), 'warning'); - drush_set_context('DRUSH_AFFIRMATIVE', FALSE); - drush_set_context('DRUSH_NEGATIVE', TRUE); - } -} - -/** - * Implements drush_hook_COMMAND_validate(). - * - * Only sudo tells me to make a sandwich: http://xkcd.com/149/ - */ -function drush_policy_make_me_a_sandwich_validate() { - if (drush_is_windows()) { - // $name = drush_get_username(); - // TODO: implement check for elevated process using w32api - // as sudo is not available for Windows - // @see http://php.net/manual/en/book.w32api.php - // @see http://social.msdn.microsoft.com/Forums/en/clr/thread/0957c58c-b30b-4972-a319-015df11b427d - } - else { - $name = posix_getpwuid(posix_geteuid()); - if ($name['name'] !== 'root') { - return drush_set_error('POLICY_MAKE_IT_YOUSELF', dt('What? Make your own sandwich.')); - } - } -} diff --git a/vendor/drush/drush/examples/sandwich-topic.txt b/vendor/drush/drush/examples/sandwich-topic.txt deleted file mode 100644 index f0e0fa72aac45789019b2a714e7acec4f4c18c1d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/sandwich-topic.txt +++ /dev/null @@ -1,4 +0,0 @@ -I have discovered a truly marvelous proof that it is impossible to -separate a sandwich into two cubes, or four sandwiches into two -fourth of a sandwich, or in general, any sandwich larger than the -second into two like sandwiches. This text file is too narrow to contain it. diff --git a/vendor/drush/drush/examples/sandwich.drush.inc b/vendor/drush/drush/examples/sandwich.drush.inc deleted file mode 100644 index f8dd479c0586a6b25c88e4b3ade56303be1d93ab..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/sandwich.drush.inc +++ /dev/null @@ -1,308 +0,0 @@ -<?php - -/** - * @file - * Example drush command. - * - * To run this *fun* command, execute `sudo drush --include=./examples mmas` - * from within your drush directory. - * - * See `drush topic docs-commands` for more information about command authoring. - * - * You can copy this file to any of the following - * 1. A .drush folder in your HOME folder. - * 2. Anywhere in a folder tree below an active module on your site. - * 3. /usr/share/drush/commands (configurable) - * 4. In an arbitrary folder specified with the --include option. - * 5. Drupal's /drush or /sites/all/drush folders, or in the /drush - * folder in the directory above the Drupal root. - */ - -/** - * Implements hook_drush_command(). - * - * In this hook, you specify which commands your - * drush module makes available, what it does and - * description. - * - * Notice how this structure closely resembles how - * you define menu hooks. - * - * See `drush topic docs-commands` for a list of recognized keys. - */ -function sandwich_drush_command() { - $items = array(); - - // The 'make-me-a-sandwich' command. - $items['make-me-a-sandwich'] = array( - 'description' => "Makes a delicious sandwich.", - 'arguments' => array( - 'filling' => 'The type of the sandwich (turkey, cheese, etc.). Defaults to ascii.', - ), - 'options' => array( - 'spreads' => array( - 'description' => 'Comma delimited list of spreads.', - 'example-value' => 'mayonnaise,mustard', - ), - ), - 'examples' => array( - 'drush mmas turkey --spreads=ketchup,mustard' => 'Make a terrible-tasting sandwich that is lacking in pickles.', - ), - 'aliases' => array('mmas'), - // No bootstrap at all. - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - - // The 'sandwiches-served' command. Informs how many 'mmas' commands - // completed. - $items['sandwiches-served'] = array( - 'description' => "Report how many sandwiches we have made.", - 'examples' => array( - 'drush sandwiches-served' => 'Show how many sandwiches we have served.', - ), - 'aliases' => array('sws'), - // Example output engine data: command returns a single keyed - // data item (e.g. array("served" => 1)) that can either be - // printed with a label (e.g. "served: 1"), or output raw with - // --pipe (e.g. "1"). - 'engines' => array( - 'outputformat' => array( - 'default' => 'key-value', - 'pipe-format' => 'string', - 'label' => 'Sandwiches Served', - 'require-engine-capability' => array('format-single'), - ), - ), - // No bootstrap at all. - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - - // The 'spreads-status' command. Prints a table about available spreads. - $items['spreads-status'] = array( - 'description' => "Show a table of information about available spreads.", - 'examples' => array( - 'drush spreads-status' => 'Show a table of spreads.', - ), - 'aliases' => array('sps'), - // Example output engine data: command returns a deep array - // that can either be printed in table format or as a json array. - 'engines' => array( - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'json', - // Commands that return deep arrays will usually use - // machine-ids for the column data. A 'field-labels' - // item maps from the machine-id to a human-readable label. - 'field-labels' => array( - 'name' => 'Name', - 'description' => 'Description', - 'available' => 'Num', - 'taste' => 'Taste', - ), - // In table format, the 'column-widths' item is consulted - // to determine the default weights for any named column. - 'column-widths' => array( - 'name' => 10, - 'available' => 3, - ), - 'require-engine-capability' => array('format-table'), - ), - ), - // No bootstrap at all. - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - - // Commandfiles may also add topics. These will appear in - // the list of topics when `drush topic` is executed. - // To view this topic, run `drush --include=/full/path/to/examples topic` - $items['sandwich-exposition'] = array( - 'description' => 'Ruminations on the true meaning and philosophy of sandwiches.', - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_print_file', - 'callback arguments' => array(dirname(__FILE__) . '/sandwich-topic.txt'), - ); - - return $items; -} - -/** - * Implements hook_drush_help(). - * - * This function is called whenever a drush user calls - * 'drush help <name-of-your-command>'. This hook is optional. If a command - * does not implement this hook, the command's description is used instead. - * - * This hook is also used to look up help metadata, such as help - * category title and summary. See the comments below for a description. - */ -function sandwich_drush_help($section) { - switch ($section) { - case 'drush:make-me-a-sandwich': - return dt("This command will make you a delicious sandwich, just how you like it."); - - // The 'title' meta item is used to name a group of - // commands in `drush help`. If a title is not defined, - // the default is "All commands in ___", with the - // specific name of the commandfile (e.g. sandwich). - // Command files with less than four commands will - // be placed in the "Other commands" section, _unless_ - // they define a title. It is therefore preferable - // to not define a title unless the file defines a lot - // of commands. - case 'meta:sandwich:title': - return dt("Sandwich commands"); - - // The 'summary' meta item is displayed in `drush help --filter`, - // and is used to give a general idea what the commands in this - // command file do, and what they have in common. - case 'meta:sandwich:summary': - return dt("Automates your sandwich-making business workflows."); - } -} - -/** - * Implements drush_hook_COMMAND_validate(). - * - * The validate command should exit with - * `return drush_set_error(...)` to stop execution of - * the command. In practice, calling drush_set_error - * OR returning FALSE is sufficient. See drush.api.php - * for more details. - */ -function drush_sandwich_make_me_a_sandwich_validate() { - if (drush_is_windows()) { - // $name = drush_get_username(); - // @todo Implement check for elevated process using w32api - // as sudo is not available for Windows - // @see http://php.net/manual/en/book.w32api.php - // @see http://social.msdn.microsoft.com/Forums/en/clr/thread/0957c58c-b30b-4972-a319-015df11b427d - } - else { - $name = posix_getpwuid(posix_geteuid()); - if ($name['name'] !== 'root') { - return drush_set_error('MAKE_IT_YOUSELF', dt('What? Make your own sandwich.')); - } - } -} - -/** - * Implements drush_hook_COMMAND(). - * - * The command callback is where the action takes place. - * - * The function name should be same as command name but with dashes turned to - * underscores and 'drush_commandfile_' prepended, where 'commandfile' is - * taken from the file 'commandfile.drush.inc', which in this case is - * 'sandwich'. Note also that a simplification step is also done in instances - * where the commandfile name is the same as the beginning of the command name, - * "drush_example_example_foo" is simplified to just "drush_example_foo". - * To also implement a hook that is called before your command, implement - * "drush_hook_pre_example_foo". For a list of all available hooks for a - * given command, run drush in --debug mode. - * - * If for some reason you do not want your hook function to be named - * after your command, you may define a 'callback' item in your command - * object that specifies the exact name of the function that should be - * called. - * - * In this function, all of Drupal's API is (usually) available, including - * any functions you have added in your own modules/themes. - * - * @see drush_invoke() - * @see drush.api.php - */ -function drush_sandwich_make_me_a_sandwich($filling = 'ascii') { - $str_spreads = ''; - // Read options with drush_get_option. Note that the options _must_ - // be documented in the $items structure for this command in the 'command' - // hook. See `drush topic docs-commands` for more information. - if ($spreads = drush_get_option('spreads')) { - $list = implode(' and ', explode(',', $spreads)); - $str_spreads = ' with just a dash of ' . $list; - } - $msg = dt('Okay. Enjoy this !filling sandwich!str_spreads.', - array('!filling' => $filling, '!str_spreads' => $str_spreads) - ); - drush_print("\n" . $msg . "\n"); - - if (drush_get_context('DRUSH_NOCOLOR')) { - $filename = dirname(__FILE__) . '/sandwich-nocolor.txt'; - } - else { - $filename = dirname(__FILE__) . '/sandwich.txt'; - } - drush_print(file_get_contents($filename)); - // Find out how many sandwiches have been served, and set - // the cached value to one greater. - $served = drush_sandwich_sandwiches_served(); - drush_cache_set(drush_get_cid('sandwiches-served'), $served + 1); -} - -/** - * Implements drush_hook_COMMAND(). - * - * Demonstrates how to return a simple value that is transformed by - * the selected formatter to display either with a label (using the - * key-value formatter) or as the raw value itself (using the string formatter). - */ -function drush_sandwich_sandwiches_served() { - $served = 0; - $served_object = drush_cache_get(drush_get_cid('sandwiches-served')); - if ($served_object) { - $served = $served_object->data; - } - // In the default format, key-value, this return value - // will print " Sandwiches Served : 1". In the default pipe - // format, only the array value ("1") is returned. - return $served; -} - -/** - * Implements drush_hook_COMMAND(). - * - * This ficticious command shows how a deep array can be constructed - * and used as a command return value that can be output by different - * output formatters. - */ -function drush_sandwich_spreads_status() { - return array( - 'ketchup' => array( - 'name' => 'Ketchup', - 'description' => 'Some say its a vegetable, but we know its a sweet spread.', - 'available' => '7', - 'taste' => 'sweet', - ), - 'mayonnaise' => array( - 'name' => 'Mayonnaise', - 'description' => 'A nice dairy-free spead.', - 'available' => '12', - 'taste' => 'creamy', - ), - 'mustard' => array( - 'name' => 'Mustard', - 'description' => 'Pardon me, but could you please pass that plastic yellow bottle?', - 'available' => '8', - 'taste' => 'tangy', - ), - 'pickles' => array( - 'name' => 'Pickles', - 'description' => 'A necessary part of any sandwich that does not taste terrible.', - 'available' => '63', - 'taste' => 'tasty', - ), - ); -} - -/** - * Command argument complete callback. - * - * Provides argument values for shell completion. - * - * @return array - * Array of popular fillings. - */ -function sandwich_make_me_a_sandwich_complete() { - return array('values' => array('turkey', 'cheese', 'jelly', 'butter')); -} diff --git a/vendor/drush/drush/examples/sync_enable.drush.inc b/vendor/drush/drush/examples/sync_enable.drush.inc deleted file mode 100644 index 6e3fabe570cfc3d19108f500e2f2c735df7345f2..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/sync_enable.drush.inc +++ /dev/null @@ -1,125 +0,0 @@ -<?php - -/** - * @file - * Example "Sync enable" sql-sync command alter. - * - * For Drupal 8, please use the config_split module instead of this code. Drupal - * 6 and 7 sites may use this example. - * - * Sync_enable adds options to sql-sync to enable and disable - * modules after an sql-sync operation. One use case for this - * is to use Drush site aliases to automatically enable your - * development modules whenever you sync from your live site to - * your dev site. You may also add or remove permissions at - * the same time. - * - * For example: - * - * @code - * $aliases['dev'] = array ( - * 'root' => '/srv/www/drupal', - * 'uri' => 'site.com', - * 'target-command-specific' => array( - * 'sql-sync' => array( - * 'enable' => array('devel', 'hacked'), - * 'disable' => array('securepages'), - * 'permission' => array( - * 'authenticated user' => array( - * 'add' => array('access devel information', 'access environment indicator'), - * 'remove' => 'change own password', - * ), - * 'anonymous user' => array( - * 'add' => 'access environment indicator', - * ), - * ), - * ), - * ), - * ); - * @endcode - * - * To use this feature, copy the 'target-command-specific' - * item from the example alias above, place it in your development - * site aliases, and customize the development module list - * to suit. You must also copy the sync_enable.drush.inc - * file to a location where Drush will find it, such as - * $HOME/.drush. See `drush topic docs-commands` for more - * information. - * - * To set variables on a development site: - * - * Instead of calling variable_set and variable_delete in a post-sync - * hook, consider adding $conf variables to settings.php. - * - * For example: - * - * $conf['error_level'] = 2; - * error_reporting(E_ALL); - * ini_set('display_errors', TRUE); - * ini_set('display_startup_errors', TRUE); - * $conf['preprocess_css'] = 0; - * $conf['cache'] = 0; - * $conf['googleanalytics_account'] = ''; - */ - -/** - * Implements hook_drush_help_alter(). - * - * When a hook extends a command with additional options, it must - * implement help alter and declare the option(s). Doing so will add - * the option to the help text for the modified command, and will also - * allow the new option to be specified on the command line. Without - * this, Drush will fail with an error when a user attempts to use - * the option. - */ -function sync_enable_drush_help_alter(&$command) { - if ($command['command'] == 'sql-sync') { - $command['options']['updb'] = "Apply database updates on the target database after the sync operation has completed."; - $command['options']['enable'] = "Enable the specified modules in the target database after the sync operation has completed."; - $command['options']['disable'] = "Disable the specified modules in the target database after the sync operation has completed."; - $command['options']['permission'] = "Add or remove permissions from a role in the target database after the sync operation has completed. The value of this option must be an array, so it may only be specified in a site alias record or drush configuration file. See `drush topic docs-example-sync-extension`."; - } -} - -/** - * Implements drush_hook_post_COMMAND(). - * - * The post hook is only called if the sql-sync operation completes - * without an error. When called, we check to see if the user specified - * any modules to enable/disable. If so, we will call pm-enable/pm-disable on - * each module. - */ -function drush_sync_enable_post_sql_sync($source = NULL, $destination = NULL) { - $updb = drush_get_option('updb', FALSE); - if ($updb) { - drush_log('Run database updates', 'ok'); - drush_invoke_process($destination, 'updatedb', array(), array('yes' => TRUE)); - } - $modules_to_enable = drush_get_option_list('enable'); - if (!empty($modules_to_enable)) { - drush_log(dt("Enable !modules post-sql-sync", array('!modules' => implode(',', $modules_to_enable))), 'ok'); - drush_invoke_process($destination, 'pm-enable', $modules_to_enable, array('yes' => TRUE)); - } - $modules_to_disable = drush_get_option_list('disable'); - if (!empty($modules_to_disable)) { - drush_log(dt("Disable !modules post-sql-sync", array('!modules' => implode(',', $modules_to_disable))), 'ok'); - drush_invoke_process($destination, 'pm-disable', $modules_to_disable, array('yes' => TRUE)); - } - $permissions_table = drush_get_option('permission'); - if (!empty($permissions_table)) { - foreach ($permissions_table as $role_name => $actions) { - if (array_key_exists('add', $actions)) { - $permissions_to_add = is_array($actions['add']) ? $actions['add'] : explode(', ', $actions['add']); - foreach ($permissions_to_add as $permission) { - $values = drush_invoke_process($destination, 'role-add-perm', array($role_name, $permission), array(), array('integrate' => TRUE)); - } - } - if (array_key_exists('remove', $actions)) { - $permissions_to_remove = is_array($actions['remove']) ? $actions['remove'] : explode(', ', $actions['remove']); - foreach ($permissions_to_remove as $permission) { - $values = drush_invoke_process($destination, 'role-remove-perm', array($role_name, $permission), array(), array('integrate' => TRUE)); - } - } - } - } -} diff --git a/vendor/drush/drush/examples/sync_via_http.drush.inc b/vendor/drush/drush/examples/sync_via_http.drush.inc deleted file mode 100644 index cf44d2132db083287f2bd4e8ee5d37c4f5f9218e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/sync_via_http.drush.inc +++ /dev/null @@ -1,126 +0,0 @@ -<?php - -/** - * @file - * Example "Sync via HTTP" sql-sync command alter. - * - * Sync_via_http allows you to sql-sync your database using HTTP - * (e.g. wget or curl) instead of rsync. This is helpful for - * exporting your database to colaborators without shell access - * to the production or staging server. - * - * For example: - * - * @code - * $aliases['staging'] = array ( - * 'root' => '/srv/www/drupal', - * 'uri' => 'staging.site.com', - * 'source-command-specific' => array( - * 'sql-sync' => array( - * 'http-sync' => 'https://staging.site.com/protected-directory/site-database-dump.sql', - * 'http-sync-user' => 'wwwadmin', - * 'http-sync-password' => 'secretsecret', - * ), - * ), - * ); - * @endcode - * - * To use this feature, copy the 'source-command-specific' - * item from the example alias above, place it in your staging - * site aliases, and custom the access credentials as - * necessary. You must also copy the sync_via_http.drush.inc - * file to a location where Drush will find it, such as - * $HOME/.drush. See `drush topic docs-commands` for more - * information. - * - * IMPORTANT NOTE: This example does not cause the sql dump - * to be performed; it is presumed that the dump file already - * exists at the provided URL. For a full solution, a web page - * that initiated an sql-dump (or perhaps a local sql-sync followed - * by an sql-sanitize and then an sql-dump) would be necessary. - */ - -/** - * Implements hook_drush_help_alter(). - * - * When a hook extends a command with additional options, it must - * implement help alter and declare the option(s). Doing so will add - * the option to the help text for the modified command, and will also - * allow the new option to be specified on the command line. Without - * this, Drush will fail with an error when a user attempts to use - * the option. - */ -function sync_via_http_drush_help_alter(&$command) { - if ($command['command'] == 'sql-sync') { - $command['options']['http-sync'] = "Copy the database via http instead of rsync. Value is the url that the existing database dump can be found at."; - $command['sub-options']['http-sync']['http-sync-user'] = "Username for the protected directory containing the sql dump."; - $command['sub-options']['http-sync']['http-sync-password'] = "Password for the same directory."; - } -} - -/** - * Implements drush_hook_pre_COMMAND(). - * - * During the pre hook, determine if the http-sync option has been - * specified. If it has been, then disable the normal ssh + rsync - * dump-and-transfer that sql-sync usually does, and transfer the - * database dump via an http download. - */ -function drush_sync_via_http_pre_sql_sync($source = NULL, $destination = NULL) { - $sql_dump_download_url = drush_get_option('http-sync'); - if (!empty($sql_dump_download_url)) { - $user = drush_get_option('http-sync-user', FALSE); - $password = drush_get_option('http-sync-password', FALSE); - $source_dump_file = _drush_sync_via_http_download_file($sql_dump_download_url, $user, $password); - if ($source_dump_file === FALSE) { - return drush_set_error('DRUSH_CANNOT_DOWNLOAD', dt("The URL !url could not be downloaded.", array('!url' => $sql_dump_download_url))); - } - drush_set_option('target-dump', $source_dump_file); - drush_set_option('no-dump', TRUE); - drush_set_option('no-sync', TRUE); - } -} - -/** - * Downloads a files. - * - * Optionaly uses user authentication, using either wget or curl, as available. - */ -function _drush_sync_via_http_download_file($url, $user = FALSE, $password = FALSE, $destination = FALSE, $overwrite = TRUE) { - static $use_wget; - if ($use_wget === NULL) { - $use_wget = drush_shell_exec('which wget'); - } - - $destination_tmp = drush_tempnam('download_file'); - if ($use_wget) { - if ($user && $password) { - drush_shell_exec("wget -q --timeout=30 --user=%s --password=%s -O %s %s", $user, $password, $destination_tmp, $url); - } - else { - drush_shell_exec("wget -q --timeout=30 -O %s %s", $destination_tmp, $url); - } - } - else { - if ($user && $password) { - drush_shell_exec("curl -s -L --connect-timeout 30 --user %s:%s -o %s %s", $user, $password, $destination_tmp, $url); - } - else { - drush_shell_exec("curl -s -L --connect-timeout 30 -o %s %s", $destination_tmp, $url); - } - } - if (!drush_get_context('DRUSH_SIMULATE')) { - if (!drush_file_not_empty($destination_tmp) && $file = @file_get_contents($url)) { - @file_put_contents($destination_tmp, $file); - } - if (!drush_file_not_empty($destination_tmp)) { - // Download failed. - return FALSE; - } - } - if ($destination) { - drush_move_dir($destination_tmp, $destination, $overwrite); - return $destination; - } - return $destination_tmp; -} diff --git a/vendor/drush/drush/examples/xkcd.drush.inc b/vendor/drush/drush/examples/xkcd.drush.inc deleted file mode 100644 index bb53ff92c4827fc650b060c1b36e680cc82d7968..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/examples/xkcd.drush.inc +++ /dev/null @@ -1,161 +0,0 @@ -<?php - -/** - * @file - * Example XKCD Drush command. - * - * To run this *fun* command, execute `drush --include=./examples xkcd` from - * within your drush directory. - * - * See `drush topic docs-commands` for more information about command authoring. - * - * You can copy this file to any of the following - * 1. A .drush folder in your HOME folder. - * 2. Anywhere in a folder tree below an active module on your site. - * 3. /usr/share/drush/commands (configurable) - * 4. In an arbitrary folder specified with the --include option. - * 5. Drupal's /drush or /sites/all/drush folders, or in the /drush - * folder in the directory above the Drupal root. - */ - -/** - * Implements hook_drush_command(). - * - * In this hook, you specify which commands your drush module makes available, - * what it does and description. - * - * Notice how this structure closely resembles how you define menu hooks. - * - * See `drush topic docs-commands` for a list of recognized keys. - */ -function xkcd_drush_command() { - $items = array(); - - // The 'xkcd' command. - $items['xkcd-fetch'] = array( - 'description' => "Retrieve and display xkcd cartoons.", - 'arguments' => array( - 'search' => 'Optional argument to retrive the cartoons matching an index number, keyword search or "random". If omitted the latest cartoon will be retrieved.', - ), - 'options' => array( - 'image-viewer' => 'Command to use to view images (e.g. xv, firefox). Defaults to "display" (from ImageMagick).', - 'google-custom-search-api-key' => 'Google Custom Search API Key, available from https://code.google.com/apis/console/. Default key limited to 100 queries/day globally.', - ), - 'examples' => array( - 'drush xkcd' => 'Retrieve and display the latest cartoon.', - 'drush xkcd sandwich' => 'Retrieve and display cartoons about sandwiches.', - 'drush xkcd 123 --image-viewer=eog' => 'Retrieve and display cartoon #123 in eog.', - 'drush xkcd random --image-viewer=firefox' => 'Retrieve and display a random cartoon in Firefox.', - ), - 'aliases' => array('xkcd'), - // No bootstrap at all. - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - - return $items; -} - -/** - * Implements hook_drush_help(). - * - * This function is called whenever a drush user calls - * 'drush help <name-of-your-command>'. This hook is optional. If a command - * does not implement this hook, the command's description is used instead. - * - * This hook is also used to look up help metadata, such as help - * category title and summary. See the comments below for a description. - */ -function xkcd_drush_help($section) { - switch ($section) { - case 'drush:xkcd-fetch': - return dt("A command line tool (1) for a web site tool (2), that emulates -(badly) a web based tool (3) that emulates (badly) a command line tool (4) to -access a web site (5) with awesome geek humor.\n -(1) Drush -(2) Drupal -(3) http://uni.xkcd.com/ -(4) BASH -(5) http://xkcd.com/"); - } -} - -/** - * Implements drush_hook_COMMAND(). - * - * The command callback is where the action takes place. - * - * The function name should be same as command name but with dashes turned to - * underscores and 'drush_commandfile_' prepended, where 'commandfile' is - * taken from the file 'commandfile.drush.inc', which in this case is - * 'sandwich'. Note also that a simplification step is also done in instances - * where the commandfile name is the same as the beginning of the command name, - * "drush_example_example_foo" is simplified to just "drush_example_foo". - * To also implement a hook that is called before your command, implement - * "drush_hook_pre_example_foo". For a list of all available hooks for a - * given command, run drush in --debug mode. - * - * If for some reason you do not want your hook function to be named - * after your command, you may define a 'callback' item in your command - * object that specifies the exact name of the function that should be - * called. - * - * In this function, all of Drupal's API is (usually) available, including - * any functions you have added in your own modules/themes. - * - * @see drush_invoke() - * @see drush.api.php - * - * @param string $search - * An optional string with search keyworks, cartoon ID or "random". - */ -function drush_xkcd_fetch($search = '') { - if (empty($search)) { - drush_xkcd_display('http://xkcd.com'); - } - elseif (is_numeric($search)) { - drush_xkcd_display('http://xkcd.com/' . $search); - } - elseif ($search == 'random') { - $xkcd_response = @json_decode(file_get_contents('http://xkcd.com/info.0.json')); - if (!empty($xkcd_response->num)) { - drush_xkcd_display('http://xkcd.com/' . rand(1, $xkcd_response->num)); - } - } - else { - // This uses an API key with a limited number of searches per. - $search_response = @json_decode(file_get_contents('https://www.googleapis.com/customsearch/v1?key=' . drush_get_option('google-custom-search-api-key', 'AIzaSyDpE01VDNNT73s6CEeJRdSg5jukoG244ek') . '&cx=012652707207066138651:zudjtuwe28q&q=' . $search)); - if (!empty($search_response->items)) { - foreach ($search_response->items as $item) { - drush_xkcd_display($item->link); - } - } - else { - drush_set_error('DRUSH_XKCD_SEARCH_FAIL', dt('The search failed or produced no results.')); - } - } -} - -/** - * Display a given XKCD cartoon. - * - * Retrieve and display a table of metadata for an XKCD cartoon, then retrieve - * and display the cartoon using a specified image viewer. - * - * @param string $url - * A string with the URL of the cartoon to display. - */ -function drush_xkcd_display($url) { - $xkcd_response = @json_decode(file_get_contents($url . '/info.0.json')); - if (!empty($xkcd_response->num)) { - $data = (array) $xkcd_response; - $data['date'] = $data['year'] . '/' . $data['month'] . '/' . $data['day']; - unset($data['safe_title'], $data['news'], $data['link'], $data['year'], $data['month'], $data['day']); - drush_print_table(drush_key_value_to_array_table($data)); - $img = drush_download_file($data['img']); - drush_register_file_for_deletion($img); - drush_shell_exec(drush_get_option('image-viewer', 'display') . ' ' . $img); - } - else { - drush_set_error('DRUSH_XKCD_METADATA_FAIL', dt('Unable to retrieve cartoon metadata.')); - } -} diff --git a/vendor/drush/drush/includes/annotationcommand_adapter.inc b/vendor/drush/drush/includes/annotationcommand_adapter.inc deleted file mode 100644 index 07ab48951792c6e0d823c65630469ed77dee9aa5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/includes/annotationcommand_adapter.inc +++ /dev/null @@ -1,879 +0,0 @@ -<?php - -/** - * @file - * annotationcommand_adapter.inc - */ - -use Consolidation\AnnotatedCommand\CommandFileDiscovery; -use Consolidation\AnnotatedCommand\AnnotatedCommandFactory; -use Consolidation\AnnotatedCommand\CommandProcessor; -use Consolidation\AnnotatedCommand\Hooks\HookManager; -use Consolidation\OutputFormatters\FormatterManager; -use Consolidation\OutputFormatters\Options\FormatterOptions; -use Symfony\Component\Console\Input\ArrayInput; -use Consolidation\AnnotatedCommand\AnnotationData; -use Consolidation\AnnotatedCommand\CommandData; -use Drush\Command\DrushInputAdapter; -use Drush\Command\DrushOutputAdapter; -use Drush\Drush; -use Drush\SiteAlias\AliasManagerAdapterInjector; -use Drush\SiteAlias\ProcessManagerInjector; - -use Symfony\Component\Console\Output\ConsoleOutput; - -/** - * Cache the command file discovery object. - * - * @return CommandFileDiscovery - */ -function annotationcommand_adapter_get_discovery() { - static $discovery; - if (!isset($discovery)) { - $discovery = new CommandFileDiscovery(); - $discovery - ->setIncludeFilesAtBase(false) - ->setSearchDepth(3) - ->ignoreNamespacePart('contrib', 'Commands') - ->ignoreNamespacePart('custom', 'Commands') - ->ignoreNamespacePart('src') - ->setSearchLocations(['Commands']) - ->setSearchPattern('#.*Commands.php$#'); - } - return $discovery; -} - -/** - * Initialize and cache the command factory. Drush 9 uses dependency injection. - * - * @return AnnotatedCommandFactory - */ -function annotationcommand_adapter_get_factory() { - static $factory; - if (!isset($factory)) { - $factory = new AnnotatedCommandFactory(); - $factory->commandProcessor()->hookManager()->add('annotatedcomand_adapter_backend_result', HookManager::EXTRACT_OUTPUT); - $formatter = new FormatterManager(); - $formatter->addDefaultFormatters(); - $formatter->addDefaultSimplifiers(); - $factory->commandProcessor()->setFormatterManager($formatter); - } - return $factory; -} - -/** - * Fetch the command processor from the factory. - * - * @return AnnotatedCommandFactory - */ -function annotationcommand_adapter_get_processor() { - $factory = annotationcommand_adapter_get_factory(); - return $factory->commandProcessor(); -} - -/** - * Fetch the formatter manager from the command processor - * - * @return FormatterManager - */ -function annotatedcomand_adapter_get_formatter() { - $commandProcessor = annotationcommand_adapter_get_processor(); - return $commandProcessor->formatterManager(); -} - -/** - * Callback function called by HookManager::EXTRACT_OUTPUT to set - * the backend result. - */ -function annotatedcomand_adapter_backend_result($structured_data) { - $return = drush_backend_get_result(); - if (empty($return)) { - drush_backend_set_result($structured_data); - } -} - -/** - * Return the cached commands built by annotationcommand_adapter_discover. - * @see drush_get_commands() - */ -function annotationcommand_adapter_commands() { - $annotation_commandfiles = drush_get_context('DRUSH_ANNOTATED_COMMANDFILES'); - // Remove any entry in the commandfiles list from an ignored module. - $ignored = implode('|', drush_get_option_list('ignored-modules')); - $regex = "#/(modules|themes|profiles)(/|/.*/)($ignored)/#"; - foreach ($annotation_commandfiles as $key => $path) { - if (preg_match($regex, $path)) { - unset($annotation_commandfiles[$key]); - } - } - $site_wide_commands = annotationcommand_adapter_get_commands($annotation_commandfiles); - $module_service_commands = drush_get_context('DRUSH_MODULE_SERVICE_COMMANDS'); - $commands = array_merge($site_wide_commands, $module_service_commands); - - return $commands; -} - -/** - * Search for annotation commands at the provided search path. - * @see _drush_find_commandfiles() - */ -function annotationcommand_adapter_discover($searchpath, $phase = false, $phase_max = false) { - if (empty($searchpath)) { - return; - } - if (($phase >= DRUSH_BOOTSTRAP_DRUPAL_SITE) && (drush_drupal_major_version() >= 8)) { - return; - } - $annotation_commandfiles = []; - // Assemble a cid specific to the bootstrap phase and searchpaths. - // Bump $cf_version when making a change to a dev version of Drush - // that invalidates the commandfile cache. - $cf_version = 1; - $cid = drush_get_cid('annotationfiles-' . $phase, array(), array_merge($searchpath, array($cf_version))); - $command_cache = drush_cache_get($cid); - if (isset($command_cache->data)) { - $annotation_commandfiles = $command_cache->data; - } - else { - // Check to see if this is the Drush searchpath for instances where we are - // NOT going to do a full bootstrap (e.g. when running a help command) - if (($phase == DRUSH_BOOTSTRAP_DRUPAL_SITE) && ($phase_max < DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - $searchpath = annotationcommand_adapter_refine_searchpaths($searchpath); - } - $discovery = annotationcommand_adapter_get_discovery(); - $annotation_commandfiles = $discovery->discoverNamespaced($searchpath, '\Drupal'); - drush_cache_set($cid, $annotation_commandfiles); - } - drush_set_context( - 'DRUSH_ANNOTATED_COMMANDFILES', - array_merge( - drush_get_context('DRUSH_ANNOTATED_COMMANDFILES'), - $annotation_commandfiles - ) - ); -} - -/** - * This function is set as the $command['callback'] for Symfony Console commands - * e.g. those provided by Drupal 8 modules. Note that Drush 9 calls these with - * Symfony's Application::run() method, but Drush 8 continues to use the - * legacy Drush command dispatcher for all commands. - * - * @return bolean false if command failed (expect drush_set_error was called in this case) - */ -function annotationcommand_adapter_run_console_command() { - $args = func_get_args(); - $command = drush_get_command(); - - $console_command = $command['drush-console-command']; - // TODO: Build an appropriate input object - $input = annotationcommand_adapter_build_input($console_command, $args); - $output = new ConsoleOutput(); - $result = $console_command->run($input, $output); - - return $result; -} - -/** - * TODO: This could probably just be a DrushInputAdapter now. - */ -function annotationcommand_adapter_build_input($console_command, $userArgs) { - $args = []; - $defaultOptions = []; - $definition = $console_command->getDefinition(); - $inputArguments = $definition->getArguments(); - foreach ($inputArguments as $key => $inputOption) { - $value = array_shift($userArgs); - if (!isset($value)) { - $value = $inputOption->getDefault(); - } - $args[$key] = $value; - } - $inputOptions = $definition->getOptions(); - foreach ($inputOptions as $option => $inputOption) { - $defaultOptions[$option] = $inputOption->getDefault(); - } - foreach ($defaultOptions as $option => $value) { - $args["--$option"] = drush_get_option($option, $value); - } - // TODO: Need to add global options. Note that ArrayInput is validated. - $input = new ArrayInput($args, $definition); - return $input; -} - -/** - * Collect all of the options defined in every relevant context, and - * merge them together to form the options array. - * - * @return array - */ -function annotationcommand_adapter_get_options($command) { - $default_options = isset($command['consolidation-option-defaults']) ? $command['consolidation-option-defaults'] : []; - $options = drush_redispatch_get_options() + $default_options; - - $options += drush_get_merged_options(); - - return $options; -} - -/** - * This function is set as the $command['callback'] for commands that have - * been converted to annotated commands. Note that Drush 9 calls these with - * Symfony's Application::run() method, but Drush 8 continues to use the - * legacy Drush command dispatcher for all commands. - * - * @return bolean false if command failed (expect drush_set_error was called in this case) - */ -function annotationcommand_adapter_process_command() { - $userArgs = func_get_args(); - $commandprocessor = annotationcommand_adapter_get_processor(); - $command = drush_get_command(); - annotationcommand_adapter_add_hook_options($command); - $args = []; - foreach ($command['consolidation-arg-defaults'] as $key => $default) { - $value = array_shift($userArgs); - if (!isset($value)) { - $value = $default; - } - $args[$key] = $value; - } - - $input = new DrushInputAdapter($args, annotationcommand_adapter_get_options($command), $command['command']); - $output = new DrushOutputAdapter(); - annotationcommand_adapter_input($input); - $annotationData = $command['annotations']; - $commandData = new CommandData( - $annotationData, - $input, - $output - ); - $commandData->setIncludeOptionsInArgs($command['add-options-to-arguments']); - $names = annotationcommand_adapter_command_names($command); - - // For now, the only thing that can be injected is the InputInterface. - foreach ($command['injected-classes'] as $injected) { - switch ($injected) { - case 'Symfony\Component\Console\Input\InputInterface': - $commandData->injectInstance($input); - break; - } - } - - // n.b.: backend result is set by a post-alter hook. - $result = $commandprocessor->process( - $output, - $names, - $command['annotated-command-callback'], - $commandData - ); - - return $result; -} - -function annotationcommand_adapter_input($setInput = null) { - static $cacheInput = null; - if ($setInput != null) { - $cacheInput = $setInput; - } - return $cacheInput; -} - -/** - * Internal function called by annotationcommand_adapter_commands, which - * is called by drush_get_commands(). - * - * @param array $annotation_commandfiles path => class mapping - * - * @return object[] - */ -function annotationcommand_adapter_get_commands($annotation_commandfiles) { - $commands = []; - // This will give us a list containing something akin to: - // 'modules/default_content/src/CliTools/DefaultContentCommands.php' => - // '\\Drupal\\default_content\\CliTools\\DefaultContentCommands', - foreach ($annotation_commandfiles as $commandfile_path => $commandfile_class) { - try { - if (file_exists($commandfile_path) && ($commandfile_class != '\Drush\Commands\DrushCommands')) { - $commandhandler = annotationcommand_adapter_create_commandfile_instance($commandfile_path, $commandfile_class); - $commands_for_this_commandhandler = annotationcommand_adapter_get_commands_for_commandhandler($commandhandler, $commandfile_path); - $commands = array_merge($commands, $commands_for_this_commandhandler); - } - } - catch (\Exception $e) {} - } - return $commands; -} - -use Psr\Log\LoggerAwareInterface; - - -/** - * Create and cache a commandfile instance. - * - * @param string $commandfile_path Path to the commandfile implementation - * @param string $commandfile_class Namespace and class of the commandfile object - * - * @return object - */ -function annotationcommand_adapter_create_commandfile_instance($commandfile_path, $commandfile_class) { - $cache =& drush_get_context('DRUSH_ANNOTATION_COMMANDFILE_INSTANCES'); - if (!isset($cache[$commandfile_path])) { - include_once $commandfile_path; - $commandhandler = new $commandfile_class; - - // Inject logger if requested - if ($commandhandler instanceof LoggerAwareInterface) { - $commandhandler->setLogger(Drush::logger()); - } - - if (class_exists('\Consolidation\SiteAlias\SiteAliasManager')) { - $alias_manager_injector = new AliasManagerAdapterInjector(); - $alias_manager_injector->inflect($commandhandler); - } - - if (class_exists('\Consolidation\SiteProcess\ProcessManager')) { - $process_manager_injector = new ProcessManagerInjector(); - $process_manager_injector->inflect($commandhandler); - } - - $cache[$commandfile_path] = $commandhandler; - } - return $cache[$commandfile_path]; -} - -/** - * TODO: document - */ -function annotationcommand_adapter_cache_module_console_commands($console_command, $commandfile_path = null) { - if (!isset($commandfile_path)) { - $class = new \ReflectionClass($console_command); - $commandfile_path = $class->getFileName(); - } - $module_service_commands = drush_get_context('DRUSH_MODULE_SERVICE_COMMANDS'); - $commands = annotationcommand_adapter_get_command_for_console_command($console_command, $commandfile_path); - drush_set_context('DRUSH_MODULE_SERVICE_COMMANDS', array_merge($commands, $module_service_commands)); -} - -/** - * TODO: document - */ -function annotationcommand_adapter_cache_module_service_commands($commandhandler, $commandfile_path = null) { - if (!isset($commandfile_path)) { - $class = new \ReflectionClass($commandhandler); - $commandfile_path = $class->getFileName(); - } - $module_service_commands = drush_get_context('DRUSH_MODULE_SERVICE_COMMANDS'); - $commands = annotationcommand_adapter_get_commands_for_commandhandler($commandhandler, $commandfile_path, false); - drush_set_context('DRUSH_MODULE_SERVICE_COMMANDS', array_merge($commands, $module_service_commands)); -} - -/** - * Convert a Symfony Console command into a Drush $command record - * - * @param Symfony\Component\Console\Command\Command $console_command The Symfony Console command to convert - * @param string $commandfile_path Path to console command file - * - * @return array Drush $command record - */ -function annotationcommand_adapter_get_command_for_console_command($console_command, $commandfile_path) { - $commands = []; - $commandfile = basename($commandfile_path, '.php'); - $factory = annotationcommand_adapter_get_factory(); - $inputDefinition = $console_command->getDefinition(); - $inputArguments = $inputDefinition->getArguments(); - $inputOptions = $inputDefinition->getOptions(); - $aliases = $console_command->getAliases(); - $command_name = strtolower($console_command->getName()); - $standard_alias = str_replace(':', '-', $command_name); - if ($command_name != $standard_alias) { - $aliases[] = $standard_alias; - } - $command = [ - 'name' => $command_name, - 'callback' => 'annotationcommand_adapter_run_console_command', - 'drush-console-command' => $console_command, - 'commandfile' => $commandfile, - 'category' => $commandfile, - 'options' => [], - 'arguments' => [], - 'description' => $console_command->getDescription(), - 'examples' => $console_command->getUsages(), - 'aliases' => $aliases, - ]; - foreach ($inputArguments as $arg => $inputArg) { - $command['arguments'][$arg] = $inputArg->getDescription(); - } - $command['required-arguments'] = $inputDefinition->getArgumentRequiredCount(); - foreach ($inputOptions as $option => $inputOption) { - $description = $inputOption->getDescription(); - $default = $inputOption->getDefault(); - $command['options'][$option] = ['description' => $description]; - if (!empty($default)) { - $command['options'][$option]['example-value'] = $default; - } - } - $command += drush_command_defaults($command_name, $commandfile, $commandfile_path); - $commands[$command_name] = $command; - return $commands; -} - -function annotationcommand_adapter_bootstrap_phase_index($phase) -{ - $phaseMap = annotationcommand_adapter_bootstrap_phase_map(); - if (isset($phaseMap[$phase])) { - return $phaseMap[$phase]; - } - - if ((substr($phase, 0, 16) != 'DRUSH_BOOTSTRAP_') || (!defined($phase))) { - return; - } - return constant($phase); -} - -function annotationcommand_adapter_bootstrap_phase_map() -{ - return [ - 'none' => DRUSH_BOOTSTRAP_NONE, - 'root' => DRUSH_BOOTSTRAP_DRUPAL_ROOT, - 'site' => DRUSH_BOOTSTRAP_DRUPAL_SITE, - 'config' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, - 'configuration' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, - 'db' => DRUSH_BOOTSTRAP_DRUPAL_DATABASE, - 'database' => DRUSH_BOOTSTRAP_DRUPAL_DATABASE, - 'full' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - ]; -} - -/** - * Convert an annotated command command handler object into a Drush $command record. - * - * @param object $commandhandler Command handler object - * @param string $commandfile_path - * @param boolean $includeAllPublicMethods TODO remove this, make it 'false' always - * - * @return array Drush $command record - */ -function annotationcommand_adapter_get_commands_for_commandhandler($commandhandler, $commandfile_path, $includeAllPublicMethods = true) { - if (!$commandhandler) { - return []; - } - $cache =& drush_get_context('DRUSH_ANNOTATION_COMMANDS_FOR_COMMANDFILE'); - if (isset($cache[$commandfile_path])) { - return $cache[$commandfile_path]; - } - $factory = annotationcommand_adapter_get_factory(); - $commands = []; - $commandfile = basename($commandfile_path, '.php'); - - $commandinfo_list = $factory->getCommandInfoListFromClass($commandhandler); - - foreach ($commandinfo_list as $commandinfo) { - // Hooks are automatically registered when the commandhandler is - // created via registerCommandClass(), so we don't need to do it again here. - // $factory->registerCommandHook($commandinfo, $commandhandler); - $aliases = $commandinfo->getAliases(); - $command_name = strtolower($commandinfo->getName()); - $standard_alias = str_replace(':', '-', $command_name); - if ($command_name != $standard_alias) { - $aliases[] = $standard_alias; - } - $handle_remote_commands = $commandinfo->getAnnotation('handle-remote-commands') == 'true'; - // TODO: if there is no 'bootstrap' annotation, maybe we should default to NONE instead of FULL? - if ($bootstrap = $commandinfo->getAnnotation('bootstrap')) { - // Convert from the bootstrap string to the appropriate bootstrap phase index - $bootstrap = annotationcommand_adapter_bootstrap_phase_index($bootstrap); - } - $command = [ - 'name' => $command_name, - //'callback' => [$commandhandler, $commandinfo->getMethodName()], - 'callback' => 'annotationcommand_adapter_process_command', - 'annotated-command-callback' => [$commandhandler, $commandinfo->getMethodName()], - 'commandfile' => $commandfile, - 'category' => $commandfile, - 'options' => [], - 'arguments' => [], - 'description' => $commandinfo->getDescription(), - 'examples' => $commandinfo->getExampleUsages(), - 'bootstrap' => $bootstrap, - 'handle-remote-commands' => $handle_remote_commands, - 'aliases' => $aliases, - 'add-options-to-arguments' => TRUE, - 'consolidation-output-formatters' => TRUE, - 'consolidation-option-defaults' => $commandinfo->options()->getValues(), - 'consolidation-arg-defaults' => $commandinfo->arguments()->getValues(), - ]; - $required_arguments = 0; - foreach ($commandinfo->arguments()->getValues() as $arg => $default) { - $command['arguments'][$arg] = $commandinfo->arguments()->getDescription($arg); - if (!isset($default)) { - ++$required_arguments; - } - } - $command['required-arguments'] = $required_arguments; - foreach ($commandinfo->options()->getValues() as $option => $default) { - $description = $commandinfo->options()->getDescription($option); - $command['options'][$option] = ['description' => $description]; - if (!empty($default)) { - $command['options'][$option]['example-value'] = $default; - } - $fn = 'annotationcommand_adapter_alter_option_description_' . $option; - if (function_exists($fn)) { - $command['options'][$option] = $fn($command['options'][$option], $commandinfo, $default); - } - } - $command['annotations'] = $commandinfo->getAnnotations(); - $command['injected-classes'] = $commandinfo->getInjectedClasses(); - // If the command has a '@return' annotation, then - // remember information we will need to use the output formatter. - $returnType = $commandinfo->getReturnType(); - if (isset($returnType)) { - $command['return-type'] = $returnType; - } - $command += drush_command_defaults($command_name, $commandfile, $commandfile_path); - $commands[$command_name] = $command; - } - $cache[$commandfile_path] = $commands; - return $commands; -} - -/** - * Modify a $command record, adding option definitions defined by any - * command hook. - * - * @param array $command Drush command record to modify - */ -function annotationcommand_adapter_add_hook_options(&$command) -{ - // Get options added by hooks. We postpone doing this until the - // last minute rather than doing it when processing commandfiles - // so that we do not need to worry about what order we process the - // commandfiles in -- we can load extensions late, and still have - // the extension hook a core command, or have an early-loaded global - // extension hook a late-loaded extension (e.g. attached to a module). - $names = annotationcommand_adapter_command_names($command); - $names[] = '*'; // we are missing annotations here; maybe we just don't support that? (TODO later, maybe) - $factory = annotationcommand_adapter_get_factory(); - $extraOptions = $factory->hookManager()->getHookOptions($names); - foreach ($extraOptions as $commandinfo) { - if (!isset($command['consolidation-option-defaults'])) { - $command['consolidation-option-defaults'] = array(); - } - $command['consolidation-option-defaults'] += $commandinfo->options()->getValues(); - foreach ($commandinfo->options()->getValues() as $option => $default) { - $description = $commandinfo->options()->getDescription($option); - $command['options'][$option] = ['description' => $description]; - if (!empty($default)) { - $command['options'][$option]['example-value'] = $default; - } - $fn = 'annotationcommand_adapter_alter_option_description_' . $option; - if (function_exists($fn)) { - $command['options'][$option] = $fn($command['options'][$option], $commandinfo, $default); - } - } - } -} - -/** - * Build all of the name variants for a Drush $command record - * - * @param array $command Drush command record - * - * @return string[] - */ -function annotationcommand_adapter_command_names($command) -{ - $names = array_merge( - [$command['command']], - $command['aliases'] - ); - if (!empty($command['annotated-command-callback'])) { - $commandHandler = $command['annotated-command-callback'][0]; - $reflectionClass = new \ReflectionClass($commandHandler); - $commandFileClass = $reflectionClass->getName(); - $names[] = $commandFileClass; - } - return $names; -} - -/** - * Convert from an old-style Drush initialize hook into annotated-command hooks. - * @see _drush_invoke_hooks(). - * - * @param string[] $names All of the applicable names for the command being hooked - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - */ -function annotationcommand_adapter_call_initialize($names, CommandData $commandData) -{ - $factory = annotationcommand_adapter_get_factory(); - $hookManager = $factory->hookManager(); - - $hooks = $hookManager->getHooks( - $names, - [ - HookManager::PRE_INITIALIZE, - HookManager::INITIALIZE, - HookManager::POST_INITIALIZE, - ], - $commandData->annotationData() - ); - - foreach ((array)$hooks as $hook) { - $hook($commandData->input(), $commandData->annotationData()); - } -} - -/** - * Convert from an old-style Drush pre-validate hook into annotated-command hooks. - * @see _drush_invoke_hooks(). - * - * @param string[] $names All of the applicable names for the command being hooked - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - * - * @return boolean|object - */ -function annotationcommand_adapter_call_hook_pre_validate($names, CommandData $commandData) -{ - return annotationcommand_adapter_call_validate_interface( - $names, - [ - HookManager::PRE_ARGUMENT_VALIDATOR, - ], - $commandData - ); -} - -/** - * Convert from an old-style Drush validate hook into annotated-command hooks. - * @see _drush_invoke_hooks(). - * - * @param string[] $names All of the applicable names for the command being hooked - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - * - * @return boolean|object - */ -function annotationcommand_adapter_call_hook_validate($names, CommandData $commandData) -{ - return annotationcommand_adapter_call_validate_interface( - $names, - [ - HookManager::ARGUMENT_VALIDATOR, - ], - $commandData - ); -} - -/** - * Convert from an old-style Drush pre-command hook into annotated-command hooks. - * @see _drush_invoke_hooks(). - * - * @param string[] $names All of the applicable names for the command being hooked - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - * - * @return boolean|object - */ -function annotationcommand_adapter_call_hook_pre_command($names, CommandData $commandData) -{ - return annotationcommand_adapter_call_validate_interface( - $names, - [ - HookManager::PRE_COMMAND_HOOK, - ], - $commandData - ); -} - -/** - * Convert from an old-style Drush 'command' hook into annotated-command hooks. - * @see _drush_invoke_hooks(). - * - * @param string[] $names All of the applicable names for the command being hooked - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - * - * @return boolean|object - */ -function annotationcommand_adapter_call_hook_command($names, CommandData $commandData) -{ - return annotationcommand_adapter_call_validate_interface( - $names, - [ - HookManager::COMMAND_HOOK, - ], - $commandData - ); -} - -/** - * Convert from an old-style Drush post-command hook into annotated-command hooks. - * @see _drush_invoke_hooks(). - * - * @param string[] $names All of the applicable names for the command being hooked - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - * @param mixed $return The return value of the command being executed - * - * @return mixed The altered command return value - */ -function annotationcommand_adapter_call_hook_post_command($names, CommandData $commandData, $return) -{ - return annotationcommand_adapter_call_process_interface( - $names, - [ - HookManager::POST_COMMAND_HOOK, - ], - $commandData, - $return - ); -} - -/** - * After the primary Drush command hook is called, call all of the annotated-command - * process and alter hooks. - * @see _drush_invoke_hooks(). - * - * @param string[] $names All of the applicable names for the command being hooked - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - * @param mixed $return The return value of the command being executed - * - * @return mixed The altered command return value - */ -function annotationcommand_adapter_call_hook_process_and_alter($names, $commandData, $return) -{ - return annotationcommand_adapter_call_process_interface( - $names, - [ - HookManager::PRE_PROCESS_RESULT, - HookManager::PROCESS_RESULT, - HookManager::POST_PROCESS_RESULT, - HookManager::PRE_ALTER_RESULT, - HookManager::ALTER_RESULT, - HookManager::POST_ALTER_RESULT, - ], - $commandData, - $return - ); -} - -/** - * Given a list of hooks that conform to the interface ProcessResultInterface, - * call them and return the result. - * - * @param string[] $names All of the applicable names for the command being hooked - * @param string[] $hooks All of the HookManager hooks that should be called - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - * @param mixed $return The return value of the command being executed - * - * @return mixed The altered command return value - */ -function annotationcommand_adapter_call_process_interface($names, $hooks, CommandData $commandData, $return) -{ - $factory = annotationcommand_adapter_get_factory(); - $hookManager = $factory->hookManager(); - - $hooks = $hookManager->getHooks($names, $hooks, $commandData->annotationData()); - - foreach ((array)$hooks as $hook) { - $result = $hook($return, $commandData); - if (isset($result)) { - $return = $result; - } - } - return $return; -} - -/** - * Given a list of hooks that conform to the interface ValidatorInterface, - * call them and return the result. - * - * @param string[] $names All of the applicable names for the command being hooked - * @param string[] $hooks All of the HookManager hooks that should be called - * @param CommandData $commandData All of the parameter data associated with the - * current command invokation, including the InputInterface, OutputInterface - * and AnnotationData - * - * @return boolean|object - */ -function annotationcommand_adapter_call_validate_interface($names, $hooks, CommandData $commandData) -{ - $factory = annotationcommand_adapter_get_factory(); - $hookManager = $factory->hookManager(); - - $annotationData = $commandData->annotationData(); - $hooks = $hookManager->getHooks($names, $hooks, $annotationData); - - foreach ((array)$hooks as $hook) { - $validated = $hook($commandData); - // TODO: if $validated is a CommandError, maybe the best thing to do is 'return drush_set_error()'? - if (is_object($validated) || ($validated === false)) { - return $validated; - } - } - return true; -} - -/** - * TODO: Document - */ -function annotationcommand_adapter_alter_option_description_format($option_help, $commandinfo, $default) { - $formatterManager = annotatedcomand_adapter_get_formatter(); - $return_type = $commandinfo->getReturnType(); - if (!empty($return_type)) { - $available_formats = $formatterManager->validFormats($return_type); - $option_help['description'] = dt('Select output format. Available: !formats.', array('!formats' => implode(', ', $available_formats))); - if (!empty($default)) { - $option_help['description'] .= dt(' Default is !default.', array('!default' => $default)); - } - } - return $option_help; -} - -/** - * TODO: Document - */ -function annotationcommand_adapter_alter_option_description_fields($option_help, $commandinfo, $default) { - $formatOptions = new FormatterOptions($commandinfo->getAnnotations()->getArrayCopy()); - $field_labels = $formatOptions->get(FormatterOptions::FIELD_LABELS); - $default_fields = $formatOptions->get(FormatterOptions::DEFAULT_FIELDS, [], array_keys($field_labels)); - $available_fields = array_keys($field_labels); - $option_help['example-value'] = implode(', ', $default_fields); - $option_help['description'] = dt('Fields to output. All available fields are: !available.', array('!available' => implode(', ', $available_fields))); - return $option_help; -} - -/** - * In some circumstances, Drush just does a deep search for any *.drush.inc - * file, so that it can find all commands, in enabled and disabled modules alike, - * for the purpose of displaying the help text for that command. - */ -function annotationcommand_adapter_refine_searchpaths($searchpath) { - $result = []; - foreach ($searchpath as $path) { - $max_depth = TRUE; - $pattern = '/.*\.info$/'; - if (drush_drupal_major_version() > 7) { - $pattern = '/.*\.info.yml$/'; - } - $locations = drush_scan_directory($path, $pattern, ['.', '..'], false, $max_depth); - - // Search for any directory that might be a module or theme (contains - // a *.info or a *.info.yml file) - foreach ($locations as $key => $info) { - $result[dirname($key)] = true; - } - } - return array_keys($result); -} diff --git a/vendor/drush/drush/includes/array_column.inc b/vendor/drush/drush/includes/array_column.inc deleted file mode 100644 index e7551173adfcc6b5a30bd369213b4924398455c5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/includes/array_column.inc +++ /dev/null @@ -1,117 +0,0 @@ -<?php -/** - * This file was recommended at http://php.net/manual/en/function.array-column.php#refsect1-function.array-column-seealso - * - * This file is part of the array_column library - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * @copyright Copyright (c) Ben Ramsey (http://benramsey.com) - * @license http://opensource.org/licenses/MIT MIT - */ - -if (!function_exists('array_column')) { - /** - * Returns the values from a single column of the input array, identified by - * the $columnKey. - * - * Optionally, you may provide an $indexKey to index the values in the returned - * array by the values from the $indexKey column in the input array. - * - * @param array $input A multi-dimensional array (record set) from which to pull - * a column of values. - * @param mixed $columnKey The column of values to return. This value may be the - * integer key of the column you wish to retrieve, or it - * may be the string key name for an associative array. - * @param mixed $indexKey (Optional.) The column to use as the index/keys for - * the returned array. This value may be the integer key - * of the column, or it may be the string key name. - * @return array - */ - function array_column($input = null, $columnKey = null, $indexKey = null) - { - // Using func_get_args() in order to check for proper number of - // parameters and trigger errors exactly as the built-in array_column() - // does in PHP 5.5. - $argc = func_num_args(); - $params = func_get_args(); - - if ($argc < 2) { - trigger_error("array_column() expects at least 2 parameters, {$argc} given", E_USER_WARNING); - return null; - } - - if (!is_array($params[0])) { - trigger_error( - 'array_column() expects parameter 1 to be array, ' . gettype($params[0]) . ' given', - E_USER_WARNING - ); - return null; - } - - if (!is_int($params[1]) - && !is_float($params[1]) - && !is_string($params[1]) - && $params[1] !== null - && !(is_object($params[1]) && method_exists($params[1], '__toString')) - ) { - trigger_error('array_column(): The column key should be either a string or an integer', E_USER_WARNING); - return false; - } - - if (isset($params[2]) - && !is_int($params[2]) - && !is_float($params[2]) - && !is_string($params[2]) - && !(is_object($params[2]) && method_exists($params[2], '__toString')) - ) { - trigger_error('array_column(): The index key should be either a string or an integer', E_USER_WARNING); - return false; - } - - $paramsInput = $params[0]; - $paramsColumnKey = ($params[1] !== null) ? (string) $params[1] : null; - - $paramsIndexKey = null; - if (isset($params[2])) { - if (is_float($params[2]) || is_int($params[2])) { - $paramsIndexKey = (int) $params[2]; - } else { - $paramsIndexKey = (string) $params[2]; - } - } - - $resultArray = array(); - - foreach ($paramsInput as $row) { - $key = $value = null; - $keySet = $valueSet = false; - - if ($paramsIndexKey !== null && array_key_exists($paramsIndexKey, $row)) { - $keySet = true; - $key = (string) $row[$paramsIndexKey]; - } - - if ($paramsColumnKey === null) { - $valueSet = true; - $value = $row; - } elseif (is_array($row) && array_key_exists($paramsColumnKey, $row)) { - $valueSet = true; - $value = $row[$paramsColumnKey]; - } - - if ($valueSet) { - if ($keySet) { - $resultArray[$key] = $value; - } else { - $resultArray[] = $value; - } - } - - } - - return $resultArray; - } - -} diff --git a/vendor/drush/drush/includes/backend.inc b/vendor/drush/drush/includes/backend.inc index 11619d613c14d9b37d93dbdf7df558fb3d862bac..93ce984c52a5dae7a665f4e1cbd2b3288c614b19 100644 --- a/vendor/drush/drush/includes/backend.inc +++ b/vendor/drush/drush/includes/backend.inc @@ -57,7 +57,10 @@ * drush_backend_get_result(). */ +use Drush\Drush; use Drush\Log\LogLevel; +use Drush\Preflight\PreflightArgs; +use Drush\Runtime\Runtime; /** * Identify the JSON encoded output from a command. @@ -84,7 +87,7 @@ * used to generate the output for the current command. */ function drush_backend_set_result($value) { - if (drush_get_context('DRUSH_BACKEND')) { + if (\Drush\Drush::backend()) { drush_set_context('BACKEND_RESULT', $value); } } @@ -107,7 +110,7 @@ function drush_backend_set_result($value) { * command. Zero means "no error". * - log: The log item contains an array of log messages from * the command execution ordered chronologically. Each log - * entery is an associative array. A log entry contains + * entry is an associative array. A log entry contains * following items: * o type: The type of log entry, such as 'notice' or 'warning' * o message: The log message @@ -135,18 +138,12 @@ function drush_backend_get_result() { * encoded log records, context information, etc. */ function drush_backend_output() { - $data = array(); + $data = []; - if (drush_get_context('DRUSH_PIPE')) { - $pipe = drush_get_context('DRUSH_PIPE_BUFFER'); - $data['output'] = $pipe; // print_r($pipe, TRUE); - } - else { - // Strip out backend commands. - $packet_regex = strtr(sprintf(DRUSH_BACKEND_PACKET_PATTERN, "([^\0]*)"), array("\0" => "\\0")); - $packet_regex = str_replace("\n", "", $packet_regex); - $data['output'] = preg_replace("/$packet_regex/s", '', drush_backend_output_collect(NULL)); - } + // Strip out backend commands. + $packet_regex = strtr(sprintf(DRUSH_BACKEND_PACKET_PATTERN, "([^\0]*)"), ["\0" => "\\0"]); + $packet_regex = str_replace("\n", "", $packet_regex); + $data['output'] = preg_replace("/$packet_regex/s", '', drush_backend_output_collect(NULL)); if (drush_get_context('DRUSH_QUIET', FALSE)) { ob_end_clean(); @@ -157,17 +154,15 @@ function drush_backend_output() { $data['object'] = $result_object; } - $error = drush_get_error(); - $data['error_status'] = ($error) ? $error : DRUSH_SUCCESS; - - $data['log'] = drush_get_log(); // Append logging information + $data['error_status'] = Runtime::exitCode(); + $data['log'] = Drush::logger()->getLogs(); // Append logging information // The error log is a more specific version of the log, and may be used by calling // scripts to check for specific errors that have occurred. - $data['error_log'] = drush_get_error_log(); + $data['error_log'] = Drush::logger()->getErrorLogs(); // If there is a @self record, then include it in the result $self_record = drush_sitealias_get_record('@self'); if (!empty($self_record)) { - $site_context = drush_get_context('site', array()); + $site_context = drush_get_context('site', []); unset($site_context['config-file']); unset($site_context['context-path']); unset($self_record['loaded-config']); @@ -197,7 +192,7 @@ function drush_backend_output_collect($string) { * Output buffer functions that discards all output but backend packets. */ function drush_backend_output_discard($string) { - $packet_regex = strtr(sprintf(DRUSH_BACKEND_PACKET_PATTERN, "([^\0]*)"), array("\0" => "\\0")); + $packet_regex = strtr(sprintf(DRUSH_BACKEND_PACKET_PATTERN, "([^\0]*)"), ["\0" => "\\0"]); $packet_regex = str_replace("\n", "", $packet_regex); if (preg_match_all("/$packet_regex/s", $string, $matches)) { return implode('', $matches[0]); @@ -216,8 +211,11 @@ function drush_backend_output_discard($string) { * A boolean indicating whether the command was output. */ function drush_backend_packet($packet, $data) { - if (drush_get_context('DRUSH_BACKEND')) { + if (\Drush\Drush::backend()) { $data['packet'] = $packet; + // Ensure $data['_style'] isn't encoded, to avoid errors during decode and + // subsequent logging. + unset($data['_style']); $data = json_encode($data); // We use 'fwrite' instead of 'drush_print' here because // this backend packet is out-of-band data. @@ -242,7 +240,7 @@ function drush_backend_packet($packet, $data) { * An associative array containing the data from the external command, or the string parameter if it * could not be parsed successfully. */ -function drush_backend_parse_output($string, $backend_options = array(), $outputted = FALSE) { +function drush_backend_parse_output($string, $backend_options = [], $outputted = FALSE) { $regex = sprintf(DRUSH_BACKEND_OUTPUT_DELIMITER, '(.*)'); preg_match("/$regex/s", $string, $match); @@ -285,7 +283,7 @@ function _drush_backend_integrate($data, $backend_options, $outputted) { // Drush (version 4.x) that does not send backend packets, then we will // not have processed the log entries yet, and must print them here. $received_packets = drush_get_context('DRUSH_RECEIVED_BACKEND_PACKETS', FALSE); - if (is_array($data['log']) && $backend_options['log'] && (!$received_packets)) { + if (is_array($data['log']) && !empty($backend_options['log']) && (!$received_packets)) { foreach($data['log'] as $log) { $message = is_array($log['message']) ? implode("\n", $log['message']) : $log['message']; if (isset($backend_options['#output-label'])) { @@ -303,9 +301,9 @@ function _drush_backend_integrate($data, $backend_options, $outputted) { // If the output has already been printed, then we do not need to show it again on a failure. if (!$outputted) { if (drush_cmp_error('DRUSH_APPLICATION_ERROR') && !empty($data['output'])) { - drush_set_error("DRUSH_APPLICATION_ERROR", dt("Output from failed command :\n !output", array('!output' => $data['output']))); + drush_set_error("DRUSH_APPLICATION_ERROR", dt("Output from failed command :\n !output", ['!output' => $data['output']])); } - elseif ($backend_options['output']) { + elseif (!empty($backend_options['output'])) { _drush_backend_print_output($data['output'], $backend_options); } } @@ -341,13 +339,13 @@ function _drush_backend_integrate_log($entry) { * called, the output of the command, and the error code of the command. */ function _drush_backend_proc_open($cmds, $process_limit, $context = NULL) { - $descriptorspec = array( - 0 => array("pipe", "r"), // stdin is a pipe that the child will read from - 1 => array("pipe", "w"), // stdout is a pipe that the child will write to - ); + $descriptorspec = [ + 0 => ["pipe", "r"], // stdin is a pipe that the child will read from + 1 => ["pipe", "w"], // stdout is a pipe that the child will write to + ]; - $open_processes = array(); - $bucket = array(); + $open_processes = []; + $bucket = []; $process_limit = max($process_limit, 1); $is_windows = drush_is_windows(); // Loop through processes until they all close, having a nap as needed. @@ -357,7 +355,8 @@ function _drush_backend_proc_open($cmds, $process_limit, $context = NULL) { if (count($cmds) && (count($open_processes) < $process_limit)) { // Pop the site and command (key / value) from the cmds array end($cmds); - list($site, $cmd) = each($cmds); + $cmd = current($cmds); + $site = key($cmds); unset($cmds[$site]); if (is_array($cmd)) { @@ -367,16 +366,16 @@ function _drush_backend_proc_open($cmds, $process_limit, $context = NULL) { } else { $c = $cmd; - $post_options = array(); - $backend_options = array(); + $post_options = []; + $backend_options = []; } - $backend_options += array( + $backend_options += [ '#output-label' => '', '#process-read-size' => 4096, - ); - $process = array(); + ]; + $process = []; drush_log($backend_options['#output-label'] . $c); - $process['process'] = proc_open($c, $descriptorspec, $process['pipes'], null, null, array('context' => $context)); + $process['process'] = proc_open($c, $descriptorspec, $process['pipes'], null, null, ['context' => $context]); if (is_resource($process['process'])) { if ($post_options) { fwrite($process['pipes'][0], json_encode($post_options)); // pass the data array in a JSON encoded string @@ -409,9 +408,9 @@ function _drush_backend_proc_open($cmds, $process_limit, $context = NULL) { // streams returned by proc_open. if (!$is_windows) { $ss_result = 0; - $read_streams = array(); - $write_streams = array(); - $except_streams = array(); + $read_streams = []; + $write_streams = []; + $except_streams = []; foreach ($open_processes as $site => &$current_process) { if (isset($current_process['pipes'][1])) { $read_streams[] = $current_process['pipes'][1]; @@ -534,25 +533,27 @@ function _drush_backend_print_output($output_string, $backend_options) { */ function drush_backend_parse_packets(&$string, &$remainder, $backend_options) { $remainder = ''; - $packet_regex = strtr(sprintf(DRUSH_BACKEND_PACKET_PATTERN, "([^\0]*)"), array("\0" => "\\0")); + $packet_regex = strtr(sprintf(DRUSH_BACKEND_PACKET_PATTERN, "([^\0]*)"), ["\0" => "\\0"]); $packet_regex = str_replace("\n", "", $packet_regex); if (preg_match_all("/$packet_regex/s", $string, $match, PREG_PATTERN_ORDER)) { drush_set_context('DRUSH_RECEIVED_BACKEND_PACKETS', TRUE); foreach ($match[1] as $packet_data) { $entry = (array) json_decode($packet_data); + // Ensure $entry['_style'] isn't set to avoid type mismatch errors. + unset($entry['_style']); if (is_array($entry) && isset($entry['packet'])) { $function = 'drush_backend_packet_' . $entry['packet']; if (function_exists($function)) { $function($entry, $backend_options); } else { - drush_log(dt("Unknown backend packet @packet", array('@packet' => $entry['packet'])), LogLevel::NOTICE); + drush_log(dt("Unknown backend packet @packet", ['@packet' => $entry['packet']]), LogLevel::INFO); } } else { drush_log(dt("Malformed backend packet"), LogLevel::ERROR); - drush_log(dt("Bad packet: @packet", array('@packet' => print_r($entry, TRUE))), LogLevel::DEBUG); - drush_log(dt("String is: @str", array('@str' => $packet_data), LogLevel::DEBUG)); + drush_log(dt("Bad packet: @packet", ['@packet' => print_r($entry, TRUE)]), LogLevel::DEBUG); + drush_log(dt("String is: @str", ['@str' => $packet_data]), LogLevel::DEBUG); } } $string = preg_replace("/$packet_regex/s", '', $string); @@ -605,14 +606,14 @@ function _drush_backend_adjust_options($site_record, $command, $command_options, $backend_options['output'] = FALSE; } $has_site_specification = array_key_exists('root', $site_record) || array_key_exists('uri', $site_record); - $result = $backend_options + array( + $result = $backend_options + [ 'method' => 'GET', 'output' => TRUE, 'log' => TRUE, 'integrate' => TRUE, 'backend' => TRUE, 'dispatch-using-alias' => !$has_site_specification, - ); + ]; // Convert '#integrate' et. al. into backend options foreach ($command_options as $key => $value) { if (substr($key,0,1) === '#') { @@ -625,10 +626,11 @@ function _drush_backend_adjust_options($site_record, $command, $command_options, /** * Execute a new local or remote command in a new process. * - * n.b. Prefer drush_invoke_process() to this function. + * @deprecated as of Drush 9.4.0 and will be removed in Drush 10. Instead, use + * Drush::drush(). * * @param invocations - * An array of command records to exacute. Each record should contain: + * An array of command records to execute. Each record should contain: * 'site': * An array containing information used to generate the command. * 'remote-host' @@ -707,11 +709,11 @@ function _drush_backend_adjust_options($site_record, $command, $command_options, * If the command could not be completed successfully, FALSE. * If the command was completed, this will return an associative array containing the data from drush_backend_output(). */ -function drush_backend_invoke_concurrent($invocations, $common_options = array(), $common_backend_options = array(), $default_command = NULL, $default_site = NULL, $context = NULL) { +function drush_backend_invoke_concurrent($invocations, $common_options = [], $common_backend_options = [], $default_command = NULL, $default_site = NULL, $context = NULL) { $index = 0; // Slice and dice our options in preparation to build a command string - $invocation_options = array(); + $invocation_options = []; foreach ($invocations as $invocation) { $site_record = isset($invocation['site']) ? $invocation['site'] : $default_site; // NULL is a synonym to '@self', although the latter is preferred. @@ -725,33 +727,48 @@ function drush_backend_invoke_concurrent($invocations, $common_options = array() $site_record = drush_sitealias_get_record($site_record); } $command = isset($invocation['command']) ? $invocation['command'] : $default_command; - $args = isset($invocation['args']) ? $invocation['args'] : array(); - $command_options = isset($invocation['options']) ? $invocation['options'] : array(); - $backend_options = isset($invocation['backend-options']) ? $invocation['backend-options'] : array(); + $args = isset($invocation['args']) ? $invocation['args'] : []; + $command_options = isset($invocation['options']) ? $invocation['options'] : []; + $backend_options = isset($invocation['backend-options']) ? $invocation['backend-options'] : []; // If $backend_options is passed in as a bool, interpret that as the value for 'integrate' if (!is_array($common_backend_options)) { $integrate = (bool)$common_backend_options; - $common_backend_options = array('integrate' => $integrate); + $common_backend_options = ['integrate' => $integrate]; } $command_options += $common_options; $backend_options += $common_backend_options; $backend_options = _drush_backend_adjust_options($site_record, $command, $command_options, $backend_options); - $backend_options += array( + $backend_options += [ 'drush-script' => NULL, - ); + ]; // Insure that contexts such as DRUSH_SIMULATE and NO_COLOR are included. $command_options += _drush_backend_get_global_contexts($site_record); // Add in command-specific options as well - $command_options += drush_command_get_command_specific_options($site_record, $command); + // $command_options += drush_command_get_command_specific_options($site_record, $command); + + $is_remote = array_key_exists('remote-host', $site_record); + + // Add in preflight option contexts (--include et. al) + $preflightContextOptions = \Drush\Drush::config()->get(PreflightArgs::DRUSH_RUNTIME_CONTEXT_NAMESPACE, []); + $preflightContextOptions['local'] = \Drush\Drush::config()->get('runtime.local', false); + // If the command is local, also include the paths context. + if (!$is_remote) { + $preflightContextOptions += \Drush\Drush::config()->get(PreflightArgs::DRUSH_CONFIG_PATH_NAMESPACE, []); + } + foreach ($preflightContextOptions as $key => $value) { + if ($value) { + $command_options[$key] = $value; + } + } // If the caller has requested it, don't pull the options from the alias // into the command line, but use the alias name for dispatching. if (!empty($backend_options['dispatch-using-alias']) && isset($site_record['#name'])) { - list($post_options, $commandline_options, $drush_global_options) = _drush_backend_classify_options(array(), $command_options, $backend_options); + list($post_options, $commandline_options, $drush_global_options) = _drush_backend_classify_options([], $command_options, $backend_options); $site_record_to_dispatch = '@' . ltrim($site_record['#name'], '@'); } else { @@ -761,13 +778,13 @@ function drush_backend_invoke_concurrent($invocations, $common_options = array() if (array_key_exists('backend-simulate', $backend_options)) { $drush_global_options['simulate'] = TRUE; } - $site_record += array('path-aliases' => array(), '#env-vars' => array()); - $site_record['path-aliases'] += array( + $site_record += ['path-aliases' => [], '#env-vars' => []]; + $site_record['path-aliases'] += [ '%drush-script' => $backend_options['drush-script'], - ); + ]; $site = (array_key_exists('#name', $site_record) && !array_key_exists($site_record['#name'], $invocation_options)) ? $site_record['#name'] : $index++; - $invocation_options[$site] = array( + $invocation_options[$site] = [ 'site-record' => $site_record, 'site-record-to-dispatch' => $site_record_to_dispatch, 'command' => $command, @@ -777,7 +794,7 @@ function drush_backend_invoke_concurrent($invocations, $common_options = array() 'commandline-options' => $commandline_options, 'command-options' => $command_options, 'backend-options' => $backend_options, - ); + ]; } // Calculate the length of the longest output label @@ -809,7 +826,7 @@ function drush_backend_invoke_concurrent($invocations, $common_options = array() // Now pad out the output labels and add the label separator. $reserve_margin = $max_name_length + strlen($label_separator); foreach ($invocation_options as $site => $item) { - $backend_options = $item['backend-options'] + array('#output-label' => ''); + $backend_options = $item['backend-options'] + ['#output-label' => '']; $invocation_options[$site]['backend-options']['#output-label'] = str_pad($backend_options['#output-label'], $max_name_length, " ") . $label_separator; if ($reserve_margin) { $invocation_options[$site]['drush-global-options']['reserve-margin'] = $reserve_margin; @@ -817,7 +834,7 @@ function drush_backend_invoke_concurrent($invocations, $common_options = array() } // Now take our prepared options and generate the command strings - $cmds = array(); + $cmds = []; foreach ($invocation_options as $site => $item) { $site_record = $item['site-record']; $site_record_to_dispatch = $item['site-record-to-dispatch']; @@ -831,27 +848,26 @@ function drush_backend_invoke_concurrent($invocations, $common_options = array() $is_remote = array_key_exists('remote-host', $site_record); $is_different_site = $is_remote || - (isset($site_record['root']) && ($site_record['root'] != drush_get_context('DRUSH_DRUPAL_ROOT'))) || - (isset($site_record['uri']) && ($site_record['uri'] != drush_get_context('DRUSH_SELECTED_URI'))); + (isset($site_record['root']) && ($site_record['root'] != Drush::bootstrapManager()->getRoot())) || + (isset($site_record['uri']) && ($site_record['uri'] != Drush::bootstrapManager()->getUri())); $os = drush_os($site_record); // If the caller did not pass in a specific path to drush, then we will // use a default value. For commands that are being executed on the same // machine, we will use DRUSH_COMMAND, which is the path to the drush.php - // that is running right now. For remote commands, we will run a wrapper - // script instead of drush.php called drush. + // that is running right now. $drush_path = $site_record['path-aliases']['%drush-script']; if (!$drush_path && !$is_remote && $is_different_site) { - $drush_path = find_wrapper_or_launcher($site_record['root']); + $drush_path = DRUSH_COMMAND; } $env_vars = $site_record['#env-vars']; $php = array_key_exists('php', $site_record) ? $site_record['php'] : (array_key_exists('php', $command_options) ? $command_options['php'] : NULL); $drush_command_path = drush_build_drush_command($drush_path, $php, $os, $is_remote, $env_vars); $cmd = _drush_backend_generate_command($site_record, $drush_command_path . " " . _drush_backend_argument_string($drush_global_options, $os) . " " . $site_record_to_dispatch . " " . $command, $args, $commandline_options, $backend_options) . ' 2>&1'; - $cmds[$site] = array( + $cmds[$site] = [ 'cmd' => $cmd, 'post-options' => $post_options, 'backend-options' => $backend_options, - ); + ]; } return _drush_backend_invoke($cmds, $common_backend_options, $context); @@ -862,7 +878,7 @@ function drush_backend_invoke_concurrent($invocations, $common_options = array() * return them in an associative array. */ function _drush_backend_get_global_contexts($site_record) { - $result = array(); + $result = []; $global_option_list = drush_get_global_options(FALSE); foreach ($global_option_list as $global_key => $global_metadata) { if (is_array($global_metadata)) { @@ -878,7 +894,7 @@ function _drush_backend_get_global_contexts($site_record) { // If the context is declared to be a 'local-context-only', // then only put it in if this is a local dispatch. if (!array_key_exists('local-context-only', $global_metadata) || !array_key_exists('remote-host', $site_record)) { - $value = drush_get_context($global_metadata['context'], array()); + $value = drush_get_context($global_metadata['context'], []); } } if (!empty($value) || ($value === '0')) { @@ -908,17 +924,17 @@ function _drush_backend_classify_options($site_record, $command_options, &$backe // in the global option list) from the commandline options and put them into the post options. // The post options will be json-encoded and sent to the command via stdin $global_option_list = drush_get_global_options(FALSE); // These should be in the command line. - $additional_global_options = array(); + $additional_global_options = []; if (array_key_exists('additional-global-options', $backend_options)) { $additional_global_options = $backend_options['additional-global-options']; $command_options += $additional_global_options; } $method_post = ((!array_key_exists('method', $backend_options)) || ($backend_options['method'] == 'POST')); - $post_options = array(); - $commandline_options = array(); - $drush_global_options = array(); - $drush_local_options = array(); - $additional_backend_options = array(); + $post_options = []; + $commandline_options = []; + $drush_global_options = []; + $drush_local_options = []; + $additional_backend_options = []; foreach ($site_record as $key => $value) { if (!in_array($key, drush_sitealias_site_selection_keys())) { if ($key[0] == '#') { @@ -972,7 +988,7 @@ function _drush_backend_classify_options($site_record, $command_options, &$backe } } } - return array($post_options, $commandline_options, $drush_global_options, $additional_backend_options); + return [$post_options, $commandline_options, $drush_global_options, $additional_backend_options]; } /** @@ -1003,15 +1019,15 @@ function _drush_backend_classify_options($site_record, $command_options, &$backe * containing one item, 'concurrent', which will contain a list of the different * backend invoke results from each concurrent command. */ -function _drush_backend_invoke($cmds, $common_backend_options = array(), $context = NULL) { - if (drush_get_context('DRUSH_SIMULATE') && !array_key_exists('override-simulated', $common_backend_options) && !array_key_exists('backend-simulate', $common_backend_options)) { +function _drush_backend_invoke($cmds, $common_backend_options = [], $context = NULL) { + if (\Drush\Drush::simulate() && !array_key_exists('override-simulated', $common_backend_options) && !array_key_exists('backend-simulate', $common_backend_options)) { foreach ($cmds as $cmd) { - drush_print(dt('Simulating backend invoke: !cmd', array('!cmd' => $cmd['cmd']))); + drush_print(dt('Simulating backend invoke: !cmd', ['!cmd' => $cmd['cmd']])); } return FALSE; } foreach ($cmds as $cmd) { - drush_log(dt('Backend invoke: !cmd', array('!cmd' => $cmd['cmd'])), 'command'); + drush_log(dt('Backend invoke: !cmd', ['!cmd' => $cmd['cmd']]), 'command'); } if (!empty($common_backend_options['interactive']) || !empty($common_backend_options['fork'])) { foreach ($cmds as $cmd) { @@ -1021,15 +1037,15 @@ function _drush_backend_invoke($cmds, $common_backend_options = array(), $contex } $result_code = drush_shell_proc_open($exec_cmd); - $ret = array('error_status' => $result_code); + $ret = ['error_status' => $result_code]; } } else { $process_limit = drush_get_option_override($common_backend_options, 'concurrency', 1); $procs = _drush_backend_proc_open($cmds, $process_limit, $context); - $procs = is_array($procs) ? $procs : array($procs); + $procs = is_array($procs) ? $procs : [$procs]; - $ret = array(); + $ret = []; foreach ($procs as $site => $proc) { if (($proc['code'] == DRUSH_APPLICATION_ERROR) && isset($common_backend_options['integrate'])) { drush_set_error('DRUSH_APPLICATION_ERROR', dt("The external command could not be executed due to an application error.")); @@ -1043,14 +1059,14 @@ function _drush_backend_invoke($cmds, $common_backend_options = array(), $contex $ret = $values; } elseif (!array_key_exists('concurrent', $ret)) { - $ret = array('concurrent' => array($ret, $values)); + $ret = ['concurrent' => [$ret, $values]]; } else { $ret['concurrent'][] = $values; } } else { - $ret = drush_set_error('DRUSH_FRAMEWORK_ERROR', dt("The command could not be executed successfully (returned: !return, code: !code)", array("!return" => $proc['output'], "!code" => $proc['code']))); + $ret = drush_set_error('DRUSH_FRAMEWORK_ERROR', dt("The command could not be executed successfully (returned: !return, code: !code)", ["!return" => $proc['output'], "!code" => $proc['code']])); } } } @@ -1064,22 +1080,22 @@ function _drush_backend_invoke($cmds, $common_backend_options = array(), $contex */ function drush_backend_generate_sitealias($backend_options) { // Ensure default values. - $backend_options += array( + $backend_options += [ 'remote-host' => NULL, 'remote-user' => NULL, 'ssh-options' => NULL, 'drush-script' => NULL, 'env-vars' => NULL - ); - return array( + ]; + return [ 'remote-host' => $backend_options['remote-host'], 'remote-user' => $backend_options['remote-user'], 'ssh-options' => $backend_options['ssh-options'], '#env-vars' => $backend_options['env-vars'], - 'path-aliases' => array( + 'path-aliases' => [ '%drush-script' => $backend_options['drush-script'], - ), - ); + ], + ]; } /** @@ -1121,20 +1137,20 @@ function drush_backend_generate_sitealias($backend_options) { * @return * A text string representing a fully escaped command. */ -function _drush_backend_generate_command($site_record, $command, $args = array(), $command_options = array(), $backend_options = array()) { - $site_record += array( +function _drush_backend_generate_command($site_record, $command, $args = [], $command_options = [], $backend_options = []) { + $site_record += [ 'remote-host' => NULL, 'remote-user' => NULL, 'ssh-options' => NULL, - 'path-aliases' => array(), - ); - $backend_options += array( + 'path-aliases' => [], + ]; + $backend_options += [ '#tty' => FALSE, - ); + ]; $hostname = $site_record['remote-host']; $username = $site_record['remote-user']; - $ssh_options = $site_record['ssh-options']; + $ssh_options = $site_record['ssh-options']; // TODO: update this (maybe make $site_record an AliasRecord) $os = drush_os($site_record); if (drush_is_local_host($hostname)) { @@ -1158,17 +1174,17 @@ function _drush_backend_generate_command($site_record, $command, $args = array() } $command = implode(' ', array_filter($cmd, 'strlen')); if (isset($hostname)) { - $username = (isset($username)) ? drush_escapeshellarg($username, "LOCAL") . "@" : ''; - $ssh_options = $site_record['ssh-options']; - $ssh_options = (isset($ssh_options)) ? $ssh_options : drush_get_option('ssh-options', "-o PasswordAuthentication=no"); + $username = (isset($username)) ? drush_escapeshellarg($username) . "@" : ''; + $ssh_options = $site_record['ssh-options']; // TODO: update + $ssh_options = (isset($ssh_options)) ? $ssh_options : \Drush\Drush::config()->get('ssh.options', "-o PasswordAuthentication=no"); $ssh_cmd[] = "ssh"; $ssh_cmd[] = $ssh_options; if ($backend_options['#tty']) { $ssh_cmd[] = '-t'; } - $ssh_cmd[] = $username . drush_escapeshellarg($hostname, "LOCAL"); - $ssh_cmd[] = drush_escapeshellarg($command . ' 2>&1', "LOCAL"); + $ssh_cmd[] = $username . drush_escapeshellarg($hostname); + $ssh_cmd[] = drush_escapeshellarg($command . ' 2>&1'); // Remove NULLs and separate with spaces $command = implode(' ', array_filter($ssh_cmd, 'strlen')); @@ -1194,7 +1210,7 @@ function _drush_backend_generate_command($site_record, $command, $args = array() * A properly formatted and escaped set of arguments and options to append to the drush.php shell command. */ function _drush_backend_argument_string($data, $os = NULL) { - $options = array(); + $options = []; foreach ($data as $key => $value) { if (!is_array($value) && !is_object($value) && isset($value)) { @@ -1266,7 +1282,7 @@ function _drush_backend_get_stdin() { // So, redirecting input is okay, it is just the proc_open that is a problem. if (drush_is_windows()) { // Note that stream_select uses reference parameters, so we need variables (can't pass a constant NULL) - $read = array($fp); + $read = [$fp]; $write = NULL; $except = NULL; // Question: might we need to wait a bit for STDIN to be ready, diff --git a/vendor/drush/drush/includes/batch.inc b/vendor/drush/drush/includes/batch.inc index 71fedb330d2956983a234b20eb46ac5ff27aba0f..bcdccd6309aa976baca8f88416bbe781569132cd 100644 --- a/vendor/drush/drush/includes/batch.inc +++ b/vendor/drush/drush/includes/batch.inc @@ -24,6 +24,7 @@ * implementations. */ +use Drush\Drush; use Drush\Log\LogLevel; /** @@ -38,10 +39,10 @@ class DrushBatchContext extends ArrayObject { function offsetSet($name, $value) { if ($name == 'message') { - drush_log(strip_tags($value), LogLevel::OK); + Drush::logger()->notice(strip_tags($value)); } elseif ($name == 'error_message') { - drush_set_error('DRUSH_BATCH_ERROR', strip_tags($value)); + Drush::logger()->error(strip_tags($value)); } parent::offsetSet($name, $value); } @@ -56,7 +57,7 @@ function offsetSet($name, $value) { * the current batch, while keeping track of available memory. * * The batch system will process as many batch sets as possible until - * the entire batch has been completed or half of the available memory + * the entire batch has been completed or 60% of the available memory * has been used. * * This function is a drop in replacement for the existing batch_process() @@ -64,7 +65,7 @@ function offsetSet($name, $value) { * * @param string $command * (optional) The command to call for the back end process. By default this will be - * the 'batch-process' command, but some commands such as updatedb will + * the 'batch-process' command, but some commands will * have special initialization requirements, and will need to define and * use their own command. * @param array $args @@ -72,12 +73,10 @@ function offsetSet($name, $value) { * @param array $options * (optional) */ -function drush_backend_batch_process($command = 'batch-process', $args = array(), $options = array()) { +function drush_backend_batch_process($command = 'batch-process', $args = [], $options = []) { // Command line options to pass to the command. - $options['u'] = drush_user_get_class()->getCurrentUserAsSingle()->id(); - - drush_include_engine('drupal', 'batch'); - _drush_backend_batch_process($command, $args, $options); + $options['u'] = \Drupal::currentUser()->id(); + return _drush_backend_batch_process($command, $args, $options); } /** @@ -91,9 +90,292 @@ function drush_backend_batch_process($command = 'batch-process', $args = array() * * @param int $id * The batch ID of the batch being processed. + * + * @return bool|array + * A results array. */ function drush_batch_command($id) { include_once(DRUSH_DRUPAL_CORE . '/includes/batch.inc'); - drush_include_engine('drupal', 'batch'); - _drush_batch_command($id); + return _drush_batch_command($id); +} + +/** + * Main loop for the Drush batch API. + * + * Saves a record of the batch into the database, and progressively call $command to + * process the operations. + * + * @param command + * The command to call to process the batch. + * + * @return array + * A return array. The callers only care about the finished marker and an #abort on an operation. + * + */ +function _drush_backend_batch_process($command = 'batch-process', $args, $options) { + $result = NULL; + + $batch =& batch_get(); + + if (isset($batch)) { + $process_info = [ + 'current_set' => 0, + ]; + $batch += $process_info; + + // The batch is now completely built. Allow other modules to make changes + // to the batch so that it is easier to reuse batch processes in other + // environments. + \Drupal::moduleHandler()->alter('batch', $batch); + + // Assign an arbitrary id: don't rely on a serial column in the 'batch' + // table, since non-progressive batches skip database storage completely. + $batch['id'] = db_next_id(); + $args[] = $batch['id']; + + $batch['progressive'] = TRUE; + + // Move operations to a job queue. Non-progressive batches will use a + // memory-based queue. + foreach ($batch['sets'] as $key => $batch_set) { + _batch_populate_queue($batch, $key); + } + + // Store the batch. + /** @var \Drupal\Core\Batch\BatchStorage $batch_storage */ + $batch_storage = \Drupal::service('batch.storage'); + $batch_storage->create($batch); + $finished = FALSE; + + while (!$finished) { + $process = Drush::drush(Drush::aliasManager()->getSelf(), $command, $args); + // Suppress printing stdout since a JSON array is returned to us here. + $process->run($process->showRealtime()->hideStdout()); + $result = $process->getOutputAsJson(); + $finished = !$process->isSuccessful() || (isset($result['drush_batch_process_finished']) && $result['drush_batch_process_finished'] === TRUE); + } + } + + return $result; +} + + +/** + * Initialize the batch command and call the worker function. + * + * Loads the batch record from the database and sets up the requirements + * for the worker, such as registering the shutdown function. + * + * @param id + * The batch id of the batch being processed. + * + * @return bool|array + * A results array. + */ +function _drush_batch_command($id) { + $batch =& batch_get(); + + $data = db_query("SELECT batch FROM {batch} WHERE bid = :bid", [ + ':bid' => $id + ])->fetchField(); + + if ($data) { + $batch = unserialize($data); + } + else { + return FALSE; + } + + if (!isset($batch['running'])) { + $batch['running'] = TRUE; + } + + // Register database update for end of processing. + register_shutdown_function('_drush_batch_shutdown'); + + if (_drush_batch_worker()) { + return _drush_batch_finished(); + } + else { + return ['drush_batch_process_finished' => FALSE]; + } +} + + +/** + * Process batch operations + * + * Using the current $batch process each of the operations until the batch + * has been completed or 60% of the available memory for the process has been + * reached. + */ +function _drush_batch_worker() { + $batch =& batch_get(); + $current_set =& _batch_current_set(); + $set_changed = TRUE; + + if (empty($current_set['start'])) { + $current_set['start'] = microtime(TRUE); + } + $queue = _batch_queue($current_set); + while (!$current_set['success']) { + // If this is the first time we iterate this batch set in the current + // request, we check if it requires an additional file for functions + // definitions. + if ($set_changed && isset($current_set['file']) && is_file($current_set['file'])) { + include_once DRUPAL_ROOT . '/' . $current_set['file']; + } + + $task_message = ''; + // Assume a single pass operation and set the completion level to 1 by + // default. + $finished = 1; + + if ($item = $queue->claimItem()) { + list($function, $args) = $item->data; + + // Build the 'context' array and execute the function call. + $batch_context = [ + 'sandbox' => &$current_set['sandbox'], + 'results' => &$current_set['results'], + 'finished' => &$finished, + 'message' => &$task_message, + ]; + // Magic wrap to catch changes to 'message' key. + $batch_context = new DrushBatchContext($batch_context); + + // Tolerate recoverable errors. + // See https://github.com/drush-ops/drush/issues/1930 + $halt_on_error = \Drush\Drush::config()->get('runtime.php.halt-on-error', TRUE); + \Drush\Drush::config()->set('runtime.php.halt-on-error', FALSE); + $message = call_user_func_array($function, array_merge($args, [&$batch_context])); + if (!empty($message)) { + Drush::logger()->notice($message); + } + \Drush\Drush::config()->set('runtime.php.halt-on-error', $halt_on_error); + + $finished = $batch_context['finished']; + if ($finished >= 1) { + // Make sure this step is not counted twice when computing $current. + $finished = 0; + // Remove the processed operation and clear the sandbox. + $queue->deleteItem($item); + $current_set['count']--; + $current_set['sandbox'] = []; + } + } + + // When all operations in the current batch set are completed, browse + // through the remaining sets, marking them 'successfully processed' + // along the way, until we find a set that contains operations. + // _batch_next_set() executes form submit handlers stored in 'control' + // sets (see form_execute_handlers()), which can in turn add new sets to + // the batch. + $set_changed = FALSE; + $old_set = $current_set; + while (empty($current_set['count']) && ($current_set['success'] = TRUE) && _batch_next_set()) { + $current_set = &_batch_current_set(); + $current_set['start'] = microtime(TRUE); + $set_changed = TRUE; + } + + // At this point, either $current_set contains operations that need to be + // processed or all sets have been completed. + $queue = _batch_queue($current_set); + + // If we are in progressive mode, break processing after 60% of memory usage + // is reached. + if (drush_memory_limit() > 0 && (memory_get_usage() * 1.6) >= drush_memory_limit()) { + Drush::logger()->notice(dt("Batch process has consumed in excess of 60% of available memory. Starting new thread")); + // Record elapsed wall clock time. + $current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2); + break; + } + } + + // Reporting 100% progress will cause the whole batch to be considered + // processed. If processing was paused right after moving to a new set, + // we have to use the info from the new (unprocessed) set. + if ($set_changed && isset($current_set['queue'])) { + // Processing will continue with a fresh batch set. + $remaining = $current_set['count']; + $total = $current_set['total']; + $progress_message = $current_set['init_message']; + $task_message = ''; + } + else { + // Processing will continue with the current batch set. + $remaining = $old_set['count']; + $total = $old_set['total']; + $progress_message = $old_set['progress_message']; + } + + $current = $total - $remaining + $finished; + $percentage = _batch_api_percentage($total, $current); + return ($percentage == 100); +} + +/** + * End the batch processing: + * Call the 'finished' callbacks to allow custom handling of results, + * and resolve page redirection. + * + * @return array + */ +function _drush_batch_finished() { + $results = []; + + $batch = &batch_get(); + + // Execute the 'finished' callbacks for each batch set, if defined. + foreach ($batch['sets'] as $id => $batch_set) { + if (isset($batch_set['finished'])) { + // Check if the set requires an additional file for function definitions. + if (isset($batch_set['file']) && is_file($batch_set['file'])) { + include_once DRUPAL_ROOT . '/' . $batch_set['file']; + } + if (is_callable($batch_set['finished'])) { + $queue = _batch_queue($batch_set); + $operations = $queue->getAllItems(); + $elapsed = $batch_set['elapsed'] / 1000; + $elapsed = \Drupal::service('date.formatter')->formatInterval($elapsed); + call_user_func_array($batch_set['finished'], [$batch_set['success'], $batch_set['results'], $operations, $elapsed]); + $results[$id] = $batch_set['results']; + } + } + } + + // Clean up the batch table. + \Drupal::service('batch.storage')->delete($batch['id']); + + foreach ($batch['sets'] as $batch_set) { + if ($queue = _batch_queue($batch_set)) { + $queue->deleteQueue(); + } + } + + $batch = NULL; + $results['drush_batch_process_finished'] = TRUE; + + return $results; +} + +/** + * Shutdown function: store the batch data for next request, + * or clear the table if the batch is finished. + */ +function _drush_batch_shutdown() { + if ($batch = batch_get()) { + if (drush_drupal_major_version() >= 8) { + /** @var \Drupal\Core\Batch\BatchStorage $batch_storage */ + $batch_storage = \Drupal::service('batch.storage'); + $batch_storage->update($batch); + } + else { + db_update('batch') + ->fields(['batch' => serialize($batch)]) + ->condition('bid', $batch['id']) + ->execute(); + } + } } diff --git a/vendor/drush/drush/includes/bootstrap.inc b/vendor/drush/drush/includes/bootstrap.inc index 9b08db8acbe300f1721ffe3481f40862b658a331..aba21f4e53c3ed2165ff6b3599304a7953d170d6 100644 --- a/vendor/drush/drush/includes/bootstrap.inc +++ b/vendor/drush/drush/includes/bootstrap.inc @@ -1,5 +1,6 @@ <?php +use Drush\Drush; use Drush\Log\LogLevel; /** @@ -8,7 +9,7 @@ * Commands that only preflight, but do not bootstrap, should use * a bootstrap level of DRUSH_BOOTSTRAP_NONE. */ -define('DRUSH_BOOTSTRAP_NONE', -1); +define('DRUSH_BOOTSTRAP_NONE', 0); /** * Use drush_bootstrap_max instead of drush_bootstrap_to_phase @@ -27,12 +28,6 @@ */ define('DRUSH_BOOTSTRAP_DRUSH', 0); -// TODO: Move all of the constants below to a Drupal-specific file. -// We can't do this until commands are declaring which CMS they work -// with, because right now, commands that do not declare a 'bootstrap' -// level default to DRUSH_BOOTSTRAP_DRUPAL_LOGIN, so we need this constant, -// at least, available in non-Drupal contexts. - /** * Set up and test for a valid drupal root, either through the -r/--root options, * or evaluated based on the current working directory. @@ -91,183 +86,16 @@ */ define('DRUSH_BOOTSTRAP_DRUPAL_FULL', 5); -/** - * Log in to the initialiased Drupal site. - * - * This is the default bootstrap phase all commands will try to reach, - * unless otherwise specified. - * - * This bootstrap phase is used after the site has been - * fully bootstrapped. - * - * This phase will log you in to the drupal site with the username - * or user ID specified by the --user/ -u option. - * - * Use this bootstrap phase for your command if you need to have access - * to information for a specific user, such as listing nodes that might - * be different based on who is logged in. - */ -define('DRUSH_BOOTSTRAP_DRUPAL_LOGIN', 6); - -/** - * Return the list of bootstrap objects that are available for - * initializing a CMS with Drush. We insure that any given candidate - * class is instantiated only once. - * - * @return \Drush\Boot\Boot[] - */ -function drush_get_bootstrap_candidates() { - $candidate_classes = drush_get_bootstrap_candidate_classnames(); - - $cache =& drush_get_context('DRUSH_BOOTSTRAP_CANDIDATE_OBJECTS'); - $result = array(); - foreach($candidate_classes as $candidate_class) { - if (array_key_exists($candidate_class, $cache)) { - $result[$candidate_class] = $cache[$candidate_class]; - } - else { - $result[$candidate_class] = new $candidate_class; - } - } - - $cache = $result; - return $result; -} - -/** - * Find the list of bootstrap classnames available for initializing a - * CMS with Drush. - * - * @return array - */ -function drush_get_bootstrap_candidate_classnames() { - // Give all commandfiles a chance to return candidates. They should - // return STRINGS with the class name of the bootstrap object they provide. - $candidates = drush_command_invoke_all('bootstrap_candidates'); - // If a bootstrap class was specified on the command line, consider it first. - $bootstrap_class = drush_get_option('bootstrap_class', FALSE); - if ($bootstrap_class) { - array_unshift($candidates, $bootstrap_class); - } - // Add candidate bootstrap classes for Drupal - foreach (array('8', '7', '6') as $version) { - $drupal_bootstrap_class = 'Drush\Boot\DrupalBoot' . $version; - $candidates[] = $drupal_bootstrap_class; - } - // Always consider our default bootstrap class last. - $candidates[] = 'Drush\Boot\EmptyBoot'; - - return $candidates; -} - -/** - * Look up the best bootstrap class for the given location - * from the set of available candidates. - */ -function drush_bootstrap_class_for_root($path) { - drush_load_bootstrap_commandfile_at_path($path); - $candidates = drush_get_bootstrap_candidates(); - foreach ($candidates as $candidate) { - if ($candidate->valid_root($path)) { - return $candidate; - } - } - return NULL; -} - -/** - * Check to see if there is a bootstrap class available - * at the specified location; if there is, load it. - */ -function drush_load_bootstrap_commandfile_at_path($path) { - static $paths = array(); - - if (!empty($path) && (!array_key_exists($path, $paths))) { - $paths[$path] = TRUE; - // Check to see if we have any bootstrap classes in this location. - $bootstrap_class_dir = $path . '/drush/bootstrap'; - if (is_dir($bootstrap_class_dir)) { - _drush_add_commandfiles(array($bootstrap_class_dir), DRUSH_BOOTSTRAP_NONE); - } - } -} - -/** - * Select the bootstrap class to use. If this is called multiple - * times, the bootstrap class returned might change on subsequent - * calls, if the root directory changes. Once the bootstrap object - * starts changing the state of the system, however, it will - * be 'latched', and further calls to drush_select_bootstrap_class() - * will always return the same object. - */ -function drush_select_bootstrap_class() { - $root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - - // Once we have selected a Drupal root, we will reduce our bootstrap - // candidates down to just the one used to select this site root. - $bootstrap = drush_bootstrap_class_for_root($root); - // If we have not found a bootstrap class by this point, - // then take the last one and use it. This should be our - // default bootstrap class. The default bootstrap class - // should pass through all calls without doing anything that - // changes state in a CMS-specific way. - if ($bootstrap == NULL) { - $candidates = drush_get_bootstrap_candidates(); - $bootstrap = array_pop($candidates); - } - - return $bootstrap; -} - -/** - * Don't allow the bootstrap object to change once we start bootstrapping - */ -function drush_latch_bootstrap_object($bootstrap) { - drush_set_context('DRUSH_BOOTSTRAP_OBJECT', $bootstrap); -} - -/** - * Get the appropriate bootstrap object. We'll search for a new - * bootstrap object every time someone asks for one until we start - * bootstrapping; then we'll returned the same cached one every time. - * - * @return \Drush\Boot\Boot - */ -function drush_get_bootstrap_object() { - $bootstrap = drush_get_context('DRUSH_BOOTSTRAP_OBJECT', FALSE); - if (!$bootstrap) { - $bootstrap = drush_select_bootstrap_class(); - } - return $bootstrap; -} - -/** - * Find the URI that has been selected by the cwd - * if it was not previously set via the --uri / -l option - */ -function _drush_bootstrap_selected_uri() { - $uri = drush_get_context('DRUSH_SELECTED_URI'); - if (empty($uri)) { - $site_path = drush_site_path(); - $elements = explode('/', $site_path); - $current = array_pop($elements); - if (!$current) { - $current = 'default'; - } - $uri = 'http://'. $current; - $uri = drush_set_context('DRUSH_SELECTED_URI', $uri); - drush_sitealias_create_self_alias(); - } - - return $uri; -} /** * Helper function to store any context settings that are being validated. + * + * @deprecated + * No longer used in Drush core. */ function drush_bootstrap_value($context, $value = null) { - $values =& drush_get_context('DRUSH_BOOTSTRAP_VALUES', array()); + $values =& drush_get_context('DRUSH_BOOTSTRAP_VALUES', []); if (isset($value)) { $values[$context] = $value; @@ -280,271 +108,12 @@ function drush_bootstrap_value($context, $value = null) { return null; } -/** - * Returns an array that determines what bootstrap phases - * are necessary to bootstrap the CMS. - * - * @param bool $function_names - * (optional) If TRUE, return an array of method names index by their - * corresponding phase values. Otherwise return an array of phase values. - * - * @return array - * - * @see \Drush\Boot\Boot::bootstrap_phases() - */ -function _drush_bootstrap_phases($function_names = FALSE) { - $result = array(); - - if ($bootstrap = drush_get_bootstrap_object()) { - $result = $bootstrap->bootstrap_phases(); - if (!$function_names) { - $result = array_keys($result); - } - } - return $result; -} - -/** - * Bootstrap Drush to the desired phase. - * - * This function will sequentially bootstrap each - * lower phase up to the phase that has been requested. - * - * @param int $phase - * The bootstrap phase to bootstrap to. - * @param int $phase_max - * (optional) The maximum level to boot to. This does not have a use in this - * function itself but can be useful for other code called from within this - * function, to know if e.g. a caller is in the process of booting to the - * specified level. If specified, it should never be lower than $phase. - * - * @return bool - * TRUE if the specified bootstrap phase has completed. - * - * @see \Drush\Boot\Boot::bootstrap_phases() - */ -function drush_bootstrap($phase, $phase_max = FALSE) { - $bootstrap = drush_get_bootstrap_object(); - $phases = _drush_bootstrap_phases(TRUE); - $result = TRUE; - - // If the requested phase does not exist in the list of available - // phases, it means that the command requires bootstrap to a certain - // level, but no site root could be found. - if (!isset($phases[$phase])) { - $result = drush_bootstrap_error('DRUSH_NO_SITE', dt("We could not find an applicable site for that command.")); - } - - // Once we start bootstrapping past the DRUSH_BOOTSTRAP_DRUSH phase, we - // will latch the bootstrap object, and prevent it from changing. - if ($phase > DRUSH_BOOTSTRAP_DRUSH) { - drush_latch_bootstrap_object($bootstrap); - } - - drush_set_context('DRUSH_BOOTSTRAPPING', TRUE); - foreach ($phases as $phase_index => $current_phase) { - $bootstrapped_phase = drush_get_context('DRUSH_BOOTSTRAP_PHASE', -1); - if ($phase_index > $phase) { - break; - } - if ($phase_index > $bootstrapped_phase) { - if ($result = drush_bootstrap_validate($phase_index)) { - if (method_exists($bootstrap, $current_phase) && !drush_get_error()) { - drush_log(dt("Drush bootstrap phase : !function()", array('!function' => $current_phase)), LogLevel::BOOTSTRAP); - $bootstrap->{$current_phase}(); - - // Reset commandfile cache and find any new command files that are available during this bootstrap phase. - drush_get_commands(TRUE); - _drush_find_commandfiles($phase_index, $phase_max); - } - drush_set_context('DRUSH_BOOTSTRAP_PHASE', $phase_index); - } - } - } - drush_set_context('DRUSH_BOOTSTRAPPING', FALSE); - if (!$result || drush_get_error()) { - $errors = drush_get_context('DRUSH_BOOTSTRAP_ERRORS', array()); - foreach ($errors as $code => $message) { - drush_set_error($code, $message); - } - } - return !drush_get_error(); -} - -/** - * Determine whether a given bootstrap phase has been completed - * - * This function name has a typo which makes me laugh so we choose not to - * fix it. Take a deep breath, and smile. See - * http://en.wikipedia.org/wiki/HTTP_referer - * - * - * @param int $phase - * The bootstrap phase to test - * - * @return bool - * TRUE if the specified bootstrap phase has completed. - */ -function drush_has_boostrapped($phase) { - $phase_index = drush_get_context('DRUSH_BOOTSTRAP_PHASE'); - - return isset($phase_index) && ($phase_index >= $phase); -} - -/** - * Validate whether a bootstrap phase can be reached. - * - * This function will validate the settings that will be used - * during the actual bootstrap process, and allow commands to - * progressively bootstrap to the highest level that can be reached. - * - * This function will only run the validation function once, and - * store the result from that execution in a local static. This avoids - * validating phases multiple times. - * - * @param int $phase - * The bootstrap phase to validate to. - * - * @return bool - * TRUE if bootstrap is possible, FALSE if the validation failed. - * - * @see \Drush\Boot\Boot::bootstrap_phases() - */ -function drush_bootstrap_validate($phase) { - $bootstrap = drush_get_bootstrap_object(); - $phases = _drush_bootstrap_phases(TRUE); - static $result_cache = array(); - - if (!array_key_exists($phase, $result_cache)) { - drush_set_context('DRUSH_BOOTSTRAP_ERRORS', array()); - drush_set_context('DRUSH_BOOTSTRAP_VALUES', array()); - - foreach ($phases as $phase_index => $current_phase) { - $validated_phase = drush_get_context('DRUSH_BOOTSTRAP_VALIDATION_PHASE', -1); - if ($phase_index > $phase) { - break; - } - if ($phase_index > $validated_phase) { - $current_phase .= '_validate'; - if (method_exists($bootstrap, $current_phase)) { - $result_cache[$phase_index] = $bootstrap->{$current_phase}(); - } - else { - $result_cache[$phase_index] = TRUE; - } - drush_set_context('DRUSH_BOOTSTRAP_VALIDATION_PHASE', $phase_index); - } - } - } - return $result_cache[$phase]; -} - -/** - * Bootstrap to the specified phase. - * - * @param int $max_phase_index - * Only attempt bootstrap to the specified level. - * - * @return bool - * TRUE if the specified bootstrap phase has completed. - */ -function drush_bootstrap_to_phase($max_phase_index) { - if ($max_phase_index == DRUSH_BOOTSTRAP_MAX) { - // Bootstrap as far as we can without throwing an error, but log for - // debugging purposes. - drush_log(dt("Trying to bootstrap as far as we can."), 'debug'); - drush_bootstrap_max(); - return TRUE; - } - - drush_log(dt("Bootstrap to phase !phase.", array('!phase' => $max_phase_index)), LogLevel::BOOTSTRAP); - $phases = _drush_bootstrap_phases(); - $result = TRUE; - - // Try to bootstrap to the maximum possible level, without generating errors - foreach ($phases as $phase_index) { - if ($phase_index > $max_phase_index) { - // Stop trying, since we achieved what was specified. - break; - } - - if (drush_bootstrap_validate($phase_index)) { - if ($phase_index > drush_get_context('DRUSH_BOOTSTRAP_PHASE', DRUSH_BOOTSTRAP_NONE)) { - $result = drush_bootstrap($phase_index, $max_phase_index); - } - } - else { - $result = FALSE; - break; - } - } - - return $result; -} - -/** - * Bootstrap to the highest level possible, without triggering any errors. - * - * @param int $max_phase_index - * (optional) Only attempt bootstrap to the specified level. - * - * @return int - * The maximum phase to which we bootstrapped. - */ -function drush_bootstrap_max($max_phase_index = FALSE) { - $phases = _drush_bootstrap_phases(TRUE); - if (!$max_phase_index) { - $max_phase_index = count($phases); - } - - // Try to bootstrap to the maximum possible level, without generating errors. - foreach ($phases as $phase_index => $current_phase) { - if ($phase_index > $max_phase_index) { - // Stop trying, since we achieved what was specified. - break; - } - - if (drush_bootstrap_validate($phase_index)) { - if ($phase_index > drush_get_context('DRUSH_BOOTSTRAP_PHASE')) { - drush_bootstrap($phase_index, $max_phase_index); - } - } - else { - // drush_bootstrap_validate() only logs successful validations. For us, - // knowing what failed can also be important. - $previous = drush_get_context('DRUSH_BOOTSTRAP_PHASE'); - drush_log(dt("Bootstrap phase !function() failed to validate; continuing at !current().", array('!function' => $current_phase, '!current' => $phases[$previous])), 'debug'); - break; - } - } - - return drush_get_context('DRUSH_BOOTSTRAP_PHASE'); -} - -/** - * Bootstrap the specified site alias. The site alias must - * be a valid alias to a local site. - * - * @param $site_record - * The alias record for the given site alias. - * @see drush_sitealias_get_record(). - * @param $max_phase_index - * Only attempt bootstrap to the specified level. - * @returns TRUE if attempted to bootstrap, or FALSE - * if no bootstrap attempt was made. - */ -function drush_bootstrap_max_to_sitealias($site_record, $max_phase_index = NULL) { - if ((array_key_exists('root', $site_record) && !array_key_exists('remote-host', $site_record))) { - drush_sitealias_set_alias_context($site_record); - drush_bootstrap_max($max_phase_index); - return TRUE; - } - return FALSE; -} - /** * Helper function to collect any errors that occur during the bootstrap process. * Always returns FALSE, for convenience. + * + * @deprecated + * No longer used in Drush core. */ function drush_bootstrap_error($code, $message = null) { $errors = drush_get_context('DRUSH_BOOTSTRAP_ERRORS'); @@ -552,63 +121,3 @@ function drush_bootstrap_error($code, $message = null) { drush_set_context('DRUSH_BOOTSTRAP_ERRORS', $errors); return FALSE; } - -function _drush_bootstrap_output_prepare() { - // Note that as soon as we set the DRUSH_BACKEND context, we change - // the behavior of drush_log(). It is therefore important that we - // should not set this context until immediately before we call ob_start - // (i.e., in this function). - $backend = drush_set_context('DRUSH_BACKEND', drush_get_option('backend')); - $quiet = drush_get_context('DRUSH_QUIET'); - - if ($backend) { - // Load options passed as a JSON encoded string through STDIN. - $stdin_options = _drush_backend_get_stdin(); - if (is_array($stdin_options)) { - drush_set_context('stdin', $stdin_options); - } - // Add an output buffer handler to collect output/pass through backend - // packets. Using a chunksize of 2 ensures that each line is flushed - // straight away. - if ($quiet) { - // Pass through of backend packets, discard regular output. - ob_start('drush_backend_output_discard', 2); - } - else { - // Collect output. - ob_start('drush_backend_output_collect', 2); - } - } - - // In non-backend quiet mode we start buffering and discards it on command - // completion. - if ($quiet && !$backend) { - ob_start(); - } -} - -/** - * Used by a Drush extension to request that its Composer autoload - * files be loaded by Drush, if they have not already been. - * - * Usage: - * - * function mycommandfile_drush_init() { - * drush_autoload(__FILE__) - * } - * - */ -function drush_autoload($commandfile) { - $already_added = commandfiles_cache()->add($commandfile); - - $dir = dirname($commandfile); - $candidates = array("vendor/autoload.php", "../../../vendor/autoload.php"); - $drush_autoload_file = drush_get_context('DRUSH_VENDOR_PATH', ''); - - foreach ($candidates as $candidate) { - $autoload = $dir . '/' . $candidate; - if (file_exists($autoload) && (realpath($autoload) != $drush_autoload_file)) { - include $autoload; - } - } -} diff --git a/vendor/drush/drush/includes/cache.inc b/vendor/drush/drush/includes/cache.inc index 8f62193832449dda9f2f599eb49be907b533ce07..95a0733a6b6beade1bffabdab57449822c97bd6c 100644 --- a/vendor/drush/drush/includes/cache.inc +++ b/vendor/drush/drush/includes/cache.inc @@ -11,6 +11,8 @@ * option in drushrc.php. */ +use Drush\Cache\JSONCache; +use Drush\Drush; use Drush\Log\LogLevel; /** @@ -44,11 +46,7 @@ function _drush_cache_get_object($bin) { static $cache_objects; if (!isset($cache_objects[$bin])) { - $class = drush_get_option('cache-class-' . $bin, NULL); - if (!isset($class)) { - $class = drush_get_option('cache-default-class', '\Drush\Cache\JSONCache'); - } - $cache_objects[$bin] = new $class($bin); + $cache_objects[$bin] = new JSONCache($bin); } return $cache_objects[$bin]; } @@ -72,7 +70,7 @@ function _drush_cache_get_object($bin) { function drush_cache_get($cid, $bin = 'default') { $ret = _drush_cache_get_object($bin)->get($cid); $mess = $ret ? "HIT" : "MISS"; - drush_log(dt("Cache !mess cid: !cid", array('!mess' => $mess, '!cid' => $cid)), LogLevel::DEBUG); + Drush::logger()->debug(dt("Cache !mess cid: !cid", ['!mess' => $mess, '!cid' => $cid])); return $ret; } @@ -114,9 +112,10 @@ function drush_cache_get_multiple(array &$cids, $bin = 'default') { * @return bool */ function drush_cache_set($cid, $data, $bin = 'default', $expire = DRUSH_CACHE_PERMANENT) { - $ret = _drush_cache_get_object($bin)->set($cid, $data, $expire); - if ($ret) drush_log(dt("Cache SET cid: !cid", array('!cid' => $cid)), LogLevel::DEBUG); - return $ret; + if ($ret = _drush_cache_get_object($bin)->set($cid, $data, $expire)) { + Drush::logger()->debug(dt("Cache SET cid: !cid", ['!cid' => $cid])); + return $ret; + } } /** @@ -166,8 +165,9 @@ function _drush_cache_is_empty($bin) { * Return drush cache bins and any bins added by hook_drush_flush_caches(). */ function drush_cache_get_bins() { - $drush = array('default'); - return array_merge(drush_command_invoke_all('drush_flush_caches'), $drush); + $drush = ['default']; + return $drush; + // return array_merge(drush_command_invoke_all('drush_flush_caches'), $drush); } /** @@ -182,9 +182,11 @@ function drush_cache_get_bins() { * * @return * A cache id string. + * + * @deprecated */ -function drush_get_cid($prefix, $contexts = array(), $params = array()) { - $cid = array(); +function drush_get_cid($prefix, $contexts = [], $params = []) { + $cid = []; foreach ($contexts as $context) { $c = drush_get_context($context); @@ -197,5 +199,5 @@ function drush_get_cid($prefix, $contexts = array(), $params = array()) { $cid[] = $param; } - return DRUSH_VERSION . '-' . $prefix . '-' . md5(implode("", $cid)); + return Drush::getVersion() . '-' . $prefix . '-' . md5(implode("", $cid)); } diff --git a/vendor/drush/drush/includes/command.inc b/vendor/drush/drush/includes/command.inc index 3e1821a91b6edb9c33cbd2a99b09a3bb3d709b3e..1bbfccbf3729b8f431a396f613a48a509d18653d 100644 --- a/vendor/drush/drush/includes/command.inc +++ b/vendor/drush/drush/includes/command.inc @@ -1,69 +1,29 @@ <?php +use Consolidation\AnnotatedCommand\AnnotatedCommand; +use Drush\Drush; use Drush\Log\LogLevel; use Webmozart\PathUtil\Path; use Consolidation\AnnotatedCommand\AnnotationData; use Drush\Command\DrushInputAdapter; -use Drush\Command\DrushOutputAdapter; +use Consolidation\SiteAlias\SiteAlias; use Consolidation\AnnotatedCommand\CommandData; +use Symfony\Component\Console\Output\ConsoleOutput; /** * @defgroup dispatching Command dispatching functions. * @{ * * These functions handle command dispatching, and can - * be used to programatically invoke drush commands in + * be used to programmatically invoke Drush commands in * different ways. */ -/** - * Invokes a Drush API call, including all hooks. - * - * Executes the specified command with the specified arguments on the currently - * bootstrapped site using the current option contexts. Note that it will not - * bootstrap any further than the current command has already bootstrapped; - * therefore, you should only invoke commands that have the same (or lower) - * bootstrap requirements. - * - * Commands execute with the same options that the user provided on the - * commandline. If you need to invoke another Drush command with options you - * specify, use drush_invoke_process() instead. - * - * @param string $command - * The command to invoke. - * @param array $arguments - * An array of argument to pass into the command. - * - * @return mixed|false - * The return value from drush_dispatch() or FALSE on error. - * - * @see drush_invoke_process() - */ -function drush_invoke($command, $arguments = array()) { - // Convert a standalone argument to a single-element array. - if (!is_array($arguments)) { - $arguments = array($arguments); - } - $commands = drush_get_commands(); - if (array_key_exists($command, $commands)) { - $command = $commands[$command]; - // Drush overloads the 'arguments' element, which contains the help string - // for the allowed arguments for the command when fetched, and is fixed up - // by _drush_prepare_command() to contain the actual commandline arguments - // during dispatching. - $command['arguments'] = array(); - return drush_dispatch($command, $arguments); - } - else { - return drush_set_error('DRUSH_COMMAND_NOT_FOUND', dt("The drush command '!command' could not be found.", array('!command' => $command))); - } -} - /** * Invoke a command in a new process, targeting the site specified by * the provided site alias record. * - * @param array $site_alias_record + * @param array|string $site_alias_record * The site record to execute the command on. Use '@self' to run on the current site. * @param string $command_name * The command to invoke. @@ -104,1575 +64,34 @@ function drush_invoke($command, $arguments = array()) { * @see drush_backend_get_result() * * Do not change the signature of this function! drush_invoke_process - * is one of the key Drush APIs. See http://drupal.org/node/1152908 - */ -function drush_invoke_process($site_alias_record, $command_name, $commandline_args = array(), $commandline_options = array(), $backend_options = TRUE) { - if (is_array($site_alias_record) && array_key_exists('site-list', $site_alias_record)) { - list($site_alias_records, $not_found) = drush_sitealias_resolve_sitespecs($site_alias_record['site-list']); - if (!empty($not_found)) { - drush_log(dt("Not found: @list", array("@list" => implode(', ', $not_found))), LogLevel::WARNING); - return FALSE; - } - $site_alias_records = drush_sitealias_simplify_names($site_alias_records); - foreach ($site_alias_records as $alias_name => $alias_record) { - $invocations[] = array( - 'site' => $alias_record, - 'command' => $command_name, - 'args' => $commandline_args, - ); - } - } - else { - $invocations[] = array( - 'site' => $site_alias_record, - 'command' => $command_name, - 'args' => $commandline_args); - $invoke_multiple = drush_get_option_override($backend_options, 'invoke-multiple', 0); - if ($invoke_multiple) { - $invocations = array_fill(0, $invoke_multiple, $invocations[0]); - } - } - return drush_backend_invoke_concurrent($invocations, $commandline_options, $backend_options); -} - -/** - * Given a command record, dispatch it as if it were - * the original command. Executes in the currently - * bootstrapped site using the current option contexts. - * Note that drush_dispatch will not bootstrap any further than the - * current command has already bootstrapped; therefore, you should only invoke - * commands that have the same (or lower) bootstrap requirements. - * - * @param command - * A full $command such as returned by drush_get_commands(), - * or a string containing the name of the command record from - * drush_get_commands() to call. - * @param arguments - * An array of argument values. - * - * @see drush_topic_docs_topic(). - */ -function drush_dispatch($command, $arguments = array()) { - drush_set_command($command); - $return = FALSE; - - if ($command) { - // Add arguments, if this has not already been done. - // (If the command was fetched from drush_parse_command, - // then you cannot provide arguments to drush_dispatch.) - if (empty($command['arguments'])) { - _drush_prepare_command($command, $arguments); - } - - // Merge in the options added by hooks. We need this - // for validation, but this $command is just going to - // get thrown away, so we'll have to do this again later. - annotationcommand_adapter_add_hook_options($command); - - // Add command-specific options, if applicable. - drush_command_default_options($command); - - // Test to see if any of the options in the 'cli' context - // are not represented in the command structure. - if ((_drush_verify_cli_options($command) === FALSE) || (_drush_verify_cli_arguments($command) === FALSE)) { - return FALSE; - } - - // Give command files an opportunity to alter the command record - drush_command_invoke_all_ref('drush_command_alter', $command); - - // Include and validate command engines. - if (drush_load_command_engines($command) === FALSE) { - return FALSE; - } - - // Do tilde expansion immediately prior to execution, - // so that tildes are passed through unchanged for - // remote commands and other redispatches. - drush_preflight_tilde_expansion($command); - - // Get the arguments for this command. Add the options - // on the end if this is that kind of command. - $args = $command['arguments']; - - // Call the callback function of the active command. - $return = call_user_func_array($command['callback'], $args); - } - - // Add a final log entry, just so a timestamp appears. - drush_log(dt('Command dispatch complete'), LogLevel::NOTICE); - - return $return; -} - -/** - * Entry point for commands into the drush_invoke() API - * - * If a command does not have a callback specified, this function will be called. - * - * This function will trigger $hook_drush_init, then if no errors occur, - * it will call drush_invoke() with the command that was dispatch. - * - * If no errors have occured, it will run $hook_drush_exit. - */ -function drush_command() { - $args = func_get_args(); - $command = drush_get_command(); - foreach (drush_command_implements("drush_init") as $name) { - $func = $name . '_drush_init'; - if (drush_get_option('show-invoke')) { - drush_log(dt("Calling global init hook: !func", array('!name' => $name, '!func' => $func . '()')), LogLevel::BOOTSTRAP); - } - call_user_func_array($func, $args); - _drush_log_drupal_messages(); - } - - if (!drush_get_error()) { - $result = _drush_invoke_hooks($command, $args); - } - - if (!drush_get_error()) { - foreach (drush_command_implements('drush_exit') as $name) { - $func = $name . '_drush_exit'; - if (drush_get_option('show-invoke')) { - drush_log(dt("Calling global exit hook: !func", array('!name' => $name, '!func' => $func . '()')), LogLevel::BOOTSTRAP); - } - call_user_func_array($func, $args); - _drush_log_drupal_messages(); - } - } -} - -/** - * Invoke Drush API calls, including all hooks. - * - * This is an internal function; it is called from drush_dispatch via - * drush_command, but only if the command does not specify a 'callback' - * function. If a callback function is specified, it will be called - * instead of drush_command + _drush_invoke_hooks. - * - * Executes the specified command with the specified arguments on the - * currently bootstrapped site using the current option contexts. - * Note that _drush_invoke_hooks will not bootstrap any further than the - * current command has already bootstrapped; therefore, you should only invoke - * commands that have the same (or lower) bootstrap requirements. - * - * Call the correct hook for all the modules that implement it. - * Additionally, the ability to rollback when an error has been encountered is also provided. - * If at any point during execution, the drush_get_error() function returns anything but 0, - * drush_invoke() will trigger $hook_rollback for each of the hooks that implement it, - * in reverse order from how they were executed. Rollbacks are also triggered any - * time a hook function returns FALSE. - * - * This function will also trigger pre_$hook and post_$hook variants of the hook - * and its rollbacks automatically. - * - * HOW DRUSH HOOK FUNCTIONS ARE NAMED: - * - * The name of the hook is composed from the name of the command and the name of - * the command file that the command definition is declared in. The general - * form for the hook filename is: - * - * drush_COMMANDFILE_COMMANDNAME - * - * In many cases, drush commands that are functionally part of a common collection - * of similar commands will all be declared in the same file, and every command - * defined in that file will start with the same command prefix. For example, the - * command file "pm.drush.inc" defines commands such as "pm-enable" and "pm-disable". - * In the case of "pm-enable", the command file is "pm", and and command name is - * "pm-enable". When the command name starts with the same sequence of characters - * as the command file, then the repeated sequence is dropped; thus, the command - * hook for "pm-enable" is "drush_pm_enable", not "drush_pm_pm_enable". - * - * There is also a special Drupal-version-specific naming convention that may - * be used. To hide a commandfile from all versions of Drupal except for the - * specific one named, add a ".dVERSION" after the command prefix. For example, - * the file "views.d8.drush.inc" defines a "views" commandfile that will only - * load with Drupal 8. This feature is not necessary and should not be used - * in contrib modules (any extension with a ".module" file), since these modules - * are already version-specific. - * - * @param command - * The drush command to execute. - * @param args - * An array of arguments to the command OR a single non-array argument. - * @return - * The return value will be passed along to the caller if --backend option is - * present. A boolean FALSE indicates failure and rollback will be intitated. - * - * This function should not be called directly. - * @see drush_invoke() and @see drush_invoke_process() - */ -function _drush_invoke_hooks($command, $args) { - $return = null; - // If someone passed a standalone arg, convert it to a single-element array - if (!is_array($args)) { - $args = array($args); - } - // Include the external command file used by this command, if there is one. - drush_command_include($command['command-hook']); - // Generate the base name for the hook by converting all - // dashes in the command name to underscores. - $hook = str_replace("-", "_", $command['command-hook']); - - // Call the hook init function, if it exists. - // If a command needs to bootstrap, it is advisable - // to do so in _init; otherwise, new commandfiles - // will miss out on participating in any stage that - // has passed or started at the time it was discovered. - $func = 'drush_' . $hook . '_init'; - if (function_exists($func)) { - drush_log(dt("Calling drush command init function: !func", array('!func' => $func)), LogLevel::BOOTSTRAP); - call_user_func_array($func, $args); - _drush_log_drupal_messages(); - if (drush_get_error()) { - drush_log(dt('The command @command could not be initialized.', array('@command' => $command['command-hook'])), LogLevel::ERROR); - return FALSE; - } - } - - // We will adapt and call as many of the annotated command hooks as we can. - // The following command hooks are not supported in Drush 8.x: - // - Command Event: not called (requires CommandEvent object) - // - Option: Equivalent functionality supported in annotationcommand_adapter.inc - // - Interact: not called (We don't use SymfonyStyle in 8.x at the moment) - // - Status: not called - probably not needed? - // - Extract not called - probably not needed? - // The hooks that are called include: - // - Pre-initialize, initialize and post-initialize - // - Pre-validate and validate - // - Pre-command, command and post-command - // - Pre-process, process and post-process - // - Pre-alter, alter and post-alter - - $names = annotationcommand_adapter_command_names($command); - // Merge in the options added by hooks (again) - annotationcommand_adapter_add_hook_options($command); - $annotationData = $command['annotations']; - - $input = new DrushInputAdapter($args, annotationcommand_adapter_get_options($command), $command['command']); - $output = new DrushOutputAdapter(); - $commandData = new CommandData( - $annotationData, - $input, - $output, - false, - false - ); - - annotationcommand_adapter_call_initialize($names, $commandData); - - $rollback = FALSE; - $completed = array(); - $available_rollbacks = array(); - $all_available_hooks = array(); - - // Iterate through the different hook variations - $variations = array( - 'pre_validate' => $hook . "_pre_validate", - 'validate' => $hook . "_validate", - 'pre_command' => "pre_$hook", - 'command' => $hook, - 'post_command' => "post_$hook" - ); - foreach ($variations as $hook_phase => $var_hook) { - - $adapterHookFunction = 'annotationcommand_adapter_call_hook_' . $hook_phase; - $adapterHookFunction($names, $commandData, $return); - - // Get the list of command files. - // We re-fetch the list every time through - // the loop in case one of the hook function - // does something that will add additional - // commandfiles to the list (i.e. bootstrapping - // to a higher phase will do this). - $list = drush_commandfile_list(); - - // Make a list of function callbacks to call. If - // there is a 'primary function' mentioned, make sure - // that it appears first in the list, but only if - // we are running the main hook ("$hook"). After that, - // make sure that any callback associated with this commandfile - // executes before any other hooks defined in any other - // commandfiles. - $callback_list = array(); - if (($var_hook == $hook) && ($command['primary function'])) { - $callback_list[$command['primary function']] = $list[$command['commandfile']]; - } - else { - $primary_func = ($command['commandfile'] . "_" == substr($var_hook . "_",0,strlen($command['commandfile']) + 1)) ? sprintf("drush_%s", $var_hook) : sprintf("drush_%s_%s", $command['commandfile'], $var_hook); - $callback_list[$primary_func] = $list[$command['commandfile']]; - } - // We've got the callback for the primary function in the - // callback list; now add all of the other callback functions. - unset($list[$command['commandfile']]); - foreach ($list as $commandfile => $filename) { - $func = sprintf("drush_%s_%s", $commandfile, $var_hook); - $callback_list[$func] = $filename; - } - // Run all of the functions available for this variation - $accumulated_result = NULL; - foreach ($callback_list as $func => $filename) { - if (function_exists($func)) { - $all_available_hooks[] = $func . ' [* Defined in ' . $filename . ']'; - $available_rollbacks[] = $func . '_rollback'; - $completed[] = $func; - drush_log(dt("Calling hook !hook", array('!hook' => $func)), LogLevel::DEBUG); - try { - $result = call_user_func_array($func, $args); - drush_log(dt("Returned from hook !hook", array('!hook' => $func)), LogLevel::DEBUG); - } - catch (Exception $e) { - drush_set_error('DRUSH_EXECUTION_EXCEPTION', (string) $e); - } - // If there is an error, break out of the foreach - // $variations and foreach $callback_list - if (drush_get_error() || ($result === FALSE)) { - $rollback = TRUE; - break 2; - } - // If result values are arrays, then combine them all together. - // Later results overwrite earlier results. - if (isset($result) && is_array($accumulated_result) && is_array($result)) { - $accumulated_result = array_merge($accumulated_result, $result); - } - else { - $accumulated_result = $result; - } - _drush_log_drupal_messages(); - } - else { - $all_available_hooks[] = $func; - } - } - // Process the result value from the 'main' callback hook only. - if ($var_hook == $hook) { - $return = $accumulated_result; - if (isset($return)) { - annotationcommand_adapter_call_hook_process_and_alter($names, $commandData, $return); - drush_handle_command_output($command, $return); - } - } - } - - // If no hook functions were found, print a warning. - if (empty($completed)) { - $default_command_hook = sprintf("drush_%s_%s", $command['commandfile'], $hook); - if (($command['commandfile'] . "_" == substr($hook . "_",0,strlen($command['commandfile'])+ 1))) { - $default_command_hook = sprintf("drush_%s", $hook); - } - $dt_args = array( - '!command' => $command['command-hook'], - '!default_func' => $default_command_hook, - ); - $message = "No hook functions were found for !command. The primary hook function is !default_func(). Please implement this function. Run with --show-invoke to see all available hooks."; - $return = drush_set_error('DRUSH_FUNCTION_NOT_FOUND', dt($message, $dt_args)); - } - if (drush_get_option('show-invoke')) { - // We show all available hooks up to and including the one that failed (or all, if there were no failures) - drush_log(dt("Available drush_invoke() hooks for !command: !available", array('!command' => $command['command-hook'], '!available' => "\n" . implode("\n", $all_available_hooks))), LogLevel::OK); - } - if (drush_get_option('show-invoke') && !empty($available_rollbacks)) { - drush_log(dt("Available rollback hooks for !command: !rollback", array('!command' => $command['command-hook'], '!rollback' => "\n" . implode("\n", $available_rollbacks))), LogLevel::OK); - } - - // Something went wrong, we need to undo. - if ($rollback) { - if (drush_get_option('confirm-rollback', FALSE)) { - // Optionally ask for confirmation, --yes and --no are ignored from here on as we are about to finish this process. - drush_set_context('DRUSH_AFFIRMATIVE', FALSE); - drush_set_context('DRUSH_NEGATIVE', FALSE); - $rollback = drush_confirm(dt('Do you want to rollback? (manual cleanup might be required otherwise)')); - } - - if ($rollback) { - foreach (array_reverse($completed) as $func) { - $rb_func = $func . '_rollback'; - if (function_exists($rb_func)) { - call_user_func_array($rb_func, $args); - _drush_log_drupal_messages(); - drush_log(dt("Changes made in !func have been rolled back.", array('!func' => $func)), LogLevel::DEBUG); - } - } - } - $return = FALSE; - } - - if (isset($return)) { - return $return; - } -} - -/** - * Convert the structured output array provided from the Drush - * command into formatted output. Output is only printed for commands - * that define 'default-format' &/or 'default-pipe-format'; all - * other commands are expected to do their own output. - */ -function drush_handle_command_output($command, $structured_output) { - // If the hook already called drush_backend_set_result, - // then return that value. If it did not, then the return - // value from the hook will be the value returned from - // this routine. - $return = drush_backend_get_result(); - if (empty($return)) { - drush_backend_set_result($structured_output); - } - // We skip empty strings and empty arrays, but note that 'empty' - // returns TRUE for the integer value '0', but we do want to print that. - // Only handle output here if the command defined an output format - // engine. If no engine was declared, then we presume that the command - // handled its own output. - if ((!empty($structured_output) || ($structured_output === 0))) { - // If the command specifies a default pipe format and - // returned a result, then output the formatted output when - // in --pipe mode. - $formatter = drush_get_outputformat(); - if (!$formatter && is_string($structured_output)) { - $formatter = drush_load_engine('outputformat', 'string'); - } - if ($formatter) { - if ($formatter === TRUE) { - return drush_set_error(dt('No outputformat class defined for !format', array('!format' => $format))); - } - if ((!empty($command['engines']['outputformat'])) && (!in_array($formatter->engine, $command['engines']['outputformat']['usable']))) { - return $formatter->format_error(dt("The command '!command' does not produce output in a structure usable by this output format.", array('!command' => $command['command']))); - } - // Add any user-specified options to the metadata passed to the formatter. - $metadata = array(); - $metadata['strict'] = drush_get_option('strict', FALSE); - if (isset($formatter->engine_config['options'])) { - $machine_parsable = $formatter->engine_config['engine-info']['machine-parsable']; - if (drush_get_option('full', FALSE)) { - if (isset($formatter->engine_config['fields-full'])) { - $formatter->engine_config['fields-default'] = $formatter->engine_config['fields-full']; - } - else { - $formatter->engine_config['fields-default'] = array_keys($formatter->engine_config['field-labels']); - } - } - elseif ((drush_get_context('DRUSH_PIPE') || $machine_parsable) && isset($formatter->engine_config['fields-pipe'])) { - $formatter->engine_config['fields-default'] = $formatter->engine_config['fields-pipe']; - } - - // Determine the --format, and options relevant for that format. - foreach ($formatter->engine_config['options'] as $option => $option_info) { - $default_value = isset($formatter->engine_config[$option . '-default']) ? $formatter->engine_config[$option . '-default'] : FALSE; - if (($default_value === FALSE) && array_key_exists('default', $option_info)) { - $default_value = $option_info['default']; - } - if (isset($option_info['list'])) { - $user_specified_value = drush_get_option_list($option, $default_value); - } - else { - $user_specified_value = drush_get_option($option, $default_value); - } - if ($user_specified_value !== FALSE) { - if (array_key_exists('key', $option_info)) { - $option = $option_info['key']; - } - $metadata[$option] =$user_specified_value; - } - } - } - if (isset($metadata['fields']) && !empty($metadata['fields'])) { - if (isset($formatter->engine_config['field-labels'])) { - $formatter->engine_config['field-labels'] = drush_select_fields($formatter->engine_config['field-labels'], $metadata['fields'], $metadata['strict']); - } - } - $output = $formatter->process($structured_output, $metadata); - if (drush_get_context('DRUSH_PIPE')) { - drush_print_pipe($output); - } - else { - drush_print($output); - } - } - } -} - -/** - * Fail with an error if the user specified options on the - * command line that are not documented in the current command - * record. Also verify that required options are present. - */ -function _drush_verify_cli_options($command) { - - // Start out with just the options in the current command record. - $options = _drush_get_command_options($command); - // Skip all tests if the command is marked to allow anything. - // Also skip backend commands, which may have options on the commandline - // that were inherited from the calling command. - if (($command['allow-additional-options'] === TRUE)) { - return TRUE; - } - // If 'allow-additional-options' contains a list of command names, - // then union together all of the options from all of the commands. - if (is_array($command['allow-additional-options'])) { - $implemented = drush_get_commands(); - foreach ($command['allow-additional-options'] as $subcommand_name) { - if (array_key_exists($subcommand_name, $implemented)) { - $options = array_merge($options, _drush_get_command_options($implemented[$subcommand_name])); - } - } - } - // Also add in global options - $options = array_merge($options, drush_get_global_options()); - - // Add a placeholder option so that backend requests originating from prior versions of Drush are valid. - $options += array('invoke' => ''); - - // Now we will figure out which options in the cli context - // are not represented in our options list. - $cli_options = array_keys(drush_get_context('cli')); - $allowed_options = _drush_flatten_options($options); - $allowed_options = drush_append_negation_options($allowed_options); - $disallowed_options = array_diff($cli_options, $allowed_options); - if (!empty($disallowed_options)) { - $unknown = count($disallowed_options) > 1 ? dt('Unknown options') : dt('Unknown option'); - if (drush_get_option('strict', TRUE)) { - $msg = dt("@unknown: --@options. See `drush help @command` for available options. To suppress this error, add the option --strict=0.", array('@unknown' => $unknown, '@options' => implode(', --', $disallowed_options), '@command' => $command['command'])); - return drush_set_error('DRUSH_UNKNOWN_OPTION', $msg); - } - } - - // Next check to see if all required options were specified, - // and if all specified options with required values have values. - $missing_required_options = array(); - $options_missing_required_values = array(); - foreach ($command['options'] as $option_name => $option) { - if (is_array($option) && !empty($option['required']) && drush_get_option($option_name, NULL) === NULL) { - $missing_required_options[] = $option_name; - } - // Note that drush_get_option() will return TRUE if an option - // was specified without a value (--option), as opposed to - // the string "1" is --option=1 was used. - elseif (is_array($option) && !empty($option['value']) && ($option['value'] == 'required') && drush_get_option($option_name, NULL) === TRUE) { - $options_missing_required_values[] = $option_name; - } - } - if (!empty($missing_required_options) || !empty($options_missing_required_values)) { - $missing_message = ''; - if (!empty($missing_required_options)) { - $missing = count($missing_required_options) > 1 ? dt('Missing required options') : dt('Missing required option'); - $missing_message = dt("@missing: --@options.", array('@missing' => $missing, '@options' => implode(', --', $missing_required_options))); - } - if (!empty($options_missing_required_values)) { - if (!empty($missing_message)) { - $missing_message .= " "; - } - $missing = count($options_missing_required_values) > 1 ? dt('Options used without providing required values') : dt('Option used without a value where one was required'); - $missing_message .= dt("@missing: --@options.", array('@missing' => $missing, '@options' => implode(', --', $options_missing_required_values))); - } - return drush_set_error(dt("!message See `drush help @command` for information on usage.", array('!message' => $missing_message, '@command' => $command['command']))); - } - return TRUE; -} - -function drush_append_negation_options($allowed_options) { - $new_allowed = $allowed_options; - foreach ($allowed_options as $option) { - $new_allowed[] = 'no-' . $option; - } - return $new_allowed; -} - -function _drush_verify_cli_arguments($command) { - // Check to see if all of the required arguments - // are specified. - if ($command['required-arguments']) { - $required_arg_count = $command['required-arguments']; - if ($required_arg_count === TRUE) { - $required_arg_count = count($command['argument-description']); - } - - if (count($command['arguments']) < $required_arg_count) { - $missing = $required_arg_count > 1 ? dt('Missing required arguments') : dt('Missing required argument'); - $required = array_slice(array_keys($command['argument-description']), 0, $required_arg_count); - - return drush_set_error(dt("@missing: @required. See `drush help @command` for information on usage.", array( - '@missing' => $missing, - '@required' => implode(", ", $required), - '@command' => $command['command'], - ))); - } - } - return TRUE; -} - -/** - * Return the list of all of the options for the given - * command record by merging the 'options' and 'sub-options' - * records. - */ -function _drush_get_command_options($command) { - drush_command_invoke_all_ref('drush_help_alter', $command); - $options = $command['options']; - foreach ($command['sub-options'] as $group => $suboptions) { - $options = array_merge($options, $suboptions); - } - return $options; -} - -/** - * Return the list of all of the options for the given - * command record including options provided by engines and additional-options. - */ -function drush_get_command_options_extended($command) { - drush_merge_engine_data($command); - - // Start out with just the options in the current command record. - $options = _drush_get_command_options($command); - // If 'allow-additional-options' contains a list of command names, - // then union together all of the options from all of the commands. - if (is_array($command['allow-additional-options'])) { - $implemented = drush_get_commands(); - foreach ($command['allow-additional-options'] as $subcommand_name) { - if (array_key_exists($subcommand_name, $implemented)) { - $options = array_merge($options, _drush_get_command_options($implemented[$subcommand_name])); - } - } - } - return $options; -} - -/** - * Return the array keys of $options, plus any 'short-form' - * representations that may appear in the option's value. - */ -function _drush_flatten_options($options) { - $flattened_options = array(); - - foreach($options as $key => $value) { - // engine sections start with 'package-handler=git_drupalorg', - // or something similar. Get rid of everything from the = onward. - if (($eq_pos = strpos($key, '=')) !== FALSE) { - $key = substr($key, 0, $eq_pos); - } - $flattened_options[] = $key; - if (is_array($value)) { - if (array_key_exists('short-form', $value)) { - $flattened_options[] = $value['short-form']; - } - } - } - return $flattened_options; -} - -/** - * Get the options that were passed to the current command. - * - * This function returns an array that contains all of the options - * that are appropriate for forwarding along to drush_invoke_process. - * - * @return - * An associative array of option key => value pairs. - */ -function drush_redispatch_get_options() { - $options = array(); - - // Add in command-specific and alias options, but for global options only. - $options_soup = drush_get_context('specific') + drush_get_context('alias'); - $global_option_list = drush_get_global_options(FALSE); - foreach ($options_soup as $key => $value) { - if (array_key_exists($key, $global_option_list)) { - $options[$key] = $value; - } - } - - // Local php settings should not override sitealias settings. - $cli_context = drush_get_context('cli'); - unset($cli_context['php'], $cli_context['php-options']); - // Pass along CLI parameters, as higher priority. - $options = $cli_context + $options; - - $options = array_diff_key($options, array_flip(drush_sitealias_site_selection_keys())); - unset($options['command-specific']); - unset($options['path-aliases']); - // If we can parse the current command, then examine all contexts - // in order for any option that is directly related to the current command - $command = drush_parse_command(); - if (is_array($command)) { - foreach (drush_get_command_options_extended($command) as $key => $value) { - $value = drush_get_option($key); - if (isset($value)) { - $options[$key] = $value; - } - } - } - // If --bootstrap-to-first-arg is specified, do not - // pass it along to remote commands. - unset($options['bootstrap-to-first-arg']); - - return $options; -} - -/** - * @} End of "defgroup dispatching". - */ - -/** - * @file - * The drush command engine. - * - * Since drush can be invoked independently of a proper Drupal - * installation and commands may operate across sites, a distinct - * command engine is needed. - * - * It mimics the Drupal module engine in order to economize on - * concepts and to make developing commands as familiar as possible - * to traditional Drupal module developers. - */ - -/** - * Parse console arguments. - */ -function drush_parse_args() { - $args = drush_get_context('argv'); - $command_args = NULL; - $global_options = array(); - $target_alias_name = NULL; - // It would be nice if commandfiles could somehow extend this list, - // but it is not possible. We need to parse args before we find commandfiles, - // because the specified options may affect how commandfiles are located. - // Therefore, commandfiles are loaded too late to affect arg parsing. - // There are only a limited number of short options anyway; drush reserves - // all for use by drush core. - static $arg_opts = array('c', 'u', 'r', 'l', 'i'); - - // Check to see if we were executed via a "#!/usr/bin/env drush" script - drush_adjust_args_if_shebang_script($args); - - // Now process the command line arguments. We will divide them - // into options (starting with a '-') and arguments. - $arguments = $options = array(); - - $verbosity = 0; - for ($i = 1; $i < count($args); $i++) { - $opt = $args[$i]; - // We set $command_args to NULL until the first argument that is not - // an alias is found (the command); we put everything that follows - // into $command_args. - if (is_array($command_args)) { - $command_args[] = $opt; - } - // Is the arg an option (starting with '-')? - if (!empty($opt) && $opt{0} == "-" && strlen($opt) != 1) { - // Do we have multiple options behind one '-'? - if (strlen($opt) > 2 && $opt{1} != "-") { - // Each char becomes a key of its own. - for ($j = 1; $j < strlen($opt); $j++) { - $opt_char = substr($opt, $j, 1); - $options[$opt_char] = TRUE; - if ($opt_char == 'v') { - ++$verbosity; - } - } - } - // Do we have a longopt (starting with '--')? - elseif ($opt{1} == "-") { - if ($pos = strpos($opt, '=')) { - $options[substr($opt, 2, $pos - 2)] = substr($opt, $pos + 1); - } - else { - $options[substr($opt, 2)] = TRUE; - } - } - else { - $opt = substr($opt, 1); - // Check if the current opt is in $arg_opts (= has to be followed by an argument). - if ((in_array($opt, $arg_opts))) { - // Raising errors for missing option values should be handled by the - // bootstrap or specific command, so we no longer do this here. - $options[$opt] = $args[$i + 1]; - $i++; - } - else { - $options[$opt] = TRUE; - } - } - } - // If it's not an option, it's a command. - else { - $arguments[] = $opt; - // Once we find the first argument, record the command args and global options - if (!is_array($command_args)) { - // Remember whether we set $target_alias_name on a previous iteration, - // then record the $target_alias_name iff this arguement references a valid site alias. - $already_set_target = is_string($target_alias_name); - if (!$already_set_target && drush_sitealias_valid_alias_format($opt)) { - $target_alias_name = $opt; - } - // If an alias record was set on a previous iteration, then this - // argument must be the command name. If we set the target alias - // record on this iteration, then this is not the command name. - // If we've found the command name, then save $options in $global_options - // (all options that came before the command name), and initialize - // $command_args to an array so that we will begin storing all args - // and options that follow the command name in $command_args. - if ($already_set_target || (!is_string($target_alias_name))) { - $command_args = array(); - $global_options = $options; - } - } - } - } - if ($verbosity >= 3) { - $options['debug'] = TRUE; - } - // If no arguments are specified, then the command will - // be either 'help' or 'version' (the latter if --version is specified) - // @todo: it would be handy if one could do `drush @remote st --help` and - // have that show help for st. Today, that shows --help for help command! - if (!count($arguments)) { - if (array_key_exists('version', $options)) { - $arguments = array('version'); - } - else { - $arguments = array('help'); - } - } - if (is_array($command_args)) { - drush_set_context('DRUSH_COMMAND_ARGS', $command_args); - } - drush_set_context('DRUSH_GLOBAL_CLI_OPTIONS', $global_options); - - // Handle the "@shift" alias, if present - drush_process_bootstrap_to_first_arg($arguments); - - drush_set_arguments($arguments); - drush_set_config_special_contexts($options); - drush_set_context('cli', $options); - return $arguments; -} - -/** - * Pop an argument off of drush's argument list - */ -function drush_shift() { - $arguments = drush_get_arguments(); - $result = NULL; - if (!empty($arguments)) { - // The php-script command uses the DRUSH_SHIFT_SKIP - // context to cause drush_shift to skip the 'php-script' - // command and the script path argument when it is - // called from the user script. - $skip_count = drush_get_context('DRUSH_SHIFT_SKIP'); - if (is_numeric($skip_count)) { - for ($i = 0; $i < $skip_count; $i++) { - array_shift($arguments); - } - $skip_count = drush_set_context('DRUSH_SHIFT_SKIP', 0); - } - $result = array_shift($arguments); - drush_set_arguments($arguments); - } - return $result; -} - -/** - * Special checking for "shebang" script handling. - * - * If there is a file 'script.php' that begins like so: - * #!/path/to/drush - * Then $args will be: - * /path/to/drush /path/to/script userArg1 userArg2 ... - * If it instead starts like this: - * #!/path/to/drush --flag php-script - * Then $args will be: - * /path/to/drush "--flag php-script" /path/to/script userArg1 userArg2 ... - * (Note that execve does not split the parameters from - * the shebang line on whitespace; see http://en.wikipedia.org/wiki/Shebang_%28Unix%29) - * When drush is called via one of the "shebang" lines above, - * the first or second parameter will be the full path - * to the "shebang" script file -- and if the path to the - * script is in the second position, then we will expect that - * the argument in the first position must begin with a - * '@' (alias) or '-' (flag). Under ordinary circumstances, - * we do not expect that the drush command must come before - * any argument that is the full path to a file. We use - * this assumption to detect "shebang" script execution. - */ -function drush_adjust_args_if_shebang_script(&$args) { - if (drush_has_bash()) { - // The drush.launcher script may add --php or --php-options at the - // head of the argument list; skip past those. - $base_arg_number = 1; - while (substr($args[$base_arg_number], 0, 5) == '--php') { - ++$base_arg_number; - } - if (_drush_is_drush_shebang_script($args[$base_arg_number])) { - // If $args[1] is a drush "shebang" script, we will insert - // the option "--bootstrap-to-first-arg" and the command - // "php-script" at the beginning of @args, so the command - // line args become: - // /path/to/drush --bootstrap-to-first-arg php-script /path/to/script userArg1 userArg2 ... - drush_set_option('bootstrap-to-first-arg', TRUE); - array_splice($args, $base_arg_number, 0, array('php-script')); - drush_set_context('DRUSH_SHEBANG_SCRIPT', TRUE); - } - elseif (((strpos($args[$base_arg_number], ' ') !== FALSE) || (!ctype_alnum($args[$base_arg_number][0]))) && (_drush_is_drush_shebang_script($args[$base_arg_number + 1]))) { - // If $args[2] is a drush "shebang" script, we will insert - // the space-exploded $arg[1] in place of $arg[1], so the - // command line args become: - // /path/to/drush scriptArg1 scriptArg2 ... /path/to/script userArg1 userArg2 ... - // If none of the script arguments look like a drush command, - // then we will insert "php-script" as the default command to - // execute. - $script_args = explode(' ', $args[$base_arg_number]); - $has_command = FALSE; - foreach ($script_args as $script_arg) { - if (preg_match("/^[a-z][a-z0-9-]*$/",$script_arg)) { - $has_command = TRUE; - } - } - if (!$has_command) { - $script_args[] = 'php-script'; - } - array_splice($args, 1, $base_arg_number, $script_args); - drush_set_context('DRUSH_SHEBANG_SCRIPT', TRUE); - } - } -} - -/** - * Process the --bootstrap-to-first-arg option, if it is present. - * - * This option checks to see if the first user-provided argument is an alias - * or site specification; if it is, it will be shifted into the first argument - * position, where it will specify the site to bootstrap. The result of this - * is that if your shebang line looks like this: - * - * #!/path/to/drush --bootstrap-to-first-arg php-script - * - * Then when you run that script, you can optionally provide an alias such - * as @dev as the first argument (e.g. $ ./mydrushscript.php @dev scriptarg1 - * scriptarg2). Since this is the behavior that one would usually want, - * it is default behavior for a canonical script. That is, a script - * with a simple shebang line, like so: - * - * #!/path/to/drush - * - * will implicitly have "--bootstrap-to-first-arg" and "php-script" prepended, and will therefore - * behave exactly like the first example. To write a script that does not - * use --bootstrap-to-first-arg, then the drush command or at least one flag must be explicitly - * included, like so: + * was one of the key Drush APIs. See http://drupal.org/node/1152908 * - * #!/path/to/drush php-script + * @deprecated See Drush::drush(). */ -function drush_process_bootstrap_to_first_arg(&$arguments) { - if (drush_get_option('bootstrap-to-first-arg', FALSE)) { - $shift_alias_pos = 1 + (drush_get_context('DRUSH_SHEBANG_SCRIPT') === TRUE); - if (count($arguments) >= $shift_alias_pos) { - $shifted_alias = $arguments[$shift_alias_pos]; - $alias_record = drush_sitealias_get_record($shifted_alias); - if (!empty($alias_record)) { - // Move the alias we shifted from its current position - // in the argument list to the front of the list - array_splice($arguments, $shift_alias_pos, 1); - array_unshift($arguments, $shifted_alias); - } - } - } -} - -/** - * Get a list of all implemented commands. - * This invokes hook_drush_command(). - * - * @return - * Associative array of currently active command descriptors. - * - */ -function drush_get_commands($reset = FALSE) { - static $commands = array(); - - if ($reset) { - $commands = array(); - return; - } - elseif ($commands) { - return $commands; - } - - $list = drush_commandfile_list(); - foreach ($list as $commandfile => $path) { - if (drush_command_hook($commandfile, 'drush_command')) { - $function = $commandfile . '_drush_command'; - $result = $function(); - foreach ((array)$result as $key => $command) { - // Add some defaults and normalize the command descriptor. - $command += drush_command_defaults($key, $commandfile, $path); - - // Add engine data. - drush_merge_engine_data($command); - - // Translate command. - drush_command_translate($command); - - // If the command callback is not 'drush_command', then - // copy the callback function to an alternate element - // of the command array that will be called when Drush - // calls the command function hooks. Then, set the - // callback to drush_command so that the function hooks - // will be called. - if (($command['callback'] != 'drush_command') && $command['invoke hooks']) { - $command['primary function'] = $command['callback']; - $command['callback'] = 'drush_command'; - } - - $commands[$key] = $command; - } - } - } - $commands = array_merge($commands, annotationcommand_adapter_commands()); - foreach ($commands as $command) { - // For every alias, make a copy of the command and store it in the command list - // using the alias as a key - if (isset($command['aliases']) && count($command['aliases'])) { - foreach ($command['aliases'] as $alias) { - $commands[$alias] = $command; - $commands[$alias]['is_alias'] = TRUE; - } - } - } - return $commands; -} - -/** - * Organize commands into categories. Used by help listing and core-cli. - * - * @param array $commands - * A commands array as per drush_get_commands(). - * - * @return array $command_categories - * A categorized associative array of commands. - */ -function drush_commands_categorize($commands) { - $command_categories = array(); - $category_map = array(); - foreach ($commands as $key => $candidate) { - if ((!array_key_exists('is_alias', $candidate) || !$candidate['is_alias']) && !$candidate['hidden']) { - $category = $candidate['category']; - // If we have decided to remap a category, remap every command - if (array_key_exists($category, $category_map)) { - $category = $category_map[$category]; - } - if (!array_key_exists($category, $command_categories)) { - $title = drush_command_invoke_all('drush_help', "meta:$category:title"); - $alternate_title = ''; - if (!$title) { - // If there is no title, then check to see if the - // command file is stored in a folder with the same - // name as some other command file (e.g. 'core') that - // defines a title. - $alternate = basename($candidate['path']); - $alternate_title = drush_command_invoke_all('drush_help', "meta:$alternate:title"); - } - if (!empty($alternate_title)) { - $category_map[$category] = $alternate; - $category = $alternate; - $title = $alternate_title; - } - $command_categories[$category]['title'] = empty($title) ? '' : $title[0]; - $summary = drush_command_invoke_all('drush_help', "meta:$category:summary"); - if ($summary) { - $command_categories[$category]['summary'] = $summary[0]; - } - } - $candidate['category'] = $category; - $command_categories[$category]['commands'][$key] = $candidate; - } - } - - // Make sure that 'core' is always first in the list - $core_category = array('core' => $command_categories['core']); - unset($command_categories['core']); - - // Post-process the categories that have no title. - // Any that have fewer than 4 commands go into a section called "other". - $processed_categories = array(); - $misc_categories = array(); - $other_commands = array(); - $other_categories = array(); - foreach ($command_categories as $key => $info) { - if (empty($info['title'])) { - $one_category = $key; - if (count($info['commands']) < 4) { - $other_commands = array_merge($other_commands, $info['commands']); - $other_categories[] = $one_category; - } - else { - $info['title'] = dt("All commands in !category", array('!category' => $key)); - $misc_categories[$one_category] = $info; - } - } - else { - $processed_categories[$key] = $info; - } - } - $other_category = array(); - if (!empty($other_categories)) { - $other_category[implode(',', $other_categories)] = array('title' => dt("Other commands"), 'commands' => $other_commands); - } - asort($processed_categories); - asort($misc_categories); - $command_categories = array_merge($core_category, $processed_categories, $misc_categories, $other_category); - - // If the user specified --sort, then merge all of the remaining - // categories together - if (drush_get_option('sort', FALSE)) { - $combined_commands = array(); - foreach ($command_categories as $key => $info) { - $combined_commands = array_merge($combined_commands, $info['commands']); - } - $command_categories = array('all' => array('commands' => $combined_commands, 'title' => dt("Commands:"))); - } - - return $command_categories; -} - -function drush_command_defaults($key, $commandfile, $path) { - $defaults = array( - 'command' => $key, - 'command-hook' => $key, - 'invoke hooks' => TRUE, - 'callback arguments' => array(), - 'commandfile' => $commandfile, - 'path' => dirname($path), - 'engines' => array(), // Helpful for drush_show_help(). - 'callback' => 'drush_command', - 'primary function' => FALSE, - 'description' => NULL, - 'sections' => array( - 'examples' => 'Examples', - 'arguments' => 'Arguments', - 'options' => 'Options', - ), - 'arguments' => array(), - 'required-arguments' => FALSE, - 'options' => array(), - 'sub-options' => array(), - 'allow-additional-options' => FALSE, - 'global-options' => array(), - 'examples' => array(), - 'aliases' => array(), - 'core' => array(), - 'scope' => 'site', - 'drush dependencies' => array(), - 'handle-remote-commands' => FALSE, - 'remote-tty' => FALSE, - 'strict-option-handling' => FALSE, - 'tilde-expansion' => TRUE, - 'bootstrap_errors' => array(), - 'topics' => array(), - 'hidden' => FALSE, - 'category' => $commandfile, - 'add-options-to-arguments' => FALSE, - 'consolidation-output-formatters' => FALSE, - 'annotated-command-callback' => '', - 'annotations' => new AnnotationData(['command' => $key]), - ); - // We end up here, setting the defaults for a command, when - // called from drush_get_global_options(). Early in the Drush - // bootstrap, there will be no bootstrap object, because we - // need to get the list of global options when loading config - // files, and config files are loaded before the bootstrap object - // is created. In this early stage, we just use the core global - // options list. Later, the bootstrap object can also provide - // additional defaults if needed. The bootstrap command defaults - // will be merged into the command object again just before - // running it in bootstrap_and_dispatch(). - if ($bootstrap = drush_get_bootstrap_object()) { - $defaults = array_merge($defaults, $bootstrap->command_defaults()); - } - return $defaults; -} - -/** - * Translates description and other keys of a command definition. - * - * @param $command - * A command definition. - */ -function drush_command_translate(&$command) { - $command['description'] = _drush_command_translate($command['description']); - $keys = array('arguments', 'options', 'examples', 'sections'); - foreach ($keys as $key) { - foreach ($command[$key] as $k => $v) { - if (is_array($v)) { - $v['description'] = _drush_command_translate($v['description']); - } - else { - $v = _drush_command_translate($v); - } - $command[$key][$k] = $v; - } - } -} - -/** - * Helper function for drush_command_translate(). - * - * @param $source - * String or array. - */ -function _drush_command_translate($source) { - return is_array($source) ? call_user_func_array('dt', $source) : dt($source); -} - -/** - * Matches a commands array, as returned by drush_get_arguments, with the - * current command table. - * - * Note that not all commands may be discoverable at the point-of-call, - * since Drupal modules can ship commands as well, and they are - * not available until after bootstrapping. - * - * drush_parse_command returns a normalized command descriptor, which - * is an associative array. Some of its entries are: - * - callback arguments: an array of arguments to pass to the calback. - * - callback: the function to run. Usually, this is 'drush_command', which - * will determine the primary hook for the function automatically. Only - * specify a callback function if you need many commands to call the same - * function (e.g. drush_print_file). - * - invoke hooks: If TRUE (the default), Drush will invoke all of the pre and - * post hooks for this command. Set to FALSE to suppress hooks. This setting - * is ignored unless the command 'callback' is also set. - * - primary function: Drush will copy the 'callback' parameter here if - * necessary. This value should not be set explicitly; use 'callback' instead. - * - description: description of the command. - * - arguments: an array of arguments that are understood by the command. for help texts. - * - required-arguments: The minimum number of arguments that are required, or TRUE if all are required. - * - options: an array of options that are understood by the command. for help texts. - * - global-options: a list of options from the set of Drush global options (@see: - * drush_get_global_options()) that relate to this command. The help for these - * options will be included in the help output for this command. - * - examples: an array of examples that are understood by the command. for help texts. - * - scope: one of 'system', 'project', 'site'. - * - bootstrap: drupal bootstrap level (depends on Drupal major version). -1=no_bootstrap. - * - core: Drupal major version required. - * - drupal dependencies: drupal modules required for this command. - * - drush dependencies: other drush command files required for this command. - * - handle-remote-commands: set to TRUE if `drush @remote mycommand` should be executed - * locally rather than remotely dispatched. When this mode is set, the target site - * can be obtained via: - * drush_get_context('DRUSH_TARGET_SITE_ALIAS') - * - remote-tty: set to TRUE if Drush should force ssh to allocate a pseudo-tty - * when this command is being called remotely. Important for interactive commands. - * Remote commands that allocate a psedo-tty always print "Connection closed..." when done. - * - strict-option-handling: set to TRUE if drush should strictly separate local command - * cli options from the global options. Usually, drush allows global cli options and - * command cli options to be interspersed freely on the commandline. For commands where - * this flag is set, options are separated, with global options comming before the - * command names, and command options coming after, like so: - * drush --global-options command --command-options - * In this mode, the command options are no longer available via drush_get_option(); - * instead, they can be retrieved via: - * $args = drush_get_original_cli_args_and_options(); - * $args = drush_get_context('DRUSH_COMMAND_ARGS', array()); - * In this case, $args will contain the command args and options literally, exactly as they - * were entered on the command line, and in the same order as they appeared. - * - 'outputformat': declares the data format to be used to render the - * command result. In addition to the output format engine options - * listed below, each output format type can take additional metadata - * items that control the way that the output is rendered. See the - * comment in each particular output format class for information. The - * Drush core output format engines can be found in commands/core/outputformat. - * - 'default': The default type to render output as. If declared, the - * command should not print any output on its own, but instead should - * return a data structure (usually an associative array) that can - * be rendered by the output type selected. - * - 'pipe-format': When the command is executed in --pipe mode, the - * command output will be rendered by the format specified by the - * pipe-format item instead of the default format. Note that in - * either event, the user may specify the format to use via the - * --format command-line option. - * - 'formatted-filter': specifies a function callback that will be - * used to filter the command result if the selected output formatter - * is NOT declared to be machine-parsable. "table" is an example of - * an output format that is not machine-parsable. - * - 'parsable-filter': function callback that will be used to filter the - * command result if the selected output formatter is declared to be - * machine-parsable. "var_export" is an example of an output format that - * is machine-parsable. - * - 'output-data-type': An identifier representing the data structure that - * the command returns. @see outputformat_drush_engine_outputformat() for - * a description of the supported values. - * - 'field-labels': A mapping from machine name to human-readable name - * for all of the fields in a table-format command result. All - * possible field names should appear in this list. - * - 'fields-default': A list of the machine names of the fields that - * should be displayed by default in tables. - * - 'private-fields': A list of any fields that contain sensitive - * information, such as passwords. By default, Drush will hide private - * fields before printing the results to the console, but will include - * them in backend invoke results. Use --show-passwords to display. - * - 'column-widths': A mapping from field machine name to the column width - * that should be used in table output. Drush will automatically - * calculate the width of any field not listed here based on the length - * of the data items in it. - * - engines: declares information on Drush engines the command will load. - * Available engines can vary by command type. - * - * @return bool|array - * A command definition. - */ -function drush_parse_command() { - $args = drush_get_arguments(); - $command = FALSE; - - // Get a list of all implemented commands. - $implemented = drush_get_commands(); - if (!empty($args) && isset($implemented[$args[0]])) { - $command = $implemented[$args[0]]; - $arguments = array_slice($args, 1); - } - - // We have found a command that matches. Set the appropriate values. - if ($command) { - // Special case. Force help command if --help option was specified. - if (drush_get_option('help')) { - $arguments = array($command['command']); - $command = $implemented['helpsingle']; - $command['arguments'] = $arguments; - $command['allow-additional-options'] = TRUE; - } - else { - _drush_prepare_command($command, $arguments); - } - drush_set_command($command); - } - return $command; -} - -/** - * Called by drush_parse_command(). If a command is dispatched - * directly by drush_dispatch(), then drush_dispatch() will call - * this function. - */ -function _drush_prepare_command(&$command, $arguments = array()) { - // Drush overloads $command['arguments']; save the argument description - if (!isset($command['argument-description'])) { - $command['argument-description'] = $command['arguments']; - } - // Merge specified callback arguments, which precede the arguments passed on the command line. - if (isset($command['callback arguments']) && is_array($command['callback arguments'])) { - $arguments = array_merge($command['callback arguments'], $arguments); - } - $command['arguments'] = $arguments; -} - -/** - * Invoke a hook in all available command files that implement it. - * - * @see drush_command_invoke_all_ref() - * - * @param $hook - * The name of the hook to invoke. - * @param ... - * Arguments to pass to the hook. - * @return - * An array of return values of the hook implementations. If commands return - * arrays from their implementations, those are merged into one array. - */ -function drush_command_invoke_all() { - $args = func_get_args(); - if (count($args) == 1) { - $args[] = NULL; - } - $reference_value = $args[1]; - $args[1] = &$reference_value; - - return call_user_func_array('drush_command_invoke_all_ref', $args); -} - -/** - * A drush_command_invoke_all() that wants the first parameter to be passed by reference. - * - * @see drush_command_invoke_all() - */ -function drush_command_invoke_all_ref($hook, &$reference_parameter) { - $args = func_get_args(); - array_shift($args); - // Insure that call_user_func_array can alter first parameter - $args[0] = &$reference_parameter; - $return = array(); - $modules = drush_command_implements($hook); - if ($hook != 'drush_invoke_alter') { - // Allow modules to control the order of hook invocations - drush_command_invoke_all_ref('drush_invoke_alter', $modules, $hook); +function drush_invoke_process($site_alias_record, $command_name, $commandline_args = [], $commandline_options = [], $backend_options = TRUE) { + if ($site_alias_record instanceof SiteAlias) { + $site_alias_record = $site_alias_record->legacyRecord(); } - foreach ($modules as $module) { - $function = $module .'_'. $hook; - $result = call_user_func_array($function, $args); - if (isset($result) && is_array($result)) { - $return = array_merge_recursive($return, $result); - } - else if (isset($result)) { - $return[] = $result; - } - } - return $return; -} -/** - * Determine which command files are implementing a hook. - * - * @param $hook - * The name of the hook (e.g. "drush_help" or "drush_command"). - * - * @return - * An array with the names of the command files which are implementing this hook. - */ -function drush_command_implements($hook) { - $implementations[$hook] = array(); - $list = drush_commandfile_list(); - foreach ($list as $commandfile => $file) { - if (drush_command_hook($commandfile, $hook)) { - $implementations[$hook][] = $commandfile; - } + $invocations[] = [ + 'site' => $site_alias_record, + 'command' => $command_name, + 'args' => $commandline_args + ]; + $invoke_multiple = drush_get_option_override($backend_options, 'invoke-multiple', 0); + if ($invoke_multiple) { + $invocations = array_fill(0, $invoke_multiple, $invocations[0]); } - return (array)$implementations[$hook]; -} -/** - * @param string - * name of command to check. - * - * @return boolean - * TRUE if the given command has an implementation. - */ -function drush_is_command($command) { - $commands = drush_get_commands(); - return isset($commands[$command]); -} - -/** - * @param string - * name of command or command alias. - * - * @return string - * Primary name of command. - */ -function drush_command_normalize_name($command_name) { - $commands = drush_get_commands(); - return isset($commands[$command_name]) ? $commands[$command_name]['command'] : $command_name; -} - -/** - * Collect a list of all available drush command files. - * - * Scans the following paths for drush command files: - * - * - The "/path/to/drush/commands" folder. - * - Folders listed in the 'include' option (see example.drushrc.php). - * - The system-wide drush commands folder, e.g. /usr/share/drush/commands - * - The ".drush" folder in the user's HOME folder. - * - /drush and sites/all/drush in current Drupal site. - * - Folders belonging to enabled modules in the current Drupal site. - * - * A Drush command file is a file that matches "*.drush.inc". - * - * @see drush_scan_directory() - * - * @return - * An associative array whose keys and values are the names of all available - * command files. - */ -function drush_commandfile_list() { - return commandfiles_cache()->get(); -} - -function _drush_find_commandfiles($phase, $phase_max = FALSE) { - drush_log(dt("Find command files for phase !phase (max=!max)", array('!phase' => $phase, '!max' => (string)$phase_max)), LogLevel::DEBUG); - if ($bootstrap = drush_get_bootstrap_object()) { - $searchpath = $bootstrap->commandfile_searchpaths($phase, $phase_max); - _drush_add_commandfiles($searchpath, $phase); - annotationcommand_adapter_discover($searchpath, $phase, $phase_max); - } -} - -function _drush_add_commandfiles($searchpath, $phase = NULL, $reset = FALSE) { - static $evaluated = array(); - $needs_sort = FALSE; - - if (count($searchpath)) { - if (!$reset) { - // Assemble a cid specific to the bootstrap phase and searchpaths. - // Bump $cf_version when making a change to a dev version of Drush - // that invalidates the commandfile cache. - $cf_version = 8; - $cid = drush_get_cid('commandfiles-' . $phase, array(), array_merge($searchpath, array($cf_version))); - $command_cache = drush_cache_get($cid); - if (isset($command_cache->data)) { - $cached_list = $command_cache->data; - // If we want to temporarily ignore modules via 'ignored-modules', - // then we need to take these out of the cache as well. - foreach (drush_get_option_list('ignored-modules') as $ignored) { - unset($cached_list[$ignored]); - } - } - } - - // Build a list of all of the modules to attempt to load. - // Start with any modules deferred from a previous phase. - $list = commandfiles_cache()->deferred(); - if (isset($cached_list)) { - $list = array_merge($list, $cached_list); - } - else { - // Scan for drush command files; add to list for consideration if found. - foreach (array_unique($searchpath) as $path) { - if (is_dir($path)) { - $nomask = array_merge(drush_filename_blacklist(), drush_get_option_list('ignored-modules')); - $dmv = DRUSH_MAJOR_VERSION; - $files = drush_scan_directory($path, "/\.drush($dmv|)\.inc$/", $nomask); - foreach ($files as $filename => $info) { - $module = basename($filename); - $module = preg_replace('/\.*drush[0-9]*\.inc/', '', $module); - // Only try to bootstrap modules that we have never seen before. - if (!array_key_exists($module, $evaluated) && file_exists($filename)) { - $evaluated[$module] = TRUE; - $list[$module] = Path::canonicalize($filename); - } - } - } - } - if (isset($cid)) { - drush_cache_set($cid, $list); - } - } - // Check to see if the commandfile is valid for this version of Drupal - // and is still present on filesystem (in case of cached commandfile list). - foreach ($list as $module => $filename) { - // Only try to require if the file exists. If not, a file from the - // command file cache may not be available anymore, in which case - // we rebuild the cache for this phase. - if (file_exists($filename)) { - // Avoid realpath() here as Drush commandfiles can have phar:// locations. - $load_command = commandfiles_cache()->add($filename); - if ($load_command) { - $needs_sort = TRUE; - } - } - elseif (!$reset) { - _drush_add_commandfiles($searchpath, $phase, TRUE); - $needs_sort = FALSE; - } - } - - if ($needs_sort) { - commandfiles_cache()->sort(); - } - } + return drush_backend_invoke_concurrent($invocations, $commandline_options, $backend_options); } /** * Substrings to ignore during commandfile and site alias searching. + * TODO: Do we do any searching in the new code that should be filtered like this? */ function drush_filename_blacklist() { - $blacklist = array('.', '..', 'drush_make', 'examples', 'tests', 'disabled', 'gitcache', 'cache'); + $blacklist = ['.', '..', 'drush_make', 'examples', 'tests', 'disabled', 'gitcache', 'cache']; for ($v=4; $v<=(DRUSH_MAJOR_VERSION)+3; ++$v) { if ($v != DRUSH_MAJOR_VERSION) { $blacklist[] = 'drush' . $v; @@ -1681,333 +100,3 @@ function drush_filename_blacklist() { $blacklist = array_merge($blacklist, drush_get_option_list('exclude')); return $blacklist; } - -/** - * Conditionally include files based on the command used. - * - * Steps through each of the currently loaded commandfiles and - * loads an optional commandfile based on the key. - * - * When a command such as 'pm-enable' is called, this - * function will find all 'enable.pm.inc' files that - * are present in each of the commandfile directories. - */ -function drush_command_include($command) { - $include_files = drush_command_get_includes($command); - foreach($include_files as $filename => $commandfile) { - drush_log(dt('Including !filename', array('!filename' => $filename)), LogLevel::BOOTSTRAP); - include_once($filename); - } -} - -function drush_command_get_includes($command) { - $include_files = array(); - $parts = explode('-', $command); - $command = implode(".", array_reverse($parts)); - - $commandfiles = drush_commandfile_list(); - $options = array(); - foreach ($commandfiles as $commandfile => $file) { - $filename = sprintf("%s/%s.inc", dirname($file), $command); - if (file_exists($filename)) { - $include_files[$filename] = $commandfile; - } - } - return $include_files; -} - -/** - * Conditionally include default options based on the command used. - */ -function drush_command_default_options($command = NULL) { - $command_default_options = drush_get_context('command-specific'); - drush_command_set_command_specific($command_default_options, $command); -} - -function drush_sitealias_command_default_options($site_record, $prefix, $command = NULL) { - if (isset($site_record) && array_key_exists($prefix . 'command-specific', $site_record)) { - drush_command_set_command_specific($site_record[$prefix . 'command-specific'], $command); - } - return FALSE; -} - -function drush_command_set_command_specific_options($prefix, $command = NULL) { - $command_default_options = drush_get_option($prefix . 'command-specific', array()); - drush_command_set_command_specific($command_default_options, $command); -} - -function drush_command_set_command_specific($command_default_options, $command = NULL) { - if (!$command) { - $command = drush_get_command(); - } - if ($command) { - // Look for command-specific options for this command - // keyed both on the command's primary name, and on each - // of its aliases. - $options_were_set = _drush_command_set_default_options($command_default_options, $command['command']); - if (isset($command['aliases']) && count($command['aliases'])) { - foreach ($command['aliases'] as $alias) { - $options_were_set += _drush_command_set_default_options($command_default_options, $alias); - } - } - // If we set or cleared any options, go back and re-bootstrap any global - // options such as -y and -v. - if (!empty($options_were_set)) { - _drush_preflight_global_options(); - } - // If the command uses strict option handling, back out any global - // options that were set. - if ($command['strict-option-handling']) { - $global_options = drush_get_global_options(); - foreach ($options_were_set as $key) { - if (array_key_exists($key, $global_options)) { - if (!array_key_exists('context', $global_options[$key])) { - $strict_options_warning =& drush_get_context('DRUSH_STRICT_OPTIONS_WARNING', array()); - if (!array_key_exists($key, $strict_options_warning)) { - drush_log(dt("Global option --!option not supported in command-specific options for command !command due to a limitation in strict option handling.", array('!option' => $key, '!command' => $command['command'])), LogLevel::WARNING); - $strict_options_warning[$key] = TRUE; - } - } - drush_unset_option($key, 'specific'); - } - } - } - } -} - -function _drush_command_set_default_options($command_default_options, $command) { - $options_were_set = array(); - if (array_key_exists($command, $command_default_options)) { - foreach ($command_default_options[$command] as $key => $value) { - // We set command-specific options in their own context - // that is higher precedence than the various config file - // context, but lower than command-line options. - if (!drush_get_option('no-' . $key, FALSE)) { - drush_set_option($key, $value, 'specific'); - $options_were_set[] = $key; - } - } - } - return $options_were_set; -} - -/** - * Return all of the command-specific options defined in the given - * options set for the specified command name. Note that it is valid - * to use the command name alias rather than the primary command name, - * both in the parameter to this function, and in the options set. - */ -function drush_command_get_command_specific_options($options, $command_name, $prefix = '') { - $result = array(); - $command_name = drush_command_normalize_name($command_name); - if (isset($options[$prefix . 'command-specific'])) { - foreach ($options[$prefix . 'command-specific'] as $options_for_command => $values) { - if ($command_name == drush_command_normalize_name($options_for_command)) { - $result = array_merge($result, $values); - } - } - } - return $result; -} - -/** - * Return the original cli args and options, exactly as they - * appeared on the command line, and in the same order. - * Any command-specific options that were set will also - * appear in this list, appended at the very end. - * - * The args and options returned are raw, and must be - * escaped as necessary before use. - */ -function drush_get_original_cli_args_and_options($command = NULL) { - $args = drush_get_context('DRUSH_COMMAND_ARGS', array()); - $command_specific_options = drush_get_context('specific'); - if ($command == NULL) { - $command = drush_get_command(); - } - $command_options = ($command == NULL) ? array() : _drush_get_command_options($command); - foreach ($command_specific_options as $key => $value) { - if (!array_key_exists($key, $command_options)) { - if (($value === TRUE) || (!isset($value))) { - $args[] = "--$key"; - } - else { - $args[] = "--$key=$value"; - } - } - } - return $args; -} - -/** - * Determine whether a command file implements a hook. - * - * @param $module - * The name of the module (without the .module extension). - * @param $hook - * The name of the hook (e.g. "help" or "menu"). - * @return - * TRUE if the the hook is implemented. - */ -function drush_command_hook($commandfile, $hook) { - return function_exists($commandfile . '_' . $hook); -} - -/** - * Check that a command is valid for the current bootstrap phase. - * - * @param $command - * Command to check. Any errors will be added to the 'bootstrap_errors' element. - * - * @return - * TRUE if command is valid. - */ -function drush_enforce_requirement_bootstrap_phase(&$command) { - $valid = array(); - $current_phase = drush_get_context('DRUSH_BOOTSTRAP_PHASE'); - if ($command['bootstrap'] <= $current_phase) { - return TRUE; - } - // TODO: provide description text for each bootstrap level so we can give - // the user something more helpful and specific here. - $command['bootstrap_errors']['DRUSH_COMMAND_INSUFFICIENT_BOOTSTRAP'] = dt('Command !command needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.', array('!command' => $command['command'])); -} - -/** - * Check that a command has its declared drush dependencies available or have no - * dependencies. Drush dependencies are helpful when a command is invoking - * another command, or implementing its API. - * - * @param $command - * Command to check. Any errors will be added to the 'bootstrap_errors' element. - * @return - * TRUE if dependencies are met. - */ -function drush_enforce_requirement_drush_dependencies(&$command) { - // If there are no drush dependencies, then do nothing. - if (!empty($command['drush dependencies'])) { - $commandfiles = drush_commandfile_list(); - foreach ($command['drush dependencies'] as $dependency) { - if (!isset($commandfiles[$dependency])) { - $dt_args = array( - '!command' => $command['command'], - '!dependency' => "$dependency.drush.inc", - ); - $command['bootstrap_errors']['DRUSH_COMMANDFILE_DEPENDENCY_ERROR'] = dt('Command !command needs the following drush command file to run: !dependency.', $dt_args); - return FALSE; - } - } - } - return TRUE; -} - -/** - * Check that a command is valid for the current major version of core. Handles - * explicit version numbers and 'plus' numbers like 7+ (compatible with 7,8 ...). - * - * @param $command - * Command to check. Any errors will be added to the 'bootstrap_errors' element. - * - * @return - * TRUE if command is valid. - */ -function drush_enforce_requirement_core(&$command) { - $major = drush_drupal_major_version(); - if (!$core = $command['core']) { - return TRUE; - } - foreach ($core as $compat) { - if ($compat == $major) { - return TRUE; - } - elseif (substr($compat, -1) == '+' && $major >= substr($compat, 0, strlen($compat)-1)) { - return TRUE; - } - } - $versions = array_pop($core); - if (!empty($core)) { - $versions = implode(', ', $core) . dt(' or ') . $versions; - } - $command['bootstrap_errors']['DRUSH_COMMAND_CORE_VERSION_ERROR'] = dt('Command !command requires Drupal core version !versions to run.', array('!command' => $command['command'], '!versions' => $versions)); -} - -/** - * Check if a shell alias exists for current request. If so, re-route to - * core-execute and pass alias value along with rest of CLI arguments. - */ -function drush_shell_alias_replace($target_site_alias) { - $escape = TRUE; - $args = drush_get_arguments(); - $argv = drush_get_context('argv'); - $first = current($args); - // @todo drush_get_option is awkward here. - $shell_aliases = drush_get_context('shell-aliases', array()); - if (isset($shell_aliases[$first])) { - // Shell alias found for first argument in the request. - $alias_value = $shell_aliases[$first]; - if (!is_array($alias_value)) { - // Shell aliases can have embedded variables such as {{@target}} and {{%root}} - // that are replaced with the name of the target site alias, or the value of a - // path alias defined in the target site alias record. We only support replacements - // when the alias value is a string; if it is already broken out into an array, - // then the values therein are used literally. - $alias_variables = array( '{{@target}}' => '@none' ); - if ($target_site_alias) { - $alias_variables = array( '{{@target}}' => $target_site_alias ); - $target = drush_sitealias_get_record($target_site_alias); - foreach ($target as $key => $value) { - if (!is_array($value)) { - $alias_variables['{{' . $key . '}}'] = $value; - } - } - if (array_key_exists('path-aliases', $target)) { - foreach ($target['path-aliases'] as $key => $value) { - // n.b. $key will contain something like "%root" or "%files". - $alias_variables['{{' . $key . '}}'] = $value; - } - } - } - $alias_value = str_replace(array_keys($alias_variables), array_values($alias_variables), $alias_value); - // Check for unmatched replacements - $matches = array(); - $match_result = preg_match('/{{[%@#]*[a-z0-9.]*}}/', $alias_value, $matches); - if ($match_result) { - $unmatched_replacements = implode(', ', $matches); - $unmatched_replacements = preg_replace('/[{}]/', '', $unmatched_replacements); - return drush_set_error('DRUSH_SHELL_ALIAS_UNMATCHED_REPLACEMENTS', dt('The shell alias @alias-name uses replacements "@unmatched". You must use this command with a site alias (e.g. `drush @myalias @alias-name ...`) that defines all of these variables.', array('@alias-name' => $first, '@unmatched' => $unmatched_replacements))); - } - if (substr($alias_value, 0, 1) == '!') { - $alias_value = ltrim($alias_value, '!'); - $alias_value = array('core-execute', $alias_value); - $escape = FALSE; - } - else { - // Respect quoting. See http://stackoverflow.com/questions/2202435/php-ex - $alias_value = str_getcsv($alias_value, ' '); - } - } - drush_log(dt('Shell alias found: !key => !value', array('!key' => $first, '!value' => implode(' ', $alias_value))), LogLevel::DEBUG); - $pos = array_search($first, $argv); - $number = 1; - if ($target_site_alias && ($argv[$pos - 1] == $target_site_alias)) { - --$pos; - ++$number; - } - array_splice($argv, $pos, $number, $alias_value); - if (!$escape) { - drush_set_option('escape', FALSE); - } - drush_set_context('argv', $argv); - drush_parse_args(); - _drush_preflight_global_options(); - } -} - -function commandfiles_cache() { - static $commandfiles_cache = NULL; - - if (!isset($commandfiles_cache)) { - $commandfiles_cache = new Drush\Command\Commandfiles(); - } - return $commandfiles_cache; -} diff --git a/vendor/drush/drush/includes/complete.inc b/vendor/drush/drush/includes/complete.inc deleted file mode 100644 index ba36b501eaadaaf9839d9b5c33857dbc96ee031b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/includes/complete.inc +++ /dev/null @@ -1,586 +0,0 @@ -<?php - -use Consolidation\AnnotatedCommand\Parser\CommandInfo; -use Drush\Log\LogLevel; - -/** - * @file - * - * Provide completion output for shells. - * - * This is not called directly, but by shell completion scripts specific to - * each shell (bash, csh etc). These run whenever the user triggers completion, - * typically when pressing <tab>. The shell completion scripts should call - * "drush complete <text>", where <text> is the full command line, which we take - * as input and use to produce a list of possible completions for the - * current/next word, separated by newlines. Typically, when multiple - * completions are returned the shell will display them to the user in a concise - * format - but when a single completion is returned it will autocomplete. - * - * We provide completion for site aliases, commands, shell aliases, options, - * engines and arguments. Displaying all of these when the last word has no - * characters yet is not useful, as there are too many items. Instead we filter - * the possible completions based on position, in a similar way to git. - * For example: - * - We only display site aliases and commands if one is not already present. - * - We only display options if the user has already entered a hyphen. - * - We only display global options before a command is entered, and we only - * display command specific options after the command (Drush itself does not - * care about option placement, but this approach keeps things more concise). - * - * Below is typical output of complete in different situations. Tokens in square - * brackets are optional, and [word] will filter available options that start - * with the same characters, or display all listed options if empty. - * drush --[word] : Output global options - * drush [word] : Output site aliases, sites, commands and shell aliases - * drush [@alias] [word] : Output commands - * drush [@alias] command [word] : Output command specific arguments - * drush [@alias] command --[word] : Output command specific options - * - * Because the purpose of autocompletion is to make the command line more - * efficient for users we need to respond quickly with the list of completions. - * To do this, we call drush_complete() early in the Drush bootstrap, and - * implement a simple caching system. - * - * To generate the list of completions, we set up the Drush environment as if - * the command was called on it's own, parse the command using the standard - * Drush functions, bootstrap the site (if any) and collect available - * completions from various sources. Because this can be somewhat slow, we cache - * the results. The cache strategy aims to balance accuracy and responsiveness: - * - We cache per site, if a site is available. - * - We generate (and cache) everything except arguments at the same time, so - * subsequent completions on the site don't need any bootstrap. - * - We generate and cache arguments on-demand, since these can often be - * expensive to generate. Arguments are also cached per-site. - * - * For argument completions, commandfiles can implement - * COMMANDFILE_COMMAND_complete() returning an array containing a key 'values' - * containing an array of all possible argument completions for that command. - * For example, return array('values' => array('aardvark', 'aardwolf')) offers - * the words 'aardvark' and 'aardwolf', or will complete to 'aardwolf' if the - * letters 'aardw' are already present. Since command arguments are cached, - * commandfiles can bootstrap a site or perform other somewhat time consuming - * activities to retrieve the list of possible arguments. Commands can also - * clear the cache (or just the "arguments" cache for their command) when the - * completion results have likely changed - see drush_complete_cache_clear(). - * - * Commandfiles can also return a special optional element in their array with - * the key 'files' that contains an array of patterns/flags for the glob() - * function. These are used to produce file and directory completions (the - * results of these are not cached, since this is a fast operation). - * See http://php.net/glob for details of valid patterns and flags. - * For example the following will complete the command arguments on all - * directories, as well as files ending in tar.gz: - * return array( - * 'files' => array( - * 'directories' => array( - * 'pattern' => '*', - * 'flags' => GLOB_ONLYDIR, - * ), - * 'tar' => array( - * 'pattern' => '*.tar.gz', - * ), - * ), - * ); - * - * To check completion results without needing to actually trigger shell - * completion, you can call this manually using a command like: - * - * drush --early=includes/complete.inc [--complete-debug] drush [@alias] [command]... - * - * If you want to simulate the results of pressing tab after a space (i.e. - * and empty last word, include '' on the end of your command: - * - * drush --early=includes/complete.inc [--complete-debug] drush '' - */ - -/** - * Produce autocomplete output. - * - * Determine position (is there a site-alias or command set, and are we trying - * to complete an option). Then produce a list of completions for the last word - * and output them separated by newlines. - */ -function drush_early_complete() { - // We use a distinct --complete-debug option to avoid unwanted debug messages - // being printed when users use this option for other purposes in the command - // they are trying to complete. - drush_set_option(LogLevel::DEBUG, FALSE); - if (drush_get_option('complete-debug', FALSE)) { - drush_set_context('DRUSH_DEBUG', TRUE); - } - // Set up as if we were running the command, and attempt to parse. - $argv = drush_complete_process_argv(); - if ($alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS')) { - $set_sitealias_name = $alias; - $set_sitealias = drush_sitealias_get_record($alias); - } - - // Arguments have now had site-aliases and options removed, so we take the - // first item as our command. We need to know if the command is valid, so that - // we know if we are supposed to complete an in-progress command name, or - // arguments for a command. We do this by checking against our per-site cache - // of command names (which will only bootstrap if the cache needs to be - // regenerated), rather than drush_parse_command() which always requires a - // site bootstrap. - $arguments = drush_get_arguments(); - $set_command_name = NULL; - if (isset($arguments[0]) && in_array($arguments[0] . ' ', drush_complete_get('command-names'))) { - $set_command_name = $arguments[0]; - } - // We unset the command if it is "help" but that is not explicitly found in - // args, since Drush sets the command to "help" if no command is specified, - // which prevents completion of global options. - if ($set_command_name == 'help' && !array_search('help', $argv)) { - $set_command_name = NULL; - } - - // Determine the word we are trying to complete, and if it is an option. - $last_word = end($argv); - $word_is_option = FALSE; - if (!empty($last_word) && $last_word[0] == '-') { - $word_is_option = TRUE; - $last_word = ltrim($last_word, '-'); - } - - $completions = array(); - if (!$set_command_name) { - // We have no command yet. - if ($word_is_option) { - // Include global option completions. - $completions += drush_hyphenate_options(drush_complete_match($last_word, drush_complete_get('options'))); - } - else { - if (empty($set_sitealias_name)) { - // Include site alias completions. - $completions += drush_complete_match($last_word, drush_complete_get('site-aliases')); - } - // Include command completions. - $completions += drush_complete_match($last_word, drush_complete_get('command-names')); - } - } - else { - if ($last_word == $set_command_name) { - // The user just typed a valid command name, but we still do command - // completion, as there may be other commands that start with the detected - // command (e.g. "make" is a valid command, but so is "make-test"). - // If there is only the single matching command, this will include in the - // completion list so they get a space inserted, confirming it is valid. - $completions += drush_complete_match($last_word, drush_complete_get('command-names')); - } - else if ($word_is_option) { - // Include command option completions. - $completions += drush_hyphenate_options(drush_complete_match($last_word, drush_complete_get('options', $set_command_name))); - } - else { - // Include command argument completions. - $argument_completion = drush_complete_get('arguments', $set_command_name); - if (isset($argument_completion['values'])) { - $completions += drush_complete_match($last_word, $argument_completion['values']); - } - if (isset($argument_completion['files'])) { - $completions += drush_complete_match_file($last_word, $argument_completion['files']); - } - } - } - - if (!empty($completions)) { - sort($completions); - return implode("\n", $completions); - } - return TRUE; -} - -/** - * This function resets the raw arguments so that Drush can parse the command as - * if it was run directly. The shell complete command passes the - * full command line as an argument, and the --early and --complete-debug - * options have to come before that, and the "drush" bash script will add a - * --php option on the end, so we end up with something like this: - * - * /path/to/drush.php --early=includes/complete.inc [--complete-debug] drush [@alias] [command]... --php=/usr/bin/php - * - * Note that "drush" occurs twice, and also that the second occurrence could be - * an alias, so we can't easily use it as to detect the start of the actual - * command. Hence our approach is to remove the initial "drush" and then any - * options directly following that - what remains is then the command we need - * to complete - i.e.: - * - * drush [@alias] [command]... - * - * Note that if completion is initiated following a space an empty argument is - * added to argv. So in that case argv looks something like this: - * array ( - * '0' => '/path/to/drush.php', - * '1' => '--early=includes/complete.inc', - * '2' => 'drush', - * '3' => 'topic', - * '4' => '', - * '5' => '--php=/usr/bin/php', - * ); - * - * @return $args - * Array of arguments (argv), excluding the initial command and options - * associated with the complete call. - * array ( - * '0' => 'drush', - * '1' => 'topic', - * '2' => '', - * ); - */ -function drush_complete_process_argv() { - $argv = drush_get_context('argv'); - // Remove the first argument, which will be the "drush" command. - array_shift($argv); - while (substr($arg = array_shift($argv), 0, 2) == '--') { - // We remove all options, until we get to a non option, which - // marks the start of the actual command we are trying to complete. - } - // Replace the initial argument. - array_unshift($argv, $arg); - // Remove the --php option at the end if exists (added by the "drush" shell - // script that is called when completion is requested). - if (substr(end($argv), 0, 6) == '--php=') { - array_pop($argv); - } - drush_set_context('argv', $argv); - drush_set_command(NULL); - // Reparse arguments, site alias, and command. - drush_parse_args(); - // Ensure the base environment is configured, so tests look in the correct - // places. - _drush_preflight_base_environment(); - // Check for and record any site alias. - drush_sitealias_check_arg(); - drush_sitealias_check_site_env(); - // We might have just changed our root--run drush_select_bootstrap_class() again. - $bootstrap = drush_select_bootstrap_class(); - - // Return the new argv for easy reference. - return $argv; -} - -/** - * Retrieves the appropriate list of candidate completions, then filters this - * list using the last word that we are trying to complete. - * - * @param string $last_word - * The last word in the argument list (i.e. the subject of completion). - * @param array $values - * Array of possible completion values to filter. - * - * @return array - * Array of candidate completions that start with the same characters as the - * last word. If the last word is empty, return all candidates. - */ -function drush_complete_match($last_word, $values) { - // Using preg_grep appears to be faster that strpos with array_filter/loop. - return preg_grep('/^' . preg_quote($last_word, '/') . '/', $values); -} - -/** - * Retrieves the appropriate list of candidate file/directory completions, - * filtered by the last word that we are trying to complete. - * - * @param string $last_word - * The last word in the argument list (i.e. the subject of completion). - * @param array $files - * Array of file specs, each with a pattern and flags subarray. - * - * @return array - * Array of candidate file/directory completions that start with the same - * characters as the last word. If the last word is empty, return all - * candidates. - */ -function drush_complete_match_file($last_word, $files) { - $return = array(); - if ($last_word[0] == '~') { - // Complete does not do tilde expansion, so we do it here. - // We shell out (unquoted) to expand the tilde. - drush_shell_exec('echo ' . $last_word); - return drush_shell_exec_output(); - } - - $dir = ''; - if (substr($last_word, -1) == '/' && is_dir($last_word)) { - // If we exactly match a trailing directory, then we use that as the base - // for the listing. We only do this if a trailing slash is present, since at - // this stage it is still possible there are other directories that start - // with this string. - $dir = $last_word; - } - else { - // Otherwise we discard the last part of the path (this is matched against - // the list later), and use that as our base. - $dir = dirname($last_word); - if (empty($dir) || $dir == '.' && $last_word != '.' && substr($last_word, 0, 2) != './') { - // We are looking at the current working directory, so unless the user is - // actually specifying a leading dot we leave the path empty. - $dir = ''; - } - else { - // In all other cases we need to add a trailing slash. - $dir .= '/'; - } - } - - foreach ($files as $spec) { - // We always include GLOB_MARK, as an easy way to detect directories. - $flags = GLOB_MARK; - if (isset($spec['flags'])) { - $flags = $spec['flags'] | GLOB_MARK; - } - $listing = glob($dir . $spec['pattern'], $flags); - $return = array_merge($return, drush_complete_match($last_word, $listing)); - } - // If we are returning a single item (which will become part of the final - // command), we need to use the full path, and we need to escape it - // appropriately. - if (count($return) == 1) { - // Escape common shell metacharacters (we don't use escapeshellarg as it - // single quotes everything, even when unnecessary). - $item = array_pop($return); - $item = preg_replace('/[ |&;()<>]/', "\\\\$0", $item); - if (substr($item, -1) !== '/') { - // Insert a space after files, since the argument is complete. - $item = $item . ' '; - } - $return = array($item); - } - else { - $firstchar = TRUE; - if ($last_word[0] == '/') { - // If we are working with absolute paths, we need to check if the first - // character of all the completions matches. If it does, then we pass a - // full path for each match, so the shell completes as far as it can, - // matching the behaviour with relative paths. - $pos = strlen($last_word); - foreach ($return as $id => $item) { - if ($item[$pos] !== $return[0][$pos]) { - $firstchar = FALSE; - continue; - } - } - } - foreach ($return as $id => $item) { - // For directories we leave the path alone. - $slash_pos = strpos($last_word, '/'); - if ($slash_pos === 0 && $firstchar) { - // With absolute paths where completions share initial characters, we - // pass in a resolved path. - $return[$id] = realpath($item); - } - else if ($slash_pos !== FALSE && $dir != './') { - // For files, we pass only the file name, ignoring the false match when - // the user is using a single dot relative path. - $return[$id] = basename($item); - } - } - } - return $return; -} - -/** - * Simple helper function to ensure options are properly hyphenated before we - * return them to the user (we match against the non-hyphenated versions - * internally). - * - * @param array $options - * Array of unhyphenated option names. - * - * @return array - * Array of hyphenated option names. - */ -function drush_hyphenate_options($options) { - foreach ($options as $key => $option) { - $options[$key] = '--' . ltrim($option, '--'); - } - return $options; -} - -/** - * Retrieves from cache, or generates a listing of completion candidates of a - * specific type (and optionally, command). - * - * @param string $type - * String indicating type of completions to return. - * See drush_complete_rebuild() for possible keys. - * @param string $command - * An optional command name if command specific completion is needed. - * - * @return array - * List of candidate completions. - */ -function drush_complete_get($type, $command = NULL) { - static $complete; - if (empty($command)) { - // Quick return if we already have a complete static cache. - if (!empty($complete[$type])) { - return $complete[$type]; - } - // Retrieve global items from a non-command specific cache, or rebuild cache - // if needed. - $cache = drush_cache_get(drush_complete_cache_cid($type), 'complete'); - if (isset($cache->data)) { - return $cache->data; - } - $complete = drush_complete_rebuild(); - return $complete[$type]; - } - // Retrieve items from a command specific cache. - $cache = drush_cache_get(drush_complete_cache_cid($type, $command), 'complete'); - if (isset($cache->data)) { - return $cache->data; - } - // Build argument cache - built only on demand. - if ($type == 'arguments') { - return drush_complete_rebuild_arguments($command); - } - // Rebuild cache of general command specific items. - if (empty($complete)) { - $complete = drush_complete_rebuild(); - } - if (!empty($complete['commands'][$command][$type])) { - return $complete['commands'][$command][$type]; - } - return array(); -} - -/** - * Rebuild and cache completions for everything except command arguments. - * - * @return array - * Structured array of completion types, commands and candidate completions. - */ -function drush_complete_rebuild() { - $complete = array(); - // Bootstrap to the site level (if possible) - commands may need to check - // the bootstrap level, and perhaps bootstrap higher in extraordinary cases. - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION); - $commands = drush_get_commands(); - foreach ($commands as $command_name => $command) { - // Add command options and suboptions. - $options = array_keys($command['options']); - foreach ($command['sub-options'] as $option => $sub_options) { - $options = array_merge($options, array_keys($sub_options)); - } - $complete['commands'][$command_name]['options'] = $options; - } - // We treat shell aliases as commands for the purposes of completion. - $complete['command-names'] = array_merge(array_keys($commands), array_keys(drush_get_context('shell-aliases', array()))); - $site_aliases = _drush_sitealias_all_list(); - // TODO: Figure out where this dummy @0 alias is introduced. - unset($site_aliases['@0']); - $complete['site-aliases'] = array_keys($site_aliases); - $complete['options'] = array_keys(drush_get_global_options()); - - // We add a space following all completes. Eventually there may be some - // items (e.g. options that we know need values) where we don't add a space. - array_walk_recursive($complete, 'drush_complete_trailing_space'); - drush_complete_cache_set($complete); - return $complete; -} - -/** - * Helper callback function that adds a trailing space to completes in an array. - */ -function drush_complete_trailing_space(&$item, $key) { - if (!is_array($item)) { - $item = (string)$item . ' '; - } -} - -/** - * Rebuild and cache completions for command arguments. - * - * @param string $command - * A specific command to retrieve and cache arguments for. - * - * @return array - * Structured array of candidate completion arguments, keyed by the command. - */ -function drush_complete_rebuild_arguments($command) { - // Bootstrap to the site level (if possible) - commands may need to check - // the bootstrap level, and perhaps bootstrap higher in extraordinary cases. - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_SITE); - $commands = drush_get_commands(); - $command_info = $commands[$command]; - if ($callback = $command_info['annotated-command-callback']) { - list($classname, $method) = $callback; - $commandInfo = new CommandInfo($classname, $method); - if ($callable = $commandInfo->getAnnotation('complete')) { - $result = call_user_func($callable); - } - } - else { - $hook = str_replace("-", "_", $command_info['command-hook']); - $result = drush_command_invoke_all($hook . '_complete'); - } - if (isset($result['values'])) { - // We add a space following all completes. Eventually there may be some - // items (e.g. comma separated arguments) where we don't add a space. - array_walk($result['values'], 'drush_complete_trailing_space'); - } - - $complete = array( - 'commands' => array( - $command => array( - 'arguments' => $result, - ) - ) - ); - drush_complete_cache_set($complete); - return $complete['commands'][$command]['arguments']; -} - -/** - * Stores caches for completions. - * - * @param $complete - * A structured array of completions, keyed by type, including a 'commands' - * type that contains all commands with command specific completions keyed by - * type. The array does not need to include all types - used by - * drush_complete_rebuild_arguments(). - */ -function drush_complete_cache_set($complete) { - foreach ($complete as $type => $values) { - if ($type == 'commands') { - foreach ($values as $command_name => $command) { - foreach ($command as $command_type => $command_values) { - drush_cache_set(drush_complete_cache_cid($command_type, $command_name), $command_values, 'complete', DRUSH_CACHE_TEMPORARY); - } - } - } - else { - drush_cache_set(drush_complete_cache_cid($type), $values, 'complete', DRUSH_CACHE_TEMPORARY); - } - } -} - -/** - * Generate a cache id. - * - * @param $type - * The completion type. - * @param $command - * The command name (optional), if completions are command specific. - * - * @return string - * Cache id. - */ -function drush_complete_cache_cid($type, $command = NULL) { - // For per-site caches, we include the site root and uri/path in the cache id - // hash. These are quick to determine, and prevents a bootstrap to site just - // to get a validated root and URI. Because these are not validated, there is - // the possibility of cache misses/ but they should be rare, since sites are - // normally referred to the same way (e.g. a site alias, or using the current - // directory), at least within a single command completion session. - // We also static cache them, since we may get differing results after - // bootstrap, which prevents the caches from being found on the next call. - static $root, $site; - if (empty($root)) { - $root = drush_get_option(array('r', 'root'), drush_locate_root()); - $site = drush_get_option(array('l', 'uri'), drush_site_path()); - } - return drush_get_cid('complete', array(), array($type, $command, $root, $site)); -} diff --git a/vendor/drush/drush/includes/context.inc b/vendor/drush/drush/includes/context.inc index a10996d486c48071910b179d5253fcdc62bd6228..3070143d6637f39f58c78460f8b57dc633d1eb44 100644 --- a/vendor/drush/drush/includes/context.inc +++ b/vendor/drush/drush/includes/context.inc @@ -39,6 +39,7 @@ * the matching configuration file through the drush_save_config() function. */ +use Drush\Drush; use Drush\Log\LogLevel; @@ -74,113 +75,20 @@ * default : The script might provide some sensible defaults during init. */ function drush_context_names() { - static $contexts = array( + static $contexts = [ 'process', 'cli', 'stdin', 'specific', 'alias', 'custom', 'site', 'drupal', 'user', 'home.drush', 'system', - 'drush', 'default'); + 'drush', 'default' + ]; return $contexts; } -/** - * Return a list of possible drushrc file locations. - * - * @context - * A valid drush context from drush_context_names(). - * @prefix - * Optional. Specify a prefix to prepend to ".drushrc.php" when looking - * for config files. Most likely used by contrib commands. - * @return - * An associative array containing possible config files to load - * The keys are the 'context' of the files, the values are the file - * system locations. - */ -function _drush_config_file($context, $prefix = NULL, $version = '') { - $configs = array(); - $base_name = 'drush' . $version . 'rc.php'; - $config_file = $prefix ? $prefix . '.' . $base_name : $base_name; - - // Did the user explicitly specify a config file? - if ($config_list = (array)drush_get_context('DRUSH_CONFIG')) { - foreach ($config_list as $config) { - if (is_dir($config)) { - $config = $config . '/' . $config_file; - } - $configs['custom'][] = $config; - } - } - - if ($drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT')) { - $configs['drupal'] = array( - $drupal_root . '/../drush/' . $config_file, - $drupal_root . '/sites/all/drush/' . $config_file, - $drupal_root . '/drush/' . $config_file, - ); - - if ($conf_path = drush_get_context('DRUSH_SELECTED_DRUPAL_SITE_CONF_PATH', 'sites/default')) { - $site_path = $drupal_root . '/' . $conf_path; - $configs['site'] = $site_path . "/" . $config_file; - } - } - - // in the user home directory - $server_home = drush_server_home(); - if (isset($server_home)) { - $configs['user'] = $server_home . '/.' . $config_file; - } - - // in $HOME/.drush directory - $per_user_config_dir = drush_get_context('DRUSH_PER_USER_CONFIGURATION'); - if (!empty($per_user_config_dir)) { - $configs['home.drush'] = $per_user_config_dir . '/' . $config_file; - } - - // In the system wide configuration folder. - $configs['system'] = drush_get_context('DRUSH_SITE_WIDE_CONFIGURATION') . '/' . $config_file; - - // in the drush installation folder - $configs['drush'] = dirname(__FILE__) . '/../' . $config_file; - - return empty($configs[$context]) ? '' : $configs[$context]; -} - - -/** - * Load drushrc files (if available) from several possible locations. - */ -function drush_load_config($context) { - drush_load_config_file($context, _drush_config_file($context)); - drush_load_config_file($context, _drush_config_file($context, '', DRUSH_MAJOR_VERSION)); -} - -function drush_load_config_file($context, $config_list) { - foreach ((array)$config_list as $config) { - if (file_exists($config)) { - $options = $aliases = $command_specific = $override = array(); - drush_log(dt('Loading drushrc "!config" into "!context" scope.', array('!config' => realpath($config), '!context' => $context)), LogLevel::BOOTSTRAP); - $ret = @include_once($config); - if ($ret === FALSE) { - drush_log(dt('Cannot open drushrc "!config", ignoring.', array('!config' => realpath($config))), LogLevel::WARNING); - return FALSE; - } - if (!empty($options) || !empty($aliases) || !empty($command_specific) || !empty($override)) { - $options = array_merge(drush_get_context($context), $options); - $options['config-file'] = realpath($config); - - unset($options['site-aliases']); - $options['command-specific'] = array_merge(isset($command_specific) ? $command_specific : array(), isset($options['command-specific']) ? $options['command-specific'] : array()); - - drush_set_config_options($context, $options, $override); - } - } - } -} - -function drush_set_config_options($context, $options, $override = array()) { +function drush_set_config_options($context, $options, $override = []) { // Copy 'config-file' into 'context-path', converting to an array to hold multiple values if necessary if (isset($options['config-file'])) { if (isset($options['context-path'])) { - $options['context-path'] = array_merge(array($options['config-file']), is_array($options['context-path']) ? $options['context-path'] : array($options['context-path'])); + $options['context-path'] = array_merge([$options['config-file']], is_array($options['context-path']) ? $options['context-path'] : [$options['context-path']]); } else { $options['context-path'] = $options['config-file']; @@ -229,7 +137,7 @@ function drush_set_config_special_contexts(&$options) { // Change the keys of the site aliases from 'alias' to '@alias' if (array_key_exists('site-aliases', $options)) { $user_aliases = $options['site-aliases']; - $options['site-aliases'] = array(); + $options['site-aliases'] = []; foreach ($user_aliases as $alias_name => $alias_value) { if (substr($alias_name,0,1) != '@') { $alias_name = "@$alias_name"; @@ -257,7 +165,7 @@ function drush_set_config_special_contexts(&$options) { } if (array_key_exists('merge-associative', $info)) { foreach ($value as $subkey => $subvalue) { - $cache[$subkey] = array_merge(isset($cache[$subkey]) ? $cache[$subkey] : array(), $subvalue); + $cache[$subkey] = array_merge(isset($cache[$subkey]) ? $cache[$subkey] : [], $subvalue); } } else { @@ -292,6 +200,8 @@ function drush_set_config_special_contexts(&$options) { * * @return * An associative array of the settings specified in the request context. + * + * @deprecated */ function drush_set_context($context, $value) { $cache =& drush_get_context($context); @@ -327,12 +237,14 @@ function drush_set_context($context, $value) { * If context is not supplied, the entire context cache will be returned. * Otherwise only the requested context will be returned. * If the context does not exist yet, it will be initialized to an empty array. + * + * @deprecated */ function &drush_get_context($context = NULL, $default = NULL) { - static $cache = array(); + static $cache = []; if (isset($context)) { if (!isset($cache[$context])) { - $default = !isset($default) ? array() : $default; + $default = !isset($default) ? [] : $default; $cache[$context] = $default; } return $cache[$context]; @@ -365,6 +277,8 @@ function drush_set_arguments($arguments) { * the array will not include the command name. * * @see drush_set_arguments() + * + * @deprecated */ function drush_get_arguments() { return drush_get_context('arguments'); @@ -386,6 +300,8 @@ function drush_set_command($command) { /** * Return the command being executed. + * + * @deprecated() */ function drush_get_command() { return drush_get_context('command'); @@ -404,8 +320,16 @@ function drush_get_command() { * Optional. The value to return if the option has not been set * @param context * Optional. The context to check for the option. If this is set, only this context will be searched. + * + * @deprecated */ function drush_get_option($option, $default = NULL, $context = NULL) { + // Uncomment when fumigating. +// $backtrace = debug_backtrace()[1]; +// if (!strpos($backtrace['file'], 'engines') && !strpos($backtrace['file'], 'preflight') && !strpos($backtrace['file'], 'backend')) { +// drush_log('drush_get_option() has been deprecated and is unreliable. Called by '. $backtrace['function']. ' in '. $backtrace['file']. ':'. $backtrace['line'], LogLevel::WARNING); +// } + $value = NULL; if ($context) { @@ -446,7 +370,7 @@ function drush_get_option($option, $default = NULL, $context = NULL) { * @param context * Optional. The context to check for the option. If this is set, only this context will be searched. */ -function drush_get_option_list($option, $default = array(), $context = NULL) { +function drush_get_option_list($option, $default = [], $context = NULL) { $result = drush_get_option($option, $default, $context); if (!is_array($result)) { @@ -508,7 +432,7 @@ function drush_sitealias_get_option($site_alias_record, $option, $default = NULL * the specific value for the option in that context. */ function drush_get_context_options($option, $flatten = FALSE) { - $result = array(); + $result = []; $contexts = drush_context_names(); foreach ($contexts as $context) { @@ -533,7 +457,7 @@ function drush_get_context_options($option, $flatten = FALSE) { function drush_get_merged_options() { $contexts = drush_context_names(); $cache = drush_get_context(); - $result = array(); + $result = []; foreach (array_reverse($contexts) as $context) { if (array_key_exists($context, $cache)) { $result = array_merge($result, $cache[$context]); @@ -543,22 +467,6 @@ function drush_get_merged_options() { return $result; } -/** - * Retrieves a collapsed list of all options - * with a specified prefix. - */ -function drush_get_merged_prefixed_options($prefix) { - $merged_options = drush_get_merged_options(); - $result = array(); - foreach ($merged_options as $key => $value) { - if ($prefix == substr($key, 0, strlen($prefix))) { - $result[substr($key, strlen($prefix))] = $value; - } - } - - return $result; -} - /** * Helper function to recurse through possible option names */ @@ -631,39 +539,3 @@ function drush_unset_option($option, $context = NULL) { } } } - -/** - * Save the settings in a specific context to the applicable configuration file - * This is useful is you want certain settings to be available automatically the next time a command is executed. - * - * @param $context - * The context to save - */ -function drush_save_config($context) { - $filename = _drush_config_file($context); - if (is_array($filename)) { - $filename = $filename[0]; - } - - if ($filename) { - $cache = drush_get_context($context); - - $fp = fopen($filename, "w+"); - if (!$fp) { - return drush_set_error('DRUSH_PERM_ERROR', dt('Drushrc (!filename) could not be written', array('!filename' => $filename))); - } - else { - fwrite($fp, "<?php\n"); - foreach ($cache as $key => $value) { - $line = "\n\$options['$key'] = ". var_export($value, TRUE) .';'; - fwrite($fp, $line); - } - fwrite($fp, "\n"); - fclose($fp); - drush_log(dt('Drushrc file (!filename) was written successfully', array('!filename' => $filename))); - return TRUE; - } - - } - return FALSE; -} diff --git a/vendor/drush/drush/includes/dbtng.inc b/vendor/drush/drush/includes/dbtng.inc deleted file mode 100644 index e7e105b82a0f902e60c6d155fa20282436aa8caa..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/includes/dbtng.inc +++ /dev/null @@ -1,194 +0,0 @@ -<?php - -/** - * @file - * Wrappers to abstract database operations from Drupal version. - */ - -/** - * @defgroup dbfunctions Database convenience functions. - * @{ - */ - -/** - * Replace named placeholders in a WHERE snippet. - * - * Helper function to allow the usage of Drupal 7+ WHERE snippets - * with named placeholders in code for Drupal 6. - * - * @param $where - * String with a WHERE snippet using named placeholders. - * @param $args - * Array of placeholder values. - * @return - * String. $where filled with literals from $args. - */ -function _drush_replace_query_placeholders($where, $args) { - foreach ($args as $key => $data) { - if (is_array($data)) { - $new_keys = array(); - // $data can't have keys that are a prefix of other keys to - // prevent a corrupted result in the below calls to str_replace(). - // To avoid this we will use a zero padded indexed array of the values of $data. - $pad_length = strlen((string)count(array_values($data))); - foreach (array_values($data) as $i => $value) { - if (!is_numeric($value)) { - $value = "'".$value."'"; - } - $new_keys[$key . '_' . str_pad($i, $pad_length, '0', STR_PAD_LEFT)] = $value; - } - $where = preg_replace('#' . $key . '\b#', implode(', ', array_keys($new_keys)), $where); - unset($args[$key]); - $args += $new_keys; - } - else if (!is_numeric($data)) { - $args[$key] = "'".$data."'"; - } - } - - foreach ($args as $key => $data) { - $where = str_replace($key, $data, $where); - } - - return $where; -} - -/** - * A db_select() that works for any version of Drupal. - * - * @param $table - * String. The table to operate on. - * @param $fields - * Array or string. Fields affected in this operation. Valid string values are '*' or a single column name. - * @param $where - * String. WHERE snippet for the operation. It uses named placeholders. see @_drush_replace_query_placeholders() - * @param $args - * Array. Arguments for the WHERE snippet. - * @param $start - * Int. Value for OFFSET. - * @param $length - * Int. Value for LIMIT. - * @param $order_by_field - * String. Database column to order by. - * @param $order_by_direction - * ('ASC', 'DESC'). Ordering direction. - * @return - * A database resource. - */ -function drush_db_select($table, $fields = '*', $where = NULL, $args = NULL, $start = NULL, $length = NULL, $order_by_field = NULL, $order_by_direction = 'ASC') { - if (drush_drupal_major_version() >= 7) { - if (!is_array($fields)) { - if ($fields == '*') { - $fields = array(); - } - else { - $fields = array($fields); - } - } - $query = db_select($table, $table) - ->fields($table, $fields); - if (!empty($where)) { - $query = $query->where($where, $args); - } - if (isset($order_by_field)) { - $query = $query->orderBy($order_by_field, $order_by_direction); - } - if (isset($length)) { - $query = $query->range($start, $length); - } - return $query->execute(); - } - else { - if (is_array($fields)) { - $fields = implode(', ', $fields); - } - $query = "SELECT $fields FROM {{$table}}"; - if (!empty($where)) { - $where = _drush_replace_query_placeholders($where, $args); - $query .= " WHERE ".$where; - } - if (isset($order_by_field)) { - $query .= " ORDER BY $order_by_field $order_by_direction"; - } - if (isset($length)) { - $sql = drush_sql_get_class(); - $db_scheme = $sql->scheme(); - if ($db_scheme == 'oracle') - return db_query_range($query, $start, $length); - else { - $limit = " LIMIT $length"; - if (isset($start)) { - $limit .= " OFFSET $start"; - } - $query .= $limit; - } - } - - return db_query($query, $args); - } -} - -/** - * A db_delete() that works for any version of Drupal. - * - * @param $table - * String. The table to operate on. - * @param $where - * String. WHERE snippet for the operation. It uses named placeholders. see @_drush_replace_query_placeholders() - * @param $args - * Array. Arguments for the WHERE snippet. - * @return - * Affected rows (except on D7+mysql without a WHERE clause - returns TRUE) or FALSE. - */ -function drush_db_delete($table, $where = NULL, $args = NULL) { - if (drush_drupal_major_version() >= 7) { - if (!empty($where)) { - $query = db_delete($table)->where($where, $args); - return $query->execute(); - } - else { - return db_truncate($table)->execute(); - } - } - else { - $query = "DELETE FROM {{$table}}"; - if (!empty($where)) { - $where = _drush_replace_query_placeholders($where, $args); - $query .= ' WHERE '.$where; - } - if (!db_query($query, $args)) { - return FALSE; - } - return db_affected_rows(); - } -} - -/** - * A db_result() that works consistently for any version of Drupal. - * - * @param - * A Database result object. - */ -function drush_db_result($result) { - switch (drush_drupal_major_version()) { - case 6: - return db_result($result); - case 7: - default: - return $result->fetchField(); - } -} - -/** - * A db_fetch_object() that works for any version of Drupal. - * - * @param - * A Database result object. - */ -function drush_db_fetch_object($result) { - return drush_drupal_major_version() >= 7 ? $result->fetchObject() : db_fetch_object($result); -} - -/** - * @} End of "defgroup dbfunctions". - */ diff --git a/vendor/drush/drush/includes/drupal.inc b/vendor/drush/drush/includes/drupal.inc index cee6c48e83166ce45aae09b83ceb887df2f09cd9..04d64f2ca876e75c88d7d21bfac906ec48445aa6 100644 --- a/vendor/drush/drush/includes/drupal.inc +++ b/vendor/drush/drush/includes/drupal.inc @@ -5,30 +5,15 @@ * Utility functions related to Drupal. */ -use Drush\Log\LogLevel; - -/** - * Loads the Drupal autoloader and returns the instance. - */ -function drush_drupal_load_autoloader($drupal_root) { - static $autoloader = FALSE; - - if (!$autoloader) { - $autoloader = require $drupal_root .'/autoload.php'; - if ($autoloader === TRUE) { - // The autoloader was already require(). Assume that Drush and Drupal share an autoloader per - // "Point autoload.php to the proper vendor directory" - https://www.drupal.org/node/2404989 - $autoloader = drush_get_context('DRUSH_CLASSLOADER'); - } - } - return $autoloader; -} +use Drush\Drush; /** * Detects the version number of the current Drupal installation, * if any. Returns FALSE if there is no current Drupal installation, * or it is somehow broken. * + * @deprecated See \Drush\Boot\Boot::getVersion. + * * @return * A string containing the version number of the current * Drupal installation, if any. Otherwise, return FALSE. @@ -37,23 +22,22 @@ function drush_drupal_version($drupal_root = NULL) { static $version = FALSE; if (!$version) { - if (($drupal_root != NULL) || ($drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'))) { - $bootstrap = drush_bootstrap_class_for_root($drupal_root); + if (($drupal_root != NULL) || ($drupal_root = Drush::bootstrapManager()->getRoot())) { + $bootstrap = Drush::bootstrapManager()->bootstrapObjectForRoot($drupal_root); if ($bootstrap) { - $version = $bootstrap->get_version($drupal_root); + $version = $bootstrap->getVersion($drupal_root); } } } return $version; } +/** + * @deprecated @see Drush::drush() + */ function drush_drupal_cache_clear_all() { - if (drush_drupal_major_version() >= 8) { - drush_invoke_process('@self', 'cache-rebuild'); - } - else { - drush_invoke_process('@self', 'cache-clear', array('all')); - } + $process = Drush::drush(Drush::aliasManager()->getSelf(), 'cache-rebuild'); + $process->mustrun(); } /** @@ -69,186 +53,3 @@ function drush_drupal_major_version($drupal_root = NULL) { } return $major_version; } - -/** - * Log Drupal watchdog() calls. - * - * A sneaky implementation of hook_watchdog(), for D6/D7. - */ -function system_watchdog($log_entry) { - // Transform non informative severity levels to 'error' for compatibility with _drush_print_log. - // Other severity levels are coincident with the ones we use in drush. - if (drush_drupal_major_version() >= 6 && $log_entry['severity'] <= 2) { - $severity = 'error'; - } - else { - drush_include_engine('drupal', 'environment'); - $levels = drush_watchdog_severity_levels(); - $severity = $levels[$log_entry['severity']]; - } - // Format the message. - if (is_array($log_entry['variables'])) { - $message = strtr($log_entry['message'], $log_entry['variables']); - } - else { - $message = $log_entry['message']; - } - - // decode_entities() only loaded after FULL bootstrap. - if (function_exists('decode_entities')) { - $message = decode_entities($message); - } - $message = strip_tags($message); - - // Log or print or ignore. Just printing saves memory but thats rarely needed. - switch (drush_get_option('watchdog', 'log')) { - case 'log': - drush_log('WD '. $log_entry['type'] . ': ' . $message, $severity); - break; - case 'print': - // Disable in backend mode since it logs output and the goal is to conserve memory. - // @see _drush_bootstrap_drush(). - if (ob_get_length() === FALSE) { - drush_print('WD '. $severity . ' ' . $log_entry['type'] . ': ' . $message); - } - break; - default: - // Do nothing. - } -} - -/** - * Log the return value of Drupal hook_update_n functions. - * - * This is used during install and update to log the output - * of the update process to the logging system. - */ -function _drush_log_update_sql($ret) { - if (count($ret)) { - foreach ($ret as $info) { - if (is_array($info)) { - if (!$info['success']) { - drush_set_error('DRUPAL_UPDATE_FAILED', $info['query']); - } - else { - drush_log($info['query'], ($info['success']) ? LogLevel::SUCCESS : LogLevel::ERROR); - } - } - } - } -} - -function drush_find_profiles($drupal_root , $key = 'name') { - return drush_scan_directory($drupal_root . '/profiles', "/.*\.profile$/", array('.', '..', 'CVS', 'tests'), 0, 2, $key); -} - -/** - * Parse Drupal info file format. - * - * Copied with modifications from includes/common.inc. - * - * @see drupal_parse_info_file - */ -function drush_drupal_parse_info_file($filename) { - if (!file_exists($filename)) { - return array(); - } - - $data = file_get_contents($filename); - return _drush_drupal_parse_info_file($data); -} - -/** - * Parse the info file. - */ -function _drush_drupal_parse_info_file($data, $merge_item = NULL) { - if (!$data) { - return FALSE; - } - - if (preg_match_all(' - @^\s* # Start at the beginning of a line, ignoring leading whitespace - ((?: - [^=;\[\]]| # Key names cannot contain equal signs, semi-colons or square brackets, - \[[^\[\]]*\] # unless they are balanced and not nested - )+?) - \s*=\s* # Key/value pairs are separated by equal signs (ignoring white-space) - (?: - ("(?:[^"]|(?<=\\\\)")*")| # Double-quoted string, which may contain slash-escaped quotes/slashes - (\'(?:[^\']|(?<=\\\\)\')*\')| # Single-quoted string, which may contain slash-escaped quotes/slashes - ([^\r\n]*?) # Non-quoted string - )\s*$ # Stop at the next end of a line, ignoring trailing whitespace - @msx', $data, $matches, PREG_SET_ORDER)) { - $info = array(); - foreach ($matches as $match) { - // Fetch the key and value string. - $i = 0; - foreach (array('key', 'value1', 'value2', 'value3') as $var) { - $$var = isset($match[++$i]) ? $match[$i] : ''; - } - $value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3; - - // Parse array syntax. - $keys = preg_split('/\]?\[/', rtrim($key, ']')); - $last = array_pop($keys); - $parent = &$info; - - // Create nested arrays. - foreach ($keys as $key) { - if ($key == '') { - $key = count($parent); - } - if (isset($merge_item) && isset($parent[$key]) && !is_array($parent[$key])) { - $parent[$key] = array($merge_item => $parent[$key]); - } - if (!isset($parent[$key]) || !is_array($parent[$key])) { - $parent[$key] = array(); - } - $parent = &$parent[$key]; - } - - // Handle PHP constants. - if (defined($value)) { - $value = constant($value); - } - - // Insert actual value. - if ($last == '') { - $last = count($parent); - } - if (isset($merge_item) && isset($parent[$last]) && is_array($parent[$last])) { - $parent[$last][$merge_item] = $value; - } - else { - $parent[$last] = $value; - } - } - return $info; - } - return FALSE; -} - -/** - * Build a cache id to store the install_profile for a given site. - */ -function drush_cid_install_profile() { - return drush_get_cid('install_profile', array(), array(drush_get_context('DRUSH_SELECTED_DRUPAL_SITE_CONF_PATH'))); -} - -/* - * An array of options shared by sql-sanitize and sql-sync commands. - */ -function drupal_sanitize_options() { - return array( - 'sanitize-password' => array( - 'description' => 'The password to assign to all accounts in the sanitization operation, or "no" to keep passwords unchanged.', - 'example-value' => 'password', - 'value' => 'required', - ), - 'sanitize-email' => array( - 'description' => 'The pattern for test email addresses in the sanitization operation, or "no" to keep email addresses unchanged. May contain replacement patterns %uid, %mail or %name.', - 'example-value' => 'user+%uid@localhost', - 'value' => 'required', - ), - ); -} diff --git a/vendor/drush/drush/includes/drush.inc b/vendor/drush/drush/includes/drush.inc index 14da678140f5987e4469702b760e4168b0d2dcbc..1e7f59cf433369c85b8d64e25b1036ca90d7b56e 100644 --- a/vendor/drush/drush/includes/drush.inc +++ b/vendor/drush/drush/includes/drush.inc @@ -5,8 +5,9 @@ * The drush API implementation and helpers. */ -use Drush\Log\Logger; +use Drush\Drush; use Drush\Log\LogLevel; +use Drush\Utils\StringUtils; use Psr\Log\LoggerInterface; /** @@ -39,150 +40,6 @@ */ define('DRUSH_KILOBYTE', 1024); -/** - * Default amount of time, in seconds, to cache downloads via - * drush_download_file(). One day is 86400 seconds. - */ -define('DRUSH_CACHE_LIFETIME_DEFAULT', 86400); - -/** - * Include a file, selecting a version specific file if available. - * - * For example, if you pass the path "/var/drush" and the name - * "update" when bootstrapped on a Drupal 6 site it will first check for - * the presence of "/var/drush/update_6.inc" in include it if exists. If this - * file does NOT exist it will proceed and check for "/var/drush/update.inc". - * If neither file exists, it will return FALSE. - * - * @param $path - * The path you want to search. - * @param $name - * The file base name you want to include (not including a version suffix - * or extension). - * @param $version - * The version suffix you want to include (could be specific to the software - * or platform your are connecting to) - defaults to the current Drupal core - * major version. - * @param $extension - * The extension - defaults to ".inc". - * - * @return - * TRUE if the file was found and included. - */ -function drush_include($path, $name, $version = NULL, $extension = 'inc') { - $name = str_replace('-', '_', $name); - $version = ($version) ? $version : drush_drupal_major_version(); - - $file = sprintf("%s/%s_%s.%s", $path, $name, $version, $extension); - if (file_exists($file)) { - include_once($file); - return TRUE; - } - $file = sprintf("%s/%s.%s", $path, $name, $extension); - if (file_exists($file)) { - include_once($file); - return TRUE; - } - - return drush_set_error('DRUSH_INCLUDE_NO_PATH', dt('Unable to include file !name!version!extension or !name!extension from !path.', array('!name' => $name, '!version' => $version, '!extension' => $extension))); -} - -/** - * Provide a version-specific class instance. - * - * @param $class_name - * The name of the class to instantiate. Appends the Drupal - * major version number to the end of the class name before instantiation. - * @param $constructor_args - * An array of arguments to pass to the class constructor. - * - * Example wrapper class to instantiate a widget, called with the - * arguments for the WIDGET_CLASS constructor: - * - * function drush_WIDGET_CLASS_get_class($widgetName, $widgetStyle) { - * retrun drush_get_class('Widget_Class', func_get_args())); - * } - */ - -function drush_get_class($class_name, $constructor_args = array(), $variations = array()) { - if (empty($variations)) { - $variations[] = drush_drupal_major_version(); - } - $class_names = is_array($class_name) ? $class_name : array($class_name); - foreach ($class_names as $class_name) { - for ($i=count($variations); $i >= 0; $i--) { - $variant_class_name = $class_name . implode('', array_slice($variations, 0, $i)); - if (class_exists($variant_class_name)) { - $reflectionClass = new ReflectionClass($variant_class_name); - return !empty($constructor_args) ? $reflectionClass->newInstanceArgs($constructor_args) : $reflectionClass->newInstanceArgs(); - } - } - } - // Something bad happenned. TODO Exception? - return drush_set_error('DRUSH_GET_CLASS_ERROR', dt('Unable to load class !class', array('!class' => $class_name))); -} - -/** - * Generate an .ini file. used by archive-dump." - * - * @param array $ini - * A two dimensional associative array where top level are sections and - * second level are key => value pairs. - * - * @return string - * .ini formatted text. - */ -function drush_export_ini($ini) { - $output = ''; - foreach ($ini as $section => $pairs) { - if ($section) { - $output .= "[$section]\n"; - } - - foreach ($pairs as $k => $v) { - if ($v) { - $output .= "$k = \"$v\"\n"; - } - } - } - return $output; -} - -/** - * Generate code friendly to the Drupal .info format from a structured array. - * Mostly copied from http://drupalcode.org/viewvc/drupal/contributions/modules/features/features.export.inc. - * - * @param $info - * An array or single value to put in a module's .info file. - * - * @param boolean $integer_keys - * Use integer in keys. - * - * @param $parents - * Array of parent keys (internal use only). - * - * @return - * A code string ready to be written to a module's .info file. - */ -function drush_export_info($info, $integer_keys = FALSE, $parents = array()) { - $output = ''; - if (is_array($info)) { - foreach ($info as $k => $v) { - $child = $parents; - $child[] = $k; - $output .= drush_export_info($v, $integer_keys, $child); - } - } - else if (!empty($info) && count($parents)) { - $line = array_shift($parents); - foreach ($parents as $key) { - $line .= (!$integer_keys && is_numeric($key)) ? "[]" : "[{$key}]"; - } - $line .= " = \"{$info}\"\n"; - return $line; - } - return $output; -} /** * Convert a csv string, or an array of items which @@ -195,16 +52,11 @@ function drush_export_info($info, $integer_keys = FALSE, $parents = array()) { * * @returns array * A simple list of items (e.g. array('a','b','c') + * + * @deprecated Use \Drush\StringUtils::csvToArray */ function _convert_csv_to_array($args) { - // - // Step 1: implode(',',$args) converts from, say, array('a,','b,','c,') to 'a,,b,,c,' - // Step 2: explode(',', ...) converts to array('a','','b','','c','') - // Step 3: array_filter(...) removes the empty items - // Step 4: array_map(...) trims extra whitespace from each item - // (handles csv strings with extra whitespace, e.g. 'a, b, c') - // - return array_map('trim', array_filter(explode(',', is_array($args) ? implode(',',$args) : $args))); + return StringUtils::csvToArray($args); } /** @@ -219,9 +71,9 @@ function _convert_csv_to_array($args) { * A simple list of items (e.g. array('a','b','c') */ function drush_flatten_array($a) { - $result = array(); + $result = []; if (!is_array($a)) { - return array($a); + return [$a]; } foreach ($a as $value) { $result = array_merge($result, drush_flatten_array($value)); @@ -230,8 +82,8 @@ function drush_flatten_array($a) { } /** - * Get the available global options. Used by help command. Command files may - * modify this list using hook_drush_help_alter(). + * Get the available global options. Used by list/help commands. All other users + * should pull options from $application. * * @param boolean $brief * Return a reduced set of important options. Used by help command. @@ -269,397 +121,55 @@ function drush_flatten_array($a) { * - description: The help text for this item. displayed by `drush help`. */ function drush_get_global_options($brief = FALSE) { - $options['root'] = array('short-form' => 'r', 'short-has-arg' => TRUE, 'never-post' => TRUE, 'description' => "Drupal root directory to use (default: current directory).", 'example-value' => 'path'); - $options['uri'] = array('short-form' => 'l', 'short-has-arg' => TRUE, 'never-post' => TRUE, 'description' => 'URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).', 'example-value' => 'http://example.com:8888'); - $options['verbose'] = array('short-form' => 'v', 'context' => 'DRUSH_VERBOSE', 'description' => 'Display extra information about the command.'); - $options['debug'] = array('short-form' => 'd', 'context' => 'DRUSH_DEBUG', 'description' => 'Display even more information, including internal messages.'); - $options['yes'] = array('short-form' => 'y', 'context' => 'DRUSH_AFFIRMATIVE', 'description' => "Assume 'yes' as answer to all prompts."); - $options['no'] = array('short-form' => 'n', 'context' => 'DRUSH_NEGATIVE', 'description' => "Assume 'no' as answer to all prompts."); - $options['simulate'] = array('short-form' => 's', 'context' => 'DRUSH_SIMULATE', 'never-propagate' => TRUE, 'description' => "Simulate all relevant actions (don't actually change the system)."); - $options['pipe'] = array('short-form' => 'p', 'hidden' => TRUE, 'description' => "Emit a compact representation of the command for scripting."); - $options['help'] = array('short-form' => 'h', 'description' => "This help system."); + $options['root'] = ['short-form' => 'r', 'short-has-arg' => TRUE, 'never-post' => TRUE, 'description' => "Drupal root directory to use.", 'example-value' => 'path']; + $options['uri'] = ['short-form' => 'l', 'short-has-arg' => TRUE, 'never-post' => TRUE, 'description' => 'URI of the drupal site to use.', 'example-value' => 'http://example.com:8888']; + $options['verbose'] = ['short-form' => 'v', 'context' => 'DRUSH_VERBOSE', 'description' => 'Display extra information about the command.', 'symfony-conflict' => TRUE]; + $options['debug'] = ['short-form' => 'd', 'context' => 'DRUSH_DEBUG', 'description' => 'Display even more information.']; + $options['yes'] = ['short-form' => 'y', 'context' => 'DRUSH_AFFIRMATIVE', 'description' => "Assume 'yes' as answer to all prompts."]; + $options['no'] = ['short-form' => 'n', 'context' => 'DRUSH_NEGATIVE', 'description' => "Assume 'no' as answer to all prompts."]; + $options['help'] = ['short-form' => 'h', 'description' => "This help system."]; if (!$brief) { - $options['version'] = array('description' => "Show drush version."); - $options['php'] = array('description' => "The absolute path to your PHP interpreter, if not 'php' in the path.", 'example-value' => '/path/to/file', 'never-propagate' => TRUE); - $options['interactive'] = array('short-form' => 'ia', 'description' => "Force interactive mode for commands run on multiple targets (e.g. `drush @site1,@site2 cc --ia`).", 'never-propagate' => TRUE); - $options['tty'] = array('hidden' => TRUE, 'description' => "Force allocation of tty for remote commands", 'never-propagate' => TRUE); - $options['quiet'] = array('short-form' => 'q', 'description' => 'Suppress non-error messages.'); - $options['include'] = array('short-form' => 'i', 'short-has-arg' => TRUE, 'context' => 'DRUSH_INCLUDE', 'never-post' => TRUE, 'propagate-cli-value' => TRUE, 'merge-pathlist' => TRUE, 'description' => "A list of additional directory paths to search for drush commands.", 'example-value' => '/path/dir'); - $options['exclude'] = array('propagate-cli-value' => TRUE, 'never-post' => TRUE, 'merge-pathlist' => TRUE, 'description' => "A list of files and directory paths to exclude from consideration when searching for drush commandfiles.", 'example-value' => '/path/dir'); - $options['config'] = array('short-form' => 'c', 'short-has-arg' => TRUE, 'context' => 'DRUSH_CONFIG', 'never-post' => TRUE, 'propagate-cli-value' => TRUE, 'merge-pathlist' => TRUE, 'description' => "Specify an additional config file to load. See example.drushrc.php.", 'example-value' => '/path/file'); - $options['user'] = array('short-form' => 'u', 'short-has-arg' => TRUE, 'propagate-cli-value' => TRUE, 'description' => "Specify a Drupal user to login with. May be a name or a number.", 'example-value' => 'name_or_number'); - $options['backend'] = array('short-form' => 'b', 'never-propagate' => TRUE, 'description' => "Hide all output and return structured data."); - $options['choice'] = array('description' => "Provide an answer to a multiple-choice prompt.", 'example-value' => 'number'); - $options['variables'] = array('description' => "Comma delimited list of name=value pairs. These values take precedence even over settings.php variable overrides.", 'example-value' => 'foo=bar,baz=yaz'); - $options['search-depth'] = array('description' => "Control the depth that drush will search for alias files.", 'example-value' => 'number'); - $options['ignored-modules'] = array('description' => "Exclude some modules from consideration when searching for drush command files.", 'example-value' => 'token,views'); - $options['no-label'] = array('description' => "Remove the site label that drush includes in multi-site command output (e.g. `drush @site1,@site2 status`)."); - $options['label-separator'] = array('description' => "Specify the separator to use in multi-site command output (e.g. `drush @sites pm-list --label-separator=',' --format=csv`)."); - $options['nocolor'] = array('context' => 'DRUSH_NOCOLOR', 'propagate-cli-value' => TRUE, 'description' => "Suppress color highlighting on log messages."); - $options['show-passwords'] = array('description' => "Show database passwords in commands that display connection information."); - $options['show-invoke'] = array('description' => "Show all function names which could have been called for the current command. See drush_invoke()."); - $options['watchdog'] = array('description' => "Control logging of Drupal's watchdog() to drush log. Recognized values are 'log', 'print', 'disabled'. Defaults to log. 'print' shows calls to admin but does not add them to the log.", 'example-value' => 'print'); - $options['cache-default-class'] = array('description' => "A cache backend class that implements CacheInterface. Defaults to JSONCache.", 'example-value' => 'JSONCache'); - $options['cache-class-<bin>'] = array('description' => "A cache backend class that implements CacheInterface to use for a specific cache bin.", 'example-value' => 'className'); - $options['early'] = array('description' => "Include a file (with relative or full path) and call the drush_early_hook() function (where 'hook' is the filename). The function is called pre-bootstrap and offers an opportunity to alter the drush bootstrap environment or process (returning FALSE from the function will continue the bootstrap), or return output very rapidly (e.g. from caches). See includes/complete.inc for an example."); - $options['alias-path'] = array('context' => 'ALIAS_PATH', 'local-context-only' => TRUE, 'merge-pathlist' => TRUE, 'propagate-cli-value' => TRUE, 'description' => "Specifies the list of paths where drush will search for alias files.", 'example-value' => '/path/alias1:/path/alias2'); - $options['backup-location'] = array('description' => "Specifies the directory where drush will store backups.", 'example-value' => '/path/to/dir'); - $options['confirm-rollback'] = array('description' => 'Wait for confirmation before doing a rollback when something goes wrong.'); - $options['complete-debug'] = array('hidden' => TRUE, 'description' => "Turn on debug mode forf completion code"); - $options['php-options'] = array('description' => "Options to pass to `php` when running drush. Only effective when using the drush.launcher script.", 'never-propagate' => TRUE, 'example-value' => '-d error_reporting="E_ALL"'); - $options['halt-on-error'] = array('propagate-cli-value' => TRUE, 'description' => "Controls error handling of recoverable errors (E_RECOVERABLE_ERROR). --halt-on-error=1: Execution is halted. --halt-on-error=0: Drush execution continues"); - $options['deferred-sanitization'] = array('hidden' => TRUE, 'description' => "Defer calculating the sanitization operations until after the database has been copied. This is done automatically if the source database is remote."); - $options['remote-host'] = array('hidden' => TRUE, 'description' => 'Remote site to execute drush command on. Managed by site alias.'); - $options['remote-user'] = array('hidden' => TRUE, 'description' => 'User account to use with a remote drush command. Managed by site alias.'); - $options['remote-os'] = array('hidden' => TRUE, 'description' => 'The operating system used on the remote host. Managed by site alias.'); - $options['site-list'] = array('hidden' => TRUE, 'description' => 'List of sites to run commands on. Managed by site alias.'); - $options['reserve-margin'] = array('hidden' => TRUE, 'description' => 'Remove columns from formatted opions. Managed by multi-site command handling.'); - $options['strict'] = array('propagate' => TRUE, 'description' => 'Return an error on unrecognized options. --strict=0: Allow unrecognized options. --strict=2: Also return an error on any "warning" log messages. Optional. Default is 1.'); - $options['command-specific'] = array('hidden' => TRUE, 'merge-associative' => TRUE, 'description' => 'Command-specific options.'); - $options['site-aliases'] = array('hidden' => TRUE, 'merge-associative' => TRUE, 'description' => 'List of site aliases.'); - $options['shell-aliases'] = array('hidden' => TRUE, 'merge' => TRUE, 'never-propagate' => TRUE, 'description' => 'List of shell aliases.'); - $options['path-aliases'] = array('hidden' => TRUE, 'never-propagate' => TRUE, 'description' => 'Path aliases from site alias.'); - $options['ssh-options'] = array('never-propagate' => TRUE, 'description' => 'A string of extra options that will be passed to the ssh command', 'example-value' => '-p 100'); - $options['editor'] = array('never-propagate' => TRUE, 'description' => 'A string of bash which launches user\'s preferred text editor. Defaults to ${VISUAL-${EDITOR-vi}}.', 'example-value' => 'vi'); - $options['bg'] = array('never-propagate' => TRUE, 'description' => 'Run editor in the background. Does not work with editors such as `vi` that run in the terminal. Supresses config-import at the end.'); - $options['db-url'] = array('hidden' => TRUE, 'description' => 'A Drupal 6 style database URL. Used by various commands.', 'example-value' => 'mysql://root:pass@127.0.0.1/db'); - $options['drush-coverage'] = array('hidden' => TRUE, 'never-post' => TRUE, 'propagate-cli-value' => TRUE, 'description' => 'File to save code coverage data into.'); - $options['redirect-port'] = array('hidden' => TRUE, 'never-propagate' => TRUE, 'description' => 'Used by the user-login command to specify the redirect port on the local machine; it therefore would not do to pass this to the remote machines.'); - $options['cache-clear'] = array('propagate' => TRUE, 'description' => 'If 0, Drush skips normal cache clearing; the caller should then clear if needed.', 'example-value' => '0', ); - $options['local'] = array('propagate' => TRUE, 'description' => 'Don\'t look in global locations for commandfiles, config, and site aliases'); - $options['no-interaction'] = array('hidden' => TRUE, 'description' => 'Synonym for --yes; provided for light forward-compatibility with future Drush versions.'); - $options['ignored-directories'] = array('propagate' => TRUE, 'description' => "Exclude directories when searching for files in drush_scan_directory().", 'example-value' => 'node_modules,bower_components'); - - $command = array( - 'options' => $options, - '#brief' => FALSE, - ) + drush_command_defaults('global-options', 'global_options', __FILE__); - drush_command_invoke_all_ref('drush_help_alter', $command); - - $options = $command['options']; + $options['simulate'] = ['short-form' => 's', 'context' => 'DRUSH_SIMULATE', 'never-propagate' => TRUE, 'description' => "Simulate all relevant actions (don't actually change the system).", 'symfony-conflict' => TRUE]; + $options['pipe'] = ['short-form' => 'p', 'hidden' => TRUE, 'description' => "Emit a compact representation of the command for scripting."]; + $options['php'] = ['description' => "The absolute path to your PHP interpreter, if not 'php' in the path.", 'example-value' => '/path/to/file', 'never-propagate' => TRUE]; + $options['interactive'] = ['short-form' => 'ia', 'description' => "Force interactive mode for commands run on multiple targets (e.g. `drush @site1,@site2 cc --ia`).", 'never-propagate' => TRUE]; + $options['tty'] = ['hidden' => TRUE, 'description' => "Force allocation of tty for remote commands", 'never-propagate' => TRUE]; + $options['quiet'] = ['short-form' => 'q', 'description' => 'Suppress non-error messages.']; + $options['include'] = ['short-form' => 'i', 'short-has-arg' => TRUE, 'context' => 'DRUSH_INCLUDE', 'never-post' => TRUE, 'propagate-cli-value' => TRUE, 'merge-pathlist' => TRUE, 'description' => "A list of additional directory paths to search for Drush commands. Commandfiles should be placed in a subfolder called 'Commands'.", 'example-value' => '/path/dir']; + $options['exclude'] = ['propagate-cli-value' => TRUE, 'never-post' => TRUE, 'merge-pathlist' => TRUE, 'description' => "A list of files and directory paths to exclude from consideration when searching for drush commandfiles.", 'example-value' => '/path/dir']; + $options['config'] = ['short-form' => 'c', 'short-has-arg' => TRUE, 'context' => 'DRUSH_CONFIG', 'never-post' => TRUE, 'propagate-cli-value' => TRUE, 'merge-pathlist' => TRUE, 'description' => "Specify an additional config file to load. See example.drush.yml", 'example-value' => '/path/file']; + $options['backend'] = ['short-form' => 'b', 'never-propagate' => TRUE, 'description' => "Hide all output and return structured data."]; + $options['choice'] = ['description' => "Provide an answer to a multiple-choice prompt.", 'example-value' => 'number']; + $options['search-depth'] = ['description' => "Control the depth that drush will search for alias files.", 'example-value' => 'number']; + $options['ignored-modules'] = ['description' => "Exclude some modules from consideration when searching for drush command files.", 'example-value' => 'token,views']; + $options['no-label'] = ['description' => "Remove the site label that drush includes in multi-site command output (e.g. `drush @site1,@site2 status`)."]; + $options['label-separator'] = ['description' => "Specify the separator to use in multi-site command output (e.g. `drush @sites pm-list --label-separator=',' --format=csv`).", 'example-value' => ',']; + $options['show-invoke'] = ['description' => "Show all function names which could have been called for the current command. See drush_invoke()."]; + $options['cache-default-class'] = ['description' => "A cache backend class that implements CacheInterface. Defaults to JSONCache.", 'example-value' => 'JSONCache']; + $options['cache-class-<bin>'] = ['description' => "A cache backend class that implements CacheInterface to use for a specific cache bin.", 'example-value' => 'className']; + $options['early'] = ['description' => "Include a file (with relative or full path) and call the drush_early_hook() function (where 'hook' is the filename)"]; + $options['alias-path'] = ['context' => 'ALIAS_PATH', 'local-context-only' => TRUE, 'merge-pathlist' => TRUE, 'propagate-cli-value' => TRUE, 'description' => "Specifies the list of paths where drush will search for alias files.", 'example-value' => '/path/alias1:/path/alias2']; + $options['confirm-rollback'] = ['description' => 'Wait for confirmation before doing a rollback when something goes wrong.']; + $options['php-options'] = ['hidden' => TRUE, 'description' => "Options to pass to `php` when running drush. Only effective when specified in a site alias definition.", 'never-propagate' => TRUE, 'example-value' => '-d error_reporting="E_ALL"']; + $options['halt-on-error'] = ['propagate-cli-value' => TRUE, 'description' => "Manage recoverable errors. Values: 1=Execution halted. 0=Execution continues."]; + $options['remote-host'] = ['hidden' => TRUE, 'description' => 'Remote site to execute drush command on. Managed by site alias.', 'example-value' => 'http://example.com']; + $options['remote-user'] = ['hidden' => TRUE, 'description' => 'User account to use with a remote drush command. Managed by site alias.', 'example-value' => 'www-data']; + $options['remote-os'] = ['hidden' => TRUE, 'description' => 'The operating system used on the remote host. Managed by site alias.', 'example-value' => 'linux']; + $options['site-list'] = ['hidden' => TRUE, 'description' => 'List of sites to run commands on. Managed by site alias.', 'example-value' => '@site1,@site2']; + $options['reserve-margin'] = ['hidden' => TRUE, 'description' => 'Remove columns from formatted opions. Managed by multi-site command handling.', 'example-value' => 'number']; + $options['strict'] = ['propagate' => TRUE, 'description' => 'Return an error on unrecognized options. --strict=0: Allow unrecognized options.']; + $options['command-specific'] = ['hidden' => TRUE, 'merge-associative' => TRUE, 'description' => 'Command-specific options.']; + $options['site-aliases'] = ['hidden' => TRUE, 'merge-associative' => TRUE, 'description' => 'List of site aliases.']; + $options['shell-aliases'] = ['hidden' => TRUE, 'merge' => TRUE, 'never-propagate' => TRUE, 'description' => 'List of shell aliases.']; + $options['path-aliases'] = ['hidden' => TRUE, 'never-propagate' => TRUE, 'description' => 'Path aliases from site alias.']; + $options['ssh-options'] = ['never-propagate' => TRUE, 'description' => 'A string of extra options that will be passed to the ssh command', 'example-value' => '-p 100']; + $options['drush-coverage'] = ['hidden' => TRUE, 'never-post' => TRUE, 'propagate-cli-value' => TRUE, 'description' => 'File to save code coverage data into.']; + $options['local'] = ['propagate' => TRUE, 'description' => 'Don\'t look in global locations for commandfiles, config, and site aliases']; } return $options; } -/** - * Exits with a message. In general, you should use drush_set_error() instead of - * this function. That lets drush proceed with other tasks. - * TODO: Exit with a correct status code. - */ -function drush_die($msg = NULL, $status = NULL) { - die($msg ? "drush: $msg\n" : ''); -} - -/** - * Check to see if the provided line is a "#!/usr/bin/env drush" - * "shebang" script line. - */ -function _drush_is_drush_shebang_line($line) { - return ((substr($line,0,2) == '#!') && (strstr($line, 'drush') !== FALSE)); -} - -/** - * Check to see if the provided script file is a "#!/usr/bin/env drush" - * "shebang" script line. - */ -function _drush_is_drush_shebang_script($script_filename) { - $result = FALSE; - - if (file_exists($script_filename)) { - $fp = fopen($script_filename, "r"); - if ($fp !== FALSE) { - $line = fgets($fp); - $result = _drush_is_drush_shebang_line($line); - fclose($fp); - } - } - - return $result; -} - -/** - * @defgroup userinput Get input from the user. - * @{ - */ - -/** - * Asks the user a basic yes/no question. - * - * @param string $msg - * The question to ask. - * @param int $indent - * The number of spaces to indent the message. - * - * @return bool - * TRUE if the user enters "y" or FALSE if "n". - */ -function drush_confirm($msg, $indent = 0) { - drush_print_prompt((string)$msg . " (y/n): ", $indent); - - // Automatically accept confirmations if the --yes argument was supplied. - if (drush_get_context('DRUSH_AFFIRMATIVE')) { - drush_print("y"); - return TRUE; - } - // Automatically cancel confirmations if the --no argument was supplied. - elseif (drush_get_context('DRUSH_NEGATIVE')) { - drush_print("n"); - return FALSE; - } - // See http://drupal.org/node/499758 before changing this. - $stdin = fopen("php://stdin","r"); - - while ($line = fgets($stdin)) { - $line = trim($line); - if ($line == 'y') { - return TRUE; - } - if ($line == 'n') { - return FALSE; - } - drush_print_prompt((string)$msg . " (y/n): ", $indent); - } -} - -/** - * Ask the user to select an item from a list. - * From a provided associative array, drush_choice will - * display all of the questions, numbered from 1 to N, - * and return the item the user selected. "0" is always - * cancel; entering a blank line is also interpreted - * as cancelling. - * - * @param $options - * A list of questions to display to the user. The - * KEYS of the array are the result codes to return to the - * caller; the VALUES are the messages to display on - * each line. Special keys of the form '-- something --' can be - * provided as separator between choices groups. Separator keys - * don't alter the numbering. - * @param $prompt - * The message to display to the user prompting for input. - * @param $label - * Controls the display of each line. Defaults to - * '!value', which displays the value of each item - * in the $options array to the user. Use '!key' to - * display the key instead. In some instances, it may - * be useful to display both the key and the value; for - * example, if the key is a user id and the value is the - * user name, use '!value (uid=!key)'. - */ -function drush_choice($options, $prompt = 'Enter a number.', $label = '!value', $widths = array()) { - drush_print(dt($prompt)); - - // Preflight so that all rows will be padded out to the same number of columns - $array_pad = 0; - foreach ($options as $key => $option) { - if (is_array($option) && (count($option) > $array_pad)) { - $array_pad = count($option); - } - } - - $rows[] = array_pad(array('[0]', ':', 'Cancel'), $array_pad + 2, ''); - $selection_number = 0; - foreach ($options as $key => $option) { - if ((substr($key, 0, 3) == '-- ') && (substr($key, -3) == ' --')) { - $rows[] = array_pad(array('', '', $option), $array_pad + 2, ''); - } - else { - $selection_number++; - $row = array("[$selection_number]", ':'); - if (is_array($option)) { - $row = array_merge($row, $option); - } - else { - $row[] = dt($label, array('!number' => $selection_number, '!key' => $key, '!value' => $option)); - } - $rows[] = $row; - $selection_list[$selection_number] = $key; - } - } - drush_print_table($rows, FALSE, $widths); - drush_print_pipe(array_keys($options)); - - // If the user specified --choice, then make an - // automatic selection. Cancel if the choice is - // not an available option. - if (($choice = drush_get_option('choice', FALSE)) !== FALSE) { - // First check to see if $choice is one of the symbolic options - if (array_key_exists($choice, $options)) { - return $choice; - } - // Next handle numeric selections - elseif (array_key_exists($choice, $selection_list)) { - return $selection_list[$choice]; - } - return FALSE; - } - - // If the user specified --no, then cancel; also avoid - // getting hung up waiting for user input in --pipe and - // backend modes. If none of these apply, then wait, - // for user input and return the selected result. - if (!drush_get_context('DRUSH_NEGATIVE') && !drush_get_context('DRUSH_AFFIRMATIVE') && !drush_get_context('DRUSH_PIPE')) { - while ($line = trim(fgets(STDIN))) { - if (array_key_exists($line, $selection_list)) { - return $selection_list[$line]; - } - } - } - // We will allow --yes to confirm input if there is only - // one choice; otherwise, --yes will cancel to avoid ambiguity - if (drush_get_context('DRUSH_AFFIRMATIVE') && (count($options) == 1)) { - return $selection_list[1]; - } - return FALSE; -} - -/** - * Ask the user to select multiple items from a list. - * This is a wrapper around drush_choice, that repeats the selection process, - * allowing users to toggle a number of items in a list. The number of values - * that can be constrained by both min and max: the user will only be allowed - * finalize selection once the minimum number has been selected, and the oldest - * selected value will "drop off" the list, if they exceed the maximum number. - * - * @param $options - * Same as drush_choice() (see above). - * @param $defaults - * This can take 3 forms: - * - FALSE: (Default) All options are unselected by default. - * - TRUE: All options are selected by default. - * - Array of $options keys to be selected by default. - * @param $prompt - * Same as drush_choice() (see above). - * @param $label - * Same as drush_choice() (see above). - * @param $mark - * Controls how selected values are marked. Defaults to '!value (selected)'. - * @param $min - * Constraint on minimum number of selections. Defaults to zero. When fewer - * options than this are selected, no final options will be available. - * @param $max - * Constraint on minimum number of selections. Defaults to NULL (unlimited). - * If the a new selection causes this value to be exceeded, the oldest - * previously selected value is automatically unselected. - * @param $final_options - * An array of additional options in the same format as $options. - * When the minimum number of selections is met, this array is merged into the - * array of options. If the user selects one of these values and the - * selection process will complete (the key for the final option is included - * in the return value). If this is an empty array (default), then a built in - * final option of "Done" will be added to the available options (in this case - * no additional keys are added to the return value). - */ -function drush_choice_multiple($options, $defaults = FALSE, $prompt = 'Select some numbers.', $label = '!value', $mark = '!value (selected)', $min = 0, $max = NULL, $final_options = array()) { - $selections = array(); - // Load default selections. - if (is_array($defaults)) { - $selections = $defaults; - } - elseif ($defaults === TRUE) { - $selections = array_keys($options); - } - $complete = FALSE; - $final_builtin = array(); - if (empty($final_options)) { - $final_builtin['done'] = dt('Done'); - } - $final_options_keys = array_keys($final_options); - while (TRUE) { - $current_options = $options; - // Mark selections. - foreach ($selections as $selection) { - $current_options[$selection] = dt($mark, array('!key' => $selection, '!value' => $options[$selection])); - } - // Add final options, if the minimum number of selections has been reached. - if (count($selections) >= $min) { - $current_options = array_merge($current_options, $final_options, $final_builtin); - } - $toggle = drush_choice($current_options, $prompt, $label); - if ($toggle === FALSE) { - return FALSE; - } - // Don't include the built in final option in the return value. - if (count($selections) >= $min && empty($final_options) && $toggle == 'done') { - return $selections; - } - // Toggle the selected value. - $item = array_search($toggle, $selections); - if ($item === FALSE) { - array_unshift($selections, $toggle); - } - else { - unset($selections[$item]); - } - // If the user selected one of the final options, return. - if (count($selections) >= $min && in_array($toggle, $final_options_keys)) { - return $selections; - } - // If the user selected too many options, drop the oldest selection. - if (isset($max) && count($selections) > $max) { - array_pop($selections); - } - } -} - -/** - * Prompt the user for input - * - * The input can be anything that fits on a single line (not only y/n), - * so we can't use drush_confirm() - * - * @param $prompt - * The text which is displayed to the user. - * @param $default - * The default value of the input. - * @param $required - * If TRUE, user may continue even when no value is in the input. - * @param $password - * If TRUE, surpress printing of the input. - * - * @see drush_confirm() - */ -function drush_prompt($prompt, $default = NULL, $required = TRUE, $password = FALSE) { - if (isset($default)) { - $prompt .= " [" . $default . "]"; - } - $prompt .= ": "; - - drush_print_prompt($prompt); - - if (drush_get_context('DRUSH_AFFIRMATIVE')) { - return $default; - } - - $stdin = fopen('php://stdin', 'r'); - - if ($password) drush_shell_exec("stty -echo"); - - stream_set_blocking($stdin, TRUE); - while (($line = fgets($stdin)) !== FALSE) { - $line = trim($line); - if ($line === "") { - $line = $default; - } - if ($line || !$required) { - break; - } - drush_print_prompt($prompt); - } - fclose($stdin); - if ($password) { - drush_shell_exec("stty echo"); - print "\n"; - } - return $line; -} - -/** - * @} End of "defgroup userinput". - */ - /** * Calls a given function, passing through all arguments unchanged. * @@ -667,10 +177,6 @@ function drush_prompt($prompt, $default = NULL, $required = TRUE, $password = FA * (e.g. unlink() and other file system functions) so that can be suppressed * if the simulation mode is enabled. * - * Important: Call @see drush_op_system() to execute a shell command, - * or @see drush_shell_exec() to execute a shell command and capture the - * shell output. - * * @param $callable * The name of the function. Any additional arguments are passed along. * @return @@ -678,11 +184,11 @@ function drush_prompt($prompt, $default = NULL, $required = TRUE, $password = FA * */ function drush_op($callable) { - $args_printed = array(); + $args_printed = []; $args = func_get_args(); array_shift($args); // Skip function name foreach ($args as $arg) { - $args_printed[] = is_scalar($arg) ? $arg : (is_array($arg) ? 'Array' : 'Object'); + $args_printed[] = is_scalar($arg) ? $arg : (is_object($arg) ? get_class($arg) : gettype($arg)); } if (!is_array($callable)) { @@ -697,16 +203,11 @@ function drush_op($callable) { } } - // Special checking for drush_op('system') - if ($callable == 'system') { - drush_log(dt("Do not call drush_op('system'); use drush_op_system instead"), LogLevel::DEBUG); - } - - if (drush_get_context('DRUSH_VERBOSE') || drush_get_context('DRUSH_SIMULATE')) { - drush_log(sprintf("Calling %s(%s)", $callable_string, implode(", ", $args_printed)), LogLevel::DEBUG); + if (\Drush\Drush::verbose() || \Drush\Drush::simulate()) { + Drush::logger()->debug('Calling {method}({args})', ['method' => $callable_string, 'args' => implode(", ", $args_printed)]); } - if (drush_get_context('DRUSH_SIMULATE')) { + if (\Drush\Drush::simulate()) { return TRUE; } @@ -716,7 +217,7 @@ function drush_op($callable) { /** * Mimic cufa but still call function directly. See http://drupal.org/node/329012#comment-1260752 */ -function drush_call_user_func_array($function, $args = array() ) { +function drush_call_user_func_array($function, $args = []) { if (is_array($function)) { // $callable is a method so always use CUFA. return call_user_func_array($function, $args); @@ -737,131 +238,6 @@ function drush_call_user_func_array($function, $args = array() ) { } } -/** - * Download a file using wget, curl or file_get_contents, or via download cache. - * - * @param string $url - * The url of the file to download. - * @param string $destination - * The name of the file to be saved, which may include the full path. - * Optional, if omitted the filename will be extracted from the url and the - * file downloaded to the current working directory (Drupal root if - * bootstrapped). - * @param integer $cache_duration - * The acceptable age of a cached file. If cached file is too old, a fetch - * will occur and cache will be updated. Optional, if ommitted the file will - * be fetched directly. - * - * @return string - * The path to the downloaded file, or FALSE if the file could not be - * downloaded. - */ -function drush_download_file($url, $destination = FALSE, $cache_duration = 0) { - // Generate destination if omitted. - if (!$destination) { - $file = basename(current(explode('?', $url, 2))); - $destination = getcwd() . '/' . basename($file); - } - - // Simply copy local files to the destination - if (!_drush_is_url($url)) { - return copy($url, $destination) ? $destination : FALSE; - } - - if ($cache_duration !== 0 && $cache_file = drush_download_file_name($url)) { - // Check for cached, unexpired file. - if (file_exists($cache_file) && filectime($cache_file) > ($_SERVER['REQUEST_TIME']-$cache_duration)) { - drush_log(dt('!name retrieved from cache.', array('!name' => $cache_file))); - } - else { - if (_drush_download_file($url, $cache_file, TRUE)) { - // Cache was set just by downloading file to right location. - } - elseif (file_exists($cache_file)) { - drush_log(dt('!name retrieved from an expired cache since refresh failed.', array('!name' => $cache_file)), LogLevel::WARNING); - } - else { - $cache_file = FALSE; - } - } - - if ($cache_file && copy($cache_file, $destination)) { - // Copy cached file to the destination - return $destination; - } - } - elseif ($return = _drush_download_file($url, $destination)) { - drush_register_file_for_deletion($return); - return $return; - } - - // Unable to retrieve from cache nor download. - return FALSE; -} - -/** - * Helper function to determine name of cached file. - */ -function drush_download_file_name($url) { - if ($cache_dir = drush_directory_cache('download')) { - $cache_name = str_replace(array(':', '/', '?', '=', '\\'), '-', $url); - return $cache_dir . "/" . $cache_name; - } - else { - return FALSE; - } -} - -/** - * Check whether the given path is just a url or a local path - * @param string $url - * @return boolean - * TRUE if the path does not contain a schema:// part. - */ -function _drush_is_url($url) { - return parse_url($url, PHP_URL_SCHEME) !== NULL; -} - -/** - * Download a file using wget, curl or file_get_contents. Does not use download - * cache. - * - * @param string $url - * The url of the file to download. - * @param string $destination - * The name of the file to be saved, which may include the full path. - * @param boolean $overwrite - * Overwrite any file thats already at the destination. - * @return string - * The path to the downloaded file, or FALSE if the file could not be - * downloaded. - */ -function _drush_download_file($url, $destination, $overwrite = TRUE) { - static $use_wget; - if ($use_wget === NULL) { - $use_wget = drush_shell_exec('wget --version'); - } - - $destination_tmp = drush_tempnam('download_file'); - if ($use_wget) { - drush_shell_exec("wget -q --timeout=30 -O %s %s", $destination_tmp, $url); - } - else { - // Force TLS1+ as per https://github.com/drush-ops/drush/issues/894. - drush_shell_exec("curl --tlsv1 --fail -s -L --connect-timeout 30 -o %s %s", $destination_tmp, $url); - } - if (!drush_file_not_empty($destination_tmp) && $file = @file_get_contents($url)) { - @file_put_contents($destination_tmp, $file); - } - if (!drush_file_not_empty($destination_tmp)) { - // Download failed. - return FALSE; - } - - drush_move_dir($destination_tmp, $destination, $overwrite); - return $destination; -} - /** * Determines the MIME content type of the specified file. * @@ -871,16 +247,17 @@ function _drush_download_file($url, $destination, $overwrite = TRUE) { * * If mime type can't be obtained, an error will be set. * - * @return mixed + * @return string|bool * The MIME content type of the file or FALSE. */ function drush_mime_content_type($filename) { $content_type = drush_attempt_mime_content_type($filename); if ($content_type) { - drush_log(dt('Mime type for !file is !mt', array('!file' => $filename, '!mt' => $content_type)), LogLevel::NOTICE); + Drush::logger()->info(dt('Mime type for !file is !mt', ['!file' => $filename, '!mt' => $content_type])); return $content_type; } - return drush_set_error('MIME_CONTENT_TYPE_UNKNOWN', dt('Unable to determine mime type for !file.', array('!file' => $filename))); + Drush::logger()->error(dt('Unable to determine mime type for !file.', ['!file' => $filename])); + return false; } /** @@ -893,7 +270,7 @@ function drush_attempt_mime_content_type($filename) { $finfo = new finfo(FILEINFO_MIME_TYPE); $content_type = $finfo->file($filename); if ($content_type == 'application/octet-stream') { - drush_log(dt('Mime type for !file is application/octet-stream.', array('!file' => $filename)), LogLevel::DEBUG); + Drush::logger()->debug(dt('Mime type for !file is application/octet-stream.', ['!file' => $filename])); $content_type = FALSE; } } @@ -902,7 +279,7 @@ function drush_attempt_mime_content_type($filename) { // archives as octet-stream for other reasons) we'll detect mime types on our // own by examing the file's magic header bytes. if (!$content_type) { - drush_log(dt('Examining !file headers.', array('!file' => $filename)), LogLevel::DEBUG); + Drush::logger()->debug(dt('Examining !file headers.', ['!file' => $filename])); if ($file = fopen($filename, 'rb')) { $first = fread($file, 2); fclose($file); @@ -930,30 +307,30 @@ function drush_attempt_mime_content_type($filename) { break; default: - drush_log(dt('Unable to determine mime type from header bytes 0x!hex of !file.', array('!hex' => dechex($data[1]), '!file' => $filename,), LogLevel::DEBUG)); + Drush::logger()->debug(dt('Unable to determine mime type from header bytes 0x!hex of !file.', ['!hex' => dechex($data[1]), '!file' => $filename,])); } } else { - drush_log(dt('Unable to read !file.', array('!file' => $filename)), LogLevel::WARNING); + Drush::logger()->warning(dt('Unable to read !file.', ['!file' => $filename])); } } else { - drush_log(dt('Unable to open !file.', array('!file' => $filename)), LogLevel::WARNING); + Drush::logger()->warning(dt('Unable to open !file.', ['!file' => $filename])); } } // 3. Lastly if above methods didn't work, try to guess the mime type from - // the file extension. This is useful if the file has no identificable magic + // the file extension. This is useful if the file has no identifiable magic // header bytes (for example tarballs). if (!$content_type) { - drush_log(dt('Examining !file extension.', array('!file' => $filename)), LogLevel::DEBUG); + Drush::logger()->debug(dt('Examining !file extension.', ['!file' => $filename])); // Remove querystring from the filename, if present. $filename = basename(current(explode('?', $filename, 2))); - $extension_mimetype = array( + $extension_mimetype = [ '.tar' => 'application/x-tar', '.sql' => 'application/octet-stream', - ); + ]; foreach ($extension_mimetype as $extension => $ct) { if (substr($filename, -strlen($extension)) === $extension) { $content_type = $ct; @@ -972,265 +349,19 @@ function drush_attempt_mime_content_type($filename) { */ function drush_file_is_tarball($path) { $content_type = drush_attempt_mime_content_type($path); - $supported = array( + $supported = [ 'application/x-bzip2', 'application/x-gzip', 'application/x-tar', 'application/x-zip', 'application/zip', - ); + ]; if (in_array($content_type, $supported)) { return $content_type; } return FALSE; } -/** - * Extract a tarball. - * - * @param string $path - * Path to the archive to be extracted. - * @param string $destination - * The destination directory the tarball should be extracted into. - * Optional, if ommitted the tarball directory will be used as destination. - * @param boolean $listing - * If TRUE, a listing of the tar contents will be returned on success. - * @param string $tar_extra_options - * Extra options to be passed to the tar command. - * - * @return mixed - * TRUE on success, FALSE on fail. If $listing is TRUE, a file listing of the - * tarball is returned if the extraction reported success, instead of TRUE. - */ -function drush_tarball_extract($path, $destination = FALSE, $listing = FALSE, $tar_extra_options = '') { - // Check if tarball is supported. - if (!($mimetype = drush_file_is_tarball($path))) { - return drush_set_error('TARBALL_EXTRACT_UNKNOWN_FORMAT', dt('Unable to extract !path. Unknown archive format.', array('!path' => $path))); - } - - // Check if destination is valid. - if (!$destination) { - $destination = dirname($path); - } - if (!drush_mkdir($destination)) { - // drush_mkdir already set an error. - return FALSE; - } - - // Perform the extraction of a zip file. - if (($mimetype == 'application/zip') || ($mimetype == 'application/x-zip')) { - $return = drush_shell_cd_and_exec(dirname($path), "unzip %s -d %s", $path, $destination); - if (!$return) { - return drush_set_error('DRUSH_TARBALL_EXTRACT_ERROR', dt('Unable to unzip !filename.', array('!filename' => $path))); - } - if ($listing) { - // unzip prefixes the file listing output with a header line, - // and prefixes each line with a verb representing the compression type. - $output = drush_shell_exec_output(); - // Remove the header line. - array_shift($output); - // Remove the prefix verb from each line. - $output = array_map( - function ($str) use ($destination) { - return substr($str, strpos($str, ":") + 3 + strlen($destination)); - }, - $output - ); - // Remove any remaining blank lines. - $return = array_filter( - $output, - function ($str) { - return $str != ""; - } - ); - } - } - // Otherwise we have a possibly-compressed Tar file. - // If we are not on Windows, then try to do "tar" in a single operation. - elseif (!drush_is_windows()) { - $tar = drush_get_tar_executable(); - $tar_compression_flag = ''; - if ($mimetype == 'application/x-gzip') { - $tar_compression_flag = 'z'; - } - elseif ($mimetype == 'application/x-bzip2') { - $tar_compression_flag = 'j'; - } - - $return = drush_shell_cd_and_exec(dirname($path), "$tar {$tar_extra_options} -C %s -x%sf %s", $destination, $tar_compression_flag, basename($path)); - if (!$return) { - return drush_set_error('DRUSH_TARBALL_EXTRACT_ERROR', dt('Unable to untar !filename.', array('!filename' => $path))); - } - if ($listing) { - // We use a separate tar -tf instead of -xvf above because - // the output is not the same in Mac. - drush_shell_cd_and_exec(dirname($path), "$tar -t%sf %s", $tar_compression_flag, basename($path)); - $return = drush_shell_exec_output(); - } - } - // In windows, do the extraction by its primitive steps. - else { - // 1. copy the source tarball to the destination directory. Rename to a - // temp name in case the destination directory == dirname($path) - $tmpfile = drush_tempnam(basename($path), $destination); - drush_copy_dir($path, $tmpfile, FILE_EXISTS_OVERWRITE); - - // 2. uncompress the tarball, if compressed. - if (($mimetype == 'application/x-gzip') || ($mimetype == 'application/x-bzip2')) { - if ($mimetype == 'application/x-gzip') { - $compressed = $tmpfile . '.gz'; - // We used to use gzip --decompress in --stdout > out, but the output - // redirection sometimes failed on Windows for some binary output. - $command = 'gzip --decompress %s'; - } - elseif ($mimetype == 'application/x-bzip2') { - $compressed = $tmpfile . '.bz2'; - $command = 'bzip2 --decompress %s'; - } - drush_op('rename', $tmpfile, $compressed); - $return = drush_shell_cd_and_exec(dirname($compressed), $command, $compressed); - if (!$return || !file_exists($tmpfile)) { - return drush_set_error('DRUSH_TARBALL_EXTRACT_ERROR', dt('Unable to decompress !filename.', array('!filename' => $compressed))); - } - } - - // 3. Untar. - $tar = drush_get_tar_executable(); - $return = drush_shell_cd_and_exec(dirname($tmpfile), "$tar {$tar_extra_options} -xvf %s", basename($tmpfile)); - if (!$return) { - return drush_set_error('DRUSH_TARBALL_EXTRACT_ERROR', dt('Unable to untar !filename.', array('!filename' => $tmpfile))); - } - if ($listing) { - $return = drush_shell_exec_output(); - // Cut off the 'x ' prefix for the each line of the tar output - // See http://drupal.org/node/1775520 - foreach($return as &$line) { - if(strpos($line, "x ") === 0) - $line = substr($line, 2); - } - } - - // Remove the temporary file so the md5 hash is accurate. - unlink($tmpfile); - } - - return $return; -} - -/** - * @defgroup commandprocessing Command processing functions. - * @{ - * - * These functions manage command processing by the - * main function in drush.php. - */ - -/** - * Determine whether or not an argument should be removed from the - * DRUSH_COMMAND_ARGS context. This method is used when a Drush - * command has set the 'strict-option-handling' flag indicating - * that it will pass through all commandline arguments and any - * additional options (not known to Drush) to some shell command. - * - * Take as an example the following call to core-rsync: - * - * drush --yes core-rsync -v -az --exclude-paths='.git:.svn' local-files/ @site:%files - * - * In this instance: - * - * --yes is a global Drush option - * - * -v is an rsync option. It will make rsync run in verbose mode, - * but will not make Drush run in verbose mode due to the fact that - * core-rsync sets the 'strict-option-handling' flag. - * - * --exclude-paths is a local Drush option. It will be converted by - * Drush into --exclude='.git' and --exclude='.svn', and then passed - * on to the rsync command. - * - * The parameter $arg passed to this function is one of the elements - * of DRUSH_COMMAND_ARGS. It will have values such as: - * -v - * -az - * --exclude-paths='.git:.svn' - * local-files/ - * @site:%files - * - * Our job in this function is to determine if $arg should be removed - * by virtue of appearing in $removal_list. $removal_list is an array - * that will contain values such as 'exclude-paths'. Both the key and - * the value of $removal_list is the same. - */ -function _drush_should_remove_command_arg($arg, $removal_list) { - foreach ($removal_list as $candidate) { - if (($arg == "-$candidate") || - ($arg == "--$candidate") || - (substr($arg,0,strlen($candidate)+3) == "--$candidate=") ) { - return TRUE; - } - } - return FALSE; -} - -/** - * Redispatch the specified command using the same - * options that were passed to this invocation of drush. - */ -function drush_do_command_redispatch($command, $args = array(), $remote_host = NULL, $remote_user = NULL, $drush_path = NULL, $user_interactive = FALSE, $aditional_options = array()) { - $additional_global_options = array(); - $command_options = drush_redispatch_get_options(); - $command_options = $aditional_options + $command_options; - if (is_array($command)) { - $command_name = $command['command']; - // If we are executing a remote command that uses strict option handling, - // then mark all of the options in the alias context as global, so that they - // will appear before the command name. - if (!empty($command['strict-option-handling'])) { - foreach(drush_get_context('alias') as $alias_key => $alias_value) { - if (array_key_exists($alias_key, $command_options) && !array_key_exists($alias_key, $command['options'])) { - $additional_global_options[$alias_key] = $alias_value; - } - } - } - } - else { - $command_name = $command; - } - // If the path to drush was supplied, then use it to invoke the new command. - if ($drush_path == NULL) { - $drush_path = drush_get_option('drush-script'); - if (!isset($drush_path)) { - $drush_folder = drush_get_option('drush'); - if (isset($drush)) { - $drush_path = $drush_folder . '/drush'; - } - } - } - $backend_options = array('drush-script' => $drush_path, 'remote-host' => $remote_host, 'remote-user' => $remote_user, 'integrate' => TRUE, 'additional-global-options' => $additional_global_options); - // Set the tty if requested, if the command necessitates it, - // or if the user explicitly asks for interactive mode, but - // not if interactive mode is forced. tty implies interactive - if (drush_get_option('tty') || $user_interactive || !empty($command['remote-tty'])) { - $backend_options['#tty'] = TRUE; - $backend_options['interactive'] = TRUE; - } - elseif (drush_get_option('interactive')) { - $backend_options['interactive'] = TRUE; - } - - // Run the command in a new process. - drush_log(dt('Begin redispatch via drush_invoke_process().')); - $values = drush_invoke_process('@self', $command_name, $args, $command_options, $backend_options); - drush_log(dt('End redispatch via drush_invoke_process().')); - - return $values; -} - - -/** - * @} End of "defgroup commandprocessing". - */ - /** * @defgroup logging Logging information to be provided as output. * @{ @@ -1257,43 +388,39 @@ function drush_do_command_redispatch($command, $args = array(), $remote_host = N * The type of message to be logged. Common types are 'warning', 'error', 'success' and 'notice'. * A type of 'ok' or 'success' can also be supplied to flag something that worked. * If you want your log messages to print to screen without the user entering - * a -v or --verbose flag, use type 'ok', this prints log messages out to + * a -v or --verbose flag, use type 'ok' or 'notice', this prints log messages out to * STDERR, which prints to screen (unless you have redirected it). All other - * types of messages will be assumed to be notices. + * types of messages will be assumed to be info. + * + * @deprecated + * Use this->logger()->warning (for example) from an Annotated command method. */ -function drush_log($message, $type = LogLevel::NOTICE, $error = null) { - $entry = array( +function drush_log($message, $type = LogLevel::INFO, $error = null) { + $entry = [ 'type' => $type, 'message' => $message, 'timestamp' => microtime(TRUE), 'memory' => memory_get_usage(), - ); + ]; $entry['error'] = $error; return _drush_log($entry); } -/** - * Future: add some sort of dependency injection to Drush. - */ -function _drush_create_default_logger() { - $drush_logger = new Logger(); - drush_set_context('DRUSH_LOGGER', $drush_logger); - drush_set_context('DRUSH_LOG_CALLBACK', $drush_logger); -} - /** * Call the default logger, or the user's log callback, as * appropriate. */ function _drush_log($entry) { $callback = drush_get_context('DRUSH_LOG_CALLBACK'); - + if (!$callback) { + $callback = Drush::logger(); + } if ($callback instanceof LoggerInterface) { _drush_log_to_logger($callback, $entry); } elseif ($callback) { - $log =& drush_get_context('DRUSH_LOG', array()); + $log =& drush_get_context('DRUSH_LOG', []); $log[] = $entry; drush_backend_packet('log', $entry); return $callback($entry); @@ -1303,7 +430,7 @@ function _drush_log($entry) { // Maintain compatibility with extensions that hook into // DRUSH_LOG_CALLBACK (e.g. drush_ctex_bonus) function _drush_print_log($entry) { - $drush_logger = drush_get_context('DRUSH_LOGGER'); + $drush_logger = Drush::logger(); if ($drush_logger) { _drush_log_to_logger($drush_logger, $entry); } @@ -1319,8 +446,8 @@ function _drush_log_to_logger($logger, $entry) { $logger->log($log_level, $message, $context); } -function drush_log_has_errors($types = array(LogLevel::WARNING, LogLevel::ERROR, LogLevel::FAILED)) { - $log =& drush_get_context('DRUSH_LOG', array()); +function drush_log_has_errors($types = [LogLevel::WARNING, LogLevel::ERROR, LogLevel::FAILED]) { + $log =& drush_get_context('DRUSH_LOG', []); foreach ($log as $entry) { if (in_array($entry['type'], $types)) { return TRUE; @@ -1353,7 +480,7 @@ function drush_backend_packet_log($entry, $backend_options) { _drush_log($entry); } else { - $log =& drush_get_context('DRUSH_LOG', array()); + $log =& drush_get_context('DRUSH_LOG', []); $log[] = $entry; // Yes, this looks odd, but we might in fact be a backend command // that ran another backend command. @@ -1366,127 +493,38 @@ function drush_backend_packet_log($entry, $backend_options) { * * @return * Entire log history + * + * @deprecated */ function drush_get_log() { - return drush_get_context('DRUSH_LOG', array()); + return drush_get_context('DRUSH_LOG', []); } /** * Run print_r on a variable and log the output. */ function dlm($object) { - drush_log(print_r($object, TRUE)); -} - -/** - * Display the pipe output for the current request. - */ -function drush_pipe_output() { - $pipe = drush_get_context('DRUSH_PIPE_BUFFER'); - if (!empty($pipe)) { - drush_print_r($pipe, NULL, FALSE); - } -} - -// Print all timers for the request. -function drush_print_timers() { - global $timers; - $temparray = array(); - foreach ((array)$timers as $name => $timerec) { - // We have to use timer_read() for active timers, and check the record for others - if (isset($timerec['start'])) { - $temparray[$name] = timer_read($name); - } - else { - $temparray[$name] = $timerec['time']; - } - } - // Go no farther if there were no timers - if (count($temparray) > 0) { - // Put the highest cumulative times first - arsort($temparray); - $table = array(); - $table[] = array('Timer', 'Cum (sec)', 'Count', 'Avg (msec)'); - foreach ($temparray as $name => $time) { - $cum = round($time/1000, 3); - $count = $timers[$name]['count']; - if ($count > 0) { - $avg = round($time/$count, 3); - } - else { - $avg = 'N/A'; - } - $table[] = array($name, $cum, $count, $avg); - } - drush_print_table($table, TRUE, array(), STDERR); - } -} - -/** - * Turn drupal_set_message errors into drush_log errors - */ -function _drush_log_drupal_messages() { - if (function_exists('drupal_get_messages')) { - - $messages = drupal_get_messages(NULL, TRUE); - - if (array_key_exists('error', $messages)) { - //Drupal message errors. - foreach ((array) $messages['error'] as $error) { - $error = strip_tags($error); - $header = preg_match('/^warning: Cannot modify header information - headers already sent by /i', $error); - $session = preg_match('/^warning: session_start\(\): Cannot send session /i', $error); - if ($header || $session) { - //These are special cases for an unavoidable warnings - //that are generated by generating output before Drupal is bootstrapped. - //or sending a session cookie (seems to affect d7 only?) - //Simply ignore them. - continue; - } - elseif (preg_match('/^warning:/i', $error)) { - drush_log(preg_replace('/^warning: /i', '', $error), LogLevel::WARNING); - } - elseif (preg_match('/^notice:/i', $error)) { - drush_log(preg_replace('/^notice: /i', '', $error), LogLevel::NOTICE); - } - elseif (preg_match('/^user warning:/i', $error)) { - // This is a special case. PHP logs sql errors as 'User Warnings', not errors. - drush_set_error('DRUSH_DRUPAL_ERROR_MESSAGE', preg_replace('/^user warning: /i', '', $error)); - } - else { - drush_set_error('DRUSH_DRUPAL_ERROR_MESSAGE', $error); - } - } - } - unset($messages['error']); - - // Log non-error messages. - foreach ($messages as $type => $items) { - foreach ($items as $item) { - drush_log(strip_tags($item), $type); - } - } - } + Drush::logger()->notice(print_r($object, TRUE)); } // Copy of format_size() in Drupal. function drush_format_size($size) { if ($size < DRUSH_KILOBYTE) { // format_plural() not always available. - return dt('@count bytes', array('@count' => $size)); + return dt('@count bytes', ['@count' => $size]); } else { $size = $size / DRUSH_KILOBYTE; // Convert bytes to kilobytes. - $units = array( - dt('@size KB', array()), - dt('@size MB', array()), - dt('@size GB', array()), - dt('@size TB', array()), - dt('@size PB', array()), - dt('@size EB', array()), - dt('@size ZB', array()), - dt('@size YB', array()), - ); + $units = [ + dt('@size KB', []), + dt('@size MB', []), + dt('@size GB', []), + dt('@size TB', []), + dt('@size PB', []), + dt('@size EB', []), + dt('@size ZB', []), + dt('@size YB', []), + ]; foreach ($units as $unit) { if (round($size, 2) >= DRUSH_KILOBYTE) { $size = $size / DRUSH_KILOBYTE; @@ -1533,7 +571,7 @@ function drush_set_error($error, $message = null, $output_label = "") { $error_code =& drush_get_context('DRUSH_ERROR_CODE', DRUSH_SUCCESS); $error_code = DRUSH_FRAMEWORK_ERROR; - $error_log =& drush_get_context('DRUSH_ERROR_LOG', array()); + $error_log =& drush_get_context('DRUSH_ERROR_LOG', []); if (is_numeric($error)) { $error = 'DRUSH_FRAMEWORK_ERROR'; @@ -1543,14 +581,14 @@ function drush_set_error($error, $message = null, $output_label = "") { $error = "$error"; } - $message = ($message) ? $message : drush_command_invoke_all('drush_help', 'error:' . $error); + $message = ($message) ? $message : ''; // drush_command_invoke_all('drush_help', 'error:' . $error); if (is_array($message)) { $message = implode("\n", $message); } $error_log[$error][] = $message; - if (!drush_backend_packet('set_error', array('error' => $error, 'message' => $message))) { + if (!drush_backend_packet('set_error', ['error' => $error, 'message' => $message])) { drush_log(($message) ? $output_label . $message : $output_label . $error, LogLevel::ERROR, $error); } @@ -1562,6 +600,8 @@ function drush_set_error($error, $message = null, $output_label = "") { * * @return * The current aggregate error status + * + * @deprecated */ function drush_get_error() { return drush_get_context('DRUSH_ERROR_CODE', DRUSH_SUCCESS); @@ -1572,9 +612,11 @@ function drush_get_error() { * * @return * An associative array of error messages indexed by the type of message. + * + * @deprecated */ function drush_get_error_log() { - return drush_get_context('DRUSH_ERROR_LOG', array()); + return drush_get_context('DRUSH_ERROR_LOG', []); } /** @@ -1602,18 +644,6 @@ function drush_clear_error() { drush_set_context('DRUSH_ERROR_CODE', DRUSH_SUCCESS); } -/** - * Exit due to user declining a confirmation prompt. - * - * Usage: return drush_user_abort(); - */ -function drush_user_abort($msg = NULL) { - drush_set_context('DRUSH_USER_ABORT', TRUE); - drush_set_context('DRUSH_EXIT_CODE', DRUSH_EXITCODE_USER_ABORT); - drush_log($msg ? $msg : dt('Cancelled.'), LogLevel::CANCEL); - return FALSE; -} - /** * Turn PHP error handling off. * @@ -1679,67 +709,6 @@ function drush_memory_limit() { return $size; } -/** - * Unset the named key anywhere in the provided - * data structure. - */ -function drush_unset_recursive(&$data, $unset_key) { - if (!empty($data) && is_array($data)) { - unset($data[$unset_key]); - foreach ($data as $key => $value) { - if (is_array($value)) { - drush_unset_recursive($data[$key], $unset_key); - } - } - } -} - -/** - * Return a list of VCSs reserved files and directories. - */ -function drush_version_control_reserved_files() { - static $files = FALSE; - - if (!$files) { - // Also support VCSs that are not drush vc engines. - $files = array('.git', '.gitignore', '.hg', '.hgignore', '.hgrags'); - $engine_info = drush_get_engines('version_control'); - $vcs = array_keys($engine_info['engines']); - foreach ($vcs as $name) { - $version_control = drush_include_engine('version_control', $name); - $files = array_merge($files, $version_control->reserved_files()); - } - } - - return $files; -} - -/** - * Generate a random alphanumeric password. Copied from user.module. - */ -function drush_generate_password($length = 10) { - // This variable contains the list of allowable characters for the - // password. Note that the number 0 and the letter 'O' have been - // removed to avoid confusion between the two. The same is true - // of 'I', 1, and 'l'. - $allowable_characters = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'; - - // Zero-based count of characters in the allowable list: - $len = strlen($allowable_characters) - 1; - - // Declare the password as a blank string. - $pass = ''; - - // Loop the number of times specified by $length. - for ($i = 0; $i < $length; $i++) { - - // Each iteration, pick a random character from the - // allowable string and append it to the password: - $pass .= $allowable_characters[mt_rand(0, $len)]; - } - - return $pass; -} /** * Form an associative array from a linear array. @@ -1761,91 +730,9 @@ function drush_generate_password($length = 10) { function drush_map_assoc($array, $function = NULL) { // array_combine() fails with empty arrays: // http://bugs.php.net/bug.php?id=34857. - $array = !empty($array) ? array_combine($array, $array) : array(); + $array = !empty($array) ? array_combine($array, $array) : []; if (is_callable($function)) { $array = array_map($function, $array); } return $array; } -/** - * Clears completion caches. - * - * If called with no parameters the entire complete cache will be cleared. - * If called with just the $type parameter the global cache for that type will - * be cleared (in the site context, if any). If called with both $type and - * $command parameters the command cache of that type will be cleared (in the - * site context, if any). - * - * This is included in drush.inc as complete.inc is only loaded conditionally. - * - * @param $type - * The completion type (optional). - * @param $command - * The command name (optional), if command specific cache is to be cleared. - * If specifying a command, $type is not optional. - */ -function drush_complete_cache_clear($type = NULL, $command = NULL) { - require_once DRUSH_BASE_PATH . '/includes/complete.inc'; - if ($type) { - drush_cache_clear_all(drush_complete_cache_cid($type, $command), 'complete'); - return; - } - // No type or command, so clear the entire complete cache. - drush_cache_clear_all('*', 'complete', TRUE); -} - -/* - * Cast a value according to the provided format - * - * @param mixed $value. - * @param string $format - * Allowed values: auto, integer, float, bool, boolean, json, yaml. - * - * @return $value - * The value, re-typed as needed. - */ -function drush_value_format($value, $format) { - if ($format == 'auto') { - if (is_numeric($value)) { - $value = $value + 0; // http://php.net/manual/en/function.is-numeric.php#107326 - $format = gettype($value); - } - elseif (($value == 'TRUE') || ($value == 'FALSE')) { - $format = 'bool'; - } - } - - // Now, we parse the object. - switch ($format) { - case 'integer': - $value = (integer)$value; - break; - // from: http://php.net/gettype - // for historical reasons "double" is returned in case of a float, and not simply "float" - case 'double': - case 'float': - $value = (float)$value; - break; - case 'bool': - case 'boolean': - if ($value == 'TRUE') { - $value = TRUE; - } - elseif ($value == 'FALSE') { - $value = FALSE; - } - else { - $value = (bool)$value; - } - break; - - case 'json': - $value = drush_json_decode($value); - break; - - case 'yaml': - $value = \Symfony\Component\Yaml\Yaml::parse($value, FALSE, TRUE); - break; - } - return $value; -} diff --git a/vendor/drush/drush/includes/engines.inc b/vendor/drush/drush/includes/engines.inc deleted file mode 100644 index 56a2b41f34dc5cc37c1c53af5494d2f2f931dc18..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/includes/engines.inc +++ /dev/null @@ -1,567 +0,0 @@ -<?php - -/** - * @file - * The drush engines API implementation and helpers. - */ - -use Drush\Log\LogLevel; - -/** - * Obtain all engine types info and normalize with defaults. - * - * @see hook_drush_engine_type_info(). - */ -function drush_get_engine_types_info() { - $info = drush_command_invoke_all('drush_engine_type_info'); - foreach ($info as $type => $data) { - $info[$type] += array( - 'description' => '', - 'option' => FALSE, - 'default' => NULL, - 'options' => array(), - 'sub-options' => array(), - 'config-aliases' => array(), - 'add-options-to-command' => FALSE, - 'combine-help' => FALSE, - ); - } - - return $info; -} - -/** - * Return a structured array of engines of a specific type. - * - * Engines are pluggable subsystems. Each engine of a specific type will - * implement the same set of API functions and perform the same high-level - * task using a different backend or approach. - * - * This function/hook is useful when you have a selection of several mutually - * exclusive options to present to a user to select from. - * - * Other commands are able to extend this list and provide their own engines. - * The hook can return useful information to help users decide which engine - * they need, such as description or list of available engine options. - * - * The engine path element will automatically default to a subdirectory (within - * the directory of the commandfile that implemented the hook) with the name of - * the type of engine - e.g. an engine "wget" of type "handler" provided by - * the "pm" commandfile would automatically be found if the file - * "pm/handler/wget.inc" exists and a specific path is not provided. - * - * @param $engine_type - * The type of engine. - * - * @return - * A structured array of engines. - */ -function drush_get_engines($engine_type) { - $info = drush_get_engine_types_info(); - if (!isset($info[$engine_type])) { - return drush_set_error('DRUSH_UNKNOWN_ENGINE_TYPE', dt('Unknown engine type !engine_type', array('!engine_type' => $engine_type))); - } - - $engines = array( - 'info' => $info[$engine_type], - 'engines' => array(), - ); - $list = drush_commandfile_list(); - $hook = 'drush_engine_' . str_replace('-', '_', $engine_type); - foreach ($list as $commandfile => $path) { - if (drush_command_hook($commandfile, $hook)) { - $function = $commandfile . '_' . $hook; - $result = $function(); - foreach ($result as $engine_name => $engine) { - // Add some defaults. - $engine += array( - 'commandfile' => $commandfile, - 'options' => array(), - 'sub-options' => array(), - 'drupal dependencies' => array(), - ); - - // Legacy engines live in a subdirectory - // of the commandfile that declared them. - $engine_path = sprintf("%s/%s", dirname($path), $engine_type); - if (file_exists($engine_path)) { - $engine['path'] = $engine_path; - } - // Build engine class name, in case the engine doesn't provide it. - // The class name is based on the engine type and name, converted - // from snake_case to CamelCase. - // For example for type 'package_handler' and engine 'git_drupalorg' - // the class is \Drush\PackageHandler\GitDrupalorg - elseif (!isset($engine['class'])) { - $parts = array(); - $parts[] = '\Drush'; - $parts[] = str_replace(' ', '', ucwords(strtr($engine_type, '_', ' '))); - $parts[] = str_replace(' ', '', ucwords(strtr($engine_name, '_', ' '))); - $engine['class'] = implode('\\', $parts); - } - - $engines['engines'][$engine_name] = $engine; - } - } - } - - return $engines; -} - -/** - * Take a look at all of the available engines, - * and create topic commands for each one that - * declares a topic. - */ -function drush_get_engine_topics() { - $items = array(); - $info = drush_get_engine_types_info(); - foreach ($info as $engine => $data) { - if (array_key_exists('topic', $data)) { - $items[$data['topic']] = array( - 'description' => $data['description'], - 'hidden' => TRUE, - 'topic' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, - 'callback' => 'drush_engine_topic_command', - 'callback arguments' => array($engine), - ); - } - } - return $items; -} - -/** - * Include, instantiate and validate command engines. - * - * @return FALSE if a engine doesn't validate. - */ -function drush_load_command_engines($command) { - $result = TRUE; - foreach ($command['engines'] as $engine_type => $config) { - $result = drush_load_command_engine($command, $engine_type); - // Stop loading engines if any of them fails. - if ($result === FALSE) { - break; - } - } - return $result; -} - -/** - * Returns engine config supplied in the command definition. - */ -function drush_get_command_engine_config($command, $engine_type, $metadata = array()) { - if (isset($command['engines'][$engine_type])) { - $metadata = array_merge($metadata, $command['engines'][$engine_type]); - } - return $metadata; -} - -/** - * Selects and loads an engine implementing the given type. - * - * Loaded engines are stored as a context. - */ -function drush_load_command_engine($command, $engine_type, $metadata = array()) { - drush_log(dt("Loading !engine engine.", array('!engine' => $engine_type), LogLevel::BOOTSTRAP)); - - $config = drush_get_command_engine_config($command, $engine_type, $metadata); - $engine_info = drush_get_engines($engine_type); - $engine = drush_select_engine($config, $engine_info); - $version = drush_drupal_major_version(); - - $context = $engine_type . '_engine_' . $engine . '_' . $version; - $instance = drush_get_context($context, FALSE); - if ($instance != FALSE) { - drush_set_engine($engine_type, $instance); - } - else { - $instance = drush_load_engine($engine_type, $engine, $config); - if ($instance == FALSE) { - return FALSE; - } - drush_set_context($context, $instance); - } - return $instance; -} - -/** - * Add command structure info from each engine type back into the command. - */ -function drush_merge_engine_data(&$command) { - // First remap engine data from the shortcut location - // ($command['engine_type']) to the standard location - // ($command['engines']['engine_type']) - $info = drush_get_engine_types_info(); - foreach ($info as $engine_type => $info) { - if (isset($command[$engine_type])) { - $config = $command[$engine_type]; - foreach ($info['config-aliases'] as $engine_option_alias_name => $engine_option_standard_name) { - if (array_key_exists($engine_option_alias_name, $config)) { - $config[$engine_option_standard_name] = $config[$engine_option_alias_name]; - unset($config[$engine_option_alias_name]); - } - } - // Convert single string values of 'require-engine-capability' to an array. - if (isset($config['require-engine-capability']) && is_string($config['require-engine-capability'])) { - $config['require-engine-capability'] = array($config['require-engine-capability']); - } - $command['engines'][$engine_type] = $config; - } - } - - foreach ($command['engines'] as $engine_type => $config) { - // Normalize engines structure. - if (!is_array($config)) { - unset($command['engines'][$engine_type]); - $command['engines'][$config] = array(); - $engine_type = $config; - } - - // Get all implementations for this engine type. - $engine_info = drush_get_engines($engine_type); - if ($engine_info === FALSE) { - return FALSE; - } - - // Complete command-declared engine type with default info. - $command['engines'][$engine_type] += $engine_info['info']; - $config = $command['engines'][$engine_type]; - - $engine_data = array(); - - // If there's a single implementation for this engine type, it will be - // loaded by default, and makes no sense to provide a command line option - // to select the only flavor (ie. --release_info=updatexml), so we won't - // add an option in this case. - // Additionally, depending on the command, it may be convenient to extend - // the command with the engine options. - if (count($engine_info['engines']) == 1) { - if ($config['add-options-to-command'] !== FALSE) { - // Add options and suboptions of the engine type and - // the sole implementation. - $engine = key($engine_info['engines']); - $data = $engine_info['engines'][$engine]; - $engine_data += array( - 'options' => $config['options'] + $data['options'], - 'sub-options' => $config['sub-options'] + $data['sub-options'], - ); - } - } - // Otherwise, provide a command option to choose between engines and add - // the engine options and sub-options. - else { - // Add engine type global options and suboptions. - $engine_data += array( - 'options' => $config['options'], - 'sub-options' => $config['sub-options'], - ); - - // If the 'combine-help' flag is set in the engine config, - // then we will combine all of the help items into the help - // text for $config['option']. - $combine_help = $config['combine-help']; - $combine_help_data = array(); - - // Process engines in order. First the default engine, the rest alphabetically. - $default = drush_select_engine($config, $engine_info); - $engines = array_keys($engine_info['engines']); - asort($engines); - array_unshift($engines, $default); - $engines = array_unique($engines); - foreach ($engines as $engine) { - $data = $engine_info['engines'][$engine]; - // Check to see if the command requires any particular - // capabilities. If no capabilities are required, then - // all engines are acceptable. - $engine_is_usable = TRUE; - if (array_key_exists('require-engine-capability', $config)) { - // See if the engine declares that it provides any - // capabilities. If no capabilities are listed, then - // it is assumed that the engine can satisfy all requirements. - if (array_key_exists('engine-capabilities', $data)) { - $engine_is_usable = FALSE; - // If 'require-engine-capability' is TRUE instead of an array, - // then only engines that are universal (do not declare any - // particular capabilities) are usable. - if (is_array($config['require-engine-capability'])) { - foreach ($config['require-engine-capability'] as $required) { - // We need an engine that provides any one of the requirements. - if (in_array($required, $data['engine-capabilities'])) { - $engine_is_usable = TRUE; - } - } - } - } - } - if ($engine_is_usable) { - $command['engines'][$engine_type]['usable'][] = $engine; - if (!isset($data['hidden'])) { - $option = $config['option'] . '=' . $engine; - $engine_data['options'][$option]['description'] = array_key_exists('description', $data) ? $data['description'] : NULL; - if ($combine_help) { - $engine_data['options'][$option]['hidden'] = TRUE; - if (drush_get_context('DRUSH_VERBOSE') || ($default == $engine) || !isset($data['verbose-only'])) { - $combine_help_data[$engine] = $engine . ': ' . $data['description']; - } - } - if (isset($data['options'])) { - $engine_data['sub-options'][$option] = $data['options']; - } - if (isset($data['sub-options'])) { - $engine_data['sub-options'] += $data['sub-options']; - } - } - } - } - if (!empty($combine_help_data)) { - $engine_selection_option = $config['option']; - if (!is_array($engine_data['options'][$engine_selection_option])) { - $engine_data['options'][$engine_selection_option] = array('description' => $config['options'][$engine_selection_option]); - } - if (drush_get_context('DRUSH_VERBOSE')) { - $engine_data['options'][$engine_selection_option]['description'] .= "\n" . dt("All available values are:") . "\n - " . implode("\n - ", $combine_help_data) . "\n"; - } - else { - $engine_data['options'][$engine_selection_option]['description'] .= " " . dt("Available: ") . implode(', ', array_keys($combine_help_data)) . ". "; - } - $engine_data['options'][$engine_selection_option]['description'] .= dt("Default is !default.", array('!default' => $default)); - } - else { - // If the help options are not combined, then extend the - // default engine description. - $desc = $engine_info['engines'][$default]['description']; - $engine_info['engines'][$default]['description'] = dt('Default !type engine.', array('!type' => $engine_type)) . ' ' . $desc; - } - } - // This was simply array_merge_recursive($command, $engine_data), but this - // function has an undesirable behavior when merging primative types. - // If there is a 'key' => 'value' in $command, and the same 'key' => 'value' - // exists in $engine data, then the result will be 'key' => array('value', 'value');. - // This is NOT what we want, so we provide our own 'overlay' function instead. - $command = _drush_array_overlay_recursive($command, $engine_data); - } -} - -// Works like array_merge_recursive(), but does not convert primative -// types into arrays. Ever. -function _drush_array_overlay_recursive($a, $b) { - foreach ($b as $key => $value) { - if (!isset($a[$key]) || !is_array($a[$key])) { - $a[$key] = $b[$key]; - } - else { - $a[$key] = _drush_array_overlay_recursive($a[$key], $b[$key]); - } - } - return $a; -} - -/** - * Implementation of command hook for docs-output-formats - */ -function drush_engine_topic_command($engine) { - $engine_instances = drush_get_engines($engine); - $option = $engine_instances['info']['option']; - - if (isset($engine_instances['info']['topic-file'])) { - // To do: put this file next to the commandfile that defines the - // engine type, not in the core docs directory. - $docs_dir = drush_get_context('DOC_PREFIX', DRUSH_BASE_PATH); - $path = $engine_instances['info']['topic-file']; - $docs_file = (drush_is_absolute_path($path) ? '' : $docs_dir . '/') . $path; - $doc_text = drush_html_to_text(file_get_contents($docs_file)); - } - elseif (isset($engine_instances['info']['topic-text'])) { - $doc_text = $engine_instances['info']['topic-text']; - } - else { - return drush_set_error('DRUSH_BAD_ENGINE_TOPIC', dt("The engine !engine did not define its topic command correctly.", array('!engine' => $engine))); - } - - // Look at each instance of the engine; if it has an html - // file in the the 'topics' folder named after itself, then - // include the file contents in the engine topic text. - $instances = $engine_instances['engines']; - ksort($instances); - foreach ($instances as $instance => $config) { - if (isset($config['description'])) { - $doc_text .= "\n\n::: --$option=$instance :::\n" . $config['description']; - $path = $config['path'] . '/topics/' . $instance . '.html'; - if (file_exists($path)) { - $doc_text .= "\n" . drush_html_to_text(file_get_contents($path)); - } - $additional_topic_text = drush_command_invoke_all('drush_engine_topic_additional_text', $engine, $instance, $config); - if (!empty($additional_topic_text)) { - $doc_text .= "\n\n" . implode("\n\n", $additional_topic_text); - } - } - } - - // Write the topic text to a file so that is can be paged - $file = drush_save_data_to_temp_file($doc_text); - drush_print_file($file); -} - -/** - * Selects an engine between the available ones. - * - * Precedence: - * - * - preferred engine, if available. - * - user supplied engine via cli. - * - default engine from engine type / command declaration. - * - the first engine available. - * - * @param array $config - * Engine type configuration. My be overridden in command declaration. - * @param array $engine_info - * Engine type declaration. - * @param string $default - * Preferred engine. - * - * @return string - * Selected engine. - */ -function drush_select_engine($config, $engine_info, $preferred = NULL) { - $engines = array_keys($engine_info['engines']); - - if (in_array($preferred, $engines)) { - return $preferred; - } - - if (!empty($config['option'])) { - $engine = drush_get_option($config['option'], FALSE); - if ($engine && in_array($engine, $engines)) { - return $engine; - } - } - - if (isset($config['default']) && in_array($config['default'], $engines)) { - return $config['default']; - } - - return current($engines); -} - -/** - * Loads and validate an engine of the given type. - * - * @param string $type - * Engine type. - * @param string $engine - * Engine name. - * @param array $config - * Engine configuration. Tipically it comes from a command declaration. - * - * @return - * TRUE or instanced object of available class on success. FALSE on fail. - */ -function drush_load_engine($type, $engine, $config = array()) { - $engine_info = drush_get_engines($type); - $engine = drush_select_engine($config, $engine_info, $engine); - $config['engine-info'] = $engine_info['engines'][$engine]; - - // Check engine dependency on drupal modules before include. - $dependencies = $config['engine-info']['drupal dependencies']; - foreach ($dependencies as $dependency) { - if (!drush_module_exists($dependency)) { - return drush_set_error('DRUSH_ENGINE_DEPENDENCY_ERROR', dt('!engine_type: !engine engine needs the following modules installed/enabled to run: !dependencies.', array('!engine_type' => $type, '!engine' => $engine, '!dependencies' => implode(', ', $dependencies)))); - } - } - - $result = drush_include_engine($type, $engine, $config); - if (is_object($result)) { - $valid = method_exists($result, 'validate') ? $result->validate() : TRUE; - if ($valid) { - drush_set_engine($type, $result); - } - } - else { - $function = strtr($type, '-', '_') . '_validate'; - $valid = function_exists($function) ? call_user_func($function) : TRUE; - } - if (!$valid) { - return FALSE; - } - return $result; -} - -/** - * Include the engine code for a specific named engine of a certain type. - * - * If the engine type has implemented hook_drush_engine_$type the path to the - * engine specified in the array will be used. - * - * If a class named in the form drush_$type_$engine exists, it will return an - * instance of the class. - * - * @param string $type - * The type of engine. - * @param string $engine - * The name for the engine to include. - * @param array $config - * Parameters for the engine class constructor. - * - * @return - * TRUE or instanced object of available class on success. FALSE on fail. - */ -function drush_include_engine($type, $engine, $config = NULL) { - $engine_info = drush_get_engines($type); - - // Pick the engine name that actually implements the requested engine. - $engine = isset($engine_info['engines'][$engine]['implemented-by']) ? $engine_info['engines'][$engine]['implemented-by'] : $engine; - - // Legacy engines live in a subdirectory of the commandfile - // that declares them. We need to explicitly include the file. - if (isset($engine_info['engines'][$engine]['path'])) { - $path = $engine_info['engines'][$engine]['path']; - if (!drush_include($path, $engine)) { - return drush_set_error('DRUSH_ENGINE_INCLUDE_FAILED', dt('Unable to include the !type engine !engine from !path.' , array('!path' => $path, '!type' => $type, '!engine' => $engine))); - } - // Legacy engines may be implemented in a magic class name. - $class = 'drush_' . $type . '_' . str_replace('-', '_', $engine); - if (class_exists($class)) { - $instance = new $class($config); - $instance->engine_type = $type; - $instance->engine = $engine; - return $instance; - } - - return TRUE; - } - - return drush_get_class($engine_info['engines'][$engine]['class'], array($type, $engine, $config)); -} - -/** - * Return the engine of the specified type that was loaded by the Drush command. - */ -function drush_get_engine($type) { - return drush_get_context($type . '_engine', FALSE); -} - -/** - * Called by the Drush command (@see _drush_load_command_engines()) - * to cache the active engine instance. - */ -function drush_set_engine($type, $instance) { - drush_set_context($type . '_engine', $instance); -} - -/** - * Add engine topics to the command topics, if any. - */ -function drush_engine_add_help_topics(&$command) { - $engine_types = drush_get_engine_types_info(); - foreach ($command['engines'] as $engine_type => $config) { - $info = $engine_types[$engine_type]; - if (isset($info['topics'])) { - $command['topics'] = array_merge($command['topics'], $info['topics']); - } - if (isset($info['topic'])) { - $command['topics'][] = $info['topic']; - } - } -} diff --git a/vendor/drush/drush/includes/environment.inc b/vendor/drush/drush/includes/environment.inc index e6c993389142473b4f8c5f98eb104b84eb430fb2..83786a85fd6c5616d99ae4bc34caf5d8acdb69ae 100644 --- a/vendor/drush/drush/includes/environment.inc +++ b/vendor/drush/drush/includes/environment.inc @@ -14,139 +14,6 @@ use Drush\Log\LogLevel; use Webmozart\PathUtil\Path; -/** - * Log PHP errors to the Drush log. This is in effect until Drupal's error - * handler takes over. - */ -function drush_error_handler($errno, $message, $filename, $line) { - // E_DEPRECATED was added in PHP 5.3. Drupal 6 will not fix all the - // deprecated errors, but suppresses them. So we suppress them as well. - if (defined('E_DEPRECATED')) { - $errno = $errno & ~E_DEPRECATED; - } - - // "error_reporting" is usually set in php.ini, but may be changed by - // drush_errors_on() and drush_errors_off(). - if ($errno & error_reporting()) { - // By default we log notices. - $type = drush_get_option('php-notices', 'notice'); - $halt_on_error = drush_get_option('halt-on-error', (drush_drupal_major_version() != 6)); - - // Bitmask value that constitutes an error needing to be logged. - $error = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR; - if ($errno & $error) { - $type = 'error'; - } - - // Bitmask value that constitutes a warning being logged. - $warning = E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING; - if ($errno & $warning) { - $type = LogLevel::WARNING; - } - - drush_log($message . ' ' . basename($filename) . ':' . $line, $type); - - if ($errno == E_RECOVERABLE_ERROR && $halt_on_error) { - drush_log(dt('E_RECOVERABLE_ERROR encountered; aborting. To ignore recoverable errors, run again with --no-halt-on-error'), 'error'); - exit(DRUSH_APPLICATION_ERROR); - } - - return TRUE; - } -} - -/** - * Returns a localizable message about php.ini that - * varies depending on whether the php_ini_loaded_file() - * is available or not. - */ -function _drush_php_ini_loaded_file_message() { - if (function_exists('php_ini_loaded_file')) { - return dt('Please check your configuration settings in !phpini or in your drush.ini file; see examples/example.drush.ini for details.', array('!phpini' => php_ini_loaded_file())); - } - else { - return dt('Please check your configuration settings in your php.ini file or in your drush.ini file; see examples/example.drush.ini for details.'); - } -} - -/** - * Evalute the environment after an abnormal termination and - * see if we can determine any configuration settings that the user might - * want to adjust. - */ -function _drush_postmortem() { - // Make sure that the memory limit has been bumped up from the minimum default value of 32M. - $php_memory_limit = drush_memory_limit(); - if (($php_memory_limit > 0) && ($php_memory_limit <= 32*DRUSH_KILOBYTE*DRUSH_KILOBYTE)) { - drush_set_error('DRUSH_MEMORY_LIMIT', dt('Your memory limit is set to !memory_limit; Drush needs as much memory to run as Drupal. !php_ini_msg', array('!memory_limit' => $php_memory_limit / (DRUSH_KILOBYTE*DRUSH_KILOBYTE) . 'M', '!php_ini_msg' => _drush_php_ini_loaded_file_message()))); - } -} - -/** - * Evaluate the environment before command bootstrapping - * begins. If the php environment is too restrictive, then - * notify the user that a setting change is needed and abort. - */ -function _drush_environment_check_php_ini() { - $ini_checks = array('safe_mode' => '', 'open_basedir' => '', 'disable_functions' => array('exec', 'system'), 'disable_classes' => ''); - - // Test to insure that certain php ini restrictions have not been enabled - $prohibited_list = array(); - foreach ($ini_checks as $prohibited_mode => $disallowed_value) { - $ini_value = ini_get($prohibited_mode); - $invalid_value = FALSE; - if (empty($disallowed_value)) { - $invalid_value = !empty($ini_value) && (strcasecmp($ini_value, 'off') != 0); - } - else { - foreach ($disallowed_value as $test_value) { - if (preg_match('/(^|,)' . $test_value . '(,|$)/', $ini_value)) { - $invalid_value = TRUE; - } - } - } - if ($invalid_value) { - $prohibited_list[] = $prohibited_mode; - } - } - if (!empty($prohibited_list)) { - drush_log(dt('The following restricted PHP modes have non-empty values: !prohibited_list. This configuration is incompatible with drush. !php_ini_msg', array('!prohibited_list' => implode(' and ', $prohibited_list), '!php_ini_msg' => _drush_php_ini_loaded_file_message())), LogLevel::ERROR); - } - - return TRUE; -} - -/** - * Returns the current working directory. - * - * This is the directory as it was when drush was started, not the - * directory we are currently in. For that, use getcwd() directly. - */ -function drush_cwd() { - if ($path = drush_get_context('DRUSH_OLDCWD')) { - return $path; - } - // We use PWD if available because getcwd() resolves symlinks, which - // could take us outside of the Drupal root, making it impossible to find. - // $_SERVER['PWD'] isn't set on windows and generates a Notice. - $path = isset($_SERVER['PWD']) ? $_SERVER['PWD'] : ''; - if (empty($path)) { - $path = getcwd(); - } - - // Convert windows paths. - $path = Path::canonicalize($path); - - // Save original working dir case some command wants it. - drush_set_context('DRUSH_OLDCWD', $path); - - // Make a read-only copy of the original cwd at env.cwd - // for forwards-compatibility - drush_set_option('env.cwd', $path); - - return $path; -} - /** * Converts a Windows path (dir1\dir2\dir3) into a Unix path (dir1/dir2/dir3). * Also converts a cygwin "drive emulation" path (/cygdrive/c/dir1) into a @@ -154,7 +21,7 @@ function drush_cwd() { */ function _drush_convert_path($path) { $path = str_replace('\\','/', $path); - if (drush_is_windows(_drush_get_os()) && !drush_is_cygwin(_drush_get_os())) { + if (drush_is_windows() && !drush_is_cygwin()) { $path = preg_replace('/^\/cygdrive\/([A-Za-z])(.*)$/', '\1:\2', $path); } @@ -162,296 +29,12 @@ function _drush_convert_path($path) { } /** - * Returns parent directory. - * - * @param string - * Path to start from. - * - * @return string - * Parent path of given path. - */ -function _drush_shift_path_up($path) { - if (empty($path)) { - return FALSE; - } - $path = explode(DIRECTORY_SEPARATOR, $path); - // Move one directory up. - array_pop($path); - return implode(DIRECTORY_SEPARATOR, $path); - // return dirname($path); -} - -/** - * Like Drupal conf_path, but searching from beneath. - * Allows proper site uri detection in site sub-directories. - * - * Essentially looks for a settings.php file. Drush uses this - * function to find a usable site based on the user's current - * working directory. - * - * @param string - * Search starting path. Defaults to current working directory. - * - * @return - * Current site path (folder containing settings.php) or FALSE if not found. - */ -function drush_site_path($path = NULL) { - $site_path = FALSE; - - $path = empty($path) ? drush_cwd() : $path; - // Check the current path. - if (file_exists($path . '/settings.php')) { - $site_path = $path; - } - else { - // Move up dir by dir and check each. - // Stop if we get to a Drupal root. We don't care - // if it is DRUSH_SELECTED_DRUPAL_ROOT or some other root. - while (($path = _drush_shift_path_up($path)) && !drush_valid_root($path)) { - if (file_exists($path . '/settings.php')) { - $site_path = $path; - break; - } - } - } - - $site_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - if (file_exists($site_root . '/sites/sites.php')) { - $sites = array(); - // This will overwrite $sites with the desired mappings. - include($site_root . '/sites/sites.php'); - // We do a reverse lookup here to determine the URL given the site key. - if ($match = array_search($site_path, $sites)) { - $site_path = $match; - } - } - - // Last resort: try from site root - if (!$site_path) { - if ($site_root) { - if (file_exists($site_root . '/sites/default/settings.php')) { - $site_path = $site_root . '/sites/default'; - } - } - } - - return $site_path; -} - -/** - * Lookup a site's directory via the sites.php file given a hostname. - * - * @param $hostname - * The hostname of a site. May be converted from URI. - * - * @return $dir - * The directory associated with that hostname or FALSE if not found. - */ -function drush_site_dir_lookup_from_hostname($hostname, $site_root = NULL) { - if (!isset($site_root)) { - $site_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - } - if (!empty($site_root) && file_exists($site_root . '/sites/sites.php')) { - $sites = array(); - // This will overwrite $sites with the desired mappings. - include($site_root . '/sites/sites.php'); - return isset($sites[$hostname]) ? $sites[$hostname] : FALSE; - } - else { - return FALSE; - } -} - -/** - * This is a copy of Drupal's conf_path function, taken from D7 and - * adjusted slightly to search from the selected Drupal Root. - * - * Drush uses this routine to find a usable site based on a URI - * passed in via a site alias record or the --uri commandline option. - * - * Drush uses Drupal itself (specifically, the Drupal conf_path function) - * to bootstrap the site itself. If the implementation of conf_path - * changes, the site should still bootstrap correctly; the only consequence - * of this routine not working is that drush configuration files - * (drushrc.php) stored with the site's drush folders might not be found. - */ -function drush_conf_path($server_uri, $require_settings = TRUE) { - $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - if(empty($drupal_root) || empty($server_uri)) { - return NULL; - } - $parsed_uri = parse_url($server_uri); - if (is_array($parsed_uri) && !array_key_exists('scheme', $parsed_uri)) { - $parsed_uri = parse_url('http://' . $server_uri); - } - if (!is_array($parsed_uri)) { - return NULL; - } - $server_host = $parsed_uri['host']; - if (array_key_exists('path', $parsed_uri)) { - $server_uri = $parsed_uri['path'] . '/index.php'; - } - else { - $server_uri = "/index.php"; - } - $confdir = 'sites'; - - $sites = array(); - if (file_exists($drupal_root . '/' . $confdir . '/sites.php')) { - // This will overwrite $sites with the desired mappings. - include($drupal_root . '/' . $confdir . '/sites.php'); - } - - $uri = explode('/', $server_uri); - $server = explode('.', implode('.', array_reverse(explode(':', rtrim($server_host, '.'))))); - for ($i = count($uri) - 1; $i > 0; $i--) { - for ($j = count($server); $j > 0; $j--) { - $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i)); - if (isset($sites[$dir]) && file_exists($drupal_root . '/' . $confdir . '/' . $sites[$dir])) { - $dir = $sites[$dir]; - } - if (file_exists($drupal_root . '/' . $confdir . '/' . $dir . '/settings.php') || (!$require_settings && file_exists(DRUPAL_ROOT . '/' . $confdir . '/' . $dir))) { - $conf = "$confdir/$dir"; - return $conf; - } - } - } - $conf = "$confdir/default"; - return $conf; -} - -/** - * Exhaustive depth-first search to try and locate the Drupal root directory. - * This makes it possible to run Drush from a subdirectory of the drupal root. - * - * @param - * Search start path. Defaults to current working directory. - * @return - * A path to drupal root, or FALSE if not found. - */ -function drush_locate_root($start_path = NULL) { - $drupal_root = FALSE; - - $start_path = empty($start_path) ? drush_cwd() : $start_path; - foreach (array(TRUE, FALSE) as $follow_symlinks) { - $path = $start_path; - if ($follow_symlinks && is_link($path)) { - $path = realpath($path); - } - // Check the start path. - if (drush_valid_root($path)) { - $drupal_root = $path; - break; - } - else { - // Move up dir by dir and check each. - while ($path = _drush_shift_path_up($path)) { - if ($follow_symlinks && is_link($path)) { - $path = realpath($path); - } - if (drush_valid_root($path)) { - $drupal_root = $path; - break 2; - } - } - } - } - - return $drupal_root; -} - -/** - * Checks whether given path qualifies as a Drupal root. - * - * @param string - * Path to check. - * - * @return string - * The relative path to common.inc (varies by Drupal version), or FALSE if not - * a Drupal root. - */ -function drush_valid_root($path) { - $bootstrap_class = drush_bootstrap_class_for_root($path); - return $bootstrap_class != NULL; -} - -/** - * Tests the currently loaded database credentials to ensure a database connection can be made. - * - * @param bool $log_errors - * (optional) If TRUE, log error conditions; otherwise be quiet. - * - * @return bool - * TRUE if database credentials are valid. - */ -function drush_valid_db_credentials() { - try { - $sql = drush_sql_get_class(); - if (!$sqlVersion = drush_sql_get_version()) { - drush_log(dt('While checking DB credentials, could not instantiate SQLVersion class.'), 'debug'); - return FALSE; - } - if (!$sqlVersion->valid_credentials($sql->db_spec())) { - drush_log(dt('DB credentials are invalid.'), 'debug'); - return FALSE; - } - return $sql->query('SELECT 1;'); - } - catch (Exception $e) { - drush_log(dt('Checking DB credentials yielded error: @e', array('@e' => $e->getMessage())), 'debug'); - return FALSE; - } -} - -/** - * Determine a proper way to call drush again - * - * This check if we were called directly or as an argument to some - * wrapper command (php and sudo are checked now). - * - * Calling ./drush.php directly yields the following environment: - * - * _SERVER["argv"][0] => ./drush.php - * - * Calling php ./drush.php also yields the following: + * Build a drush command suitable for use for Drush to call itself. + * Used in backend_invoke. * - * _SERVER["argv"][0] => ./drush.php - * - * Note that the $_ global is defined only in bash and therefore cannot - * be relied upon. - * - * The DRUSH_COMMAND constant is initialised to the value of this - * function when environment.inc is loaded. - * - * @see DRUSH_COMMAND - */ -function drush_find_drush() { - if ($drush = realpath($_SERVER['argv']['0'])) { - return Path::canonicalize($drush); - } - return FALSE; -} - -/** - * Verify that we are running PHP through the command line interface. - * - * This function is useful for making sure that code cannot be run via the web server, - * such as a function that needs to write files to which the web server should not have - * access to. - * - * @return - * A boolean value that is true when PHP is being run through the command line, - * and false if being run through cgi or mod_php. - */ -function drush_verify_cli() { - return (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)); -} - -/** - * Build a drush command suitable for use for Drush to call itself - * e.g. in backend_invoke. + * @deprecated. */ -function drush_build_drush_command($drush_path = NULL, $php = NULL, $os = NULL, $remote_command = FALSE, $environment_variables = array()) { +function drush_build_drush_command($drush_path = NULL, $php = NULL, $os = NULL, $remote_command = FALSE, $environment_variables = []) { $os = _drush_get_os($os); $additional_options = ''; $prefix = ''; @@ -469,10 +52,7 @@ function drush_build_drush_command($drush_path = NULL, $php = NULL, $os = NULL, // via the --php flag. if (substr($drush_path, -4) == ".php") { if (!isset($php)) { - $php = drush_get_option('php'); - if (!isset($php)) { - $php = 'php'; - } + $php = Drush::config()->get('php', 'php'); } if (isset($php) && ($php != "php")) { $additional_options .= ' --php=' . drush_escapeshellarg($php, $os); @@ -503,11 +83,10 @@ function drush_build_drush_command($drush_path = NULL, $php = NULL, $os = NULL, // Add environmental variables, if present if (!empty($environment_variables)) { - $env = 'env'; + $prefix .= ' env'; foreach ($environment_variables as $key=>$value) { - $env .= ' ' . drush_escapeshellarg($key, $os) . '=' . drush_escapeshellarg($value, $os); + $prefix .= ' ' . drush_escapeshellarg($key, $os) . '=' . drush_escapeshellarg($value, $os); } - $prefix = $env . ' ' . $prefix; } return trim($prefix . ' ' . drush_escapeshellarg($drush_path, $os) . $additional_options); @@ -520,18 +99,11 @@ function drush_build_drush_command($drush_path = NULL, $php = NULL, $os = NULL, * which is which, test mingw first. */ function drush_is_cygwin($os = NULL) { - return _drush_test_os($os, array("CYGWIN","CWRSYNC","MINGW")); + return _drush_test_os($os, ["CYGWIN","CWRSYNC","MINGW"]); } function drush_is_mingw($os = NULL) { - return _drush_test_os($os, array("MINGW")); -} - -/** - * Return tar executable name specific for the current OS - */ -function drush_get_tar_executable() { - return drush_is_windows() ? (drush_is_mingw() ? "tar.exe" : "bsdtar.exe") : "tar"; + return _drush_test_os($os, ["MINGW"]); } /** @@ -539,7 +111,7 @@ function drush_get_tar_executable() { * This will return TRUE for Mac OS X (Darwin). */ function drush_is_osx($os = NULL) { - return _drush_test_os($os, array("DARWIN")); + return _drush_test_os($os, ["DARWIN"]); } /** @@ -552,16 +124,10 @@ function drush_has_bash($os = NULL) { } /** - * Checks operating system and returns - * supported bit bucket folder. + * Checks operating system and returns supported bit bucket folder. */ function drush_bit_bucket() { - if (drush_has_bash()) { - return '/dev/null'; - } - else { - return 'nul'; - } + return drush_has_bash() ? '/dev/null' : 'nul'; } /** @@ -572,31 +138,13 @@ function drush_bit_bucket() { * WIN* (e.g. WINNT) * CYGWIN * MINGW* (e.g. MINGW32) + * + * @deprecated. Use \Consolidation\SiteProcess\Util\Escape. */ function _drush_get_os($os = NULL) { - // The special os "CWRSYNC" can be used to indicate that we are testing - // a path that will be passed as an argument to cwRsync, which requires - // that the path be converted to /cygdrive/c/path, even on DOS or Powershell. - // The special os "RSYNC" can be used to indicate that we want to assume - // "CWRSYNC" when cwrsync is installed, or default to the local OS otherwise. - if (strtoupper($os) == "RSYNC") { - $os = _drush_get_os("LOCAL"); - // For now we assume that cwrsync is always installed on Windows, and never installed son any other platform. - return drush_is_windows($os) ? "CWRSYNC" : $os; - } - // We allow "LOCAL" to document, in instances where some parameters are being escaped - // for use on a remote machine, that one particular parameter will always be used on - // the local machine (c.f. drush_backend_invoke). - if (isset($os) && ($os != "LOCAL")) { - return $os; - } - if (_drush_test_os(getenv("MSYSTEM"), array("MINGW"))) { - return getenv("MSYSTEM"); - } - // QUESTION: Can we differentiate between DOS and POWERSHELL? They appear to have the same environment. - // At the moment, it does not seem to matter; they behave the same from PHP. - // At this point we will just return PHP_OS. - return PHP_OS; + // In most cases, $os will be NULL and PHP_OS will be returned. However, if an + // OS is specified in $os, return that instead. + return $os ?: PHP_OS; } function _drush_test_os($os, $os_list_to_check) { @@ -609,13 +157,6 @@ function _drush_test_os($os, $os_list_to_check) { return FALSE; } -/** - * Read the drush info file. - */ -function drush_read_drush_info() { - return Drush::ReadDrushInfo(); -} - /** * Make a determination whether or not the given * host is local or not. @@ -628,245 +169,88 @@ function drush_read_drush_info() { function drush_is_local_host($host) { // Check to see if the provided host is "local". // @see hook_drush_sitealias_alter() in drush.api.php. - if ( - ($host == 'localhost') || - ($host == '127.0.0.1') - ) { - return TRUE; - } - - return FALSE; -} - -/** - * Return the user's home directory. - */ -function drush_server_home() { - try { - return Path::getHomeDirectory(); - } catch (Exception $e) { - return NULL; - } + return $host == 'localhost' || $host == '127.0.0.1'; } /** - * Return the name of the user running drush. + * Determine whether current OS is a Windows variant. + * + * @deprecated. Use \Consolidation\SiteProcess\Util\Escape. */ -function drush_get_username() { - $name = NULL; - if (!$name = getenv("username")) { // Windows - if (!$name = getenv("USER")) { - // If USER not defined, use posix - if (function_exists('posix_getpwuid')) { - $processUser = posix_getpwuid(posix_geteuid()); - $name = $processUser['name']; - } - } - } - return $name; +function drush_is_windows($os = NULL) { + return strtoupper(substr(_drush_get_os($os), 0, 3)) === 'WIN'; } /** - * The path to the global cache directory. - * - * @param subdir - * Return the specified subdirectory inside the global - * cache directory instead. The subdirectory is created. + * @deprecated. Use \Consolidation\SiteProcess\Util\Escape. */ -function drush_directory_cache($subdir = '') { - $cache_locations = array(); - if (getenv('CACHE_PREFIX')) { - $cache_locations[getenv('CACHE_PREFIX')] = 'cache'; +function drush_escapeshellarg($arg, $os = NULL, $raw = FALSE) { + // Short-circuit escaping for simple params (keep stuff readable) + if (preg_match('|^[a-zA-Z0-9.:/_-]*$|', $arg)) { + return $arg; } - $home = drush_server_home(); - if ($home) { - $cache_locations[$home] = '.drush/cache'; + elseif (drush_is_windows($os)) { + return _drush_escapeshellarg_windows($arg, $raw); } - $cache_locations[drush_find_tmp()] = 'drush-' . drush_get_username() . '/cache'; - foreach ($cache_locations as $base => $dir) { - if (!empty($base) && is_writable($base)) { - $cache_dir = $base . '/' . $dir; - if (!empty($subdir)) { - $cache_dir .= '/' . $subdir; - } - if (drush_mkdir($cache_dir)) { - return $cache_dir; - } - else { - // If the base directory is writable, but the cache directory - // is not, then we will get an error. The error will be displayed, - // but we will still call drush_clear_error so that we can go - // on and try the next location to see if we can find a cache - // directory somewhere. - drush_clear_error(); - } - } - } - return drush_set_error('DRUSH_NO_WRITABLE_CACHE', dt('Drush must have a writable cache directory; please insure that one of the following locations is writable: @locations', - array('@locations' => implode(',', array_keys($cache_locations))))); -} - -/** - * Get complete information for all available extensions (modules and themes). - * - * @return - * An array containing info for all available extensions. In D8, these are Extension objects. - */ -function drush_get_extensions($include_hidden = TRUE) { - drush_include_engine('drupal', 'environment'); - $extensions = array_merge(drush_get_modules($include_hidden), drush_get_themes($include_hidden)); - foreach ($extensions as $name => $extension) { - if (isset($extension->info['name'])) { - $extensions[$name]->label = $extension->info['name'].' ('.$name.')'; - } - else { - drush_log(dt("Extension !name provides no human-readable name in .info file.", array('!name' => $name), LogLevel::DEBUG)); - $extensions[$name]->label = $name.' ('.$name.')'; - } - if (empty($extension->info['package'])) { - $extensions[$name]->info['package'] = dt('Other'); - } + else { + return _drush_escapeshellarg_linux($arg, $raw); } - return $extensions; } /** - * Gets the extension name. + * Linux version of escapeshellarg(). * - * @param $info - * The extension info. - * @return string - * The extension name. - */ -function drush_extension_get_name($info) { - drush_include_engine('drupal', 'environment'); - return _drush_extension_get_name($info); -} - -/** - * Gets the extension type. + * This is intended to work the same way that escapeshellarg() does on + * Linux. If we need to escape a string that will be used remotely on + * a Linux system, then we need our own implementation of escapeshellarg, + * because the Windows version behaves differently * - * @param $info - * The extension info. - * @return string - * The extension type. + * @deprecated. Use \Consolidation\SiteProcess\Util\Escape. */ -function drush_extension_get_type($info) { - drush_include_engine('drupal', 'environment'); - return _drush_extension_get_type($info); -} +function _drush_escapeshellarg_linux($arg, $raw = FALSE) { + // For single quotes existing in the string, we will "exit" + // single-quote mode, add a \' and then "re-enter" + // single-quote mode. The result of this is that + // 'quote' becomes '\''quote'\'' + $arg = preg_replace('/\'/', '\'\\\'\'', $arg); -/** - * Gets the extension path. - * - * @param $info - * The extension info. - * @return string - * The extension path. - */ -function drush_extension_get_path($info) { - drush_include_engine('drupal', 'environment'); - return _drush_extension_get_path($info); -} + // Replace "\t", "\n", "\r", "\0", "\x0B" with a whitespace. + // Note that this replacement makes Drush's escapeshellarg work differently + // than the built-in escapeshellarg in PHP on Linux, as these characters + // usually are NOT replaced. However, this was done deliberately to be more + // conservative when running _drush_escapeshellarg_linux on Windows + // (this can happen when generating a command to run on a remote Linux server.) + $arg = str_replace(["\t", "\n", "\r", "\0", "\x0B"], ' ', $arg); -/** - * Test compatibility of a extension with version of drupal core and php. - * - * @param $file Extension object as returned by system_rebuild_module_data(). - * @return FALSE if the extension is compatible. - */ -function drush_extension_check_incompatibility($file) { - if (!isset($file->info['core']) || $file->info['core'] != drush_get_drupal_core_compatibility()) { - return 'Drupal'; + // Only wrap with quotes when needed. + if(!$raw) { + // Add surrounding quotes. + $arg = "'" . $arg . "'"; } - if (version_compare(phpversion(), $file->info['php']) < 0) { - return 'PHP'; - } - return FALSE; -} - -/** - * - */ -function drush_drupal_required_modules($modules) { - drush_include_engine('drupal', 'environment'); - return _drush_drupal_required_modules($modules); -} -/** - * Return the default theme. - * - * @return - * Machine name of the default theme. - */ -function drush_theme_get_default() { - drush_include_engine('drupal', 'environment'); - return _drush_theme_default(); + return $arg; } /** - * Return the administration theme. + * Windows version of escapeshellarg(). * - * @return - * Machine name of the administration theme. - */ -function drush_theme_get_admin() { - drush_include_engine('drupal', 'environment'); - return _drush_theme_admin(); -} - -/** - * Return the path to public files directory. + * @deprecated. Use \Consolidation\SiteProcess\Util\Escape. */ -function drush_file_get_public() { - drush_include_engine('drupal', 'environment'); - return _drush_file_public_path(); -} +function _drush_escapeshellarg_windows($arg, $raw = FALSE) { + // Double up existing backslashes + $arg = preg_replace('/\\\/', '\\\\\\\\', $arg); -/** - * Return the path to private files directory. - */ -function drush_file_get_private() { - drush_include_engine('drupal', 'environment'); - return _drush_file_private_path(); -} + // Double up double quotes + $arg = preg_replace('/"/', '""', $arg); -/** - * Returns the sitewide Drupal directory for extensions. - */ -function drush_drupal_sitewide_directory($major_version = NULL) { - if (!$major_version) { - $major_version = drush_drupal_major_version(); - } - return ($major_version < 8) ? 'sites/all' : ''; -} + // Double up percents. + // $arg = preg_replace('/%/', '%%', $arg); -/** - * Helper function to get core compatibility constant. - * - * @return string - * The Drupal core compatibility constant. - */ -function drush_get_drupal_core_compatibility() { - if (defined('DRUPAL_CORE_COMPATIBILITY')) { - return DRUPAL_CORE_COMPATIBILITY; - } - elseif (defined('\Drupal::CORE_COMPATIBILITY')) { - return \Drupal::CORE_COMPATIBILITY; + // Only wrap with quotes when needed. + if(!$raw) { + // Add surrounding quotes. + $arg = '"' . $arg . '"'; } -} -/** - * Set Env. Variables for given site-alias. - */ -function drush_set_environment_vars(array $site_record) { - if (!empty($site_record)) { - $os = drush_os($site_record); - if (isset($site_record['#env-vars'])) { - foreach ($site_record['#env-vars'] as $var => $value) { - $env_var = drush_escapeshellarg($var, $os, TRUE) . '=' . drush_escapeshellarg($value, $os, TRUE); - putenv($env_var); - } - } - } + return $arg; } diff --git a/vendor/drush/drush/includes/exec.inc b/vendor/drush/drush/includes/exec.inc index 412cc5f965aee585029f26564a2f221387240503..33292d828a4f41e39d09807ae68347b06abb7efc 100644 --- a/vendor/drush/drush/includes/exec.inc +++ b/vendor/drush/drush/includes/exec.inc @@ -5,7 +5,9 @@ * Functions for executing system commands. (e.g. exec(), system(), ...). */ +use Drush\Drush; use Drush\Log\LogLevel; +use \Consolidation\SiteAlias\SiteAlias; /** * @defgroup commandwrappers Functions to execute commands. @@ -25,12 +27,13 @@ * The result code from system(): 0 == success. * * @see drush_shell_exec() + * @deprecated See Drush::process(). */ function drush_op_system($exec) { - if (drush_get_context('DRUSH_VERBOSE') || drush_get_context('DRUSH_SIMULATE')) { + if (Drush::verbose() || Drush::simulate()) { drush_print("Calling system($exec);", 0, STDERR); } - if (drush_get_context('DRUSH_SIMULATE')) { + if (Drush::simulate()) { return 0; } @@ -50,6 +53,9 @@ function drush_op_system($exec) { * The command to execute. May include placeholders used for sprintf. * @param ... * Values for the placeholders specified in $cmd. Each of these will be passed through escapeshellarg() to ensure they are safe to use on the command line. + * + * @deprecated See Drush::process(). + * * @return * TRUE on success, FALSE on failure */ @@ -74,20 +80,32 @@ function drush_shell_cd_and_exec($effective_wd, $cmd) { * The command to execute. May include placeholders used for sprintf. * @param ... * Values for the placeholders specified in $cmd. Each of these will be passed through escapeshellarg() to ensure they are safe to use on the command line. + * + * @deprecated See Drush::process(). + * * @return * TRUE on success, FALSE on failure */ function drush_shell_exec($cmd) { - return _drush_shell_exec(func_get_args()); + return _drush_shell_exec(func_get_args(), FALSE, Drush::simulate()); } /** - * Returns executable code for invoking preferred test editor. + * A version of drush_shell_exec() that ignores simulate mode * - * The next line after calling this function is usually - * @code drush_shell_exec_interactive($exec, $filepath, $filepath) @endcode + * @deprecated See Drush::process(). + */ +function drush_always_exec($cmd) { + return _drush_shell_exec(func_get_args(), FALSE, FALSE); +} + +/** + * Returns executable code for invoking preferred test editor. * * @see drush_config_edit() + * + * @deprecated + * Please make sure your shell is configured as desired. */ function drush_get_editor() { $bg = drush_get_option('bg') ? '&' : ''; @@ -100,9 +118,11 @@ function drush_get_editor() { * Executes a command in interactive mode. * * @see drush_shell_exec. + * + * @deprecated See Drush::process(). */ function drush_shell_exec_interactive($cmd) { - return _drush_shell_exec(func_get_args(), TRUE); + return _drush_shell_exec(func_get_args(), TRUE, Drush::simulate()); } /** @@ -123,7 +143,7 @@ function drush_shell_exec_interactive($cmd) { * * @see drush_shell_exec. */ -function _drush_shell_exec($args, $interactive = FALSE) { +function _drush_shell_exec($args, $interactive = FALSE, $simulate = false) { // Do not change the command itself, just the parameters. for ($x = 1; $x < count($args); $x++) { $args[$x] = drush_escapeshellarg($args[$x]); @@ -140,10 +160,8 @@ function _drush_shell_exec($args, $interactive = FALSE) { $command = call_user_func_array('sprintf', $args); } - if (drush_get_context('DRUSH_VERBOSE') || drush_get_context('DRUSH_SIMULATE')) { - drush_print('Executing: ' . $command, 0, STDERR); - } - if (!drush_get_context('DRUSH_SIMULATE')) { + Drush::logger()->info('Executing: ' . $command); + if (!$simulate) { if ($interactive) { $result = drush_shell_proc_open($command); return ($result == 0) ? TRUE : FALSE; @@ -152,7 +170,7 @@ function _drush_shell_exec($args, $interactive = FALSE) { exec($command . ' 2>&1', $output, $result); _drush_shell_exec_output_set($output); - if (drush_get_context('DRUSH_DEBUG')) { + if (Drush::debug()) { foreach ($output as $line) { drush_print($line, 2); } @@ -170,10 +188,15 @@ function _drush_shell_exec($args, $interactive = FALSE) { /** * Determine whether 'which $command' can find * a command on this system. + * + * @return bool + * + * @deprecated See \Drush\Exec\ExecTrait::programExists */ function drush_which($command) { - exec("which $command 2>&1", $output, $result); - return ($result == 0); + $process = Drush::process(['which', $command]); + $process->run(); + return $process->isSuccessful(); } /** @@ -192,21 +215,23 @@ function drush_which($command) { * Force creation of a tty * @return string * A string suitable for execution with drush_shell_remote_exec(). + * + * @deprecated See Drush::process and Drush::siteProcess(). + * */ -function drush_shell_proc_build($site, $command = '', $cd = NULL, $interactive = FALSE) { - // Build up the command. TODO: We maybe refactor this soon. - $hostname = drush_remote_host($site); - $ssh_options = drush_sitealias_get_option($site, 'ssh-options', "-o PasswordAuthentication=no"); +function drush_shell_proc_build(SiteAlias $site, $command = '', $cd = NULL, $interactive = FALSE) { + $hostname = $site->remoteHostWithUser(); + $ssh_options = drush_get_site_alias_config($site, 'ssh.options', "-o PasswordAuthentication=no"); $os = drush_os($site); - if (drush_sitealias_get_option($site, 'tty') || $interactive) { + if ($site->get('tty') || $interactive) { $ssh_options .= ' -t'; } $cmd = "ssh " . $ssh_options . " " . $hostname; if ($cd === TRUE) { - if (array_key_exists('root', $site)) { - $cd = $site['root']; + if ($site->hasRoot()) { + $cd = $site->root(); } else { $cd = FALSE; @@ -217,12 +242,7 @@ function drush_shell_proc_build($site, $command = '', $cd = NULL, $interactive = } if (!empty($command)) { - if (!drush_get_option('escaped', FALSE)) { - $cmd .= " " . drush_escapeshellarg($command, $os); - } - else { - $cmd .= " $command"; - } + $cmd .= " " . drush_escapeshellarg($command, $os); } return $cmd; @@ -236,13 +256,15 @@ function drush_shell_proc_build($site, $command = '', $cd = NULL, $interactive = * 0 no error * 1 general error * 127 command not found + * + * @deprecated See Drush::process(). */ function drush_shell_proc_open($cmd) { - if (drush_get_context('DRUSH_VERBOSE') || drush_get_context('DRUSH_SIMULATE')) { + if (Drush::verbose() || Drush::simulate()) { drush_print("Calling proc_open($cmd);", 0, STDERR); } - if (!drush_get_context('DRUSH_SIMULATE')) { - $process = proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes); + if (!Drush::simulate()) { + $process = proc_open($cmd, [0 => STDIN, 1 => STDOUT, 2 => STDERR], $pipes); $proc_status = proc_get_status($process); $exit_code = proc_close($process); return ($proc_status["running"] ? $exit_code : $proc_status["exitcode"] ); @@ -250,26 +272,31 @@ function drush_shell_proc_open($cmd) { return 0; } -/** - * Used by definition of ssh and other commands that call into drush_shell_proc_build() - * to declare their options. - */ -function drush_shell_exec_proc_build_options() { - return array( - 'ssh-options' => 'A string of extra options that will be passed to the ssh command (e.g. "-p 100")', - 'tty' => 'Create a tty (e.g. to run an interactive program).', - 'escaped' => 'Command string already escaped; do not add additional quoting.', - ); -} - /** * Determine the appropriate os value for the * specified site record * * @returns * NULL for 'same as local machine', 'Windows' or 'Linux'. + * + * @deprecated. See \Consolidation\SiteAlias\SiteAlias::os */ function drush_os($site_record = NULL) { + if (!$site_record instanceof SiteAlias) { + return legacy_drush_os($site_record); + } + // n.b. $options['remote-os'] has become 'ssh.os' in drush.yml + return drush_get_site_alias_config($site_record, 'ssh.os', 'Linux'); +} + +function drush_get_site_alias_config($site_record, $key, $default) +{ + $siteAliasWithConfig = SiteAliasWithConfig::create($site_record, Drush::config()); + + return $siteAliasWithConfig->get($key, $default); +} + +function legacy_drush_os($site_record = NULL) { // Default to $os = NULL, meaning 'same as local machine' $os = NULL; // If the site record has an 'os' element, use it @@ -277,28 +304,20 @@ function drush_os($site_record = NULL) { $os = $site_record['os']; } // Otherwise, we will assume that all remote machines are Linux - // (or whatever value 'remote-os' is set to in drushrc.php). + // (or whatever value 'remote-os' is set to in drush.yml). elseif (isset($site_record) && array_key_exists('remote-host', $site_record) && !empty($site_record['remote-host'])) { - $os = drush_get_option('remote-os', 'Linux'); + $os = Drush::config()->get('ssh.os', 'Linux'); } return $os; } -/** - * Determine the remote host (username@hostname.tld) for - * the specified site. - */ -function drush_remote_host($site, $prefix = '') { - $hostname = drush_escapeshellarg(drush_sitealias_get_option($site, 'remote-host', '', $prefix), "LOCAL"); - $username = drush_escapeshellarg(drush_sitealias_get_option($site, 'remote-user', '', $prefix), "LOCAL"); - return $username . (empty($username) ? '' : '@') . $hostname; -} - /** * Make an attempt to simply wrap the arg with the * kind of quote characters it does not already contain. * If it contains both kinds, then this function reverts to drush_escapeshellarg. + * + * @deprecated. Quoting performed by Drush::process() and friends. */ function drush_wrap_with_quotes($arg) { $has_double = strpos($arg, '"') !== FALSE; @@ -339,81 +358,13 @@ function _drush_shell_exec_output_set($output = FALSE) { /** * Returns the output of the most recent shell command as an array of lines. + * + * @deprecated Use Drush:process() and Drush::drush. Output is retried via $process->getOutput(). */ function drush_shell_exec_output() { return _drush_shell_exec_output_set(); } -/** - * Starts a background browser/tab for the current site or a specified URL. - * - * Uses a non-blocking proc_open call, so Drush execution will continue. - * - * @param $uri - * Optional URI or site path to open in browser. If omitted, or if a site path - * is specified, the current site home page uri will be prepended if the sites - * hostname resolves. - * @return - * TRUE if browser was opened, FALSE if browser was disabled by the user or a, - * default browser could not be found. - */ -function drush_start_browser($uri = NULL, $sleep = FALSE, $port = FALSE) { - if ($browser = drush_get_option('browser', TRUE)) { - // We can only open a browser if we have a DISPLAY environment variable on - // POSIX or are running Windows or OS X. - if (!drush_get_context('DRUSH_SIMULATE') && !getenv('DISPLAY') && !drush_is_windows() && !drush_is_osx()) { - drush_log(dt('No graphical display appears to be available, not starting browser.'), LogLevel::NOTICE); - return FALSE; - } - $host = parse_url($uri, PHP_URL_HOST); - if (!$host) { - // Build a URI for the current site, if we were passed a path. - $site = drush_get_context('DRUSH_URI'); - $host = parse_url($site, PHP_URL_HOST); - $uri = $site . '/' . ltrim($uri, '/'); - } - // Validate that the host part of the URL resolves, so we don't attempt to - // open the browser for http://default or similar invalid hosts. - $hosterror = (gethostbynamel($host) === FALSE); - $iperror = (ip2long($host) && gethostbyaddr($host) == $host); - if (!drush_get_context('DRUSH_SIMULATE') && ($hosterror || $iperror)) { - drush_log(dt('!host does not appear to be a resolvable hostname or IP, not starting browser. You may need to use the --uri option in your command or site alias to indicate the correct URL of this site.', array('!host' => $host)), LogLevel::WARNING); - return FALSE; - } - if ($port) { - $uri = str_replace($host, "localhost:$port", $uri); - } - if ($browser === TRUE) { - // See if we can find an OS helper to open URLs in default browser. - if (drush_shell_exec('which xdg-open')) { - $browser = 'xdg-open'; - } - else if (drush_shell_exec('which open')) { - $browser = 'open'; - } - else if (!drush_has_bash()) { - $browser = 'start'; - } - else { - // Can't find a valid browser. - $browser = FALSE; - } - } - $prefix = ''; - if ($sleep) { - $prefix = 'sleep ' . $sleep . ' && '; - } - if ($browser) { - drush_log(dt('Opening browser !browser at !uri', array('!browser' => $browser, '!uri' => $uri))); - if (!drush_get_context('DRUSH_SIMULATE')) { - $pipes = array(); - proc_close(proc_open($prefix . $browser . ' ' . drush_escapeshellarg($uri) . ' 2> ' . drush_bit_bucket() . ' &', array(), $pipes)); - } - return TRUE; - } - } - return FALSE; -} /** * @} End of "defgroup commandwrappers". diff --git a/vendor/drush/drush/includes/filesystem.inc b/vendor/drush/drush/includes/filesystem.inc index 0d0f49935a62cce5313d00c35341cd0bf5f85fe3..8ca1fc3d08a64b1224491b54fa043e844fd6899b 100644 --- a/vendor/drush/drush/includes/filesystem.inc +++ b/vendor/drush/drush/includes/filesystem.inc @@ -4,6 +4,9 @@ * @file * Filesystem utilities. */ +use Drush\Drush; +use Drush\Sql\SqlBase; +use Symfony\Component\Filesystem\Filesystem; use Webmozart\PathUtil\Path; /** @@ -12,100 +15,12 @@ */ /** - * Behavior for drush_copy_dir() and drush_move_dir() when destinations exist. + * Behavior for drush_copy_dir() when destinations exist. */ define('FILE_EXISTS_ABORT', 0); define('FILE_EXISTS_OVERWRITE', 1); define('FILE_EXISTS_MERGE', 2); - /** - * Determines whether the provided path is absolute or not - * on the specified O.S. -- starts with "/" on *nix, or starts - * with "[A-Z]:\" or "[A-Z]:/" on Windows. - */ -function drush_is_absolute_path($path, $os = NULL) { - // Relative paths will never start with a '/', even on Windows, - // so it is safe to just call all paths that start with a '/' - // absolute. This simplifies things for Windows with CYGWIN / MINGW / CWRSYNC, - // where absolute paths sometimes start c:\path and sometimes - // start /cygdrive/c/path. - if ($path[0] == '/') { - return TRUE; - } - if (drush_is_windows($os)) { - return preg_match('@^[a-zA-Z]:[\\\/]@', $path); - } - return FALSE; -} - -/** - * If we are going to pass a path to exec or proc_open, - * then we need to fix it up under CYGWIN or MINGW. In - * both of these environments, PHP works with absolute paths - * such as "C:\path". CYGWIN expects these to be converted - * to "/cygdrive/c/path" and MINGW expects these to be converted - * to "/c/path"; otherwise, the exec will not work. - * - * This call does nothing if the parameter is not an absolute - * path, or we are not running under CYGWIN / MINGW. - * - * UPDATE: It seems I was mistaken; this is only necessary if we - * are using cwRsync. We do not need to correct every path to - * exec or proc_open (thank god). - */ -function drush_correct_absolute_path_for_exec($path, $os = NULL) { - if (drush_is_windows() && drush_is_absolute_path($path, "WINNT")) { - if (drush_is_mingw($os)) { - $path = preg_replace('/(\w):/', '/${1}', str_replace('\\', '/', $path)); - } - elseif (drush_is_cygwin($os)) { - $path = preg_replace('/(\w):/', '/cygdrive/${1}', str_replace('\\', '/', $path)); - } - } - return $path; -} - -/** - * Remove the trailing DIRECTORY_SEPARATOR from a path. - * Will actually remove either / or \ on Windows. - */ -function drush_trim_path($path, $os = NULL) { - if (drush_is_windows($os)) { - return rtrim($path, '/\\'); - } - else { - return rtrim($path, '/'); - } -} - -/** - * Makes sure the path has only path separators native for the current operating system - */ -function drush_normalize_path($path) { - if (drush_is_windows()) { - $path = str_replace('/', '\\', strtolower($path)); - } - else { - $path = str_replace('\\', '/', $path); - } - return drush_trim_path($path); -} - -/** - * Calculates a single md5 hash for all files a directory (incuding subdirectories) - */ -function drush_dir_md5($dir) { - $flist = drush_scan_directory($dir, '/./', array('.', '..'), 0, TRUE, 'filename', 0, TRUE); - $hashes = array(); - foreach ($flist as $f) { - $sum = array(); - exec('cksum ' . escapeshellarg($f->filename), $sum); - $hashes[] = trim(str_replace(array($dir), array(''), $sum[0])); - } - sort($hashes); - return md5(implode("\n", $hashes)); -} - /** * Deletes the specified file or directory and everything inside it. * @@ -123,6 +38,8 @@ function drush_dir_md5($dir) { * * @return bool * FALSE on failure, TRUE if everything was deleted. + * + * @deprecated Use \Symfony\Component\Filesystem\Filesystem::remove. */ function drush_delete_dir($dir, $force = FALSE, $follow_symlinks = FALSE) { // Do not delete symlinked files, only unlink symbolic links @@ -182,19 +99,6 @@ function drush_delete_dir_contents($dir, $force = FALSE) { return TRUE; } -/** - * Deletes the provided file or folder and everything inside it. - * This function explicitely tries to delete read-only files / folders. - * - * @param $dir - * The directory to delete - * @return - * FALSE on failure, TRUE if everything was deleted - */ -function drush_delete_tmp_dir($dir) { - return drush_delete_dir($dir, TRUE); -} - /** * Copy $src to $dest. * @@ -212,6 +116,8 @@ function drush_delete_tmp_dir($dir) { * - FILE_EXISTS_MERGE - Leaves existing files and directories in place. * @return * TRUE on success, FALSE on failure. + * + * @deprecated Use \Symfony\Component\Filesystem\Filesystem::copy. */ function drush_copy_dir($src, $dest, $overwrite = FILE_EXISTS_ABORT) { // Preflight based on $overwrite if $dest exists. @@ -236,7 +142,7 @@ function drush_copy_dir($src, $dest, $overwrite = FILE_EXISTS_ABORT) { return drush_set_error('DRUSH_DESTINATION_NOT_WRITABLE', dt('Destination directory !dest is not writable.', array('!dest' => dirname($dest)))); } // Try to do a recursive copy. - if (@drush_op('_drush_recursive_copy', $src, $dest)) { + if (@_drush_recursive_copy($src, $dest)) { return TRUE; } @@ -249,7 +155,7 @@ function drush_copy_dir($src, $dest, $overwrite = FILE_EXISTS_ABORT) { function _drush_recursive_copy($src, $dest) { // all subdirectories and contents: if(is_dir($src)) { - if (!drush_mkdir($dest, TRUE)) { + if (!mkdir($dest)) { return FALSE; } $dir_handle = opendir($src); @@ -274,7 +180,7 @@ function _drush_recursive_copy($src, $dest) { touch($dest, filemtime($src)); // Preserve execute permission. - if (!is_link($src) && !drush_is_windows()) { + if (!is_link($src) && (!function_exists('drush_is_windows') || !drush_is_windows())) { // Get execute bits of $src. $execperms = fileperms($src) & 0111; // Apply execute permissions if any. @@ -288,119 +194,38 @@ function _drush_recursive_copy($src, $dest) { } /** - * Move $src to $dest. - * - * If the php 'rename' function doesn't work, then we'll do copy & delete. - * - * @param $src - * The directory to move. - * @param $dest - * The destination to move the source to, including the new name of - * the directory. To move directory "a" from "/b" to "/c", then - * $src = "/b/a" and $dest = "/c/a". To move "a" to "/c" and rename - * it to "d", then $dest = "/c/d" (just like php rename function). - * @param $overwrite - * If TRUE, the destination will be deleted if it exists. - * @return - * TRUE on success, FALSE on failure. - */ -function drush_move_dir($src, $dest, $overwrite = FALSE) { - // Preflight based on $overwrite if $dest exists. - if (file_exists($dest)) { - if ($overwrite) { - drush_op('drush_delete_dir', $dest, TRUE); - } - else { - return drush_set_error('DRUSH_DESTINATION_EXISTS', dt('Destination directory !dest already exists.', array('!dest' => $dest))); - } - } - // $src readable? - if (!drush_op('is_readable', $src)) { - return drush_set_error('DRUSH_SOURCE_NOT_EXISTS', dt('Source directory !src is not readable or does not exist.', array('!src' => $src))); - } - // $dest writable? - if (!drush_op('is_writable', dirname($dest))) { - return drush_set_error('DRUSH_DESTINATION_NOT_WRITABLE', dt('Destination directory !dest is not writable.', array('!dest' => dirname($dest)))); - } - // Try rename. It will fail if $src and $dest are not in the same partition. - if (@drush_op('rename', $src, $dest)) { - return TRUE; - } - // Eventually it will create an empty file in $dest. See - // http://www.php.net/manual/es/function.rename.php#90025 - elseif (is_file($dest)) { - drush_op('unlink', $dest); - } - - // If 'rename' fails, then we will use copy followed - // by a delete of the source. - if (drush_copy_dir($src, $dest)) { - drush_op('drush_delete_dir', $src, TRUE); - return TRUE; - } - - return drush_set_error('DRUSH_MOVE_DIR_FAILURE', dt('Unable to move !src to !dest.', array('!src' => $src, '!dest' => $dest))); -} - -/** - * Cross-platform compatible helper function to recursively create a directory tree. + * Recursively create a directory tree. * * @param path * Path to directory to create. - * @param required - * If TRUE, then drush_mkdir will call drush_set_error on failure. * - * Callers should *always* do their own error handling after calling drush_mkdir. - * If $required is FALSE, then a different location should be selected, and a final - * error message should be displayed if no usable locations can be found. - * @see drush_directory_cache(). - * If $required is TRUE, then the execution of the current command should be - * halted if the required directory cannot be created. + * @throws IOException On any directory creation failure + * @deprecated See \Symfony\Component\Filesystem\Filesystem::mkdir. */ -function drush_mkdir($path, $required = TRUE) { - if (!is_dir($path)) { - if (drush_mkdir(dirname($path))) { - if (@mkdir($path)) { - return TRUE; - } - elseif (is_dir($path) && is_writable($path)) { - // The directory was created by a concurrent process. - return TRUE; - } - else { - if (!$required) { - return FALSE; - } - if (is_writable(dirname($path))) { - return drush_set_error('DRUSH_CREATE_DIR_FAILURE', dt('Unable to create !dir.', array('!dir' => preg_replace('/\w+\/\.\.\//', '', $path)))); - } - else { - return drush_set_error('DRUSH_PARENT_NOT_WRITABLE', dt('Unable to create !newdir in !dir. Please check directory permissions.', array('!newdir' => basename($path), '!dir' => realpath(dirname($path))))); - } - } - } - return FALSE; - } - else { - if (!is_writable($path)) { - if (!$required) { - return FALSE; - } - return drush_set_error('DRUSH_DESTINATION_NOT_WRITABLE', dt('Directory !dir exists, but is not writable. Please check directory permissions.', array('!dir' => realpath($path)))); - } - return TRUE; - } +function drush_mkdir($path) { + $fs = new Filesystem(); + $fs->mkdir($path); + return true; } /* * Determine if program exists on user's PATH. * * @return bool|null + * + * @deprecated + * See \Drush\Exec\ExecTrait::programExists. */ function drush_program_exists($program) { if (drush_has_bash()) { $bucket = drush_bit_bucket(); - return drush_op_system("command -v $program >$bucket 2>&1") === 0 ? TRUE : FALSE; + + // Remove environment variables (eg. PGPASSFILE=) before testing program. + $program = preg_replace('#^([A-Z0-9]+=.+? )+#', '', $program); + + // Don't use drush_op_system() since we don't want output during tests. + system("command -v $program > $bucket 2>&1", $result_code); + return $result_code === 0 ? TRUE : FALSE; } } @@ -431,61 +256,10 @@ function drush_save_data_to_temp_file($data, $suffix = NULL) { /** * Returns the path to a temporary directory. * - * This is a custom version of Drupal's file_directory_path(). - * We can't directly rely on sys_get_temp_dir() as this - * path is not valid in some setups for Mac, and we want to honor - * an environment variable (used by tests). + * @deprecated Use $this->getConfig()->tmp() in a ConfigAware command. */ function drush_find_tmp() { - static $temporary_directory; - - if (!isset($temporary_directory)) { - $directories = array(); - - // Get user specific and operating system temp folders from system environment variables. - // See http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true - $tempdir = getenv('TEMP'); - if (!empty($tempdir)) { - $directories[] = $tempdir; - } - $tmpdir = getenv('TMP'); - if (!empty($tmpdir)) { - $directories[] = $tmpdir; - } - // Operating system specific dirs. - if (drush_is_windows()) { - $windir = getenv('WINDIR'); - if (isset($windir)) { - // WINDIR itself is not writable, but it always contains a /Temp dir, - // which is the system-wide temporary directory on older versions. Newer - // versions only allow system processes to use it. - $directories[] = Path::join($windir, 'Temp'); - } - } - else { - $directories[] = Path::canonicalize('/tmp'); - } - $directories[] = Path::canonicalize(sys_get_temp_dir()); - - foreach ($directories as $directory) { - if (is_dir($directory) && is_writable($directory)) { - $temporary_directory = $directory; - break; - } - } - - if (empty($temporary_directory)) { - // If no directory has been found, create one in cwd. - $temporary_directory = Path::join(drush_cwd(), 'tmp'); - drush_mkdir($temporary_directory, TRUE); - if (!is_dir($temporary_directory)) { - return drush_set_error('DRUSH_UNABLE_TO_CREATE_TMP_DIR', dt("Unable to create a temporary directory.")); - } - drush_register_file_for_deletion($temporary_directory); - } - } - - return $temporary_directory; + return Drush::config()->tmp(); } /** @@ -501,9 +275,9 @@ function drush_find_tmp() { */ function drush_tempnam($pattern, $tmp_dir = NULL, $suffix = '') { if ($tmp_dir == NULL) { - $tmp_dir = drush_find_tmp(); + $tmp_dir = Drush::config()->tmp(); } - $tmp_file = tempnam($tmp_dir, $pattern); + $tmp_file = Path::canonicalize(tempnam($tmp_dir, $pattern)); drush_register_file_for_deletion($tmp_file); $tmp_file_with_suffix = $tmp_file . $suffix; drush_register_file_for_deletion($tmp_file_with_suffix); @@ -514,10 +288,10 @@ function drush_tempnam($pattern, $tmp_dir = NULL, $suffix = '') { * Creates a temporary directory and return its path. */ function drush_tempdir() { - $tmp_dir = drush_trim_path(drush_find_tmp()); - $tmp_dir .= '/' . 'drush_tmp_' . uniqid(time() . '_'); + $tmp_dir = Path::join(Drush::config()->tmp(), 'drush_tmp_' . uniqid(time() . '_')); - drush_mkdir($tmp_dir); + $fs = new Filesystem(); + $fs->mkdir($tmp_dir); drush_register_file_for_deletion($tmp_dir); return $tmp_dir; @@ -562,65 +336,6 @@ function _drush_delete_registered_files() { } } -/** - * Decide where our backup directory should go - * - * @param string $subdir - * The name of the desired subdirectory(s) under drush-backups. - * Usually a database name. - */ -function drush_preflight_backup_dir($subdir = NULL) { - $backup_dir = drush_get_context('DRUSH_BACKUP_DIR', drush_get_option('backup-location')); - - if (empty($backup_dir)) { - // Try to use db name as subdir if none was provided. - if (empty($subdir)) { - $subdir = 'unknown'; - if ($sql = drush_sql_get_class()) { - $db_spec = $sql->db_spec(); - $subdir = $db_spec['database']; - } - } - - // Save the date to be used in the backup directory's path name. - $date = gmdate('YmdHis', $_SERVER['REQUEST_TIME']); - - $backup_dir = drush_get_option('backup-dir', Path::join(drush_server_home(), 'drush-backups')); - $backup_dir = Path::join($backup_dir, $subdir, $date); - drush_set_context('DRUSH_BACKUP_DIR', $backup_dir); - } - else { - Path::canonicalize($backup_dir); - } - return $backup_dir; -} - -/** - * Prepare a backup directory - */ -function drush_prepare_backup_dir($subdir = NULL) { - $backup_dir = drush_preflight_backup_dir($subdir); - $backup_parent = Path::getDirectory($backup_dir); - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - - if ((!empty($drupal_root)) && (strpos($backup_parent, $drupal_root) === 0)) { - return drush_set_error('DRUSH_PM_BACKUP_FAILED', dt('It\'s not allowed to store backups inside the Drupal root directory.')); - } - if (!file_exists($backup_parent)) { - if (!drush_mkdir($backup_parent, TRUE)) { - return drush_set_error('DRUSH_PM_BACKUP_FAILED', dt('Unable to create backup directory !dir.', array('!dir' => $backup_parent))); - } - } - if (!is_writable($backup_parent)) { - return drush_set_error('DRUSH_PM_BACKUP_FAILED', dt('Backup directory !dir is not writable.', array('!dir' => $backup_parent))); - } - - if (!drush_mkdir($backup_dir, TRUE)) { - return FALSE; - } - return $backup_dir; -} - /** * Test to see if a file exists and is not empty */ @@ -635,105 +350,6 @@ function drush_file_not_empty($file_to_test) { return FALSE; } -/** - * Finds all files that match a given mask in a given directory. - * Directories and files beginning with a period are excluded; this - * prevents hidden files and directories (such as SVN working directories - * and GIT repositories) from being scanned. - * - * @param $dir - * The base directory for the scan, without trailing slash. - * @param $mask - * The regular expression of the files to find. - * @param $nomask - * An array of files/directories to ignore. - * @param $callback - * The callback function to call for each match. - * @param $recurse_max_depth - * When TRUE, the directory scan will recurse the entire tree - * starting at the provided directory. When FALSE, only files - * in the provided directory are returned. Integer values - * limit the depth of the traversal, with zero being treated - * identically to FALSE, and 1 limiting the traversal to the - * provided directory and its immediate children only, and so on. - * @param $key - * The key to be used for the returned array of files. Possible - * values are "filename", for the path starting with $dir, - * "basename", for the basename of the file, and "name" for the name - * of the file without an extension. - * @param $min_depth - * Minimum depth of directories to return files from. - * @param $include_dot_files - * If TRUE, files that begin with a '.' will be returned if they - * match the provided mask. If FALSE, files that begin with a '.' - * will not be returned, even if they match the provided mask. - * @param $depth - * Current depth of recursion. This parameter is only used internally and should not be passed. - * - * @return - * An associative array (keyed on the provided key) of objects with - * "path", "basename", and "name" members corresponding to the - * matching files. - */ -function drush_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $callback = 0, $recurse_max_depth = TRUE, $key = 'filename', $min_depth = 0, $include_dot_files = FALSE, $depth = 0) { - $key = (in_array($key, array('filename', 'basename', 'name')) ? $key : 'filename'); - $files = array(); - - // Exclude Bower and Node directories. - $nomask = array_merge($nomask, drush_get_option_list('ignored-directories', array('node_modules', 'bower_components'))); - - if (is_string($dir) && is_dir($dir) && $handle = opendir($dir)) { - while (FALSE !== ($file = readdir($handle))) { - if (!in_array($file, $nomask) && (($include_dot_files && (!preg_match("/\.\+/",$file))) || ($file[0] != '.'))) { - if (is_dir("$dir/$file") && (($recurse_max_depth === TRUE) || ($depth < $recurse_max_depth))) { - // Give priority to files in this folder by merging them in after any subdirectory files. - $files = array_merge(drush_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse_max_depth, $key, $min_depth, $include_dot_files, $depth + 1), $files); - } - elseif ($depth >= $min_depth && preg_match($mask, $file)) { - // Always use this match over anything already set in $files with the same $$key. - $filename = "$dir/$file"; - $basename = basename($file); - $name = substr($basename, 0, strrpos($basename, '.')); - $files[$$key] = new stdClass(); - $files[$$key]->filename = $filename; - $files[$$key]->basename = $basename; - $files[$$key]->name = $name; - if ($callback) { - drush_op($callback, $filename); - } - } - } - } - - closedir($handle); - } - - return $files; -} - -/** - * Simple helper function to append data to a given file. - * - * @param string $file - * The full path to the file to append the data to. - * @param string $data - * The data to append. - * - * @return boolean - * TRUE on success, FALSE in case of failure to open or write to the file. - */ -function drush_file_append_data($file, $data) { - if (!$fd = fopen($file, 'a+')) { - drush_set_error(dt("ERROR: fopen(@file, 'ab') failed", array('@file' => $file))); - return FALSE; - } - if (!fwrite($fd, $data)) { - drush_set_error(dt("ERROR: fwrite(@file) failed", array('@file' => $file)) . '<pre>' . $data); - return FALSE; - } - return TRUE; -} - /** * Return 'TRUE' if one directory is located anywhere inside * the other. diff --git a/vendor/drush/drush/includes/output.inc b/vendor/drush/drush/includes/output.inc index 950953f12123252c8a294d6d9fef210094907b6d..d8f4f92aa21f0deac6347d2e18c5e0f2da3da7a0 100644 --- a/vendor/drush/drush/includes/output.inc +++ b/vendor/drush/drush/includes/output.inc @@ -1,7 +1,7 @@ <?php use Drupal\Core\Render\Markup; -use Drush\Log\LogLevel; +use Drush\Utils\StringUtils; /** * @defgroup outputfunctions Process output text. @@ -10,9 +10,9 @@ /** * Prints a message with optional indentation. In general, - * drush_log($message, LogLevel::OK) is often a better choice than this function. + * $this->>logger()->$method($message) is often a better choice than this function. * That gets your confirmation message (for example) into the logs for this - * drush request. Consider that drush requests may be executed remotely and + * drush request. Consider that Drush requests may be executed remotely and * non interactively. * * @param $message @@ -25,6 +25,9 @@ * error. See http://php.net/manual/en/features.commandline.io-streams.php * @param $newline * Add a "\n" to the end of the output. Defaults to TRUE. + * + * @deprecated + * Use $this->output()->writeln() in a command method. */ function drush_print($message = '', $indent = 0, $handle = NULL, $newline = TRUE) { $msg = str_repeat(' ', $indent) . (string)$message; @@ -34,109 +37,14 @@ function drush_print($message = '', $indent = 0, $handle = NULL, $newline = TRUE if (($charset = drush_get_option('output_charset')) && function_exists('iconv')) { $msg = iconv('UTF-8', $charset, $msg); } - if (!isset($handle)) { + if (!$handle) { $handle = STDOUT; - // In the past, Drush would use `print` here; now that we are using - // fwrite (to avoid problems with php sending the http headers), we - // must explicitly capture the output, because ob_start() / ob_end() - // does not capture output written via fwrite to STDOUT. - drush_backend_output_collect($msg); } fwrite($handle, $msg); } /** - * Print a prompt -- that is, a message with no trailing newline. - */ -function drush_print_prompt($message, $indent = 0, $handle = NULL) { - drush_print($message, $indent, $handle, FALSE); -} - -/** - * Stores a message which is printed during drush_shutdown() if in compact mode. - * @param $message - * The message to print. If $message is an array, - * then each element of the array is printed on a - * separate line. - */ -function drush_print_pipe($message = '') { - $buffer = &drush_get_context('DRUSH_PIPE_BUFFER' , ''); - if (is_array($message)) { - $message = implode("\n", $message) . "\n"; - } - $buffer .= $message; -} - -/** - * Prints an array or string. - * @param $array - * The array to print. - * @param $newline - * Add a "\n" to the end of the output. Defaults to TRUE. - */ -function drush_print_r($array, $handle = NULL, $newline = TRUE) { - drush_print(print_r($array, TRUE), 0, $handle, $newline); -} - -/** - * Format some data and print it out. Respect --format option. - */ -function drush_print_format($input, $default_format, $metadata = NULL) { - drush_print(drush_format($input, $metadata, drush_get_option('format', $default_format))); -} - -/** - * Prepares a variable for printing. Loads the requested output - * formatter and uses it to process the provided input. - * - * @param mixed $input - * A variable. - * @param string $metadata - * Optional formatting metadata. Not used by all formats. - * 'label' - text to label data with in some formats (e.g. export, config) - * @param string $format - * Optional format; defaults to print_r. - * @return string - * The variable formatted according to specified format. - * Ready for drush_print(). - */ -function drush_format($input, $metadata = NULL, $format = NULL) { - $output = ''; - // Look up the format and label, and fill in default values for metadata - if (is_string($metadata)) { - $metadata = array('label' => $metadata); - } - if (!is_array($metadata)) { - $metadata = array(); - } - $metadata += array( - 'metameta' => array(), - ); - if (isset($metadata['format'])) { - // If the format is set in metadata, then it will - // override whatever is passed in via the $format parameter. - $format = $metadata['format']; - } - if (!isset($format)) { - // TODO: we shouldn't ever call drush_get_option here. - // Get rid of this once we confirm that there are no - // callers that still need it. - $format = drush_get_option('format', 'print-r'); - } - - $formatter = drush_load_engine('outputformat', $format); - if ($formatter) { - if ($formatter === TRUE) { - return drush_set_error(dt('No outputformat class defined for !format', array('!format' => $format))); - } - $output = $formatter->process($input, $metadata); - } - - return $output; -} - -/** - * Rudimentary replacement for Drupal API t() function. + * Rudimentary translation system, akin to Drupal's t() function. * * @param string * String to process, possibly with replacement item. @@ -145,58 +53,9 @@ function drush_format($input, $metadata = NULL, $format = NULL) { * * @return * The processed string. - * - * @see t() */ -function dt($string, $args = array()) { - $output = NULL; - if (function_exists('t') && drush_drupal_major_version() == 7) { - $output = t($string, $args); - } - // The language system requires a working container which has the string - // translation service. - else if (drush_drupal_major_version() >= 8 && \Drupal::hasService('string_translation')) { - // Drupal 8 removes !var replacements, creating a user-level error when - // these are used, so we'll pre-replace these before calling translate(). - list($string, $args) = replace_legacy_dt_args($string, $args); - $output = (string) \Drupal::translation()->translate($string, $args); - } - else if (function_exists('t') && drush_drupal_major_version() <= 7 && function_exists('theme')) { - $output = t($string, $args); - } - - // If Drupal's t() function unavailable. - if (!isset($output)) { - if (!empty($args)) { - $output = strtr($string, $args); - } - else { - $output = $string; - } - } - return $output; -} - -/** - * Replace placeholders that begin with a '!' with '@'. - */ -function replace_legacy_dt_args(&$string, &$legacy_args) { - $args = array(); - $replace = array(); - foreach ($legacy_args as $name => $argument) { - if ($name[0] == '!') { - $new_arg = '@' . substr($name, 1); - $replace[$name] = $new_arg; - $args[$new_arg] = Markup::create($argument); - } - else { - $args[$name] = $argument; - } - } - return [ - strtr($string, $replace), - $args - ]; +function dt($string, $args = []) { + return StringUtils::interpolate($string, $args); } /** @@ -212,7 +71,7 @@ function replace_legacy_dt_args(&$string, &$legacy_args) { * The plain-text representation of the input. */ function drush_html_to_text($html, $allowed_tags = NULL) { - $replacements = array( + $replacements = [ '<hr>' => '------------------------------------------------------------------------------', '<li>' => ' * ', '<h1>' => '===== ', @@ -222,603 +81,11 @@ function drush_html_to_text($html, $allowed_tags = NULL) { '<h3>' => '::: ', '</h3>' => ' :::', '<br/>' => "\n", - ); + ]; $text = str_replace(array_keys($replacements), array_values($replacements), $html); return html_entity_decode(preg_replace('/ *<[^>]*> */', ' ', $text)); } - -/** - * Print a formatted table. - * - * @param $rows - * The rows to print. - * @param $header - * If TRUE, the first line will be treated as table header. - * @param $widths - * An associative array whose keys are column IDs and values are widths of each column (in characters). - * If not specified this will be determined automatically, based on a "best fit" algorithm. - * @param $handle - * File handle to write to. NULL will write - * to standard output, STDERR will write to the standard - * error. See http://php.net/manual/en/features.commandline.io-streams.php - * @return $tbl - * Use $tbl->getTable() to get the output from the return value. - */ -function drush_print_table($rows, $header = FALSE, $widths = array(), $handle = NULL) { - $tbl = _drush_format_table($rows, $header, $widths); - $output = $tbl->getTable(); - if (!stristr(PHP_OS, 'WIN')) { - $output = str_replace("\r\n", PHP_EOL, $output); - } - - drush_print(rtrim($output), 0, $handle); - return $tbl; -} - -/** - * Format a table of data. - * - * @param $rows - * The rows to print. - * @param $header - * If TRUE, the first line will be treated as table header. - * @param $widths - * An associative array whose keys are column IDs and values are widths of each column (in characters). - * If not specified this will be determined automatically, based on a "best fit" algorithm. - * @param array $console_table_options - * An array that is passed along when constructing a Console_Table instance. - * @return $output - * The formatted output. - */ -function drush_format_table($rows, $header = FALSE, $widths = array(), $console_table_options = array()) { - $tbl = _drush_format_table($rows, $header, $widths, $console_table_options); - $output = $tbl->getTable(); - if (!drush_is_windows()) { - $output = str_replace("\r\n", PHP_EOL, $output); - } - return $output; -} - -function _drush_format_table($rows, $header = FALSE, $widths = array(), $console_table_options = array()) { - // Add defaults. - $tbl = new ReflectionClass('Console_Table'); - $console_table_options += array(CONSOLE_TABLE_ALIGN_LEFT , ''); - $tbl = $tbl->newInstanceArgs($console_table_options); - - $auto_widths = drush_table_column_autowidth($rows, $widths); - - // Do wordwrap on all cells. - $newrows = array(); - foreach ($rows as $rowkey => $row) { - foreach ($row as $col_num => $cell) { - $newrows[$rowkey][$col_num] = wordwrap($cell, $auto_widths[$col_num], "\n", TRUE); - if (isset($widths[$col_num])) { - $newrows[$rowkey][$col_num] = str_pad($newrows[$rowkey][$col_num], $widths[$col_num]); - } - } - } - if ($header) { - $headers = array_shift($newrows); - $tbl->setHeaders($headers); - } - - $tbl->addData($newrows); - return $tbl; -} - -/** - * Convert an associative array of key : value pairs into - * a table suitable for processing by drush_print_table. - * - * @param $keyvalue_table - * An associative array of key : value pairs. - * @param $metadata - * 'key-value-item': If the value is an array, then - * the item key determines which item from the value - * will appear in the output. - * @return - * An array of arrays, where the keys from the input - * array are stored in the first column, and the values - * are stored in the third. A second colum is created - * specifically to hold the ':' separator. - */ -function drush_key_value_to_array_table($keyvalue_table, $metadata = array()) { - if (!is_array($keyvalue_table)) { - return drush_set_error('DRUSH_INVALID_FORMAT', dt("Data not compatible with selected key-value output format.")); - } - if (!is_array($metadata)) { - $metadata = array('key-value-item' => $metadata); - } - $item_key = array_key_exists('key-value-item', $metadata) ? $metadata['key-value-item'] : NULL; - $metadata += array( - 'format' => 'list', - 'separator' => ' ', - ); - $table = array(); - foreach ($keyvalue_table as $key => $value) { - if (isset($value)) { - if (is_array($value) && isset($item_key)) { - $value = $value[$item_key]; - } - // We should only have simple values here, but if - // we don't, use drush_format() to flatten as a fallback. - if (is_array($value)) { - $value = drush_format($value, $metadata, 'list'); - } - } - if (isset($metadata['include-field-labels']) && !$metadata['include-field-labels']) { - $table[] = array(isset($value) ? $value : ''); - } - elseif (isset($value)) { - $table[] = array($key, ' :', $value); - } - else { - $table[] = array($key . ':', '', ''); - } - } - return $table; -} - -/** - * Select the fields that should be used. - */ -function drush_select_fields($all_field_labels, $fields, $strict = TRUE) { - $field_labels = array(); - foreach ($fields as $field) { - if (array_key_exists($field, $all_field_labels)) { - $field_labels[$field] = $all_field_labels[$field]; - } - else { - // Allow the user to select fields via their human-readable names. - // This is less convenient than the field name (since the human-readable - // names may contain spaces, and must therefore be quoted), but these are - // the values that the user sees in the command output. n.b. the help - // text lists fields by their more convenient machine names. - $key = array_search(strtolower($field), array_map('strtolower', $all_field_labels)); - if ($key !== FALSE) { - $field_labels[$key] = $all_field_labels[$key]; - } - elseif (!$strict) { - $field_labels[$field] = $field; - } - } - } - return $field_labels; -} - -/** - * Select the fields from the input array that should be output. - * - * @param $input - * An associative array of key:value pairs to be output - * @param $fields - * An associative array that maps FROM a field in $input - * TO the corresponding field name in $output. - * @param $mapping - * An associative array that maps FROM a field in $fields - * TO the actual field in $input to use in the preceeding - * translation described above. - * @return - * The input array, re-ordered and re-keyed per $fields - */ -function drush_select_output_fields($input, $fields, $mapping = array(), $default_value = NULL) { - $result = array(); - if (empty($fields)) { - $result = $input; - } - else { - foreach ($fields as $key => $label) { - $value = drush_lookup_field_by_path($input, $key, $mapping, $default_value); - if (isset($value)) { - $result[$label] = $value; - } - } - } - return $result; -} - -/** - * Return a specific item inside an array, as identified - * by the provided path. - * - * @param $input: - * An array of items, potentially multiple layers deep. - * @param $path: - * A specifier of array keys, either in an array or separated by - * a '/', that list the elements of the array to access. This - * works much like a very simple version of xpath for arrays, with - * all items being treated identically (like elements). - * @param $mapping: - * (optional) An array whose keys may correspond to the $path parameter and - * whose values are the corresponding paths to be used in $input. - * - * Example 1: - * - * $input = array('#name' => 'site.dev', '#id' => '222'); - * $path = '#name'; - * result: 'site.dev'; - * - * Example 2: - * - * $input = array('ca' => array('sf' => array('mission'=>array('1700'=>'woodward')))); - * $path = 'ca/sf/mission/1701'; - * result: 'woodward' - * - * Example 3: - * - * $input = array('#name' => 'site.dev', '#id' => '222'); - * $path = 'name'; - * $mapping = array('name' => '#name'); - * result: 'site.dev'; - */ -function drush_lookup_field_by_path($input, $path, $mapping = array(), $default_value = NULL) { - $result = ''; - if (isset($mapping[$path])) { - $path = $mapping[$path]; - } - if (!is_array($path)) { - $parts = explode('/', $path); - } - if (!empty($parts)) { - $result = $input; - foreach ($parts as $key) { - if ((is_array($result)) && (isset($result[$key]))) { - $result = $result[$key]; - } - else { - return $default_value; - } - } - } - return $result; -} - -/** - * Given a table array (an associative array of associative arrays), - * return an array of all of the values with the specified field name. - */ -function drush_output_get_selected_field($input, $field_name, $default_value = '') { - $result = array(); - foreach ($input as $key => $data) { - if (is_array($data) && isset($data[$field_name])) { - $result[] = $data[$field_name]; - } - else { - $result[] = $default_value; - } - } - return $result; -} - -/** - * Hide any fields that are empty - */ -function drush_hide_empty_fields($input, $fields) { - $has_data = array(); - foreach ($input as $key => $data) { - foreach ($fields as $field => $label) { - if (isset($data[$field]) && !empty($data[$field])) { - $has_data[$field] = TRUE; - } - } - } - foreach ($fields as $field => $label) { - if (!isset($has_data[$field])) { - unset($fields[$field]); - } - } - return $fields; -} - -/** - * Convert an array of data rows, where each row contains an - * associative array of key : value pairs, into - * a table suitable for processing by drush_print_table. - * The provided $header determines the order that the items - * will appear in the output. Only data items listed in the - * header will be placed in the output. - * - * @param $rows_of_keyvalue_table - * array( - * 'row1' => array('col1' => 'data', 'col2' => 'data'), - * 'row2' => array('col1' => 'data', 'col2' => 'data'), - * ) - * @param $header - * array('col1' => 'Column 1 Label', 'col2' => 'Column 2 Label') - * @param $metadata - * (optional) An array of special options, all optional: - * - strip-tags: call the strip_tags function on the data - * before placing it in the table - * - concatenate-columns: an array of: - * - dest-col: array('src-col1', 'src-col2') - * Appends all of the src columns with whatever is - * in the destination column. Appended columns are - * separated by newlines. - * - transform-columns: an array of: - * - dest-col: array('from' => 'to'), - * Transforms any occurance of 'from' in 'dest-col' to 'to'. - * - format-cell: Drush output format name to use to format - * any cell that is an array. - * - process-cell: php function name to use to process - * any cell that is an array. - * - field-mappings: an array whose keys are some or all of the keys in - * $header and whose values are the corresponding keys to use when - * indexing the values of $rows_of_keyvalue_table. - * @return - * An array of arrays - */ -function drush_rows_of_key_value_to_array_table($rows_of_keyvalue_table, $header, $metadata) { - if (isset($metadata['hide-empty-fields'])) { - $header = drush_hide_empty_fields($rows_of_keyvalue_table, $header); - } - if (empty($header)) { - $first = (array)reset($rows_of_keyvalue_table); - $keys = array_keys($first); - $header = array_combine($keys, $keys); - } - $table = array(array_values($header)); - if (isset($rows_of_keyvalue_table) && is_array($rows_of_keyvalue_table) && !empty($rows_of_keyvalue_table)) { - foreach ($rows_of_keyvalue_table as $row_index => $row_data) { - $row_data = (array)$row_data; - $row = array(); - foreach ($header as $column_key => $column_label) { - $data = drush_lookup_field_by_path($row_data, $column_key, $metadata['field-mappings']); - if (array_key_exists('transform-columns', $metadata)) { - foreach ($metadata['transform-columns'] as $dest_col => $transformations) { - if ($dest_col == $column_key) { - $data = str_replace(array_keys($transformations), array_values($transformations), $data); - } - } - } - if (array_key_exists('concatenate-columns', $metadata)) { - foreach ($metadata['concatenate-columns'] as $dest_col => $src_cols) { - if ($dest_col == $column_key) { - $data = ''; - if (!is_array($src_cols)) { - $src_cols = array($src_cols); - } - foreach($src_cols as $src) { - if (array_key_exists($src, $row_data) && !empty($row_data[$src])) { - if (!empty($data)) { - $data .= "\n"; - } - $data .= $row_data[$src]; - } - } - } - } - } - if (array_key_exists('format-cell', $metadata) && is_array($data)) { - $data = drush_format($data, array(), $metadata['format-cell']); - } - if (array_key_exists('process-cell', $metadata) && is_array($data)) { - $data = $metadata['process-cell']($data, $metadata); - } - if (array_key_exists('strip-tags', $metadata)) { - $data = strip_tags($data); - } - $row[] = $data; - } - $table[] = $row; - } - } - return $table; -} - -/** - * Determine the best fit for column widths. - * - * @param $rows - * The rows to use for calculations. - * @param $widths - * Manually specified widths of each column (in characters) - these will be - * left as is. - */ -function drush_table_column_autowidth($rows, $widths) { - $auto_widths = $widths; - - // First we determine the distribution of row lengths in each column. - // This is an array of descending character length keys (i.e. starting at - // the rightmost character column), with the value indicating the number - // of rows where that character column is present. - $col_dist = array(); - foreach ($rows as $rowkey => $row) { - foreach ($row as $col_id => $cell) { - if (empty($widths[$col_id])) { - $length = strlen($cell); - if ($length == 0) { - $col_dist[$col_id][0] = 0; - } - while ($length > 0) { - if (!isset($col_dist[$col_id][$length])) { - $col_dist[$col_id][$length] = 0; - } - $col_dist[$col_id][$length]++; - $length--; - } - } - } - } - foreach ($col_dist as $col_id => $count) { - // Sort the distribution in decending key order. - krsort($col_dist[$col_id]); - // Initially we set all columns to their "ideal" longest width - // - i.e. the width of their longest column. - $auto_widths[$col_id] = max(array_keys($col_dist[$col_id])); - } - - // We determine what width we have available to use, and what width the - // above "ideal" columns take up. - $available_width = drush_get_context('DRUSH_COLUMNS', 80) - (count($auto_widths) * 2); - $auto_width_current = array_sum($auto_widths); - - // If we need to reduce a column so that we can fit the space we use this - // loop to figure out which column will cause the "least wrapping", - // (relative to the other columns) and reduce the width of that column. - while ($auto_width_current > $available_width) { - $count = 0; - $width = 0; - foreach ($col_dist as $col_id => $counts) { - // If we are just starting out, select the first column. - if ($count == 0 || - // OR: if this column would cause less wrapping than the currently - // selected column, then select it. - (current($counts) < $count) || - // OR: if this column would cause the same amount of wrapping, but is - // longer, then we choose to wrap the longer column (proportionally - // less wrapping, and helps avoid triple line wraps). - (current($counts) == $count && key($counts) > $width)) { - // Select the column number, and record the count and current width - // for later comparisons. - $column = $col_id; - $count = current($counts); - $width = key($counts); - } - } - if ($width <= 1) { - // If we have reached a width of 1 then give up, so wordwrap can still progress. - break; - } - // Reduce the width of the selected column. - $auto_widths[$column]--; - // Reduce our overall table width counter. - $auto_width_current--; - // Remove the corresponding data from the disctribution, so next time - // around we use the data for the row to the left. - unset($col_dist[$column][$width]); - } - return $auto_widths; -} - -/** - * Print the contents of a file. - * - * @param string $file - * Full path to a file. - */ -function drush_print_file($file) { - // Don't even bother to print the file in --no mode - if (drush_get_context('DRUSH_NEGATIVE')) { - return; - } - if ((substr($file,-4) == ".htm") || (substr($file,-5) == ".html")) { - $tmp_file = drush_tempnam(basename($file)); - file_put_contents($tmp_file, drush_html_to_text(file_get_contents($file))); - $file = $tmp_file; - } - // Do not wait for user input in --yes or --pipe modes - if (drush_get_context('DRUSH_PIPE')) { - drush_print_pipe(file_get_contents($file)); - } - elseif (drush_get_context('DRUSH_AFFIRMATIVE')) { - drush_print(file_get_contents($file)); - } - elseif (drush_shell_exec_interactive("less %s", $file)) { - return; - } - elseif (drush_shell_exec_interactive("more %s", $file)) { - return; - } - else { - drush_print(file_get_contents($file)); - } -} - - -/** - * Converts a PHP variable into its Javascript equivalent. - * - * We provide a copy of D7's drupal_json_encode since this function is - * unavailable on earlier versions of Drupal. - * - * @see drupal_json_decode() - * @ingroup php_wrappers - */ -function drush_json_encode($var) { - if (version_compare(phpversion(), '5.4.0', '>=')) { - $json = json_encode($var, JSON_PRETTY_PRINT); - } - else { - $json = json_encode($var); - } - // json_encode() does not escape <, > and &, so we do it with str_replace(). - return str_replace(array('<', '>', '&'), array('\u003c', '\u003e', '\u0026'), $json); -} - -/** - * Converts an HTML-safe JSON string into its PHP equivalent. - * - * We provide a copy of D7's drupal_json_decode since this function is - * unavailable on earlier versions of Drupal. - * - * @see drupal_json_encode() - * @ingroup php_wrappers - */ -function drush_json_decode($var) { - return json_decode($var, TRUE); -} - -/** - * Drupal-friendly var_export(). Taken from utility.inc in Drupal 8. - * - * @param $var - * The variable to export. - * @param $prefix - * A prefix that will be added at the beginning of every lines of the output. - * - * @return - * The variable exported in a way compatible to Drupal's coding standards. - */ -function drush_var_export($var, $prefix = '') { - if (is_array($var)) { - if (empty($var)) { - $output = 'array()'; - } - else { - $output = "array(\n"; - // Don't export keys if the array is non associative. - $export_keys = array_values($var) != $var; - foreach ($var as $key => $value) { - $output .= ' ' . ($export_keys ? drush_var_export($key) . ' => ' : '') . drush_var_export($value, ' ', FALSE) . ",\n"; - } - $output .= ')'; - } - } - elseif (is_bool($var)) { - $output = $var ? 'TRUE' : 'FALSE'; - } - elseif (is_string($var)) { - $line_safe_var = str_replace("\n", '\n', $var); - if (strpos($var, "\n") !== FALSE || strpos($var, "'") !== FALSE) { - // If the string contains a line break or a single quote, use the - // double quote export mode. Encode backslash and double quotes and - // transform some common control characters. - $var = str_replace(array('\\', '"', "\n", "\r", "\t"), array('\\\\', '\"', '\n', '\r', '\t'), $var); - $output = '"' . $var . '"'; - } - else { - $output = "'" . $var . "'"; - } - } - elseif (is_object($var) && get_class($var) === 'stdClass') { - // var_export() will export stdClass objects using an undefined - // magic method __set_state() leaving the export broken. This - // workaround avoids this by casting the object as an array for - // export and casting it back to an object when evaluated. - $output = '(object) ' . drush_var_export((array) $var, $prefix); - } - else { - $output = var_export($var, TRUE); - } - - if ($prefix) { - $output = str_replace("\n", "\n$prefix", $output); - } - - return $output; -} - /** * @} End of "defgroup outputfunctions". */ diff --git a/vendor/drush/drush/includes/preflight.inc b/vendor/drush/drush/includes/preflight.inc index c8e939b686719d2abef1a3b27197385aece9baae..8678f5d0378ae917b4b15c1d381f0ee667516f4d 100644 --- a/vendor/drush/drush/includes/preflight.inc +++ b/vendor/drush/drush/includes/preflight.inc @@ -2,826 +2,20 @@ /** * @file - * Preflight, postflight and shutdown code. + * Postflight and shutdown code. */ use Drush\Drush; -use Drush\Log\LogLevel; +use Drush\Runtime\Runtime; /** * The main Drush function. * - * - Runs "early" option code, if set (see global options). - * - Parses the command line arguments, configuration files and environment. - * - Prepares and executes a Drupal bootstrap, if possible, - * - Dispatches the given command. - * - * function_exists('drush_main') may be used by modules to detect whether - * they are being called from Drush. See http://drupal.org/node/1181308 - * and http://drupal.org/node/827478 - * - * @return mixed - * Whatever the given command returns. + * This function is still called by drush-launcher. It is no longer used by + * Drush itself. */ function drush_main() { - // Load Drush core include files, and parse command line arguments. - if (drush_preflight_prepare() === FALSE) { - return(1); - } - // Start code coverage collection. - if ($coverage_file = drush_get_option('drush-coverage', FALSE)) { - drush_set_context('DRUSH_CODE_COVERAGE', $coverage_file); - xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); - register_shutdown_function('drush_coverage_shutdown'); - } - - // Load the global Drush configuration files, and global Drush commands. - // Find the selected site based on --root, --uri or cwd - // Preflight the selected site, and load any configuration and commandfiles associated with it. - // Select and return the bootstrap class. - $bootstrap = drush_preflight(); - - // Reset our bootstrap phase to the beginning - drush_set_context('DRUSH_BOOTSTRAP_PHASE', DRUSH_BOOTSTRAP_NONE); - - $return = ''; - if (!drush_get_error()) { - if ($file = drush_get_option('early', FALSE)) { - require_once drush_is_absolute_path($file) ? $file : DRUSH_BASE_PATH . DIRECTORY_SEPARATOR . $file; - $function = 'drush_early_' . basename($file, '.inc'); - if (function_exists($function)) { - if ($return = $function()) { - // If the function returns FALSE, we continue and attempt to bootstrap - // as normal. Otherwise, we exit early with the returned output. - if ($return === TRUE) { - $return = ''; - } - } - } - } - else { - // Do any necessary preprocessing operations on the command, - // perhaps handling immediately. - $command_handled = drush_preflight_command_dispatch(); - if (!$command_handled) { - $return = $bootstrap->bootstrap_and_dispatch(); - } - } - } - // TODO: Get rid of global variable access here, and just trust - // the bootstrap object returned from drush_preflight(). This will - // require some adjustments to Drush bootstrapping. - // See: https://github.com/drush-ops/drush/pull/1303 - if ($bootstrap = drush_get_bootstrap_object()) { - $bootstrap->terminate(); - } - drush_postflight(); - if (is_object($return)) { - $return = 0; - } - - // How strict are we? If we are very strict, turn 'ok' into 'error' - // if there are any warnings in the log. - if (($return == 0) && (drush_get_option('strict') > 1) && drush_log_has_errors()) { - $return = 1; - } - - // After this point the drush_shutdown function will run, - // exiting with the correct exit code. - return $return; -} - -/** - * Prepare Drush for preflight. - * - * Runs before drush_main(). - * - * @see drush_main() - * @see drush.php - */ -function drush_preflight_prepare() { - define('DRUSH_BASE_PATH', dirname(dirname(__FILE__))); - // Local means that autoload.php is inside of Drush. That is, Drush is its own Composer project. - // Global means autoload.php is outside of Drush. That is, Drush is a dependency of a bigger project. - $local_vendor_path = DRUSH_BASE_PATH . '/vendor/autoload.php'; - $global_vendor_path = DRUSH_BASE_PATH . '/../../../vendor/autoload.php'; - - // Check for a local composer install or a global composer install. Vendor dirs are in different spots). - if (file_exists($local_vendor_path)) { - $vendor_path = $local_vendor_path; - } - elseif (file_exists($global_vendor_path)) { - $vendor_path = $global_vendor_path; - } - else { - $msg = "Unable to load autoload.php. Run composer install to fetch dependencies and write this file (http://docs.drush.org/en/master/install-alternative/). Or if you prefer, use the drush.phar which already has dependencies included (http://docs.drush.org/en/master/install).\n"; - fwrite(STDERR, $msg); - return FALSE; - } - - $classloader = require $vendor_path; - - require_once DRUSH_BASE_PATH . '/includes/startup.inc'; - require_once DRUSH_BASE_PATH . '/includes/bootstrap.inc'; - require_once DRUSH_BASE_PATH . '/includes/environment.inc'; - require_once DRUSH_BASE_PATH . '/includes/annotationcommand_adapter.inc'; - require_once DRUSH_BASE_PATH . '/includes/command.inc'; - require_once DRUSH_BASE_PATH . '/includes/drush.inc'; - require_once DRUSH_BASE_PATH . '/includes/engines.inc'; - require_once DRUSH_BASE_PATH . '/includes/backend.inc'; - require_once DRUSH_BASE_PATH . '/includes/batch.inc'; - require_once DRUSH_BASE_PATH . '/includes/context.inc'; - require_once DRUSH_BASE_PATH . '/includes/sitealias.inc'; - require_once DRUSH_BASE_PATH . '/includes/exec.inc'; - require_once DRUSH_BASE_PATH . '/includes/drupal.inc'; - require_once DRUSH_BASE_PATH . '/includes/output.inc'; - require_once DRUSH_BASE_PATH . '/includes/cache.inc'; - require_once DRUSH_BASE_PATH . '/includes/filesystem.inc'; - require_once DRUSH_BASE_PATH . '/includes/dbtng.inc'; - require_once DRUSH_BASE_PATH . '/includes/array_column.inc'; - - // Stash our vendor path and classloader. - drush_set_context('DRUSH_VENDOR_PATH', dirname($vendor_path)); - drush_set_context('DRUSH_CLASSLOADER', $classloader); - - // Make a read-only copy of the vendor path at drush.vendor-dir - // for forwards-compatibility - drush_set_option('drush.vendor-dir', dirname($vendor_path)); - - // Can't log until we have a logger, so we'll create this ASAP. - _drush_create_default_logger(); - - // Terminate immediately unless invoked as a command line script - if (!drush_verify_cli()) { - return drush_set_error('DRUSH_REQUIREMENTS_ERROR', dt('Drush is designed to run via the command line.')); - } - - // Check supported version of PHP. - // Note: If this is adjusted, check other code that compares - // PHP_VERSION, such as drush_json_encode(), runserver/runserver.drush.inc, and also - // adjust _drush_environment_check_php_ini() and the php_prohibited_options - // list in the drush script. See http://drupal.org/node/1748228 - define('DRUSH_MINIMUM_PHP', '5.4.5'); - if (version_compare(phpversion(), DRUSH_MINIMUM_PHP) < 0 && !getenv('DRUSH_NO_MIN_PHP')) { - return drush_set_error('DRUSH_REQUIREMENTS_ERROR', dt('Your command line PHP installation is too old. Drush requires at least PHP !version. To suppress this check, set the environment variable DRUSH_NO_MIN_PHP=1', array('!version' => DRUSH_MINIMUM_PHP))); - } - - if (!$return = _drush_environment_check_php_ini()) { - return; // An error was logged. - } - - // For backwards compatibility. Prefer the static accessors. - define('DRUSH_VERSION', Drush::getVersion()); - define('DRUSH_MAJOR_VERSION', Drush::getMajorVersion()); - define('DRUSH_MINOR_VERSION', Drush::getMinorVersion()); - - define('DRUSH_REQUEST_TIME', microtime(TRUE)); - - drush_set_context('argc', $GLOBALS['argc']); - drush_set_context('argv', $GLOBALS['argv']); - - // Make a read-only copy of the arguments at runtime.argv - // for forwards-compatibility - drush_set_option('runtime.argv', $GLOBALS['argv']); - - // Set an error handler and a shutdown function - set_error_handler('drush_error_handler'); - register_shutdown_function('drush_shutdown'); - // We need some global options/arguments processed at this early stage. - drush_parse_args(); - - // Process initial global options such as --debug. - _drush_preflight_global_options(); - - drush_log(dt("Drush preflight prepare loaded autoloader at !autoloader", array('!autoloader' => realpath($vendor_path))), LogLevel::PREFLIGHT); -} - -/** - * During the initialization of Drush, this is the first - * step where we load our configuration and commandfiles, - * and select the site we are going to operate on; however, - * we take no irreversible actions (e.g. site bootstrapping). - * This allows commands that are declared with no bootstrap - * to select a new site root and bootstrap it. - * - * In this step we will register the shutdown function, - * parse the command line arguments and store them in their - * related contexts. - * - * Configuration files (drushrc.php) that are - * a) Specified on the command line - * b) Stored in the root directory of drush.php - * c) Stored in the home directory of the system user. - * - * Additionally the DRUSH_QUIET and DRUSH_BACKEND contexts, - * will be evaluated now, as they need to be set very early in - * the execution flow to be able to take affect. - * - * @return \Drush\Boot\Boot; - */ -function drush_preflight() { - // Create an alias '@none' to represent no Drupal site - _drush_sitealias_cache_alias('@none', array('root' => '', 'uri' => '')); - - // Discover terminal width for pretty output. - _drush_preflight_columns(); - - // Display is tidy now that column width has been handled. - drush_log(dt('Starting Drush preflight.'), LogLevel::PREFLIGHT); - - // Statically define a way to call drush again. - define('DRUSH_COMMAND', drush_find_drush()); - - // prime the CWD cache - drush_cwd(); - - // Set up base environment for system-wide file locations. - _drush_preflight_base_environment(); - - // Setup global alias_paths[] in context system. - if (!drush_get_option('local')) { - _drush_preflight_alias_path(); - } - if (!drush_get_option('local')) { - // Load a drushrc.php file in the drush.php's directory. - drush_load_config('drush'); - - // Load a drushrc.php file in the $ETC_PREFIX/etc/drush directory. - drush_load_config('system'); - - // Load a drushrc.php file at ~/.drushrc.php. - drush_load_config('user'); - - // Load a drushrc.php file in the ~/.drush directory. - drush_load_config('home.drush'); - } - - // Load a custom config specified with the --config option. - drush_load_config('custom'); - - _drush_preflight_global_options(); - // Load all the commandfiles findable from any of the - // scopes listed above. - _drush_find_commandfiles_drush(); - - // Look up the alias identifier that the user wants to use, - // either via an argument or via 'site-set'. - $target_alias = drush_sitealias_check_arg_and_site_set(); - - // Process the site alias that specifies which instance - // of Drush (local or remote) this command will operate on. - // We must do this after we load our config files (so that - // site aliases are available), but before the rest of - // Drush preflight and Drupal root bootstrap phase are - // done, since site aliases may set option values that - // affect these phases. - $alias_record = _drush_sitealias_set_context_by_name($target_alias); - - // Find the selected site based on --root, --uri or cwd - drush_preflight_root(); - - // Preflight the selected site, and load any configuration and commandfiles associated with it. - drush_preflight_site(); - - // Check to see if anything changed during the 'site' preflight - // that might allow us to find our alias record now - if (empty($alias_record)) { - $alias_record = _drush_sitealias_set_context_by_name($target_alias); - - // If the site alias settings changed late in the preflight, - // then run the preflight for the root and site contexts again. - if (!empty($alias_record)) { - $remote_host = drush_get_option('remote-host'); - if (!isset($remote_host)) { - drush_preflight_root(); - drush_preflight_site(); - } - } - } - - // Fail if we could not find the selected site alias. - if ($target_alias && empty($alias_record)) { - // We will automatically un-set the site-set alias if it could not be found. - // Otherwise, we'd be stuck -- the user would only be able to execute Drush - // commands again after `drush @none site-set @none`, and most folks would - // have a hard time figuring that out. - $site_env = drush_sitealias_site_get(); - if ($site_env == $target_alias) { - drush_sitealias_site_clear(); - } - return drush_set_error('DRUSH_BOOTSTRAP_NO_ALIAS', dt("Could not find the alias !alias", array('!alias' => $target_alias))); - } - - // If applicable swaps in shell alias values. - drush_shell_alias_replace($target_alias); - - // Copy global options to their respective contexts - _drush_preflight_global_options(); - - // Set environment variables based on #env-vars. - drush_set_environment_vars($alias_record); - - // Select the bootstrap object and return it. - return drush_select_bootstrap_class(); -} - -/** - * If --root is provided, set context. - */ -function drush_preflight_root() { - $root = drush_get_option('root'); - if (!isset($root)) { - $root = drush_locate_root(); - } - // If the old ways do not find a Drupal root, use DrupalFinder. - if (!$root) { - $finder = new \DrupalFinder\DrupalFinder(); - if ($finder->locateRoot(getcwd())) { - $root = $finder->getDrupalRoot(); - } - } - if ($root) { - $root = realpath($root); - } - // @todo This context name should not mention Drupal. - // @todo Drupal code should use DRUSH_DRUPAL_ROOT instead of this constant. - drush_set_context('DRUSH_SELECTED_DRUPAL_ROOT', $root); - - // Load the config options from Drupal's /drush, ../drush, and sites/all/drush directories, - // even prior to bootstrapping the root. - drush_load_config('drupal'); - - // Search for commandfiles in the root locations - $discovery = annotationcommand_adapter_get_discovery(); - $searchpath = [dirname($root) . '/drush', "$root/drush", "$root/sites/all/drush"]; - - $drush_root_extensions = $discovery->discover($searchpath, '\Drush'); - drush_set_context( - 'DRUSH_ANNOTATED_COMMANDFILES', - array_merge( - drush_get_context('DRUSH_ANNOTATED_COMMANDFILES'), - $drush_root_extensions - ) - ); -} - -function drush_preflight_site() { - // Load the Drupal site configuration options upfront. - drush_load_config('site'); - - // Determine URI and set constants/contexts accordingly. Keep this after loading of drupal,site configs. - _drush_preflight_uri(); - - // If someone set 'uri' in the 'site' context, then copy it - // to the 'process' context (to give it a higher priority - // than the 'cli' and 'alias' contexts) and reset our selected - // site and @self alias. - $uri = drush_get_option('uri'); - if ($uri != drush_get_option('uri', $uri, 'site')) { - drush_set_option('uri', drush_get_option('uri', $uri, 'site')); - _drush_preflight_uri(); - } - - // Create a @self site alias record. - drush_sitealias_create_self_alias(); -} - -function _drush_preflight_global_options() { - // Debug implies verbose - $verbose = drush_get_option('verbose', FALSE); - $debug = drush_get_option('debug', FALSE); - drush_set_context('DRUSH_VERBOSE', $verbose || $debug); - drush_set_context('DRUSH_DEBUG', $debug); - drush_set_context('DRUSH_DEBUG_NOTIFY', $verbose && $debug); - drush_set_context('DRUSH_SIMULATE', drush_get_option('simulate', FALSE)); - - // Backend implies affirmative unless negative is explicitly specified - drush_set_context('DRUSH_NEGATIVE', drush_get_option('no', FALSE)); - drush_set_context('DRUSH_AFFIRMATIVE', drush_get_option(array('yes', 'pipe', 'no-interaction'), FALSE) || (drush_get_context('DRUSH_BACKEND') && !drush_get_context('DRUSH_NEGATIVE'))); - - // Pipe implies quiet. - drush_set_context('DRUSH_QUIET', drush_get_option(array('quiet', 'pipe'))); - drush_set_context('DRUSH_PIPE', drush_get_option('pipe')); - - // Suppress colored logging if --nocolor option is explicitly given or if - // terminal does not support it. - $nocolor = (drush_get_option('nocolor', FALSE)); - if (!$nocolor) { - // Check for colorless terminal. If there is no terminal, then - // 'tput colors 2>&1' will return "tput: No value for $TERM and no -T specified", - // which is not numeric and therefore will put us in no-color mode. - $colors = exec('tput colors 2>&1'); - $nocolor = !($colors === FALSE || (is_numeric($colors) && $colors >= 3)); - } - drush_set_context('DRUSH_NOCOLOR', $nocolor); -} - -/** - * Sets up basic environment that controls where Drush looks for files on a - * system-wide basis. Important to call for "early" functions that need to - * work with unit tests. - */ -function _drush_preflight_base_environment() { - // Copy ETC_PREFIX and SHARE_PREFIX from environment variables if available. - // This alters where we check for server-wide config and alias files. - // Used by unit test suite to provide a clean environment. - if (getenv('ETC_PREFIX')) drush_set_context('ETC_PREFIX', getenv('ETC_PREFIX')); - if (getenv('SHARE_PREFIX')) drush_set_context('SHARE_PREFIX', getenv('SHARE_PREFIX')); - - drush_set_context('DOC_PREFIX', DRUSH_BASE_PATH); - if (!file_exists(DRUSH_BASE_PATH . '/README.md') && file_exists(drush_get_context('SHARE_PREFIX', '/usr') . '/share/doc/drush' . '/README.md')) { - drush_set_context('DOC_PREFIX', drush_get_context('SHARE_PREFIX', '/usr') . '/share/doc/drush'); - } - - $default_prefix_configuration = drush_is_windows() ? getenv('ALLUSERSPROFILE') . '/Drush' : ''; - $default_prefix_commandfile = drush_is_windows() ? getenv('ALLUSERSPROFILE') . '/Drush' : '/usr'; - $site_wide_configuration_dir = drush_get_context('ETC_PREFIX', $default_prefix_configuration) . '/etc/drush'; - $site_wide_commandfile_dir = drush_get_context('SHARE_PREFIX', $default_prefix_commandfile) . '/share/drush/commands'; - drush_set_context('DRUSH_SITE_WIDE_CONFIGURATION', $site_wide_configuration_dir); - drush_set_context('DRUSH_SITE_WIDE_COMMANDFILES', $site_wide_commandfile_dir); - - $server_home = drush_server_home(); - if (isset($server_home)) { - drush_set_context('DRUSH_PER_USER_CONFIGURATION', $server_home . '/.drush'); - } -} - -/* - * Set the terminal width, used for wrapping table output. - * Normally this is exported using tput in the drush script. - * If this is not present we do an additional check using stty here. - * On Windows in CMD and PowerShell is this exported using mode con. - */ -function _drush_preflight_columns() { - if (!($columns = getenv('COLUMNS') ?: 0)) { - // Trying to export the columns using stty. - exec('stty size 2>&1', $columns_output, $columns_status); - $matched = FALSE; - if (!$columns_status && $matched = preg_match('/^\d+\s(\d+)$/', $columns_output[0], $matches, 0)) { - $columns = $matches[1]; - } - // If stty fails and Drush us running on Windows are we trying with mode con. - if (($columns_status || !$matched) && drush_is_windows()) { - $columns_output = array(); - exec('mode con', $columns_output, $columns_status); - if (!$columns_status && is_array($columns_output)) { - $columns = (int)preg_replace('/\D/', '', $columns_output[4], -1, $columns_count); - } - else { - drush_log(dt('Drush could not detect the console window width. Set a Windows Environment Variable of COLUMNS to the desired width.'), LogLevel::WARNING); - } - } - - // Failling back to default columns value - if (empty($columns)) { - $columns = 80; - } - } - // If a caller wants to reserve some room to add additional - // information to the drush output via post-processing, the - // --reserve-margin flag can be used to declare how much - // space to leave out. This only affects drush functions - // such as drush_print_table() that wrap the output. - $columns -= drush_get_option('reserve-margin', 0); - drush_set_context('DRUSH_COLUMNS', $columns); -} - -function _drush_preflight_alias_path() { - $alias_path =& drush_get_context('ALIAS_PATH'); - $default_prefix_configuration = drush_is_windows() ? getenv('ALLUSERSPROFILE') . '/Drush' : ''; - $site_wide_configuration_dir = drush_get_context('ETC_PREFIX', $default_prefix_configuration) . '/etc/drush'; - $alias_path[] = drush_sitealias_alias_base_directory($site_wide_configuration_dir); - - $alias_path[] = drush_sitealias_alias_base_directory(dirname(__FILE__) . '/..'); - - $server_home = drush_server_home(); - if (isset($server_home)) { - $alias_path[] = drush_sitealias_alias_base_directory($server_home . '/.drush'); - } -} - -/* - * Set root and uri. - */ -function _drush_preflight_root_uri() { - drush_preflight_root(); - _drush_preflight_uri(); -} - -/** - * If --uri is provided, set context. - */ -function _drush_preflight_uri() { - $uri = drush_get_option('uri', ''); - drush_set_context('DRUSH_SELECTED_URI', $uri); -} - -function _drush_find_commandfiles_drush() { - // Core commands shipping with Drush - $searchpath[] = dirname(__FILE__) . '/../commands/'; - - // User commands, specified by 'include' option - $include = drush_get_context('DRUSH_INCLUDE', array()); - foreach ($include as $path) { - if (is_dir($path)) { - drush_log('Include ' . $path, LogLevel::NOTICE); - $searchpath[] = $path; - } - } - - if (!drush_get_option('local')) { - // System commands, residing in $SHARE_PREFIX/share/drush/commands - $share_path = drush_get_context('DRUSH_SITE_WIDE_COMMANDFILES'); - if (is_dir($share_path)) { - $searchpath[] = $share_path; - } - - // User commands, residing in ~/.drush - $per_user_config_dir = drush_get_context('DRUSH_PER_USER_CONFIGURATION'); - if (!empty($per_user_config_dir)) { - $searchpath[] = $per_user_config_dir; - } - } - - // @todo the zero parameter is a bit weird here. It's $phase. - _drush_add_commandfiles($searchpath, 0); - - // Also discover Drush's own annotation commands. - $discovery = annotationcommand_adapter_get_discovery(); - $annotation_commandfiles = $discovery->discover(DRUSH_BASE_PATH . '/lib/Drush', '\Drush'); - - // And, finally, search for commandfiles in the $searchpath - $searchpath = array_map( - function ($item) { - if (strtolower(basename($item)) == 'commands') { - return dirname($item); - } - return $item; - }, - $searchpath - ); - $global_drush_extensions = $discovery->discover($searchpath, '\Drush'); - $annotation_commandfiles += $global_drush_extensions; - - drush_set_context('DRUSH_ANNOTATED_COMMANDFILES', $annotation_commandfiles); -} - -/** - * Handle any command preprocessing that may need to be done, including - * potentially redispatching the command immediately (e.g. for remote - * commands). - * - * @return - * TRUE if the command was handled remotely. - */ -function drush_preflight_command_dispatch() { - $interactive = drush_get_option('interactive', FALSE); - - // The command will be executed remotely if the --remote-host flag - // is set; note that if a site alias is provided on the command line, - // and the site alias references a remote server, then the --remote-host - // option will be set when the site alias is processed. - // @see drush_sitealias_check_arg_and_site_set and _drush_sitealias_set_context_by_name - $remote_host = drush_get_option('remote-host'); - $site_list = drush_get_option('site-list'); - // Get the command early so that we can allow commands to directly handle remote aliases if they wish - $command = drush_parse_command(); - drush_command_default_options($command); - - // If the command sets the 'strict-option-handling' flag, then we will remove - // any cli options that appear after the command name from the 'cli' context. - // The cli options that appear before the command name are stored in the - // 'DRUSH_GLOBAL_CLI_OPTIONS' context, so we will just overwrite the cli context - // with this, after doing the neccessary fixup from short-form to long-form options. - // After we do that, we put back any local drush options identified by $command['options']. - if (is_array($command) && !empty($command['strict-option-handling'])) { - $cli_options = drush_get_context('DRUSH_GLOBAL_CLI_OPTIONS', array()); - // Now we are going to sort out any options that exist in $command['options']; - // we will remove these from DRUSH_COMMAND_ARGS and put them back into the - // cli options. - $cli_context = drush_get_context('cli'); - $remove_from_command_args = array(); - foreach ($command['options'] as $option => $info) { - if (array_key_exists($option, $cli_context)) { - $cli_options[$option] = $cli_context[$option]; - $remove_from_command_args[$option] = $option; - } - } - if (!empty($remove_from_command_args)) { - $drush_command_args = array(); - foreach (drush_get_context('DRUSH_COMMAND_ARGS') as $arg) { - if (!_drush_should_remove_command_arg($arg, $remove_from_command_args)) { - $drush_command_args[] = $arg; - } - } - drush_set_context('DRUSH_COMMAND_ARGS', $drush_command_args); - } - drush_expand_short_form_options($cli_options); - drush_set_context('cli', $cli_options); - _drush_preflight_global_options(); - } - $args = drush_get_arguments(); - $command_name = array_shift($args); - $root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - $local_drush = drush_get_option('drush-script'); - if (empty($local_drush) && !empty($root)) { - $local_drush = find_wrapper_or_launcher($root); - } - $is_local = drush_get_option('local'); - $must_use_site_local = !empty($root) && !empty($local_drush) && !empty($is_local); - // If the command sets the 'handle-remote-commands' flag, then we will short-circuit - // remote command dispatching and site-list command dispatching, and always let - // the command handler run on the local machine. - if (is_array($command) && !empty($command['handle-remote-commands']) && !$must_use_site_local) { - return FALSE; - } - $values = NULL; - if (!isset($remote_host) && !isset($site_list) && $must_use_site_local) { - if (!drush_is_absolute_path($local_drush)) { - $local_drush = $root . DIRECTORY_SEPARATOR . $local_drush; - } - $local_drush = realpath($local_drush); - $this_drush = drush_find_drush(); - // If there is a local Drush selected, and it is not the - // same Drush that is currently running, redispatch to it. - // We assume that if the current Drush is nested inside - // the current Drupal root (or, more specifically, the - // current Drupal root's parent), then it is a site-local Drush. - // We avoid redispatching in that instance to prevent an - // infinite loop. - if (file_exists($local_drush) && !drush_is_nested_directory(dirname($root), $this_drush)) { - $uri = drush_get_context('DRUSH_SELECTED_URI'); - $aditional_options = array( - 'root' => $root, - ); - if (!empty($uri)) { - $aditional_options['uri'] = $uri; - } - // We need to chdir to the Drupal root here, for the - // benefit of the Drush wrapper. - chdir($root); - $values = drush_do_command_redispatch(is_array($command) ? $command : $command_name, $args, NULL, NULL, $local_drush, TRUE, $aditional_options); - } - } - if (isset($remote_host)) { - $remote_user = drush_get_option('remote-user'); - - // Force interactive mode if there is a single remote target. #interactive is added by drush_do_command_redispatch - $user_interactive = drush_get_option('interactive'); - drush_set_option('interactive', TRUE); - $values = drush_do_command_redispatch(is_array($command) ? $command : $command_name, $args, $remote_host, $remote_user, $user_interactive); - } - // If the --site-list flag is set, then we will execute the specified - // command once for every site listed in the site list. - if (isset($site_list)) { - if (!is_array($site_list)) { - $site_list = explode(',', $site_list); - } - $site_record = array('site-list' => $site_list); - $args = drush_get_arguments(); - - if (!drush_get_context('DRUSH_SIMULATE') && !$interactive && !drush_get_context('DRUSH_AFFIRMATIVE') && !drush_get_context('DRUSH_QUIET')) { - drush_print(dt("You are about to execute '!command' non-interactively (--yes forced) on all of the following targets:", array('!command' => implode(" ", $args)))); - foreach ($site_list as $one_destination) { - drush_print(dt(' !target', array('!target' => $one_destination))); - } - - if (drush_confirm('Continue? ') === FALSE) { - drush_user_abort(); - return TRUE; - } - } - $command_name = array_shift($args); - $multi_options = drush_redispatch_get_options(); - $backend_options = array(); - if (drush_get_option('pipe') || drush_get_option('interactive')) { - $backend_options['interactive'] = TRUE; - } - if (drush_get_option('no-label', FALSE)) { - $backend_options['no-label'] = TRUE; - } - // If the user specified a format, try to look up the - // default list separator for the specified format. - // If the user did not specify a different label separator, - // then pass in the default as an option, so that the - // separator between the items in the list and the site - // name will be consistent. - $format = drush_get_option('format', FALSE); - if ($format && !array_key_exists('label-separator', $multi_options)) { - $formatter = drush_load_engine('outputformat', $format); - if ($formatter) { - $list_separator = $formatter->get_info('list-separator'); - if ($list_separator) { - $multi_options['label-separator'] = $list_separator; - } - } - } - $values = drush_invoke_process($site_record, $command_name, $args, $multi_options, $backend_options); - } - if (isset($values)) { - if (is_array($values) && ($values['error_status'] > 0)) { - // Force an error result code. Note that drush_shutdown() will still run. - drush_set_context('DRUSH_EXECUTION_COMPLETED', TRUE); - exit($values['error_status']); - } - return TRUE; - } - return FALSE; -} - -/** - * Look for instances of arguments or parameters that - * start with "~/". Replace these with "$HOME/". - * - * Note that this function is called _after_ Drush does - * its redispatch checks; tildes are passed through - * unmodified on a redispatch, and are only expanded when - * a command is handled locally. - */ -function drush_preflight_tilde_expansion(&$command) { - // Skip tilde expansion for commands that use - // stict option handling, or those that explicitly - // turn it off via $command['tilde-expansion'] = FALSE. - if ($command['tilde-expansion'] && !$command['strict-option-handling']) { - $cli =& drush_get_context('cli'); - $match = '#^~/#'; - $replacement = drush_server_home() . '/'; - foreach ($cli as $key => $value) { - if (is_string($value) && preg_match($match, $value)) { - $cli[$key] = preg_replace($match, $replacement, $value); - } - } - $command['arguments'] = array_map(function($value) use($match, $replacement) { return is_string($value) ? preg_replace($match, $replacement, $value) : $value; } , $command['arguments']); - } -} - -/** - * We set this context to let the shutdown function know we reached the end of drush_main(). - * - * @see drush_main() - */ -function drush_postflight() { - drush_set_context("DRUSH_EXECUTION_COMPLETED", TRUE); -} - -/** - * Shutdown function for use while Drush and Drupal are bootstrapping and to return any - * registered errors. - * - * The shutdown command checks whether certain options are set to reliably - * detect and log some common Drupal initialization errors. - * - * If the command is being executed with the --backend option, the script - * will return a json string containing the options and log information - * used by the script. - * - * The command will exit with '1' if it was successfully executed, and the - * result of drush_get_error() if it wasn't. - */ -function drush_shutdown() { - // Mysteriously make $user available during sess_write(). Avoids a NOTICE. - global $user; - - if (!drush_get_context('DRUSH_EXECUTION_COMPLETED', FALSE) && !drush_get_context('DRUSH_USER_ABORT', FALSE)) { - $php_error_message = ''; - if ($error = error_get_last()) { - $php_error_message = "\n" . dt('Error: !message in !file, line !line', array('!message' => $error['message'], '!file' => $error['file'], '!line' => $error['line'])); - } - // We did not reach the end of the drush_main function, - // this generally means somewhere in the code a call to exit(), - // was made. We catch this, so that we can trigger an error in - // those cases. - drush_set_error("DRUSH_NOT_COMPLETED", dt("Drush command terminated abnormally due to an unrecoverable error.!message", array('!message' => $php_error_message))); - // Attempt to give the user some advice about how to fix the problem - _drush_postmortem(); - } - - // @todo Ask the bootstrap object (or maybe dispatch) how far we got. - $phase = drush_get_context('DRUSH_BOOTSTRAP_PHASE'); - if (drush_get_context('DRUSH_BOOTSTRAPPING')) { - switch ($phase) { - case DRUSH_BOOTSTRAP_DRUPAL_FULL : - ob_end_clean(); - _drush_log_drupal_messages(); - drush_set_error('DRUSH_DRUPAL_BOOTSTRAP_ERROR'); - break; - } - } - - if (drush_get_context('DRUSH_BACKEND', FALSE)) { - drush_backend_output(); - } - elseif (drush_get_context('DRUSH_QUIET', FALSE)) { - ob_end_clean(); - // If we are in pipe mode, emit the compact representation of the command, if available. - if (drush_get_context('DRUSH_PIPE')) { - drush_pipe_output(); - } - } - - // This way drush_return_status() will always be the last shutdown function (unless other shutdown functions register shutdown functions...) - // and won't prevent other registered shutdown functions (IE from numerous cron methods) from running by calling exit() before they get a chance. - register_shutdown_function('drush_return_status'); + require dirname(__DIR__) . '/drush.php'; } /** @@ -859,13 +53,3 @@ function drush_coverage_shutdown() { file_put_contents($file_name, serialize($data)); } } - -function drush_return_status() { - // If a specific exit code was set, then use it. - $exit_code = drush_get_context('DRUSH_EXIT_CODE'); - if (empty($exit_code)) { - $exit_code = (drush_get_error()) ? DRUSH_FRAMEWORK_ERROR : DRUSH_SUCCESS; - } - - exit($exit_code); -} diff --git a/vendor/drush/drush/includes/site_install.inc b/vendor/drush/drush/includes/site_install.inc new file mode 100644 index 0000000000000000000000000000000000000000..4e15f4cf5f86d0d60d73eae1472c7254c866fca1 --- /dev/null +++ b/vendor/drush/drush/includes/site_install.inc @@ -0,0 +1,16 @@ +<?php + +/** + * A sneaky implementation of hook_module_implements_alter(). + * + * site:install includes this file in order to not run any cron hooks during install. + * That's a bad idea. + * + * @param $implementations + * @param $hook + */ +function system_module_implements_alter(&$implementations, $hook) { + if ($hook == 'cron') { + $implementations = []; + } +} diff --git a/vendor/drush/drush/includes/sitealias.inc b/vendor/drush/drush/includes/sitealias.inc index be109498ca48878263e9379f5d20f6c94c3fc815..f795d31123d994229329caa41526a4d9e5bffa17 100644 --- a/vendor/drush/drush/includes/sitealias.inc +++ b/vendor/drush/drush/includes/sitealias.inc @@ -5,176 +5,21 @@ * The site alias API. * * Run commands on remote server(s). - * @see example.aliases.drushrc.php + * @see example.aliases.yml * @see http://drupal.org/node/670460 */ +use Drush\Commands\core\StatusCommands; +use Drush\Drush; use Drush\Log\LogLevel; +use Consolidation\SiteAlias\SiteAlias; use Webmozart\PathUtil\Path; /** - * Check to see if the user specified an alias - * in an arguement, or via site-set. If so, return - * the name of the alias. - * - * If the alias came from args, then remove it - * from args. - */ -function drush_sitealias_check_arg_and_site_set() { - $args = drush_get_arguments(); - $target_alias = FALSE; - - // Test to see if the first arg is a valid alias identifier. - // If the first arguement is a well-formed identifier, but we - // cannot find a record for it, then we will fail with an error. - if (!empty($args) && drush_sitealias_valid_alias_format($args[0])) { - // Pop the alias off the arguments list first thing. - $target_alias = array_shift($args); - drush_set_arguments($args); - } - else { - // If the user did not specify an alias via an argument, - // check to see if a site env was set. - $target_alias = drush_sitealias_site_get(); - } - - // Record the user's desired target alias name - if ($target_alias) { - drush_set_context('DRUSH_TARGET_SITE_ALIAS', $target_alias); - } - return $target_alias; -} - -/** - * Check to see if the first command-line arg or the - * -l option is a site alias; if it is, copy its record - * values to the 'alias' context. - * - * @return boolean - * TRUE if a site alias was found and processed. - */ -function drush_sitealias_check_arg() { - $args = drush_get_arguments(); - - // Test to see if the first arg is a site specification - if (!empty($args) && _drush_sitealias_set_context_by_name($args[0])) { - drush_set_context('DRUSH_TARGET_SITE_ALIAS', $args[0]); - array_shift($args); - // We only need to expand the site specification - // once, then we are done. - drush_set_arguments($args); - return TRUE; - } - // Return false to indicate that no site alias was specified. - return FALSE; -} - -/* - * Check to see if user has selected a site via site-set command. - */ -function drush_sitealias_check_site_env() { - $site = drush_get_context('DRUSH_TARGET_SITE_ALIAS'); - if (empty($site)) { - $site_env = drush_sitealias_site_get(); - if (!empty($site_env) && (_drush_sitealias_set_context_by_name($site_env))) { - drush_set_context('DRUSH_TARGET_SITE_ALIAS', $site_env); - return TRUE; - } - } - // Return false to indicate that no site alias was specified. - return FALSE; -} - -/** - * Check to see if a '@self' record was created during bootstrap. - * If not, make one now. - */ -function drush_sitealias_create_self_alias() { - $self_record = drush_sitealias_get_record('@self'); - if (!array_key_exists('root', $self_record) && !array_key_exists('remote-host', $self_record)) { - $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - $uri = drush_get_context('DRUSH_SELECTED_URI'); - if (!empty($drupal_root) && !empty($uri)) { - // Create an alias '@self' - _drush_sitealias_cache_alias('@self', array('root' => $drupal_root, 'uri' => $uri)); - } - } -} - -/** - * Given a list of alias records, shorten the name used if possible - */ -function drush_sitealias_simplify_names($site_list) { - $result = array(); - foreach ($site_list as $original_name => $alias_record) { - $adjusted_name = $alias_record['#name']; - $hashpos = strpos($original_name, '#'); - if ($hashpos !== FALSE) { - $adjusted_name = substr($original_name, $hashpos); - if (array_key_exists('remote-host', $alias_record)) { - $adjusted_name = $alias_record['remote-host'] . $adjusted_name; - } - } - $result[$adjusted_name] = $alias_record; - } - return $result; -} - -/** - * Given an array of site specifications, resolve each one in turn and - * return an array of alias records. If you only want a single record, - * it is preferable to simply call drush_sitealias_get_record() directly. - * - * @param $site_specifications - * One of: - * A comma-separated list of site specifications: '@site1,@site2' - * An array of site specifications: array('@site1','@site2') - * An array of alias records: - * array( - * 'site1' => array('root' => ...), - * 'site2' => array('root' => ...) - * ) - * An array of site specifications. - * @see drush_sitealias_get_record() for the format of site specifications. - * @return - * An array of alias records - */ -function drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_context = NULL) { - $result_list = array(); - $not_found = array(); - if (!is_array($site_specifications)) { - $site_specifications = explode(',', $site_specifications); - } - if (!empty($site_specifications)) { - foreach ($site_specifications as $site) { - if (is_array($site)) { - $result_list[] = $site; - } - else { - $alias_record = drush_sitealias_get_record($site, $alias_path_context); - if (!$alias_record) { - $not_found[] = $site; - } - else { - $result_list = array_merge($result_list, drush_sitealias_resolve_sitelist($alias_record)); - } - } - } - } - return array($result_list, $not_found); -} - -/** - * Returns TRUE if $alias is a valid format for an alias name. - * - * Mirrors the allowed formats shown below for drush_sitealias_get_record. + * Option keys used for site selection. */ -function drush_sitealias_valid_alias_format($alias) { - return ( (strpos($alias, ',') !== false) || - ((strpos($alias, '@') === FALSE ? 0 : 1) + (strpos($alias, '/') === FALSE ? 0 : 1) + (strpos($alias, '#') === FALSE ? 0 : 1) >= 2) || - ($alias{0} == '#') || - ($alias{0} == '@') - ); +function drush_sitealias_site_selection_keys() { + return ['remote-host', 'remote-user', 'ssh-options', '#name', 'os']; } /** @@ -209,2126 +54,45 @@ function drush_sitealias_valid_alias_format($alias) { * An alias record, or empty if none found. */ function drush_sitealias_get_record($alias, $alias_context = NULL) { - // Check to see if the alias contains commas. If it does, then - // we will go ahead and make a site list record - $alias_record = array(); - if (strpos($alias, ',') !== false) { - // TODO: If the site list contains any site lists, or site - // search paths, then we should expand those and merge them - // into this list longhand. - $alias_record['site-list'] = explode(',', $alias); - } - else { - $alias_record = _drush_sitealias_get_record($alias, $alias_context); - } - if (!empty($alias_record)) { - if (array_key_exists('#name', $alias_record)) { - if ($alias_record['#name'] == 'self') { - $path = drush_sitealias_local_site_path($alias_record); - if ($path) { - $cached_alias_record = drush_sitealias_lookup_alias_by_path($path); - // Don't overrite keys which have already been negotiated. - unset($cached_alias_record['#name'], $cached_alias_record['root'], $cached_alias_record['uri']); - $alias_record = array_merge($alias_record, $cached_alias_record); - } - } - } - else { - $alias_record['#name'] = drush_sitealias_uri_to_site_dir($alias); - } - } - return $alias_record; -} - -/** - * This is a continuation of drush_sitealias_get_record, above. It is - * not intended to be called directly. - */ -function _drush_sitealias_get_record($alias, $alias_context = NULL) { - $alias_record = array(); - // Before we do anything else, load $alias if it needs to be loaded - _drush_sitealias_load_alias($alias, $alias_context); - - // Check to see if the provided parameter is in fact a defined alias. - $all_site_aliases =& drush_get_context('site-aliases'); - if (array_key_exists($alias, $all_site_aliases)) { - $alias_record = $all_site_aliases[$alias]; - } - // If the parameter is not an alias, then it is some form of - // site specification (or it is nothing at all) - else { - if (isset($alias)) { - // Cases 1.) - 4.): - // We will check for a site specification if the alias has at least - // two characters from the set '@', '/', '#'. - if ((strpos($alias, '@') === FALSE ? 0 : 1) + ((strpos($alias, '/') === FALSE && strpos($alias, '\\') === FALSE) ? 0 : 1) + (strpos($alias, '#') === FALSE ? 0 : 1) >= 2) { - if ((substr($alias,0,7) != 'http://') && !drush_is_absolute_path($alias)) { - // Add on a scheme so that "user:pass@server" will always parse correctly - $parsed = parse_url('http://' . $alias); - } - else if (drush_is_windows() && drush_is_absolute_path($alias)) { - // On windows if alias begins with a filesystem path we must add file:// scheme to make it parse correcly - $parsed = parse_url('file:///' . $alias); - } - else { - $parsed = parse_url($alias); - } - // Copy various parts of the parsed URL into the appropriate records of the alias record - foreach (array('user' => 'remote-user', 'pass' => 'remote-pass', 'host' => 'remote-host', 'fragment' => 'uri', 'path' => 'root') as $url_key => $option_key) { - if (array_key_exists($url_key, $parsed)) { - _drush_sitealias_set_record_element($alias_record, $option_key, $parsed[$url_key]); - } - } - // If the site specification has a query, also set the query items - // in the alias record. This allows passing db_url as part of the - // site specification, for example. - if (array_key_exists('query', $parsed)) { - foreach (explode('&', $parsed['query']) as $query_arg) { - $query_components = explode('=', $query_arg); - _drush_sitealias_set_record_element($alias_record, urldecode($query_components[0]), urldecode($query_components[1])); - } - } - - // Case 3.): If the URL contains a 'host' portion but no fragment, then set the uri to the host - // Note: We presume that 'server' is the best default for case 3; without this code, the default would - // be whatever is set in $options['l'] on the target machine's drushrc.php settings file. - if (array_key_exists('host', $parsed) && !array_key_exists('fragment', $parsed)) { - $alias_record['uri'] = $parsed['host']; - } - - // Special checking: relative aliases embedded in a path - $relative_alias_pos = strpos($alias_record['root'], '/@'); - if ($relative_alias_pos !== FALSE) { - // Special checking: /path/@sites - $base = substr($alias_record['root'], 0, $relative_alias_pos); - $relative_alias = substr($alias_record['root'], $relative_alias_pos + 1); - if (drush_valid_root($base) || ($relative_alias == '@sites')) { - drush_sitealias_create_sites_alias($base); - $alias_record = drush_sitealias_get_record($relative_alias); - } - else { - $alias_record = array(); - } - } - } - else { - // Case 5.) and 6.): - // If the alias is the name of a folder in the 'sites' directory, - // then use it as a local site specification. - $alias_record = _drush_sitealias_find_record_for_local_site($alias); - } - } - } - - if (!empty($alias_record)) { - if (!isset($alias_record['remote']) && !isset($alias_record['#loaded-config'])) { - if (array_key_exists('root', $alias_record)) { - drush_sitealias_add_to_alias_path($alias_record['root'] . '/drush'); - drush_sitealias_add_to_alias_path($alias_record['root'] . '/sites/all/drush'); - } - // TODO: We should probably remove this feature, and put it back - // in, but in different places (e.g. site selection, sql-sync + rsync - // parameters, etc.) - $alias_site_dir = drush_sitealias_local_site_path($alias_record); - - if (isset($alias_site_dir)) { - // Add the sites folder of this site to the alias search path list - drush_sitealias_add_to_alias_path($alias_site_dir); - } - if (isset($alias_record['config']) && file_exists($alias_record['config'])) { - drush_load_config_file('site', $alias_record['config']); - $alias_record['#loaded-config'] = TRUE; - } - unset($alias_record['config']); - } - - // Add the static defaults - _drush_sitealias_add_static_defaults($alias_record); - - // Cache the result with all of its calculated values - $all_site_aliases[$alias] = $alias_record; - } - - return $alias_record; -} - -/** - * Add a path to the array of paths where alias files are searched for. - * - * @param $add_path - * A path to add to the search path (or NULL to not add any). - * Once added, the new path will remain available until drush - * exits. - * @return - * An array of paths containing all values added so far - */ -function drush_sitealias_add_to_alias_path($add_path) { - static $site_paths = array(); - - if ($add_path != NULL) { - if (!is_array($add_path)) { - $add_path = explode(PATH_SEPARATOR, $add_path); - } - // Normalize path to make sure we don't add the same path twice on - // windows due to different spelling. e.g. c:\tmp and c:/tmp - foreach($add_path as &$path) { - $path = drush_normalize_path($path); - } - $site_paths = array_unique(array_merge($site_paths, $add_path)); - } - return $site_paths; -} - -/** - * Return the array of paths where alias files are searched for. - * - * @param $alias_path_context - * If the alias being looked up is part of a relative alias, - * the alias path context specifies the context of the primary - * alias the new alias is rooted from. Alias files stored in - * the sites folder of this context, or inside the context itself - * takes priority over any other search path that might define - * a similarly-named alias. In this way, multiple sites can define - * a '@peer' alias. - * @return - * An array of paths - */ -function drush_sitealias_alias_path($alias_path_context = NULL) { - $context_path = array(); - if (isset($alias_path_context)) { - $context_path = array(drush_sitealias_local_site_path($alias_path_context)); - } - // We get the current list of site paths by adding NULL - // (nothing) to the path list, which is a no-op - $site_paths = drush_sitealias_add_to_alias_path(NULL); - - // If the user defined the root of a drupal site, then also - // look for alias files in /drush and /sites/all/drush. - $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - if (!empty($drupal_root)) { - $site_paths[] = drush_sitealias_alias_base_directory($drupal_root . '/../drush'); - $site_paths[] = drush_sitealias_alias_base_directory($drupal_root . '/drush'); - $site_paths[] = drush_sitealias_alias_base_directory($drupal_root . '/sites/all/drush'); - $uri = drush_get_context('DRUSH_SELECTED_URI'); - if (empty($uri)) { - $uri = 'default'; - } - $site_dir = drush_sitealias_uri_to_site_dir($uri, $drupal_root); - if ($site_dir) { - $site_paths[] = drush_sitealias_alias_base_directory("$drupal_root/sites/$site_dir"); - } - } - $alias_path = (array) drush_get_context('ALIAS_PATH', array()); - return array_unique(array_merge($context_path, $alias_path, $site_paths)); -} - -/** - * If there is a directory 'site-aliases' in the specified search location, - * then search ONLY in that directory for aliases. Otherwise, search - * anywhere inside the specified directory for aliases. - */ -function drush_sitealias_alias_base_directory($dir) { - $potential_location = $dir . '/site-aliases'; - if (is_dir($potential_location)) { - return $potential_location; + // If legacy code is still looking for an alias record this way, redirect the + // request to the alias manager. + $alias_record = Drush::aliasManager()->get($alias); + if (empty($alias_record)) { + return []; } - return $dir; + $config_record = $alias_record->exportConfig(); + $exported_config = $config_record->export(); + return isset($exported_config['options']) ? $exported_config['options'] : []; } /** - * Return the full path to the site directory of the - * given alias record. - * - * @param $alias_record - * The alias record - * @return - * The path to the site directory of the associated - * alias record, or NULL if the record is not a local site. - */ -function drush_sitealias_local_site_path($alias_record) { - $result = NULL; - - if (isset($alias_record['root']) && !isset($alias_record['remote-host'])) { - if (isset($alias_record['uri'])) { - $uri = $alias_record['uri']; - $uri = preg_replace('#^[^:]*://#', '', $uri); - while (!$result && !empty($uri)) { - if (file_exists($alias_record['root'] . '/sites/sites.php')) { - $sites = array(); - include($alias_record['root'] . '/sites/sites.php'); - if (array_key_exists($uri, $sites)) { - $result = $alias_record['root'] . '/sites/' . $sites[$uri]; - } - } - if (!$result) { - $result = ($alias_record['root'] . '/sites/' . drush_sitealias_uri_to_site_dir($uri, drush_sitealias_get_root($alias_record))); - } - $result = realpath($result); - $uri = preg_replace('#^[^.]*\.*#', '', $uri); - } - } - if (!$result) { - $result = realpath($alias_record['root'] . '/sites/default'); - } - } - - return $result; -} - -/** - * Check and see if an alias definition for $alias is available. - * If it is, load it into the list of aliases cached in the - * 'site-aliases' context. - * - * @param $alias - * The name of the alias to load in ordinary form ('@name') - * @param $alias_path_context - * When looking up a relative alias, the alias path context is - * the primary alias that we will start our search from. - */ -function _drush_sitealias_load_alias($alias, $alias_path_context = NULL) { - $all_site_aliases = drush_get_context('site-aliases'); - $result = array(); - - // Only aliases--those named entities that begin with '@'--can be loaded this way. - // We also skip any alias that has already been loaded. - if ((substr($alias,0,1) == '@') && !array_key_exists($alias,$all_site_aliases)) { - $aliasname = substr($alias,1); - $result = _drush_sitealias_find_and_load_alias($aliasname, $alias_path_context); - if (!empty($result)) { - $alias_options = array('site-aliases' => array($aliasname => $result)); - _drush_sitealias_add_inherited_values($alias_options['site-aliases']); - drush_set_config_special_contexts($alias_options); - if (array_key_exists('#file', $result)) { - drush_log(dt('Loaded alias !alias from file !file', array('!alias' => $alias, '!file' => $result['#file']))); - } - } - } - - return $result; -} - -/** - * Load every alias file that can be found anywhere in the - * alias search path. - */ -function drush_sitealias_load_all($resolve_parent = TRUE) { - $result = _drush_sitealias_find_and_load_all_aliases(); - if (!empty($result) && ($resolve_parent == TRUE)) { - // If any aliases were returned, then check for - // inheritance and then store the aliases into the - // alias cache - _drush_sitealias_add_inherited_values($result); - $alias_options = array('site-aliases' => $result); - drush_set_config_special_contexts($alias_options); - } -} - -/** - * Worker function called by _drush_sitealias_load_alias and - * drush_sitealias_load_all. Traverses the alias search path - * and finds the specified alias record. + * Determines whether a given site alias is for a remote site. * - * @return - * An array of $kay => $value pair of alias names and alias records - * loaded. - */ -function _drush_sitealias_find_and_load_all_aliases() { - $result = array(); - - $drush_alias_files = _drush_sitealias_find_alias_files(); - drush_set_context('drush-alias-files', $drush_alias_files); - - // For every file that matches, check inside it for - // an alias with a matching name. - foreach ($drush_alias_files as $filename) { - if (file_exists($filename)) { - $aliases = $options = array(); - // silently ignore files we can't include - if ((@include $filename) === FALSE) { - drush_log(dt('Cannot open alias file "!alias", ignoring.', array('!alias' => realpath($filename))), LogLevel::BOOTSTRAP); - continue; - } - unset($options['site-aliases']); // maybe unnecessary - - // If $aliases are not set, but $options are, then define one alias named - // after the first word of the file, before '.alias.drushrc.php. - if (empty($aliases) && !empty($options)) { - $this_alias_name = substr(basename($filename),0,strpos(basename($filename),'.')); - $aliases[$this_alias_name] = $options; - $options = array(); - } - // If this is a group alias file, then make an - // implicit alias from the group name that contains - // a site-list of all of the aliases in the file - $group_name = ''; - if (substr($filename, -20) == ".aliases.drushrc.php") { - $group_name = basename($filename,".aliases.drushrc.php"); - if (!empty($aliases) && !array_key_exists($group_name, $aliases)) { - $alias_names = array(); - foreach (array_keys($aliases) as $one_alias) { - $alias_names[] = "@$group_name.$one_alias"; - $aliases["$group_name.$one_alias"] = $aliases[$one_alias]; - unset($aliases[$one_alias]); - } - $aliases[$group_name] = array('site-list' => implode(',', $alias_names)); - } - } - if (!empty($aliases)) { - if (!empty($options)) { - foreach ($aliases as $name => $value) { - $aliases[$name] = array_merge($options, $value); - } - $options = array(); - } - - foreach ($aliases as $name => $value) { - _drush_sitealias_initialize_alias_record($aliases[$name]); - $aliases[$name]['#name'] = $name; - $aliases[$name]['#file'] = $filename; - } - - $result = _sitealias_array_merge($result, $aliases); - // If we found at least one alias from this file - // then record it in the drush-alias-files context. - $drush_alias_files = drush_get_context('drush-alias-files'); - if (!in_array($filename, $drush_alias_files)) { - $drush_alias_files[] = $filename; - } - drush_set_context('drush-alias-files', $drush_alias_files); - } - } - } - - return $result; -} - -/** - * Function to find all alias files that might contain aliases - * that match the requested alias name. - */ -function _drush_sitealias_find_alias_files($aliasname = NULL, $alias_path_context = NULL) { - $alias_files_to_consider = array(); - - // The alias path is a list of folders to search for alias settings files - $alias_path = drush_sitealias_alias_path($alias_path_context); - - // $alias_files contains a list of filename patterns - // to search for. We will find any matching file in - // any folder in the alias path. The directory scan - // is not deep, though; only files immediately in the - // search path are considered. - $alias_files = array('/.*aliases\.drush(' . DRUSH_MAJOR_VERSION . '|)rc\.php$/'); - if ($aliasname == NULL) { - $alias_files[] = '/.*\.alias\.drush(' . DRUSH_MAJOR_VERSION . '|)rc\.php$/'; - } - else { - $alias_files[] = '/' . preg_quote($aliasname, '/') . '\.alias\.drush(' . DRUSH_MAJOR_VERSION . '|)rc\.php$/'; - } - - // Do not scan into the files directory. - $blacklist = array_merge(array('files'), drush_filename_blacklist()); - - // Search each path in turn. - foreach ($alias_path as $path) { - // Find all of the matching files in this location - foreach ($alias_files as $file_pattern_to_search_for) { - drush_log(dt('Scanning into @path for @pattern', array('@path' => $path, '@pattern' => $file_pattern_to_search_for)), LogLevel::DEBUG_NOTIFY); - $alias_files_to_consider = array_merge($alias_files_to_consider, array_keys(drush_scan_directory($path, $file_pattern_to_search_for, $blacklist, 0, TRUE))); - } - } - - return $alias_files_to_consider; -} - -/** - * Traverses the alias search path and finds the specified alias record. + * @param string $alias + * An alias name or site specification. * - * @param $aliasname - * The name of the alias without the leading '@' (i.e. '#name') - * or NULL to load every alias found in every alias file. - * @param $alias_path_context - * When looking up a relative alias, the alias path context is - * the primary alias that we will start our search from. - * @return - * An empty array if nothing was loaded. If $aliasname is - * not null, then the array returned is the alias record for - * $aliasname. If $aliasname is NULL, then the array returned - * is a $kay => $value pair of alias names and alias records - * loaded. + * @return bool + * Returns TRUE if the alias refers to a remote site, FALSE if it does not, or NULL is unsure. */ -function _drush_sitealias_find_and_load_alias($aliasname, $alias_path_context = NULL) { - // Special checking for '@sites' alias - if ($aliasname == 'sites') { - $drupal_root = NULL; - if ($alias_path_context != null) { - if (array_key_exists('root', $alias_path_context) && !array_key_exists('remote-host', $alias_path_context)) { - $drupal_root = $alias_path_context['root']; - } - } - else { - $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - } - if (isset($drupal_root) && !is_array($drupal_root)) { - drush_sitealias_create_sites_alias($drupal_root); - } - } - - $alias_files_to_consider = _drush_sitealias_find_alias_files($aliasname, $alias_path_context); - - return _drush_sitealias_find_and_load_alias_from_file($aliasname, $alias_files_to_consider); -} - -function _drush_sitealias_find_and_load_alias_from_file($aliasname, $alias_files_to_consider) { - $result = array(); - $result_names = array(); - - // For every file that matches, check inside it for - // an alias with a matching name. - $recorded_files = array(); - foreach ($alias_files_to_consider as $filename) { - if (file_exists($filename)) { - $aliases = $options = array(); - // silently ignore files we can't include - if ((@include $filename) === FALSE) { - drush_log(dt('Cannot open alias file "!alias", ignoring.', array('!alias' => realpath($filename))), LogLevel::BOOTSTRAP); - continue; - } - unset($options['site-aliases']); // maybe unnecessary - - // If $aliases are not set, but $options are, then define one alias named - // after the first word of the file, before '.alias.drushrc.php. - if (empty($aliases) && !empty($options)) { - $this_alias_name = substr(basename($filename),0,strpos(basename($filename),'.')); - $aliases[$this_alias_name] = $options; - $options = array(); - } - // If this is a group alias file, then make an - // implicit alias from the group name that contains - // a site-list of all of the aliases in the file - $group_prefix = ''; - if (substr($filename, -20) == ".aliases.drushrc.php") { - $group_name = basename($filename,".aliases.drushrc.php"); - $group_prefix = $group_name . '.'; - if (!empty($aliases) && !array_key_exists($group_name, $aliases)) { - $alias_names = array(); - foreach (array_keys($aliases) as $one_alias) { - $alias_names[] = "@$group_name.$one_alias"; - $aliases[$one_alias]['#name'] = "$group_name.$one_alias"; - $aliases[$one_alias]['#group'] = $group_name; - $aliases["$group_name.$one_alias"] = $aliases[$one_alias]; - $aliases[$one_alias]["#hidden"] = TRUE; - } - $aliases[$group_name] = array('site-list' => implode(',', $alias_names), '#group' => $group_name, '#name' => $group_name); - } - } - // Store only the named alias into the alias cache - if ((isset($aliases)) && !empty($aliasname) && array_key_exists($aliasname, $aliases)) { - drush_set_config_special_contexts($options); // maybe unnecessary - $one_result = array_merge($options, $aliases[$aliasname]); - $one_result['#file'] = $filename; - if (!array_key_exists('#name', $one_result)) { - $one_result['#name'] = $aliasname; - } - _drush_sitealias_initialize_alias_record($one_result); - // If the alias name is exactly the same as a previous match, then - // merge the two records together - if (!empty($result) && ($result['#name'] == $one_result['#name'])) { - $result = _sitealias_array_merge($result, $one_result); - } - // Add the name of the found record to the list of results - else { - $result_names[] = "@" . $one_result['#name']; - $result = $one_result; - } - } - } +function drush_sitealias_is_remote_site($alias) { + if (is_array($alias) && !empty($alias['remote-host'])) { + return TRUE; } - // If there are multiple matches, then return a list of results. - if (count($result_names) > 1) { - $result = array('site-list' => $result_names); + if (!is_string($alias) || !strlen($alias)) { + return NULL; } - return $result; -} - -/** - * Merges two site aliases. - * - * array_merge_recursive is too much; we only want to run - * array_merge on the common top-level keys of the array. - * - * @param array $site_alias_a - * A site alias array. - * @param array $site_alias_b - * A site alias array. - * @return - * A site alias array where the keys from $site_alias_a are overwritten by the - * keys from $site_alias_b. - */ -function _sitealias_array_merge($site_alias_a, $site_alias_b) { - $result = $site_alias_a; - - foreach($site_alias_b as $key => $value) { - if (is_array($value) && array_key_exists($key, $result)) { - $result[$key] = array_merge($result[$key], $value); + $site_record = drush_sitealias_get_record($alias); + if ($site_record) { + if (!empty($site_record['remote-host'])) { + return TRUE; } else { - $result[$key] = $value; - } - } - - return $result; -} - -/** - * Check to see if there is a 'parent' item in the alias; if there is, - * then load the parent alias record and overlay the entries in the - * current alias record on top of the items from the parent record. - * - * @param $aliases - * An array of alias records that are modified in-place. - */ -function _drush_sitealias_add_inherited_values(&$aliases) { - foreach ($aliases as $alias_name => $alias_value) { - // Prevent circular references from causing an infinite loop - _drush_sitealias_cache_alias("@$alias_name", array()); - _drush_sitealias_add_inherited_values_to_record($alias_value); - $aliases[$alias_name] = $alias_value; - } -} - -function _drush_sitealias_add_inherited_values_to_record(&$alias_value) { - drush_command_invoke_all_ref('drush_sitealias_alter', $alias_value); - if (isset($alias_value['parent'])) { - drush_log(dt("Using deprecated 'parent' element '!parent' in '!name'.", array('!parent' => $alias_value['parent'], '!name' => $alias_value['#name'])), LogLevel::DEBUG); - // Fetch and merge in each parent - foreach (explode(',', $alias_value['parent']) as $parent) { - $parent_record = drush_sitealias_get_record($parent); - unset($parent_record['#name']); - unset($parent_record['#file']); - unset($parent_record['#hidden']); - $array_based_keys = array_merge(drush_get_special_keys(), array('path-aliases')); - foreach ($array_based_keys as $array_based_key) { - if (isset($alias_value[$array_based_key]) && isset($parent_record[$array_based_key])) { - $alias_value[$array_based_key] = array_merge($parent_record[$array_based_key], $alias_value[$array_based_key]); - } - } - $alias_value = array_merge($parent_record, $alias_value); - } - } - unset($alias_value['parent']); -} - -/** - * Add an empty record for the specified alias name - * - * @param $alias_name - * The name of the alias, including the leading "@" - */ -function _drush_sitealias_cache_alias($alias_name, $alias_record) { - $cache =& drush_get_context('site-aliases'); - // If the alias already exists in the cache, then merge - // the new alias with the existing alias - if (array_key_exists($alias_name, $cache)) { - $alias_record = array_merge($cache[$alias_name], $alias_record); - } - if (!isset($alias_record['#name'])) { - $alias_record['#name'] = trim($alias_name, '@'); - } - $cache[$alias_name] = $alias_record; - - // If the alias record points at a local site, make sure - // that /drush, /sites/all/drush and the site folder for that site - // are added to the alias path, so that other alias files - // stored in those locations become searchable. - if (!array_key_exists('remote-host', $alias_record) && !empty($alias_record['root'])) { - drush_sitealias_add_to_alias_path($alias_record['root'] . '/drush'); - drush_sitealias_add_to_alias_path($alias_record['root'] . '/sites/all/drush'); - $site_dir = drush_sitealias_local_site_path($alias_record); - if (isset($site_dir)) { - drush_sitealias_add_to_alias_path($site_dir); - } - } -} - -/** - * If the alias record does not contain a 'databases' or 'db-url' - * entry, then use backend invoke to look up the settings value - * from the remote or local site. The 'db_url' form is preferred; - * nothing is done if 'db_url' is not available (e.g. on a D7 site) - * - * @param $alias_record - * The full alias record to populate with database settings - */ -function drush_sitealias_add_db_url(&$alias_record) { - if (!isset($alias_record['db-url']) && !isset($alias_record['databases']) && !isset($alias_record['site-list'])) { - drush_sitealias_add_db_settings($alias_record); - } - if (!isset($alias_record['db-url']) && isset($alias_record['databases'])) { - $alias_record['db-url'] = drush_sitealias_convert_databases_to_db_url($alias_record['databases']); - } -} - -/** - * Drush still accepts --db-url format database specifications as - * cli parameters; it is therefore useful to be able to convert - * from a database record back to a db-url sometimes. - */ -function drush_sitealias_convert_db_spec_to_db_url($db_spec) { - $result = urlencode($db_spec["driver"]) . "://"; - if (isset($db_spec["username"])) { - $result .= urlencode($db_spec["username"]); - if (isset($db_spec["password"])) { - $result .= ":" . urlencode($db_spec["password"]); - } - $result .= "@"; - } - // Host is required, unless this is an sqlite db. - if (isset($db_spec["host"])) { - $result .= urlencode($db_spec["host"]); - if (isset($db_spec["port"])) { - $result .= ":" . urlencode($db_spec["port"]); + return FALSE; } - $result .= '/' . urlencode($db_spec["database"]); } else { - // URL-encode the database, but convert slashes - // back to their original form for readability. - // This portion is the "path" of the URL, so it may - // contain slashes. This is important for sqlite. - $result .= str_replace("%2F", "/", urlencode(ltrim($db_spec["database"], '/'))); - } - return $result; -} - -/** - * Create a db-url from the databases record. - */ -function drush_sitealias_convert_databases_to_db_url($databases) { - if ((count($databases) == 1) && isset($databases['default'])) { - $result = drush_sitealias_convert_db_spec_to_db_url($databases['default']['default']); - } - else { - foreach ($databases as $key => $db_info) { - $result[$key] = drush_sitealias_convert_db_spec_to_db_url($db_info['default']); - } - } - return $result; -} - -/** - * Return the databases record from the alias record - * - * @param $alias_record - * A record returned from drush_sitealias_get_record - * @returns - * A databases record (always in D7 format) or NULL - * if the databases record could not be found. - */ -function sitealias_get_databases_from_record(&$alias_record) { - $altered_record = drush_sitealias_add_db_settings($alias_record); - - return array_key_exists('databases', $alias_record) ? $alias_record['databases'] : NULL; -} - -/** - * Return the $db_spec record for the database associated with - * the provided alias record. @see drush_sitealias_add_db_settings(), - * which will be used to first add the database information to the - * alias records, invoking sql-conf to look them up if necessary. - * - * The options 'database' and 'target' are used to specify which - * specific database should be fetched from the database record; - * they may appear in the alias definition, or may be taken from the - * command line options. The values 'default' and 'default' are - * used if these options are not specified in either location. - * - * Note that in the context of sql-sync, the site alias record will - * be taken from one of the source or target aliases - * (e.g. `drush sql-sync @source @target`), which will be overlayed with - * any options that begin with 'source-' or 'target-', respectively. - * Therefore, the commandline options 'source-database' and 'source-target' - * (or 'target-database' and 'source-target') may also affect the operation - * of this function. - */ -function drush_sitealias_get_db_spec(&$alias_record, $default_to_self = FALSE, $prefix = '') { - $db_spec = NULL; - $databases = sitealias_get_databases_from_record($alias_record); - if (isset($databases) && !empty($databases)) { - $database = drush_sitealias_get_option($alias_record, 'database', 'default', $prefix); - $target = drush_sitealias_get_option($alias_record, 'target', 'default', $prefix); - if (array_key_exists($database, $databases) && array_key_exists($target, $databases[$database])) { - $db_spec = $databases[$database][$target]; - } - } - elseif ($default_to_self) { - $db_spec = _drush_sql_get_db_spec(); - } - - if (isset($db_spec)) { - $remote_host = drush_sitealias_get_option($alias_record, 'remote-host', NULL, $prefix); - if (!drush_is_local_host($remote_host)) { - $db_spec['remote-host'] = $remote_host; - $db_spec['port'] = drush_sitealias_get_option($alias_record, 'remote-port', (isset($db_spec['port']) ? $db_spec['port'] : NULL), $prefix); - } - } - - return $db_spec; -} - -/** - * If the alias record does not contain a 'databases' or 'db-url' - * entry, then use backend invoke to look up the settings value - * from the remote or local site. The 'databases' form is - * preferred; 'db_url' will be converted to 'databases' if necessary. - * - * @param $alias_record - * The full alias record to populate with database settings - */ -function drush_sitealias_add_db_settings(&$alias_record) { - $altered_record = FALSE; - if (isset($alias_record['root'])) { - // If the alias record does not have a defined 'databases' entry, - // then we'll need to look one up - if (!isset($alias_record['db-url']) && !isset($alias_record['databases']) && !isset($alias_record['site-list'])) { - $values = drush_invoke_process($alias_record, "sql-conf", array(), array('all' => TRUE), array('integrate' => FALSE, 'override-simulated' => TRUE)); - if (is_array($values) && ($values['error_status'] == 0)) { - $altered_record = TRUE; - // If there are any special settings in the '@self' record returned by drush_invoke_process, - // then add those into our altered record as well - if (array_key_exists('self', $values)) { - $alias_record = array_merge($values['self'], $alias_record); - } - drush_sitealias_cache_db_settings($alias_record, $values['object']); - } - } + drush_set_error('Unrecognized site alias.'); } - return $altered_record; } -function drush_sitealias_cache_db_settings(&$alias_record, $databases) { - if (!empty($databases)) { - $alias_record['databases'] = $databases; - } - - // If the name is set, then re-cache the record after we fetch the databases - if (array_key_exists('#name', $alias_record)) { - $all_site_aliases =& drush_get_context('site-aliases'); - $all_site_aliases['@' . $alias_record['#name']] = $alias_record; - // Check and see if this record is a copy of 'self' - if (($alias_record['#name'] != 'self') && array_key_exists('@self', $all_site_aliases) && array_key_exists('#name', $all_site_aliases['@self']) && ($all_site_aliases['@self']['#name'] == $alias_record['#name'])) { - $all_site_aliases['@self'] = $alias_record; - } - } -} - -/** - * Check to see if we have already bootstrapped to a site. - */ -function drush_sitealias_is_bootstrapped_site($alias_record) { - if (!isset($alias_record['remote-host']) && array_key_exists('root', $alias_record)) { - $self_record = drush_sitealias_get_record("@self"); - if (empty($self_record) || !array_key_exists('root', $self_record)) { - // TODO: If we have not bootstrapped to a site yet, we could - // perhaps bootstrap to $alias_record here. - return FALSE; - } - elseif(($alias_record['root'] == $self_record['root']) && ($alias_record['uri'] == $self_record['uri'])) { - return TRUE; - } - } - return FALSE; -} - -/** - * Determines whether a given site alias is for a remote site. - * - * @param string $alias - * An alias name or site specification. - * - * @return bool - * Returns TRUE if the alias refers to a remote site, FALSE if it does not, or NULL is unsure. - */ -function drush_sitealias_is_remote_site($alias) { - if (is_array($alias) && !empty($alias['remote-host'])) { - return TRUE; - } - if (!is_string($alias) || !strlen($alias)) { - return NULL; - } - - $site_record = drush_sitealias_get_record($alias); - if ($site_record) { - if (!empty($site_record['remote-host'])) { - return TRUE; - } - else { - return FALSE; - } - } - else { - drush_set_error('Unrecognized site alias.'); - } -} - -/** - * Get the name of the current bootstrapped site - */ -function drush_sitealias_bootstrapped_site_name() { - $site_name = NULL; - $self_record = drush_sitealias_get_record('@self'); - if (array_key_exists('#name', $self_record)) { - $site_name = $self_record['#name']; - } - if (!isset($site_name) || ($site_name == '@self')) { - $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - if (isset($drupal_root)) { - $drupal_uri = drush_get_context('DRUSH_SELECTED_URI', 'default'); - $drupal_uri = str_replace('http://', '', $drupal_uri); - // TODO: Maybe use _drush_sitealias_find_local_alias_name? - $site_name = $drupal_root . '#' . $drupal_uri; - } - } - return $site_name; -} - -/** - * If there are any path aliases (items beginning with "%") in the test - * string, then resolve them as path aliases and add them to the provided - * alias record. - * - * @param $alias_record - * The full alias record to use in path alias expansion - * @param $test_string - * A slash-separated list of path aliases to resolve - * e.g. "%files/%special". - */ -function drush_sitealias_resolve_path_references(&$alias_record, $test_string = '') { - $path_aliases = array_key_exists('path-aliases', $alias_record) ? $alias_record['path-aliases'] : array(); - // Convert the test string into an array of items, and - // from this make a comma-separated list of projects - // that we can pass to 'drush status'. - $test_array = explode('/', $test_string); - $project_array = array(); - foreach($test_array as $one_item) { - if (!empty($one_item) && ($one_item[0] == '%') && (!array_key_exists($one_item,$path_aliases))) { - $project_array[] = substr($one_item,1); - } - } - $project_list = implode(',', $project_array); - - if (!empty($project_array)) { - // Optimization: if we're already bootstrapped to the - // site specified by $alias_record, then we can just - // call _core_site_status_table() rather than use backend invoke. - if (drush_sitealias_is_bootstrapped_site($alias_record) && drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - $status_values = _core_site_status_table($project_list); - } - else { - $values = drush_invoke_process($alias_record, "core-status", array(), empty($project_list) ? array() : array('project' => $project_list), array('integrate' => FALSE, 'override-simulated' => TRUE)); - $status_values = $values['object']; - } - if (isset($status_values['%paths'])) { - foreach ($status_values['%paths'] as $key => $path) { - $alias_record['path-aliases'][$key] = $path; - } - } - // If 'root' is not set in the alias, then fill it in from the status values. - if (!isset($alias_record['root']) && isset($status_values['root'])) { - $alias_record['root'] = $status_values['root']; - } - } -} - -/** - * Given an alias record that is a site list (contains a 'site-list' entry), - * resolve all of the members of the site list and return them - * is an array of alias records. - * - * @param $alias_record - * The site list alias record array - * @return - * An array of individual site alias records - */ -function drush_sitealias_resolve_sitelist($alias_record) { - $result_list = array(); - if (isset($alias_record)) { - if (array_key_exists('site-list', $alias_record)) { - foreach ($alias_record['site-list'] as $sitespec) { - $one_result = drush_sitealias_get_record($sitespec); - $result_list = array_merge($result_list, drush_sitealias_resolve_sitelist($one_result)); - } - } - elseif (array_key_exists('#name', $alias_record)) { - $result_list[$alias_record['#name']] = $alias_record; - } - } - - return $result_list; -} - -function _drush_sitelist_find_in_list($one_source, &$target) { - $result = FALSE; - - foreach ($target as $key => $one_target) { - if(_drush_sitelist_check_site_records($one_source, $one_target)) { - $result = $one_target; - unset($target[$key]); - } - } - - return $result; -} - -function _drush_sitelist_check_site_records($source, $target) { - if ((array_key_exists('uri', $source)) && (array_key_exists('uri', $target)) && ($source['uri'] == $target['uri'])) { - return TRUE; - } - return FALSE; -} - -/** - * Initialize an alias record; called as soon as the alias - * record is loaded from its alias file, before it is stored - * in the cache. - * - * @param alias_record - * The alias record to be initialized; parameter is modified in place. - */ -function _drush_sitealias_initialize_alias_record(&$alias_record) { - // If there is a 'from-list' entry, then build a derived - // list based on the site list with the given name. - if (array_key_exists('from-list', $alias_record)) { - // danger of infinite loops... move to transient defaults? - $from_record = drush_sitealias_get_record($alias_record['from-list']); - $from_list = drush_sitealias_resolve_sitelist($from_record); - $derived_list = array(); - foreach ($from_list as $one_record) { - $derived_record = _drush_sitealias_derive_record($one_record, $alias_record); - $derived_list[] = drush_sitealias_alias_record_to_spec($derived_record); - } - - $alias_record = array(); - if (!empty($derived_list)) { - $alias_record['site-list'] = $derived_list; - } - } - // If there is a 'site-search-path' entry, then build - // a 'site-list' entry from all of the sites that can be - // found in the search path. - if (array_key_exists('site-search-path', $alias_record)) { - // TODO: Is there any point in merging the sites from - // the search path with any sites already listed in the - // 'site-list' entry? For now we'll just overwrite. - $search_path = $alias_record['site-search-path']; - if (!is_array($search_path)) { - $search_path = explode(',', $search_path); - } - $found_sites = _drush_sitealias_find_local_sites($search_path); - $alias_record['site-list'] = $found_sites; - // The 'unordered-list' flag indicates that the order of the items in the site list is not stable. - $alias_record['unordered-list'] = '1'; - // DEBUG: var_export($alias_record, FALSE); - } - if (array_key_exists('site-list', $alias_record)) { - if (!is_array($alias_record['site-list'])) { - $alias_record['site-list'] = explode(',', $alias_record['site-list']); - } - } - else { - if (isset($alias_record['root']) && !isset($alias_recort['uri'])) { - $alias_recort['uri'] = 'default'; - } - } -} - -/** - * Add "static" default values to the given alias record. The - * difference between a static default and a transient default is - * that static defaults -always- exist in the alias record, and - * they are cached, whereas transient defaults are only added - * if the given drush command explicitly adds them. - * - * @param alias_record - * An alias record with most values already filled in - */ -function _drush_sitealias_add_static_defaults(&$alias_record) { - // If there is a 'db-url' entry but not 'databases' entry, then we will - // build 'databases' from 'db-url' so that drush commands that use aliases - // can always count on using a uniform 'databases' array. - if (isset($alias_record['db-url']) && !isset($alias_record['databases'])) { - $alias_record['databases'] = drush_sitealias_convert_db_from_db_url($alias_record['db-url']); - } - - // Canonicalize paths. - if (!empty($alias_record['root'])) { - $alias_record['root'] = Path::canonicalize($alias_record['root']); - } - - // Adjustments for aliases to drupal instances (as opposed to aliases that are site lists) - if (array_key_exists('uri', $alias_record)) { - // Make sure that there is always a 'path-aliases' array - if (!array_key_exists('path-aliases', $alias_record)) { - $alias_record['path-aliases'] = array(); - } - // If there is a 'root' entry, then copy it to the '%root' path alias - if (isset($alias_record['root'])) { - $alias_record['path-aliases']['%root'] = $alias_record['root']; - } - } -} - -function _drush_sitealias_derive_record($from_record, $modifying_record) { - $result = $from_record; - - // If there is a 'remote-user' in the modifying record, copy it. - if (array_key_exists('remote-user', $modifying_record)) { - $result['remote-user'] = $from_record['remote_user']; - } - // If there is a 'remote-host', then: - // If it is empty, clear the remote host in the result record - // If it ends in '.', then prepend it to the remote host in the result record - // Otherwise, copy it to the result record - if (array_key_exists('remote-host', $modifying_record)) { - $remote_host_modifier = $modifying_record['remote-host']; - if(empty($remote_host_modifier)) { - unset($result['remote-host']); - unset($result['remote-user']); - } - elseif ($remote_host_modifier[strlen($remote_host_modifier)-1] == '.') { - $result['remote-host'] = $remote_host_modifier . $result['remote-host']; - } - else { - $result['remote-host'] = $remote_host_modifier; - } - } - // If there is a 'root', then: - // If it begins with '/', copy it to the result record - // Otherwise, append it to the result record - if (array_key_exists('root', $modifying_record)) { - $root_modifier = $modifying_record['root']; - if($root_modifier[0] == '/') { - $result['root'] = $root_modifier; - } - else { - $result['root'] = $result['root'] . '/' . $root_modifier; - } - } - // Poor man's realpath: take out the /../ with preg_replace. - // (realpath fails if the files in the path do not exist) - while(strpos($result['root'], '/../') !== FALSE) { - $result['root'] = preg_replace('/\w+\/\.\.\//', '', $result['root']); - } - - // TODO: Should we allow the uri to be transformed? - // I think that if the uri does not match, then you should - // always build the list by hand, and not rely on '_drush_sitealias_derive_record'. - - return $result; -} - -/** - * Convert from an alias record to a site specification - * - * @param alias_record - * The full alias record to convert - * - * @param with_db - * True if the site specification should include a ?db-url term - * - * @return string - * The site specification - */ -function drush_sitealias_alias_record_to_spec($alias_record, $with_db = false) { - $result = ''; - - // TODO: we should handle 'site-list' records too. - if (array_key_exists('site-list', $alias_record)) { - // TODO: we should actually expand the site list and recompose it - $result = implode(',', $alias_record['site-list']); - } - else { - // There should always be a uri - if (array_key_exists('uri', $alias_record)) { - $result = '#' . drush_sitealias_uri_to_site_dir($alias_record['uri'], drush_sitealias_get_root($alias_record)); - } - // There should always be a root - if (array_key_exists('root', $alias_record)) { - $result = $alias_record['root'] . $result; - } - if (array_key_exists('remote-host', $alias_record)) { - $result = drush_remote_host($alias_record) . $result; - } - - // Add the database info to the specification if desired - if ($with_db) { - // If db-url is not supplied, look it up from the remote - // or local site and add it to the site alias - if (!isset($alias_record['db-url'])) { - drush_sitealias_add_db_url($alias_record); - } - $result = $result . '?db-url=' . urlencode(is_array($alias_record['db-url']) ? $alias_record['db-url']['default'] : $alias_record['db-url']); - } - } - - return $result; -} - -/** - * Search for drupal installations in the search path. - * - * @param search_path - * An array of drupal root folders - * - * @return - * An array of site specifications (/path/to/root#sitename.com) - */ -function _drush_sitealias_find_local_sites($search_path) { - $result = array(); - foreach ($search_path as $a_drupal_root) { - $result = array_merge($result, _drush_find_local_sites_at_root($a_drupal_root)); - } - return $result; -} - -/** - * Return a list of all of the local sites at the specified drupal root. - */ -function _drush_find_local_sites_at_root($a_drupal_root = '', $search_depth = 1) { - $site_list = array(); - $base_path = (empty($a_drupal_root) ? drush_get_context('DRUSH_DRUPAL_ROOT') : $a_drupal_root ); - if (!empty($base_path)) { - if (drush_valid_root($base_path)) { - // If $a_drupal_root is in fact a valid drupal root, then return - // all of the sites found inside the 'sites' folder of this drupal instance. - $site_list = _drush_find_local_sites_in_sites_folder($base_path); - } - else { - $bootstrap_files = drush_scan_directory($base_path, '/' . basename(DRUSH_DRUPAL_SIGNATURE) . '/' , array('.', '..', 'CVS', 'examples'), 0, drush_get_option('search-depth', $search_depth) + 1, 'filename', 1); - foreach ($bootstrap_files as $one_bootstrap => $info) { - $includes_dir = dirname($one_bootstrap); - if (basename($includes_dir) == basename(dirname(DRUSH_DRUPAL_SIGNATURE))) { - $drupal_root = dirname($includes_dir); - $site_list = array_merge(_drush_find_local_sites_in_sites_folder($drupal_root), $site_list); - } - } - } - } - return $site_list; -} - -/** - * Return a list of all of the local sites at the specified 'sites' folder. - */ -function _drush_find_local_sites_in_sites_folder($a_drupal_root) { - $site_list = array(); - - // If anyone searches for sites at a given root, then - // make sure that alias files stored at this root - // directory are included in the alias search path - drush_sitealias_add_to_alias_path($a_drupal_root); - - $base_path = $a_drupal_root . '/sites'; - - // TODO: build a cache keyed off of $base_path (realpath($base_path)?), - // so that it is guarenteed that the lists returned will definitely be - // exactly the same should this routine be called twice with the same path. - - $files = drush_scan_directory($base_path, '/settings\.php/', array('.', '..', 'CVS', 'all'), 0, 1, 'filename', 1); - foreach ($files as $filename => $info) { - if ($info->basename == 'settings.php') { - // First we'll resolve the realpath of the settings.php file, - // so that we get the correct drupal root when symlinks are in use. - $real_sitedir = dirname(realpath($filename)); - $real_root = drush_locate_root($filename); - if ($real_root !== FALSE) { - $a_drupal_site = $real_root . '#' . basename($real_sitedir); - } - // If the symlink points to some folder outside of any drupal - // root, then we'll use the - else { - $uri = drush_sitealias_site_dir_from_filename($filename); - $a_drupal_site = $a_drupal_root . '#' . $uri; - } - // Add the site if it isn't already in the array - if (!in_array($a_drupal_site, $site_list)) { - $site_list[] = $a_drupal_site; - } - } - } - return $site_list; -} - -function drush_sitealias_create_sites_alias($a_drupal_root = '') { - $sites_list = _drush_find_local_sites_at_root($a_drupal_root); - _drush_sitealias_cache_alias('@sites', array('site-list' => $sites_list)); -} - -/** - * Add "transient" default values to the given alias record. The - * difference between a static default and a transient default is - * that static defaults -always- exist in the alias record, - * whereas transient defaults are only added if the given drush - * command explicitly calls this function. The other advantage - * of transient defaults is that it is possible to differentiate - * between a default value and an unspecified value, since the - * transient defaults are not added until requested. - * - * Since transient defaults are not cached, you should avoid doing - * expensive operations here. To be safe, drush commands should - * avoid calling this function more than once. - * - * @param alias_record - * An alias record with most values already filled in - */ -function _drush_sitealias_add_transient_defaults(&$alias_record) { - if (isset($alias_record['path-aliases'])) { - // Add the path to the drush folder to the path aliases as !drush - if (!array_key_exists('%drush', $alias_record['path-aliases'])) { - if (array_key_exists('%drush-script', $alias_record['path-aliases'])) { - $alias_record['path-aliases']['%drush'] = dirname($alias_record['path-aliases']['%drush-script']); - } - else { - $alias_record['path-aliases']['%drush'] = dirname(drush_find_drush()); - } - } - // Add the path to the site folder to the path aliases as !site - if (!array_key_exists('%site', $alias_record['path-aliases']) && array_key_exists('uri', $alias_record)) { - $alias_record['path-aliases']['%site'] = 'sites/' . drush_sitealias_uri_to_site_dir($alias_record['uri'], drush_sitealias_get_root($alias_record)) . '/'; - } - } -} - -/** - * Find the name of a local alias record that has the specified - * root and uri. - */ -function _drush_sitealias_find_local_alias_name($root, $uri) { - $result = ''; - $all_site_aliases =& drush_get_context('site-aliases'); - - foreach ($all_site_aliases as $alias_name => $alias_values) { - if (!array_key_exists('remote-host', $alias_values) && array_key_exists('root', $alias_values) && array_key_exists('uri', $alias_values) && ($alias_name != '@self')) { - if (($root == $alias_values['root']) && ($uri == $alias_values['uri'])) { - $result = $alias_name; - } - } - } - - return $result; -} - -/** - * If '$alias' is the name of a folder in the sites folder of the given drupal - * root, then build an alias record for it - * - * @param alias - * The name of the site in the 'sites' folder to convert - * @return array - * An alias record, or empty if none found. - */ -function _drush_sitealias_find_record_for_local_site($alias, $drupal_root = NULL) { - $alias_record = array(); - - // Clip off the leading '#' if it is there - if (substr($alias,0,1) == '#') { - $alias = substr($alias,1); - } - - if (!isset($drupal_root)) { - $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - } - - if (!empty($drupal_root)) { - $alias_dir = drush_sitealias_uri_to_site_dir($alias, $drupal_root); - $site_settings_file = $drupal_root . '/sites/' . $alias_dir . '/settings.php'; - $alias_record = drush_sitealias_build_record_from_settings_file($site_settings_file, $alias, $drupal_root); - } - - return $alias_record; -} - -function drush_sitealias_build_record_from_settings_file($site_settings_file, $alias = null, $drupal_root = null) { - $alias_record = array(); - - if (file_exists($site_settings_file)) { - if (!isset($drupal_root)) { - $drupal_root = drush_locate_root($site_settings_file); - } - - $alias_record['root'] = $drupal_root; - if (isset($alias)) { - $alias_record['uri'] = $alias; - } - else { - $alias_record['uri'] = _drush_sitealias_site_dir_to_uri(drush_sitealias_site_dir_from_filename($site_settings_file)); - } - } - - return $alias_record; -} - -/** - * Pull the site directory from the path to settings.php - * - * @param site_settings_file - * path to settings.php - * - * @return string - * the site directory component of the path to settings.php - */ -function drush_sitealias_site_dir_from_filename($site_settings_file) { - return basename(dirname($site_settings_file)); -} - -/** - * Convert from a URI to a site directory. - * - * @param uri - * A uri, such as http://domain.com:8080/drupal - * @return string - * A directory, such as domain.com.8080.drupal - */ -function drush_sitealias_uri_to_site_dir($uri, $site_root = NULL) { - $uri = str_replace('http://', '', $uri); - $uri = str_replace('https://', '', $uri); - if (drush_is_windows()) { - // Handle absolute paths on windows - $uri = str_replace(array(':/', ':\\'), array('.', '.'), $uri); - } - - $hostname = str_replace(array('/', ':', '\\'), array('.', '.', '.'), $uri); - - // Check sites.php mappings - $site_dir = drush_site_dir_lookup_from_hostname($hostname, $site_root); - - return $site_dir ? $site_dir : $hostname; -} - -/** - * Convert from an old-style database URL to an array of database settings. - * - * @param db_url - * A Drupal 6 db url string to convert, or an array with a 'default' element. - * @return array - * An array of database values containing only the 'default' element of - * the db url. If the parse fails the array is empty. - */ -function drush_convert_db_from_db_url($db_url) { - $db_spec = array(); - - if (is_array($db_url)) { - $db_url_default = $db_url['default']; - } - else { - $db_url_default = $db_url; - } - - // If it's a sqlite database, pick the database path and we're done. - if (strpos($db_url_default, 'sqlite://') === 0) { - $db_spec = array( - 'driver' => 'sqlite', - 'database' => substr($db_url_default, strlen('sqlite://')), - ); - } - else { - $url = parse_url($db_url_default); - if ($url) { - // Fill in defaults to prevent notices. - $url += array( - 'scheme' => NULL, - 'user' => NULL, - 'pass' => NULL, - 'host' => NULL, - 'port' => NULL, - 'path' => NULL, - ); - $url = (object)array_map('urldecode', $url); - $db_spec = array( - 'driver' => $url->scheme == 'mysqli' && extension_loaded('mysql') ? 'mysql' : $url->scheme, - 'username' => $url->user, - 'password' => $url->pass, - 'host' => $url->host, - 'port' => $url->port, - 'database' => ltrim($url->path, '/'), - ); - } - } - - return $db_spec; -} - -function drush_convert_db_url($db_url) { - if (extension_loaded('mysql') && !extension_loaded('mysqli')) { - return preg_replace('#^mysqli://#', 'mysql://', $db_url);; - } - return preg_replace('#^mysql://#', 'mysqli://', $db_url); -} - -/** - * Convert from an old-style database URL to an array of database settings - * - * @param db_url - * A Drupal 6 db-url string to convert, or an array with multiple db-urls. - * @return array - * An array of database values. - */ -function drush_sitealias_convert_db_from_db_url($db_url) { - $result = array(); - - if (!is_array($db_url)) { - $result = array('default' => array('default' => drush_convert_db_from_db_url($db_url))); - } - else { - foreach ($db_url as $one_name => $one_db_url) { - $result[$one_name] = array('default' => drush_convert_db_from_db_url($one_db_url)); - } - } - - return $result; -} - -/** - * Utility function used by drush_get_alias; keys that start with - * '%' or '!' are path aliases, the rest are entries in the alias record. - */ -function _drush_sitealias_set_record_element(&$alias_record, $key, $value) { - if ((substr($key,0,1) == '%') || (substr($key,0,1) == '!')) { - $alias_record['path-aliases'][$key] = $value; - } - elseif (!empty($key)) { - $alias_record[$key] = $value; - } -} - -/** - * Looks up the specified alias record and calls through to - * drush_sitealias_set_alias_context, below. - * - * @param alias - * The name of the alias record - * @param prefix - * The prefix value to afix to the beginning of every - * key set. - * @return boolean - * TRUE is an alias was found and processed. - */ -function _drush_sitealias_set_context_by_name($alias, $prefix = '') { - if ($alias) { - $site_alias_settings = drush_sitealias_get_record($alias); - if (!empty($site_alias_settings)) { - drush_sitealias_set_alias_context($site_alias_settings, $prefix); - drush_sitealias_cache_alias_by_path($site_alias_settings); - if (empty($prefix)) { - - // Create an alias '@self' - // Allow 'uri' from the commandline to override - $drush_uri = drush_get_option(array('uri', 'l'), FALSE); - if ($drush_uri) { - $site_alias_settings['uri'] = $drush_uri; - } - - _drush_sitealias_cache_alias('@self', $site_alias_settings); - // Change the selected site to match the new --root and --uri, if any were set. - _drush_preflight_root_uri(); - } - return $site_alias_settings; - } - } - return array(); -} - -/** - * Given an alias record, overwrite its values with options - * from the command line and other drush contexts as specified - * by the provided prefix. For example, if the prefix is 'source-', - * then any option 'source-foo' will set the value 'foo' in the - * alias record. - */ -function drush_sitealias_overlay_options($site_alias_record, $prefix) { - return array_merge($site_alias_record, drush_get_merged_prefixed_options($prefix)); -} - -/** - * First return an option set via drush_sitealias_overlay_options, if - * any, then fall back on "%" . $option from the path aliases. - */ -function drush_sitealias_get_path_option($site_alias_record, $option, $default = NULL) { - if (isset($site_alias_record) && array_key_exists($option, $site_alias_record)) { - return $site_alias_record[$option]; - } - if (isset($site_alias_record) && array_key_exists('path-aliases', $site_alias_record) && array_key_exists("%$option", $site_alias_record['path-aliases'])) { - return $site_alias_record['path-aliases']["%$option"]; - } - else { - return drush_get_option($option, $default); - } -} - -/** - * Given a site alias record, copy selected fields from it - * into the drush 'alias' context. The 'alias' context has - * lower precedence than the 'cli' context, so values - * set by an alias record can be overridden by command-line - * parameters. - * - * @param site_alias_settings - * An alias record - * @param prefix - * The prefix value to affix to the beginning of every - * key set. For example, if this function is called once with - * 'source-' and again with 'destination-' prefixes, then the - * source database records will be stored in 'source-databases', - * and the destination database records will be in - * 'destination-databases'. - */ -function drush_sitealias_set_alias_context($site_alias_settings, $prefix = '') { - $options = drush_get_context('alias'); - - // There are some items that we should just skip - $skip_list = drush_get_special_keys(); - // If 'php-options' are set in the alias, then we will force drush - // to redispatch via the remote dispatch mechanism even if the target is localhost. - if ((array_key_exists('php-options', $site_alias_settings) || array_key_exists('php', $site_alias_settings)) && !drush_get_context('DRUSH_BACKEND', FALSE)) { - if (!array_key_exists('remote-host', $site_alias_settings)) { - $site_alias_settings['remote-host'] = 'localhost'; - } - } - // If 'php-options' are not set in the alias, then skip 'remote-host' - // and 'remote-user' if 'remote-host' is actually the local machine. - // This prevents drush from using the remote dispatch mechanism (the command - // is just run directly on the local machine, bootstrapping to the specified alias) - elseif (array_key_exists('remote-host', $site_alias_settings) && drush_is_local_host($site_alias_settings['remote-host'])) { - $skip_list[] = 'remote-host'; - $skip_list[] = 'remote-user'; - } - // If prefix is set, then copy from the 'prefix-' version - // of the drush special keys ('command-specific', 'path-aliases') - // into the ordinary version. This will allow us to set - // 'source-command-specific' options that will only apply when - // the alias is used as the source option for rsync or sql-sync. - if (!empty($prefix)) { - $special_contexts = drush_get_special_keys(); - foreach ($special_contexts as $option_name) { - if (array_key_exists($prefix . $option_name, $site_alias_settings)) { - $site_alias_settings[$option_name] = array_key_exists($option_name, $site_alias_settings) ? array_merge($site_alias_settings[$option_name], $site_alias_settings[$prefix . $option_name]) : $site_alias_settings[$prefix . $option_name]; - } - } - } - // Transfer all options from the site alias to the drush options - // in the 'alias' context. - foreach ($site_alias_settings as $key => $value) { - // Special handling for path aliases: - if ($key == "path-aliases") { - $path_aliases = $value; - foreach (array('%drush-script', '%dump', '%dump-dir', '%include') as $path_key) { - if (array_key_exists($path_key, $path_aliases)) { - // Evaluate the path value, and substitute any path references found. - // ex: '%dump-dir' => '%root/dumps' will store sql-dumps in the folder - // 'dumps' in the Drupal root folder for the site. - $evaluated_path = str_replace(array_keys($path_aliases), array_values($path_aliases), $path_aliases[$path_key]); - $options[$prefix . substr($path_key, 1)] = $evaluated_path; - } - } - } - // Special handling for command-specific - elseif ($key == "command-specific") { - $options[$key] = $value; - } - elseif (!in_array($key, $skip_list)) { - $options[$prefix . $key] = $value; - } - } - drush_set_config_options('alias', $options); -} - -/** - * Call prior to drush_sitealias_evaluate_path to insure - * that any site-specific aliases associated with any - * local site in $path are defined. - */ -function _drush_sitealias_preflight_path($path) { - $alias = NULL; - // Parse site aliases if there is a colon in the path - // We allow: - // @alias:/path - // machine.domain.com:/path - // machine:/path - // Note that paths in the form "c:/path" are converted to - // "/cygdrive/c/path" later; we do not want them to confuse - // us here, so we skip paths that start with a single character - // before the colon if we are running on Windows. Single-character - // machine names are allowed in Linux only. - $colon_pos = strpos($path, ':'); - if ($colon_pos > (drush_is_windows("LOCAL") ? 1 : 0)) { - $alias = substr($path, 0, $colon_pos); - $path = substr($path, $colon_pos + 1); - $site_alias_settings = drush_sitealias_get_record($alias); - if (empty($site_alias_settings) && (substr($path,0,1) == '@')) { - return NULL; - } - $machine = $alias; - } - else { - $machine = ''; - // if the path is a site alias or a local site... - $site_alias_settings = drush_sitealias_get_record($path); - if (empty($site_alias_settings) && (substr($path,0,1) == '@')) { - return NULL; - } - if (!empty($site_alias_settings) || drush_is_local_host($path)) { - $alias = $path; - $path = ''; - } - } - return array('alias' => $alias, 'path' => $path, 'machine' => $machine); -} - -/** - * Given a properly-escaped options string, replace any occurance of - * %files and so on embedded inside it with its corresponding path. - */ -function drush_sitealias_evaluate_paths_in_options($option_string) { - $path_aliases = _core_path_aliases(); - return str_replace(array_keys($path_aliases), array_values($path_aliases), $option_string); -} - -/** - * Evaluate a path from its shorthand form to a literal path - * usable by rsync. - * - * A path is "machine:/path" or "machine:path" or "/path" or "path". - * 'machine' might instead be an alias record, or the name - * of a site in the 'sites' folder. 'path' might be (or contain) - * '%root' or some other path alias. This function will examine - * all components of the path and evaluate them as necessary to - * come to the final path. - * - * @param path - * The path to evaluate - * @param additional_options - * An array of options that overrides whatever was passed in on - * the command line (like the 'process' context, but only for - * the scope of this one call). - * @param local_only - * If TRUE, force an error if the provided path points to a remote - * machine. - * @param os - * This should be the local system os, unless evaluate path is - * being called for rsync, in which case it should be "CWRSYNC" - * if cwrsync is being used, or "rsync" to automatically select - * between "LOCAL" and "CWRSYNC" based on the platform. - * @return - * The site record for the machine specified in the path, if any, - * with the path to pass to rsync (including the machine specifier) - * in the 'evaluated-path' item. - */ -function drush_sitealias_evaluate_path($path, &$additional_options, $local_only = FALSE, $os = NULL, $command_specific_prefix = '') { - $site_alias_settings = array(); - $path_aliases = array(); - $remote_user = ''; - - $preflight = _drush_sitealias_preflight_path($path); - if (!isset($preflight)) { - return NULL; - } - - $alias = $preflight['alias']; - $path = $preflight['path']; - $machine = $preflight['machine']; - - if (isset($alias)) { - // Note that the alias settings may have an 'os' component, but we do - // not want to use it here. The paths passed to rsync should always be - // escaped per the LOCAL rules, without regard to the remote platform type. - $site_alias_settings = drush_sitealias_get_record($alias); - if (!empty($command_specific_prefix)) { - drush_command_set_command_specific_options($command_specific_prefix); - drush_sitealias_command_default_options($site_alias_settings, $command_specific_prefix); - } - } - - if (!empty($site_alias_settings)) { - if ($local_only && array_key_exists('remote-host', $site_alias_settings)) { - return drush_set_error('DRUSH_REMOTE_SITE_IN_LOCAL_CONTEXT', dt("A remote site alias was used in a context where only a local alias is appropriate.")); - } - - // Apply any options from this alias that might affect our rsync - drush_sitealias_set_alias_context($site_alias_settings); - - // Use 'remote-host' from settings if available; otherwise site is local - if (drush_sitealias_is_remote_site($site_alias_settings)) { - $machine = drush_remote_host($site_alias_settings); - } - else { - $machine = ''; - } - } - else { - // Strip the machine portion of the path if the - // alias points to the local machine. - if (drush_is_local_host($machine)) { - $machine = ''; - } - else { - $machine = "$remote_user$machine"; - } - } - - // TOD: The code below is a little rube-goldberg-ish, and needs to be - // reworked. core-rsync will call this function twice: once to - // evaluate the destination, and then again to evaluate the source. Things - // get odd with --exclude-paths, especially in conjunction with command-specific - // and the --exclude-files option. @see testCommandSpecific() - - // If the --exclude-other-sites option is specified, then - // convert that into --include-paths='%site' and --exclude-sites. - if (drush_get_option_override($additional_options, 'exclude-other-sites', FALSE) && !drush_get_context('exclude-other-sites-processed', FALSE)) { - $include_path_option = drush_get_option_override($additional_options, 'include-paths', ''); - $additional_options['include-paths'] = '%site'; - if (!empty($include_path_option)) { - // We use PATH_SEPARATOR here because we are later going to explicitly explode() this variable using PATH_SEPARATOR. - $additional_options['include-paths'] .= PATH_SEPARATOR . $include_path_option; - } - $additional_options['exclude-sites'] = TRUE; - drush_set_context('exclude-other-sites-processed', TRUE); - } - else { - unset($additional_options['include-paths']); - } - // If the --exclude-files option is specified, then - // convert that into --exclude-paths='%files'. - if (drush_get_option_override($additional_options, 'exclude-files', FALSE) && !drush_get_option_override($additional_options, 'exclude-files-processed', FALSE, 'process')) { - $exclude_path_option = drush_get_option_override($additional_options, 'exclude-paths', ''); - $additional_options['exclude-paths'] = '%files'; - if (!empty($exclude_path_option)) { - // We use PATH_SEPARATOR here because we are later going to explicitly explode() this variable using PATH_SEPARATOR. - $additional_options['exclude-paths'] .= PATH_SEPARATOR . $exclude_path_option; - } - $additional_options['exclude-files-processed'] = TRUE; - } - else { - unset($additional_options['exclude-paths']); - } - - // If there was no site specification given, and the - // machine is local, then try to look - // up an alias record for the default drush site. - if (empty($site_alias_settings) && empty($machine)) { - $drush_uri = drush_get_context('DRUSH_SELECTED_URI', 'default'); - $site_alias_settings = drush_sitealias_get_record($drush_uri); - } - - // Always add transient defaults - _drush_sitealias_add_transient_defaults($site_alias_settings); - - // The $resolve_path variable is used by drush_sitealias_resolve_path_references - // to test to see if there are any path references such as %site or %files - // in it, so that resolution is only done if the path alias is referenced. - // Therefore, we can concatenate without worrying too much about the structure of - // this variable's contents. - $include_path = drush_get_option_override($additional_options, 'include-paths', ''); - $exclude_path = drush_get_option_override($additional_options, 'exclude-paths', ''); - if (is_array($include_path)) { - $include_path = implode('/', $include_path); - } - if (is_array($exclude_path)) { - $include_path = implode('/', $exclude_path); - } - $resolve_path = "$path/$include_path/$exclude_path"; - // Resolve path aliases such as %files, if any exist in the path - if (!empty($resolve_path)) { - drush_sitealias_resolve_path_references($site_alias_settings, $resolve_path); - } - - if (array_key_exists('path-aliases', $site_alias_settings)) { - $path_aliases = $site_alias_settings['path-aliases']; - } - - // Get the 'root' setting from the alias; if it does not - // exist, then get the root from the bootstrapped site. - if (array_key_exists('root', $site_alias_settings)) { - $drupal_root = $site_alias_settings['root']; - } - elseif (!drush_sitealias_is_remote_site($site_alias_settings)) { - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_SITE); - $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT'); - } - if (empty($drupal_root)) { - $drupal_root = ''; - } - else { - // Add a slash to the end of the drupal root, as below. - $drupal_root = drush_trim_path($drupal_root) . "/"; - } - $full_path_aliases = $path_aliases; - foreach ($full_path_aliases as $key => $value) { - // Expand all relative path aliases to be based off of the Drupal root - if (!drush_is_absolute_path($value, "LOCAL") && ($key != '%root')) { - $full_path_aliases[$key] = $drupal_root . $value; - } - // We do not want slashes on the end of our path aliases. - $full_path_aliases[$key] = drush_trim_path($full_path_aliases[$key]); - } - - // Fill in path aliases in the path, the include path and the exclude path. - $path = str_replace(array_keys($full_path_aliases), array_values($full_path_aliases), $path); - if (!empty($include_path)) { - drush_set_option('include-paths', str_replace(array_keys($path_aliases), array_values($path_aliases), $include_path)); - } - if (!empty($exclude_path)) { - drush_set_option('exclude-paths', str_replace(array_keys($path_aliases), array_values($path_aliases), $exclude_path)); - } - // Next make the rsync path, which includes the machine - // and path components together. - // First make empty paths or relative paths start from the drupal root. - if (empty($path) || (!drush_is_absolute_path($path, "LOCAL"))) { - $path = $drupal_root . $path; - } - // When calculating a path for use with rsync, we must correct - // absolute paths in the form c:\path when cwrsync is in use. - $path = drush_correct_absolute_path_for_exec($path, $os); - - // If there is a $machine component, to the path, then - // add it to the beginning - $evaluated_path = drush_escapeshellarg($path, $os); - if (!empty($machine)) { - $evaluated_path = $machine . ':' . $evaluated_path; - } - - // - // Add our result paths: - // - // evaluated-path: machine:/path - // server-component: machine - // path-component: :/path - // path: /path - // user-path: path (as specified in input parameter) - // - $site_alias_settings['evaluated-path'] = $evaluated_path; - if (!empty($machine)) { - $site_alias_settings['server-component'] = $machine; - } - $site_alias_settings['path-component'] = (!empty($path) ? ':' . $path : ''); - $site_alias_settings['path'] = $path; - $site_alias_settings['user-path'] = $preflight['path']; - - return $site_alias_settings; -} - -/** - * Option keys used for site selection. - */ -function drush_sitealias_site_selection_keys() { - return array('remote-host', 'remote-user', 'ssh-options', '#name', 'os'); -} - - -function sitealias_find_local_drupal_root($site_list) { - $drupal_root = NULL; - - foreach ($site_list as $site) { - if (($drupal_root == NULL) && (array_key_exists('root', $site) && !array_key_exists('remote-host', $site))) { - $drupal_root = $site['root']; - } - } - - return $drupal_root; -} - - -/** - * Helper function to obtain the keys' names that need special handling in certain - * cases. - * @return - * A non-associative array containing the needed keys' names. - */ -function drush_get_special_keys() { - $special_keys = array( - 'command-specific', - 'site-aliases', - ); - return $special_keys; -} - -/** - * Read the tmp file where the persistent site setting is stored. - * - * @return string - * A valid site specification. - */ -function drush_sitealias_site_get() { - if (($filename = drush_sitealias_get_envar_filename()) && file_exists($filename)) { - $site = file_get_contents($filename); - return $site; - } - else { - return FALSE; - } -} - -/** - * Un-set the currently use'd site alias. - */ -function drush_sitealias_site_clear() { - if ($filename = drush_sitealias_get_envar_filename()) { - return drush_delete_dir($filename); - } - return FALSE; -} - -/** - * Returns the filename for the file that stores the DRUPAL_SITE variable. - * - * @param string $filename_prefix - * An arbitrary string to prefix the filename with. - * - * @return string|false - * Returns the full path to temp file if possible, or FALSE if not. - */ -function drush_sitealias_get_envar_filename($filename_prefix = 'drush-drupal-site-') { - $shell_pid = getenv('DRUSH_SHELL_PID'); - if (!$shell_pid && function_exists('posix_getppid')) { - $shell_pid = posix_getppid(); - } - if (!$shell_pid) { - return FALSE; - } - - $tmp = getenv('TMPDIR') ? getenv('TMPDIR') : '/tmp'; - $username = drush_get_username(); - - return "{$tmp}/drush-env-{$username}/{$filename_prefix}" . $shell_pid; -} - -/** - * Cache the specified alias in the alias path cache. The - * alias path cache creates a lookup from the site folder - * (/path/to/drupal/sites/default) to the provided alias record. - * - * Only the name of the alias and the path to the file it - * is stored in is cached; when it is retrieved, it is - * loaded directly from the correct file. - */ -function drush_sitealias_cache_alias_by_path($alias_record) { - if (!isset($alias_record['remote-host']) && isset($alias_record['root']) && isset($alias_record['uri']) && isset($alias_record['#name']) && isset($alias_record['#file'])) { - $path = drush_sitealias_local_site_path($alias_record); - if ($path) { - $cid = drush_get_cid('alias-path-', array(), array($path)); - $alias_path_data = array( - '#name' => $alias_record['#name'], - '#file' => $alias_record['#file'], - ); - drush_cache_set($cid, $alias_path_data); - } - } -} - -/** - * Look for a defined alias that points to the specified - * site directory. The cache is tested first; if nothing - * is cached, then an exhaustive search is done for the - * specified site. If the exhaustive search returns a - * match, then it is cached. - * - * @param $path - * /path/to/drupal/sites/default - * @return - * An alias record for the provided path - */ -function drush_sitealias_lookup_alias_by_path($path, $allow_best_match=FALSE) { - $result = drush_sitealias_quick_lookup_cached_alias_by_path($path); - $fallback = array(); - if (empty($result)) { - $aliases = _drush_sitealias_find_and_load_all_aliases(); - foreach ($aliases as $name => $alias_record) { - if (!isset($alias_record['remote-host']) && isset($alias_record['root']) && isset($alias_record['uri']) && isset($alias_record['#name']) && isset($alias_record['#file'])) { - if ($path == drush_sitealias_local_site_path($alias_record)) { - $result = $alias_record; - break; - } - if (substr($path, 0, strlen($alias_record['root'])) == $alias_record['root']) { - $fallback = $alias_record; - } - } - } - } - if (empty($result) && $allow_best_match) { - $result = $fallback; - } - if (!empty($result)) { - _drush_sitealias_add_inherited_values_to_record($result); - drush_sitealias_cache_alias_by_path($result); - } - return $result; -} - -/** - * Look for a cached alias that points to the specified - * site directory. Nothing is returned if there is no - * matching cached alias. - * - * @param $path - * /path/to/drupal/sites/default - * @return - * An alias record for the provided path - */ -function drush_sitealias_quick_lookup_cached_alias_by_path($path) { - $alias_record = array(); - $cid = drush_get_cid('alias-path-', array(), array($path)); - $alias_path_cache = drush_cache_get($cid); - if (isset($alias_path_cache->data)) { - $alias_name = $alias_path_cache->data['#name']; - $alias_file = $alias_path_cache->data['#file']; - - $alias_record = _drush_sitealias_find_and_load_alias_from_file($alias_name, array($alias_file)); - _drush_sitealias_add_inherited_values_to_record($alias_record); - $alias_record['#name'] = $alias_name; - } - return $alias_record; -} - -/** - * Return the site root, if there is one in the record. - */ -function drush_sitealias_get_root($alias_record) { - return array_key_exists('root', $alias_record) ? $alias_record['root'] : NULL; -} - -/** - * Decide on which side to run a core-rsync. - * - * @param $source - * @param $destination - * @param $runner Where to run the rsync operation: 'destination', 'source', - * 'auto' ('destination' if both are remote, otherwise '@self') or FALSE (@self) - * @return mixed - */ -function drush_get_runner($source, $destination, $runner = FALSE) { - if (is_string($source)) { - $source = drush_sitealias_get_record($site); - } - if (is_string($destination)) { - $destination = drush_sitealias_get_record($destination); - } - - // If both sites are remote, and --runner=auto, then we'll use the destination site. - if (drush_sitealias_is_remote_site($source) && drush_sitealias_is_remote_site($destination)) { - if ($runner == 'auto') { - $runner = 'destination'; - } - } - - // If the user explicitly requests a remote site, then return the selected one. - if ($runner == 'destination') { - return "@" . $destination['#name']; - } - if ($runner == 'source') { - return "@" . $source['#name']; - } - - // Default to running rsync locally. When in doubt, local is best, because - // we can always resolve aliases here. - return '@self'; -} diff --git a/vendor/drush/drush/includes/startup.inc b/vendor/drush/drush/includes/startup.inc deleted file mode 100644 index 5daedead9296a63e39784efc0a59829c1695ffa0..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/includes/startup.inc +++ /dev/null @@ -1,466 +0,0 @@ -<?php - -/** - * @file - * Functions used when Drush is starting up. - * - * This file is included and used early in the Drush - * startup process, before any other Drush APIs are - * available, and before the autoloader has been included. - */ - -/** - * Get the current enviornment. - */ -function drush_env() { - // Fetch the current environment. To ensure that - // $_ENV is correctly populated, make sure that - // the value of 'variables-order' in your php.ini - // contains "E" ("Environment"). See: - // http://us.php.net/manual/en/ini.core.php#ini.variables-order - $env = $_ENV; - - // If PHP is not configured correctly, $_ENV will be - // empty. Drush counts on the fact that environment - // variables will always be available, though, so we - // need to repair this situation. We can always access - // individual environmnet values via getenv(); however, - // there is no PHP API that will tell us all of the - // available values, so we will get the environment - // variable values using 'printenv'. - if (empty($env)) { - exec('printenv', $env_items); - foreach ($env_items as $item) { - // Each $item is 'key=value' or just 'key'. - // If $item has no value, then explode will return - // a single array, [0 => 'key']. We add a default - // value of [1 => 'value'] to cover this case. If - // explode returns two items, the default value is ignored. - list($key, $value) = explode('=', $item, 2) + array(1 => ''); - $env[$key] = $value; - } - } - - return $env; -} - -/** - * Checks the provided location and return the appropriate - * Drush wrapper or Drush launcher script, if found. - * - * If the provided location looks like it might be a web - * root (i.e., it contains an index.php), then we will search - * in a number of locations in the general vicinity of the - * web root for a Drush executable. - * - * For other locations, we will look only in that specific - * directory, or in vendor/bin. - */ -function find_wrapper_or_launcher($location) { - if (file_exists($location. DIRECTORY_SEPARATOR. 'index.php')) { - return find_wrapper_or_launcher_in_vicinity($location); - } - return find_wrapper_or_launcher_in_specific_locations($location, ["", 'vendor'. DIRECTORY_SEPARATOR. 'bin']); -} - -/** - * We look for a "Drush wrapper" script that might - * be stored in the root of a site. If there is - * no wrapper script, then we look for the - * drush.launcher script in vendor/bin. We try just a - * few of the most common locations; if the user relocates - * their vendor directory anywhere else, then they must - * use a wrapper script to locate it. See the comment in - * 'examples/drush' for details. - */ -function find_wrapper_or_launcher_in_vicinity($location) { - $sep = DIRECTORY_SEPARATOR; - $drush_locations = [ - "", - "vendor{$sep}bin/", - "..{$sep}vendor{$sep}bin{$sep}", - "sites{$sep}all{$sep}vendor{$sep}bin{$sep}", - "sites{$sep}all{$sep}vendor{$sep}drush{$sep}drush{$sep}", - "sites{$sep}all{$sep}drush{$sep}drush{$sep}", - "drush{$sep}drush{$sep}", - ]; - - return find_wrapper_or_launcher_in_specific_locations($location, $drush_locations); -} - -function find_wrapper_or_launcher_in_specific_locations($location, $drush_locations) { - $sep = DIRECTORY_SEPARATOR; - foreach ($drush_locations as $d) { - $found_script = find_wrapper_or_launcher_at_location("$location$sep$d"); - if (!empty($found_script)) { - return $found_script; - } - } - return ""; -} - -/** - * We are somewhat "loose" about whether we are looking - * for "drush" or "drush.launcher", because in old versions - * of Drush, the "drush launcher" was named "drush". - * Otherwise, there wouldn't be any point in looking for - * "drush.launcher" at the root, or "drush" in a vendor directory. - * We also allow users to rename their drush wrapper to - * 'drush.wrapper' to avoid conflicting with a directory named - * 'drush' at the site root. - */ -function find_wrapper_or_launcher_at_location($location) { - $sep = DIRECTORY_SEPARATOR; - // Sanity-check: empty $location means that we should search - // at the cwd, not at the root of the filesystem. - if (empty($location)) { - $location = "."; - } - foreach (array('.launcher', '.wrapper', '') as $suffix) { - $check_location = "$location{$sep}drush$suffix"; - if (is_file($check_location)) { - return $check_location; - } - } - return ""; -} - -/** - * Determine whether current OS is a Windows variant. - */ -function drush_is_windows($os = NULL) { - // The _drush_get_os() function may not be available, so resolve "LOCAL" - if (!$os || $os == "LOCAL") { - $os = PHP_OS; - } - return strtoupper(substr($os, 0, 3)) === 'WIN'; -} - -function drush_escapeshellarg($arg, $os = NULL, $raw = FALSE) { - // Short-circuit escaping for simple params (keep stuff readable) - if (preg_match('|^[a-zA-Z0-9.:/_-]*$|', $arg)) { - return $arg; - } - elseif (drush_is_windows($os)) { - return _drush_escapeshellarg_windows($arg, $raw); - } - else { - return _drush_escapeshellarg_linux($arg, $raw); - } -} - -/** - * Linux version of escapeshellarg(). - * - * This is intended to work the same way that escapeshellarg() does on - * Linux. If we need to escape a string that will be used remotely on - * a Linux system, then we need our own implementation of escapeshellarg, - * because the Windows version behaves differently. - */ -function _drush_escapeshellarg_linux($arg, $raw = FALSE) { - // For single quotes existing in the string, we will "exit" - // single-quote mode, add a \' and then "re-enter" - // single-quote mode. The result of this is that - // 'quote' becomes '\''quote'\'' - $arg = preg_replace('/\'/', '\'\\\'\'', $arg); - - // Replace "\t", "\n", "\r", "\0", "\x0B" with a whitespace. - // Note that this replacement makes Drush's escapeshellarg work differently - // than the built-in escapeshellarg in PHP on Linux, as these characters - // usually are NOT replaced. However, this was done deliberately to be more - // conservative when running _drush_escapeshellarg_linux on Windows - // (this can happen when generating a command to run on a remote Linux server.) - $arg = str_replace(array("\t", "\n", "\r", "\0", "\x0B"), ' ', $arg); - - // Only wrap with quotes when needed. - if(!$raw) { - // Add surrounding quotes. - $arg = "'" . $arg . "'"; - } - - return $arg; -} - -/** - * Windows version of escapeshellarg(). - */ -function _drush_escapeshellarg_windows($arg, $raw = FALSE) { - // Double up existing backslashes - $arg = preg_replace('/\\\/', '\\\\\\\\', $arg); - - // Double up double quotes - $arg = preg_replace('/"/', '""', $arg); - - // Double up percents. - // $arg = preg_replace('/%/', '%%', $arg); - - // Only wrap with quotes when needed. - if(!$raw) { - // Add surrounding quotes. - $arg = '"' . $arg . '"'; - } - - return $arg; -} - -/** - * drush_startup is called once, by the Drush "finder" - * script -- the "drush" script at the Drush root. - * It finds the correct Drush "wrapper" or "launcher" - * script to use, and executes it with process replacement. - */ -function drush_startup($argv) { - $sep = DIRECTORY_SEPARATOR; - $found_script = ""; - $cwd = getcwd(); - $home = getenv("HOME"); - $use_dir = "$home{$sep}.drush{$sep}use"; - - // Get the arguments for the command. Shift off argv[0], - // which contains the name of this script. - $arguments = $argv; - array_shift($arguments); - - // We need to do at least a partial parsing of the options, - // so that we can find --root / -r and so on. - $VERBOSE=FALSE; - $DEBUG=FALSE; - $ROOT=FALSE; - $COMMAND=FALSE; - $ALIAS=FALSE; - $VAR=FALSE; - - foreach ($arguments as $arg) { - // If a variable to set was indicated on the - // previous iteration, then set the value of - // the named variable (e.g. "ROOT") to "$arg". - if ($VAR) { - $$VAR = "$arg"; - $VAR = FALSE; - } - else { - switch ($arg) { - case "-r": - $VAR = "ROOT"; - break; - - case "-dv": - case "-vd": - case "--debug": - case "-d": - $DEBUG = TRUE; - break; - - case "-dv": - case "-vd": - case "--verbose": - case "-v": - $VERBOSE = TRUE; - break; - } - if (!$COMMAND && !$ALIAS && ($arg[0] == '@')) { - $ALIAS = $arg; - } - elseif (!$COMMAND && ($arg[0] != '-')) { - $COMMAND = $arg; - } - if (substr($arg, 0, 7) == "--root=") { - $ROOT = substr($arg, 7); - } - } - } - - $NONE=($ALIAS == "@none"); - - // If we have found the site-local Drush script, then - // do not search for it again; use the environment value - // we set last time. - $found_script = getenv('DRUSH_FINDER_SCRIPT'); - - // If the @none alias is used, then we skip the Drush wrapper, - // and call the Drush launcher directly. - // - // In this instance, we are assuming that the 'drush' that is being - // called is: - // - // a) The global 'drush', or - // b) A site-local 'drush' in a vendor/bin directory. - // - // In either event, the appropriate 'drush.launcher' should be right next - // to this script (stored in the same directory). - if (empty($found_script) && $NONE) { - if (is_file(dirname(__DIR__) . "{$sep}drush.launcher")) { - $found_script = dirname(__DIR__) . "{$sep}drush.launcher"; - } - else { - fwrite(STDERR, "Could not find drush.launcher in " . dirname(__DIR__) . ". Check your installation.\n"); - exit(1); - } - } - - // Check for a root option: - // - // drush --root=/path - // - // If the site root is specified via a commandline option, then we - // should always use the Drush stored at this root, if there is one. - // We will first check for a "wrapper" script at the root, and then - // we will look for a "launcher" script in vendor/bin. - if (empty($found_script) && !empty($ROOT)) { - $found_script = find_wrapper_or_launcher($ROOT); - if (!empty($found_script)) { - chdir($ROOT); - } - } - - // If there is a .drush-use file, then its contents will - // contain the path to the Drush to use. - if (empty($found_script)) { - if (is_file(".drush-use")) { - $found_script = trim(file_get_contents(".drush-use")); - } - } - - // Look for a 'drush' wrapper or launcher at the cwd, - // and in each of the directories above the cwd. If - // we find one, use it. - if (empty($found_script)) { - $c = getcwd(); - // Windows can give us lots of different strings to represent the root - // directory as it often includes the drive letter. If we get the same - // result from dirname() twice in a row, then we know we're at the root. - $last = ''; - while (!empty($c) && ($c != $last)) { - $found_script = find_wrapper_or_launcher($c); - if ($found_script) { - chdir($c); - break; - } - $last = $c; - $c = dirname($c); - } - } - - if (!empty($found_script)) { - $found_script = realpath($found_script); - - // Guard against errors: if we have found a "drush" script - // (that is, theoretically a drush wrapper script), and - // there is a "drush.launcher" script in the same directory, - // then we will skip the "drush" script and use the drush launcher - // instead. This is because drush "wrapper" scripts should - // only ever exist at the root of a site, and there should - // never be a drush "launcher" at the root of a site. - // Therefore, if we find a "drush.launcher" next to a script - // called "drush", we have probably found a Drush install directory, - // not a site root. Adjust appropriately. Note that this - // also catches the case where a drush "finder" script finds itself. - if (is_file(dirname($found_script) . "{$sep}drush.launcher")) { - $found_script = dirname($found_script) . "{$sep}drush.launcher"; - } - } - - // Didn't find any site-local Drush, or @use'd Drush. - // Skip the Bash niceties of the launcher and proceed to drush_main() in either case: - // - No script was found and we are running a Phar - // - The found script *is* the Phar https://github.com/drush-ops/drush/pull/2246. - $phar_path = class_exists('Phar') ? Phar::running(FALSE) : ''; - if ((empty($found_script) && $phar_path) || !empty($found_script) && $found_script == $phar_path) { - drush_run_main($DEBUG, $sep, "Phar detected. Proceeding to drush_main()."); - } - - // Didn't find any site-local Drush, or @use'd Drush, or Phar. - // There should be a drush.launcher in same directory as this script. - if (empty($found_script)) { - $found_script = dirname(__DIR__) . "{$sep}drush.launcher"; - } - - if (drush_is_windows()) { - // Sometimes we found launcher in /bin, and sometimes not. Adjust accordingly. - if (strpos($found_script, 'bin')) { - $found_script = dirname($found_script). $sep. 'drush.php.bat'; - } - else { - array_unshift($arguments, dirname($found_script). $sep. 'drush.php'); - $found_script = 'php'; - } - } - - // Always use pcntl_exec if it exists. - $use_pcntl_exec = function_exists("pcntl_exec") && (strpos(ini_get('disable_functions'), 'pcntl_exec') === FALSE); - - // If we have posix_getppid, then pass in the shell pid so - // that 'site-set' et. al. can work correctly. - if (function_exists('posix_getppid')) { - putenv("DRUSH_SHELL_PID=" . posix_getppid()); - } - - // Set an environment variable indicating which script - // the Drush finder found. If we end up re-entrantly calling - // another Drush finder, then we will skip searching for - // a site-local Drush, and always use the drush.launcher - // found previously. This environment variable typically should - // not be set by clients. - putenv("DRUSH_FINDER_SCRIPT=$found_script"); - - // Emit a message in debug mode advertising the location of the - // script we found. - if ($DEBUG) { - $launch_method = $use_pcntl_exec ? 'pcntl_exec' : 'proc_open'; - fwrite(STDERR, "Using the Drush script found at $found_script using $launch_method\n"); - } - - if ($use_pcntl_exec) { - // Get the current environment for pnctl_exec. - $env = drush_env(); - - // Make sure Drush can locates original working directory. https://github.com/drush-ops/drush/issues/2285 - chdir($cwd); - - // Launch the new script in the same process. - // If the launch succeeds, then it will not return. - $error = pcntl_exec($found_script, $arguments, $env); - if (!$error) { - $errno = pcntl_get_last_error(); - $strerror = pcntl_strerror($errno); - fwrite(STDERR, "Error has occurred executing the Drush script found at $found_script\n"); - fwrite(STDERR, "(errno {$errno}) $strerror\n"); - } - exit(1); - } - else { - $escaped_args = array_map(function($item) { return drush_escapeshellarg($item); }, $arguments); - // Double quotes around $found_script as it can contain spaces. - $cmd = drush_escapeshellarg($found_script). ' '. implode(' ', $escaped_args); - if (drush_is_windows()) { - // Windows requires double quotes around whole command. - // @see https://bugs.php.net/bug.php?id=49139 - // @see https://bugs.php.net/bug.php?id=60181 - $cmd = '"'. $cmd. '"'; - } - $process = proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes, $cwd); - $proc_status = proc_get_status($process); - $exit_code = proc_close($process); - exit($proc_status["running"] ? $exit_code : $proc_status["exitcode"] ); - } -} - -/** - * Run drush_main() and then exit. Used when we cannot hand over execution to - * the launcher. - * - * @param bool $DEBUG - * Are we in debug mode - * @param string $sep - * Directory separator - * @param string $msg - * Debug message to log before running drush_main() - */ -function drush_run_main($DEBUG, $sep, $msg) { -// Emit a message in debug mode advertising how we proceeded. - if ($DEBUG) { - fwrite(STDERR, $msg. "\n"); - } - require __DIR__ . "{$sep}preflight.inc"; - exit(drush_main()); -} diff --git a/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php b/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php deleted file mode 100644 index c816988c45406b1e338d65dcd3fa5fbe401ef35b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -namespace Drush\Boot; - -use Drush\Log\LogLevel; - -abstract class BaseBoot implements Boot { - - function __construct() { - } - - function valid_root($path) { - } - - function get_version($root) { - } - - function command_defaults() { - } - - function enforce_requirement(&$command) { - drush_enforce_requirement_bootstrap_phase($command); - drush_enforce_requirement_core($command); - drush_enforce_requirement_drush_dependencies($command); - } - - function report_command_error($command) { - // Set errors related to this command. - $args = implode(' ', drush_get_arguments()); - if (isset($command) && is_array($command)) { - foreach ($command['bootstrap_errors'] as $key => $error) { - drush_set_error($key, $error); - } - drush_set_error('DRUSH_COMMAND_NOT_EXECUTABLE', dt("The drush command '!args' could not be executed.", array('!args' => $args))); - } - elseif (!empty($args)) { - drush_set_error('DRUSH_COMMAND_NOT_FOUND', dt("The drush command '!args' could not be found. Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.", array('!args' => $args))); - } - // Set errors that occurred in the bootstrap phases. - $errors = drush_get_context('DRUSH_BOOTSTRAP_ERRORS', array()); - foreach ($errors as $code => $message) { - drush_set_error($code, $message); - } - } - - function bootstrap_and_dispatch() { - $phases = $this->bootstrap_init_phases(); - - $return = ''; - $command_found = FALSE; - _drush_bootstrap_output_prepare(); - foreach ($phases as $phase) { - if (drush_bootstrap_to_phase($phase)) { - $command = drush_parse_command(); - if (is_array($command)) { - $command += $this->command_defaults(); - // Insure that we have bootstrapped to a high enough - // phase for the command prior to enforcing requirements. - $bootstrap_result = drush_bootstrap_to_phase($command['bootstrap']); - $this->enforce_requirement($command); - - if ($bootstrap_result && empty($command['bootstrap_errors'])) { - drush_log(dt("Found command: !command (commandfile=!commandfile)", array('!command' => $command['command'], '!commandfile' => $command['commandfile'])), LogLevel::BOOTSTRAP); - - $command_found = TRUE; - // Dispatch the command(s). - $return = drush_dispatch($command); - - // Prevent a '1' at the end of the output. - if ($return === TRUE) { - $return = ''; - } - - if (drush_get_context('DRUSH_DEBUG') && !drush_get_context('DRUSH_QUIET')) { - // @todo Create version independant wrapper around Drupal timers. Use it. - drush_print_timers(); - } - break; - } - } - } - else { - break; - } - } - - if (!$command_found) { - // If we reach this point, command doesn't fit requirements or we have not - // found either a valid or matching command. - $this->report_command_error($command); - } - return $return; - } - - /** - * {@inheritdoc} - */ - public function terminate() { - } -} diff --git a/vendor/drush/drush/lib/Drush/Boot/Boot.php b/vendor/drush/drush/lib/Drush/Boot/Boot.php deleted file mode 100644 index 9bad8e7ade373a9a3feacbd7119db54daf8922a9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Boot/Boot.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php - -namespace Drush\Boot; - -/** - * Defines the interface for a Boot classes. Any CMS that wishes - * to work with Drush should extend BaseBoot. If the CMS has a - * Drupal-Compatibility layer, then it should extend DrupalBoot. - * - * @todo Doc these methods. - */ -interface Boot { - /** - * This function determines if the specified path points to - * the root directory of a CMS that can be bootstrapped by - * the specific subclass that implements it. - * - * These functions should be written such that one and only - * one class will return TRUE for any given $path. - * - * @param $path to a directory to test - * - * @return TRUE if $path is a valid root directory - */ - function valid_root($path); - - - /** - * Given a site root directory, determine the exact version of the software. - * - * @param string $root - * The full path to the site installation, with no trailing slash. - * @return string|NULL - * The version string for the current version of the software, e.g. 8.1.3 - */ - function get_version($root); - - /** - * Main entrypoint to bootstrap the selected CMS and - * execute the selected command. - * - * The implementation provided in BaseBoot should be - * sufficient; this method usually will not need to - * be overridden. - */ - function bootstrap_and_dispatch(); - - /** - * Returns an array that determines what bootstrap phases - * are necessary to bootstrap this CMS. This array - * should map from a numeric phase to the name of a method - * (string) in the Boot class that handles the bootstrap - * phase. - * - * @see \Drush\Boot\DrupalBoot::bootstrap_phases() - * - * @return array of PHASE index => method name. - */ - function bootstrap_phases(); - - /** - * List of bootstrap phases where Drush should stop and look for commandfiles. - * - * This allows us to bootstrap to a minimum neccesary to find commands. - * - * Once a command is found, Drush will ensure a bootstrap to the phase - * declared by the command. - * - * @return array of PHASE indexes. - */ - function bootstrap_init_phases(); - - /** - * Return an array of default values that should be added - * to every command (e.g. values needed in enforce_requirements(), - * etc.) - */ - function command_defaults(); - - /** - * Called by Drush when a command is selected, but - * before it runs. This gives the Boot class an - * opportunity to determine if any minimum - * requirements (e.g. minimum Drupal version) declared - * in the command have been met. - * - * @return TRUE if command is valid. $command['bootstrap_errors'] - * should be populated with an array of error messages if - * the command is not valid. - */ - function enforce_requirement(&$command); - - /** - * Called by Drush if a command is not found, or if the - * command was found, but did not meet requirements. - * - * The implementation in BaseBoot should be sufficient - * for most cases, so this method typically will not need - * to be overridden. - */ - function report_command_error($command); - - /** - * This method is called during the shutdown of drush. - * - * @return void - */ - public function terminate(); -} diff --git a/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php b/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php deleted file mode 100644 index e30ad0f6a226e17f39df1a833db96ffc035c7a5b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php +++ /dev/null @@ -1,576 +0,0 @@ -<?php - -namespace Drush\Boot; - -use Drush\Log\LogLevel; - -abstract class DrupalBoot extends BaseBoot { - - function __construct() { - } - - function valid_root($path) { - } - - function get_version($drupal_root) { - } - - function get_profile() { - } - - function conf_path($require_settings = TRUE, $reset = FALSE) { - return conf_path($require_settings = TRUE, $reset = FALSE); - } - - /** - * Bootstrap phases used with Drupal: - * - * DRUSH_BOOTSTRAP_DRUSH = Only Drush. - * DRUSH_BOOTSTRAP_DRUPAL_ROOT = Find a valid Drupal root. - * DRUSH_BOOTSTRAP_DRUPAL_SITE = Find a valid Drupal site. - * DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION = Load the site's settings. - * DRUSH_BOOTSTRAP_DRUPAL_DATABASE = Initialize the database. - * DRUSH_BOOTSTRAP_DRUPAL_FULL = Initialize Drupal fully. - * DRUSH_BOOTSTRAP_DRUPAL_LOGIN = Log into Drupal with a valid user. - * - * The value is the name of the method of the Boot class to - * execute when bootstrapping. Prior to bootstrapping, a "validate" - * method is called, if defined. The validate method name is the - * bootstrap method name with "_validate" appended. - */ - function bootstrap_phases() { - return array( - DRUSH_BOOTSTRAP_DRUSH => 'bootstrap_drush', - DRUSH_BOOTSTRAP_DRUPAL_ROOT => 'bootstrap_drupal_root', - DRUSH_BOOTSTRAP_DRUPAL_SITE => 'bootstrap_drupal_site', - DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION => 'bootstrap_drupal_configuration', - DRUSH_BOOTSTRAP_DRUPAL_DATABASE => 'bootstrap_drupal_database', - DRUSH_BOOTSTRAP_DRUPAL_FULL => 'bootstrap_drupal_full', - DRUSH_BOOTSTRAP_DRUPAL_LOGIN => 'bootstrap_drupal_login'); - } - - /** - * List of bootstrap phases where Drush should stop and look for commandfiles. - * - * For Drupal, we try at these bootstrap phases: - * - * - Drush preflight: to find commandfiles in any system location, - * out of a Drupal installation. - * - Drupal root: to find commandfiles based on Drupal core version. - * - Drupal full: to find commandfiles defined within a Drupal directory. - * - * Once a command is found, Drush will ensure a bootstrap to the phase - * declared by the command. - * - * @return array of PHASE indexes. - */ - function bootstrap_init_phases() { - return array(DRUSH_BOOTSTRAP_DRUSH, DRUSH_BOOTSTRAP_DRUPAL_ROOT, DRUSH_BOOTSTRAP_DRUPAL_FULL); - } - - function enforce_requirement(&$command) { - parent::enforce_requirement($command); - $this->drush_enforce_requirement_drupal_dependencies($command); - } - - function report_command_error($command) { - // If we reach this point, command doesn't fit requirements or we have not - // found either a valid or matching command. - - // If no command was found check if it belongs to a disabled module. - if (!$command) { - $command = $this->drush_command_belongs_to_disabled_module(); - } - parent::report_command_error($command); - } - - function command_defaults() { - return array( - 'drupal dependencies' => array(), - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN, - ); - } - - /** - * @return array of strings - paths to directories where contrib - * modules can be found - */ - abstract function contrib_modules_paths(); - - /** - * @return array of strings - paths to directories where contrib - * themes can be found - */ - abstract function contrib_themes_paths(); - - function commandfile_searchpaths($phase, $phase_max = FALSE) { - if (!$phase_max) { - $phase_max = $phase; - } - - $searchpath = array(); - switch ($phase) { - case DRUSH_BOOTSTRAP_DRUPAL_ROOT: - $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - $searchpath[] = $drupal_root . '/../drush'; - $searchpath[] = $drupal_root . '/drush'; - $searchpath[] = $drupal_root . '/sites/all/drush'; - break; - case DRUSH_BOOTSTRAP_DRUPAL_SITE: - // If we are going to stop bootstrapping at the site, then - // we will quickly add all commandfiles that we can find for - // any extension associated with the site, whether it is enabled - // or not. If we are, however, going to continue on to bootstrap - // all the way to DRUSH_BOOTSTRAP_DRUPAL_FULL, then we will - // instead wait for that phase, which will more carefully add - // only those Drush commandfiles that are associated with - // enabled modules. - if ($phase_max < DRUSH_BOOTSTRAP_DRUPAL_FULL) { - $searchpath = array_merge($searchpath, $this->contrib_modules_paths()); - - // Adding commandfiles located within /profiles. Try to limit to one profile for speed. Note - // that Drupal allows enabling modules from a non-active profile so this logic is kinda dodgy. - $cid = drush_cid_install_profile(); - if ($cached = drush_cache_get($cid)) { - $profile = $cached->data; - $searchpath[] = "profiles/$profile/modules"; - $searchpath[] = "profiles/$profile/themes"; - } - else { - // If install_profile is not available, scan all profiles. - $searchpath[] = "profiles"; - $searchpath[] = "sites/all/profiles"; - } - - $searchpath = array_merge($searchpath, $this->contrib_themes_paths()); - } - break; - case DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION: - // Nothing to do here anymore. Left for documentation. - break; - case DRUSH_BOOTSTRAP_DRUPAL_FULL: - // Add enabled module paths, excluding the install profile. Since we are bootstrapped, - // we can use the Drupal API. - $ignored_modules = drush_get_option_list('ignored-modules', array()); - $cid = drush_cid_install_profile(); - if ($cached = drush_cache_get($cid)) { - $ignored_modules[] = $cached->data; - } - foreach (array_diff(drush_module_list(), $ignored_modules) as $module) { - $filepath = drupal_get_path('module', $module); - if ($filepath && $filepath != '/') { - $searchpath[] = $filepath; - } - } - - // Check all enabled themes including non-default and non-admin. - foreach (drush_theme_list() as $key => $value) { - $searchpath[] = drupal_get_path('theme', $key); - } - break; - } - - return $searchpath; - } - - /** - * Check if the given command belongs to a disabled module. - * - * @return array - * Array with a command-like bootstrap error or FALSE if Drupal was not - * bootstrapped fully or the command does not belong to a disabled module. - */ - function drush_command_belongs_to_disabled_module() { - if (drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - _drush_find_commandfiles(DRUSH_BOOTSTRAP_DRUPAL_SITE, DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION); - drush_get_commands(TRUE); - $commands = drush_get_commands(); - $arguments = drush_get_arguments(); - $command_name = array_shift($arguments); - if (isset($commands[$command_name])) { - // We found it. Load its module name and set an error. - if (is_array($commands[$command_name]['drupal dependencies']) && count($commands[$command_name]['drupal dependencies'])) { - $modules = implode(', ', $commands[$command_name]['drupal dependencies']); - } - else { - // The command does not define Drupal dependencies. Derive them. - $command_files = commandfiles_cache()->get(); - $command_path = $commands[$command_name]['path'] . DIRECTORY_SEPARATOR . $commands[$command_name]['commandfile'] . '.drush.inc'; - $modules = array_search($command_path, $command_files); - } - return array( - 'bootstrap_errors' => array( - 'DRUSH_COMMAND_DEPENDENCY_ERROR' => dt('Command !command needs the following extension(s) enabled to run: !dependencies.', array( - '!command' => $command_name, - '!dependencies' => $modules, - )), - ), - ); - } - } - - return FALSE; - } - - /** - * Check that a command has its declared dependencies available or have no - * dependencies. - * - * @param $command - * Command to check. Any errors will be added to the 'bootstrap_errors' element. - * - * @return - * TRUE if command is valid. - */ - function drush_enforce_requirement_drupal_dependencies(&$command) { - // If the command bootstrap is DRUSH_BOOTSTRAP_MAX, then we will - // allow the requirements to pass if we have not successfully - // bootstrapped Drupal. The combination of DRUSH_BOOTSTRAP_MAX - // and 'drupal dependencies' indicates that the drush command - // will use the dependent modules only if they are available. - if ($command['bootstrap'] == DRUSH_BOOTSTRAP_MAX) { - // If we have not bootstrapped, then let the dependencies pass; - // if we have bootstrapped, then enforce them. - if (drush_get_context('DRUSH_BOOTSTRAP_PHASE') < DRUSH_BOOTSTRAP_DRUPAL_FULL) { - return TRUE; - } - } - // If there are no drupal dependencies, then do nothing - if (!empty($command['drupal dependencies'])) { - foreach ($command['drupal dependencies'] as $dependency) { - drush_include_engine('drupal', 'environment'); - if(!drush_module_exists($dependency)) { - $command['bootstrap_errors']['DRUSH_COMMAND_DEPENDENCY_ERROR'] = dt('Command !command needs the following modules installed/enabled to run: !dependencies.', array('!command' => $command['command'], '!dependencies' => implode(', ', $command['drupal dependencies']))); - return FALSE; - } - } - } - return TRUE; - } - - /** - * Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase. - * - * In this function, we will check if a valid Drupal directory is available. - * We also determine the value that will be stored in the DRUSH_DRUPAL_ROOT - * context and DRUPAL_ROOT constant if it is considered a valid option. - */ - function bootstrap_drupal_root_validate() { - $drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT'); - - if (empty($drupal_root)) { - return drush_bootstrap_error('DRUSH_NO_DRUPAL_ROOT', dt("A Drupal installation directory could not be found")); - } - if (!$signature = drush_valid_root($drupal_root)) { - return drush_bootstrap_error('DRUSH_INVALID_DRUPAL_ROOT', dt("The directory !drupal_root does not contain a valid Drupal installation", array('!drupal_root' => $drupal_root))); - } - - $version = drush_drupal_version($drupal_root); - $major_version = drush_drupal_major_version($drupal_root); - if ($major_version <= 5) { - return drush_set_error('DRUSH_DRUPAL_VERSION_UNSUPPORTED', dt('Drush !drush_version does not support Drupal !major_version.', array('!drush_version' => DRUSH_VERSION, '!major_version' => $major_version))); - } - - drush_bootstrap_value('drupal_root', $drupal_root); - define('DRUSH_DRUPAL_SIGNATURE', $signature); - - return TRUE; - } - - /** - * Bootstrap Drush with a valid Drupal Directory. - * - * In this function, the pwd will be moved to the root - * of the Drupal installation. - * - * The DRUSH_DRUPAL_ROOT context, DRUSH_DRUPAL_CORE context, DRUPAL_ROOT, and the - * DRUSH_DRUPAL_CORE constants are populated from the value that we determined during - * the validation phase. - * - * We also now load the drushrc.php for this specific Drupal site. - * We can now include files from the Drupal Tree, and figure - * out more context about the platform, such as the version of Drupal. - */ - function bootstrap_drupal_root() { - // Load the config options from Drupal's /drush and sites/all/drush directories. - drush_load_config('drupal'); - - $drupal_root = drush_set_context('DRUSH_DRUPAL_ROOT', drush_bootstrap_value('drupal_root')); - chdir($drupal_root); - $version = drush_drupal_version(); - $major_version = drush_drupal_major_version(); - - $core = $this->bootstrap_drupal_core($drupal_root); - - // DRUSH_DRUPAL_CORE should point to the /core folder in Drupal 8+ or to DRUPAL_ROOT - // in prior versions. - drush_set_context('DRUSH_DRUPAL_CORE', $core); - define('DRUSH_DRUPAL_CORE', $core); - - _drush_preflight_global_options(); - - drush_log(dt("Initialized Drupal !version root directory at !drupal_root", array("!version" => $version, '!drupal_root' => $drupal_root)), LogLevel::BOOTSTRAP); - } - - /** - * VALIDATE the DRUSH_BOOTSTRAP_DRUPAL_SITE phase. - * - * In this function we determine the URL used for the command, - * and check for a valid settings.php file. - * - * To do this, we need to set up the $_SERVER environment variable, - * to allow us to use conf_path to determine what Drupal will load - * as a configuration file. - */ - function bootstrap_drupal_site_validate() { - // Define the selected conf path as soon as we have identified that - // we have selected a Drupal site. Drush used to set this context - // during the drush_bootstrap_drush phase. - $drush_uri = _drush_bootstrap_selected_uri(); - drush_set_context('DRUSH_SELECTED_DRUPAL_SITE_CONF_PATH', drush_conf_path($drush_uri)); - - $this->bootstrap_drupal_site_setup_server_global($drush_uri); - return $this->bootstrap_drupal_site_validate_settings_present(); - } - - /** - * Set up the $_SERVER globals so that Drupal will see the same values - * that it does when serving pages via the web server. - */ - function bootstrap_drupal_site_setup_server_global($drush_uri) { - // Fake the necessary HTTP headers that Drupal needs: - if ($drush_uri) { - $drupal_base_url = parse_url($drush_uri); - // If there's no url scheme set, add http:// and re-parse the url - // so the host and path values are set accurately. - if (!array_key_exists('scheme', $drupal_base_url)) { - $drush_uri = 'http://' . $drush_uri; - $drupal_base_url = parse_url($drush_uri); - } - // Fill in defaults. - $drupal_base_url += array( - 'path' => '', - 'host' => NULL, - 'port' => NULL, - ); - $_SERVER['HTTP_HOST'] = $drupal_base_url['host']; - - if ($drupal_base_url['scheme'] == 'https') { - $_SERVER['HTTPS'] = 'on'; - } - - if ($drupal_base_url['port']) { - $_SERVER['HTTP_HOST'] .= ':' . $drupal_base_url['port']; - } - $_SERVER['SERVER_PORT'] = $drupal_base_url['port']; - - $_SERVER['REQUEST_URI'] = $drupal_base_url['path'] . '/'; - } - else { - $_SERVER['HTTP_HOST'] = 'default'; - $_SERVER['REQUEST_URI'] = '/'; - } - - $_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'] . 'index.php'; - $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF']; - $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; - $_SERVER['REQUEST_METHOD'] = 'GET'; - - $_SERVER['SERVER_SOFTWARE'] = NULL; - $_SERVER['HTTP_USER_AGENT'] = NULL; - $_SERVER['SCRIPT_FILENAME'] = DRUPAL_ROOT . '/index.php'; - } - - /** - * Validate that the Drupal site has all of the settings that it - * needs to operated. - */ - function bootstrap_drupal_site_validate_settings_present() { - $site = drush_bootstrap_value('site', $_SERVER['HTTP_HOST']); - - $conf_path = drush_bootstrap_value('conf_path', $this->conf_path(TRUE, TRUE)); - $conf_file = "$conf_path/settings.php"; - if (!file_exists($conf_file)) { - return drush_bootstrap_error('DRUPAL_SITE_SETTINGS_NOT_FOUND', dt("Could not find a Drupal settings.php file at !file.", - array('!file' => $conf_file))); - } - - return TRUE; - } - - /** - * Called by bootstrap_drupal_site to do the main work - * of the drush drupal site bootstrap. - */ - function bootstrap_do_drupal_site() { - $drush_uri = drush_get_context('DRUSH_SELECTED_URI'); - drush_set_context('DRUSH_URI', $drush_uri); - $site = drush_set_context('DRUSH_DRUPAL_SITE', drush_bootstrap_value('site')); - $conf_path = drush_set_context('DRUSH_DRUPAL_SITE_ROOT', drush_bootstrap_value('conf_path')); - - drush_log(dt("Initialized Drupal site !site at !site_root", array('!site' => $site, '!site_root' => $conf_path)), LogLevel::BOOTSTRAP); - - _drush_preflight_global_options(); - } - - /** - * Initialize a site on the Drupal root. - * - * We now set various contexts that we determined and confirmed to be valid. - * Additionally we load an optional drushrc.php file in the site directory. - */ - function bootstrap_drupal_site() { - drush_load_config('site'); - $this->bootstrap_do_drupal_site(); - } - - /** - * Initialize and load the Drupal configuration files. - * - * We process and store a normalized set of database credentials - * from the loaded configuration file, so we can validate them - * and access them easily in the future. - * - * Also override Drupal variables as per --variables option. - */ - function bootstrap_drupal_configuration() { - global $conf; - - $override = array( - 'dev_query' => FALSE, // Force Drupal6 not to store queries since we are not outputting them. - 'cron_safe_threshold' => 0, // Don't run poormanscron during Drush request (D7+). - ); - - $current_override = drush_get_option_list('variables'); - foreach ($current_override as $name => $value) { - if (is_numeric($name) && (strpos($value, '=') !== FALSE)) { - list($name, $value) = explode('=', $value, 2); - } - $override[$name] = $value; - } - $conf = is_array($conf) ? array_merge($conf, $override) : $conf; - } - - /** - * Validate the DRUSH_BOOTSTRAP_DRUPAL_DATABASE phase - * - * Attempt to make a working database connection using the - * database credentials that were loaded during the previous - * phase. - */ - function bootstrap_drupal_database_validate() { - if (!drush_valid_db_credentials()) { - return drush_bootstrap_error('DRUSH_DRUPAL_DB_ERROR'); - } - return TRUE; - } - - /** - * Test to see if the Drupal database has a specified - * table or tables. - * - * This is a bootstrap helper function designed to be called - * from the bootstrap_drupal_database_validate() methods of - * derived DrupalBoot classes. If a database exists, but is - * empty, then the Drupal database bootstrap will fail. To - * prevent this situation, we test for some table that is needed - * in an ordinary bootstrap, and return FALSE from the validate - * function if it does not exist, so that we do not attempt to - * start the database bootstrap. - * - * Note that we must manually do our own prefix testing here, - * because the existing wrappers we have for handling prefixes - * depend on bootstrapping to the "database" phase, and therefore - * are not available to validate this same phase. - * - * @param $required_tables - * Array of table names, or string with one table name - * - * @return TRUE if all tables in input parameter exist in - * the database. - */ - function bootstrap_drupal_database_has_table($required_tables) { - try { - $sql = drush_sql_get_class(); - $spec = $sql->db_spec(); - $prefix = isset($spec['prefix']) ? $spec['prefix'] : NULL; - if (!is_array($prefix)) { - $prefix = array('default' => $prefix); - } - $tables = $sql->listTables(); - foreach ((array)$required_tables as $required_table) { - $prefix_key = array_key_exists($required_table, $prefix) ? $required_table : 'default'; - if (!in_array($prefix[$prefix_key] . $required_table, $tables)) { - return FALSE; - } - } - } - catch (Exception $e) { - // Usually the checks above should return a result without - // throwing an exception, but we'll catch any that are - // thrown just in case. - return FALSE; - } - return TRUE; - } - - /** - * Boostrap the Drupal database. - */ - function bootstrap_drupal_database() { - // We presume that our derived classes will connect and then - // either fail, or call us via parent:: - drush_log(dt("Successfully connected to the Drupal database."), LogLevel::BOOTSTRAP); - } - - /** - * Attempt to load the full Drupal system. - */ - function bootstrap_drupal_full() { - drush_include_engine('drupal', 'environment'); - - $this->add_logger(); - - // Write correct install_profile to cache as needed. Used by _drush_find_commandfiles(). - $cid = drush_cid_install_profile(); - $install_profile = $this->get_profile(); - if ($cached_install_profile = drush_cache_get($cid)) { - // We have a cached profile. Check it for correctness and save new value if needed. - if ($cached_install_profile->data != $install_profile) { - drush_cache_set($cid, $install_profile); - } - } - else { - // No cached entry so write to cache. - drush_cache_set($cid, $install_profile); - } - - _drush_log_drupal_messages(); - } - - /** - * Log into the bootstrapped Drupal site with a specific - * username or user id. - */ - function bootstrap_drupal_login() { - $uid_or_name = drush_set_context('DRUSH_USER', drush_get_option('user', 0)); - $userversion = drush_user_get_class(); - if (!$account = $userversion->load_by_uid($uid_or_name)) { - if (!$account = $userversion->load_by_name($uid_or_name)) { - if (is_numeric($uid_or_name)) { - $message = dt('Could not login with user ID !user.', array('!user' => $uid_or_name)); - if ($uid_or_name === 0) { - $message .= ' ' . dt('This is typically caused by importing a MySQL database dump from a faulty tool which re-numbered the anonymous user ID in the users table. See !link for help recovering from this situation.', array('!link' => 'http://drupal.org/node/1029506')); - } - } - else { - $message = dt('Could not login with user account `!user\'.', array('!user' => $uid_or_name)); - } - return drush_set_error('DRUPAL_USER_LOGIN_FAILED', $message); - } - } - $userversion->setCurrentUser($account); - _drush_log_drupal_messages(); - } - -} diff --git a/vendor/drush/drush/lib/Drush/Boot/DrupalBoot6.php b/vendor/drush/drush/lib/Drush/Boot/DrupalBoot6.php deleted file mode 100644 index 9539f38777b4c32da987859cff181d9f3d27f4c3..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Boot/DrupalBoot6.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -namespace Drush\Boot; - -class DrupalBoot6 extends DrupalBoot { - - function valid_root($path) { - if (!empty($path) && is_dir($path) && file_exists($path . '/index.php')) { - // Drupal 6 root. - // We check for the absence of 'modules/field/field.module' to differentiate this from a D7 site. - // n.b. we want D5 and earlier to match here, if possible, so that we can print a 'not supported' - // error durring bootstrap. If someone later adds a commandfile that adds a boot class for - // Drupal 5, it will be tested first, so we shouldn't get here. - $candidate = 'includes/common.inc'; - if (file_exists($path . '/' . $candidate) && file_exists($path . '/misc/drupal.js') && !file_exists($path . '/modules/field/field.module')) { - return $candidate; - } - } - } - - function get_version($drupal_root) { - $path = $drupal_root . '/modules/system/system.module'; - if (is_file($path)) { - require_once $path; - if (defined('VERSION')) { - return VERSION; - } - } - } - - function get_profile() { - return variable_get('install_profile', 'standard'); - } - - function add_logger() { - // If needed, prod module_implements() to recognize our system_watchdog() implementation. - $dogs = drush_module_implements('watchdog'); - if (!in_array('system', $dogs)) { - // Note that this resets module_implements cache. - drush_module_implements('watchdog', FALSE, TRUE); - } - } - - function contrib_modules_paths() { - return array( - $this->conf_path() . '/modules', - 'sites/all/modules', - ); - } - - function contrib_themes_paths() { - return array( - $this->conf_path() . '/themes', - 'sites/all/themes', - ); - } - - function bootstrap_drupal_core($drupal_root) { - define('DRUPAL_ROOT', $drupal_root); - require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; - $core = DRUPAL_ROOT; - - return $core; - } - - function bootstrap_drupal_database_validate() { - return parent::bootstrap_drupal_database_validate() && $this->bootstrap_drupal_database_has_table('cache'); - } - - function bootstrap_drupal_database() { - drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE); - parent::bootstrap_drupal_database(); - } - - function bootstrap_drupal_configuration() { - drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); - - parent::bootstrap_drupal_configuration(); - } - - function bootstrap_drupal_full() { - if (!drush_get_context('DRUSH_QUIET', FALSE)) { - ob_start(); - } - drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - if (!drush_get_context('DRUSH_QUIET', FALSE)) { - ob_end_clean(); - } - - // Unset drupal error handler and restore drush's one. - restore_error_handler(); - - parent::bootstrap_drupal_full(); - } -} diff --git a/vendor/drush/drush/lib/Drush/Boot/DrupalBoot7.php b/vendor/drush/drush/lib/Drush/Boot/DrupalBoot7.php deleted file mode 100644 index 30e55a5b3517219aba4cfcde38c75d742cc74d6c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Boot/DrupalBoot7.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -namespace Drush\Boot; - -class DrupalBoot7 extends DrupalBoot { - - function valid_root($path) { - if (!empty($path) && is_dir($path) && file_exists($path . '/index.php')) { - // Drupal 7 root. - // We check for the presence of 'modules/field/field.module' to differentiate this from a D6 site - $candidate = 'includes/common.inc'; - if (file_exists($path . '/' . $candidate) && file_exists($path . '/misc/drupal.js') && file_exists($path . '/modules/field/field.module')) { - return $candidate; - } - } - } - - function get_version($drupal_root) { - $path = $drupal_root . '/includes/bootstrap.inc'; - if (is_file($path)) { - require_once $path; - if (defined('VERSION')) { - return VERSION; - } - } - } - - function get_profile() { - return drupal_get_profile(); - } - - function add_logger() { - // If needed, prod module_implements() to recognize our system_watchdog() implementation. - $dogs = drush_module_implements('watchdog'); - if (!in_array('system', $dogs)) { - // Note that we must never clear the module_implements() cache because - // that would trigger larger cache rebuilds with system_cache_tables on - // every drush invocation. Instead we inject our system_watchdog() - // implementation direclty into the static cache. - $implementations = &drupal_static('module_implements'); - $implementations['watchdog']['system'] = FALSE; - $verified_implementations = &drupal_static('module_implements:verified'); - $verified_implementations['watchdog'] = TRUE; - } - } - - function contrib_modules_paths() { - return array( - $this->conf_path() . '/modules', - 'sites/all/modules', - ); - } - - function contrib_themes_paths() { - return array( - $this->conf_path() . '/themes', - 'sites/all/themes', - ); - } - - function bootstrap_drupal_core($drupal_root) { - define('DRUPAL_ROOT', $drupal_root); - require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; - $core = DRUPAL_ROOT; - - return $core; - } - - function bootstrap_drupal_database_validate() { - return parent::bootstrap_drupal_database_validate() && $this->bootstrap_drupal_database_has_table('blocked_ips'); - } - - function bootstrap_drupal_database() { - drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE); - parent::bootstrap_drupal_database(); - } - - function bootstrap_drupal_configuration() { - drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); - - // Unset drupal error handler and restore drush's one. - restore_error_handler(); - - parent::bootstrap_drupal_configuration(); - } - - function bootstrap_drupal_full() { - if (!drush_get_context('DRUSH_QUIET', FALSE)) { - ob_start(); - } - drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - if (!drush_get_context('DRUSH_QUIET', FALSE)) { - ob_end_clean(); - } - - parent::bootstrap_drupal_full(); - } -} diff --git a/vendor/drush/drush/lib/Drush/Boot/DrupalBoot8.php b/vendor/drush/drush/lib/Drush/Boot/DrupalBoot8.php deleted file mode 100644 index bb537e7b2fca7c4697f3e22ca6657107523d7dfe..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Boot/DrupalBoot8.php +++ /dev/null @@ -1,205 +0,0 @@ -<?php - -namespace Drush\Boot; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Drupal\Core\DrupalKernel; -use Drush\Drupal\DrupalKernel as DrushDrupalKernel; -use Drush\Drupal\DrushServiceModifier; - -use Drush\Log\LogLevel; - -class DrupalBoot8 extends DrupalBoot { - - /** - * @var \Drupal\Core\DrupalKernelInterface - */ - protected $kernel; - - /** - * @var \Symfony\Component\HttpFoundation\Request - */ - protected $request; - - function valid_root($path) { - if (!empty($path) && is_dir($path) && file_exists($path . '/autoload.php')) { - // Additional check for the presence of core/composer.json to - // grant it is not a Drupal 7 site with a base folder named "core". - $candidate = 'core/includes/common.inc'; - if (file_exists($path . '/' . $candidate) && file_exists($path . '/core/core.services.yml')) { - if (file_exists($path . '/core/misc/drupal.js') || file_exists($path . '/core/assets/js/drupal.js')) { - return $candidate; - } - } - } - } - - function get_version($drupal_root) { - // Load the autoloader so we can access the class constants. - drush_drupal_load_autoloader($drupal_root); - // Drush depends on bootstrap being loaded at this point. - require_once $drupal_root .'/core/includes/bootstrap.inc'; - if (defined('\Drupal::VERSION')) { - return \Drupal::VERSION; - } - } - - function get_profile() { - return drupal_get_profile(); - } - - function conf_path($require_settings = TRUE, $reset = FALSE, Request $request = NULL) { - if (!isset($request)) { - if (\Drupal::hasRequest()) { - $request = \Drupal::request(); - } - // @todo Remove once external CLI scripts (Drush) are updated. - else { - $request = Request::createFromGlobals(); - } - } - if (\Drupal::hasService('kernel')) { - $site_path = \Drupal::service('kernel')->getSitePath(); - } - if (!isset($site_path) || empty($site_path)) { - $site_path = DrupalKernel::findSitePath($request, $require_settings); - } - return $site_path; - } - - function add_logger() { - // If we're running on Drupal 8 or later, we provide a logger which will send - // output to drush_log(). This should catch every message logged through every - // channel. - $container = \Drupal::getContainer(); - $parser = $container->get('logger.log_message_parser'); - $drushLogger = drush_get_context('DRUSH_LOG_CALLBACK'); - $logger = new \Drush\Log\DrushLog($parser, $drushLogger); - $container->get('logger.factory')->addLogger($logger); - } - - function contrib_modules_paths() { - return array( - $this->conf_path() . '/modules', - 'sites/all/modules', - 'modules', - ); - } - - /** - * @return array of strings - paths to directories where contrib - * themes can be found - */ - function contrib_themes_paths() { - return array( - $this->conf_path() . '/themes', - 'sites/all/themes', - 'themes', - ); - } - - function bootstrap_drupal_core($drupal_root) { - $core = DRUPAL_ROOT . '/core'; - - return $core; - } - - function bootstrap_drupal_database_validate() { - return parent::bootstrap_drupal_database_validate() && $this->bootstrap_drupal_database_has_table('key_value'); - } - - function bootstrap_drupal_database() { - // D8 omits this bootstrap level as nothing special needs to be done. - parent::bootstrap_drupal_database(); - } - - function bootstrap_drupal_configuration() { - $this->request = Request::createFromGlobals(); - $classloader = drush_drupal_load_autoloader(DRUPAL_ROOT); - // @todo - use Request::create() and then no need to set PHP superglobals - $kernelClass = new \ReflectionClass('\Drupal\Core\DrupalKernel'); - if ($kernelClass->hasMethod('addServiceModifier')) { - $this->kernel = DrupalKernel::createFromRequest($this->request, $classloader, 'prod'); - } - else { - $this->kernel = DrushDrupalKernel::createFromRequest($this->request, $classloader, 'prod'); - } - // @see Drush\Drupal\DrupalKernel::addServiceModifier() - $this->kernel->addServiceModifier(new DrushServiceModifier()); - - // Unset drupal error handler and restore Drush's one. - restore_error_handler(); - - // Disable automated cron if the module is enabled. - $GLOBALS['config']['automated_cron.settings']['interval'] = 0; - - parent::bootstrap_drupal_configuration(); - } - - function bootstrap_drupal_full() { - drush_log(dt('About to bootstrap the Drupal 8 Kernel.'), LogLevel::DEBUG); - // TODO: do we need to do ob_start any longer? - if (!drush_get_context('DRUSH_QUIET', FALSE)) { - ob_start(); - } - $this->kernel->boot(); - $this->kernel->prepareLegacyRequest($this->request); - if (!drush_get_context('DRUSH_QUIET', FALSE)) { - ob_end_clean(); - } - drush_log(dt('Finished bootstraping the Drupal 8 Kernel.'), LogLevel::DEBUG); - - parent::bootstrap_drupal_full(); - - // Get a list of the modules to ignore - $ignored_modules = drush_get_option_list('ignored-modules', array()); - - // We have to get the service command list from the container, because - // it is constructed in an indirect way during the container initialization. - // The upshot is that the list of console commands is not available - // until after $kernel->boot() is called. - $container = \Drupal::getContainer(); - if ($container->has('drush.service.consolecommands')) { - $serviceCommandlist = $container->get('drush.service.consolecommands'); - foreach ($serviceCommandlist->getCommandList() as $command) { - if (!$this->commandIgnored($command, $ignored_modules)) { - drush_log(dt('Add a command: !name', ['!name' => $command->getName()]), LogLevel::DEBUG); - annotationcommand_adapter_cache_module_console_commands($command); - } - } - } - // Do the same thing with the annotation commands. - if ($container->has('drush.service.consolidationcommands')) { - $serviceCommandlist = $container->get('drush.service.consolidationcommands'); - foreach ($serviceCommandlist->getCommandList() as $commandhandler) { - if (!$this->commandIgnored($commandhandler, $ignored_modules)) { - drush_log(dt('Add a commandhandler: !name', ['!name' => get_class($commandhandler)]), LogLevel::DEBUG); - annotationcommand_adapter_cache_module_service_commands($commandhandler); - } - } - } - } - - public function commandIgnored($command, $ignored_modules) { - if (empty($ignored_modules)) { - return false; - } - $ignored_regex = '#\\\\(' . implode('|', $ignored_modules) . ')\\\\#'; - $class = new \ReflectionClass($command); - $commandNamespace = $class->getNamespaceName(); - return preg_match($ignored_regex, $commandNamespace); - } - - /** - * {@inheritdoc} - */ - public function terminate() { - parent::terminate(); - - if ($this->kernel) { - $response = Response::create(''); - $this->kernel->terminate($this->request, $response); - } - } -} diff --git a/vendor/drush/drush/lib/Drush/Boot/EmptyBoot.php b/vendor/drush/drush/lib/Drush/Boot/EmptyBoot.php deleted file mode 100644 index e7d9d62105a06efd936df556dbdef80517fa69d3..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Boot/EmptyBoot.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drush\Boot; - -/** - * This is a do-nothing 'Boot' class that is used when there - * is no site at --root, or when no root is specified. - * - * The 'empty' boot must be careful to never change state, - * in case bootstrap code might later come along and set - * a site (e.g. in command completion). - */ -class EmptyBoot extends BaseBoot { - - function __construct() { - } - - function valid_root($path) { - return FALSE; - } - - function bootstrap_phases() { - return array( - DRUSH_BOOTSTRAP_DRUSH => '_drush_bootstrap_drush', - ); - } - - function bootstrap_init_phases() { - return array(DRUSH_BOOTSTRAP_DRUSH); - } - - function command_defaults() { - return array( - // TODO: Historically, commands that do not explicitly specify - // their bootstrap level default to DRUSH_BOOTSTRAP_DRUPAL_LOGIN. - // This isn't right any more, but we can't just change this to - // DRUSH_BOOTSTRAP_DRUSH, or we will start running commands that - // needed a full bootstrap with no bootstrap, and that won't work. - // For now, we will continue to force this to 'login'. Any command - // that does not declare 'bootstrap' is declaring that it is a Drupal - // command. - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN, - ); - } -} diff --git a/vendor/drush/drush/lib/Drush/Cache/CacheInterface.php b/vendor/drush/drush/lib/Drush/Cache/CacheInterface.php deleted file mode 100644 index f3ab29ef59e7a826aef6c76d97e2599a98da6f5a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Cache/CacheInterface.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -/** - * @file - * Definition of Drush\Cache\CacheInterface. - */ - -namespace Drush\Cache; - -/** - * Interface for cache implementations. - * - * All cache implementations have to implement this interface. - * JSONCache provides the default implementation, which can be - * consulted as an example. - * - * To make Drush use your implementation for a certain cache bin, you have to - * set a variable with the name of the cache bin as its key and the name of - * your class as its value. For example, if your implementation of - * CacheInterface was called MyCustomCache, the following line in - * drushrc.php would make Drush use it for the 'example' bin: - * @code - * $options['cache-class-example'] = 'MyCustomCache; - * @endcode - * - * Additionally, you can register your cache implementation to be used by - * default for all cache bins by setting the option 'cache-default-class' to - * the name of your implementation of the CacheInterface, e.g. - * @code - * $options['cache-default-class'] = 'MyCustomCache; - * @endcode - * - * @see _drush_cache_get_object() - * @see \Drupal\Core\Cache\CacheBackendInterface - */ -interface CacheInterface { - -/** - * Constructor. - * - * @param $bin - * The cache bin for which the object is created. -*/ -function __construct($bin); - -/** - * Return data from the persistent cache. - * - * @param string $cid - * The cache ID of the data to retrieve. - * - * @return - * The cache or FALSE on failure. - */ -function get($cid); - -/** - * Return data from the persistent cache when given an array of cache IDs. - * - * @param array $cids - * An array of cache IDs for the data to retrieve. This is passed by - * reference, and will have the IDs successfully returned from cache - * removed. - * - * @return - * An array of the items successfully returned from cache indexed by cid. - */ -function getMultiple(&$cids); - -/** - * Store data in the persistent cache. - * - * @param string $cid - * The cache ID of the data to store. - * @param array $data - * The data to store in the cache. - * @param $expire - * One of the following values: - * - DRUSH_CACHE_PERMANENT: Indicates that the item should never be removed unless - * explicitly told to using _drush_cache_clear_all() with a cache ID. - * - DRUSH_CACHE_TEMPORARY: Indicates that the item should be removed at the next - * general cache wipe. - * - A Unix timestamp: Indicates that the item should be kept at least until - * the given time, after which it behaves like CACHE_TEMPORARY. - */ -function set($cid, $data, $expire = DRUSH_CACHE_PERMANENT); - -/** - * Expire data from the cache. If called without arguments, expirable - * entries will be cleared from all known cache bins. - * - * @param string $cid - * If set, the cache ID to delete. Otherwise, all cache entries that can - * expire are deleted. - * @param bool $wildcard - * If set to TRUE, the $cid is treated as a substring - * to match rather than a complete ID. The match is a right hand - * match. If '*' is given as $cid, the bin $bin will be emptied. - */ -function clear($cid = NULL, $wildcard = FALSE); - -/** - * Check if a cache bin is empty. - * - * A cache bin is considered empty if it does not contain any valid data for - * any cache ID. - * - * @return - * TRUE if the cache bin specified is empty. - */ -function isEmpty(); -} diff --git a/vendor/drush/drush/lib/Drush/Cache/FileCache.php b/vendor/drush/drush/lib/Drush/Cache/FileCache.php deleted file mode 100644 index 1942bd91140989ca9e50a0f1c4c525ed9099441b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Cache/FileCache.php +++ /dev/null @@ -1,156 +0,0 @@ -<?php - -/** - * @file - * Definition of Drush\Cache\FileCache. - */ - -namespace Drush\Cache; - -/** - * Default cache implementation. - * - * This cache implementation uses plain text files - * containing serialized php to store cached data. Each cache bin corresponds - * to a directory by the same name. - */ -class FileCache implements CacheInterface { - const EXTENSION = '.cache'; - protected $bin; - - function __construct($bin) { - $this->bin = $bin; - $this->directory = $this->cacheDirectory(); - } - - /** - * Returns the cache directory for the given bin. - * - * @param string $bin - */ - function cacheDirectory($bin = NULL) { - $bin = $bin ? $bin : $this->bin; - return drush_directory_cache($bin); - } - - function get($cid) { - $cids = array($cid); - $cache = $this->getMultiple($cids); - return reset($cache); - } - - function getMultiple(&$cids) { - try { - $cache = array(); - foreach ($cids as $cid) { - $filename = $this->getFilePath($cid); - if (!file_exists($filename)) throw new \Exception; - - $item = $this->readFile($filename); - if ($item) { - $cache[$cid] = $item; - } - } - $cids = array_diff($cids, array_keys($cache)); - return $cache; - } - catch (\Exception $e) { - return array(); - } - } - - /** - * Returns the contents of the given filename unserialized. - * - * @param string $filename - * Absolute path to filename to read contents from. - */ - function readFile($filename) { - $item = file_get_contents($filename); - return $item ? unserialize($item) : FALSE; - } - - function set($cid, $data, $expire = DRUSH_CACHE_PERMANENT) { - $created = time(); - - $cache = new \stdClass; - $cache->cid = $cid; - $cache->data = is_object($data) ? clone $data : $data; - $cache->created = $created; - if ($expire == DRUSH_CACHE_TEMPORARY) { - $cache->expire = $created + 2591999; - } - // Expire time is in seconds if less than 30 days, otherwise is a timestamp. - elseif ($expire != DRUSH_CACHE_PERMANENT && $expire < 2592000) { - $cache->expire = $created + $expire; - } - else { - $cache->expire = $expire; - } - - // Ensure the cache directory still exists, in case a backend process - // cleared the cache after the cache was initialized. - drush_mkdir($this->directory); - - $filename = $this->getFilePath($cid); - return $this->writeFile($filename, $cache); - } - - /** - * Serializes data and write it to the given filename. - * - * @param string $filename - * Absolute path to filename to write cache data. - * @param $cache - * Cache data to serialize and write to $filename. - */ - function writeFile($filename, $cache) { - return file_put_contents($filename, serialize($cache)); - } - - function clear($cid = NULL, $wildcard = FALSE) { - $bin_dir = $this->cacheDirectory(); - $files = array(); - if (empty($cid)) { - drush_delete_dir($bin_dir, TRUE); - } - else { - if ($wildcard) { - if ($cid == '*') { - drush_delete_dir($bin_dir, TRUE); - } - else { - $matches = drush_scan_directory($bin_dir, "/^$cid/", array('.', '..')); - $files = $files + array_keys($matches); - } - } - else { - $files[] = $this->getFilePath($cid); - } - - foreach ($files as $f) { - if (file_exists($f)) { - unlink($f); - } - } - } - } - - function isEmpty() { - $files = drush_scan_directory($this->directory, "//", array('.', '..')); - return empty($files); - } - - /** - * Converts a cache id to a full path. - * - * @param $cid - * The cache ID of the data to retrieve. - * - * @return - * The full path to the cache file. - */ - protected function getFilePath($cid) { - return $this->directory . '/' . str_replace(array(':', '\\', '/'), '.', $cid) . self::EXTENSION; - } -} diff --git a/vendor/drush/drush/lib/Drush/Cache/JSONCache.php b/vendor/drush/drush/lib/Drush/Cache/JSONCache.php deleted file mode 100644 index 6c6b3737c5ba9a750b9e6edf4dadaf958b0a7d1c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Cache/JSONCache.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * @file - * Definition of Drush\Cache\JSONCache. - */ - -namespace Drush\Cache; - -/** - * JSON cache storage backend. - */ -class JSONCache extends FileCache { - const EXTENSION = '.json'; - - function readFile($filename) { - $item = file_get_contents($filename); - return $item ? (object)drush_json_decode($item) : FALSE; - } - - function writeFile($filename, $cache) { - return file_put_contents($filename, drush_json_encode($cache)); - } -} diff --git a/vendor/drush/drush/lib/Drush/Command/Commandfiles.php b/vendor/drush/drush/lib/Drush/Command/Commandfiles.php deleted file mode 100644 index 516f71f3f22953610a657dbf7b6d36e85d7a725b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Command/Commandfiles.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -/** - * @file - * Definition of Drush\Command\Commandfiles. - */ - -namespace Drush\Command; - -/** - * Default commandfiles implementation. - * - * This class manages the list of commandfiles that are active - * in Drush for the current command invocation. - */ -class Commandfiles implements CommandfilesInterface { - protected $cache; - protected $deferred; - - function __construct() { - $this->cache = array(); - $this->deferred = array(); - } - - function get() { - return $this->cache; - } - - function deferred() { - return $this->deferred; - } - - function sort() { - ksort($this->cache); - } - - function add($commandfile) { - $load_command = FALSE; - - $module = basename($commandfile); - $module = preg_replace('/\.*drush[0-9]*\.inc/', '', $module); - $module_versionless = preg_replace('/\.d([0-9]+)$/', '', $module); - if (!isset($this->cache[$module_versionless])) { - $drupal_version = ''; - if (preg_match('/\.d([0-9]+)$/', $module, $matches)) { - $drupal_version = $matches[1]; - } - if (empty($drupal_version)) { - $load_command = TRUE; - } - else { - if (function_exists('drush_drupal_major_version') && ($drupal_version == drush_drupal_major_version())) { - $load_command = TRUE; - } - else { - // Signal that we should try again on - // the next bootstrap phase. - $this->deferred[$module] = $commandfile; - } - } - if ($load_command) { - $this->cache[$module_versionless] = $commandfile; - require_once $commandfile; - unset($this->deferred[$module]); - } - } - return $load_command; - } -} diff --git a/vendor/drush/drush/lib/Drush/Command/CommandfilesInterface.php b/vendor/drush/drush/lib/Drush/Command/CommandfilesInterface.php deleted file mode 100644 index acb7c2cdb61a136a4b073b62e77fe72c3db2976a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Command/CommandfilesInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Drush\Command; - -interface CommandfilesInterface { - function add($commandfile); - function get(); - function deferred(); - function sort(); -} diff --git a/vendor/drush/drush/lib/Drush/Command/DrushInputAdapter.php b/vendor/drush/drush/lib/Drush/Command/DrushInputAdapter.php deleted file mode 100644 index 801b58c32174a04119746f1a1b8dd6844221da32..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Command/DrushInputAdapter.php +++ /dev/null @@ -1,187 +0,0 @@ -<?php - -/** - * @file - * Definition of Drush\Command\DrushInputAdapter. - */ - -namespace Drush\Command; - -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputDefinition; - -/** - * Adapter for Symfony Console InputInterface - * - * This class can serve as a stand-in wherever an InputInterface - * is needed. It calls through to ordinary Drush procedural functions. - * This object should not be used directly; it exists only in - * the Drush 8.x branch. - * - * We use this class rather than using an ArrayInput for two reasons: - * 1) We do not want to convert our options array back to '--option=value' - * or '--option value' just to have them re-parsed again. - * 2) We do not want Symfony to attempt to validate our options or arguments - * for us. - */ -class DrushInputAdapter implements InputInterface -{ - protected $arguments; - protected $options; - protected $interactive; - - public function __construct($arguments, $options, $command = false, $interactive = true) - { - $this->arguments = $arguments; - $this->options = $options; - - // If a command name is provided as a parameter, then push - // it onto the front of the arguments list as a service - if ($command) { - $this->arguments = array_merge( - [ 'command' => $command ], - $this->arguments - ); - } - // Is it interactive, or is it not interactive? - // Call drush_get_option() here if value not passed in? - $this->interactive = $interactive; - } - - /** - * {@inheritdoc} - */ - public function getFirstArgument() - { - return reset($this->arguments); - } - - /** - * {@inheritdoc} - */ - public function hasParameterOption($values, $onlyParams = false) - { - $values = (array) $values; - - foreach ($values as $value) { - if (array_key_exists($value, $this->options)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getParameterOption($values, $default = false, $onlyParams = false) - { - $values = (array) $values; - - foreach ($values as $value) { - if (array_key_exists($value, $this->options)) { - return $this->getOption($value); - } - } - - return $default; - } - - /** - * {@inheritdoc} - */ - public function bind(InputDefinition $definition) - { - // no-op: this class exists to avoid validation - } - - /** - * {@inheritdoc} - */ - public function validate() - { - // no-op: this class exists to avoid validation - } - - /** - * {@inheritdoc} - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * {@inheritdoc} - */ - public function getArgument($name) - { - // TODO: better to throw if an argument that does not exist is requested? - return isset($this->arguments[$name]) ? $this->arguments[$name] : ''; - } - - /** - * {@inheritdoc} - */ - public function setArgument($name, $value) - { - $this->arguments[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function hasArgument($name) - { - return isset($this->arguments[$name]); - } - - /** - * {@inheritdoc} - */ - public function getOptions() - { - return $this->options; - } - - /** - * {@inheritdoc} - */ - public function getOption($name) - { - return $this->options[$name]; - } - - /** - * {@inheritdoc} - */ - public function setOption($name, $value) - { - $this->options[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function hasOption($name) - { - return isset($this->options[$name]); - } - - /** - * {@inheritdoc} - */ - public function isInteractive() - { - return $this->interactive; - } - - /** - * {@inheritdoc} - */ - public function setInteractive($interactive) - { - $this->interactive = $interactive; - } -} diff --git a/vendor/drush/drush/lib/Drush/Command/DrushOutputAdapter.php b/vendor/drush/drush/lib/Drush/Command/DrushOutputAdapter.php deleted file mode 100644 index 5d2101bf0648b0960844e25ba50273e795000592..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Command/DrushOutputAdapter.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -/** - * @file - * Definition of Drush\Command\DrushOutputAdapter. - */ - -namespace Drush\Command; - -use Symfony\Component\Console\Output\Output; - -/** - * Adapter for Symfony Console OutputInterface - * - * This class can serve as a stand-in wherever an OutputInterface - * is needed. It calls through to drush_print(). - * This object should not be used directly; it exists only in - * the Drush 8.x branch. - */ -class DrushOutputAdapter extends Output { - protected function doWrite($message, $newline) - { - drush_print($message, 0, null, $newline); - } -} diff --git a/vendor/drush/drush/lib/Drush/CommandFiles/core/DrupliconCommands.php b/vendor/drush/drush/lib/Drush/CommandFiles/core/DrupliconCommands.php deleted file mode 100644 index 4e58fff794607934d13b0f797aff4429f230a632..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/CommandFiles/core/DrupliconCommands.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -namespace Drush\CommandFiles\core; - -use Consolidation\AnnotatedCommand\CommandData; - -class DrupliconCommands { - protected $printed = false; - - /** - * Print druplicon as post-command output. - * - * @hook post-command * - * @option druplicon Shows the druplicon as glorious ASCII art. - */ - public function druplicon($result, CommandData $commandData) { - // If one command does a drush_invoke to another command, - // then this hook will be called multiple times. Only print - // once. (n.b. If drush_invoke_process passes along the - // --druplicon option, then we will still get mulitple output) - if ($this->printed) { - return; - } - $this->printed = true; - $annotationData = $commandData->annotationData(); - $commandName = $annotationData['command']; - // For some reason, Drush help uses drush_invoke_process to call helpsingle - if ($commandName == 'helpsingle') { - return; - } - drush_log(dt('Displaying Druplicon for "!command" command.', array('!command' => $commandName))); - if ($commandData->input()->getOption('druplicon')) { - $misc_dir = DRUSH_BASE_PATH . '/misc'; - if (drush_get_context('DRUSH_NOCOLOR')) { - $content = file_get_contents($misc_dir . '/druplicon-no_color.txt'); - } - else { - $content = file_get_contents($misc_dir . '/druplicon-color.txt'); - } - drush_print($content); - } - } -} diff --git a/vendor/drush/drush/lib/Drush/CommandFiles/core/browseCommands.php b/vendor/drush/drush/lib/Drush/CommandFiles/core/browseCommands.php deleted file mode 100644 index 02e90517ef50ccf1b56816872c7c11039cd140db..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/CommandFiles/core/browseCommands.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Drush\CommandFiles\Core; - -class BrowseCommands { - - /** - * Display a link to a given path or open link in a browser. - * - * @todo Document new @handle-remote-commands and @bootstrap annotations. - * - * @param string|null $path Path to open. If omitted, the site front page will be opened. - * @option string $browser Specify a particular browser (defaults to operating system default). Use --no-browser to suppress opening a browser. - * @option integer $redirect-port The port that the web server is redirected to (e.g. when running within a Vagrant environment). - * @usage drush browse - * Open default web browser (if configured or detected) to the site front page. - * @usage drush browse node/1 - * Open web browser to the path node/1. - * @usage drush @example.prod - * Open a browser to the web site specified in a site alias. - * @usage drush browse --browser=firefox admin - * Open Firefox web browser to the path 'admin'. - * @bootstrap DRUSH_BOOTSTRAP_NONE - * @handle-remote-commands true - * @complete \Drush\CommandFiles\Core\BrowseCommands::complete - */ - public function browse($path = '', $options = ['browser' => NULL, 'redirect-port' => NULL]) { - // Redispatch if called against a remote-host so a browser is started on the - // the *local* machine. - $alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS'); - if (drush_sitealias_is_remote_site($alias)) { - $site_record = drush_sitealias_get_record($alias); - $return = drush_invoke_process($site_record, 'browse', array($path), drush_redispatch_get_options(), array('integrate' => TRUE)); - if ($return['error_status']) { - return drush_set_error('Unable to execute browse command on remote alias.'); - } - else { - $link = $return['object']; - } - } - else { - if (!drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { - // Fail gracefully if unable to bootstrap Drupal. drush_bootstrap() has - // already logged an error. - return FALSE; - } - $link = drush_url($path, array('absolute' => TRUE)); - } - - drush_start_browser($link); - return $link; - } - - /* - * An argument completion provider - */ - static function complete() { - return ['values' => ['admin', 'admin/content', 'admin/reports', 'admin/structure', 'admin/people', 'admin/modules', 'admin/config']]; - } -} \ No newline at end of file diff --git a/vendor/drush/drush/lib/Drush/Commands/DrushCommands.php b/vendor/drush/drush/lib/Drush/Commands/DrushCommands.php deleted file mode 100644 index 346c50dfb9c58f6e6fedcf082e4168afbb03761c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Commands/DrushCommands.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -namespace Drush\Commands; - -use Drush\Command\DrushInputAdapter; -use Drush\Command\DrushOutputAdapter; -use Drush\Drush; -use Drush\SiteAlias\ProcessManager; -use Psr\Log\LoggerAwareInterface; -use Psr\Log\LoggerAwareTrait; -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; - -/** - * DrushCommands provides access to configuration, IO and the logger, - * and also provides a "printFile" convenience method for displaying - * the contents of a file with a pager. - * - * Drush extensions that use ONLY the facilities provided by this class, - * plus any APIs provided by Drupal core and the module they are bundled - * with should work with both Drush 8 and Drush 9. - */ -abstract class DrushCommands implements LoggerAwareInterface -{ - // This is more readable. - const REQ=InputOption::VALUE_REQUIRED; - const OPT=InputOption::VALUE_OPTIONAL; - - use LoggerAwareTrait; - - protected $io; - - public function __construct() - { - } - - /** - * Return an object that has the same signature as a Consolidation\Config\ConfigInterface - */ - protected function getConfig() - { - return Drush::config(); - } - - /** - * @return ProcessManager - */ - public function processManager() - { - return Drush::processManager(); - } - - /** - * @return SymfonyStyle - */ - protected function io() - { - if (!$this->io) { - $this->io = new SymfonyStyle($this->input(), $this->output()); - } - return $this->io; - } - - /** - * @return InputInterface - */ - protected function input() - { - return Drush::input(); - } - - /** - * @return OutputInterface - */ - protected function output() - { - return Drush::output(); - } - - /** - * Returns a logger object. - * - * @return LoggerInterface - */ - protected function logger() - { - return $this->logger; - } - - /** - * Print the contents of a file. - * - * @param string $file - * Full path to a file. - */ - protected function printFile($file) - { - drush_print_file($file); - } -} diff --git a/vendor/drush/drush/lib/Drush/Commands/core/SanitizeCommands.php b/vendor/drush/drush/lib/Drush/Commands/core/SanitizeCommands.php deleted file mode 100644 index 132c99dc276113d2e492731edcbbdd095a814895..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Commands/core/SanitizeCommands.php +++ /dev/null @@ -1,256 +0,0 @@ -<?php - -namespace Drush\Commands\core; - -use Drupal\Component\Utility\Random; -use Drupal\Core\Database\Database; -use Drush\Commands\DrushCommands; - -/** - * Class SanitizeCommands - * @package Drush\Commands\core - */ -class SanitizeCommands { - - /** - * @var bool - * Whether database table names should be wrapped in brackets for prefixing. - */ - protected $wrap; - - /** - * Sets $this->wrap to TRUE if a db-prefix is set with drush. - */ - protected function setWrap() { - $this->wrap = $wrap_table_name = (bool) drush_get_option('db-prefix'); - } - - - /** - * Sanitize the database by removed and obfuscating user data. - * - * @command sql-sanitize - * - * @todo "drush dependencies" array('sqlsync') - * - * @bootstrap DRUSH_BOOTSTRAP_NONE - * @description Run sanitization operations on the current database. - * @option db-prefix Enable replacement of braces in sanitize queries. - * @option db-url A Drupal 6 style database URL. E.g., - * mysql://root:pass@127.0.0.1/db - * @option sanitize-email The pattern for test email addresses in the - * sanitization operation, or "no" to keep email addresses unchanged. May - * contain replacement patterns %uid, %mail or %name. Example value: - * user+%uid@localhost - * @option sanitize-password The password to assign to all accounts in the - * sanitization operation, or "no" to keep passwords unchanged. Example - * value: password - * @option whitelist-fields A comma delimited list of fields exempt from sanitization. - * @aliases sqlsan - * @usage drush sql-sanitize --sanitize-password=no - * Sanitize database without modifying any passwords. - * @usage drush sql-sanitize --whitelist-fields=field_biography,field_phone_number - * Sanitizes database but exempts two user fields from modification. - * @see hook_drush_sql_sync_sanitize() for adding custom sanitize routines. - */ - public function sqlSanitize($options = [ - 'db-prefix' => FALSE, - 'db-url' => '', - 'sanitize-email' => '', - 'sanitize-password' => '', - 'whitelist-fields' => '', - ]) { - drush_sql_bootstrap_further(); - if ($options['db-prefix']) { - drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_DATABASE); - } - - // Drush itself implements this via sql_drush_sql_sync_sanitize(). - drush_command_invoke_all('drush_sql_sync_sanitize', 'default'); - $operations = drush_get_context('post-sync-ops'); - if (!empty($operations)) { - if (!drush_get_context('DRUSH_SIMULATE')) { - $messages = _drush_sql_get_post_sync_messages(); - if ($messages) { - drush_print(); - drush_print($messages); - } - } - $queries = array_column($operations, 'query'); - $sanitize_query = implode(" ", $queries); - } - if (!drush_confirm(dt('Do you really want to sanitize the current database?'))) { - return drush_user_abort(); - } - - if ($sanitize_query) { - $sql = drush_sql_get_class(); - $sanitize_query = $sql->query_prefix($sanitize_query); - $result = $sql->query($sanitize_query); - if (!$result) { - throw new \Exception(dt('Sanitize query failed.')); - } - } - } - - /** - * Performs database sanitization. - * - * @param int $major_version - * E.g., 6, 7, or 8. - */ - public function doSanitize($major_version) { - $this->setWrap(); - $this->sanitizeSessions(); - - if ($major_version == 8) { - $this->sanitizeComments(); - $this->sanitizeUserFields(); - } - } - - /** - * Sanitize string fields associated with the user. - * - * We've got to do a good bit of SQL-foo here because Drupal services are - * not yet available. - */ - public function sanitizeUserFields() { - /** @var SqlBase $sql_class */ - $sql_class = drush_sql_get_class(); - $tables = $sql_class->listTables(); - $whitelist_fields = (array) explode(',', drush_get_option('whitelist-fields')); - - foreach ($tables as $table) { - if (strpos($table, 'user__field_') === 0) { - $field_name = substr($table, 6, strlen($table)); - if (in_array($field_name, $whitelist_fields)) { - continue; - } - - $output = $this->query("SELECT data FROM config WHERE name = 'field.field.user.user.$field_name';"); - $field_config = unserialize($output[0]); - $field_type = $field_config['field_type']; - $randomizer = new Random(); - - switch ($field_type) { - - case 'email': - $this->sanitizeTableColumn($table, $field_name . '_value', $randomizer->name(10) . '@example.com'); - break; - - case 'string': - $this->sanitizeTableColumn($table, $field_name . '_value', $randomizer->name(255)); - break; - - case 'string_long': - $this->sanitizeTableColumn($table, $field_name . '_value', $randomizer->sentences(1)); - break; - - case 'telephone': - $this->sanitizeTableColumn($table, $field_name . '_value', '15555555555'); - break; - - case 'text': - $this->sanitizeTableColumn($table, $field_name . '_value', $randomizer->paragraphs(2)); - break; - - case 'text_long': - $this->sanitizeTableColumn($table, $field_name . '_value', $randomizer->paragraphs(10)); - break; - - case 'text_with_summary': - $this->sanitizeTableColumn($table, $field_name . '_value', $randomizer->paragraphs(2)); - $this->sanitizeTableColumn($table, $field_name . '_summary', $randomizer->name(255)); - break; - } - } - } - } - - /** - * Replaces all values in given table column with the specified value. - * - * @param string $table - * The database table name. - * @param string $column - * The database column to be updated. - * @param $value - * The new value. - */ - public function sanitizeTableColumn($table, $column, $value) { - $table_name_wrapped = $this->wrapTableName($table); - $sql = "UPDATE $table_name_wrapped SET $column='$value';"; - drush_sql_register_post_sync_op($table.$column, dt("Replaces all values in $table table with the same random long string."), $sql); - } - - /** - * Truncates the session table. - */ - public function sanitizeSessions() { - // Seems quite portable (SQLite?) - http://en.wikipedia.org/wiki/Truncate_(SQL) - $table_name = $this->wrapTableName('sessions'); - $sql_sessions = "TRUNCATE TABLE $table_name;"; - drush_sql_register_post_sync_op('sessions', dt('Truncate Drupal\'s sessions table'), $sql_sessions); - } - - /** - * Sanitizes comments_field_data table. - */ - public function sanitizeComments() { - - $comments_enabled = $this->query("SHOW TABLES LIKE 'comment_field_data';"); - if (!$comments_enabled) { - return; - } - - $comments_table = $this->wrapTableName('comment_field_data'); - $sql_comments = "UPDATE $comments_table SET name='Anonymous', mail='', homepage='http://example.com' WHERE uid = 0;"; - drush_sql_register_post_sync_op('anon_comments', dt('Remove names and email addresses from anonymous user comments.'), $sql_comments); - - $sql_comments = "UPDATE $comments_table SET name=CONCAT('User', `uid`), mail=CONCAT('user+', `uid`, '@example.com'), homepage='http://example.com' WHERE uid <> 0;"; - drush_sql_register_post_sync_op('auth_comments', dt('Replace names and email addresses from authenticated user comments.'), $sql_comments); - } - - /** - * Wraps a table name in brackets if a database prefix is being used. - * - * @param string $table_name - * The name of the database table. - * - * @return string - * The (possibly wrapped) table name. - */ - public function wrapTableName($table_name) { - if ($this->wrap) { - $processed = '{' . $table_name . '}'; - } - else { - $processed = $table_name; - } - - return $processed; - } - - /** - * Executes a sql command using drush sqlq and returns the output. - * - * @param string $query - * The SQL query to execute. Must end in a semicolon! - * - * @return string - * The output of the query. - */ - protected function query($query) { - $current = drush_get_context('DRUSH_SIMULATE'); - drush_set_context('DRUSH_SIMULATE', FALSE); - $sql = drush_sql_get_class(); - $success = $sql->query($query); - $output = drush_shell_exec_output(); - drush_set_context('DRUSH_SIMULATE', $current); - - return $output; - } - -} - diff --git a/vendor/drush/drush/lib/Drush/Commands/core/StatusCommands.php b/vendor/drush/drush/lib/Drush/Commands/core/StatusCommands.php deleted file mode 100644 index 2f21810c8fac864f5965639ef7e6fe24a2818133..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Commands/core/StatusCommands.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace Drush\Commands\core; - -use Consolidation\OutputFormatters\StructuredData\AssociativeList; - -class StatusCommands { - - /** - * @command new-status - * - * @field-labels - * drupal-version: Drupal version - * uri: Site URI - * db-driver: Database driver - * db-hostname: Database hostname - * db-port: Database port - * db-username: Database username - * db-password: Database password - * db-name: Database name - * db-status: Database - * bootstrap: Drupal bootstrap - * user: Drupal user - * theme: Default theme - * admin-theme: Administration theme - * php-bin: PHP executable - * php-conf: PHP configuration - * php-os: PHP OS - * drush-script: Drush script - * drush-version: Drush version - * drush-temp: Drush temp directory - * drush-conf: Drush configuration - * drush-alias-files: Drush alias files - * install-profile: Install profile - * root: Drupal root - * drupal-settings-file: Drupal Settings File - * site-path: Site path - * root: Drupal root - * site: Site path - * themes: Themes path - * modules: Modules path - * files: File directory path - * private: Private file directory path - * temp: Temporary file directory path - * config-sync: Sync config path - * files-path: File directory path - * temp-path: Temporary file directory path - * %paths: Other paths - * - * @topics docs-readme - */ - public function status($options = ['project' => '', 'format' => 'table', 'fields' => '']) { - $data = _core_site_status_table($options['project']); - - return new AssociativeList($data); - } -} - diff --git a/vendor/drush/drush/lib/Drush/ConfigAdapter.php b/vendor/drush/drush/lib/Drush/ConfigAdapter.php deleted file mode 100644 index 3cd4f49694de1df8984fd50496744ae21c9d5a00..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/ConfigAdapter.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php -namespace Drush; - -use Consolidation\Config\ConfigInterface; - -/** - * Note that DrushConfig deliberately does NOT implement the interface - * Consolidation\Config\ConfigInterface because consolidation/config - * is NOT a requirement of Drush 8. DrushConfig must therefore work in - * the absence of consolidation/config. - * - * Drush 8 uses some components optionally, if they are available - * (e.g. the AliasManager and the ProcessManager). Drush never calls - * these directly, but makes them available to Drush extensions that - * want to use them. In these instances, the needed dependencies should - * be required in the composer.json of the extension that uses it. - * - * This adapter simply converts DrushConfig into an equivalent object - * that implements ConfigInterface, so that it may be passed to - * objects that typehint their parameters as ConfigInterface. - */ -class ConfigAdapter implements ConfigInterface -{ - protected $config; - - public function __construct($config) - { - $this->config = $config; - } - - /** - * @inheritdoc - */ - public function has($key) - { - return $this->config->has($key); - } - - /** - * @inheritdoc - */ - public function get($key, $defaultFallback = null) - { - return $this->config->get($key, $defaultFallback); - } - - /** - * @inheritdoc - */ - public function set($key, $value) - { - $this->config->set($key, $value); - } - - /** - * @inheritdoc - */ - public function import($data) - { - return $this->config->import($data); - } - - /** - * @inheritdoc - */ - public function replace($data) - { - $this->config->replace($data); - } - - /** - * @inheritdoc - */ - public function combine($data) - { - return $this->config->combine($data); - } - - /** - * @inheritdoc - */ - public function export() - { - return $this->config->export(); - } - - /** - * @inheritdoc - */ - public function hasDefault($key) - { - return $this->config->hasDefault($key); - } - - /** - * @inheritdoc - */ - public function getDefault($key, $defaultFallback = null) - { - return $this->config->getDefault($key, $defaultFallback); - } - - /** - * @inheritdoc - */ - public function setDefault($key, $value) - { - return $this->setDefault($key, $value); - } -} diff --git a/vendor/drush/drush/lib/Drush/Drupal/DrupalKernel.php b/vendor/drush/drush/lib/Drush/Drupal/DrupalKernel.php deleted file mode 100644 index 39fa15c0f953505c1449637eb07060b504b40b07..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Drupal/DrupalKernel.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -namespace Drush\Drupal; - -use Drush\Log\LogLevel; -use Drupal\Core\DrupalKernel as DrupalDrupalKernel; -use Symfony\Component\HttpFoundation\Request; -use Drupal\Core\DependencyInjection\ServiceModifierInterface; - -class DrupalKernel extends DrupalDrupalKernel { - /** @var ServiceModifierInterface[] */ - protected $serviceModifiers = []; - - /** - * @inheritdoc - */ - public static function createFromRequest(Request $request, $class_loader, $environment, $allow_dumping = TRUE, $app_root = NULL) { - drush_log(dt("Create from request"), LogLevel::DEBUG); - $kernel = new static($environment, $class_loader, $allow_dumping); - static::bootEnvironment(); - $kernel->initializeSettings($request); - return $kernel; - } - - /** - * Add a service modifier to the container builder. - * - * The container is not compiled until $kernel->boot(), so there is a chance - * for clients to add compiler passes et. al. before then. - */ - public function addServiceModifier(ServiceModifierInterface $serviceModifier) { - drush_log(dt("add service modifier"), LogLevel::DEBUG); - $this->serviceModifiers[] = $serviceModifier; - } - - /** - * @inheritdoc - */ - protected function getContainerBuilder() { - drush_log(dt("get container builder"), LogLevel::DEBUG); - $container = parent::getContainerBuilder(); - foreach ($this->serviceModifiers as $serviceModifier) { - $serviceModifier->alter($container); - } - return $container; - } - /** - * Initializes the service container. - * - * @return \Symfony\Component\DependencyInjection\ContainerInterface - */ - protected function initializeContainer() { - if (empty($this->moduleList) && !$this->containerNeedsRebuild) { - $container_definition = $this->getCachedContainerDefinition(); - foreach ($this->serviceModifiers as $serviceModifier) { - if (!$serviceModifier->check($container_definition)) { - $this->invalidateContainer(); - break; - } - } - } - return parent::initializeContainer(); - } -} diff --git a/vendor/drush/drush/lib/Drush/Drupal/DrushServiceModifier.php b/vendor/drush/drush/lib/Drush/Drupal/DrushServiceModifier.php deleted file mode 100644 index 14a8a292ee43544b1860358cc44f0ea151872f8d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Drupal/DrushServiceModifier.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Drush\Drupal; - -use Drush\Log\LogLevel; -use Drupal\Core\DependencyInjection\ServiceModifierInterface; -use Drupal\Core\DependencyInjection\ContainerBuilder; - -class DrushServiceModifier implements ServiceModifierInterface -{ - /** - * @inheritdoc - */ - public function alter(ContainerBuilder $container) { - drush_log(dt("service modifier alter"), LogLevel::DEBUG); - // http://symfony.com/doc/2.7/components/dependency_injection/tags.html#register-the-pass-with-the-container - $container->register('drush.service.consolecommands', 'Drush\Command\ServiceCommandlist'); - $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolecommands', 'drush.command')); - $container->register('drush.service.consolidationcommands', 'Drush\Command\ServiceCommandlist'); - $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolidationcommands', 'consolidation.commandhandler')); - } - /** - * Checks existing service definitions for the presence of modification. - * - * @param $container_definition - * Cached container definition - * @return bool - */ - public function check($container_definition) { - return isset($container_definition['services']['drush.service.consolecommands']) && - isset($container_definition['services']['drush.service.consolidationcommands']); - } -} diff --git a/vendor/drush/drush/lib/Drush/Drupal/ExtensionDiscovery.php b/vendor/drush/drush/lib/Drush/Drupal/ExtensionDiscovery.php deleted file mode 100644 index 5373adf15689221b95e3b232c893172f23a99767..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Drupal/ExtensionDiscovery.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -namespace Drush\Drupal; - -use Drupal\Core\Extension\ExtensionDiscovery as DrupalExtensionDiscovery; - -class ExtensionDiscovery extends DrupalExtensionDiscovery { - static public function reset() { - static::$files = array(); - } -} - diff --git a/vendor/drush/drush/lib/Drush/DrushConfig.php b/vendor/drush/drush/lib/Drush/DrushConfig.php deleted file mode 100644 index 2f9235034abb7da7119f7c1767111474d6076b3e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/DrushConfig.php +++ /dev/null @@ -1,138 +0,0 @@ -<?php -namespace Drush; - -use Dflydev\DotAccessData\Data; - -/** - * Provides minimal access to Drush configuration in a way that is - * forward-compatible with the Consolidation\Config classes used - * in Drush 9. - */ -class DrushConfig -{ - /** - * Determine if a non-default config value exists in a non-default context. - */ - public function has($key) - { - $contexts = drush_context_names(); - $contexts = array_filter($contexts, function ($item) { return $item != 'default'; }); - - foreach ($contexts as $context) { - $value = _drush_get_option($option, drush_get_context($context)); - - if ($value !== NULL) { - return true; - } - } - return false; - } - - /** - * Fetch a configuration value - * - * @param string $key Which config item to look up - * @param string|null $default Value to use when $key does not exist - * - * @return mixed - */ - public function get($key, $default = null) - { - return drush_get_option($key, $default); - } - - /** - * Set a config value - * - * @param string $key - * @param mixed $value - * - * @return $this - */ - public function set($key, $value) - { - drush_set_option($key, $value); - } - - /** - * export returns a collection of all of the - * configuration available in the config object, although - * in truth this list is pared down to include only - * those values that are common to Drush 8 and Drush 9. - */ - public function export() - { - $data = new Data; - $contextData = drush_get_merged_options(); - $cliData = drush_get_context('cli'); - foreach ($cliData as $key => $value) { - $data->set("options.$key", $value); - unset($contextData[$key]); - } - foreach ($contextData as $key => $value) { - $data->set($key, $value); - } - return $data->export(); - } - - /** - * Return the default value for a given configuration item. - * - * @param string $key - * - * @return mixed - */ - public function hasDefault($key) - { - $value = $this->getDefault($key); - return $value != null; - } - - /** - * Return the default value for a given configuration item. - * - * @param string $key - * @param mixed $default - * - * @return mixed - */ - public function getDefault($key, $default = null) - { - return drush_get_option($key, $default, 'default'); - } - - /** - * Set the default value for a configuration setting. This allows us to - * set defaults either before or after more specific configuration values - * are loaded. Keeping defaults separate from current settings also - * allows us to determine when a setting has been overridden. - * - * @param string $key - * @param string $value - */ - public function setDefault($key, $value) - { - drush_set_default($key, $value); - } - - /** - * Determine whether we are in 'backend' mode - */ - public function backend() - { - return drush_get_context('DRUSH_BACKEND'); - } - - /** - * Determine whether we are in 'simulate' mode - */ - public function simulate() - { - return drush_get_context('DRUSH_SIMULATE'); - } - - public function drushScript() - { - return DRUSH_COMMAND; - } -} diff --git a/vendor/drush/drush/lib/Drush/Log/DrushLog.php b/vendor/drush/drush/lib/Drush/Log/DrushLog.php deleted file mode 100644 index c2323e8b1f3f6f21d0a41c8bad0f14834b64a80a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Log/DrushLog.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php - -/** - * @file - * Contains \Drush\Log\DrushLog. - * - * This class is only used to convert logging calls made - * inside of Drupal into a logging format that is usable - * by Drush. This code is ONLY usable within the context - * of a bootstrapped Drupal 8 site. - * - * See Drush\Log\Logger for our actuall LoggerInterface - * implementation, that does the work of logging messages - * that originate from Drush. - */ - -namespace Drush\Log; - -use Drupal\Core\Logger\LogMessageParserInterface; -use Drupal\Core\Logger\RfcLoggerTrait; -use Drupal\Core\Logger\RfcLogLevel; -use Psr\Log\LoggerInterface; - -/** - * Redirects Drupal logging messages to Drush log. - * - * Note that Drupal extends the LoggerInterface, and - * needlessly replaces Psr\Log\LogLevels with Drupal\Core\Logger\RfcLogLevel. - * Doing this arguably violates the Psr\Log contract, - * but we can't help that here -- we just need to convert back. - */ -class DrushLog implements LoggerInterface { - - use RfcLoggerTrait; - - /** - * The message's placeholders parser. - * - * @var \Drupal\Core\Logger\LogMessageParserInterface - */ - protected $parser; - - /** - * The logger that messages will be passed through to. - */ - protected $logger; - - /** - * Constructs a DrushLog object. - * - * @param \Drupal\Core\Logger\LogMessageParserInterface $parser - * The parser to use when extracting message variables. - */ - public function __construct(LogMessageParserInterface $parser, LoggerInterface $logger) { - $this->parser = $parser; - $this->logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function log($level, $message, array $context = array()) { - // Translate the RFC logging levels into their Drush counterparts, more or - // less. - // @todo ALERT, CRITICAL and EMERGENCY are considered show-stopping errors, - // and they should cause Drush to exit or panic. Not sure how to handle this, - // though. - switch ($level) { - case RfcLogLevel::ALERT: - case RfcLogLevel::CRITICAL: - case RfcLogLevel::EMERGENCY: - case RfcLogLevel::ERROR: - $error_type = LogLevel::ERROR; - break; - - case RfcLogLevel::WARNING: - $error_type = LogLevel::WARNING; - break; - - // TODO: RfcLogLevel::DEBUG should be 'debug' rather than 'notice'? - case RfcLogLevel::DEBUG: - case RfcLogLevel::INFO: - case RfcLogLevel::NOTICE: - $error_type = LogLevel::NOTICE; - break; - - // TODO: Unknown log levels that are not defined - // in Psr\Log\LogLevel or Drush\Log\LogLevel SHOULD NOT be used. See - // https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md - // We should convert these to 'notice'. - default: - $error_type = $level; - break; - } - - // Populate the message placeholders and then replace them in the message. - $message_placeholders = $this->parser->parseMessagePlaceholders($message, $context); - - // Filter out any placeholders that can not be cast to strings. - $message_placeholders = array_filter($message_placeholders, function ($element) { - return is_scalar($element) || is_callable([$element, '__toString']); - }); - - $message = empty($message_placeholders) ? $message : strtr($message, $message_placeholders); - - $this->logger->log($error_type, $message, $context); - } - -} diff --git a/vendor/drush/drush/lib/Drush/Log/Logger.php b/vendor/drush/drush/lib/Drush/Log/Logger.php deleted file mode 100644 index f2d6b5b75862bbce77a04271e240ad66a0f4786f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Log/Logger.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php - -/** - * @file - * Contains \Drush\Log\Logger. - * - * This is the actual Logger for Drush that is responsible - * for logging messages. - * - * This logger is designed such that it can be provided to - * other libraries that log to a Psr\Log\LoggerInterface. - * As such, it takes responsibility for passing log messages - * to backend invoke, as necessary (c.f. drush_backend_packet()). - * - * Drush supports all of the required log levels from Psr\Log\LogLevel, - * and also defines its own. See Drush\Log\LogLevel. - * - * Those who may wish to change the way logging works in Drush - * should therefore NOT attempt to replace this logger with their - * own LoggerInterface, as it will not work. It would be okay - * to extend Drush\Log\Logger, or perhaps we could provide a way - * to set an output I/O object here, in case output redirection - * was the only thing that needed to be swapped out. - */ - -namespace Drush\Log; - -use Drush\Log\LogLevel; -use Psr\Log\AbstractLogger; - -class Logger extends AbstractLogger { - - public function log($level, $message, array $context = array()) { - // Convert to old $entry array for b/c calls - $entry = $context; - $entry['type'] = $level; - $entry['message'] = $message; - if (!isset($entry['memory'])) { - $entry['memory'] = memory_get_usage(); - } - if (!isset($entry['timestamp'])) { - $entry['timestamp'] = microtime(TRUE); - } - - // Drush\Log\Logger should take over all of the responsibilities - // of drush_log, including caching the log messages and sending - // log messages along to backend invoke. - // TODO: move these implementations inside this class. - $log =& drush_get_context('DRUSH_LOG', array()); - $log[] = $entry; - if ($level != LogLevel::DEBUG_NOTIFY) { - drush_backend_packet('log', $entry); - } - - if (drush_get_context('DRUSH_NOCOLOR')) { - $red = "[%s]"; - $yellow = "[%s]"; - $green = "[%s]"; - } - else { - $red = "\033[31;40m\033[1m[%s]\033[0m"; - $yellow = "\033[1;33;40m\033[1m[%s]\033[0m"; - $green = "\033[1;32;40m\033[1m[%s]\033[0m"; - } - - $verbose = drush_get_context('DRUSH_VERBOSE'); - $debug = drush_get_context('DRUSH_DEBUG'); - $debugnotify = drush_get_context('DRUSH_DEBUG_NOTIFY'); - - switch ($level) { - case LogLevel::WARNING : - case LogLevel::CANCEL : - $type_msg = sprintf($yellow, $level); - break; - case 'failed' : // Obsolete; only here in case contrib is using it. - case LogLevel::EMERGENCY : // Not used by Drush - case LogLevel::ALERT : // Not used by Drush - case LogLevel::ERROR : - $type_msg = sprintf($red, $level); - break; - case LogLevel::OK : - case 'completed' : // Obsolete; only here in case contrib is using it. - case LogLevel::SUCCESS : - case 'status': // Obsolete; only here in case contrib is using it. - // In quiet mode, suppress progress messages - if (drush_get_context('DRUSH_QUIET')) { - return TRUE; - } - $type_msg = sprintf($green, $level); - break; - case LogLevel::NOTICE : - case 'message' : // Obsolete; only here in case contrib is using it. - case LogLevel::INFO : - if (!$verbose) { - // print nothing. exit cleanly. - return TRUE; - } - $type_msg = sprintf("[%s]", $level); - break; - case LogLevel::DEBUG_NOTIFY : - $level = LogLevel::DEBUG; // Report 'debug', handle like 'preflight' - case LogLevel::PREFLIGHT : - if (!$debugnotify) { - // print nothing unless --debug AND --verbose. exit cleanly. - return TRUE; - } - $type_msg = sprintf("[%s]", $level); - break; - case LogLevel::BOOTSTRAP : - case LogLevel::DEBUG : - default : - if (!$debug) { - // print nothing. exit cleanly. - return TRUE; - } - $type_msg = sprintf("[%s]", $level); - break; - } - - // When running in backend mode, log messages are not displayed, as they will - // be returned in the JSON encoded associative array. - if (drush_get_context('DRUSH_BACKEND')) { - return; - } - - $columns = drush_get_context('DRUSH_COLUMNS', 80); - - $width[1] = 11; - // Append timer and memory values. - if ($debug) { - $timer = sprintf('[%s sec, %s]', round($entry['timestamp']-DRUSH_REQUEST_TIME, 2), drush_format_size($entry['memory'])); - $entry['message'] = $entry['message'] . ' ' . $timer; - } - - $width[0] = ($columns - 11); - - $format = sprintf("%%-%ds%%%ds", $width[0], $width[1]); - - // Place the status message right aligned with the top line of the error message. - $message = wordwrap($entry['message'], $width[0]); - $lines = explode("\n", $message); - $lines[0] = sprintf($format, $lines[0], $type_msg); - $message = implode("\n", $lines); - drush_print($message, 0, STDERR); - - } - - -} diff --git a/vendor/drush/drush/lib/Drush/Make/Parser/ParserIni.php b/vendor/drush/drush/lib/Drush/Make/Parser/ParserIni.php deleted file mode 100644 index c512072522255f48224844349ce7a69ae849927d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Make/Parser/ParserIni.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -/** - * @file - * Parser for INI format. - */ - -namespace Drush\Make\Parser; - -class ParserIni implements ParserInterface { - - /** - * Regex for parsing INI format. - */ - private static $iniRegex = ' - @^\s* # Start at the beginning of a line, ignoring leading whitespace - ((?: - [^=;\[\]]| # Key names cannot contain equal signs, semi-colons or square brackets, - \[[^\[\]]*\] # unless they are balanced and not nested - )+?) - \s*=\s* # Key/value pairs are separated by equal signs (ignoring white-space) - (?: - ("(?:[^"]|(?<=\\\\)")*")| # Double-quoted string, which may contain slash-escaped quotes/slashes - (\'(?:[^\']|(?<=\\\\)\')*\')| # Single-quoted string, which may contain slash-escaped quotes/slashes - ([^\r\n]*?) # Non-quoted string - )\s*$ # Stop at the next end of a line, ignoring trailing whitespace - @msx'; - - /** - * {@inheritdoc} - */ - public static function supportedFile($filename) { - $info = pathinfo($filename); - return isset($info['extension']) && $info['extension'] === 'make'; - } - - /** - * {@inheritdoc} - */ - public static function parse($data) { - if (preg_match_all(self::$iniRegex, $data, $matches, PREG_SET_ORDER)) { - $info = array(); - foreach ($matches as $match) { - // Fetch the key and value string. - $i = 0; - foreach (array('key', 'value1', 'value2', 'value3') as $var) { - $$var = isset($match[++$i]) ? $match[$i] : ''; - } - $value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3; - - // Parse array syntax. - $keys = preg_split('/\]?\[/', rtrim($key, ']')); - $last = array_pop($keys); - $parent = &$info; - - // Create nested arrays. - foreach ($keys as $key) { - if ($key == '') { - $key = count($parent); - } - if (isset($merge_item) && isset($parent[$key]) && !is_array($parent[$key])) { - $parent[$key] = array($merge_item => $parent[$key]); - } - if (!isset($parent[$key]) || !is_array($parent[$key])) { - $parent[$key] = array(); - } - $parent = &$parent[$key]; - } - - // Handle PHP constants. - if (defined($value)) { - $value = constant($value); - } - - // Insert actual value. - if ($last == '') { - $last = count($parent); - } - if (isset($merge_item) && isset($parent[$last]) && is_array($parent[$last])) { - $parent[$last][$merge_item] = $value; - } - else { - $parent[$last] = $value; - } - } - return $info; - } - } - -} diff --git a/vendor/drush/drush/lib/Drush/Make/Parser/ParserInterface.php b/vendor/drush/drush/lib/Drush/Make/Parser/ParserInterface.php deleted file mode 100644 index d9e16a29d37b7c7d1f5f0829b2a7853bc77e8498..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Make/Parser/ParserInterface.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * @file - * Interface for make file parsing. - */ - -namespace Drush\Make\Parser; - -interface ParserInterface { - - /** - * Determine if a given file is supported. - * - * @param string $filename - * - * @return bool - */ - public static function supportedFile($filename); - - /** - * Parse an input string into an array. - * - * @param string $data - * - * @return array - * Makefile data as an array. - */ - public static function parse($data); - -} diff --git a/vendor/drush/drush/lib/Drush/Make/Parser/ParserYaml.php b/vendor/drush/drush/lib/Drush/Make/Parser/ParserYaml.php deleted file mode 100644 index 25916194f680342f4a39c5991ce2e4c256d6bc31..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Make/Parser/ParserYaml.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/** - * @file - * Parser for YAML format. - */ - -namespace Drush\Make\Parser; - -use Symfony\Component\Yaml\Yaml; - -class ParserYaml implements ParserInterface { - - /** - * {@inheritdoc} - */ - public static function supportedFile($filename) { - $info = pathinfo($filename); - return isset($info['extension']) && $info['extension'] === 'yml'; - } - - /** - * {@inheritdoc} - */ - public static function parse($data) { - return Yaml::parse($data); - } - -} diff --git a/vendor/drush/drush/lib/Drush/Psysh/Caster.php b/vendor/drush/drush/lib/Drush/Psysh/Caster.php deleted file mode 100644 index adfa901b538da53a5b651d0e087865f4af0e3d1a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Psysh/Caster.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php - -/** - * @file - * Contains \Drush\Psysh\Caster. - */ - -namespace Drush\Psysh; - -use Symfony\Component\VarDumper\Caster\Caster as BaseCaster; - -/** - * Caster class for VarDumper casters for the shell. - */ -class Caster { - - /** - * Casts \Drupal\Core\Entity\ContentEntityInterface classes. - */ - public static function castContentEntity($entity, $array, $stub, $isNested) { - if (!$isNested) { - foreach ($entity as $property => $item) { - $array[BaseCaster::PREFIX_PROTECTED . $property] = $item; - } - } - - return $array; - } - - /** - * Casts \Drupal\Core\Field\FieldItemListInterface classes. - */ - public static function castFieldItemList($list_item, $array, $stub, $isNested) { - if (!$isNested) { - foreach ($list_item as $delta => $item) { - $array[BaseCaster::PREFIX_VIRTUAL . $delta] = $item; - } - } - - return $array; - } - - /** - * Casts \Drupal\Core\Field\FieldItemInterface classes. - */ - public static function castFieldItem($item, $array, $stub, $isNested) { - if (!$isNested) { - $array[BaseCaster::PREFIX_VIRTUAL . 'value'] = $item->getValue(); - } - - return $array; - } - - /** - * Casts \Drupal\Core\Config\Entity\ConfigEntityInterface classes. - */ - public static function castConfigEntity($entity, $array, $stub, $isNested) { - if (!$isNested) { - foreach ($entity->toArray() as $property => $value) { - $array[BaseCaster::PREFIX_PROTECTED . $property] = $value; - } - } - - return $array; - } - - /** - * Casts \Drupal\Core\Config\ConfigBase classes. - */ - public static function castConfig($config, $array, $stub, $isNested) { - if (!$isNested) { - foreach ($config->get() as $property => $value) { - $array[BaseCaster::PREFIX_VIRTUAL . $property] = $value; - } - } - - return $array; - } - - /** - * Casts \Drupal\Component\DependencyInjection\Container classes. - */ - public static function castContainer($container, $array, $stub, $isNested) { - if (!$isNested) { - $service_ids = $container->getServiceIds(); - sort($service_ids); - foreach ($service_ids as $service_id) { - $service = $container->get($service_id); - $array[BaseCaster::PREFIX_VIRTUAL . $service_id] = is_object($service) ? get_class($service) : $service; - } - } - - return $array; - } - -} diff --git a/vendor/drush/drush/lib/Drush/Psysh/DrushCommand.php b/vendor/drush/drush/lib/Drush/Psysh/DrushCommand.php deleted file mode 100644 index 7e9ae0077bfcea3d391204e8947859a6fbe061e1..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Psysh/DrushCommand.php +++ /dev/null @@ -1,244 +0,0 @@ -<?php -/** - * @file - * Contains \Drush\Psysh\DrushCommand. - * - * DrushCommand is a PsySH proxy command which accepts a Drush command config - * array and tries to build an appropriate PsySH command for it. - */ - -namespace Drush\Psysh; - -use Psy\Command\Command as BaseCommand; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Main Drush command. - */ -class DrushCommand extends BaseCommand { - - /** - * @var array - */ - private $config; - - /** - * @var string - */ - private $category = ''; - - /** - * DrushCommand constructor. - * - * This accepts the Drush command configuration array and does a pretty - * decent job of building a PsySH command proxy for it. Wheee! - * - * @param array $config - * Drush command configuration array. - */ - public function __construct(array $config) { - $this->config = $config; - parent::__construct(); - } - - /** - * Get Category of this command. - */ - public function getCategory() { - return $this->category; - } - - /** - * Sets the category title. - * - * @param string $category_title - */ - public function setCategory($category_title) { - $this->category = $category_title; - } - - /** - * {@inheritdoc} - */ - protected function configure() { - $this - ->setName($this->config['command']) - ->setAliases($this->buildAliasesFromConfig()) - ->setDefinition($this->buildDefinitionFromConfig()) - ->setDescription($this->config['description']) - ->setHelp($this->buildHelpFromConfig()); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) { - $args = $input->getArguments(); - $first = array_shift($args); - - // If the first argument is an alias, assign the next argument as the - // command. - if (strpos($first, '@') === 0) { - $alias = $first; - $command = array_shift($args); - } - // Otherwise, default the alias to '@self' and use the first argument as the - // command. - else { - $alias = '@self'; - $command = $first; - } - - $options = $input->getOptions(); - // Force the 'backend' option to TRUE. - $options['backend'] = TRUE; - - $return = drush_invoke_process($alias, $command, array_values($args), $options, ['interactive' => TRUE]); - - if ($return['error_status'] > 0) { - foreach ($return['error_log'] as $error_type => $errors) { - $output->write($errors); - } - // Add a newline after so the shell returns on a new line. - $output->writeln(''); - } - else { - $output->page(drush_backend_get_result()); - } - } - - /** - * Extract Drush command aliases from config array. - * - * @return array - * The command aliases. - */ - protected function buildAliasesFromConfig() { - return !empty($this->config['aliases']) ? $this->config['aliases'] : []; - } - - /** - * Build a command definition from Drush command configuration array. - * - * Currently, adds all non-hidden arguments and options, and makes a decent - * effort to guess whether an option accepts a value or not. It isn't always - * right :P - * - * @return array - * the command definition. - */ - protected function buildDefinitionFromConfig() { - $definitions = []; - - if (isset($this->config['arguments']) && !empty($this->config['arguments'])) { - $required_args = $this->config['required-arguments']; - - if ($required_args === FALSE) { - $required_args = 0; - } - elseif ($required_args === TRUE) { - $required_args = count($this->config['arguments']); - } - - foreach ($this->config['arguments'] as $name => $argument) { - if (!is_array($argument)) { - $argument = ['description' => $argument]; - } - - if (!empty($argument['hidden'])) { - continue; - } - - $input_type = ($required_args-- > 0) ? InputArgument::REQUIRED : InputArgument::OPTIONAL; - - $definitions[] = new InputArgument($name, $input_type, $argument['description'], NULL); - } - } - - // First create all global options. - $options = $this->config['options'] + drush_get_global_options(); - - // Add command specific options. - $definitions = array_merge($definitions, $this->createInputOptionsFromConfig($options)); - - return $definitions; - } - - /** - * Creates input definitions from command options. - * - * @param array $options_config - * - * @return \Symfony\Component\Console\Input\InputInterface[] - */ - protected function createInputOptionsFromConfig(array $options_config) { - $definitions = []; - - foreach ($options_config as $name => $option) { - // Some commands will conflict. - if (in_array($name, ['help', 'command'])) { - continue; - } - - if (!is_array($option)) { - $option = ['description' => $option]; - } - - if (!empty($option['hidden'])) { - continue; - } - - // @todo: Figure out if there's a way to detect InputOption::VALUE_NONE - // (i.e. flags) via the config array. - if (isset($option['value']) && $option['value'] === 'required') { - $input_type = InputOption::VALUE_REQUIRED; - } - else { - $input_type = InputOption::VALUE_OPTIONAL; - } - - $definitions[] = new InputOption($name, !empty($option['short-form']) ? $option['short-form'] : '', $input_type, $option['description']); - } - - return $definitions; - } - - /** - * Build a command help from the Drush configuration array. - * - * Currently it's a word-wrapped description, plus any examples provided. - * - * @return string - * The help string. - */ - protected function buildHelpFromConfig() { - $help = wordwrap($this->config['description']); - - $examples = []; - foreach ($this->config['examples'] as $ex => $def) { - // Skip empty examples and things with obvious pipes... - if (($ex === '') || (strpos($ex, '|') !== FALSE)) { - continue; - } - - $ex = preg_replace('/^drush\s+/', '', $ex); - $examples[$ex] = $def; - } - - if (!empty($examples)) { - $help .= "\n\ne.g."; - - foreach ($examples as $ex => $def) { - $help .= sprintf("\n<return>// %s</return>\n", wordwrap(OutputFormatter::escape($def), 75, "</return>\n<return>// ")); - $help .= sprintf("<return>>>> %s</return>\n", OutputFormatter::escape($ex)); - } - } - - return $help; - } - -} diff --git a/vendor/drush/drush/lib/Drush/Psysh/DrushHelpCommand.php b/vendor/drush/drush/lib/Drush/Psysh/DrushHelpCommand.php deleted file mode 100644 index 9a3961f13c9dbd4d3e16fc3f2d9b0bebc3579246..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Psysh/DrushHelpCommand.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php - -/** - * @file - * Contains \Drush\Psysh\DrushCommand. - */ - -namespace Drush\Psysh; - -use Psy\Command\Command as BaseCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Help command. - * - * Lists available commands, and gives command-specific help when asked nicely. - * - * This replaces the PsySH help command to list commands by category. - */ -class DrushHelpCommand extends BaseCommand { - - /** - * Label for PsySH commands. - */ - const PSYSH_CATEGORY = 'PsySH commands'; - - /** - * The currently set subcommand. - * - * @var \Symfony\Component\Console\Command\Command - */ - protected $command; - - /** - * {@inheritdoc} - */ - protected function configure() { - $this - ->setName('help') - ->setAliases(['?']) - ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', NULL), - ]) - ->setDescription('Show a list of commands. Type `help [foo]` for information about [foo].'); - } - - /** - * Helper for setting a subcommand to retrieve help for. - * - * @param \Symfony\Component\Console\Command\Command $command - */ - public function setCommand(Command $command) { - $this->command = $command; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) { - if ($this->command !== NULL) { - // Help for an individual command. - $output->page($this->command->asText()); - $this->command = NULL; - } - elseif ($name = $input->getArgument('command_name')) { - // Help for an individual command. - $output->page($this->getApplication()->get($name)->asText()); - } - else { - $categories = []; - - // List available commands. - $commands = $this->getApplication()->all(); - - // Find the alignment width. - $width = 0; - foreach ($commands as $command) { - $width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width; - } - $width += 2; - - foreach ($commands as $name => $command) { - if ($name !== $command->getName()) { - continue; - } - - if ($command->getAliases()) { - $aliases = sprintf(' <comment>Aliases:</comment> %s', implode(', ', $command->getAliases())); - } - else { - $aliases = ''; - } - - if ($command instanceof DrushCommand) { - $category = (string) $command->getCategory(); - } - else { - $category = static::PSYSH_CATEGORY; - } - - if (!isset($categories[$category])) { - $categories[$category] = []; - } - - $categories[$category][] = sprintf(" <info>%-${width}s</info> %s%s", $name, $command->getDescription(), $aliases); - } - - $messages = []; - - foreach ($categories as $name => $category) { - $messages[] = ''; - $messages[] = sprintf('<comment>%s</comment>', OutputFormatter::escape($name)); - foreach ($category as $message) { - $messages[] = $message; - } - } - - $output->page($messages); - } - } - -} diff --git a/vendor/drush/drush/lib/Drush/Psysh/Shell.php b/vendor/drush/drush/lib/Drush/Psysh/Shell.php deleted file mode 100644 index 7e065af8f32e72beba4d7459db700015e945c58d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Psysh/Shell.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/** - * @file - * Contains \Drush\Psysh\Shell. - */ - -namespace Drush\Psysh; - -use Psy\Shell as BaseShell; -use Symfony\Component\Console\Input\StringInput; - -class Shell extends BaseShell { - - /** - * Get a command (if one exists) for the current input string. - * - * @param string $input - * - * @return null|Command - */ - protected function getCommand($input) { - if ($name = $this->getCommandFromInput($input)) { - return $this->get($name); - } - } - - /** - * Check whether a command is set for the current input string. - * - * @param string $input - * - * @return bool True if the shell has a command for the given input. - */ - protected function hasCommand($input) { - if ($name = $this->getCommandFromInput($input)) { - return $this->has($name); - } - - return false; - } - - /** - * Get the command from the current input, takes aliases into account. - * - * @param string $input - * The raw input - * - * @return string|NULL - * The current command. - */ - protected function getCommandFromInput($input) { - // Remove the alias from the start of the string before parsing and - // returning the command. Essentially, when choosing a command, we're - // ignoring the site alias. - $input = preg_replace('|^\@[^\s]+|', '', $input); - - $input = new StringInput($input); - return $input->getFirstArgument(); - } - -} diff --git a/vendor/drush/drush/lib/Drush/Queue/Queue6.php b/vendor/drush/drush/lib/Drush/Queue/Queue6.php deleted file mode 100644 index 2b3a552079f50b4d5e80ef967b72eb4fbac6d572..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Queue/Queue6.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Drush\Queue; - -class Queue6 extends Queue7 { - - public function __construct() { - // Drupal 6 has no core queue capabilities, and thus requires contrib. - if (!module_exists('drupal_queue')) { - throw new QueueException(dt('The drupal_queue module need to be installed/enabled.')); - } - else { - drupal_queue_include(); - } - } - - /** - * {@inheritdoc} - */ - public function getQueues() { - if (!isset(static::$queues)) { - static::$queues = module_invoke_all('cron_queue_info'); - drupal_alter('cron_queue_info', static::$queues); - } - return static::$queues; - } - -} diff --git a/vendor/drush/drush/lib/Drush/Queue/Queue7.php b/vendor/drush/drush/lib/Drush/Queue/Queue7.php deleted file mode 100644 index 21a65b514457aa113af8fb8714670435c3006a9e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Queue/Queue7.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Drush\Queue; - -use Drush\Log\LogLevel; -use DrupalQueue; - -class Queue7 extends QueueBase { - - /** - * {@inheritdoc} - */ - public function getQueues() { - if (!isset(static::$queues)) { - static::$queues = module_invoke_all('cron_queue_info'); - drupal_alter('cron_queue_info', static::$queues); - // Merge in queues from modules that implement hook_queue_info. - // Currently only defined by the queue_ui module. - $info_queues = module_invoke_all('queue_info'); - foreach ($info_queues as $name => $queue) { - static::$queues[$name]['worker callback'] = $queue['cron']['callback']; - if (isset($queue['cron']['time'])) { - static::$queues[$name]['time'] = $queue['cron']['time']; - } - } - } - return static::$queues; - } - - /** - * {@inheritdoc} - * - * @return \DrupalQueueInterface - */ - public function getQueue($name) { - return DrupalQueue::get($name); - } - - /** - * {@inheritdoc} - */ - public function run($name, $time_limit = 0) { - $info = $this->getInfo($name); - $function = $info['worker callback']; - $end = time() + $time_limit; - $queue = $this->getQueue($name); - $count = 0; - - while ((!$time_limit || time() < $end) && ($item = $queue->claimItem())) { - try { - drush_log(dt('Processing item @id from @name queue.', array('@name' => $name, 'id' => $item->item_id)), LogLevel::INFO); - $function($item->data); - $queue->deleteItem($item); - $count++; - } - catch (\Exception $e) { - // In case of exception log it and leave the item in the queue - // to be processed again later. - drush_set_error('DRUSH_QUEUE_EXCEPTION', $e->getMessage()); - } - } - - return $count; - } - -} diff --git a/vendor/drush/drush/lib/Drush/Queue/Queue8.php b/vendor/drush/drush/lib/Drush/Queue/Queue8.php deleted file mode 100644 index b0fa0a66794684c0fc635e028ec7c3f8a2d77a04..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Queue/Queue8.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -namespace Drush\Queue; - -use Drush\Log\LogLevel; -use Drupal\Core\Queue\QueueWorkerManager; -use Drupal\Core\Queue\RequeueException; -use Drupal\Core\Queue\SuspendQueueException; - -class Queue8 extends QueueBase { - - /** - * @var \Drupal\Core\Queue\QueueWorkerManager - */ - protected $workerManager; - - /** - * Set the queue worker manager. - */ - public function __construct(QueueWorkerManager $manager = NULL) { - $this->workerManager = $manager ?: \Drupal::service('plugin.manager.queue_worker'); - } - - /** - * {@inheritdoc} - */ - public function getQueues() { - if (!isset(static::$queues)) { - static::$queues = array(); - foreach ($this->workerManager->getDefinitions() as $name => $info) { - static::$queues[$name] = $info; - } - } - return static::$queues; - } - - /** - * {@inheritdoc} - * - * @return \Drupal\Core\Queue\QueueInterface - */ - public function getQueue($name) { - return \Drupal::queue($name); - } - - /** - * {@inheritdoc} - */ - public function run($name, $time_limit = 0) { - $worker = $this->workerManager->createInstance($name); - $end = time() + $time_limit; - $queue = $this->getQueue($name); - $count = 0; - - while ((!$time_limit || time() < $end) && ($item = $queue->claimItem())) { - try { - drush_log(dt('Processing item @id from @name queue.', array('@name' => $name, '@id' => $item->item_id)), LogLevel::INFO); - $worker->processItem($item->data); - $queue->deleteItem($item); - $count++; - } - catch (RequeueException $e) { - // The worker requested the task to be immediately requeued. - $queue->releaseItem($item); - } - catch (SuspendQueueException $e) { - // If the worker indicates there is a problem with the whole queue, - // release the item and stop further processing. - $queue->releaseItem($item); - drush_set_error('DRUSH_SUSPEND_QUEUE_EXCEPTION', $e->getMessage()); - break; - } - catch (\Exception $e) { - // In case of any other kind of exception, log it and leave the item - // in the queue to be processed again later. - drush_set_error('DRUSH_QUEUE_EXCEPTION', $e->getMessage()); - } - } - - return $count; - } - -} diff --git a/vendor/drush/drush/lib/Drush/Queue/QueueBase.php b/vendor/drush/drush/lib/Drush/Queue/QueueBase.php deleted file mode 100644 index d3001a45c77bc0dd2aa2ca7206e2101104f1ac72..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Queue/QueueBase.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drush\Queue; - -abstract class QueueBase implements QueueInterface { - - /** - * Keep track of queue definitions. - * - * @var array - */ - protected static $queues; - - /** - * Lists all available queues. - */ - public function listQueues() { - $result = array(); - foreach (array_keys($this->getQueues()) as $name) { - $q = $this->getQueue($name); - $result[$name] = array( - 'queue' => $name, - 'items' => $q->numberOfItems(), - 'class' => get_class($q), - ); - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function getInfo($name) { - $queues = $this->getQueues(); - if (!isset($queues[$name])) { - throw new QueueException(dt('Could not find the !name queue.', array('!name' => $name))); - } - return $queues[$name]; - } - -} diff --git a/vendor/drush/drush/lib/Drush/Queue/QueueException.php b/vendor/drush/drush/lib/Drush/Queue/QueueException.php deleted file mode 100644 index 9f477e45e46f91a617bf3d433a5c622722af681b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Queue/QueueException.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -namespace Drush\Queue; - -class QueueException extends \Exception {} diff --git a/vendor/drush/drush/lib/Drush/Queue/QueueInterface.php b/vendor/drush/drush/lib/Drush/Queue/QueueInterface.php deleted file mode 100644 index 5d8adba1ad0bfc50e9d54addb71d5f07d2c38004..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Queue/QueueInterface.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drush\Queue; - -/** - * Defines an interface for interacting with queues. - */ -interface QueueInterface { - - /** - * Returns all queues. - */ - public function getQueues(); - - /** - * Runs a given queue. - * - * @param string $name - * The name of the queue to run. - * @param int $time_limit - * The maximum number of seconds that the queue can run. By default the - * queue will be run as long as possible. - * - * @return int - * The number of items successfully processed from the queue. - */ - public function run($name, $time_limit = 0); - - /** - * Returns a given queue definition. - * - * @param string $name - * The name of the queue to run. - */ - public function getQueue($name); - - /** - * Returns a given queue definition. - * - * @param string $name - * The name of the queue to run. - */ - public function getInfo($name); - -} diff --git a/vendor/drush/drush/lib/Drush/Role/Role6.php b/vendor/drush/drush/lib/Drush/Role/Role6.php deleted file mode 100644 index 5c768bd4098e401d740562652319aae19c75520b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Role/Role6.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Drush\Role; - -class Role6 extends RoleBase { - public $perms = array(); - - public function getPerms() { - if (empty($this->perms)) { - $perms = db_result(db_query("SELECT perm FROM {permission} pm LEFT JOIN {role} r ON r.rid = pm.rid WHERE r.rid = '%d'", $this->rid)); - $role_perms = explode(", ", $perms); - $this->perms = array_filter($role_perms); - } - return $this->perms; - } - - public function getModulePerms($module) { - return module_invoke($module, 'perm'); - } - - public function role_create($role_machine_name, $role_human_readable_name = '') { - $this->_admin_user_role_op($role_machine_name, t('Add role')); - return TRUE; - } - - public function delete() { - $this->_admin_user_role_op($this->rid, t('Delete role')); - } - - function _admin_user_role_op($role_machine_name, $op) { - // c.f. http://drupal.org/node/283261 - require_once(drupal_get_path('module', 'user') . "/user.admin.inc"); - - $form_id = "user_admin_new_role"; - $form_values = array(); - $form_values["name"] = $role_machine_name; - $form_values["op"] = $op; - $form_state = array(); - $form_state["values"] = $form_values; - - drupal_execute($form_id, $form_state); - } - - public function grant_permissions($perms_to_add) { - $perms = $this->getPerms(); - $this->perms = array_unique(array_merge($this->perms, $perms_to_add)); - $this->updatePerms(); - } - - public function revoke_permissions($perms_to_remove) { - $perms = $this->getPerms(); - $this->perms = array_diff($this->perms, $perms_to_remove); - $this->updatePerms(); - } - - function updatePerms() { - $new_perms = implode(", ", $this->perms); - drush_op('db_query', "UPDATE {permission} SET perm = '%s' WHERE rid= %d", $new_perms, $this->rid); - } -} diff --git a/vendor/drush/drush/lib/Drush/Role/Role7.php b/vendor/drush/drush/lib/Drush/Role/Role7.php deleted file mode 100644 index 65e5813ea0fd51fe60c9dfd1dc896f95e82efeb4..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Role/Role7.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -namespace Drush\Role; - -class Role7 extends RoleBase { - public function getPerms() { - $perms = user_role_permissions(array($this->rid => $this->name)); - return array_keys($perms[$this->rid]); - } - - public function getModulePerms($module) { - $perms = module_invoke($module, 'permission'); - return $perms ? array_keys($perms) : array(); - } - - public function role_create($role_machine_name, $role_human_readable_name = '') { - return user_role_save((object)array('name' => $role_machine_name)); - } - - public function delete() { - user_role_delete($this->rid); - } - - public function grant_permissions($perms) { - return drush_op('user_role_grant_permissions', $this->rid, $perms); - } - - public function revoke_permissions($perms) { - return drush_op('user_role_revoke_permissions', $this->rid, $perms); - } -} diff --git a/vendor/drush/drush/lib/Drush/Role/Role8.php b/vendor/drush/drush/lib/Drush/Role/Role8.php deleted file mode 100644 index ce0b28eaec302dc83f69949418a148608c4329e8..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Role/Role8.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -namespace Drush\Role; - -use Drupal\user\Entity\Role; - -class Role8 extends Role7 { - public function role_create($role_machine_name, $role_human_readable_name = '') { - // In D6 and D7, when we create a new role, the role - // machine name is specified, and the numeric rid is - // auto-assigned (next available id); in D8, when we - // create a new role, we need to specify both the rid, - // which is now the role machine name, and also a human-readable - // role name. If the client did not provide a human-readable - // name, then we'll use the role machine name in its place. - if (empty($role_human_readable_name)) { - $role_human_readable_name = ucfirst($role_machine_name); - } - $role = new Role(array( - 'id' => $role_machine_name, - 'label' => $role_human_readable_name, - ), 'user_role'); - $role->save(); - return $role; - } - - public function getPerms() { - $role = entity_load('user_role', $this->rid); - $perms = $role->getPermissions(); - // $perms = user_role_permissions(array($this->rid => $this->name)); - return $perms; - } - - public function getAllModulePerms() { - $perms = \Drupal::service('user.permissions')->getPermissions(); - return array_keys($perms); - } - - public function getModulePerms($module) { - $module_perms = array(); - $perms = \Drupal::service('user.permissions')->getPermissions(); - foreach ($perms as $name => $perm) { - if ($perm['provider'] == $module) { - $module_perms[] = $name; - } - } - return $module_perms; - } - - public function delete() { - $role = entity_load('user_role', $this->rid); - $role->delete(); - } - - public function grant_permissions($perms) { - return drush_op('user_role_grant_permissions', $this->rid, $perms); - } - - public function revoke_permissions($perms) { - return drush_op('user_role_revoke_permissions', $this->rid, $perms); - } -} diff --git a/vendor/drush/drush/lib/Drush/Role/RoleBase.php b/vendor/drush/drush/lib/Drush/Role/RoleBase.php deleted file mode 100644 index 5e19d4282ff06be6a2d9e95e4557661de5ce4c28..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Role/RoleBase.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php - -namespace Drush\Role; - -abstract class RoleBase { - /** - * Drupal 6 and Drupal 7: - * 'rid' is numeric - * 'name' is machine name (e.g. 'anonymous user') - * - * Drupal 8: - * 'rid' is machine name (e.g. 'anonymous') - * 'name' is human-readable name (e.g. 'Anonymous user'). - * - * c.f. http://drupal.org/node/1619504 - */ - public $name; - public $rid; - - /** - * This is initialized to the result of the user_roles() - * function, which returns an associative array of - * rid => name pairs. - */ - public $roles; - - /** - * This constructor will allow the role to be selected either - * via the role id or via the role name. - */ - public function __construct($rid = DRUPAL_ANONYMOUS_RID) { - $this->roles = user_roles(); - if (!is_numeric($rid)) { - $role_name = $rid; - if (in_array($role_name, $this->roles)) { - $rid = array_search($role_name, $this->roles); - } - } - - if (isset($this->roles[$rid])) { - $this->rid = $rid; - // In D8+ Role is an object. - $this->name = is_object($this->roles[$rid]) ? $this->roles[$rid]->label() : $this->roles[$rid]; - } - else { - throw new RoleException(dt('Could not find the role: !role', array('!role' => $rid))); - } - } - - /* - * Get all perms for a given Role. - */ - public function getPerms() { - return array(); - } - - /* - * Get all perms for a given module. - */ - public function getModulePerms($module) { - return array(); - } - - /* - * Get all permissions site-wide. - */ - public function getAllModulePerms() { - $permissions = array(); - drush_include_engine('drupal', 'environment'); - $module_list = drush_module_list(); - ksort($module_list); - foreach ($module_list as $module) { - if ($perms = $this->getModulePerms($module)) { - $permissions = array_merge($permissions, $perms); - } - } - return $permissions; - } - - public function role_create($role_machine_name, $role_human_readable_name = '') { - } - - public function delete() { - } - - public function add($perm) { - $perms = $this->getPerms(); - if (!in_array($perm, $perms)) { - $this->grant_permissions(array($perm)); - return TRUE; - } - else { - drush_log(dt('"!role" already has the permission "!perm"', array( - '!perm' => $perm, - '!role' => $this->name, - )), 'ok'); - return FALSE; - } - } - - public function remove($perm) { - $perms = $this->getPerms(); - if (in_array($perm, $perms)) { - $this->revoke_permissions(array($perm)); - return TRUE; - } - else { - drush_log(dt('"!role" does not have the permission "!perm"', array( - '!perm' => $perm, - '!role' => $this->name, - )), 'ok'); - return FALSE; - } - } - - public function grant_permissions($perms) { - } - - public function revoke_permissions($perms) { - } -} diff --git a/vendor/drush/drush/lib/Drush/Role/RoleException.php b/vendor/drush/drush/lib/Drush/Role/RoleException.php deleted file mode 100644 index 5751bf5273100e3792151bb2d114c6c2561d4f72..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Role/RoleException.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -namespace Drush\Role; - -class RoleException extends \Exception {} diff --git a/vendor/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapter.php b/vendor/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapter.php deleted file mode 100644 index 63704c26da6a14386281f51ae3222ba143ccafe4..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapter.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -namespace Drush\SiteAlias; - -use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; -use Consolidation\SiteAlias\SiteAliasManagerInterface; -use Consolidation\SiteAlias\SiteAlias; - -class AliasManagerAdapter implements SiteAliasManagerInterface -{ - /** - * @inheritdoc - */ - public function searchLocations() - { - // not supported - return []; - } - - /** - * @inheritdoc - */ - public function get($name) - { - return $this->getAlias($name); - } - - /** - * @inheritdoc - */ - public function getSelf() - { - return $this->getAlias('@self'); - } - - /** - * @inheritdoc - */ - public function getAlias($aliasName) - { - $record = drush_sitealias_get_record($aliasName); - - // TODO: Convert $record to new site alias layout - - return new SiteAlias($record, $aliasName); - } - - /** - * @inheritdoc - */ - public function getMultiple($name = '') - { - // Not supported - return false; - } - - /** - * @inheritdoc - */ - public function listAllFilePaths($location = '') - { - // Not supported - return []; - } -} diff --git a/vendor/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapterInjector.php b/vendor/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapterInjector.php deleted file mode 100644 index 864626ad38a47ba753637b0210c7aeccd947dfd1..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapterInjector.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -namespace Drush\SiteAlias; - -use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; -use Consolidation\SiteAlias\SiteAliasManagerInterface; -use Drush\Drush; - -class AliasManagerAdapterInjector -{ - protected static $aliasManager = null; - - public function inflect($command) - { - if ($command instanceof SiteAliasManagerAwareInterface) { - $command->setSiteAliasManager(Drush::aliasManager()); - } - } -} diff --git a/vendor/drush/drush/lib/Drush/SiteAlias/ProcessManagerInjector.php b/vendor/drush/drush/lib/Drush/SiteAlias/ProcessManagerInjector.php deleted file mode 100644 index 455fe965c33927c0bbf940e8c67c2bd7b5ad329e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/SiteAlias/ProcessManagerInjector.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drush\SiteAlias; - -use Consolidation\SiteProcess\ProcessManagerAwareInterface; -use Drush\SiteAlias\ProcessManager; -use Drush\Drush; - -class ProcessManagerInjector -{ - protected static $processManager = null; - - public function inflect($command) - { - if ($command instanceof ProcessManagerAwareInterface) { - $command->setProcessManager(Drush::processManager()); - } - } -} diff --git a/vendor/drush/drush/lib/Drush/Sql/Sql6.php b/vendor/drush/drush/lib/Drush/Sql/Sql6.php deleted file mode 100644 index 1091f1340b4db1df3782293003860c1278f7d44d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sql6.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drush\Sql; - -use Drush\Log\LogLevel; - -class Sql6 extends SqlVersion { - public function get_db_spec() { - $db_spec = NULL; - if ($url = isset($GLOBALS['db_url']) ? $GLOBALS['db_url'] : drush_get_option('db-url', NULL)) { - $database = drush_get_option('database', 'default'); - $url = is_array($url) ? $url[$database] : $url; - $db_spec = drush_convert_db_from_db_url($url); - $db_spec['db_prefix'] = isset($GLOBALS['db_prefix']) ? $GLOBALS['db_prefix'] : drush_get_option('db-prefix', NULL); - // For uniformity with code designed for Drupal 7/8 db_specs, copy the 'db_prefix' to 'prefix'. - $db_spec['prefix'] = $db_spec['db_prefix']; - } - return $db_spec; - } - - public function getAll() { - if (isset($GLOBALS['db_url'])) { - return drush_sitealias_convert_db_from_db_url($GLOBALS['db_url']); - } - } - - public function valid_credentials($db_spec) { - $type = $db_spec['driver']; - // Check for Drupal support of configured db type. - if (file_exists('./includes/install.'. $type .'.inc')) { - require_once './includes/install.'. $type .'.inc'; - $function = $type .'_is_available'; - if (!$function()) { - drush_log(dt('!type extension for PHP is not installed. Check your php.ini to see how you can enable it.', array('!type' => $type)), LogLevel::BOOTSTRAP); - return FALSE; - } - } - else { - drush_log(dt('!type database type is unsupported.', array('!type' => $type)), LogLevel::BOOTSTRAP); - return FALSE; - } - return TRUE; - } - -} diff --git a/vendor/drush/drush/lib/Drush/Sql/Sql7.php b/vendor/drush/drush/lib/Drush/Sql/Sql7.php deleted file mode 100644 index d1994e1e426ff02d999bc6c54871b2dea0e80072..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sql7.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Drush\Sql; - -class Sql7 extends SqlVersion { - public function get_db_spec() { - $db_spec = NULL; - drush_sql_bootstrap_database_configuration(); - $database = drush_get_option('database', 'default'); - $target = drush_get_option('target', 'default'); - // We don't use DB API here `sql-sync` would have to messily addConnection. - if (!isset($GLOBALS['databases']) || !array_key_exists($database, $GLOBALS['databases']) || !array_key_exists($target, $GLOBALS['databases'][$database])) { - // Do nothing - } - else { - $db_spec = $GLOBALS['databases'][$database][$target];; - } - return $db_spec; - } - - public function getAll() { - if (isset($GLOBALS['databases'])) { - return $GLOBALS['databases']; - } - } -} diff --git a/vendor/drush/drush/lib/Drush/Sql/Sql8.php b/vendor/drush/drush/lib/Drush/Sql/Sql8.php deleted file mode 100644 index 1c5154b1ad25e4e2d68504e5da178a882a25392c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sql8.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -namespace Drush\Sql; - -use Drupal\Core\Database\Database; - -class Sql8 extends Sql7 { - public function get_db_spec() { - $db_spec = NULL; - if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)) { - $database = drush_get_option('database', 'default'); - $target = drush_get_option('target', 'default'); - if ($info = Database::getConnectionInfo($database)) { - return $info[$target]; - } - } - return $db_spec; - } - - public function getAll() { - return Database::getAllConnectionInfo(); - } -} diff --git a/vendor/drush/drush/lib/Drush/Sql/SqlBase.php b/vendor/drush/drush/lib/Drush/Sql/SqlBase.php deleted file mode 100644 index 8ac60bc23c80c977c88ad14597364f2628b6c822..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/SqlBase.php +++ /dev/null @@ -1,396 +0,0 @@ -<?php - -namespace Drush\Sql; - -use Drush\Log\LogLevel; -use Webmozart\PathUtil\Path; - -class SqlBase { - - // An Drupal style array containing specs for connecting to database. - public $db_spec; - - // Default code appended to sql-query connections. - public $query_extra = ''; - - // The way you pass a sql file when issueing a query. - public $query_file = '<'; - - /** - * Typically, SqlBase objects are contructed via drush_sql_get_class(). - */ - public function __construct($db_spec = NULL) { - $this->db_spec = $db_spec; - } - - /* - * Get the current $db_spec. - */ - public function db_spec() { - return $this->db_spec; - } - - /** - * The unix command used to connect to the database. - * @return string - */ - public function command() {} - - /** - * A string for connecting to a database. - * - * @param bool $hide_password - * If TRUE, DBMS should try to hide password from process list. - * On mysql, that means using --defaults-extra-file to supply the user+password. - * - * @return string - */ - public function connect($hide_password = TRUE) { - return trim($this->command() . ' ' . $this->creds($hide_password) . ' ' . drush_get_option('extra', $this->query_extra)); - } - - - /* - * Execute a SQL dump and return the path to the resulting dump file. - * - * @param string|bool @file - * The path where the dump file should be stored. If TRUE, generate a path - * based on usual backup directory and current date. - */ - public function dump($file = '') { - $file_suffix = ''; - $table_selection = $this->get_expanded_table_selection(); - $file = $this->dumpFile($file); - $cmd = $this->dumpCmd($table_selection); - // Gzip the output from dump command(s) if requested. - if (drush_get_option('gzip')) { - $cmd .= ' | gzip -f'; - $file_suffix .= '.gz'; - } - if ($file) { - $file .= $file_suffix; - $cmd .= ' > ' . drush_escapeshellarg($file); - } - - // Avoid the php memory of the $output array in drush_shell_exec(). - if (!$return = drush_op_system($cmd)) { - if ($file) { - drush_log(dt('Database dump saved to !path', array('!path' => $file)), LogLevel::SUCCESS); - drush_backend_set_result($file); - } - } - else { - return drush_set_error('DRUSH_SQL_DUMP_FAIL', 'Database dump failed'); - } - } - - /* - * Build bash for dumping a database. - * - * @param array $table_selection - * Supported keys: 'skip', 'structure', 'tables'. - * @return string - * One or more mysqldump/pg_dump/sqlite3/etc statements that are ready for executing. - * If multiple statements are needed, enclose in parenthesis. - */ - public function dumpCmd($table_selection) {} - - /* - * Generate a path to an output file for a SQL dump when needed. - * - * @param string|bool @file - * If TRUE, generate a path based on usual backup directory and current date. - * Otherwise, just return the path that was provided. - */ - public function dumpFile($file) { - $database = $this->db_spec['database']; - - // $file is passed in to us usually via --result-file. If the user - // has set $options['result-file'] = TRUE, then we - // will generate an SQL dump file in the same backup - // directory that pm-updatecode uses. - if ($file) { - if ($file === TRUE) { - // User did not pass a specific value for --result-file. Make one. - $backup = drush_include_engine('version_control', 'backup'); - $backup_dir = $backup->prepare_backup_dir($database); - if (empty($backup_dir)) { - $backup_dir = drush_find_tmp(); - } - $file = Path::join($backup_dir, '@DATABASE_@DATE.sql'); - } - $file = str_replace(array('@DATABASE', '@DATE'), array($database, gmdate('Ymd_His')), $file); - } - return $file; - } - - /** - * Execute a SQL query. - * - * Note: This is an API function. Try to avoid using drush_get_option() and instead - * pass params in. If you don't want to query results to print during --debug then - * provide a $result_file whose value can be drush_bit_bucket(). - * - * @param string $query - * The SQL to be executed. Should be NULL if $input_file is provided. - * @param string $input_file - * A path to a file containing the SQL to be executed. - * @param string $result_file - * A path to save query results to. Can be drush_bit_bucket() if desired. - * - * @return - * TRUE on success, FALSE on failure - */ - public function query($query, $input_file = NULL, $result_file = '') { - $input_file_original = $input_file; - if ($input_file && drush_file_is_tarball($input_file)) { - if (drush_shell_exec('gzip -d %s', $input_file)) { - $input_file = trim($input_file, '.gz'); - } - else { - return drush_set_error(dt('Failed to decompress input file.')); - } - } - - // Save $query to a tmp file if needed. We will redirect it in. - if (!$input_file) { - $query = $this->query_prefix($query); - $query = $this->query_format($query); - $input_file = drush_save_data_to_temp_file($query); - } - - $parts = array( - $this->command(), - $this->creds(), - $this->silent(), // This removes column header and various helpful things in mysql. - drush_get_option('extra', $this->query_extra), - $this->query_file, - drush_escapeshellarg($input_file), - ); - $exec = implode(' ', $parts); - - if ($result_file) { - $exec .= ' > '. drush_escapeshellarg($result_file); - } - - // In --verbose mode, drush_shell_exec() will show the call to mysql/psql/sqlite, - // but the sql query itself is stored in a temp file and not displayed. - // We show the query when --debug is used and this function created the temp file. - if ((drush_get_context('DRUSH_DEBUG') || drush_get_context('DRUSH_SIMULATE')) && empty($input_file_original)) { - drush_log('sql-query: ' . $query, LogLevel::NOTICE); - } - - $success = drush_shell_exec($exec); - - if ($success && drush_get_option('file-delete')) { - drush_op('drush_delete_dir', $input_file); - } - - return $success; - } - - /* - * A string to add to the command when queries should not print their results. - */ - public function silent() {} - - - public function query_prefix($query) { - // Inject table prefixes as needed. - if (drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_DATABASE)) { - // Enable prefix processing which can be dangerous so off by default. See http://drupal.org/node/1219850. - if (drush_get_option('db-prefix')) { - $drupal_major_version = drush_drupal_major_version(); - if ($drupal_major_version >= 8) { - $query = \Drupal\Core\Database\Database::getConnection()->prefixTables($query); - } - elseif ($drupal_major_version == 7) { - $query = \Database::getConnection()->prefixTables($query); - } - else { - $query = db_prefix_tables($query); - } - } - } - return $query; - } - - - public function query_format($query) { - return $query; - } - - /** - * Drop specified database. - * - * @param array $tables - * An array of table names - * @return boolean - * True if successful, FALSE if failed. - */ - public function drop($tables) { - $return = TRUE; - if ($tables) { - $sql = 'DROP TABLE '. implode(', ', $tables); - $return = $this->query($sql); - } - return $return; - } - - /** - * Build a SQL string for dropping and creating a database. - * - * @param string dbname - * The database name. - * @param boolean $quoted - * Quote the database name. Mysql uses backticks to quote which can cause problems - * in a Windows shell. Set TRUE if the CREATE is not running on the bash command line. - */ - public function createdb_sql($dbname, $quoted = FALSE) {} - - /** - * Create a new database. - * - * @param boolean $quoted - * Quote the database name. Mysql uses backticks to quote which can cause problems - * in a Windows shell. Set TRUE if the CREATE is not running on the bash command line. - * @return boolean - * True if successful, FALSE otherwise. - */ - public function createdb($quoted = FALSE) { - $dbname = $this->db_spec['database']; - $sql = $this->createdb_sql($dbname, $quoted); - // Adjust connection to allow for superuser creds if provided. - $this->su(); - return $this->query($sql); - } - - /** - * Drop all tables (if DB exists) or CREATE target database. - * - * return boolean - * TRUE or FALSE depending on success. - */ - public function drop_or_create() { - if ($this->db_exists()) { - return $this->drop($this->listTables()); - } - else { - return $this->createdb(); - } - } - - /* - * Determine if the specified DB already exists. - * - * @return bool - */ - public function db_exists() {} - - public function delete() {} - - /** - * Build a fragment connection parameters. - * - * @param bool $hide_password - * If TRUE, DBMS should try to hide password from process list. - * On mysql, that means using --defaults-extra-file to supply the user+password. - * @return string - */ - public function creds($hide_password = TRUE) {} - - /** - * The active database driver. - * @return string - */ - public function scheme() { - return $this->db_spec['driver']; - } - - /** - * Get a list of all table names and expand input that may contain - * wildcards (`*`) if necessary so that the array returned only contains valid - * table names i.e. actual tables that exist, without a wildcard. - * - * @return array - * An array of tables with each table name in the appropriate - * element of the array. - */ - public function get_expanded_table_selection() { - $table_selection = drush_sql_get_table_selection(); - // Get the existing table names in the specified database. - $db_tables = $this->listTables(); - if (isset($table_selection['skip'])) { - $table_selection['skip'] = _drush_sql_expand_and_filter_tables($table_selection['skip'], $db_tables); - } - if (isset($table_selection['structure'])) { - $table_selection['structure'] = _drush_sql_expand_and_filter_tables($table_selection['structure'], $db_tables); - } - if (isset($table_selection['tables'])) { - $table_selection['tables'] = _drush_sql_expand_and_filter_tables($table_selection['tables'], $db_tables); - } - return $table_selection; - } - - /** - * Extract the name of all existing tables in the given database. - * - * @return array - * An array of table names which exist in the current database. - */ - public function listTables() {} - - /* - * Helper method to turn associative array into options with values. - * - * @return string - * A bash fragment. - */ - public function params_to_options($parameters) { - // Turn each parameter into a valid parameter string. - $parameter_strings = array(); - foreach ($parameters as $key => $value) { - // Only escape the values, not the keys or the rest of the string. - $value = drush_escapeshellarg($value); - $parameter_strings[] = "--$key=$value"; - } - - // Join the parameters and return. - return implode(' ', $parameter_strings); - } - - /** - * Adjust DB connection with superuser credentials if provided. - * - * The options 'db-su' and 'db-su-pw' will be retreived from the - * specified site alias record, if it exists and contains those items. - * If it does not, they will be fetched via drush_get_option. - * - * Note that in the context of sql-sync, the site alias record will - * be taken from the target alias (e.g. `drush sql-sync @source @target`), - * which will be overlayed with any options that begin with 'target-'; - * therefore, the commandline options 'target-db-su' and 'target-db-su-pw' - * may also affect the operation of this function. - * - * @return null - */ - public function su() { - $create_db_target = $this->db_spec; - - $create_db_target['database'] = ''; - $db_superuser = drush_get_option('db-su'); - if (isset($db_superuser)) { - $create_db_target['username'] = $db_superuser; - } - $db_su_pw = drush_get_option('db-su-pw'); - // If --db-su-pw is not provided and --db-su is, default to empty password. - // This way db cli command will take password from .my.cnf or .pgpass. - if (!empty($db_su_pw)) { - $create_db_target['password'] = $db_su_pw; - } - elseif (isset($db_superuser)) { - unset($create_db_target['password']); - } - $this->db_spec = $create_db_target; - } -} diff --git a/vendor/drush/drush/lib/Drush/Sql/SqlException.php b/vendor/drush/drush/lib/Drush/Sql/SqlException.php deleted file mode 100644 index 343e0e162401c501d8e8887b30b7027e4c86f69b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/SqlException.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -namespace Drush\Sql; - -class SqlException extends \Exception {} diff --git a/vendor/drush/drush/lib/Drush/Sql/SqlVersion.php b/vendor/drush/drush/lib/Drush/Sql/SqlVersion.php deleted file mode 100644 index 4d0a6090560d805d44a6a355f012acb8830cb090..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/SqlVersion.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Drush\Sql; - -use Drush\Log\LogLevel; - -class SqlVersion { - /* - * Determine $db_spec by inspecting the global environment (D6/7) or the DB API (D8+). - * - * @return array $db_spec - * An array specifying a database connection. - */ - public function get_db_spec() {} - - /* - * Return all configured DB connections by inspecting the global environment (D6/7) or the DB API (D8+). - * - * @return array $all - * An array specifying one or more database connections. - */ - public function getAll() {} - - /* - * Validate that Drupal can connect to the DB without actually using Drupal to do so. Called - * by drush_valid_db_credentials(). - */ - public function valid_credentials($db_spec) { - // Drupal >=7 requires PDO and Drush requires php 5.4+ which ships with PDO - // but it may be compiled with --disable-pdo. - if (!class_exists('\PDO')) { - drush_log(dt('PDO support is required.'), LogLevel::BOOTSTRAP); - return FALSE; - } - return TRUE; - } -} diff --git a/vendor/drush/drush/lib/Drush/Sql/Sqlmysql.php b/vendor/drush/drush/lib/Drush/Sql/Sqlmysql.php deleted file mode 100644 index 9318d164b8b7c936118412d70c5d12039f853ab1..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sqlmysql.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php - -namespace Drush\Sql; - -use PDO; - -class Sqlmysql extends SqlBase { - - public function command() { - return 'mysql'; - } - - public function creds($hide_password = TRUE) { - if ($hide_password) { - // EMPTY password is not the same as NO password, and is valid. - $contents = <<<EOT -#This file was written by Drush's Sqlmysql.php. -[client] -user="{$this->db_spec['username']}" -password="{$this->db_spec['password']}" -EOT; - - $file = drush_save_data_to_temp_file($contents); - $parameters['defaults-extra-file'] = $file; - } - else { - // User is required. Drupal calls it 'username'. MySQL calls it 'user'. - $parameters['user'] = $this->db_spec['username']; - // EMPTY password is not the same as NO password, and is valid. - if (isset($this->db_spec['password'])) { - $parameters['password'] = $this->db_spec['password']; - } - } - - // Some drush commands (e.g. site-install) want to connect to the - // server, but not the database. Connect to the built-in database. - $parameters['database'] = empty($this->db_spec['database']) ? 'information_schema' : $this->db_spec['database']; - - // Default to unix socket if configured. - if (!empty($this->db_spec['unix_socket'])) { - $parameters['socket'] = $this->db_spec['unix_socket']; - } - // EMPTY host is not the same as NO host, and is valid (see unix_socket). - elseif (isset($this->db_spec['host'])) { - $parameters['host'] = $this->db_spec['host']; - } - - if (!empty($this->db_spec['port'])) { - $parameters['port'] = $this->db_spec['port']; - } - - if (!empty($this->db_spec['pdo']['unix_socket'])) { - $parameters['socket'] = $this->db_spec['pdo']['unix_socket']; - } - - if (!empty($this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_CA])) { - $parameters['ssl-ca'] = $this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_CA]; - } - - if (!empty($this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_CAPATH])) { - $parameters['ssl-capath'] = $this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_CAPATH]; - } - - if (!empty($this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_CERT])) { - $parameters['ssl-cert'] = $this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_CERT]; - } - - if (!empty($this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_CIPHER])) { - $parameters['ssl-cipher'] = $this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_CIPHER]; - } - - if (!empty($this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_KEY])) { - $parameters['ssl-key'] = $this->db_spec['pdo'][PDO::MYSQL_ATTR_SSL_KEY]; - } - - return $this->params_to_options($parameters); - } - - public function silent() { - return '--silent'; - } - - public function createdb_sql($dbname, $quoted = FALSE) { - if ($quoted) { - $dbname = '`' . $dbname . '`'; - } - $sql[] = sprintf('DROP DATABASE IF EXISTS %s;', $dbname); - $sql[] = sprintf('CREATE DATABASE %s /*!40100 DEFAULT CHARACTER SET utf8 */;', $dbname); - $db_superuser = drush_get_option('db-su'); - if (isset($db_superuser)) { - // - For a localhost database, create a localhost user. This is important for security. - // localhost is special and only allows local Unix socket file connections. - // - If the database is on a remote server, create a wilcard user with %. - // We can't easily know what IP adderss or hostname would represent our server. - $domain = ($this->db_spec['host'] == 'localhost') ? 'localhost' : '%'; - $sql[] = sprintf('GRANT ALL PRIVILEGES ON %s.* TO \'%s\'@\'%s\'', $dbname, $this->db_spec['username'], $domain); - $sql[] = sprintf("IDENTIFIED BY '%s';", $this->db_spec['password']); - $sql[] = 'FLUSH PRIVILEGES;'; - } - return implode(' ', $sql); - } - - public function db_exists() { - $current = drush_get_context('DRUSH_SIMULATE'); - drush_set_context('DRUSH_SIMULATE', FALSE); - // Suppress output. We only care about return value. - $return = $this->query("SELECT 1;", NULL, drush_bit_bucket()); - drush_set_context('DRUSH_SIMULATE', $current); - return $return; - } - - public function listTables() { - $current = drush_get_context('DRUSH_SIMULATE'); - drush_set_context('DRUSH_SIMULATE', FALSE); - $return = $this->query('SHOW TABLES;'); - $tables = drush_shell_exec_output(); - drush_set_context('DRUSH_SIMULATE', $current); - return $tables; - } - - public function dumpCmd($table_selection) { - $parens = FALSE; - $skip_tables = $table_selection['skip']; - $structure_tables = $table_selection['structure']; - $tables = $table_selection['tables']; - - $ignores = array(); - $skip_tables = array_merge($structure_tables, $skip_tables); - $data_only = drush_get_option('data-only'); - // The ordered-dump option is only supported by MySQL for now. - // @todo add documention once a hook for drush_get_option_help() is available. - // @see drush_get_option_help() in drush.inc - $ordered_dump = drush_get_option('ordered-dump'); - - $exec = 'mysqldump '; - // mysqldump wants 'databasename' instead of 'database=databasename' for no good reason. - $only_db_name = str_replace('--database=', ' ', $this->creds()); - $exec .= $only_db_name; - - // We had --skip-add-locks here for a while to help people with insufficient permissions, - // but removed it because it slows down the import a lot. See http://drupal.org/node/1283978 - $extra = ' --no-autocommit --single-transaction --opt -Q'; - if (isset($data_only)) { - $extra .= ' --no-create-info'; - } - if (isset($ordered_dump)) { - $extra .= ' --skip-extended-insert --order-by-primary'; - } - if ($option = drush_get_option('extra', $this->query_extra)) { - $extra .= " $option"; - } - $exec .= $extra; - - if (!empty($tables)) { - $exec .= ' ' . implode(' ', $tables); - } - else { - // Append the ignore-table options. - foreach ($skip_tables as $table) { - $ignores[] = '--ignore-table=' . $this->db_spec['database'] . '.' . $table; - $parens = TRUE; - } - $exec .= ' '. implode(' ', $ignores); - - // Run mysqldump again and append output if we need some structure only tables. - if (!empty($structure_tables)) { - $exec .= " && mysqldump " . $only_db_name . " --no-data $extra " . implode(' ', $structure_tables); - $parens = TRUE; - } - } - return $parens ? "($exec)" : $exec; - } -} diff --git a/vendor/drush/drush/lib/Drush/Sql/Sqlmysqli.php b/vendor/drush/drush/lib/Drush/Sql/Sqlmysqli.php deleted file mode 100644 index 52d5fabae81da7f2f368b04f226bda3d2dd50535..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sqlmysqli.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -namespace Drush\Sql; - -class Sqlmysqli extends Sqlmysql { - -} \ No newline at end of file diff --git a/vendor/drush/drush/lib/Drush/Sql/Sqloracle.php b/vendor/drush/drush/lib/Drush/Sql/Sqloracle.php deleted file mode 100644 index 399c219f98003cdbf23daa0abd9957458d9877e9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sqloracle.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -namespace Drush\Sql; - -use Drush\Log\LogLevel; - -class Sqloracle extends SqlBase { - - // The way you pass a sql file when issueing a query. - public $query_file = '@'; - - public function command() { - // use rlwrap if available for readline support - if ($handle = popen('rlwrap -v', 'r')) { - $command = 'rlwrap sqlplus'; - pclose($handle); - } - else { - $command = 'sqlplus'; - } - return $command; - } - - public function creds() { - return ' ' . $this->db_spec['username'] . '/' . $this->db_spec['password'] . ($this->db_spec['host'] == 'USETNS' ? '@' . $this->db_spec['database'] : '@//' . $this->db_spec['host'] . ':' . ($db_spec['port'] ? $db_spec['port'] : '1521') . '/' . $this->db_spec['database']); - } - - public function createdb_sql($dbname) { - return drush_log("Unable to generate CREATE DATABASE sql for $dbname", LogLevel::ERROR); - } - - // @todo $suffix = '.sql'; - public function query_format($query) { - // remove trailing semicolon from query if we have it - $query = preg_replace('/\;$/', '', $query); - - // some sqlplus settings - $settings[] = "set TRIM ON"; - $settings[] = "set FEEDBACK OFF"; - $settings[] = "set UNDERLINE OFF"; - $settings[] = "set PAGES 0"; - $settings[] = "set PAGESIZE 50000"; - - // are we doing a describe ? - if (!preg_match('/^ *desc/i', $query)) { - $settings[] = "set LINESIZE 32767"; - } - - // are we doing a show tables ? - if (preg_match('/^ *show tables/i', $query)) { - $settings[] = "set HEADING OFF"; - $query = "select object_name from user_objects where object_type='TABLE' order by object_name asc"; - } - - // create settings string - $sqlp_settings = implode("\n", $settings) . "\n"; - - // important for sqlplus to exit correctly - return "${sqlp_settings}${query};\nexit;\n"; - } - - public function listTables() { - $return = $this->query("SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME NOT IN ('BLOBS','LONG_IDENTIFIERS')"); - $tables = drush_shell_exec_output(); - if (!empty($tables)) { - // Shift off the header of the column of data returned. - array_shift($tables); - return $tables; - } - } - - // @todo $file is no longer provided. We are supposed to return bash that can be piped to gzip. - // Probably Oracle needs to override dump() entirely - http://stackoverflow.com/questions/2236615/oracle-can-imp-exp-go-to-stdin-stdout. - public function dumpCmd($table_selection) { - $create_db = drush_get_option('create-db'); - $exec = 'exp ' . $this->creds(); - // Change variable '$file' by reference in order to get drush_log() to report. - if (!$file) { - $file = $this->db_spec['username'] . '.dmp'; - } - $exec .= ' file=' . $file; - - if (!empty($tables)) { - $exec .= ' tables="(' . implode(',', $tables) . ')"'; - } - $exec .= ' owner=' . $this->db_spec['username']; - if ($option = drush_get_option('extra', $this->query_extra)) { - $exec .= " $option"; - } - return array($exec, $file); - } -} diff --git a/vendor/drush/drush/lib/Drush/Sql/Sqlpgsql.php b/vendor/drush/drush/lib/Drush/Sql/Sqlpgsql.php deleted file mode 100644 index e0fc46cef600645c103d4586bf6f5d76c90270ef..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sqlpgsql.php +++ /dev/null @@ -1,153 +0,0 @@ -<?php - -namespace Drush\Sql; - -define('PSQL_SHOW_TABLES', "SELECT tablename FROM pg_tables WHERE schemaname='public';"); - -class Sqlpgsql extends SqlBase { - - public $query_extra = "--no-align --field-separator=\"\t\" --pset tuples_only=on"; - - public $query_file = "--file"; - - private $password_file = NULL; - - private function password_file() { - if (!isset($password_file) && isset($this->db_spec['password'])) { - $pgpass_parts = array( - empty($this->db_spec['host']) ? 'localhost' : $this->db_spec['host'], - empty($this->db_spec['port']) ? '5432' : $this->db_spec['port'], - // Database - '*', - $this->db_spec['username'], - $this->db_spec['password'] - ); - // Escape colon and backslash characters in entries. - // @see http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html - array_walk($pgpass_parts, function (&$part) { - // The order of the replacements is important so that backslashes are - // not replaced twice. - $part = str_replace(array('\\', ':'), array('\\\\', '\:'), $part); - }); - $pgpass_contents = implode(':', $pgpass_parts); - $password_file = drush_save_data_to_temp_file($pgpass_contents); - chmod($password_file, 0600); - } - return $password_file; - } - - public function command() { - $environment = ""; - $pw_file = $this->password_file(); - if (isset($pw_file)) { - $environment = "PGPASSFILE={$pw_file} "; - } - return "{$environment}psql -q"; - } - - /* - * @param $hide_password - * Not used in postgres. Use .pgpass file instead. See http://drupal.org/node/438828. - */ - public function creds($hide_password = TRUE) { - // Some drush commands (e.g. site-install) want to connect to the - // server, but not the database. Connect to the built-in database. - $parameters['dbname'] = empty($this->db_spec['database']) ? 'template1' : $this->db_spec['database']; - - // Host and port are optional but have defaults. - $parameters['host'] = empty($this->db_spec['host']) ? 'localhost' : $this->db_spec['host']; - $parameters['port'] = empty($this->db_spec['port']) ? '5432' : $this->db_spec['port']; - - // Username is required. - $parameters['username'] = $this->db_spec['username']; - - // Don't set the password. - // @see http://drupal.org/node/438828 - - return $this->params_to_options($parameters); - } - - public function createdb_sql($dbname, $quoted = FALSE) { - if ($quoted) { - $dbname = '`' . $dbname . '`'; - } - $sql[] = sprintf('drop database if exists %s;', $dbname); - $sql[] = sprintf("create database %s ENCODING 'UTF8';", $dbname); - return implode(' ', $sql); - } - - public function db_exists() { - $database = $this->db_spec['database']; - // Get a new class instance that has no 'database'. - $db_spec_no_db = $this->db_spec; - unset($db_spec_no_db['database']); - $sql_no_db = drush_sql_get_class($db_spec_no_db); - $query = "SELECT 1 AS result FROM pg_database WHERE datname='$database'"; - drush_shell_exec($sql_no_db->connect() . ' -t -c %s', $query); - $output = drush_shell_exec_output(); - return (bool)$output[0]; - } - - public function query_format($query) { - if (strtolower($query) == 'show tables;') { - return PSQL_SHOW_TABLES; - } - return $query; - } - - public function listTables() { - $return = $this->query(PSQL_SHOW_TABLES); - $tables = drush_shell_exec_output(); - if (!empty($tables)) { - return $tables; - } - return array(); - } - - public function dumpCmd($table_selection) { - $parens = FALSE; - $skip_tables = $table_selection['skip']; - $structure_tables = $table_selection['structure']; - $tables = $table_selection['tables']; - - $ignores = array(); - $skip_tables = array_merge($structure_tables, $skip_tables); - $data_only = drush_get_option('data-only'); - - $create_db = drush_get_option('create-db'); - $exec = 'pg_dump '; - // Unlike psql, pg_dump does not take a '--dbname=' before the database name. - $extra = str_replace('--dbname=', ' ', $this->creds()); - if (isset($data_only)) { - $extra .= ' --data-only'; - } - if ($option = drush_get_option('extra')) { - $extra .= " $option"; - } - $exec .= $extra; - $exec .= (!isset($create_db) && !isset($data_only) ? ' --clean' : ''); - - if (!empty($tables)) { - foreach ($tables as $table) { - $exec .= " --table=$table"; - } - } - else { - foreach ($skip_tables as $table) { - $ignores[] = "--exclude-table=$table"; - } - $exec .= ' '. implode(' ', $ignores); - // Run pg_dump again and append output if we need some structure only tables. - if (!empty($structure_tables)) { - $parens = TRUE; - $schemaonlies = array(); - foreach ($structure_tables as $table) { - $schemaonlies[] = "--table=$table"; - } - $exec .= " && pg_dump --schema-only " . implode(' ', $schemaonlies) . $extra; - $exec .= (!isset($create_db) && !isset($data_only) ? ' --clean' : ''); - } - } - return $parens ? "($exec)" : $exec; - } -} diff --git a/vendor/drush/drush/lib/Drush/Sql/Sqlsqlite.php b/vendor/drush/drush/lib/Drush/Sql/Sqlsqlite.php deleted file mode 100644 index 2182afb38b651a89a4db1491f78663ca174a9a77..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sqlsqlite.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php - -namespace Drush\Sql; - -use Drush\Log\LogLevel; - -class Sqlsqlite extends SqlBase { - public function command() { - return 'sqlite3'; - } - - public function creds($hide_password = TRUE) { - // SQLite doesn't do user management, instead relying on the filesystem - // for that. So the only info we really need is the path to the database - // file, and not as a "--key=value" parameter. - return ' ' . $this->db_spec['database']; - } - - public function createdb_sql($dbname, $quoted = false) { - return ''; - } - - /** - * Create a new database. - * - * @param boolean $quoted - * Quote the database name. Mysql uses backticks to quote which can cause problems - * in a Windows shell. Set TRUE if the CREATE is not running on the bash command line. - */ - public function createdb($quoted = FALSE) { - $file = $this->db_spec['database']; - if (file_exists($file)) { - drush_log("SQLITE: Deleting existing database '$file'", LogLevel::DEBUG); - drush_delete_dir($file, TRUE); - } - - // Make sure sqlite can create file - $path = dirname($file); - drush_log("SQLITE: creating '$path' for creating '$file'", LogLevel::DEBUG); - drush_mkdir($path); - if (!file_exists($path)) { - drush_log("SQLITE: Cannot create $path", LogLevel::ERROR); - return FALSE; - } - else { - return TRUE; - } - } - - public function db_exists() { - return file_exists($this->db_spec['database']); - } - - public function listTables() { - $return = $this->query('.tables'); - $tables_raw = drush_shell_exec_output(); - // SQLite's '.tables' command always outputs the table names in a column - // format, like this: - // table_alpha table_charlie table_echo - // table_bravo table_delta table_foxtrot - // …and there doesn't seem to be a way to fix that. So we need to do some - // clean-up. - foreach ($tables_raw as $line) { - preg_match_all('/[^\s]+/', $line, $matches); - if (!empty($matches[0])) { - foreach ($matches[0] as $match) { - $tables[] = $match; - } - } - } - return $tables; - } - - public function drop($tables) { - $sql = ''; - // SQLite only wants one table per DROP TABLE command (so we have to do - // "DROP TABLE foo; DROP TABLE bar;" instead of "DROP TABLE foo, bar;"). - foreach ($tables as $table) { - $sql .= "DROP TABLE $table; "; - } - return $this->query($sql); - } - - public function dumpCmd($table_selection) { - // Dumping is usually not necessary in SQLite, since all database data - // is stored in a single file which can be copied just - // like any other file. But it still has a use in migration purposes and - // building human-readable diffs and such, so let's do it anyway. - $exec = $this->connect(); - // SQLite's dump command doesn't support many of the features of its - // Postgres or MySQL equivalents. We may be able to fake some in the - // future, but for now, let's just support simple dumps. - $exec .= ' ".dump"'; - if ($option = drush_get_option('extra', $this->query_extra)) { - $exec .= " $option"; - } - return $exec; - } - - -} diff --git a/vendor/drush/drush/lib/Drush/Sql/Sqlsqlsrv.php b/vendor/drush/drush/lib/Drush/Sql/Sqlsqlsrv.php deleted file mode 100644 index 04ca1c335c2cec341b0214850f24ddfa516308d0..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/Sql/Sqlsqlsrv.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Drush\Sql; - -class Sqlsqlsrv extends SqlBase { - - // The way you pass a sql file when issueing a query. - public $query_file = '-h -1 -i'; - - public function command() { - return 'sqlcmd'; - } - - public function creds() { - // Some drush commands (e.g. site-install) want to connect to the - // server, but not the database. Connect to the built-in database. - $database = empty($this->db_spec['database']) ? 'master' : $this->db_spec['database']; - // Host and port are optional but have defaults. - $host = empty($this->db_spec['host']) ? '.\SQLEXPRESS' : $this->db_spec['host']; - if ($this->db_spec['username'] == '') { - return ' -S ' . $host . ' -d ' . $database; - } - else { - return ' -S ' . $host . ' -d ' . $database . ' -U ' . $this->db_spec['username'] . ' -P ' . $this->db_spec['password']; - } - } - - public function db_exists() { - // TODO: untested, but the gist is here. - $database = $this->db_spec['database']; - // Get a new class instance that has no 'database'. - $db_spec_no_db = $this->db_spec; - unset($db_spec_no_db['database']); - $sql_no_db = drush_sql_get_class($db_spec_no_db); - $query = "if db_id('$database') IS NOT NULL print 1"; - drush_shell_exec($sql_no_db->connect() . ' -Q %s', $query); - $output = drush_shell_exec_output(); - return $output[0] == 1; - } - - public function listTables() { - $return = $this->query('SELECT TABLE_NAME FROM information_schema.tables'); - $tables = drush_shell_exec_output(); - if (!empty($tables)) { - // Shift off the header of the column of data returned. - array_shift($tables); - return $tables; - } - } - - // @todo $file is no longer provided. We are supposed to return bash that can be piped to gzip. - // Probably sqlsrv needs to override dump() entirely. - public function dumpCmd($table_selection) { - if (!$file) { - $file = $this->db_spec['database'] . '_' . date('Ymd_His') . '.bak'; - } - $exec = "sqlcmd -U \"" . $this->db_spec['username'] . "\" -P \"" . $this->db_spec['password'] . "\" -S \"" . $this->db_spec['host'] . "\" -Q \"BACKUP DATABASE [" . $this->db_spec['database'] . "] TO DISK='" . $file . "'\""; - if ($option = drush_get_option('extra', $this->query_extra)) { - $exec .= " $option"; - } - return array($exec, $file); - } - - -} diff --git a/vendor/drush/drush/lib/Drush/UpdateService/Project.php b/vendor/drush/drush/lib/Drush/UpdateService/Project.php deleted file mode 100644 index 6a48f67129671b4d15e9780ae3afda4437ea9e7d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/UpdateService/Project.php +++ /dev/null @@ -1,642 +0,0 @@ -<?php - -namespace Drush\UpdateService; - -use Drush\Log\LogLevel; - -/** - * Representation of a project's release info from the update service. - */ -class Project { - private $parsed; - - - /** - * Constructor. - * - * @param string $project_name - * Project name. - * - * @param \SimpleXMLElement $xml - * XML data. - */ - function __construct(\SimpleXMLElement $xml) { - // Check if the xml contains an error on the project. - if ($error = $xml->xpath('/error')) { - $error = (string)$error[0]; - if (strpos($error, 'No release history available for') === 0) { - $project_status = 'unsupported'; - } - elseif (strpos($error, 'No release history was found for the requested project') === 0) { - $project_status = 'unknown'; - } - // Any other error we are not aware of. - else { - $project_status = 'unknown'; - } - } - // The xml has a project, but still it can have errors. - else { - $this->parsed = self::parseXml($xml); - if (empty($this->parsed['releases'])) { - $error = dt('No available releases found for the requested project (!name).', array('!name' => $this->parsed['short_name'])); - $project_status = 'unknown'; - } - else { - $error = FALSE; - $project_status = $xml->xpath('/project/project_status'); - $project_status = (string)$project_status[0]; - } - } - - $this->project_status = $project_status; - $this->error = $error; - if ($error) { - drush_set_error('DRUSH_RELEASE_INFO_ERROR', $error); - } - } - - /** - * Downloads release info xml from update service. - * - * @param array $request - * A request array. - * @param int $cache_duration - * Cache lifetime. - * - * @return \Drush\UpdateService\Project - */ - public static function getInstance(array $request, $cache_duration = ReleaseInfo::CACHE_LIFETIME) { - $url = self::buildFetchUrl($request); - drush_log(dt('Downloading release history from !url', array('!url' => $url))); - - $path = drush_download_file($url, drush_tempnam($request['name']), $cache_duration); - $xml = simplexml_load_file($path); - if (!$xml) { - $error = dt('Failed to get available update data from !url', array('!url' => $url)); - return drush_set_error('DRUSH_RELEASE_INFO_ERROR', $error); - } - - return new Project($xml); - } - - /** - * Returns URL to the updates service for the given request. - * - * @param array $request - * A request array. - * - * @return string - * URL to the updates service. - * - * @see \Drupal\update\UpdateFetcher::buildFetchUrl() - */ - public static function buildFetchUrl(array $request) { - $status_url = isset($request['status url']) ? $request['status url'] : ReleaseInfo::DEFAULT_URL; - return $status_url . '/' . $request['name'] . '/' . $request['drupal_version']; - } - - /** - * Parses update service xml. - * - * @param \SimpleXMLElement $xml - * XML element from the updates service. - * - * @return array - * Project update information. - */ - private static function parseXml(\SimpleXMLElement $xml) { - $project_info = array(); - - // Extract general project info. - $items = array('title', 'short_name', 'dc:creator', 'type', 'api_version', - 'recommended_major', 'supported_majors', 'default_major', - 'project_status', 'link', - ); - foreach ($items as $item) { - if (array_key_exists($item, (array)$xml)) { - $value = $xml->xpath($item); - $project_info[$item] = (string)$value[0]; - } - } - - // Parse project type. - $project_types = array( - 'core' => 'project_core', - 'profile' => 'project_distribution', - 'module' => 'project_module', - 'theme' => 'project_theme', - 'theme engine' => 'project_theme_engine', - 'translation' => 'project_translation', - 'utility' => 'project_drupalorg', - ); - $type = $project_info['type']; - // Probably unused but kept for possible legacy compat. - $type = ($type == 'profile-legacy') ? 'profile' : $type; - $project_info['project_type'] = array_search($type, $project_types); - - // Extract project terms. - $project_info['terms'] = array(); - if ($xml->terms) { - foreach ($xml->terms->children() as $term) { - $term_name = (string) $term->name; - $term_value = (string) $term->value; - if (!isset($project_info[$term_name])) { - $project_info['terms'][$term_name] = array(); - } - $project_info['terms'][$term_name][] = $term_value; - } - } - - // Extract and parse releases info. - // In addition to the info in the update service, here we calculate - // release statuses as Recommended, Security, etc. - - $recommended_major = empty($project_info['recommended_major']) ? '' : $project_info['recommended_major']; - $supported_majors = empty($project_info['supported_majors']) ? array() : array_flip(explode(',', $project_info['supported_majors'])); - - $items = array( - 'name', 'date', 'status', 'type', - 'version', 'tag', 'version_major', 'version_patch', 'version_extra', - 'release_link', 'download_link', 'mdhash', 'filesize', - ); - - $releases = array(); - $releases_xml = @$xml->xpath("/project/releases/release[status='published']"); - foreach ($releases_xml as $release) { - $release_info = array(); - $statuses = array(); - - // Extract general release info. - foreach ($items as $item) { - if (array_key_exists($item, $release)) { - $value = $release->xpath($item); - $release_info[$item] = (string)$value[0]; - } - } - - // Extract release terms. - $release_info['terms'] = array(); - if ($release->terms) { - foreach ($release->terms->children() as $term) { - $term_name = (string) $term->name; - $term_value = (string) $term->value; - if (!isset($release_info['terms'][$term_name])) { - $release_info['terms'][$term_name] = array(); - } - $release_info['terms'][$term_name][] = $term_value; - - // Add "Security" for security updates, and nothing - // for the other kinds. - if (strpos($term_value, "Security") !== FALSE) { - $statuses[] = "Security"; - } - } - } - - // Extract files. - $release_info['files'] = array(); - foreach ($release->files->children() as $file) { - // Normalize keys to match the ones in the release info. - $item = array( - 'download_link' => (string) $file->url, - 'date' => (string) $file->filedate, - 'mdhash' => (string) $file->md5, - 'filesize' => (string) $file->size, - 'archive_type' => (string) $file->archive_type, - ); - if (!empty($file->variant)) { - $item['variant'] = (string) $file->variant; - } - $release_info['files'][] = $item; - } - - // Calculate statuses. - if (array_key_exists($release_info['version_major'], $supported_majors)) { - $statuses[] = "Supported"; - unset($supported_majors[$release_info['version_major']]); - } - if ($release_info['version_major'] == $recommended_major) { - if (!isset($latest_version)) { - $latest_version = $release_info['version']; - } - // The first stable version (no 'version extra') in the recommended major - // is the recommended release - if (empty($release_info['version_extra']) && (!isset($recommended_version))) { - $statuses[] = "Recommended"; - $recommended_version = $release_info['version']; - } - } - if (!empty($release_info['version_extra']) && ($release_info['version_extra'] == "dev")) { - $statuses[] = "Development"; - } - - $release_info['release_status'] = $statuses; - $releases[$release_info['version']] = $release_info; - } - - // If there's no "Recommended major version", we want to recommend - // the most recent release. - if (!$recommended_major) { - $latest_version = key($releases); - } - - // If there is no -stable- release in the recommended major, - // then take the latest version in the recommended major to be - // the recommended release. - if (!isset($recommended_version) && isset($latest_version)) { - $recommended_version = $latest_version; - $releases[$recommended_version]['release_status'][] = "Recommended"; - } - - $project_info['releases'] = $releases; - if (isset($recommended_version)) { - $project_info['recommended'] = $recommended_version; - } - - return $project_info; - } - - /** - * Gets the project type. - * - * @return string - * Type of the project. - */ - public function getType() { - return $this->parsed['project_type']; - } - - /** - * Gets the project status in the update service. - * - * This is the project status in drupal.org: insecure, revoked, published etc. - * - * @return string - */ - public function getStatus() { - return $this->project_status; - } - - /** - * Whether this object represents a project in the update service or an error. - */ - public function isValid() { - return ($this->error === FALSE); - } - - /** - * Gets the parsed xml. - * - * @return array or FALSE if the xml has an error. - */ - public function getInfo() { - return (!$this->error) ? $this->parsed : FALSE; - } - - /** - * Helper to pick the best release in a list of candidates. - * - * The best one is the first stable release if there are stable - * releases; otherwise, it will be the first of the candidates. - * - * @param array $releases - * Array of release arrays. - * - * @return array|bool - */ - public static function getBestRelease(array $releases) { - if (empty($releases)) { - return FALSE; - } - else { - // If there are releases found, let's try first to fetch one with no - // 'version_extra'. Otherwise, use all. - $stable_releases = array(); - foreach ($releases as $one_release) { - if (!array_key_exists('version_extra', $one_release)) { - $stable_releases[] = $one_release; - } - } - if (!empty($stable_releases)) { - $releases = $stable_releases; - } - } - - // First published release is just the first value in $releases. - return reset($releases); - } - - private function searchReleases($key, $value) { - $releases = array(); - foreach ($this->parsed['releases'] as $version => $release) { - if ($release['status'] == 'published' && isset($release[$key]) && strcmp($release[$key], $value) == 0) { - $releases[$version] = $release; - } - } - return $releases; - } - - /** - * Returns the specific release that matches the request version. - * - * @param string $version - * Version of the release to pick. - * @return array|bool - * The release or FALSE if no version specified or no release found. - */ - public function getSpecificRelease($version = NULL) { - if (!empty($version)) { - $matches = array(); - // See if we only have a branch version. - if (preg_match('/^\d+\.x-(\d+)$/', $version, $matches)) { - $releases = $this->searchReleases('version_major', $matches[1]); - } - else { - // In some cases, the request only says something like '7.x-3.x' but the - // version strings include '-dev' on the end, so we need to append that - // here for the xpath to match below. - if (substr($version, -2) == '.x') { - $version .= '-dev'; - } - $releases = $this->searchReleases('version', $version); - } - if (empty($releases)) { - return FALSE; - } - return self::getBestRelease($releases); - } - return array(); - } - - /** - * Pick the first dev release from XML list. - * - * @return array|bool - * The selected release xml object or FALSE. - */ - public function getDevRelease() { - $releases = $this->searchReleases('version_extra', 'dev'); - return self::getBestRelease($releases); - } - - /** - * Pick most appropriate release from XML list. - * - * @return array|bool - * The selected release xml object or FALSE. - */ - public function getRecommendedOrSupportedRelease() { - $majors = array(); - - $recommended_major = empty($this->parsed['recommended_major']) ? 0 : $this->parsed['recommended_major']; - if ($recommended_major != 0) { - $majors[] = $this->parsed['recommended_major']; - } - if (!empty($this->parsed['supported_majors'])) { - $supported = explode(',', $this->parsed['supported_majors']); - foreach ($supported as $v) { - if ($v != $recommended_major) { - $majors[] = $v; - } - } - } - $releases = array(); - foreach ($majors as $major) { - $releases = $this->searchReleases('version_major', $major); - if (!empty($releases)) { - break; - } - } - - return self::getBestRelease($releases); - } - - /** - * Comparison routine to order releases by date. - * - * @param array $a - * Release to compare. - * @param array $b - * Release to compare. - * - * @return int - * -1, 0 or 1 whether $a is greater, equal or lower than $b. - */ - private static function compareDates(array $a, array $b) { - if ($a['date'] == $b['date']) { - return ($a['version_major'] > $b['version_major']) ? -1 : 1; - } - if ($a['version_major'] == $b['version_major']) { - return ($a['date'] > $b['date']) ? -1 : 1; - } - return ($a['version_major'] > $b['version_major']) ? -1 : 1; - } - - /** - * Comparison routine to order releases by version. - * - * @param array $a - * Release to compare. - * @param array $b - * Release to compare. - * - * @return int - * -1, 0 or 1 whether $a is greater, equal or lower than $b. - */ - private static function compareVersions(array $a, array $b) { - $defaults = array( - 'version_patch' => '', - 'version_extra' => '', - 'date' => 0, - ); - $a += $defaults; - $b += $defaults; - if ($a['version_major'] != $b['version_major']) { - return ($a['version_major'] > $b['version_major']) ? -1 : 1; - } - else if ($a['version_patch'] != $b['version_patch']) { - return ($a['version_patch'] > $b['version_patch']) ? -1 : 1; - } - else if ($a['version_extra'] != $b['version_extra']) { - // Don't rely on version_extra alphabetical order. - return ($a['date'] > $b['date']) ? -1 : 1; - } - - return 0; - } - - /** - * Filter project releases by a criteria and returns a list. - * - * If no filter is provided, the first Recommended, Supported, Security - * or Development release on each major version will be shown. - * - * @param string $filter - * Valid values: - * - 'all': Select all releases. - * - 'dev': Select all development releases. - * @param string $installed_version - * Version string. If provided, Select all releases in the same - * version_major branch until the provided one is found. - * On any other branch, the default behaviour will be applied. - * - * @return array - * List of releases matching the filter criteria. - */ - function filterReleases($filter = '', $installed_version = NULL) { - $releases = $this->parsed['releases']; - usort($releases, array($this, 'compareDates')); - - $installed_version = pm_parse_version($installed_version); - - // Iterate through and filter out the releases we're interested in. - $options = array(); - $limits_list = array(); - foreach ($releases as $release) { - $eligible = FALSE; - - // Mark as eligible if the filter criteria matches. - if ($filter == 'all') { - $eligible = TRUE; - } - elseif ($filter == 'dev') { - if (!empty($release['version_extra']) && ($release['version_extra'] == 'dev')) { - $eligible = TRUE; - } - } - // The Drupal core version scheme (ex: 7.31) is different to - // other projects (ex 7.x-3.2). We need to manage this special case. - elseif (($this->getType() != 'core') && ($installed_version['version_major'] == $release['version_major'])) { - // In case there's no filter, select all releases until the installed one. - // Always show the dev release. - if (isset($release['version_extra']) && ($release['version_extra'] == 'dev')) { - $eligible = TRUE; - } - else { - if (self::compareVersions($release, $installed_version) < 1) { - $eligible = TRUE; - } - } - } - // Otherwise, pick only the first release in each status. - // For example after we pick out the first security release, - // we won't pick any other. We do this on a per-major-version basis, - // though, so if a project has three major versions, then we will - // pick out the first security release from each. - else { - foreach ($release['release_status'] as $one_status) { - $test_key = $release['version_major'] . $one_status; - if (empty($limits_list[$test_key])) { - $limits_list[$test_key] = TRUE; - $eligible = TRUE; - } - } - } - - if ($eligible) { - $options[$release['version']] = $release; - } - } - - // Add Installed status. - if (!is_null($installed_version) && isset($options[$installed_version['version']])) { - $options[$installed_version['version']]['release_status'][] = 'Installed'; - } - - return $options; - } - - /** - * Prints release notes for given projects. - * - * @param string $version - * Version of the release to get notes. - * @param bool $print_status - * Whether to print a informative note. - * @param string $tmpfile - * If provided, a file that contains contents to show before the - * release notes. - */ - function getReleaseNotes($version = NULL, $print_status = TRUE, $tmpfile = NULL) { - $project_name = $this->parsed['short_name']; - if (!isset($tmpfile)) { - $tmpfile = drush_tempnam('rln-' . $project_name . '.'); - } - - // Select versions to show. - $versions = array(); - if (!is_null($version)) { - $versions[] = $version; - } - else { - // If requested project is installed, - // show release notes for the installed version and all newer versions. - if (isset($this->parsed['recommended'], $this->parsed['installed'])) { - $releases = array_reverse($this->parsed['releases']); - foreach($releases as $version => $release) { - if ($release['date'] >= $this->parsed['releases'][$this->parsed['installed']]['date']) { - $release += array('version_extra' => ''); - $this->parsed['releases'][$this->parsed['installed']] += array('version_extra' => ''); - if ($release['version_extra'] == 'dev' && $this->parsed['releases'][$this->parsed['installed']]['version_extra'] != 'dev') { - continue; - } - $versions[] = $version; - } - } - } - else { - // Project is not installed and user did not specify a version, - // so show the release notes for the recommended version. - $versions[] = $this->parsed['recommended']; - } - } - - foreach ($versions as $version) { - if (!isset($this->parsed['releases'][$version]['release_link'])) { - drush_log(dt("Project !project does not have release notes for version !version.", array('!project' => $project_name, '!version' => $version)), LogLevel::WARNING); - continue; - } - - // Download the release node page and get the html as xml to explore it. - $release_link = $this->parsed['releases'][$version]['release_link']; - $filename = drush_download_file($release_link, drush_tempnam($project_name)); - @$dom = \DOMDocument::loadHTMLFile($filename); - if ($dom) { - drush_log(dt("Successfully parsed and loaded the HTML contained in the release notes' page for !project (!version) project.", array('!project' => $project_name, '!version' => $version)), LogLevel::NOTICE); - } - else { - drush_log(dt("Error while requesting the release notes page for !project project.", array('!project' => $project_name)), LogLevel::ERROR); - continue; - } - $xml = simplexml_import_dom($dom); - - // Extract last update time and the notes. - $last_updated = $xml->xpath('//div[contains(@class,"views-field-changed")]'); - $last_updated = $last_updated[0]->asXML(); - $notes = $xml->xpath('//div[contains(@class,"field-name-body")]'); - $notes = (!empty($notes)) ? $notes[0]->asXML() : dt("There're no release notes."); - - // Build the notes header. - $header = array(); - $header[] = '<hr>'; - $header[] = dt("> RELEASE NOTES FOR '!name' PROJECT, VERSION !version:", array('!name' => strtoupper($project_name), '!version' => $version)); - $header[] = dt("> !last_updated.", array('!last_updated' => trim(drush_html_to_text($last_updated)))); - if ($print_status) { - $header[] = '> ' . implode(', ', $this->parsed['releases'][$version]['release_status']); - } - $header[] = '<hr>'; - - // Finally add the release notes for the requested project to the tmpfile. - $content = implode("\n", $header) . "\n" . $notes . "\n"; - #TODO# accept $html as a method argument - if (!drush_get_option('html', FALSE)) { - $content = drush_html_to_text($content, array('br', 'p', 'ul', 'ol', 'li', 'hr')); - } - file_put_contents($tmpfile, $content, FILE_APPEND); - } - - #TODO# don't print! Just return the filename - drush_print_file($tmpfile); - } -} diff --git a/vendor/drush/drush/lib/Drush/UpdateService/ReleaseInfo.php b/vendor/drush/drush/lib/Drush/UpdateService/ReleaseInfo.php deleted file mode 100644 index b50384d7d38bb5e5f0adb492564ab34a4a55edd5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/UpdateService/ReleaseInfo.php +++ /dev/null @@ -1,238 +0,0 @@ -<?php - -/** - * @file - * Drush release info engine for update.drupal.org and compatible services. - * - * This engine does connect directly to the update service. It doesn't depend - * on a bootstrapped site. - */ - -namespace Drush\UpdateService; - -use Drush\Log\LogLevel; - -/** - * Release info engine class. - */ -class ReleaseInfo { - const DEFAULT_URL = 'https://updates.drupal.org/release-history'; - - // Cache release xml files for 24h by default. - const CACHE_LIFETIME = 86400; - - private $cache; - private $engine_config; - - /** - * Constructor. - */ - public function __construct($type, $engine, $config) { - $this->engine_type = $type; - $this->engine = $engine; - - if (is_null($config)) { - $config = array(); - } - $config += array( - 'cache-duration' => drush_get_option('cache-duration-releasexml', self::CACHE_LIFETIME), - ); - $this->engine_config = $config; - $this->cache = array(); - } - - /** - * Returns configured cache duration. - */ - public function getCacheDuration() { - return $this->engine_config['cache-duration']; - } - - /** - * Returns a project's release info from the update service. - * - * @param array $request - * A request array. - * - * @param bool $refresh - * Whether to discard cached object. - * - * @return \Drush\UpdateService\Project - */ - public function get($request, $refresh = FALSE) { - if ($refresh || !isset($this->cache[$request['name']])) { - $project_release_info = Project::getInstance($request, $this->getCacheDuration()); - if ($project_release_info && !$project_release_info->isValid()) { - $project_release_info = FALSE; - } - $this->cache[$request['name']] = $project_release_info; - } - return $this->cache[$request['name']]; - } - - /** - * Delete cached update service file of a project. - * - * @param array $request - * A request array. - */ - public function clearCached(array $request) { - if (isset($this->cache[$request['name']])) { - unset($this->cache[$request['name']]); - } - $url = Project::buildFetchUrl($request); - $cache_file = drush_download_file_name($url); - if (file_exists($cache_file)) { - unlink($cache_file); - } - } - - /** - * Select the most appropriate release for a project, based on a strategy. - * - * @param Array &$request - * A request array. - * The array will be expanded with the project type. - * @param String $restrict_to - * One of: - * 'dev': Forces choosing a -dev release. - * 'version': Forces choosing a point release. - * '': No restriction. - * Default is ''. - * @param String $select - * Strategy for selecting a release, should be one of: - * - auto: Try to select the latest release, if none found allow the user - * to choose. - * - always: Force the user to choose a release. - * - never: Try to select the latest release, if none found then fail. - * - ignore: Ignore and return NULL. - * If no supported release is found, allow to ask the user to choose one. - * @param Boolean $all - * In case $select = TRUE this indicates that all available releases will be - * offered the user to choose. - * - * @return array - * The selected release. - */ - public function selectReleaseBasedOnStrategy($request, $restrict_to = '', $select = 'never', $all = FALSE, $version = NULL) { - if (!in_array($select, array('auto', 'never', 'always', 'ignore'))) { - return drush_set_error('DRUSH_PM_UNKNOWN_SELECT_STRATEGY', dt("Error: select strategy must be one of: auto, never, always, ignore", array())); - } - - $project_release_info = $this->get($request); - if (!$project_release_info) { - return FALSE; - } - - if ($select != 'always') { - if (isset($request['version'])) { - $release = $project_release_info->getSpecificRelease($request['version']); - if ($release === FALSE) { - return drush_set_error('DRUSH_PM_COULD_NOT_FIND_VERSION', dt("Could not locate !project version !version.", array( - '!project' => $request['name'], - '!version' => $request['version'], - ))); - } - } - if ($restrict_to == 'dev') { - // If you specified a specific release AND --dev, that is either - // redundant (okay), or contradictory (error). - if (!empty($release)) { - if ($release['version_extra'] != 'dev') { - return drush_set_error('DRUSH_PM_COULD_NOT_FIND_VERSION', dt("You requested both --dev and !project version !version, which is not a '-dev' release.", array( - '!project' => $request['name'], - '!version' => $request['version'], - ))); - } - } - else { - $release = $project_release_info->getDevRelease(); - if ($release === FALSE) { - return drush_set_error('DRUSH_PM_NO_DEV_RELEASE', dt('There is no development release for project !project.', array('!project' => $request['name']))); - } - } - } - // If there was no specific release requested, try to identify the most appropriate release. - if (empty($release)) { - $release = $project_release_info->getRecommendedOrSupportedRelease(); - } - if ($release) { - return $release; - } - else { - $message = dt('There are no stable releases for project !project.', array('!project' => $request['name'])); - if ($select == 'never') { - return drush_set_error('DRUSH_PM_NO_STABLE_RELEASE', $message); - } - drush_log($message, LogLevel::WARNING); - if ($select == 'ignore') { - return NULL; - } - } - } - - // At this point the only chance is to ask the user to choose a release. - if ($restrict_to == 'dev') { - $filter = 'dev'; - } - elseif ($all) { - $filter = 'all'; - } - else { - $filter = ''; - } - $releases = $project_release_info->filterReleases($filter, $version); - - // Special checking: Drupal 6 is EOL, so there are no stable - // releases for ANY contrib project. In this case, we'll default - // to the best release, unless the user specified --select. - $version_major = drush_drupal_major_version(); - if (($select != 'always') && ($version_major < 7)) { - $bestRelease = Project::getBestRelease($releases); - if (!empty($bestRelease)) { - $message = dt('Drupal !major has reached EOL, so there are no stable releases for any contrib projects. Selected the best release, !project.', array('!major' => $version_major, '!project' => $bestRelease['name'])); - drush_log($message, LogLevel::WARNING); - return $bestRelease; - } - } - - $options = array(); - foreach($releases as $release) { - $options[$release['version']] = array($release['version'], '-', gmdate('Y-M-d', $release['date']), '-', implode(', ', $release['release_status'])); - } - $choice = drush_choice($options, dt('Choose one of the available releases for !project:', array('!project' => $request['name']))); - if (!$choice) { - return drush_user_abort(); - } - - return $releases[$choice]; - } - - /** - * Check if a project is available in the update service. - * - * Optionally check for consistency by comparing given project type and - * the type obtained from the update service. - * - * @param array $request - * A request array. - * @param string $type - * Optional. If provided, will do a consistent check of the project type. - * - * @return boolean - * True if the project exists and type matches. - */ - public function checkProject($request, $type = NULL) { - $project_release_info = $this->get($request); - if (!$project_release_info) { - return FALSE; - } - if ($type) { - if ($project_release_info->getType() != $type) { - return FALSE; - } - } - - return TRUE; - } -} diff --git a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal6.php b/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal6.php deleted file mode 100644 index b0cc4d64285b30e78873a1c609857351be60c929..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal6.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -/** - * @file - * Implementation of 'drupal' update_status engine for Drupal 6. - */ - -namespace Drush\UpdateService; - -class StatusInfoDrupal6 extends StatusInfoDrupal7 { - - /** - * {@inheritdoc} - */ - function beforeGetStatus(&$projects, $check_disabled) { - // If check-disabled option was provided, alter Drupal settings temporarily. - // There's no other way to hook into this. - if (!is_null($check_disabled)) { - global $conf; - $this->update_check_disabled = $conf['update_advanced_check_disabled']; - $conf['update_advanced_check_disabled'] = $check_disabled; - } - } - - /** - * {@inheritdoc} - */ - function afterGetStatus(&$update_info, $projects, $check_disabled) { - // Restore Drupal settings. - if (!is_null($check_disabled)) { - global $conf; - $conf['update_advanced_check_disabled'] = $this->update_check_disabled; - unset($this->update_check_disabled); - } - - // update_advanced.module sets a different project type - // for disabled projects. Here we normalize it. - if ($check_disabled) { - foreach ($update_info as $key => $project) { - if (in_array($project['project_type'], array('disabled-module', 'disabled-theme'))) { - $update_info[$key]['project_type'] = substr($project['project_type'], strpos($project['project_type'], '-') + 1); - } - } - } - } - - /** - * Obtains release info for all installed projects via update.module. - * - * @see update_get_available(). - * @see update_manual_status(). - */ - protected function getAvailableReleases() { - // We force a refresh if the cache is not available. - if (!cache_get('update_available_releases', 'cache_update')) { - $this->refresh(); - } - - $available = update_get_available(TRUE); - - // Force to invalidate some update_status caches that are only cleared - // when visiting update status report page. - if (function_exists('_update_cache_clear')) { - _update_cache_clear('update_project_data'); - _update_cache_clear('update_project_projects'); - } - - return $available; - } -} - diff --git a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal7.php b/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal7.php deleted file mode 100644 index 0e6ae6eb46c37e7bbfe79880a7f881da07f7a271..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal7.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php - -/** - * @file - * Implementation of 'drupal' update_status engine for Drupal 7. - */ - -namespace Drush\UpdateService; - -class StatusInfoDrupal7 extends StatusInfoDrupal8 { - - /** - * {@inheritdoc} - */ - function lastCheck() { - return variable_get('update_last_check', 0); - } - - /** - * {@inheritdoc} - */ - function beforeGetStatus(&$projects, $check_disabled) { - // If check-disabled option was provided, alter Drupal settings temporarily. - // There's no other way to hook into this. - if (!is_null($check_disabled)) { - global $conf; - $this->update_check_disabled = $conf['update_check_disabled']; - $conf['update_check_disabled'] = $check_disabled; - } - } - - /** - * {@inheritdoc} - */ - function afterGetStatus(&$update_info, $projects, $check_disabled) { - // Restore Drupal settings. - if (!is_null($check_disabled)) { - global $conf; - $conf['update_check_disabled'] = $this->update_check_disabled; - unset($this->update_check_disabled); - } - - // update.module sets a different project type - // for disabled projects. Here we normalize it. - if ($check_disabled) { - foreach ($update_info as $key => $project) { - if (in_array($project['project_type'], array('module-disabled', 'theme-disabled'))) { - $update_info[$key]['project_type'] = substr($project['project_type'], 0, strpos($project['project_type'], '-')); - } - } - } - } - - /** - * Obtains release info for all installed projects via update.module. - * - * @see update_get_available(). - * @see update_manual_status(). - */ - protected function getAvailableReleases() { - // Force to invalidate some caches that are only cleared - // when visiting update status report page. This allow to detect changes in - // .info files. - _update_cache_clear('update_project_data'); - _update_cache_clear('update_project_projects'); - - // From update_get_available(): Iterate all projects and create a fetch task - // for those we have no information or is obsolete. - $available = _update_get_cached_available_releases(); - - module_load_include('inc', 'update', 'update.compare'); - $update_projects = update_get_projects(); - - foreach ($update_projects as $key => $project) { - if (empty($available[$key])) { - update_create_fetch_task($project); - continue; - } - if ($project['info']['_info_file_ctime'] > $available[$key]['last_fetch']) { - $available[$key]['fetch_status'] = UPDATE_FETCH_PENDING; - } - if (empty($available[$key]['releases'])) { - $available[$key]['fetch_status'] = UPDATE_FETCH_PENDING; - } - if (!empty($available[$key]['fetch_status']) && $available[$key]['fetch_status'] == UPDATE_FETCH_PENDING) { - update_create_fetch_task($project); - } - } - - // Set a batch to process all pending tasks. - $batch = array( - 'operations' => array( - array('update_fetch_data_batch', array()), - ), - 'finished' => 'update_fetch_data_finished', - 'file' => drupal_get_path('module', 'update') . '/update.fetch.inc', - ); - batch_set($batch); - drush_backend_batch_process(); - - // Clear any error set by a failed update fetch task. This avoid rollbacks. - drush_clear_error(); - - // Calculate update status data. - $available = _update_get_cached_available_releases(); - return $available; - } -} - diff --git a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal8.php b/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal8.php deleted file mode 100644 index 64b6a956f40faec73c19de688ed442351e30a97e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrupal8.php +++ /dev/null @@ -1,172 +0,0 @@ -<?php - -/** - * @file - * Implementation of 'drupal' update_status engine for Drupal 8. - */ - -namespace Drush\UpdateService; - -class StatusInfoDrupal8 implements StatusInfoInterface { - - /** - * {@inheritdoc} - */ - public function __construct($type, $engine, $config) { - $this->engine_type = $type; - $this->engine = $engine; - $this->engine_config = $config; - } - - /** - * {@inheritdoc} - */ - function lastCheck() { - $last_check = \Drupal::state()->get('update.last_check') ?: 0; - return $last_check; - } - - /** - * {@inheritdoc} - */ - function refresh() { - update_refresh(); - } - - /** - * Perform adjustments before running get status. - * - * - Enforce check-disabled option on update module. - */ - function beforeGetStatus(&$projects, $check_disabled) { - // If check-disabled option was provided, alter Drupal settings temporarily. - // There's no other way to hook into this. - if (!is_null($check_disabled)) { - $config = \Drupal::config('update.settings'); - $this->update_check_disabled = $config->get('check.disabled_extensions'); - $config->set('check.disabled_extensions', (bool)$check_disabled); - } - } - - /** - * Get update information for all installed projects. - * - * @return - * Array of update status information. - */ - function getStatus($projects, $check_disabled) { - $this->beforeGetStatus($projects, $check_disabled); - $available = $this->getAvailableReleases(); - $update_info = $this->calculateUpdateStatus($available, $projects); - $this->afterGetStatus($update_info, $projects, $check_disabled); - return $update_info; - } - - /** - * Perform adjustments after running get status. - * - * - Restore check-disabled setting in update module. - * - Adjust project type for disabled projects. - */ - function afterGetStatus(&$update_info, $projects, $check_disabled) { - // Restore Drupal settings. - if (!is_null($check_disabled)) { - \Drupal::config('update.settings')->set('check.disabled_extensions', $this->update_check_disabled); - unset($this->update_check_disabled); - } - - // update.module sets a different project type - // for disabled projects. Here we normalize it. - if ($check_disabled) { - foreach ($update_info as $key => $project) { - if (in_array($project['project_type'], array('module-disabled', 'theme-disabled'))) { - $update_info[$key]['project_type'] = substr($project['project_type'], 0, strpos($project['project_type'], '-')); - } - } - } - } - - /** - * Obtains release info for all installed projects via update.module. - * - * @see update_get_available(). - * @see \Drupal\update\Controller\UpdateController::updateStatusManually() - */ - protected function getAvailableReleases() { - // Force to invalidate some caches that are only cleared - // when visiting update status report page. This allow to detect changes in - // .info.yml files. - \Drupal::keyValueExpirable('update')->deleteMultiple(array('update_project_projects', 'update_project_data')); - - // From update_get_available(): Iterate all projects and create a fetch task - // for those we have no information or is obsolete. - $available = \Drupal::keyValueExpirable('update_available_releases')->getAll(); - $update_projects = \Drupal::service('update.manager')->getProjects(); - foreach ($update_projects as $key => $project) { - if (empty($available[$key])) { - \Drupal::service('update.processor')->createFetchTask($project); - continue; - } - if ($project['info']['_info_file_ctime'] > $available[$key]['last_fetch']) { - $available[$key]['fetch_status'] = UPDATE_FETCH_PENDING; - } - if (empty($available[$key]['releases'])) { - $available[$key]['fetch_status'] = UPDATE_FETCH_PENDING; - } - if (!empty($available[$key]['fetch_status']) && $available[$key]['fetch_status'] == UPDATE_FETCH_PENDING) { - \Drupal::service('update.processor')->createFetchTask($project); - } - } - - // Set a batch to process all pending tasks. - $batch = array( - 'operations' => array( - array(array(\Drupal::service('update.manager'), 'fetchDataBatch'), array()), - ), - 'finished' => 'update_fetch_data_finished', - 'file' => drupal_get_path('module', 'update') . '/update.fetch.inc', - ); - batch_set($batch); - drush_backend_batch_process(); - - // Clear any error set by a failed update fetch task. This avoid rollbacks. - drush_clear_error(); - - return \Drupal::keyValueExpirable('update_available_releases')->getAll(); - } - - /** - * Calculates update status for all projects via update.module. - */ - protected function calculateUpdateStatus($available, $projects) { - module_load_include('inc', 'update', 'update.compare'); - $data = update_calculate_project_data($available); - - foreach ($data as $project_name => $project) { - // Discard custom projects. - if ($project['status'] == UPDATE_UNKNOWN) { - unset($data[$project_name]); - continue; - } - // Discard projects with unknown installation path. - if ($project_name != 'drupal' && !isset($projects[$project_name]['path'])) { - unset($data[$project_name]); - continue; - } - - // Add some info from the project to $data. - $data[$project_name] += array( - 'path' => isset($projects[$project_name]['path']) ? $projects[$project_name]['path'] : '', - 'label' => $projects[$project_name]['label'], - ); - // Store all releases, not just the ones selected by update.module. - // We use it to allow the user to update to a specific version. - if (isset($available[$project_name]['releases'])) { - $data[$project_name]['releases'] = $available[$project_name]['releases']; - } - } - - return $data; - } -} - diff --git a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrush.php b/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrush.php deleted file mode 100644 index 636cae4376c4c183f38bba12e4b1736598c9b5b0..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoDrush.php +++ /dev/null @@ -1,420 +0,0 @@ -<?php - -/** - * @file - * Implementation of 'drush' update_status engine for any Drupal version. - */ - -namespace Drush\UpdateService; - -use Drush\Log\LogLevel; - -class StatusInfoDrush implements StatusInfoInterface { - - /** - * {@inheritdoc} - */ - public function __construct($type, $engine, $config) { - $this->engine_type = $type; - $this->engine = $engine; - $this->engine_config = $config; - } - - /** - * {@inheritdoc} - */ - function lastCheck() { - $older = 0; - - // Iterate all projects and get the time of the older release info. - $projects = drush_get_projects(); - foreach ($projects as $project_name => $project) { - $request = pm_parse_request($project_name, NULL, $projects); - $url = Project::buildFetchUrl($request); - $cache_file = drush_download_file_name($url); - if (file_exists($cache_file)) { - $ctime = filectime($cache_file); - $older = (!$older) ? $ctime : min($ctime, $older); - } - } - - return $older; - } - - /** - * {@inheritdoc} - */ - function refresh() { - $release_info = drush_include_engine('release_info', 'updatexml'); - - // Clear all caches for the available projects. - $projects = drush_get_projects(); - foreach ($projects as $project_name => $project) { - $request = pm_parse_request($project_name, NULL, $projects); - $release_info->clearCached($request); - } - } - - /** - * Get update information for all installed projects. - * - * @return - * Array of update status information. - */ - function getStatus($projects, $check_disabled) { - // Exclude disabled projects. - if (!$check_disabled) { - foreach ($projects as $project_name => $project) { - if (!$project['status']) { - unset($projects[$project_name]); - } - } - } - $available = $this->getAvailableReleases($projects); - $update_info = $this->calculateUpdateStatus($available, $projects); - return $update_info; - } - - /** - * Obtains release info for projects. - */ - private function getAvailableReleases($projects) { - drush_log(dt('Checking available update data ...'), LogLevel::OK); - - $release_info = drush_include_engine('release_info', 'updatexml'); - - $available = array(); - foreach ($projects as $project_name => $project) { - // Discard projects with unknown installation path. - if ($project_name != 'drupal' && !isset($project['path'])) { - continue; - } - drush_log(dt('Checking available update data for !project.', array('!project' => $project['label'])), LogLevel::OK); - $request = $project_name . (isset($project['core']) ? '-' . $project['core'] : ''); - $request = pm_parse_request($request, NULL, $projects); - $project_release_info = $release_info->get($request); - if ($project_release_info) { - $available[$project_name] = $project_release_info; - } - } - - // Clear any error set by a failed project. This avoid rollbacks. - drush_clear_error(); - - return $available; - } - - /** - * Calculates update status for given projects. - */ - private function calculateUpdateStatus($available, $projects) { - $update_info = array(); - foreach ($available as $project_name => $project_release_info) { - // Obtain project 'global' status. NULL status is ok (project published), - // otherwise it signals something is bad with the project (revoked, etc). - $project_status = $this->calculateProjectStatus($project_release_info); - // Discard custom projects. - if ($project_status == DRUSH_UPDATESTATUS_UNKNOWN) { - continue; - } - - // Prepare update info. - $project = $projects[$project_name]; - $is_core = ($project['type'] == 'core'); - $version = pm_parse_version($project['version'], $is_core); - // If project version ends with 'dev', this is a dev snapshot. - $install_type = (substr($project['version'], -3, 3) == 'dev') ? 'dev' : 'official'; - $project_update_info = array( - 'name' => $project_name, - 'label' => $project['label'], - 'path' => isset($project['path']) ? $project['path'] : '', - 'install_type' => $install_type, - 'existing_version' => $project['version'], - 'existing_major' => $version['version_major'], - 'status' => $project_status, - 'datestamp' => empty($project['datestamp']) ? NULL : $project['datestamp'], - ); - - // If we don't have a project status yet, it means this is - // a published project and we need to obtain its update status - // and recommended release. - if (is_null($project_status)) { - $this->calculateProjectUpdateStatus($project_release_info, $project_update_info); - } - - // We want to ship all release info data including all releases, - // not just the ones selected by calculateProjectUpdateStatus(). - // We use it to allow the user to update to a specific version. - unset($project_update_info['releases']); - $update_info[$project_name] = $project_update_info + $project_release_info->getInfo(); - } - - return $update_info; - } - - /** - * Obtain the project status in the update service. - * - * This is not the update status of the installed version - * but the project 'global' status (unpublished, revoked, etc). - * - * @see update_calculate_project_status(). - */ - private function calculateProjectStatus($project_release_info) { - $project_status = NULL; - - // If connection to the update service went wrong, or the received xml - // is malformed, we don't have a UpdateService::Project object. - if (!$project_release_info) { - $project_status = DRUSH_UPDATESTATUS_NOT_FETCHED; - } - else { - switch ($project_release_info->getStatus()) { - case 'insecure': - $project_status = DRUSH_UPDATESTATUS_NOT_SECURE; - break; - case 'unpublished': - case 'revoked': - $project_status = DRUSH_UPDATESTATUS_REVOKED; - break; - case 'unsupported': - $project_status = DRUSH_UPDATESTATUS_NOT_SUPPORTED; - break; - case 'unknown': - $project_status = DRUSH_UPDATESTATUS_UNKNOWN; - break; - } - } - return $project_status; - } - - /** - * Obtain the update status of a project and the recommended release. - * - * This is a stripped down version of update_calculate_project_status(). - * That function has the same logic in Drupal 6,7,8. - * Note: in Drupal 6 this is part of update_calculate_project_data(). - * - * @see update_calculate_project_status(). - */ - private function calculateProjectUpdateStatus($project_release_info, &$project_data) { - $available = $project_release_info->getInfo(); - - /** - * Here starts the code adapted from update_calculate_project_status(). - * Line 492 in Drupal 7. - * - * Changes are: - * - Use DRUSH_UPDATESTATUS_* constants instead of DRUSH_UPDATESTATUS_* - * - Remove error conditions we already handle - * - Remove presentation code ('extra' and 'reason' keys in $project_data) - * - Remove "also available" information. - */ - - // Figure out the target major version. - $existing_major = $project_data['existing_major']; - $supported_majors = array(); - if (isset($available['supported_majors'])) { - $supported_majors = explode(',', $available['supported_majors']); - } - elseif (isset($available['default_major'])) { - // Older release history XML file without supported or recommended. - $supported_majors[] = $available['default_major']; - } - - if (in_array($existing_major, $supported_majors)) { - // Still supported, stay at the current major version. - $target_major = $existing_major; - } - elseif (isset($available['recommended_major'])) { - // Since 'recommended_major' is defined, we know this is the new XML - // format. Therefore, we know the current release is unsupported since - // its major version was not in the 'supported_majors' list. We should - // find the best release from the recommended major version. - $target_major = $available['recommended_major']; - $project_data['status'] = DRUSH_UPDATESTATUS_NOT_SUPPORTED; - } - elseif (isset($available['default_major'])) { - // Older release history XML file without recommended, so recommend - // the currently defined "default_major" version. - $target_major = $available['default_major']; - } - else { - // Malformed XML file? Stick with the current version. - $target_major = $existing_major; - } - - // Make sure we never tell the admin to downgrade. If we recommended an - // earlier version than the one they're running, they'd face an - // impossible data migration problem, since Drupal never supports a DB - // downgrade path. In the unfortunate case that what they're running is - // unsupported, and there's nothing newer for them to upgrade to, we - // can't print out a "Recommended version", but just have to tell them - // what they have is unsupported and let them figure it out. - $target_major = max($existing_major, $target_major); - - $release_patch_changed = ''; - $patch = ''; - - foreach ($available['releases'] as $version => $release) { - // First, if this is the existing release, check a few conditions. - if ($project_data['existing_version'] === $version) { - if (isset($release['terms']['Release type']) && - in_array('Insecure', $release['terms']['Release type'])) { - $project_data['status'] = DRUSH_UPDATESTATUS_NOT_SECURE; - } - elseif ($release['status'] == 'unpublished') { - $project_data['status'] = DRUSH_UPDATESTATUS_REVOKED; - } - elseif (isset($release['terms']['Release type']) && - in_array('Unsupported', $release['terms']['Release type'])) { - $project_data['status'] = DRUSH_UPDATESTATUS_NOT_SUPPORTED; - } - } - - // Otherwise, ignore unpublished, insecure, or unsupported releases. - if ($release['status'] == 'unpublished' || - (isset($release['terms']['Release type']) && - (in_array('Insecure', $release['terms']['Release type']) || - in_array('Unsupported', $release['terms']['Release type'])))) { - continue; - } - - // See if this is a higher major version than our target and discard it. - // Note: at this point Drupal record it as an "Also available" release. - if (isset($release['version_major']) && $release['version_major'] > $target_major) { - continue; - } - - // Look for the 'latest version' if we haven't found it yet. Latest is - // defined as the most recent version for the target major version. - if (!isset($project_data['latest_version']) - && $release['version_major'] == $target_major) { - $project_data['latest_version'] = $version; - $project_data['releases'][$version] = $release; - } - - // Look for the development snapshot release for this branch. - if (!isset($project_data['dev_version']) - && $release['version_major'] == $target_major - && isset($release['version_extra']) - && $release['version_extra'] == 'dev') { - $project_data['dev_version'] = $version; - $project_data['releases'][$version] = $release; - } - - // Look for the 'recommended' version if we haven't found it yet (see - // phpdoc at the top of this function for the definition). - if (!isset($project_data['recommended']) - && $release['version_major'] == $target_major - && isset($release['version_patch'])) { - if ($patch != $release['version_patch']) { - $patch = $release['version_patch']; - $release_patch_changed = $release; - } - if (empty($release['version_extra']) && $patch == $release['version_patch']) { - $project_data['recommended'] = $release_patch_changed['version']; - $project_data['releases'][$release_patch_changed['version']] = $release_patch_changed; - } - } - - // Stop searching once we hit the currently installed version. - if ($project_data['existing_version'] === $version) { - break; - } - - // If we're running a dev snapshot and have a timestamp, stop - // searching for security updates once we hit an official release - // older than what we've got. Allow 100 seconds of leeway to handle - // differences between the datestamp in the .info file and the - // timestamp of the tarball itself (which are usually off by 1 or 2 - // seconds) so that we don't flag that as a new release. - if ($project_data['install_type'] == 'dev') { - if (empty($project_data['datestamp'])) { - // We don't have current timestamp info, so we can't know. - continue; - } - elseif (isset($release['date']) && ($project_data['datestamp'] + 100 > $release['date'])) { - // We're newer than this, so we can skip it. - continue; - } - } - - // See if this release is a security update. - if (isset($release['terms']['Release type']) - && in_array('Security update', $release['terms']['Release type'])) { - $project_data['security updates'][] = $release; - } - } - - // If we were unable to find a recommended version, then make the latest - // version the recommended version if possible. - if (!isset($project_data['recommended']) && isset($project_data['latest_version'])) { - $project_data['recommended'] = $project_data['latest_version']; - } - - // - // Check to see if we need an update or not. - // - - if (!empty($project_data['security updates'])) { - // If we found security updates, that always trumps any other status. - $project_data['status'] = DRUSH_UPDATESTATUS_NOT_SECURE; - } - - if (isset($project_data['status'])) { - // If we already know the status, we're done. - return; - } - - // If we don't know what to recommend, there's nothing we can report. - // Bail out early. - if (!isset($project_data['recommended'])) { - $project_data['status'] = DRUSH_UPDATESTATUS_UNKNOWN; - $project_data['reason'] = t('No available releases found'); - return; - } - - // If we're running a dev snapshot, compare the date of the dev snapshot - // with the latest official version, and record the absolute latest in - // 'latest_dev' so we can correctly decide if there's a newer release - // than our current snapshot. - if ($project_data['install_type'] == 'dev') { - if (isset($project_data['dev_version']) && $available['releases'][$project_data['dev_version']]['date'] > $available['releases'][$project_data['latest_version']]['date']) { - $project_data['latest_dev'] = $project_data['dev_version']; - } - else { - $project_data['latest_dev'] = $project_data['latest_version']; - } - } - - // Figure out the status, based on what we've seen and the install type. - switch ($project_data['install_type']) { - case 'official': - if ($project_data['existing_version'] === $project_data['recommended'] || $project_data['existing_version'] === $project_data['latest_version']) { - $project_data['status'] = DRUSH_UPDATESTATUS_CURRENT; - } - else { - $project_data['status'] = DRUSH_UPDATESTATUS_NOT_CURRENT; - } - break; - - case 'dev': - $latest = $available['releases'][$project_data['latest_dev']]; - if (empty($project_data['datestamp'])) { - $project_data['status'] = DRUSH_UPDATESTATUS_NOT_CHECKED; - } - elseif (($project_data['datestamp'] + 100 > $latest['date'])) { - $project_data['status'] = DRUSH_UPDATESTATUS_CURRENT; - } - else { - $project_data['status'] = DRUSH_UPDATESTATUS_NOT_CURRENT; - } - break; - - default: - $project_data['status'] = DRUSH_UPDATESTATUS_UNKNOWN; - } - } -} - diff --git a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoInterface.php b/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoInterface.php deleted file mode 100644 index 3d3592a8d93f9959772f5f8a872b166a9e77aede..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/UpdateService/StatusInfoInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * @file - * Interface for update_status engine implementations. - */ - -namespace Drush\UpdateService; - -interface StatusInfoInterface { - - /** - * Constructor. - * @todo this pertains to a yet to be defined EngineInterface. - */ - public function __construct($type, $engine, $config); - - /** - * Returns time of last check of available updates. - */ - function lastCheck(); - - /** - * Refresh update status information. - */ - function refresh(); - - /** - * Get update information for all installed projects. - * - * @return Array containing remote and local versions - * for all installed projects. - */ - function getStatus($projects, $check_disabled); -} diff --git a/vendor/drush/drush/lib/Drush/User/User6.php b/vendor/drush/drush/lib/Drush/User/User6.php deleted file mode 100644 index 1ecb6681a590314f17223e367d7f070b532bc868..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/User6.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drush\User; - -class User6 extends User7 { - - /** - * {inheritdoc} - */ - public function create($properties) { - $account = user_save(NULL, $properties, NULL); - return new UserSingle6($account); - } - - /** - * {@inheritdoc} - */ - public function load_by_name($name) { - return user_load(array('name' => $name)); - } - - /** - * {@inheritdoc} - */ - public function load_by_mail($mail) { - return user_load(array('mail' => $mail)); - } - -} diff --git a/vendor/drush/drush/lib/Drush/User/User7.php b/vendor/drush/drush/lib/Drush/User/User7.php deleted file mode 100644 index 531cacb4e42e8c52de52b84b157d6334e8e304bc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/User7.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Drush\User; - -class User7 extends UserVersion { - - /** - * {inheritdoc} - */ - public function create($properties) { - $account = user_save(NULL, $properties, NULL); - return new UserSingle7($account); - } -} diff --git a/vendor/drush/drush/lib/Drush/User/User8.php b/vendor/drush/drush/lib/Drush/User/User8.php deleted file mode 100644 index 87e86b111fccc3341053bc2870b83c24491a2f59..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/User8.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - - -namespace Drush\User; - -use Drupal\user\Entity\User; - -class User8 extends UserVersion { - - /** - * {inheritdoc} - */ - public function create($properties) { - $account = entity_create('user', $properties); - $account->save(); - return new UserSingle8($account); - } - - /** - * Attempt to load a user account. - * - * @param int $uid - * @return \Drupal\user\Entity\User; - */ - public function load_by_uid($uid) { - return User::load($uid); - } - - /** - * {inheritdoc} - */ - public function getCurrentUserAsAccount() { - return \Drupal::currentUser()->getAccount(); - } - - /** - * Set the current user in Drupal. - * - * @param \Drupal\Core\Session\AccountInterface $account - */ - public function setCurrentUser($account) { - // Some parts of Drupal still rely on a global user object. - // @todo remove once https://www.drupal.org/node/2163205 is in. - global $user; - $user = $account; - \Drupal::currentUser()->setAccount($account); - } -} diff --git a/vendor/drush/drush/lib/Drush/User/UserList.php b/vendor/drush/drush/lib/Drush/User/UserList.php deleted file mode 100644 index 3c38e2132d7a30b1d4ca6767e348ddd67aef6715..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/UserList.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -namespace Drush\User; - -class UserList { - - /** @var \Drush\User\UserSingleBase[] */ - public $accounts; - - /** - * Finds a list of user objects based on Drush arguments, - * or options. - */ - public function __construct($inputs) { - if ($this->accounts = $this->getFromOptions() + $this->getFromParameters($inputs)) { - return $this; - } - else { - throw new UserListException('Unable to find a matching user.'); - } - } - - /** - * Iterate over each account and call the specified method. - * - * @param $method - * A method on a UserSingleBase object. - * @param array $params - * An array of params to pass to the method. - * @return array - * An associate array of values keyed by account ID. - */ - public function each($method, array $params = array()) { - foreach ($this->accounts as $account) { - $return[$account->id()] = call_user_func_array(array($account, $method), $params); - } - return $return; - } - - /* - * Check common options for specifying users. If valid, return the accounts. - * - * @return \Drush\User\UserSingleBase[] - */ - function getFromOptions() { - $accounts = array(); - $userversion = drush_user_get_class(); - if ($mails = _convert_csv_to_array(drush_get_option('mail'))) { - foreach ($mails as $mail) { - if ($account = $userversion->load_by_mail($mail)) { - $single = drush_usersingle_get_class($account); - $accounts[$single->id()] = $single; - } - else { - throw new UserListException('Unable to find a matching user for ' . $mail . '.'); - } - } - } - if ($names = _convert_csv_to_array(drush_get_option('name'))) { - foreach ($names as $name) { - if ($account = $userversion->load_by_name($name)) { - $single = drush_usersingle_get_class($account); - $accounts[$single->id()] = $single; - } - else { - throw new UserListException('Unable to find a matching user for ' . $name . '.'); - } - } - } - if ($userids = _convert_csv_to_array(drush_get_option('uid'))) { - foreach ($userids as $userid) { - if (is_numeric($userid) && $account = $userversion->load_by_uid($userid)) { - $single = drush_usersingle_get_class($account); - $accounts[$single->id()] = $single; - } - else { - throw new UserListException('Unable to find a matching user for ' . $userid . '.'); - } - } - } - return $accounts; - } - - /** - * Given a comma-separated list of inputs, return accounts - * for users that match by uid,name or email address. - * - * @param string $inputs - * A comma delimited string (or array) of arguments, specifying user account(s). - * - * @throws UserListException - * If any input is unmatched, an exception is thrown. - * - * @return \Drush\User\UserSingleBase[] - * An associative array of UserSingleBase objects, keyed by user id. - */ - public static function getFromParameters($inputs) { - $accounts = array(); - $userversion = drush_user_get_class(); - if ($inputs && $userversion) { - $inputs = _convert_csv_to_array($inputs); - foreach($inputs as $input) { - if (is_numeric($input) && $account = $userversion->load_by_uid($input)) { - - } - elseif ($account = $userversion->load_by_name($input)) { - - } - elseif ($account = $userversion->load_by_mail($input)) { - - } - else { - // Unable to load an account for the input. - throw new UserListException('Unable to find a matching user for ' . $input . '.'); - } - // Populate $accounts with a UserSingle object. Will go into $this->accounts. - $single = drush_usersingle_get_class($account); - $accounts[$single->id()] = $single; - } - } - return $accounts; - } - - /* - * A comma delimited list of names built from $this->accounts. - */ - public function names() { - $names = array(); - foreach ($this->accounts as $account) { - $names[] = $account->getUsername(); - } - return implode(', ', $names); - } -} diff --git a/vendor/drush/drush/lib/Drush/User/UserListException.php b/vendor/drush/drush/lib/Drush/User/UserListException.php deleted file mode 100644 index 4b770c3a55705c8d2541ea5cd6838b1ed956aeca..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/UserListException.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -namespace Drush\User; - -class UserListException extends \Exception {} diff --git a/vendor/drush/drush/lib/Drush/User/UserSingle6.php b/vendor/drush/drush/lib/Drush/User/UserSingle6.php deleted file mode 100644 index 1411682643afda381e1d117fcdb27b27404c8971..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/UserSingle6.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Drush\User; - -class UserSingle6 extends UserSingle7 { - - public function cancel() { - user_delete(array(), $this->account->uid); - } -} diff --git a/vendor/drush/drush/lib/Drush/User/UserSingle7.php b/vendor/drush/drush/lib/Drush/User/UserSingle7.php deleted file mode 100644 index 1deb4efbe2f6baa29ac6fc7af1225097fc8f03da..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/UserSingle7.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Drush\User; - -class UserSingle7 extends UserSingleBase { - - public function block() { - user_user_operations_block(array($this->account->uid)); - } - - public function unblock() { - user_user_operations_unblock(array($this->account->uid)); - } - - public function addRole($rid) { - user_multiple_role_edit(array($this->account->uid), 'add_role', $rid); - } - - public function removeRole($rid) { - user_multiple_role_edit(array($this->account->uid), 'remove_role', $rid); - } - - function info() { - $userinfo = (array)$this->account; - unset($userinfo['data']); - unset($userinfo['block']); - unset($userinfo['form_build_id']); - foreach (array('created', 'access', 'login') as $key) { - $userinfo['user_' . $key] = format_date($userinfo[$key]); - } - $userinfo['user_status'] = $userinfo['status'] ? 'active' : 'blocked'; - return $userinfo; - } - - function password($pass) { - user_save($this->account, array('pass' => $pass)); - } - - public function getUsername() { - return $this->account->name; - } - - public function id() { - return $this->account->uid; - } -} diff --git a/vendor/drush/drush/lib/Drush/User/UserSingle8.php b/vendor/drush/drush/lib/Drush/User/UserSingle8.php deleted file mode 100644 index 07db56c9f2c626db93bdc11bf6e358cf4dafe534..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/UserSingle8.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -namespace Drush\User; - -class UserSingle8 extends UserSingleBase { - -} diff --git a/vendor/drush/drush/lib/Drush/User/UserSingleBase.php b/vendor/drush/drush/lib/Drush/User/UserSingleBase.php deleted file mode 100644 index 083ce2f38ba09d96ffab8ae33bc8f0472778da7d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/UserSingleBase.php +++ /dev/null @@ -1,133 +0,0 @@ -<?php - -namespace Drush\User; - -abstract class UserSingleBase { - - // A Drupal user entity. - public $account; - - public function __construct($account) { - $this->account = $account; - } - - /** - * A flatter and simpler array presentation of a Drupal $user object. - * - * @return array - */ - public function info() { - return array( - 'uid' => $this->account->id(), - 'name' => $this->account->getUsername(), - 'password' => $this->account->getPassword(), - 'mail' => $this->account->getEmail(), - 'user_created' => $this->account->getCreatedTime(), - 'created' => format_date($this->account->getCreatedTime()), - 'user_access' => $this->account->getLastAccessedTime(), - 'access' => format_date($this->account->getLastAccessedTime()), - 'user_login' => $this->account->getLastLoginTime(), - 'login' => format_date($this->account->getLastLoginTime()), - 'user_status' => $this->account->get('status')->value, - 'status' => $this->account->isActive() ? 'active' : 'blocked', - 'timezone' => $this->account->getTimeZone(), - 'roles' => $this->account->getRoles(), - 'langcode' => $this->account->getPreferredLangcode(), - 'uuid' => $this->account->uuid->value, - ); - } - - /** - * Block a user from login. - */ - public function block() { - $this->account->block(); - $this->account->save(); - } - - /** - * Unblock a user from login. - */ - public function unblock() { - $this->account->get('status')->value = 1; - $this->account->save(); - } - - /** - * Add a role to the current user. - * - * @param $rid - * A role ID. - */ - public function addRole($rid) { - $this->account->addRole($rid); - $this->account->save(); - } - - /** - * Remove a role from the current user. - * - * @param $rid - * A role ID. - */ - public function removeRole($rid) { - $this->account->removeRole($rid); - $this->account->save(); - } - - /** - * Block a user and remove or reassign their content. - */ - public function cancel() { - if (drush_get_option('delete-content')) { - user_cancel(array(), $this->id(), 'user_cancel_delete'); - } - else { - user_cancel(array(), $this->id(), 'user_cancel_reassign'); - } - // I got the following technique here: http://drupal.org/node/638712 - $batch =& batch_get(); - $batch['progressive'] = FALSE; - batch_process(); - } - - /** - * Change a user's password. - * - * @param $password - */ - public function password($password) { - $this->account->setPassword($password); - $this->account->save(); - } - - /** - * Build a one time login link. - * - * @param string $path - * @return string - */ - public function passResetUrl($path = '') { - $url = user_pass_reset_url($this->account) . '/login'; - if ($path) { - $url .= '?destination=' . $path; - } - return $url; - } - - /** - * Get a user's name. - * @return string - */ - public function getUsername() { - return $this->account->getUsername(); - } - - /** - * Return an id from a Drupal user account. - * @return int - */ - public function id() { - return $this->account->id(); - } -} diff --git a/vendor/drush/drush/lib/Drush/User/UserVersion.php b/vendor/drush/drush/lib/Drush/User/UserVersion.php deleted file mode 100644 index e7649a213e8351608497a6708e77e208744c4d9d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/lib/Drush/User/UserVersion.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Drush\User; - -abstract class UserVersion { - - /** - * Create a new user account. - * - * @param array $properties - * - * @return - * A user object. - */ - public function create($properties) {} - - /** - * Attempt to load a user account. - * - * @param int $uid - * @return mixed - */ - public function load_by_uid($uid) { - return user_load($uid); - } - - /** - * Attempt to load a user account. - * - * @param string $name - * @return mixed - */ - public function load_by_name($name) { - return user_load_by_name($name); - } - - /** - * Attempt to load a user account. - * - * @param string $mail - * @return mixed - */ - public function load_by_mail($mail) { - return user_load_by_mail($mail); - } - - /** - * Load the current user account. - * - * @return mixed - * A user object. - */ - public function getCurrentUserAsAccount() { - global $user; - return $user; - } - - /** - * Load the current user account and return a UserSingle instance. - * - * @return \Drush\User\UserSingleBase - * A Drush UserSingle instance. - */ - public function getCurrentUserAsSingle() { - return drush_usersingle_get_class($this->getCurrentUserAsAccount()); - } - - /** - * Set the current "global" user account in Drupal. - - * @param - * A user object. - */ - public function setCurrentUser($account) { - global $user; - $user = $account; - } -} diff --git a/vendor/drush/drush/misc/d8-rs-router.php b/vendor/drush/drush/misc/d8-rs-router.php new file mode 100644 index 0000000000000000000000000000000000000000..951950abd7b28a5d2ba34e599702bbf4847648b0 --- /dev/null +++ b/vendor/drush/drush/misc/d8-rs-router.php @@ -0,0 +1,46 @@ +<?php + +$url = parse_url($_SERVER["REQUEST_URI"]); +if (file_exists('.' . urldecode($url['path']))) { + // Serve the requested resource as-is. + return FALSE; +} + +// The built in webserver incorrectly sets $_SERVER['SCRIPT_NAME'] when URLs +// contain multiple dots (such as config entity IDs) in the path. Since this is +// a virtual resource, served by index.php set the script name explicitly. +// See https://github.com/drush-ops/drush/issues/2033 for more information. +// Work around the PHP bug. Update $_SERVER variables to point to the correct +// index-file. +$path = $url['path']; +$script = 'index.php'; +if (strpos($path, '.php') !== FALSE) { + // Work backwards through the path to check if a script exists. Otherwise + // fallback to index.php. + do { + $path = dirname($path); + if (preg_match('/\.php$/', $path) && is_file('.' . $path)) { + // Discovered that the path contains an existing PHP file. Use that as the + // script to include. + $script = ltrim($path, '/'); + break; + } + } while ($path !== '/' && $path !== '.'); +} + +// Update $_SERVER variables to point to the correct index-file. +$index_file_absolute = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $script; +$index_file_relative = DIRECTORY_SEPARATOR . $script; + +// SCRIPT_FILENAME will point to the router script itself, it should point to +// the full path of index.php. +$_SERVER['SCRIPT_FILENAME'] = $index_file_absolute; + +// SCRIPT_NAME and PHP_SELF will either point to index.php or contain the full +// virtual path being requested depending on the URL being requested. They +// should always point to index.php relative to document root. +$_SERVER['SCRIPT_NAME'] = $index_file_relative; +$_SERVER['PHP_SELF'] = $index_file_relative; + +// Require the script and let core take over. +require $_SERVER['SCRIPT_FILENAME']; \ No newline at end of file diff --git a/vendor/drush/drush/misc/icon_PhpStorm.png b/vendor/drush/drush/misc/icon_PhpStorm.png new file mode 100644 index 0000000000000000000000000000000000000000..698923d114b178270922911600ad05454f5f6aec --- /dev/null +++ b/vendor/drush/drush/misc/icon_PhpStorm.png @@ -0,0 +1,25 @@ +�PNG + +��� IHDR������������>a����tEXtSoftware�Adobe ImageReadyq�e<��VIDATx��]ml��9��"��������V�CK���-5|��/�U[~�v�Ol�A?l����NiEA���@pRh��; ��!���H�Tr�T�*Q�� �N�ݝ����ٝ�:�%�J�����{�y��}�5B���� +���N��?)ӇE���A�:���y/P���0��=��ӋV�3D�"�y���%�w�7�3����N�/��h�'88((��t���g��0/_<�5DP�#��X�>=A�1Q�JPD621t�K4 +����k���YOf��J@H�б��������j�sH�H�CI�����"td��� +JD_�4�3 ����"����ηj��v\���K�� �ޣ�Ǯ�Q�ʱ� m�� vg:����|N����̯b�ٽ�!!��<@�0m��)�01,5�4@��H�����2&�|�:��pb���$$E�-��J��Jhz��b!��8}�#s%���������CB�h}��$u<����60Q��g���8���39�0��#�@� ���i +�1���Q���v5K�� +��;0A�=�g�\��c����������u~���J����D��x����wf���($�O�a�9_�tri�ےd���{��~J�3��u���i��}6�6ֺ�=��{����{[�'�`�6�Ҽ�;�_-��M/���G�r���.:�1�|�%:p�c�_:�!`:n�ω-Wb�}�gX��@f�K@ M~Ɋ ������x���c6��� �*ԉ����%��ݹ�K!���N ��Ft��ÝX��+}!�]����G�0�w���0�]�=4���%;:����3���8�z�,�zia����� ��͙n� +y���M��[nFo\p�`�-%�����f��؛ل���k�?��v����P$M�������Wbb�l�����v����&������a�i]>Zo:�Q?�RG�����Ћ[�p���_땛^��=UB\�y��B(�^H���P��� + �t�����E�����a��M��/�v4��)cNC��ZcH�����������p8z�腕WZ��`%X9����f�����{ :��ǎ��G���F"1�ҧ�@ĺ�Z� +�L����O_A�ŷgv���,��,�d��%�=�'E���QX��`�:�ny���'Zдƅ�[���D���4�K��^^0���[�-dY��ܵ���]�X�ݦ�P�]��|���������f��.��Sh���kd����ڐ���1X��ć�z�W� %_� f ���H� +���˂��!!(K�ƅ���P#�Q=vs�tB����W��@fM�UݱW���Bh�ANs���k¸#et����2���o�[XX���x�/��V�A�]/�c#2�_�%B�oxO��jx�K��|~~>�����2ZZZr���1��{����� �����8p���Hj�߷L�n�s|�r �N���������ҮZ +n�U�����ӌ^�^7�a߾}hzz�G��SSS�l�b��������@,��1���;�o� ���+������Pm��/�B�m������qt��IT��UC���]��|��������:���x"6� +�ۊA�C�_]wĦ�Xl�_�p+{؈4�077���0�Dž�} ��¾7���X$����#��J��÷�T�X�Νj���� @�Q6::��pH�������N�ٮ�~��hwZ�����k]��]Hp���ot)�\�T��НOj�FMNN��?͋���8����c��*�@VX�_U���V���Z��4�{X�2�{6�@��ș���P��=�fܮ�����'������a���&p�ī�@g|��������9��^/p_S�P�����zll�H�;v�p�^�L�0��ᎁ�}�700`L��;y�(dY�D�Jb/��<�^�n i��7�~�J?����m�tm����� ���yS�g&O��qA����� ���<����e2���eEud+#�2��v�~���V�����~��/�u�$���q����(��� +߿gϞL��X,'���ϛ"{�,���@��1(��0 ��a�����r��vX���pak������%�j�Α����Oy?�S1���ղ����a_��?@�&RA�K�NlB@�Lv��G�9�5� �כvz�L���-y�W��BB��,��|�M��� �0ۉ�;����u rP���z�N��O� �MHh�"MT�6 �L�P�0@u1��A0`-��h^����-�o�V��s�j`���l"L(�ڴ�)]C�0H˂L���`�&jy�?`Xk�����_�1�"��l�z^d���b �w���+T#��ho�b��4P��A�%���������IV!��E]��e�w$&��yO�����>�0PW� ���o'������-����u��[����ZXRA���5/ > 4Y�)�5�k��T1���V�%����s�����: nu��"�l*���3UA@�?�����`��@�5�u��9X�����^��u�2�+��me�:����5�����l���kH�A���WǪ�aP ��nC�# �$�Ŷ�ik��^�8���#�J����˟�㾒���r�]H�� b#�=u((L�Slݺ�uh1s�b ��!T�|�*���>�&��5&K��SC�.2�`C@Kl��,�K��Y�ζm���+5G�J�X7��롂i_��?/���]�{��S�O�B8�n��m|=>��<� +�Rr����aGnYA��v)1=X8M�;�d�?���Yd��6���Y�Us&|\��$,E��e�(\�F|4���"ͯ�,Pje ��>�y��wt�W[���pLS�|_���������$�ڮMo[��!��^��y?B�������wa�Vԉ*_+����)��i ����A�S>��7��wu_Ǭ���a]CI���8��`F�S�T���f*xe�-g)6��`��פ|(���B/i��MH JHp����͡���q��u۴��i�?�����Q�湨�w�q���o���Y�����˕"J�f�m\�Ӽ�GP=�j���u�,���zٻ�����,�,�o_}����]�-Z甯��&�CBޜr���3�u��y����^��:�wO�����r��<����k�>�5�"�,�{I�TV�4���|��������h�&��r��ꍔ]�o<�(+�/�����'�d���q����I�WR-p��"K����Ab�!�!���5��|�/��<>��5���3i�M�+� L��`� /PW����,�Q����tH��i�j(��$R?Q���`�r~p�^&�6#��!!��ۺ�Z�WY���� +=�^��zb���������Ֆ�C��o� �(����gA��i�� ��k�P��$����9v�X"�X���_ +F���X�Ʊ��PȽ�V;�HY{JȰ(ij$����-�SM���ݷ���Ar��Ŵ���_��9�G��g�^�;} � +� ���{�u��Lodc�.z����8��5��K�](��qk���u:���0��G�W�Yk�u~(��eay~Q���$ 'e���]������b�dH�YBa)�@�(t��L�0��E +h6&�R�/����QnUytw<]�uXA�G�!����mݒ����Ã�������%^�#a�`�4�� z�n3�,I�n�, h���>T;]N�X& R�eH( �:@��"#�@�� _` �n��ҩ�f�x���||j��Jj�����Ր��H +˶`8?�����H��L�����O�pP��soWR�� ͍ +��[������OI��9�� ���[����,�'� Dj!@,��Z��w),q`��"ܢDlh& wt�a� $��#dQ�����/���&�ԥ{�#��iIamJ�z`&1�<*ba�i(? $���XdLQ������pB�=kMY�*4@��Pgy�è���/Bj.b�60�5̴�<��nݞ�%�V�1!�'��o}���}{�c�2̾L�3(B��<�`fw�j����]�L����wf����x!��{�Y�.��v���]��E��x���uG�(T_/,]�]���o��N9���}Y�ZBE�E p�#��b���'@CU�a!��l��M"j8�,P��%�6�vҺ���|t��4��1@��x�DQ��PXJ�" �j�Y VB� +K)D8��[�q���i&��Y@�i`��O8���@w���b��f��"�=��l�T�ĝ���m��@��l�A�A9������l�1X�Ʒ�w?q'���ş�[�ǘ*��tJ_�-3���^l����gv��̣y���c��#���h��I�|�������u�,����:z[���L�|-�w�rצ��_O��k [�OD��2rS8��M���q��m�J����` zT�ս���v����|k�/��������]�z���;�x"/q?����"�_�G*�$��2��Re�Ps<Y��{ &����Q�u�`q� ��t��g|�C���.Q�G�Y��lh�'��=vG/��f��\�����8� =��d���<�@�?���=��F:�i��a��!U����u�e���;�3ێߴ#��(��I��}�NX� �[������o�������qf�5�� t?2y������ۥ`�00ـ!�ҭ�u�����c�{�n�ov�6n`ث�,&pZ�� +X�&M�p������� +��9 퇟_��������y��~E�@:D;[�����u���O����q^��9r�J���A�x,g�&�/=}�y� ��[̞�m�Fg�����}W���To#������gN�#�j1����ձ������h�w�6��m�P���H���@���� +ut�:w��jR�_?�_�����f�R�]�n�����IEND�B`� \ No newline at end of file diff --git a/vendor/drush/drush/misc/windrush_build/README.md b/vendor/drush/drush/misc/windrush_build/README.md deleted file mode 100644 index c5a7fd6b84f332a7d36e90187b227f73a807d4f6..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/misc/windrush_build/README.md +++ /dev/null @@ -1,8 +0,0 @@ -This directory holds the build script for Drush's Windows distribution. This script is only useful to Drush administrators who are generating a new build. - -To use this script: - -- Edit the metadata at the top -- Run the script -- Attach the .zip file to the corresponding Release on Github. -- Update the links at bottom of docs/install.md diff --git a/vendor/drush/drush/misc/windrush_build/assets/composer.bat b/vendor/drush/drush/misc/windrush_build/assets/composer.bat deleted file mode 100644 index 3b62e48cd8a250f152917d9135889cd9c021826d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/misc/windrush_build/assets/composer.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off - -SET SCRIPT_HOME=%~dp0 -SET PATH=%SCRIPT_HOME%php;%PATH% - -@php.exe %SCRIPT_HOME%composer.phar %* diff --git a/vendor/drush/drush/misc/windrush_build/assets/drush.bat b/vendor/drush/drush/misc/windrush_build/assets/drush.bat deleted file mode 100644 index e7ea6cc01631cab9423050e574d43adf740197b5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/misc/windrush_build/assets/drush.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off - -SET SCRIPT_HOME=%~dp0 -SET PHP_PATH=%SCRIPT_HOME%php -SET PATH=%SCRIPT_HOME%tools\bin;%PHP_PATH%;%PATH% - -@php.exe "%SCRIPT_HOME%vendor\drush\drush\drush.php" --php="php.exe" %* diff --git a/vendor/drush/drush/misc/windrush_build/assets/notify_env_change.exe b/vendor/drush/drush/misc/windrush_build/assets/notify_env_change.exe deleted file mode 100644 index 82bb64079f5ee9327edc4487c3dd347dc56f1166..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/misc/windrush_build/assets/notify_env_change.exe +++ /dev/null @@ -1,126 +0,0 @@ -MZ��������������������@������������������������������������������ �!�L�!This program cannot be run in DOS mode. -$����������@���@���@��ͱ&V�S��ͱ&T�J��ͱ&W����@�����ͼ� �E����W�A����U�A���Rich@���������������������������PE��L��z(R������������b���������������������@���������������������� ���������@����������������������������T���<������������������������������D����������������������������������0���@�����������������������������������������.text����`������b����������������� ��`.rdata���E�������F���f��������������@��@.data���,�������������������������@���.reloc���������������������������@��B������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������U��Qj���@��E�j�j��EP��@�P�MQ�U�R��@���]�U����E������E������E�Ph���jh��@�j�jh������@��E�}��u�E�����h�@��������E���]�jh��@����j����Y�MZ��f9��@�t3��3�<�@�����@�PE��u���f9��@�u�3ۃ�t�@�v 9���@��É]��� -����uj�����Y�.����uj�����Y�r���e���� -����yj����Y��@���@�������@��N ����yj���Y�j����yj ���Yj����Y��tP���Y��@����@�P�5�@��5��@����������u܅�uV�������.�M����E�QP����YYËe�u��u܃}��uV����R���E�����������U��=`�@�t�����u���h��������YY]������{���U��E���8csm�u%�xu�@= �t=!�t="�t =�@�t3�]�������h@��.��Y3��U��V��������E���V\W�}��99t ��������;�r����;�s99t3Ʌ�����Q�������u�a�3�@�������u���������ES�^`�F`�y�����j$_�F\���d��������|�9�����~du�Fd���������9����u �Fd�����u�9����u �Fd�����d�9����u �Fd�����S�9����u �Fd�����B�9����u �Fd�����1�9����u �Fd����� �9���u �Fd������9���u�Fd�����vdj��Y�~d� �q�a���Y�^`���[�3�_^]�jh��@�����u�������~$�t �v$�\��Y�~,�t �v,�M��Y�~4�t �v4�>��Y�~<�t �v<�/��Y�~@�t �v@� ��Y�~D�t �vD���Y�~H�t �vH���Y�~\P�@�t �v\����Yj �o��Y�e���~h��tW�$�@���u����@�tW����Y�E������W���j�6��Y�E�����~l��t#W���Y;=�@�t���@�t�?�uW�%��Y�E���������V�k��Y�������uj �C��YËuj�7��Y�V��������uj���Y��^�VW��@��54�@��������Y��uGh���j�B����YY��t3V�54�@����YY��tj�V�%���YY�(�@��N��� V����Y3�W��@�_��^�jh�@��� ���u�F\P�@��f�3�G�~�~pjCXf������f������Fh��@�������j ���Y�e���vh� �@��E������>���j����Y�}��E�Fl��u��@��Fl�vl�R��Y�E���������� ���3�G�uj ���Y�j����Y���������u�c���3��h�@��C��Y�4�@����t�Vh���j�����YY��t-V�54�@��s��YY��tj�V�����YY�(�@��N��3�@^�����3�^á4�@����tP����� 4�@��Y�8��U��Q�E�Ph��@�j��8�@���th�@��u��<�@���t�u����U���u�����Y�u�4�@��U������u����Yh���������jjj��@�����jj�j��1�����U��=�@��th�@��N!��Y��t -�u��@�Y�e#��h0�@�h�@������YY��uPVWh�"@��/#��Y��@���@�����t�Ѓ�;�r�=��@��_^th��@��� ��Y��tj�jj����@�3�]�U��j�j�u������]�Vj��,�@���V�#��V�P��V�#��V�&#��V�:#��V�i ����^�-��U��V�u����t�Ѓ�;ur�^]�U��V�u3����u���t�у�;ur�^]�j�`��Y�j���Y�jh�@��� -��j�B��Y�e���=��@���������@�����E���@��}�������5�@��50�@��؉]ԅ�tt�5��@����]�}��}܃��}�;�rWj��,�@�9t�;�rG�7��j��,�@�����5�@��50�@��։E��5��@��M�9M�u9E�t��M�ى]ԉE����hD�@�h4�@������YYhL�@�hH�@������YY�E������ ����}�u)���@����j���Y�u�i����}�tj���Y��� ���U��j�j��u�������]�j����Y��tj����Y��u�= �@�uh�����1���h�����'���YY�U��M3�;Š�@�t -@��r�3�]ËŤ�@�]�U���������@�3ʼnE�V�uWV������Y���y��Sj�h��Y�����j�W��Y��u �= �@�������������A��h��@�h��h(�@���#����3ۅ��/��h��hZ�@�Sf�b�@��H�@�������uh�@�VhZ�@��#�����������hZ�@���#��@Y��<v5hZ�@���#���E��@���-Z�@�j��h�@�+�VQ��#�����������h �@�h���(�@�V��"�����������Wh��V�"������u{h �h(�@�V�<$�����Wj���@�����tI���tD3ۋˊO�� ���f9Ot A�����r�S�����P�����P�]���!��YP�����PV�D�@�[�M�_3�^�%����SSSSS������L�@�3Ʌ����P�@����jdh0�@��k��j����Y3ۉ]�j@j _W�r��YY�ȉM܅�uj��E�Ph��@��h%��������U���X�@��=��@����;�s1f�A� -� ��Y�a$��A$$�A$f�A% - -�Y8�Y4��@�MܡX�@��ƍE�P�\�@�f�}���)���E��������M���E���E����;�|�ȉM�3�F�u�9 ��@�} j@W� ��YY�ȉM܅������� ��@��M���}ԋE؋U�;�������2���tX���tS���tM�uV�P�@��U���t8����������4�X�@��u܋��E؊��Fh����FP�T�@��F�U��M�G�}ԋE�@�E��U�놉�X�@�=��@���X�@����;�s$f�A� -� ��Y�a$�f�A% - -�Y8�Y4��@�M���F�uЋM������]ԃ����������5X�@��u܃>�t�>�t�F��F�����F���uj�X� -�C�������P��@������tE��tAW�P�@���t6�>%������u�F@���u �F�Fh����FP�T�@��F�"�F@�F������\�@���t -���@����C�<����E���������3�����j���Y�U��QQ�=�@��u����SVWh���X�@�3�WS�\�@��`�@��5�@��=�@���t8u���E�P�E�PSSV�[����]��������?sE�M����s=��;�r6R�����Y��t)�E�P�E�P��PWV�����E���H���@��=�@�3�����_^[��U��ES�]V�#��u������EW�}��t�8���E3ɉM�>"u3�����F�ȉM�"�5���t��G��E��PF�%��Y��t���t��GF�E��t�M��u�< t< u���t�G���N�e��>�������< t< uF��>�������U��t�:���U�E��3�B3��FA�>\t��>"u3��u�}�t�F�8"u��� 3�3�9E���E���I��t�\G���u���tA9Mu< t8< t4��t*��P�.$��Y��t��t��GF���G���tF��F�o�����t��G��-����U_^[��t�"��E��]Ã=�@��u�� ��V�5��@�W3���u�������<=tGV�}��FY����u�GjP�w ����YY�=�@���tʋ5��@�S�>�t>V�H���>=Y�Xt"jS�F ��YY���t@VSP�u#������uH���>�uȋ5��@�V�����%��@���'���@����3�Y[_^��5�@�����%�@�������3�PPPPP�����U��E� �@�]�U��E��x!��~ ��u� `�@��� `�@��`�@���]���������������]�U������@��e���e��VW�N�@������;�t ��t �У��@��f�E�P�l�@��E�3E�E��(�@�1E��h�@�1E��E�P�d�@��M�3M�E�3M�3�;�u�O�@����u�� G����ȉ ��@��щ ��@�_^��VW���@����@�����t�Ѓ�;�r�_^�VW���@����@�����t�Ѓ�;�r�_^�U��QW�p�@���3���tuV��f9t��f9u���f9u�SPPP+�P��FVWPP�x�@��E���t7P�����Y��t*3�PP�u�SVWPP�x�@���u S���Y3�W�t�@���� W�t�@�3�[^_�����������h�#@�d�5�����D$�l$�l$+�SVW���@�1E�3�P�e��u��E��E������E��E�d�����ËM�d� ����Y__^[��]Q��������U���S�]VW�{3=��@��E���E������s���t �O�30����O�G�30�u���E�@f������E�E�E�E�C��C�E����������@�@�L������E���t{���2����M����~���~h�E�8csm�u(�=��@��th��@��3������tj�u���@����U�M����E�U�9Pth��@�V������E�X����tu�f�M��É]�����]�����tG�!�E�������{�t6h��@�V�˺������������t �O�30�l���O�W�32�\���E�_^[��]ËO�30�E���O�G�30�5���M��I�E���jhP�@�����������@x��t�e�����3�@Ëe��E���������hE%@��,�@��d�@��U�졀�@�3��@�t�u��]�]�%��@�U�졄�@�3��@��ut��]����@�]�U�졈�@�3��@��ut��]����@�]�U�졌�@�3��@��u�ut��]����@�]�U��QV�5��@���y%���@�3�3��@��u�t V�M�Q�Ѓ�zuF�5��@�3�����^��VWht�@����@��5<�@���h��@�W��3��@�h��@�W���@���3��@�h��@�W���@���3��@�h��@�W���@���3��@�h��@�W���@���3��@�h،@�W���@���3��@�h�@�W���@���3��@�h�@�W���@���3��@�h�@�W���@���3��@�h0�@�W���@���3��@�hP�@�W���@���3��@�hh�@�W���@���3��@�h��@�W���@���3��@�h��@�W���@���3��@�h��@�W���@���3��@����@�hč@�W��3��@�h�@�W���@���3��@�h��@�W���@���3��@�h �@�W���@���3��@�h4�@�W���@���3��@�hP�@�W���@���3��@�hd�@�W���@���3��@�ht�@�W���@���3��@�h��@�W���@���3��@�h��@�W���@���3��@�h��@�W���@���3��@�h��@�W���@���3��@�hԎ@�W���@���3��@�h�@�W���@���3��@�_���@�^�U���u���@�]�U���u���@�P���@�]�U��j����@��u�|�@�]�U��V�u�<���@��uV�q���Y��uj�!���Y�4���@����@�^]�VW���@���S���t�tS�X�@�S�"���'�Y������@�|�[�>�t�~u�6�X�@�������@�|�_^�jhp�@�������=P�@��u�L���j����h�����{���YY�}�<���@��u[j�2��Y����u�\�������3��Aj -����Y�e���<���@��uh���V�T�@��4���@��V�i���Y�E������ ���3�@�����j -�7���Y�VW���@��h�@��~u�>h����6���T�@�������@�|�3�_@^�U��E�4ň�@����@�]�U��}�t-�uj��5P�@����@���uV� ������@�P� ��Y�^]�U��VW3�j��u�u����������u'9��@�vV���@��������; ��@�v������uË�_^]�U��SVW�=��@�3��u�w����Y��u%��t!V���@��=��@��������;�v������u�_^��[]�U��VW3��u�u������YY��u,9Et'9��@�vV���@��������;��@�v������u���_^]�U��SV�5 �@�W�}W�փx�t�wx��������tP�փ|�t�w|��������tP��jX�_�E�{���@�t�;�t�3�E�{��t�{��t�s��E��H�Eu���������P��_^[]�U��SV�u3ۋ�����W��tf=0�@�t_�Fx��tX9uT��������t9uP��������������YY�F|��t9uP��������������YY�vx����������������YY��������tD9u@������-����P���������������+�P����������+�P����������������������=��@�t9�����uP����������j���YYjX�������~�E����@�t���t�8�uP�?����3�8���YY�E���t�G���t�8�uP����Y�E����H�Eu�V����Y_^[]�U��V�u�������SW�=$�@�V�׃~x�t�vx��������tP�׃~|�t�v|��������tP��jX�^�E�{���@�t�;�t�3�E�{��t�{��t�s��E��H�Eu�����������Q��_[��^]�jh��@��q���� ������ $�@��Npt"�~l�t������pl��uj �����Y�������j����Y�e���5�@��FlP�!���YY���u��E���������뼋u�j�����Y�U��W�}��t;�E��t4V�0;�t(W�8�����Y��tV�����>�Yu���@�tV�O���Y��^�3�_]Ã=�@��uj�����Y��@����3��U��V��M�F���uf�����ЉV�Jl��Jh�N�; �@�t�$�@��Bpu�������F;��@�t�N�$�@��Apu�����F�N�Ap�u���Ap�F� -���A�F��^]��U��E-���t&��t�� tHt3�]á`�@�]á\�@�]áX�@�]áT�@�]�U����M�j��.����E�%��@�����u���@�������@��,���u���@�������@�����u�E����@�����@�}��t�M��ap���U��S�]VWh��3��sWV�`��3��ȉ{�{����������{������@���+�����7�FIu����������9�AJu�_^[]�U��� �����@�3ʼnE�SV�uW������P�v���@�3ۿ�����������È�����@;�r�����ƅ���� ��������Q��� ;�s Ƅ���� @;�v�����u�S�v������PW������PjS�/��S�v������WPW������PW����S������@������S�vWPW������Ph�������S�����$����M�����t�L�� ������t�L �� �������������A;�r��Wj�����X+ˉ������������� ��w -�L�A �������w�L �A����������A����;�r��M�_^3�[�����jh��@��g����������� $�@��Opt�l�t�wh��uj �����Y���~����j ����Y�e���wh�u�;5��@�t6��tV�$�@���u����@�tV�����Y���@��Gh�5��@��u�V� �@��E���������뎋u�j ����Y�jhн@����������W����؉]��=����sh�u�����Y�E;F�n��h �������Y���[��������E�ph���3��3S�u�G��YY���}��� ���E��ph�$�@����E�u�Hh����@�t -Q����Y�E�XhS� �@��E��@p������$�@������j �s���Y�u��C���@��C���@��������@��ΉM���}f�DKf�M��@�A��ΉM�����} �D����@�A��u������}��������@�F���5��@��$�@���u���@�=��@�tP�\���Y���@�S� �@��E����������1�}j �!���Y��#���u����@�tS����Y����������3����f����U��� ���@�3ʼnE�SV�u�u�-�����Y�]���uV����Y3����W3��ωM��9���@������A��0�M�=����r������������������������P���@���������E�PS���@��������h���FWP����^3�C������9]�vO�}���E�t!�P��t�����LA;�v����8�uߍF������@Iu��v�����������^��~3��ȋ�����~�������9=��@�tV���������������h���FWP�����U��k�0����@��E�8���t5�A��t+���������s����@�D�AC;�v���9�uE�G���E��r��]�S�^�F����W���������j�N����@�_f�f��R�IOu�V�<���Y3�_�M�^3�[�I����U���(�����@�3ʼnE��}�Wt �u���Y�������jL������j�P�����������������0�����������������������������������������������f������f������f������f������f������f��������������E�������E������Dž0������@��������E�������E�������E���������@���������P����Y��u��u�}�t �u���Y�M�3�_�& -����U��E���@�]�U���5��@��0�@���t]���u�u�u�u�u�����3�PPPPP��������j�9����tjY�)Vj���Vj�u���V�������^��E�����u�d�@�Ã��U��V������MQ�� ���Y�������0^]�������u�`�@�Ã��U��M3�;���@�t'@��-r�A��wj X]Í�D���jY;��#���]Ë���@�]��������������U��ES�H<�V�A�Y��3��W��t�}�p;�r �H�;�r -B��(;�r�3�_^[]��������������U��j�h�@�h�#@�d�����P��SVW���@�1E�3�P�E�d������e��E�����h��@��|�������tT�E-��@�Ph��@��R�������t:�@$���Ѓ��E������M�d� ����Y_^[��]ËE��3Ɂ8�������Ëe��E�����3��M�d� ����Y_^[��]�������U��E�MZ��f9t3�]ËH<�3��9PE��u���f9Q��]�Vjj �����YY��V�,�@���@����@���ujX^Ã&�3�^�jh�@����������e���u�#���Y���u��E���������������Ëu��a����U��QSV�50�@�W�5�@����5��@��E��؋E�;��������+��O��rvP������GY;�sG����;�s�Ƌ]��;�r PS����YY��u�F;�r>PS����YY��t1��P���,�@���@��u�,�@��KQ��,�@����@��E�3�_^[��U���u����������YH]�V3���h�@��,�@���h�@�����(r�^�U���5��@��0�@���t�u��Y��t3�@]�3�]�U��E���@�]�U��E���@�]�U��E���@�]��5��@��0�@��U��E���@����@����@����@�]�j$h0�@������3ۉ]�3��}؋u��Pt��jY+�t"+�t+�t^+�uH�k������}�u����d���E���@����@��^�w\V�S��YY���E���V�ƃ�t6��t#Ht� ��������������E���@����@���E���@����@���E���@����@�3�C�]�P�0�@��E܃��������uj������tj��x���Y�e����t -��t��u�G`�EЃg`���uA�Gd�E��Gd������u/� �@��щUԡ�@��;�}&��k��G\�d�B�Uԋ �@���j��,�@��M��E�����������u �wdV�U�Y��u�]��}�tj��<���Y�V�U�Y��t -��t��u�EЉG`��u�ẺGd3������U��M���@�V�u9qt��k�E��;�r�k�U;�s 9qu���3�^]���������������̋L$�����t$�����tN�����u�������$������$���������~Ѓ��3����t�A���t2��t$�����t�����t�͍A��L$+�ÍA��L$+�ÍA��L$+�ÍA��L$+��U��VW�}��t�M��t�U��u3�f������j^�0�g�����_^]Ë�f�>�t��Iu��t�+��f��Rf��tIu�3���u�f�����j"�U��V�u��t�U��t�M��u3�f��u���j^�0�������^]�W��+��f��If��tJu�3�_��u�f��@���j"��U��Ef���f��u�+E��H]�U��U�MV��u ��u 9Mu&3��3��t�E��t��u3�f���u��u3�f������j^�0�h�����^]�SW�ً����u+��f�3�vf��t%Ou�� +��f��[f��tOtJu��u3�f���_[�{������u�E3�jPf�TA�X�3�f��i���j"�U���$���@�3ʼnE��ES�,�@�VW�E�E3�W�E��Ӌ��u��J����E�9=�@������h���Wh��@��Ā@�����u$��@���W�h��h��@��̀@������S��h��@�V�<�@����?��P��h��@�V��@��<�@�P��hȒ@�V��@��<�@�P��hܒ@�V��@��<�@�P�ӣ�@���th��@�V�<�@�P�ӣ�@��u����@���t�E��tP�Ȁ@�9}�tjX����9}�t�5�@��0�@�j���@��0�@�;�tO95�@�tGP���5�@��E��ӋM�E��t/��t+�х�t�M�Qj�M�QjP�U��t�E�u�u���� ��0��@�;�t$P�Ӆ�t�Ћ���t��@�;�tP�Ӆ�tW�Ћ��u�5�@��Ӆ�tV�u��u�W���3��M�_^3�[������; ��@�u����������SVW�T$�D$�L$URPQQhB@�d�5�������@�3ĉD$d�%�����D$0�X�L$,3�p���t;�T$4���t;�v.�4v�\���H�{�u�h���C�"�������C�4���d�������_^[ËL$�A�������t3�D$�H3��<���U�h�p�p�p�>�����]�D$�T$������U�L$�)�q�q�q(������]��UVWS��3�3�3�3�3���[_^]Ë���j���3�3�3�3�3���U��SVWj�Rh�B@�Q�.��_^[]�U�l$RQ�t$������]���`�@�Vj^��u�����;�}�ƣ`�@�jP�v���YY�\�@���ujV�5`�@��]���YY�\�@���ujX^�3ҹ��@���� �R�� �@�}�\�@���3�^�����=��@��t�����5\�@�������%\�@��Y�U��V�u���@�;�r"����@�w��+�����P�*����N����Y� -�F P���@�^]�U��E��}��P������EY�H����]ËE�� P���@�]�U��E���@�;�r=��@�w�`���+�����P����Y]Ã� P���@�]�U��M�E��}�`����AP�����Y]Ã� P���@�]�U���V�u�M��d����u�E�M�L0u3�9Ut�E��������p#E�� �t3�B�}��^t�M��ap�����U��jj��uj�������]�U��V�u��t�U��t �M��u��!���j^�0������^]�W��+���A��tJu�_��u������j"��3����/�����tj�M���Y� �@�t!j�+����tjY�)jh��@j�������j�����U��V�u���woSW�P�@���u�J���j����h�����y����P�@�YY��t���3�AQj�P�Ԁ@�����u&j[9H�@�t V�D���Y��u���=�����6������_[�V�#���Y�"��������3�^]�U��}�u�u�]���Y]�V�u��u �u�;���Y3��MS�0��uFV�uj��5P�@��@���u^9H�@�t@V����Y��t���v�V����Y���������3�[^]���������@�P����Y�����������@�P����Y�����U��V�u��tj�3�X��;Es�P��������3��Q�u��uF3Ƀ��wVj�5P�@��Ԁ@��ȅ�u*�=H�@��tV� ���Y��uЋE��t�봋E��t�������^]�U��V�u��������F;<�@�tP����Y�F;@�@�tP����Y�F;D�@�tP�����Y�F;H�@�tP�����Y�F;L�@�tP�����Y�F ;P�@�tP�����Y�F$;T�@�tP����Y�F8;h�@�tP����Y�F<;l�@�tP����Y�F@;p�@�tP�x���Y�FD;t�@�tP�f���Y�FH;x�@�tP�T���Y�FL;|�@�tP�B���Y^]�U��V�u��tY�;0�@�tP�#���Y�F;4�@�tP����Y�F;8�@�tP�����Y�F0;`�@�tP�����Y�F4;d�@�tP�����Y^]�U��V�u���n���v������v�����v�����v�����v�����v�����6�����v �����v$�����v(�y����v,�q����v0�i����v4�a����v�Y����v8�Q����v<�I�����@�v@�>����vD�6����vH�.����vL�&����vP�����vT�����vX�����v\�����v`������vd������vh������vl������vp������vt������vx������v|�������@�������������������������������������������������������������������v����������k����������`����������U����������J����������?����������4����������)�������������������������@�����������������������������������������������������������������������������������������������������������������������������������������������v���������k��������`�����@�����R��������G��������<��������1��������&������������� ��������$��������(���������,���������0���������4���������8���������<���������@��������D��������@��H��������L��������P��������T���~�����X���s�����\���h�����`���]�����^]�U��QQ���@�3ʼnE�SV�uW��~!�E��I�8�t@��u������+�H;ƍp|���M$3���u �E���@�E$��3�9E(j���j�V�u�����PQ�@�@��ȉM���u3��X��~Kj�3�X���r?�M��������w������܅�t������Q������Y��t ��������M��3ۅ�t�QSV�uj�u$�@�@���������u�j�j�VS�u�u��������������������Mt,�M �������;������Q�uVS�u�u�����������~Bj�3�X����r6�}���;�w�������tf������P�������Y��tQ��������3���t@WV�u�S�u�u�+������t!3�PP9E uPP��u �uWVP�u$�x�@���V�`���YS�Y���Y�Ǎe�_^[�M�3�������U����u�M�������u(�E��u$�u �u�u�u�u�uP�������$�}��t�M��ap���U��E��t���8����uP����Y]�U��Q���@�3ʼnE��MSVW3���u �E���@�E��3�9E WW�u���u�����PQ�@�@���u3�����~A�����w9�]���=���w������t�������P������Y��t�������������t��PWV������SV�u�uj�u�@�@���t�uPV�u�܀@���V����Y�Ǎe�_^[�M�3��W�����U����u�M������u �E��u�u�u�u�uP��������}��t�M��ap�������������̋T$�L$��t�D$�%T�@�s �L$W�|$��]�T$������|�%��@��� ��W����r1�ك�t+ш����u������������ʃ���t��t -�����u��D$_ËD$Ã%X�@���U��}�u�����������o������]��uj��5P�@����@�]�j�����Y�U��SVW3�������;�+���jU�4�8�@��u��������ty�^���~;�~Ѓ�����<�@�_^[]�U��}�t�u����Y��x=����s ���@�]�3�]�U����@�3��@�t3�QQQ�u�u�u�u�u�u��]��u�u�u�u�u�u����YP��@�]�U��V�u3���t^�MSW�}jA[jZZ+��U�jZZ�f;�r f;�w�� ������f;�rf;Ew�� ����Nt -f��tf;�t�����_+�[^]�������������WV�t$�L$�|$�����;�v;��h���%T�@�s����������������3Ʃ���u�%��@������%T�@��������������������������s ����v����s�~���vf�������tc�������foN�v�fo^��0foF fon0�v0��0fo�f:�ffo�f:�fGfo�f:�fo �0}��v����foN��v��I�fo^��0foF fon0�v0��0fo�f:�ffo�f:�fGfo�f:�fo �0}��v�VfoN��v���fo^��0foF fon0�v0��0fo�f:�ffo�f:�fGfo�f:�fo �0}��v��|�o���vf�����s ����v����s�~���vf�����T@��������u������r*��$��T@���Ǻ�����r����$��S@��$��T@���$�<T@���S@��S@�T@�#ъ��F�G�F���G������r���$��T@��I�#ъ��F���G������r���$��T@��#ъ���������r���$��T@��I��T@��T@��T@�|T@�tT@�lT@�dT@�\T@��D��D��D��D��D��D��D���D���D��D��D���D���D���D�����������$��T@����T@��T@��T@��T@��D$^_Ð���D$^_Ð���F�G�D$^_ÍI����F�G�F�G�D$^_Ð�t1��|9������u$������r ����$�DV@������$��U@��I��Ǻ�����r��+��$�HU@��$�DV@��XU@�|U@��U@��F#шG��������r�����$�DV@��I��F#шG�F���G������r�����$�DV@���F#шG�F�G�F���G�������V�������$�DV@��I��U@��V@�V@�V@�V@� V@�(V@�;V@��D��D��D��D��D��D��D��D��D��D��D��D��D��D����������$�DV@���TV@�\V@�lV@��V@��D$^_Ð�F�G�D$^_ÍI��F�G�F�G�D$^_Ð�F�G�F�G�F�G�D$^_Í�$����W�ƃ���������у���te��$�����fofoNfoV fo^0ffOfW f_0fof@fonPfov`fo~pfg@foPfw`fp������������Ju���tO������t������fof�v�Ju��t*����t ���v�Iu�ȃ�t��FGIu�������X^_Í�$�������̺���+�+�Q�ȃ�t ��FGIu���t ���v�Hu�Y�����U��E��u�,���������������]Ë@]�U��M���u ������ ����8��x$; ��@�s��������X�@����D��@]�������� ����X���3�]�U��V�u��u V����Y�/V�,���Y��t�����F�@��tV�U���P����Y��Y��3�^]�U��SV�u3ۋF$<uB�F��t9W�>+~��~.W�vV����YP�����;�u�F��y����F��N ���_�N�f��^��[]�j����Y�jhP�@��e���3��}�!}�j�����Y!}�3��]�u�;5`�@�������\�@�����t]�@�tWPV����YY�E�����\�@����@�t0��uP�����Y���tG�}����u�@tP�����Y���u E܃e������F녋]�}�u�\�@��4�V����YY��E�������������t�E������Ë]�}�j�a���Y�U�����@�j�D�@������u������=D�@��YYuj�����Yh ������Y]�U���$��j�����tjY�)�(�@�� $�@�� �@���@��5�@��=�@�f�@�@�f� 4�@�f��@�f��@�f�%�@�f�-�@���8�@��E��,�@��E�0�@��E�<�@��������x�@����0�@��4�@��(�@� ���,�@�����8�@����jXk��ǀ<�@����jXk��� ��@��L�jX���� ��@��L�h��@���������������U��SVWUj�j�h[@��u���]_^[��]ËL$�A�������t2�D$�H�3��,���U�h�P(R�P$R������]�D$�T$������SVW�D$UPj�h [@�d�5�������@�3�P�D$d������D$(�X�p���t:�|$,�t;t$,v-�4v���L$�H�|��uh���D��I����D��_���뷋L$d� ������_^[�3�d� �����y [@�u�Q�R9Qu�����SQ���@��SQ���@��L$�K�C�kUQPXY]Y[�����jhx�@�� ���3��}�j�o���Y!}�j^�u�;5`�@�}S�\�@�����tD�@�tP�B ��Y���tG�}��|)�\�@����� P�X�@��\�@��4�����Y�\�@��$��F��E����������������Ë}�j�P���Y�jh��@��p�����@�95�@�t*j�����Y�e��Vh�@��K���YY��@��E����������y����j�����Y�����������Q�L$+ȃ����Y����Q�L$+ȃ����Y������uf���fn�f`�fa�fp��SQ�ك���ux�ڃ���t0ffAfA fA0fA@fAPfA`fAp������KuЅ�t7����t��I�f�IKu���t����t -f~�IJu���t�AKu�X[��ۃ�+�R�Ӄ�t�AJu���t -f~�IKu�Z�^���U��%P�@����S3�C ��@�j -�r�������3ɋÉP�@��V�5��@�W�}�����_�O�W�E�����5��@�t���P�@�����5��@��E����t���P�@�����5��@�j3�X��u���^�N�V�E�����5T�@�t ���5T�@�3�3���}���_�O�W�}�Genuu_�}�ineIuV�}�nteluM3�@3����_�O�W�E�%�?�=��t#=`�t=p�t=P�t=`�t=p�u ���5T�@�_^3�[��jh��@�������}���u�y����� ��������������;=��@�����������E��߃�����X�@��D��ttW� -��Y3��u��E���X�@��Dt(W���YP��@���u��@����u��t������0������� �������u��E������ -������!�}�u�W���Y�������� ����F�������S����jhؾ@������u���u�_���� ������� ��������������;5��@������������������X�@��D8��tcV�� ��Y�e����X�@��D8t�u�uV�_�������������� ��������� �����}��E������ -������)�u�}�V�� -��Y������ �������� ����d�������q����U������ �����@�3ʼnE��E�M3�W����@�����D�����<�����,���9Uu3�������u�G���!8�t�������������������SV������������0�����X�@�������\$�����t��u+�E�Шu�����!8��������������L����@����D t jRRP�S -������@��������Y�������0�����X�@��D�����軲���@l3�9����������P��0�������X�@��4��@������@�������9�@���t��������@���D���!�$����ʉ������4���9}�~��3���8���Dž��� -���������� 3��� -����@�����0�����X�@��|8�t�D4�E�j�E�M��d8�P�Z��P�> ��Y��tD��D�����4���+�E������jR��<���P� -�������������4���@��8����&j��4�����<���P�V -�������������4���3�QQ@��8���j��4����E�Pj��<���PQ������x�@���������k��j���$���QP�E�P��0�����X�@��4�D�@���������8���������,���9�$����!����@���������j���$���Pj�E�P��0����E� ��X�@��4�D�@���������$����������,���G������t��u3�3�f;������<�����8���������4�����8�����@�����t��uU��<����. ��Yf;�<����������@����t$j XP��<���� ��Yf;�<�������G��,�����8�����4���;E������#��0������X�@�G�D4��X�@��D8�����@��������@��������0�����X�@��D��U����D���3���8������������<���9u����3�+�<�����H�����@���;EsD� -B@��#����� -��@�����<���u��,���� CA��#������<���CA��@��������r��������H���+�j���(���PS��H���P��0�����X�@��4�D�@��������(�����D���9�(���������<���+�;E��<����5�������ʀ��������@���9u����Dž��� -�����������,�����+������H���;Es>�1������@���f;����uj Yf���@���������f�3���������r��������H���+�j���(���PS��H���P��0�����,�����X�@��4�D�@���8�����<����������(�����D�����<���9�(���������@�����+�;E� �������]��$���������Dž��� -�����������$���+ʋ������H���;�s;�>������$���f;����uj ^f�0��$�������f�8���������r�3�VVhU ��������Q��H���+��+���P��PVh�����x�@���8�����<�����4����������3ɉ�@���j�+���(���RP������������P��0�����X�@��4�D�@���t��@����(�����4�����@���;�����@���@�������4�����8���;�Q��$�����D�����+���<���;�������7j���(���Q�u��D����4�D�@���t -��(���3����@�����D�����uc��t$j[;�u� -����� ����������?V�����Y�6��0����������X�@��D@t �:u3�� ��������������� �����+�,�����^[�M�3�_������U��V�uW�����u���������������E�F�t9V�����V������V�(���P�|������y�����~�t �v�����f�Y�f���_^]�jh��@�艹������}�3��u������u���������������裹����F@t�f���V�g���Y�e��V�?���Y���}��E����������Nju�}�V����Y���������������Q�L$+����#ȋ�%����;�r -��Y����$�-�������jh�@��ٸ���}����������4�X�@��~�u0j -�#���Y�e���~�uh����FP�T�@��F�E������*�������������X�@����P���@�3�@諸��Ë}j -�-���Y�U��EVW��x`;��@�sX��������X�@������Dt=�<�t7�= �@�u3�+�tHtHuQj��Qj��Qj���@���X�@���3�������� ����H���� ����_^]�U��M���u�.���� ��Z����� ����B��x&; ��@�s��������X�@����Dt�]������� ������� ����������]�U��M����������X�@����P���@�]�U����u�M������E��M�������H%�����}��t�M��ap���U��j��u����YY]�U��QQV�uWV�������Y;�u������ ����Nj��D�u�M�Q�u�uP���@���u��@�P�0���Y�Ӌ�������X�@����d0��E��U�_^��U���SV�u��t�]��t�>�u�E��t3�f�3�^[��W�u�M������E��������u�M��t�f�3�G�����E�P�P�����YY��t@�}��t~';_t|%3�9E��P�u�wtVj �w�@�@��}���u;_tr.�~�t(�t�13�9E��3�GP�u�E�WVj �p�@�@���u�X��������*����}��t�M��ap���_�6���U��j��u�u�u�������]�U��Q���@����u -�������@����u�������j��M�Qj�MQP���@���t�f�E��jh8�@��6����u���u����� �������� ���������xy;5��@�sq������������X�@��D8��tSV����Y�e����X�@��D8tV�U���Y����b����� �������}��E������ -������)�u�}�V�/���Y������� ��+����� ����������辴���U��VW�}W����Y���tP�X�@���u ������u��u�@Dtj�l���j���c���YY;�tW�W���YP���@���u -��@����3�W����Y��������X�@����D9���tV�h���Y����3�_^]�U��V�u�F�t �Ft�v誺���f����3�Y��F�F^]á��@����t���tP���@��3�PPjPjh���@h �@���@����@����������V�D$�u(�L$�D$3���؋D$������d$�ȋ��d$��G�ȋ\$�T$�D$���������u�����d$�ȋD$���r;T$wr;D$v N+D$T$3�+D$T$������ʋӋًȋ�^������������̋D$�L$ȋL$u �D$����S��؋D$�d$؋D$���[���%��@��%Ѐ@�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������d�������������������������� ���8���P���f���v�������������������������������������<���T���f���|��������������������������,���J���^���r���~�������������������������������������$���0���D���`���r������������������������������������������"���2���F���V����������������������������.@��9@��B@�$^@�M@����������\@��o@�EC@������������������������������������������������������������������������������������������������������������������������������������������������������� ���m�s�c�o�r�e�e�.�d�l�l���CorExitProcess��R�6�0�0�8� � -�-� �n�o�t� �e�n�o�u�g�h� �s�p�a�c�e� �f�o�r� �a�r�g�u�m�e�n�t�s� � -�������R�6�0�0�9� � -�-� �n�o�t� �e�n�o�u�g�h� �s�p�a�c�e� �f�o�r� �e�n�v�i�r�o�n�m�e�n�t� � -���R�6�0�1�0� � -�-� �a�b�o�r�t�(�)� �h�a�s� �b�e�e�n� �c�a�l�l�e�d� � -�����R�6�0�1�6� � -�-� �n�o�t� �e�n�o�u�g�h� �s�p�a�c�e� �f�o�r� �t�h�r�e�a�d� �d�a�t�a� � -���R�6�0�1�7� � -�-� �u�n�e�x�p�e�c�t�e�d� �m�u�l�t�i�t�h�r�e�a�d� �l�o�c�k� �e�r�r�o�r� � -���������R�6�0�1�8� � -�-� �u�n�e�x�p�e�c�t�e�d� �h�e�a�p� �e�r�r�o�r� � -���������R�6�0�1�9� � -�-� �u�n�a�b�l�e� �t�o� �o�p�e�n� �c�o�n�s�o�l�e� �d�e�v�i�c�e� � -���������R�6�0�2�4� � -�-� �n�o�t� �e�n�o�u�g�h� �s�p�a�c�e� �f�o�r� �_�o�n�e�x�i�t�/�a�t�e�x�i�t� �t�a�b�l�e� � -���������R�6�0�2�5� � -�-� �p�u�r�e� �v�i�r�t�u�a�l� �f�u�n�c�t�i�o�n� �c�a�l�l� � -�������R�6�0�2�6� � -�-� �n�o�t� �e�n�o�u�g�h� �s�p�a�c�e� �f�o�r� �s�t�d�i�o� �i�n�i�t�i�a�l�i�z�a�t�i�o�n� � -���������R�6�0�2�7� � -�-� �n�o�t� �e�n�o�u�g�h� �s�p�a�c�e� �f�o�r� �l�o�w�i�o� �i�n�i�t�i�a�l�i�z�a�t�i�o�n� � -���������R�6�0�2�8� � -�-� �u�n�a�b�l�e� �t�o� �i�n�i�t�i�a�l�i�z�e� �h�e�a�p� � -�����R�6�0�3�0� � -�-� �C�R�T� �n�o�t� �i�n�i�t�i�a�l�i�z�e�d� � -���������R�6�0�3�1� � -�-� �A�t�t�e�m�p�t� �t�o� �i�n�i�t�i�a�l�i�z�e� �t�h�e� �C�R�T� �m�o�r�e� �t�h�a�n� �o�n�c�e�.� -�T�h�i�s� �i�n�d�i�c�a�t�e�s� �a� �b�u�g� �i�n� �y�o�u�r� �a�p�p�l�i�c�a�t�i�o�n�.� � -�����R�6�0�3�2� � -�-� �n�o�t� �e�n�o�u�g�h� �s�p�a�c�e� �f�o�r� �l�o�c�a�l�e� �i�n�f�o�r�m�a�t�i�o�n� � -�����R�6�0�3�3� � -�-� �A�t�t�e�m�p�t� �t�o� �u�s�e� �M�S�I�L� �c�o�d�e� �f�r�o�m� �t�h�i�s� �a�s�s�e�m�b�l�y� �d�u�r�i�n�g� �n�a�t�i�v�e� �c�o�d�e� �i�n�i�t�i�a�l�i�z�a�t�i�o�n� -�T�h�i�s� �i�n�d�i�c�a�t�e�s� �a� �b�u�g� �i�n� �y�o�u�r� �a�p�p�l�i�c�a�t�i�o�n�.� �I�t� �i�s� �m�o�s�t� �l�i�k�e�l�y� �t�h�e� �r�e�s�u�l�t� �o�f� �c�a�l�l�i�n�g� �a�n� �M�S�I�L�-�c�o�m�p�i�l�e�d� �(�/�c�l�r�)� �f�u�n�c�t�i�o�n� �f�r�o�m� �a� �n�a�t�i�v�e� �c�o�n�s�t�r�u�c�t�o�r� �o�r� �f�r�o�m� �D�l�l�M�a�i�n�.� � -�����R�6�0�3�4� � -�-� �i�n�c�o�n�s�i�s�t�e�n�t� �o�n�e�x�i�t� �b�e�g�i�n�-�e�n�d� �v�a�r�i�a�b�l�e�s� � -�����D�O�M�A�I�N� �e�r�r�o�r� � -�����S�I�N�G� �e�r�r�o�r� � -�����T�L�O�S�S� �e�r�r�o�r� � -��� � -�����r�u�n�t�i�m�e� �e�r�r�o�r� ��������X�@�����@� ���p�@� -���Ȃ@�����@����h�@����ȃ@�����@����h�@����@����(�@������@�����@����T�@������@� ���`�@�!���ȇ@�"�����@�x��� �@�y���@�@�z���\�@�����x�@�������@�R�6�0�0�2� � -�-� �f�l�o�a�t�i�n�g� �p�o�i�n�t� �s�u�p�p�o�r�t� �n�o�t� �l�o�a�d�e�d� � -�����R�u�n�t�i�m�e� �E�r�r�o�r�!� -� -�P�r�o�g�r�a�m�:� ���<�p�r�o�g�r�a�m� �n�a�m�e� �u�n�k�n�o�w�n�>�����.�.�.��� -� -�����M�i�c�r�o�s�o�f�t� �V�i�s�u�a�l� �C�+�+� �R�u�n�t�i�m�e� �L�i�b�r�a�r�y�����k�e�r�n�e�l�3�2�.�d�l�l�����FlsAlloc����FlsFree�FlsGetValue�FlsSetValue�InitializeCriticalSectionEx�CreateSemaphoreExW��SetThreadStackGuarantee�CreateThreadpoolTimer���SetThreadpoolTimer��WaitForThreadpoolTimerCallbacks�CloseThreadpoolTimer����CreateThreadpoolWait����SetThreadpoolWait���CloseThreadpoolWait�FlushProcessWriteBuffers����FreeLibraryWhenCallbackReturns��GetCurrentProcessorNumber���GetLogicalProcessorInformation��CreateSymbolicLinkW�SetDefaultDllDirectories����EnumSystemLocalesEx�CompareStringEx�GetDateFormatEx�GetLocaleInfoEx�GetTimeFormatEx�GetUserDefaultLocaleName����IsValidLocaleName���LCMapStringEx���GetCurrentPackageId�Sun�Mon�Tue�Wed�Thu�Fri�Sat�Sunday��Monday��Tuesday�Wednesday���Thursday����Friday��Saturday����Jan�Feb�Mar�Apr�May�Jun�Jul�Aug�Sep�Oct�Nov�Dec�January�February����March���April���June����July����August��September���October�November����December����AM��PM��MM/dd/yy����dddd, MMMM dd, yyyy�HH:mm:ss����S�u�n���M�o�n���T�u�e���W�e�d���T�h�u���F�r�i���S�a�t���S�u�n�d�a�y�����M�o�n�d�a�y�����T�u�e�s�d�a�y���W�e�d�n�e�s�d�a�y���T�h�u�r�s�d�a�y�����F�r�i�d�a�y�����S�a�t�u�r�d�a�y�����J�a�n���F�e�b���M�a�r���A�p�r���M�a�y���J�u�n���J�u�l���A�u�g���S�e�p���O�c�t���N�o�v���D�e�c���J�a�n�u�a�r�y���F�e�b�r�u�a�r�y�����M�a�r�c�h���A�p�r�i�l���J�u�n�e�����J�u�l�y�����A�u�g�u�s�t�����S�e�p�t�e�m�b�e�r���O�c�t�o�b�e�r���N�o�v�e�m�b�e�r�����D�e�c�e�m�b�e�r�����A�M�����P�M�����M�M�/�d�d�/�y�y�����d�d�d�d�,� �M�M�M�M� �d�d�,� �y�y�y�y���H�H�:�m�m�:�s�s�����e�n�-�U�S���d�@�p�@�|�@���@�j�a�-�J�P���z�h�-�C�N���k�o�-�K�R���z�h�-�T�W���U�S�E�R�3�2�.�D�L�L�����MessageBoxW�GetActiveWindow�GetLastActivePopup��GetUserObjectInformationW���GetProcessWindowStation����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� � � � � � � � � �(�(�(�(�(� � � � � � � � � � � � � � � � � � �H��������������������������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� � � � � � � � � �h�(�(�(�(� � � � � � � � � � � � � � � � � � �H����������������������������������������������������������������� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �H����������������������������������������������������������������������������������������������������������������������������������������������������������������������� - !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� - !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������������X�@����`�@����h�@����p�@������@������@������@������@� �����@� -�����@������@������@� �����@����ȩ@����Щ@����ة@�����@�����@�����@������@������@�����@�����@�����@���� �@����(�@����0�@����8�@����@�@����H�@� ���P�@�!���X�@�"���`�@�#���h�@�$���p�@�%���x�@�&�����@�'�����@�)�����@�*�����@�+�����@�,�����@�-�����@�/�����@�6�����@�7���Ȫ@�8���Ъ@�9���ت@�>����@�?����@�@����@�A�����@�C�����@�D����@�F����@�G����@�I��� �@�J���(�@�K���0�@�N���8�@�O���@�@�P���H�@�V���P�@�W���X�@�Z���`�@�e���h�@����p�@���t�@�����@�����@�����@�����@�����@�����@�����@� ��H�@���ȫ@���ԫ@� ���@����@�����@����@���d�@���|�@����@����@���(�@���4�@���@�@���L�@���X�@���d�@���p�@���|�@�����@�����@� ����@�!����@�"����@�#��Ĭ@�$��Ь@�%��ܬ@�&���@�'����@�)����@�*���@�+���@�,��$�@�-��<�@�/��H�@�2��T�@�4��`�@�5��l�@�6��x�@�7����@�8����@�9����@�:����@�;����@�>����@�?��̭@�@��ح@�A���@�C���@�D���@�E���@�F�� �@�G��,�@�I��8�@�J��D�@�K��P�@�L��\�@�N��h�@�O��t�@�P����@�R����@�V����@�W����@�Z����@�e��Į@�k��Ԯ@�l���@�����@�����@���p�@����@� ���@� -�� �@���,�@���8�@���D�@���P�@���\�@���h�@�����@�,����@�;����@�>����@�C����@�k��ԯ@����@����@�����@� ���@� -���@��� �@���,�@�;��D�@�k��P�@���`�@���l�@���x�@� ����@� -����@�����@�����@�;����@���İ@���а@���ܰ@� ���@� -����@�����@����@�;��$�@���4�@� ��@�@� -��L�@���X�@���d�@�;��|�@�����@� ����@� -����@�����@�;��ȱ@� ��ر@� ���@� - ���@�; ����@�$���@� $���@� -$��$�@�;$��0�@�(��@�@� (��L�@� -(��X�@�,��d�@� ,��p�@� -,��|�@�0����@� 0����@� -0����@�4����@� 4����@� -4��IJ@�8��в@� -8��ܲ@�<���@� -<����@�@����@� -@���@� -D���@� -H��$�@� -L��0�@� -P��<�@�|��H�@�|��X�@�p�@�B�����@�,���`�@�q���X�@�����l�@�����x�@�������@�������@�������@�������@�������@�������@�����̳@�����س@������@������@�������@�C����@������@����� �@�������@�)���,�@�����D�@�k���h�@�!���\�@�c���`�@����h�@�D���t�@�}�����@�����h�@������@�E�����@������@�G�����@�������@������@�H�����@����ȴ@�����Դ@������@�I����@�������@�����h�@�A����@�������@�����@�J�����@���� �@�����,�@�����8�@�����D�@�����P�@�����\�@�����h�@�����t�@�������@�������@�������@�K�����@�������@�������@� �����@�����ȵ@�����Ե@������@������@�������@������@������@������@�����(�@�����4�@�����@�@�����L�@�����X�@�����d�@�����p�@�����|�@�������@�������@�����x�@�#�����@�e�����@�*�����@�l�����@�&�����@�h�����@� -���Ķ@�L���Ъ@�.���ж@�s�����@����ܶ@������@�������@�������@�M����@������@�����P�@�>���$�@������@�7���0�@������@����<�@�N���ت@�/���H�@�t��� �@����T�@�����`�@�Z���ȩ@� ���l�@�O�����@�(���x�@�j���X�@������@�a���Щ@������@�P���ة@������@�������@�Q����@������@�R���Ȫ@�-�����@�r����@�1���̷@�x���0�@�:���ط@������@����X�@�?����@�������@�S����@�2�����@�y�����@�%����@�g�����@�$����@�f���$�@�������@�+���0�@�m���<�@�����H�@�=���H�@�����8�@�;���T�@������@�0���`�@�����l�@�w���x�@�u�����@�U����@������@�������@�T�����@�������@������@������@�6�����@�~�����@����̸@�V����@����ظ@�W����@������@�������@������@������@���� �@�X����@����,�@�Y���@�@�<���8�@�����D�@�����P�@�v���\�@�����(�@����h�@�[���p�@�"���t�@�d�����@�������@�������@�������@�������@�����й@�����0�@�����@�\���X�@������@������@������@�����4�@�����8�@����L�@�����X�@�]�����@�3���d�@�z���`�@�@���p�@����� �@�8�����@�����(�@�9�����@�����@�@������@�^�����@�n���H�@������@�_����@�5�����@�|���`�@� ���Ⱥ@�b���P�@����Ժ@�`�����@�4����@�������@�{�����@�'����@�i����@�o���(�@����8�@�����H�@�����T�@�����`�@�����l�@�����x�@�F�����@�p���a�r�����b�g�����c�a�����z�h�-�C�H�S�����c�s�����d�a�����d�e�����e�l�����e�n�����e�s�����f�i�����f�r�����h�e�����h�u�����i�s�����i�t�����j�a�����k�o�����n�l�����n�o�����p�l�����p�t�����r�o�����r�u�����h�r�����s�k�����s�q�����s�v�����t�h�����t�r�����u�r�����i�d�����u�k�����b�e�����s�l�����e�t�����l�v�����l�t�����f�a�����v�i�����h�y�����a�z�����e�u�����m�k�����a�f�����k�a�����f�o�����h�i�����m�s�����k�k�����k�y�����s�w�����u�z�����t�t�����p�a�����g�u�����t�a�����t�e�����k�n�����m�r�����s�a�����m�n�����g�l�����k�o�k���s�y�r���d�i�v�������a�r�-�S�A���b�g�-�B�G���c�a�-�E�S���c�s�-�C�Z���d�a�-�D�K���d�e�-�D�E���e�l�-�G�R���f�i�-�F�I���f�r�-�F�R���h�e�-�I�L���h�u�-�H�U���i�s�-�I�S���i�t�-�I�T���n�l�-�N�L���n�b�-�N�O���p�l�-�P�L���p�t�-�B�R���r�o�-�R�O���r�u�-�R�U���h�r�-�H�R���s�k�-�S�K���s�q�-�A�L���s�v�-�S�E���t�h�-�T�H���t�r�-�T�R���u�r�-�P�K���i�d�-�I�D���u�k�-�U�A���b�e�-�B�Y���s�l�-�S�I���e�t�-�E�E���l�v�-�L�V���l�t�-�L�T���f�a�-�I�R���v�i�-�V�N���h�y�-�A�M���a�z�-�A�Z�-�L�a�t�n�����e�u�-�E�S���m�k�-�M�K���t�n�-�Z�A���x�h�-�Z�A���z�u�-�Z�A���a�f�-�Z�A���k�a�-�G�E���f�o�-�F�O���h�i�-�I�N���m�t�-�M�T���s�e�-�N�O���m�s�-�M�Y���k�k�-�K�Z���k�y�-�K�G���s�w�-�K�E���u�z�-�U�Z�-�L�a�t�n�����t�t�-�R�U���b�n�-�I�N���p�a�-�I�N���g�u�-�I�N���t�a�-�I�N���t�e�-�I�N���k�n�-�I�N���m�l�-�I�N���m�r�-�I�N���s�a�-�I�N���m�n�-�M�N���c�y�-�G�B���g�l�-�E�S���k�o�k�-�I�N�����s�y�r�-�S�Y�����d�i�v�-�M�V�����q�u�z�-�B�O�����n�s�-�Z�A���m�i�-�N�Z���a�r�-�I�Q���d�e�-�C�H���e�n�-�G�B���e�s�-�M�X���f�r�-�B�E���i�t�-�C�H���n�l�-�B�E���n�n�-�N�O���p�t�-�P�T���s�r�-�S�P�-�L�a�t�n�����s�v�-�F�I���a�z�-�A�Z�-�C�y�r�l�����s�e�-�S�E���m�s�-�B�N���u�z�-�U�Z�-�C�y�r�l�����q�u�z�-�E�C�����a�r�-�E�G���z�h�-�H�K���d�e�-�A�T���e�n�-�A�U���e�s�-�E�S���f�r�-�C�A���s�r�-�S�P�-�C�y�r�l�����s�e�-�F�I���q�u�z�-�P�E�����a�r�-�L�Y���z�h�-�S�G���d�e�-�L�U���e�n�-�C�A���e�s�-�G�T���f�r�-�C�H���h�r�-�B�A���s�m�j�-�N�O�����a�r�-�D�Z���z�h�-�M�O���d�e�-�L�I���e�n�-�N�Z���e�s�-�C�R���f�r�-�L�U���b�s�-�B�A�-�L�a�t�n�����s�m�j�-�S�E�����a�r�-�M�A���e�n�-�I�E���e�s�-�P�A���f�r�-�M�C���s�r�-�B�A�-�L�a�t�n�����s�m�a�-�N�O�����a�r�-�T�N���e�n�-�Z�A���e�s�-�D�O���s�r�-�B�A�-�C�y�r�l�����s�m�a�-�S�E�����a�r�-�O�M���e�n�-�J�M���e�s�-�V�E���s�m�s�-�F�I�����a�r�-�Y�E���e�n�-�C�B���e�s�-�C�O���s�m�n�-�F�I�����a�r�-�S�Y���e�n�-�B�Z���e�s�-�P�E���a�r�-�J�O���e�n�-�T�T���e�s�-�A�R���a�r�-�L�B���e�n�-�Z�W���e�s�-�E�C���a�r�-�K�W���e�n�-�P�H���e�s�-�C�L���a�r�-�A�E���e�s�-�U�Y���a�r�-�B�H���e�s�-�P�Y���a�r�-�Q�A���e�s�-�B�O���e�s�-�S�V���e�s�-�H�N���e�s�-�N�I���e�s�-�P�R���z�h�-�C�H�T�����s�r�����a�f�-�z�a���a�r�-�a�e���a�r�-�b�h���a�r�-�d�z���a�r�-�e�g���a�r�-�i�q���a�r�-�j�o���a�r�-�k�w���a�r�-�l�b���a�r�-�l�y���a�r�-�m�a���a�r�-�o�m���a�r�-�q�a���a�r�-�s�a���a�r�-�s�y���a�r�-�t�n���a�r�-�y�e���a�z�-�a�z�-�c�y�r�l�����a�z�-�a�z�-�l�a�t�n�����b�e�-�b�y���b�g�-�b�g���b�n�-�i�n���b�s�-�b�a�-�l�a�t�n�����c�a�-�e�s���c�s�-�c�z���c�y�-�g�b���d�a�-�d�k���d�e�-�a�t���d�e�-�c�h���d�e�-�d�e���d�e�-�l�i���d�e�-�l�u���d�i�v�-�m�v�����e�l�-�g�r���e�n�-�a�u���e�n�-�b�z���e�n�-�c�a���e�n�-�c�b���e�n�-�g�b���e�n�-�i�e���e�n�-�j�m���e�n�-�n�z���e�n�-�p�h���e�n�-�t�t���e�n�-�u�s���e�n�-�z�a���e�n�-�z�w���e�s�-�a�r���e�s�-�b�o���e�s�-�c�l���e�s�-�c�o���e�s�-�c�r���e�s�-�d�o���e�s�-�e�c���e�s�-�e�s���e�s�-�g�t���e�s�-�h�n���e�s�-�m�x���e�s�-�n�i���e�s�-�p�a���e�s�-�p�e���e�s�-�p�r���e�s�-�p�y���e�s�-�s�v���e�s�-�u�y���e�s�-�v�e���e�t�-�e�e���e�u�-�e�s���f�a�-�i�r���f�i�-�f�i���f�o�-�f�o���f�r�-�b�e���f�r�-�c�a���f�r�-�c�h���f�r�-�f�r���f�r�-�l�u���f�r�-�m�c���g�l�-�e�s���g�u�-�i�n���h�e�-�i�l���h�i�-�i�n���h�r�-�b�a���h�r�-�h�r���h�u�-�h�u���h�y�-�a�m���i�d�-�i�d���i�s�-�i�s���i�t�-�c�h���i�t�-�i�t���j�a�-�j�p���k�a�-�g�e���k�k�-�k�z���k�n�-�i�n���k�o�k�-�i�n�����k�o�-�k�r���k�y�-�k�g���l�t�-�l�t���l�v�-�l�v���m�i�-�n�z���m�k�-�m�k���m�l�-�i�n���m�n�-�m�n���m�r�-�i�n���m�s�-�b�n���m�s�-�m�y���m�t�-�m�t���n�b�-�n�o���n�l�-�b�e���n�l�-�n�l���n�n�-�n�o���n�s�-�z�a���p�a�-�i�n���p�l�-�p�l���p�t�-�b�r���p�t�-�p�t���q�u�z�-�b�o�����q�u�z�-�e�c�����q�u�z�-�p�e�����r�o�-�r�o���r�u�-�r�u���s�a�-�i�n���s�e�-�f�i���s�e�-�n�o���s�e�-�s�e���s�k�-�s�k���s�l�-�s�i���s�m�a�-�n�o�����s�m�a�-�s�e�����s�m�j�-�n�o�����s�m�j�-�s�e�����s�m�n�-�f�i�����s�m�s�-�f�i�����s�q�-�a�l���s�r�-�b�a�-�c�y�r�l�����s�r�-�b�a�-�l�a�t�n�����s�r�-�s�p�-�c�y�r�l�����s�r�-�s�p�-�l�a�t�n�����s�v�-�f�i���s�v�-�s�e���s�w�-�k�e���s�y�r�-�s�y�����t�a�-�i�n���t�e�-�i�n���t�h�-�t�h���t�n�-�z�a���t�r�-�t�r���t�t�-�r�u���u�k�-�u�a���u�r�-�p�k���u�z�-�u�z�-�c�y�r�l�����u�z�-�u�z�-�l�a�t�n�����v�i�-�v�n���x�h�-�z�a���z�h�-�c�h�s�����z�h�-�c�h�t�����z�h�-�c�n���z�h�-�h�k���z�h�-�m�o���z�h�-�s�g���z�h�-�t�w���z�u�-�z�a���(�@�x�@� - !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�A������C�O�N�O�U�T�$���H�������������������������������������������������������������@���@�������������#��B�� [�������������������������������������������@��@������������������������������@����������@�������������������������@���������@��������������������������@�������������|���������������~@�������������������������e%@�i%@������������������������������)@�����������������������������C.@�����������������������������v2@������������������������������3@�������������������������)9@�<9@������������������������������9@������������������������������<@������������������������������Y@���������~Y@��������������������������\@�����������������������������]@�����������������������������`@������������������������������`@�����������������������������$j@������������������������������j@������������������������������n@��������������������������������r�������������������������������d�������������������������� ���8���P���f���v�������������������������������������<���T���f���|��������������������������,���J���^���r���~�������������������������������������$���0���D���`���r������������������������������������������"���2���F���V����������������SendMessageTimeoutA�USER32.dll���GetStdHandle��lstrlenA���WriteConsoleA��GetCommandLineA�jGetLastError��SetLastError��qInterlockedIncrement��mInterlockedDecrement��(GetCurrentThreadId��<EncodePointer�DecodePointer�mExitProcess��GetModuleHandleExW���GetProcAddress���MultiByteToWideChar��WriteFile�}GetModuleFileNameW���GetProcessHeap��WGetFileType�fInitializeCriticalSectionAndSpinCount�DeleteCriticalSection��GetStartupInfoW�|GetModuleFileNameA��<QueryPerformanceCounter�$GetCurrentProcessId��GetSystemTimeAsFileTime�@GetEnvironmentStringsW���FreeEnvironmentStringsW��WideCharToMultiByte��UnhandledExceptionFilter��PSetUnhandledExceptionFilter�#GetCurrentProcess�oTerminateProcess���TlsAlloc���TlsGetValue��TlsSetValue��TlsFree��GetModuleHandleW��@EnterCriticalSection���LeaveCriticalSection��QHeapFree��_Sleep��IsValidCodePage��GetACP���GetOEMCP���GetCPInfo��IsDebuggerPresent��IsProcessorFeaturePresent��LoadLibraryExW��OutputDebugStringW���LoadLibraryW���RtlUnwind�MHeapAlloc�THeapReAlloc��GetStringTypeW��VHeapSize���LCMapStringW���FlushFileBuffers���GetConsoleCP��GetConsoleMode��/SetStdHandle�� SetFilePointerEx���WriteConsoleW���CloseHandle���CreateFileW�KERNEL32.dll����������������������������������������������������������������������������������������������������������������������������������Environment�Could not broadcast WM_SETTINGCHANGE������������� -������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������C���������@���@���@��@��@��@��@��@��@�$�@�,�@�8�@�D�@�L�@�X�@�\�@�`�@�d�@�h�@�l�@�p�@�t�@�x�@�|�@���@���@���@���@���@���@�h�@���@���@���@�ď@�Џ@�؏@��@���@��@���@��@��@��������$�@�,�@�4�@�<�@�D�@�L�@�T�@�\�@�l�@�|�@���@���@���@�Đ@�ؐ@���@��@��@���@���@��@��@��@� �@�(�@�0�@�8�@�H�@�\�@�h�@���@�t�@���@���@���@���@���@�ԑ@��@��@���@��@�4�@�H�@��@��������������������������������������@���������������@���������������@���������������@���������������@���������������������������0�@����������@���@��@���@����������������������������������@����`�y�!�������������������������������@~�����������ڣ �������������������������������@������������ڣ �������������������������������A����������Ϣ����[�������������������������@~������Q��Q�^� �_�j�2�������������������������1~������������������������������������������������������������������������������ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������abcdefghijklmnopqrstuvwxyz������ABCDEFGHIJKLMNOPQRSTUVWXYZ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������abcdefghijklmnopqrstuvwxyz������ABCDEFGHIJKLMNOPQRSTUVWXYZ����������������������������������������������������������������������������������������������������������������������������������������������������������������������� ������ ��������������� ������ -������������������ ��������������� ���������������!��� ���5������A��� ���C������P������R��� ���S��� ���W������Y������l��� ���m��� ���p������r��� ������������� -������� -������� �������������� �������)������� ��������������������� �����������������������������������)P@�)P@�)P@�)P@�)P@�)P@�)P@�)P@�)P@�)P@�N�@���D����������@�������@�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������0�@�.���,�@��@��@��@��@��@��@��@��@��@���@� �@� �@� �@� �@� �@� �@� �@�.����@��@����� ��������������@�������������������������������������������������������������������������������������������������00(0P0_0t0�0�0�0�0�0�0�0!1&101j1o1v1|1�1N2�394^4h4�4�4 5585S5k5w5�5�5�5�5>6I6j6�6�6�6�6�6�6�6�6A7I7\7g7l7~7�7�7�7�7�7�7l8�8�8�8�8�8�8�8�899969;9G9L9k9�9�9::R:j:t:�:�:�:�:�:�:�:�:�:�:;;D;W;�;�;�;�;<$<*<b<n<�<�<�==9=\=b=i=�=�=>9>R>�>�>�>�>�>�>"?(?��� ������0�0�01L1X1b1s1~1�1�1�1�1�122'202=2l2t22�2�2�2�2�2313<3Q3n3�3\4d4{4�4�4H5z5�5�5�5�5�5�5�5�5�5�5�5�5�5666 686I6O6U6\6e6j6p6x6}6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�677777#7(7.767;7A7I7N7T7\7a7g7o7t7y7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�788888%8-82888@8E8K8S8X8^8f8k8q8y88�8�8�8�8�8�8�8�8�89949=9I9T9y9�9�9�9�9�9 ::+:1:G:M:_:�:�:�:�:�:�:#;,;:;U;�;�;�<�<K=�=�=�=!>�>�>�>�>�>�>?_?f?m?t?�?�?�?�?�?�?�0������0Y0t0�1�1,292C2Q2Z2d2�2�33&393S3[3f3}3�3�3�3�3�3�3�3�3474q4�4�4T5�5�5�5/67O7Z7`7�7�7 8=8�8�8�8�8�8�8�9�9�9�9:::�:�:�:�:�:�:�:�:�:�:;$;1;9;?;K;P;U;Z;c;�;�;�;�;�<<<< <}<�<�<�<=�?�?�?�?�?�?�?�?���@������ 00 0&0,040:0@0H0N0T0\0e0l0t0}0�0�0�0�0�0�0�01,1E1n1�1�1�2�2�2�2 33%343;3L3Z3e3t3~3�3�3�3�34<45U5t5�5�566#6Z6r6�6�6�67#757G7Y7k7}7�7�7�7�7�7�788,8>8P8�;K<�<�=0>m>�>�>t?�?�?���P����0#0N0w0�0�0�0�0�1�1�1u3�3�3�3�3�3�3�3�3454<4@4D4H4L4P4T4X4�4�4�4�4�45%5@5G5L5P5T5u5�5�5�5�5�5�5�5�5�5�5>6D6H6L6P6�78�89959�9�9�9�9: :&:,:2:8:?:F:M:T:[:b:i:q:y:�:�:�:�:�:�:�:�:�:�:�:;q;};�;<<:<[<b<�<�<�<�<�<�<�<�<=)>7>P>Y>x>�>�>�>�>�>�>R?`?�?�?�?�?�?�`������F0y0�0�031�12P2_2}2�2�3�3�34(4�4565�5�5�6�6�7-868^8�8�89�9n:�:�:�:�:;;.;P;W;�;�;�;<�<�<�<T=�=�=�=�>>@>V>r>�>*?4?P?�?�?�?�?�?�p������0�0����H���1 1$1(1,181<1@1�:�:�:�:�:�:�:�:�:�:�:�:;;;;$;,;4;<;D;L;T;������L��T2X2\2`2;$;,;4;<;D;L;T;\;d;l;t;|;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;<<<<$<,<4<<<D<L<T<\<d<l<t<|<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<====$=,=4=<=D=L=T=\=d=l=t=|=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=>>>>$>,>4><>D>L>T>\>d>l>t>|>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>????$?,?4?<?D?L?T?\?d?l?t?|?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?������`��0000$0,040<0D0L0T0\0d0l0t0|0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�01111$1,141<1D1L1T1\1d1l1t1|1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�12222$2,24282@2H2P2X2`2h2p2x2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�3333 3(30383@3H3P3X3`3h3p3x3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�4444 4(40484@4H4P4X4`4h4p4x4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�5555 5(50585@5H5P5X5`5h5p5x5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�6666 6(60686@6H6P6X6`6h6p6x6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�7777 7(70787@7H7P7X7`7h7p7x7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�8888 8(80888@8H8P8X8`8h8p8x8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�9999 9(90989@9H9P9������H����;�;l<p<�<�<�<�<�==(=H=d=h=�=�=�=�=>>(>H>h>t>�>�>�>�>?0?P?���������1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�22222222 2$2(2,2024282<2@2D2H2L2P2T2X2d2h2l2p2t2x2|2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�333333<3L3\3l3|3�3�3�3�3�3�3h:l:p:t:x:|:�:�:�:�:�:�:(=0=4=8=<=@=D=H=L=P=T=`=d=h=l=p=t=x=|=�=�=�=���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� \ No newline at end of file diff --git a/vendor/drush/drush/misc/windrush_build/assets/setenv.bat b/vendor/drush/drush/misc/windrush_build/assets/setenv.bat deleted file mode 100644 index a72df54d4825d201d8d0a348b6d6da654dd9e5fb..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/misc/windrush_build/assets/setenv.bat +++ /dev/null @@ -1,2 +0,0 @@ -@cscript //NoLogo %~dp0setenv.js -@pause \ No newline at end of file diff --git a/vendor/drush/drush/misc/windrush_build/assets/setenv.js b/vendor/drush/drush/misc/windrush_build/assets/setenv.js deleted file mode 100644 index cc03f077015886a113541ee4bbdc672ca45a64f0..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/misc/windrush_build/assets/setenv.js +++ /dev/null @@ -1,27 +0,0 @@ -var shell = WScript.CreateObject("WScript.Shell"); -var fs = new ActiveXObject("Scripting.FileSystemObject"); - -var PATH_KEY = "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\Path"; -var path = shell.RegRead(PATH_KEY); -var windrush = fs.GetParentFolderName(WScript.ScriptFullName) - -var inPath = path.toLowerCase().indexOf(windrush.toLowerCase()) != -1; - -WScript.Echo("Adding '" + windrush + "' to your PATH variable..."); -if (inPath) { - WScript.Echo("'" + windrush + "' is already in your PATH variable"); -} else { - try { - shell.RegWrite(PATH_KEY, windrush + ";" + path, "REG_EXPAND_SZ"); - var oExec = shell.Exec(windrush + "\\tools\\bin\\notify_env_change.exe"); - while (oExec.Status == 0) - WScript.Sleep(100); - if (oExec.ExitCode != 0) - WScript.Echo("Failed to notify the system about PATH change. Reboot required"); - WScript.Echo("Done."); - } catch (err) { - WScript.Echo("Could not write PATH variable to the registry.\nYou may have insufficient permissions to that. Try running this script as administrator"); - } - -} - diff --git a/vendor/drush/drush/misc/windrush_build/windrush_build b/vendor/drush/drush/misc/windrush_build/windrush_build deleted file mode 100755 index c14290a9fa0a365e50e0c9209a1bb2d7cafc7536..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/misc/windrush_build/windrush_build +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash - -######################################## -# Configurations - -BINTOOL_GIT=https://github.com/acquia/DevDesktopCommon.git -PHP_VER=5.4.41-nts-Win32-VC9-x86 -# NOTE there in also "5.5" string in the download url. Change it if upgrading to 5.6 -MYSQL_VER=5.5.41-win32 -# goes to composer require command -DRUSH_VER=7.0.0 - -TOPDIR=windrush - -######################################## -# Utils - -fail() { - echo "$1">&2 - kill -s TERM $$ -} - -replace_in_file() { - sed "s/$1/$2/" "$3" > aa.tmp - mv aa.tmp "$3" -} - -enable_php_extension() { - for a in $1 ; do - replace_in_file ";extension=php_$a.dll" "extension=php_$a.dll" "$2" - done -} - - -######################################## -# Prepare $TOPDIR dir - -[ -e $TOPDIR ] && ( rm -r -f $TOPDIR || fail "Could not remove $TOPDIR dir" ) -mkdir $TOPDIR - - -######################################## -# MSYS & other binary tools -# - -# msys & stuff from the DD repo -#svn export $BINTOOL_SVN $TOPDIR/tools || fail "Svn failed to export from $BINTOOL_SVN" -[ -e DevDesktopCommon ] && rm -r -f DevDesktopCommon -git clone $BINTOOL_GIT || fail "Git failed to get $BINTOOL_GIT" -mv DevDesktopCommon/bintools-win/msys $TOPDIR/tools -rm -r -f DevDesktopCommon - -# mysql -MYSQL_ZIP=mysql-$MYSQL_VER.zip -MYSQL_URL=http://dev.mysql.com/get/Downloads/MySQL-5.5/$MYSQL_ZIP -if [ ! -e $MYSQL_ZIP ]; then - wget $MYSQL_URL || fail "Could not download MySQL from $MYSQL_URL" -fi - -unzip -o -j $MYSQL_ZIP mysql-$MYSQL_VER/bin/mysql.exe -d $TOPDIR/tools/bin -unzip -o -j $MYSQL_ZIP mysql-$MYSQL_VER/bin/mysqldump.exe -d $TOPDIR/tools/bin - -######################################## -# PHP - -PHP_ZIP=php-$PHP_VER.zip -PHP_URL=http://windows.php.net/downloads/releases/$PHP_ZIP -if [ ! -e $PHP_ZIP ]; then - wget $PHP_URL || fail "Could not download PHP from $PHP_URL" -fi - -unzip $PHP_ZIP -d $TOPDIR/php - -PHP_INI=$TOPDIR/php/php.ini - -cp "$PHP_INI-development" "$PHP_INI" -replace_in_file '; extension_dir = "ext"' 'extension_dir = "ext"' "$PHP_INI" -enable_php_extension "bz2 curl fileinfo gd2 gettext intl mbstring mysql mysqli openssl pdo_mysql soap sockets tidy xmrpc xsl" "$PHP_INI" - -######################################## -# Drush, composer and setenv stuff - -cd $TOPDIR -php -r "readfile('https://getcomposer.org/installer');" | php -./composer.phar require drush/drush:$DRUSH_VER || fail "Composer failed" -cd .. - -cp assets/drush.bat $TOPDIR -cp assets/composer.bat $TOPDIR -cp assets/setenv.bat $TOPDIR -cp assets/setenv.js $TOPDIR -cp assets/notify_env_change.exe $TOPDIR/tools/bin - - -######################################## -# Zip everything up - -[ -e $TOPDIR.zip ] && rm $TOPDIR.zip -zip -r $TOPDIR.zip $TOPDIR -cd .. - - -echo "Done." diff --git a/vendor/drush/drush/mkdocs.yml b/vendor/drush/drush/mkdocs.yml index 470a41ae8e207184867188fdb4c45abf04e0d75d..c91fb1ae1611caa888d7b01b38d606834a395fe7 100644 --- a/vendor/drush/drush/mkdocs.yml +++ b/vendor/drush/drush/mkdocs.yml @@ -1,28 +1,32 @@ site_name: Drush docs theme: readthedocs +site_url: http://docs.drush.org repo_url: https://github.com/drush-ops/drush -include_search: true +repo_name: GitHub +edit_uri: blob/master/docs/ +#include_search: true pages: - Home: index.md - General: - Install: install.md - - Install (alternatives): install-alternative.md - Usage: usage.md - Example files: examples.md - Cron: cron.md - - Make: make.md - - Output formats: output-formats.md - - Shell aliases: shellaliases.md - - Shell scripts: shellscripts.md - - Strict options: strict-options.md - - Bastion: bastion.md - - Exporting Drupal configuration: config-exporting.md -- Writing commands: + - Drush configuration: using-drush-configuration.md + - Drupal configuration: config-exporting.md + - Output Formats, Fields & Filters: output-formats-filters.md + - REPL (a custom shell for Drupal): repl.md +- Writing commands/generators: - Command Authoring: commands.md + - Hooks: hooks.md + - Dependency injection: dependency-injection.md + - Input / Output: io.md + - Generator Authoring: generators.md - Bootstrap: bootstrap.md - - Context system: context.md -theme: readthedocs -site_author: "" -repo_url: https://github.com/drush-ops/drush -include_search: true + - Site Alias Manager: site-alias-manager.md #use_directory_urls: false + +markdown_extensions: + - toc: + permalink: + - admonition: diff --git a/vendor/drush/drush/phpcs.xml b/vendor/drush/drush/phpcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..0a0f568ff3ba71c4f4fe353535f3ea2efa401a68 --- /dev/null +++ b/vendor/drush/drush/phpcs.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ruleset name="drush"> + <description>Default PHP CodeSniffer configuration for Drush project.</description> + <file>src</file> + <file>examples</file> + <file>tests</file> + <exclude-pattern>src/internal-forks</exclude-pattern> + <rule ref="PSR2"/> + + <arg name="warning-severity" value="0"/> +</ruleset> diff --git a/vendor/drush/drush/sami-config.php b/vendor/drush/drush/sami-config.php new file mode 100644 index 0000000000000000000000000000000000000000..5173f057adac70bfea826787aa354ccaaef82863 --- /dev/null +++ b/vendor/drush/drush/sami-config.php @@ -0,0 +1,35 @@ +<?php + +/** + * A Sami config file. See https://github.com/FriendsOfPHP/Sami. + */ + +use Sami\Sami; +use Sami\RemoteRepository\GitHubRemoteRepository; +use Sami\Version\GitVersionCollection; +use Symfony\Component\Finder\Finder; + +$iterator = Finder::create() + ->files() + ->name('*.php') + //->exclude('Resources') + //->exclude('Tests') + ->in($dir = __DIR__.'/src') +; + +// generate documentation for all v2.0.* tags, the 2.0 branch, and the master one +$versions = GitVersionCollection::create($dir) + // ->addFromTags('8.*') + // ->add('8.x', '8.x branch') + ->add('master', 'Master branch') +; + +return new Sami($iterator, array( + // 'theme' => 'symfony', + 'versions' => $versions, + 'title' => 'Drush API', + 'build_dir' => __DIR__.'/api/%version%', + 'cache_dir' => __DIR__.'/.sami-cache/%version%', + 'remote_repository' => new GitHubRemoteRepository('drush-ops/drush', dirname($dir)), + 'default_opened_level' => 2, +)); \ No newline at end of file diff --git a/vendor/drush/drush/shippable.yml b/vendor/drush/drush/shippable.yml deleted file mode 100644 index 2670e5a25a727bd28c092f6f6406fba3773272a2..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/shippable.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: php - -php: - - "7.1" - -build: - ci: - # Set up php configuration - - echo 'mbstring.http_input = pass' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo 'mbstring.http_output = pass' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo 'memory_limit = -1' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo 'sendmail_path = /bin/true' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini - # Disable xdebug for faster Composer operations - # - rm $HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - # Install / update our tools - # - composer self-update - # - composer install --prefer-dist --no-interaction - # Run lint check - # - composer lint - # No tests here - - echo 'No shippable tests on this branch' - diff --git a/vendor/drush/drush/src/.editorconfig b/vendor/drush/drush/src/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..64b60abd04a6641ba8c81e528568bffda485ab00 --- /dev/null +++ b/vendor/drush/drush/src/.editorconfig @@ -0,0 +1,13 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# PHP PSR-2 Coding Standards +# http://www.php-fig.org/psr/psr-2/ + +[*.php] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 diff --git a/vendor/drush/drush/src/Application.php b/vendor/drush/drush/src/Application.php new file mode 100644 index 0000000000000000000000000000000000000000..a13b90dce827de913daf369ff445d2270613fb57 --- /dev/null +++ b/vendor/drush/drush/src/Application.php @@ -0,0 +1,382 @@ +<?php +namespace Drush; + +use Consolidation\AnnotatedCommand\AnnotatedCommand; +use Consolidation\AnnotatedCommand\CommandFileDiscovery; +use Drush\Boot\BootstrapManager; +use Drush\Runtime\TildeExpansionHook; +use Consolidation\SiteAlias\SiteAliasManager; +use Drush\Log\LogLevel; +use Drush\Command\RemoteCommandProxy; +use Drush\Runtime\RedispatchHook; +use Drush\Config\ConfigAwareTrait; +use Robo\Contract\ConfigAwareInterface; +use Symfony\Component\Console\Application as SymfonyApplication; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Exception\CommandNotFoundException; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; + +/** + * Our application object + * + * Note: Implementing *AwareInterface here does NOT automatically cause + * that corresponding service to be injected into the Application. This + * is because the application object is created prior to the DI container. + * See DependencyInjection::injectApplicationServices() to add more services. + */ +class Application extends SymfonyApplication implements LoggerAwareInterface, ConfigAwareInterface +{ + use LoggerAwareTrait; + use ConfigAwareTrait; + + /** @var BootstrapManager */ + protected $bootstrapManager; + + /** @var SiteAliasManager */ + protected $aliasManager; + + /** @var RedispatchHook */ + protected $redispatchHook; + + /** @var TildeExpansionHook */ + protected $tildeExpansionHook; + + /** + * Add global options to the Application and their default values to Config. + */ + public function configureGlobalOptions() + { + $this->getDefinition() + ->addOption( + new InputOption('--debug', 'd', InputOption::VALUE_NONE, 'Equivalent to -vv') + ); + + $this->getDefinition() + ->addOption( + new InputOption('--yes', 'y', InputOption::VALUE_NONE, 'Equivalent to --no-interaction.') + ); + + // Note that -n belongs to Symfony Console's --no-interaction. + $this->getDefinition() + ->addOption( + new InputOption('--no', null, InputOption::VALUE_NONE, 'Cancels at any confirmation prompt.') + ); + + $this->getDefinition() + ->addOption( + new InputOption('--remote-host', null, InputOption::VALUE_REQUIRED, 'Run on a remote server.') + ); + + $this->getDefinition() + ->addOption( + new InputOption('--remote-user', null, InputOption::VALUE_REQUIRED, 'The user to use in remote execution.') + ); + + $this->getDefinition() + ->addOption( + new InputOption('--root', '-r', InputOption::VALUE_REQUIRED, 'The Drupal root for this site.') + ); + + + $this->getDefinition() + ->addOption( + new InputOption('--uri', '-l', InputOption::VALUE_REQUIRED, 'Which multisite from the selected root to use.') + ); + + $this->getDefinition() + ->addOption( + new InputOption('--simulate', null, InputOption::VALUE_NONE, 'Run in simulated mode (show what would have happened).') + ); + + // TODO: Implement handling for 'pipe' + $this->getDefinition() + ->addOption( + new InputOption('--pipe', null, InputOption::VALUE_NONE, 'Select the canonical script-friendly output format.') + ); + + $this->getDefinition() + ->addOption( + new InputOption('--define', '-D', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Define a configuration item value.', []) + ); + } + + public function bootstrapManager() + { + return $this->bootstrapManager; + } + + public function setBootstrapManager(BootstrapManager $bootstrapManager) + { + $this->bootstrapManager = $bootstrapManager; + } + + public function aliasManager() + { + return $this->aliasManager; + } + + public function setAliasManager($aliasManager) + { + $this->aliasManager = $aliasManager; + } + + public function setRedispatchHook(RedispatchHook $redispatchHook) + { + $this->redispatchHook = $redispatchHook; + } + + public function setTildeExpansionHook(TildeExpansionHook $tildeExpansionHook) + { + $this->tildeExpansionHook = $tildeExpansionHook; + } + + /** + * Return the framework uri selected by the user. + */ + public function getUri() + { + if (!$this->bootstrapManager) { + return 'default'; + } + return $this->bootstrapManager->getUri(); + } + + /** + * If the user did not explicitly select a site URI, + * then pick an appropriate site from the cwd. + */ + public function refineUriSelection($cwd) + { + if (!$this->bootstrapManager || !$this->aliasManager) { + return; + } + $selfSiteAlias = $this->aliasManager->getSelf(); + if (!$selfSiteAlias->hasRoot() && !$this->bootstrapManager()->drupalFinder()->getDrupalRoot()) { + return; + } + $uri = $selfSiteAlias->uri(); + + if (empty($uri)) { + $uri = $this->selectUri($cwd); + $selfSiteAlias->setUri($uri); + $this->aliasManager->setSelf($selfSiteAlias); + } + // Update the uri in the bootstrap manager + $this->bootstrapManager->setUri($uri); + } + + /** + * Select a URI to use for the site, based on directory or config. + */ + public function selectUri($cwd) + { + $uri = $this->config->get('options.uri'); + if ($uri) { + return $uri; + } + $uri = $this->bootstrapManager()->selectUri($cwd); + return $uri; + } + + /** + * @inheritdoc + */ + public function find($name) + { + if (empty($name)) { + return; + } + $command = $this->bootstrapAndFind($name); + // Avoid exception when help is being built by https://github.com/bamarni/symfony-console-autocomplete. + // @todo Find a cleaner solution. + if (Drush::config()->get('runtime.argv')[1] !== 'help') { + $this->checkObsolete($command); + } + return $command; + } + + /** + * Look up a command. Bootstrap further if necessary. + */ + protected function bootstrapAndFind($name) + { + try { + return parent::find($name); + } catch (CommandNotFoundException $e) { + // Is the unknown command destined for a remote site? + if ($this->aliasManager) { + $selfAlias = $this->aliasManager->getSelf(); + if (!$selfAlias->isLocal()) { + $command = new RemoteCommandProxy($name, $this->redispatchHook); + $command->setApplication($this); + return $command; + } + } + // If we have no bootstrap manager, then just re-throw + // the exception. + if (!$this->bootstrapManager) { + throw $e; + } + + $this->logger->log(LogLevel::DEBUG, 'Bootstrap further to find {command}', ['command' => $name]); + $this->bootstrapManager->bootstrapMax(); + $this->logger->log(LogLevel::DEBUG, 'Done with bootstrap max in Application::find(): trying to find {command} again.', ['command' => $name]); + + if (!$this->bootstrapManager()->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_ROOT)) { + // Unable to progress in the bootstrap. Give friendly error message. + throw new CommandNotFoundException(dt('Command !command was not found. Pass --root or a @siteAlias in order to run Drupal-specific commands.', ['!command' => $name])); + } + + // Try to find it again, now that we bootstrapped as far as possible. + try { + return parent::find($name); + } catch (CommandNotFoundException $e) { + if (!$this->bootstrapManager()->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_DATABASE)) { + // Unable to bootstrap to DB. Give targetted error message. + throw new CommandNotFoundException(dt('Command !command was not found. Drush was unable to query the database. As a result, many commands are unavailable. Re-run your command with --debug to see relevant log messages.', ['!command' => $name])); + } + if (!$this->bootstrapManager()->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + // Unable to fully bootstrap. Give targetted error message. + throw new CommandNotFoundException(dt('Command !command was not found. Drush successfully connected to the database but was unable to fully bootstrap your site. As a result, many commands are unavailable. Re-run your command with --debug to see relevant log messages.', ['!command' => $name])); + } else { + // We fully bootstrapped but still could not find command. Rethrow. + throw $e; + } + } + } + } + + /** + * If a command is annotated @obsolete, then we will throw an exception + * immediately; the command will not run, and no hooks will be called. + */ + protected function checkObsolete($command) + { + if (!$command instanceof AnnotatedCommand) { + return; + } + + $annotationData = $command->getAnnotationData(); + if (!$annotationData->has('obsolete')) { + return; + } + + $obsoleteMessage = $command->getDescription(); + throw new \Exception($obsoleteMessage); + } + + /** + * @inheritdoc + * + * Note: This method is called twice, as we wish to configure the IO + * objects earlier than Symfony does. We could define a boolean class + * field to record when this method is called, and do nothing on the + * second call. At the moment, the work done here is trivial, so we let + * it happen twice. + */ + protected function configureIO(InputInterface $input, OutputInterface $output) + { + // Do default Symfony confguration. + parent::configureIO($input, $output); + + // Process legacy Drush global options. + // Note that `getParameterOption` returns the VALUE of the option if + // it is found, or NULL if it finds an option with no value. + if ($input->getParameterOption(['--yes', '-y', '--no', '-n'], false, true) !== false) { + $input->setInteractive(false); + } + // Symfony will set these later, but we want it set upfront + if ($input->getParameterOption(['--verbose', '-v'], false, true) !== false) { + $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); + } + // We are not using "very verbose", but set this for completeness + if ($input->getParameterOption(['-vv'], false, true) !== false) { + $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); + } + // Use -vvv of --debug for even more verbose logging. + if ($input->getParameterOption(['--debug', '-d', '-vvv'], false, true) !== false) { + $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + } + } + + /** + * Configure the application object and register all of the commandfiles + * available in the search paths provided via Preflight + */ + public function configureAndRegisterCommands(InputInterface $input, OutputInterface $output, $commandfileSearchpath) + { + // Symfony will call this method for us in run() (it will be + // called again), but we want to call it up-front, here, so that + // our $input and $output objects have been appropriately + // configured in case we wish to use them (e.g. for logging) in + // any of the configuration steps we do here. + $this->configureIO($input, $output); + + $discovery = $this->commandDiscovery(); + $commandClasses = $discovery->discover($commandfileSearchpath, '\Drush'); + $commandClasses[] = \Consolidation\Filter\Hooks\FilterHooks::class; + $commandClasses = array_merge($this->commandsFromConfiguration(), $commandClasses); + + $this->loadCommandClasses($commandClasses); + + // Uncomment the lines below to use Console's built in help and list commands. + // unset($commandClasses[__DIR__ . '/Commands/help/HelpCommands.php']); + // unset($commandClasses[__DIR__ . '/Commands/help/ListCommands.php']); + + // Use the robo runner to register commands with Symfony application. + // This method could / should be refactored in Robo so that we can use + // it without creating a Runner object that we would not otherwise need. + $runner = new \Robo\Runner(); + $runner->registerCommandClasses($this, $commandClasses); + } + + protected function commandsFromConfiguration() + { + $commandList = []; + + foreach ($this->config->get('drush.commands', []) as $key => $value) { + $classname = $key; + $path = $value; + if (is_numeric($key)) { + $classname = $value; + $commandList[] = $classname; + } else { + $commandList[$path] = $classname; + } + } + return $commandList; + } + + /** + * Ensure that any discovered class that is not part of the autoloader + * is, in fact, included. + */ + protected function loadCommandClasses($commandClasses) + { + foreach ($commandClasses as $file => $commandClass) { + if (!class_exists($commandClass)) { + include $file; + } + } + } + + /** + * Create a command file discovery object + */ + protected function commandDiscovery() + { + $discovery = new CommandFileDiscovery(); + $discovery + ->setIncludeFilesAtBase(true) + ->setSearchDepth(3) + ->ignoreNamespacePart('contrib', 'Commands') + ->ignoreNamespacePart('custom', 'Commands') + ->ignoreNamespacePart('src') + ->setSearchLocations(['Commands', 'Hooks', 'Generators']) + ->setSearchPattern('#.*(Command|Hook|Generator)s?.php$#'); + return $discovery; + } +} diff --git a/vendor/drush/drush/src/Backend/BackendPathEvaluator.php b/vendor/drush/drush/src/Backend/BackendPathEvaluator.php new file mode 100644 index 0000000000000000000000000000000000000000..ebafd9a175768fc01d49d0ebf44fcbbe617780ae --- /dev/null +++ b/vendor/drush/drush/src/Backend/BackendPathEvaluator.php @@ -0,0 +1,87 @@ +<?php +namespace Drush\Backend; + +use Consolidation\SiteAlias\SiteAlias; +use Consolidation\SiteAlias\HostPath; +use Drush\Drush; + +class BackendPathEvaluator +{ + /** + * Evaluate will check to see if the provided host path + * contains a path alias. If it does, the alias will + * be resolved, and the result of the resolution will be + * injected into the HostPath, replacing the alias. + * + * @param HostPath $path The host and path to evaluate aliases on. + */ + public function evaluate(HostPath $path) + { + $resolvedPath = $this->resolve($path); + if (!$resolvedPath) { + return; + } + + $path->replacePathAlias($resolvedPath); + } + + /** + * Resolve will check to see if the provided host path + * contains a path alias. If it does, the alias will + * be resolved, and the result of the resolution will be + * returned. + * + * @param HostPath $path The host and path to resolve aliases on. + * @return string + */ + public function resolve(HostPath $path) + { + if (!$path->hasPathAlias()) { + return false; + } + + // If HostPath is `@site:%files`, then the path alias is `files`. + $pathAlias = $path->getPathAlias(); + return $this->lookup($path->getSiteAlias(), $pathAlias); + } + + /** + * Lookup will use the provided alias record to look up and return + * the value of a path alias. + * + * @param SiteAlias $aliasRecord the host to use for lookups + * @param $pathAlias the alias to look up (`files`, not `%files`) + * @return string + */ + public function lookup(SiteAlias $aliasRecord, $pathAlias) + { + if ($aliasRecord->has("paths.$pathAlias")) { + return $aliasRecord->get("paths.$pathAlias"); + } + + return $this->request($aliasRecord, $pathAlias); + } + + /** + * Request the value of the path alias from the site associated with + * the alias record. + * + * @param SiteAlias $aliasRecord the host to use for lookups + * @param string $pathAlias the alias to look up (`files`, not `%files`) + * @return string + */ + public function request(SiteAlias $aliasRecord, $pathAlias) + { + // The drupal:directory command uses a path evaluator, which + // calls this function, so we cannot use dd here, as that + // would be recursive. + $process = Drush::drush($aliasRecord, 'core-status', [], ['project' => $pathAlias, 'fields' => '%paths', 'format' => 'json']); + $process->setSimulated(false); + $process->mustRun(); + $json = $process->getOutputAsJson(); + if (isset($json['%paths']["%{$pathAlias}"])) { + return $json['%paths']["%{$pathAlias}"]; + } + throw new \Exception(dt('Cannot evaluate path alias %{path} for site alias {site}', ['path' => $pathAlias, 'site' => $aliasRecord->name()])); + } +} diff --git a/vendor/drush/drush/src/Backend/BackendResultSetter.php b/vendor/drush/drush/src/Backend/BackendResultSetter.php new file mode 100644 index 0000000000000000000000000000000000000000..51c5554045968e67bfa28d76e770e3ad444fc8a6 --- /dev/null +++ b/vendor/drush/drush/src/Backend/BackendResultSetter.php @@ -0,0 +1,15 @@ +<?php +namespace Drush\Backend; + +use Consolidation\AnnotatedCommand\Hooks\ExtractOutputInterface; + +class BackendResultSetter implements ExtractOutputInterface +{ + public function extractOutput($structured_data) + { + $return = drush_backend_get_result(); + if (empty($return)) { + drush_backend_set_result($structured_data); + } + } +} diff --git a/vendor/drush/drush/src/Boot/AutoloaderAwareInterface.php b/vendor/drush/drush/src/Boot/AutoloaderAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..d01fe879ad21435c2d485975894aa368ab9a88a7 --- /dev/null +++ b/vendor/drush/drush/src/Boot/AutoloaderAwareInterface.php @@ -0,0 +1,11 @@ +<?php +namespace Drush\Boot; + +interface AutoloaderAwareInterface +{ + public function setAutoloader($loader); + + public function autoloader(); + + public function hasAutoloader(); +} diff --git a/vendor/drush/drush/src/Boot/AutoloaderAwareTrait.php b/vendor/drush/drush/src/Boot/AutoloaderAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..a96c0e0b41a0952c594a7c7c4ca7f893776e76cd --- /dev/null +++ b/vendor/drush/drush/src/Boot/AutoloaderAwareTrait.php @@ -0,0 +1,22 @@ +<?php +namespace Drush\Boot; + +trait AutoloaderAwareTrait +{ + protected $loader; + + public function setAutoloader($loader) + { + $this->loader = $loader; + } + + public function autoloader() + { + return $this->loader; + } + + public function hasAutoloader() + { + return isset($this->loader); + } +} diff --git a/vendor/drush/drush/src/Boot/BaseBoot.php b/vendor/drush/drush/src/Boot/BaseBoot.php new file mode 100644 index 0000000000000000000000000000000000000000..b21d16396d30dfcda1663f466b2e66b1481c7a54 --- /dev/null +++ b/vendor/drush/drush/src/Boot/BaseBoot.php @@ -0,0 +1,122 @@ +<?php + +namespace Drush\Boot; + +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; + +abstract class BaseBoot implements Boot, LoggerAwareInterface +{ + use LoggerAwareTrait; + + protected $uri = false; + protected $phase = false; + + public function __construct() + { + register_shutdown_function([$this, 'terminate']); + } + + public function findUri($root, $uri) + { + return 'default'; + } + + public function getUri() + { + return $this->uri; + } + + public function setUri($uri) + { + $this->uri = $uri; + } + + /** + * @return int + */ + public function getPhase() + { + return $this->phase; + } + + /** + * @param int $phase + */ + public function setPhase($phase) + { + $this->phase = $phase; + } + + public function validRoot($path) + { + } + + public function getVersion($root) + { + } + + public function commandDefaults() + { + } + + public function reportCommandError($command) + { + // No longer used. + } + + public function bootstrapPhases() + { + return [ + DRUSH_BOOTSTRAP_DRUSH => 'bootstrapDrush', + ]; + } + + public function bootstrapPhaseMap() + { + return [ + 'none' => DRUSH_BOOTSTRAP_DRUSH, + 'drush' => DRUSH_BOOTSTRAP_DRUSH, + 'max' => DRUSH_BOOTSTRAP_MAX, + 'root' => DRUSH_BOOTSTRAP_DRUPAL_ROOT, + 'site' => DRUSH_BOOTSTRAP_DRUPAL_SITE, + 'configuration' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, + 'database' => DRUSH_BOOTSTRAP_DRUPAL_DATABASE, + 'full' => DRUSH_BOOTSTRAP_DRUPAL_FULL + ]; + } + + public function lookUpPhaseIndex($phase) + { + $phaseMap = $this->bootstrapPhaseMap(); + if (isset($phaseMap[$phase])) { + return $phaseMap[$phase]; + } + + if ((substr($phase, 0, 16) != 'DRUSH_BOOTSTRAP_') || (!defined($phase))) { + return; + } + return constant($phase); + } + + public function bootstrapDrush() + { + } + + protected function hasRegisteredSymfonyCommand($application, $name) + { + try { + $application->get($name); + return true; + } catch (\InvalidArgumentException $e) { + return false; + } + } + + /** + * {@inheritdoc} + */ + public function terminate() + { + } +} diff --git a/vendor/drush/drush/src/Boot/Boot.php b/vendor/drush/drush/src/Boot/Boot.php new file mode 100644 index 0000000000000000000000000000000000000000..0a87effcb5b658006caf8043c30b6a570fe582d7 --- /dev/null +++ b/vendor/drush/drush/src/Boot/Boot.php @@ -0,0 +1,90 @@ +<?php + +namespace Drush\Boot; + +/** + * Defines the interface for a Boot classes. Any CMS that wishes + * to work with Drush should extend BaseBoot. If the CMS has a + * Drupal-Compatibility layer, then it should extend DrupalBoot. + */ +interface Boot +{ + /** + * Select the best URI for the provided cwd. Only called + * if the user did not explicitly specify a URI. + */ + public function findUri($root, $uri); + + /** + * Inject the uri for the specific site to be bootstrapped + * + * @param string $uri Site to bootstrap + */ + public function setUri($uri); + + /** + * This function determines if the specified path points to + * the root directory of a CMS that can be bootstrapped by + * the specific subclass that implements it. + * + * These functions should be written such that one and only + * one class will return TRUE for any given $path. + * + * @param $path to a directory to test + * + * @return TRUE if $path is a valid root directory + */ + public function validRoot($path); + + /** + * Given a site root directory, determine the exact version of the software. + * + * @param string $root + * The full path to the site installation, with no trailing slash. + * @return string|NULL + * The version string for the current version of the software, e.g. 8.1.3 + */ + public function getVersion($root); + + /** + * Returns an array that determines what bootstrap phases + * are necessary to bootstrap this CMS. This array + * should map from a numeric phase to the name of a method + * (string) in the Boot class that handles the bootstrap + * phase. + * + * @see \Drush\Boot\DrupalBoot::bootstrapPhases() + * + * @return array of PHASE index => method name. + */ + public function bootstrapPhases(); + + /** + * Return an array mapping from bootstrap phase shorthand + * strings (e.g. "full") to the corresponding bootstrap + * phase index constant (e.g. DRUSH_BOOTSTRAP_DRUPAL_FULL). + */ + public function bootstrapPhaseMap(); + + /** + * Convert from a phase shorthand or constant to a phase index. + */ + public function lookUpPhaseIndex($phase); + + /** + * Called by Drush if a command is not found, or if the + * command was found, but did not meet requirements. + * + * The implementation in BaseBoot should be sufficient + * for most cases, so this method typically will not need + * to be overridden. + */ + public function reportCommandError($command); + + /** + * This method is called during the shutdown of drush. + * + * @return void + */ + public function terminate(); +} diff --git a/vendor/drush/drush/src/Boot/BootstrapHook.php b/vendor/drush/drush/src/Boot/BootstrapHook.php new file mode 100644 index 0000000000000000000000000000000000000000..2818beecb27ef5f5040c0ab660a884388364259d --- /dev/null +++ b/vendor/drush/drush/src/Boot/BootstrapHook.php @@ -0,0 +1,35 @@ +<?php + +namespace Drush\Boot; + +use Consolidation\AnnotatedCommand\Hooks\InitializeHookInterface; +use Symfony\Component\Console\Input\InputInterface; +use Consolidation\AnnotatedCommand\AnnotationData; + +/** + * The BootstrapHook is installed as an init hook that runs before + * all commands. If there is a `@bootstrap` annotation, then we will + * bootstrap Drupal to the requested phase. + */ +class BootstrapHook implements InitializeHookInterface +{ + protected $bootstrapManager; + + public function __construct(BootstrapManager $bootstrapManager) + { + $this->bootstrapManager = $bootstrapManager; + } + + public function initialize(InputInterface $input, AnnotationData $annotationData) + { + // Get the @bootstrap annotation. If there isn't one, then assume NONE. + $phase_long = $annotationData->get('bootstrap', 'none'); + $phase = current(explode(' ', $phase_long)); + $bootstrap_successful = $this->bootstrapManager->bootstrapToPhase($phase, $annotationData); + + if (!$bootstrap_successful) { + // TODO: better exception class, better exception method + throw new \Exception('Bootstrap failed. Run your command with -vvv for more information.'); + } + } +} diff --git a/vendor/drush/drush/src/Boot/BootstrapManager.php b/vendor/drush/drush/src/Boot/BootstrapManager.php new file mode 100644 index 0000000000000000000000000000000000000000..3202afbe09371be63f9b1bfb557a2906034bdde2 --- /dev/null +++ b/vendor/drush/drush/src/Boot/BootstrapManager.php @@ -0,0 +1,554 @@ +<?php + +namespace Drush\Boot; + +use Consolidation\AnnotatedCommand\AnnotationData; +use DrupalFinder\DrupalFinder; +use Drush\Log\LogLevel; +use League\Container\ContainerAwareInterface; +use League\Container\ContainerAwareTrait; +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; +use Drush\Config\ConfigAwareTrait; +use Robo\Contract\ConfigAwareInterface; + +class BootstrapManager implements LoggerAwareInterface, AutoloaderAwareInterface, ConfigAwareInterface, ContainerAwareInterface +{ + use LoggerAwareTrait; + use AutoloaderAwareTrait; + use ConfigAwareTrait; + use ContainerAwareTrait; + + /** + * @var DrupalFinder + */ + protected $drupalFinder; + + /** + * @var \Drush\Boot\Boot[] + */ + protected $bootstrapCandidates = []; + + /** + * @var \Drush\Boot\Boot + */ + protected $bootstrap; + + /** + * @var int + */ + protected $phase; + + /** + * @return int + */ + public function getPhase() + { + if (!$this->hasBootstrap()) { + return DRUSH_BOOTSTRAP_NONE; + } + return $this->bootstrap()->getPhase(); + } + + /** + * @param int $phase + */ + protected function setPhase($phase) + { + if ($this->bootstrap) { + $this->bootstrap()->setPhase($phase); + } + } + + /** + * Add a bootstrap object to the list of candidates. + * + * @param \Drush\Boot\Boot|Array + * List of boot candidates + */ + public function add($candidateList) + { + foreach (func_get_args() as $candidate) { + $this->bootstrapCandidates[] = $candidate; + } + } + + public function drupalFinder() + { + if (!isset($this->drupalFinder)) { + $this->drupalFinder = new DrupalFinder(); + } + return $this->drupalFinder; + } + + public function setDrupalFinder(DrupalFinder $drupalFinder) + { + $this->drupalFinder = $drupalFinder; + } + + /** + * Return the framework root selected by the user. + */ + public function getRoot() + { + return $this->drupalFinder()->getDrupalRoot(); + } + + /** + * Return the composer root for the selected Drupal site. + */ + public function getComposerRoot() + { + return $this->drupalFinder()->getComposerRoot(); + } + + public function locateRoot($root, $start_path = null) + { + // TODO: Throw if we already bootstrapped a framework? + + if (!isset($root)) { + $root = $this->getConfig()->cwd(); + } + $this->drupalFinder()->locateRoot($root); + } + + /** + * Return the framework uri selected by the user. + */ + public function getUri() + { + if (!$this->hasBootstrap()) { + return false; + } + return $this->bootstrap()->getUri(); + } + + /** + * This method is called by the Application iff the user + * did not explicitly provide a URI. + */ + public function selectUri($cwd) + { + $uri = $this->bootstrap()->findUri($this->getRoot(), $cwd); + $this->setUri($uri); + return $uri; + } + + public function setUri($uri) + { + // TODO: Throw if we already bootstrapped a framework? + // n.b. site-install needs to set the uri. + $this->bootstrap()->setUri($uri); + } + + /** + * Return the bootstrap object in use. This will + * be the latched bootstrap object if we have started + * bootstrapping; otherwise, it will be whichever bootstrap + * object is best for the selected root. + * + * @return \Drush\Boot\Boot + */ + public function bootstrap() + { + if (!$this->bootstrap) { + $this->bootstrap = $this->selectBootstrapClass(); + } + return $this->bootstrap; + } + + /** + * For use in testing + */ + public function injectBootstrap($bootstrap) + { + $this->inflect($bootstrap); + $this->bootstrap = $bootstrap; + + // Our bootstrap object is always a DrupalBoot8. + // TODO: make an API in the Boot interface to call. + $bootstrap->addDrupalModuleDrushCommands($this); + } + + /** + * Look up the best bootstrap class for the given location + * from the set of available candidates. + * + * @return \Drush\Boot\Boot + */ + public function bootstrapObjectForRoot($path) + { + foreach ($this->bootstrapCandidates as $candidate) { + if ($candidate->validRoot($path)) { + // This is not necessary when the autoloader is inflected + // TODO: The autoloader is inflected in the symfony dispatch, but not the traditional Drush dispatcher + if ($candidate instanceof AutoloaderAwareInterface) { + $candidate->setAutoloader($this->autoloader()); + } + return $candidate; + } + } + return new EmptyBoot(); + } + + /** + * Select the bootstrap class to use. If this is called multiple + * times, the bootstrap class returned might change on subsequent + * calls, if the root directory changes. Once the bootstrap object + * starts changing the state of the system, however, it will + * be 'latched', and further calls to Drush::bootstrap() + * will always return the same object. + */ + protected function selectBootstrapClass() + { + // Once we have selected a Drupal root, we will reduce our bootstrap + // candidates down to just the one used to select this site root. + return $this->bootstrapObjectForRoot($this->getRoot()); + } + + /** + * Once bootstrapping has started, we stash the bootstrap + * object being used, and do not allow it to change any + * longer. + */ + public function latch($bootstrap) + { + $this->bootstrap = $bootstrap; + } + + /** + * Returns an array that determines what bootstrap phases + * are necessary to bootstrap the CMS. + * + * @param bool $function_names + * (optional) If TRUE, return an array of method names index by their + * corresponding phase values. Otherwise return an array of phase values. + * + * @return array + * + * @see \Drush\Boot\Boot::bootstrapPhases() + */ + public function bootstrapPhases($function_names = false) + { + $result = []; + + if ($bootstrap = $this->bootstrap()) { + $result = $bootstrap->bootstrapPhases(); + if (!$function_names) { + $result = array_keys($result); + } + } + return $result; + } + + /** + * Bootstrap Drush to the desired phase. + * + * This function will sequentially bootstrap each + * lower phase up to the phase that has been requested. + * + * @param int $phase + * The bootstrap phase to bootstrap to. + * @param int|bool $phase_max + * (optional) The maximum level to boot to. This does not have a use in this + * function itself but can be useful for other code called from within this + * function, to know if e.g. a caller is in the process of booting to the + * specified level. If specified, it should never be lower than $phase. + * @param \Consolidation\AnnotatedCommand\AnnotationData $annotationData + * Optional annotation data from the command. + * + * @return bool + * TRUE if the specified bootstrap phase has completed. + * + * @see \Drush\Boot\Boot::bootstrapPhases() + */ + public function doBootstrap($phase, $phase_max = false, AnnotationData $annotationData = null) + { + $bootstrap = $this->bootstrap(); + $phases = $this->bootstrapPhases(true); + $result = true; + + // If the requested phase does not exist in the list of available + // phases, it means that the command requires bootstrap to a certain + // level, but no site root could be found. + if (!isset($phases[$phase])) { + throw new \Exception(dt("We could not find an applicable site for that command.")); + } + + // Once we start bootstrapping past the DRUSH_BOOTSTRAP_DRUSH phase, we + // will latch the bootstrap object, and prevent it from changing. + if ($phase > DRUSH_BOOTSTRAP_DRUSH) { + $this->latch($bootstrap); + } + + foreach ($phases as $phase_index => $current_phase) { + $bootstrapped_phase = $this->getPhase(); + if ($phase_index > $phase) { + break; + } + if ($phase_index > $bootstrapped_phase) { + if ($result = $this->bootstrapValidate($phase_index)) { + if (method_exists($bootstrap, $current_phase)) { + $this->logger->log(LogLevel::BOOTSTRAP, 'Drush bootstrap phase: {function}()', ['function' => $current_phase]); + $bootstrap->{$current_phase}($this, $annotationData); + } + $bootstrap->setPhase($phase_index); + } + } + } + return true; + } + + /** + * hasBootstrap determines whether the manager has a bootstrap object yet. + */ + public function hasBootstrap() + { + return $this->bootstrap != null; + } + + /** + * Determine whether a given bootstrap phase has been completed. + * + * @param int $phase + * The bootstrap phase to test + * + * @return bool + * TRUE if the specified bootstrap phase has completed. + */ + public function hasBootstrapped($phase) + { + return $this->getPhase() >= $phase; + } + + /** + * Validate whether a bootstrap phase can be reached. + * + * This function will validate the settings that will be used + * during the actual bootstrap process, and allow commands to + * progressively bootstrap to the highest level that can be reached. + * + * This function will only run the validation function once, and + * store the result from that execution in a local static. This avoids + * validating phases multiple times. + * + * @param int $phase + * The bootstrap phase to validate to. + * + * @return bool + * TRUE if bootstrap is possible, FALSE if the validation failed. + * + * @see \Drush\Boot\Boot::bootstrapPhases() + */ + public function bootstrapValidate($phase) + { + $bootstrap = $this->bootstrap(); + $phases = $this->bootstrapPhases(true); + static $result_cache = []; + + $validated_phase = -1; + foreach ($phases as $phase_index => $current_phase) { + if (!array_key_exists($phase_index, $result_cache)) { + if ($phase_index > $phase) { + break; + } + if ($phase_index > $validated_phase) { + $current_phase .= 'Validate'; + if (method_exists($bootstrap, $current_phase)) { + $result_cache[$phase_index] = $bootstrap->{$current_phase}($this); + } else { + $result_cache[$phase_index] = true; + } + $validated_phase = $phase_index; + } + } + } + return $result_cache[$phase]; + } + + /** + * Bootstrap to the specified phase. + * + * @param string $bootstrapPhase + * Name of phase to bootstrap to. Will be converted to appropriate index. + * @param \Consolidation\AnnotatedCommand\AnnotationData $annotationData + * Optional annotation data from the command. + * + * @return bool + * TRUE if the specified bootstrap phase has completed. + * + * @throws \Exception + * Thrown when an unknown bootstrap phase is passed in the annotation + * data. + */ + public function bootstrapToPhase($bootstrapPhase, AnnotationData $annotationData = null) + { + $this->logger->log(LogLevel::BOOTSTRAP, 'Starting bootstrap to {phase}', ['phase' => $bootstrapPhase]); + $phase = $this->bootstrap()->lookUpPhaseIndex($bootstrapPhase); + if (!isset($phase)) { + throw new \Exception(dt('Bootstrap phase !phase unknown.', ['!phase' => $bootstrapPhase])); + } + // Do not attempt to bootstrap to a phase that is unknown to the selected bootstrap object. + $phases = $this->bootstrapPhases(); + if (!array_key_exists($phase, $phases) && ($phase >= 0)) { + return false; + } + return $this->bootstrapToPhaseIndex($phase, $annotationData); + } + + protected function maxPhaseLimit($bootstrap_str) + { + $bootstrap_words = explode(' ', $bootstrap_str); + array_shift($bootstrap_words); + if (empty($bootstrap_words)) { + return null; + } + $stop_phase_name = array_shift($bootstrap_words); + return $this->bootstrap()->lookUpPhaseIndex($stop_phase_name); + } + + /** + * Bootstrap to the specified phase. + * + * @param int $max_phase_index + * Only attempt bootstrap to the specified level. + * @param \Consolidation\AnnotatedCommand\AnnotationData $annotationData + * Optional annotation data from the command. + * + * @return bool + * TRUE if the specified bootstrap phase has completed. + */ + public function bootstrapToPhaseIndex($max_phase_index, AnnotationData $annotationData = null) + { + if ($max_phase_index == DRUSH_BOOTSTRAP_MAX) { + // Try get a max phase. + $bootstrap_str = $annotationData->get('bootstrap'); + $stop_phase = $this->maxPhaseLimit($bootstrap_str); + $this->bootstrapMax($stop_phase); + return true; + } + + $this->logger->log(LogLevel::BOOTSTRAP, 'Drush bootstrap phase {phase}', ['phase' => $max_phase_index]); + $phases = $this->bootstrapPhases(); + $result = true; + + // Try to bootstrap to the maximum possible level, without generating errors + foreach ($phases as $phase_index) { + if ($phase_index > $max_phase_index) { + // Stop trying, since we achieved what was specified. + break; + } + + $this->logger->log(LogLevel::BOOTSTRAP, 'Try to validate bootstrap phase {phase}', ['phase' => $max_phase_index]); + + if ($this->bootstrapValidate($phase_index)) { + if ($phase_index > $this->getPhase()) { + $this->logger->log(LogLevel::BOOTSTRAP, 'Try to bootstrap at phase {phase}', ['phase' => $max_phase_index]); + $result = $this->doBootstrap($phase_index, $max_phase_index, $annotationData); + } + } else { + $this->logger->log(LogLevel::BOOTSTRAP, 'Could not bootstrap at phase {phase}', ['phase' => $max_phase_index]); + $result = false; + break; + } + } + + return $result; + } + + /** + * Bootstrap to the highest level possible, without triggering any errors. + * + * @param int $max_phase_index + * (optional) Only attempt bootstrap to the specified level. + * @param \Consolidation\AnnotatedCommand\AnnotationData $annotationData + * Optional annotation data from the command. + * + * @return int + * The maximum phase to which we bootstrapped. + */ + public function bootstrapMax($max_phase_index = false, AnnotationData $annotationData = null) + { + // Bootstrap as far as we can without throwing an error, but log for + // debugging purposes. + + $phases = $this->bootstrapPhases(true); + if (!$max_phase_index) { + $max_phase_index = count($phases); + } + + if ($max_phase_index >= count($phases)) { + $this->logger->log(LogLevel::DEBUG, 'Trying to bootstrap as far as we can'); + } + + // Try to bootstrap to the maximum possible level, without generating errors. + foreach ($phases as $phase_index => $current_phase) { + if ($phase_index > $max_phase_index) { + // Stop trying, since we achieved what was specified. + break; + } + + if ($this->bootstrapValidate($phase_index)) { + if ($phase_index > $this->getPhase()) { + $this->doBootstrap($phase_index, $max_phase_index, $annotationData); + } + } else { + // $this->bootstrapValidate() only logs successful validations. For us, + // knowing what failed can also be important. + $previous = $this->getPhase(); + $this->logger->log(LogLevel::DEBUG, 'Bootstrap phase {function}() failed to validate; continuing at {current}()', ['function' => $current_phase, 'current' => $phases[$previous]]); + break; + } + } + + return $this->getPhase(); + } + + /** + * Allow those with an instance to us to the BootstrapManager to use its logger + */ + public function logger() + { + return $this->logger; + } + + public function inflect($object) + { + // See \Drush\Runtime\DependencyInjection::addDrushServices and + // \Robo\Robo\addInflectors + $container = $this->getContainer(); + if ($object instanceof \Robo\Contract\ConfigAwareInterface) { + $object->setConfig($container->get('config')); + } + if ($object instanceof \Psr\Log\LoggerAwareInterface) { + $object->setLogger($container->get('logger')); + } + if ($object instanceof \League\Container\ContainerAwareInterface) { + $object->setContainer($container->get('container')); + } + if ($object instanceof \Symfony\Component\Console\Input\InputAwareInterface) { + $object->setInput($container->get('input')); + } + if ($object instanceof \Robo\Contract\OutputAwareInterface) { + $object->setOutput($container->get('output')); + } + if ($object instanceof \Robo\Contract\ProgressIndicatorAwareInterface) { + $object->setProgressIndicator($container->get('progressIndicator')); + } + if ($object instanceof \Consolidation\AnnotatedCommand\Events\CustomEventAwareInterface) { + $object->setHookManager($container->get('hookManager')); + } + if ($object instanceof \Robo\Contract\VerbosityThresholdInterface) { + $object->setOutputAdapter($container->get('outputAdapter')); + } + if ($object instanceof \Consolidation\SiteAlias\SiteAliasManagerAwareInterface) { + $object->setSiteAliasManager($container->get('site.alias.manager')); + } + if ($object instanceof \Consolidation\SiteProcess\ProcessManagerAwareInterface) { + $object->setProcessManager($container->get('process.manager')); + } + if ($object instanceof \Consolidation\AnnotatedCommand\Input\StdinAwareInterface) { + $object->setStdinHandler($container->get('stdinHandler')); + } + } +} diff --git a/vendor/drush/drush/src/Boot/DrupalBoot.php b/vendor/drush/drush/src/Boot/DrupalBoot.php new file mode 100644 index 0000000000000000000000000000000000000000..aeba00a9fa3a8d8b451d07e93272d906fbadfcb7 --- /dev/null +++ b/vendor/drush/drush/src/Boot/DrupalBoot.php @@ -0,0 +1,199 @@ +<?php + +namespace Drush\Boot; + +use Drush\Drush; +use Drush\Log\LogLevel; +use Drush\Sql\SqlBase; +use Webmozart\PathUtil\Path; + +abstract class DrupalBoot extends BaseBoot +{ + /** + * Select the best URI for the provided cwd. Only called + * if the user did not explicitly specify a URI. + */ + public function findUri($root, $cwd) + { + if (Path::isBasePath($root, $cwd)) { + $siteDir = $this->scanUpForUri($root, $cwd); + if ($siteDir) { + return basename($siteDir); + } + } + return 'default'; + } + + protected function scanUpForUri($root, $scan) + { + $root = Path::canonicalize($root); + while (!empty($scan)) { + if (file_exists("$scan/settings.php")) { + return $scan; + } + // Use Path::getDirectory instead of dirname to + // avoid certain bugs. Returns a canonicalized path. + $next = Path::getDirectory($scan); + if ($next == $scan) { + return false; + } + $scan = $next; + if ($scan == $root) { + return false; + } + } + return false; + } + + public function validRoot($path) + { + } + + public function getVersion($drupal_root) + { + } + + public function confPath($require_settings = true, $reset = false) + { + } + + /** + * Bootstrap phases used with Drupal: + * + * DRUSH_BOOTSTRAP_DRUSH = Only Drush. + * DRUSH_BOOTSTRAP_DRUPAL_ROOT = Find a valid Drupal root. + * DRUSH_BOOTSTRAP_DRUPAL_SITE = Find a valid Drupal site. + * DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION = Load the site's settings. + * DRUSH_BOOTSTRAP_DRUPAL_DATABASE = Initialize the database. + * DRUSH_BOOTSTRAP_DRUPAL_FULL = Initialize Drupal fully. + * + * The value is the name of the method of the Boot class to + * execute when bootstrapping. Prior to bootstrapping, a "validate" + * method is called, if defined. The validate method name is the + * bootstrap method name with "_validate" appended. + */ + public function bootstrapPhases() + { + return parent::bootstrapPhases() + [ + DRUSH_BOOTSTRAP_DRUPAL_ROOT => 'bootstrapDrupalRoot', + DRUSH_BOOTSTRAP_DRUPAL_SITE => 'bootstrapDrupalSite', + DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION => 'bootstrapDrupalConfiguration', + DRUSH_BOOTSTRAP_DRUPAL_DATABASE => 'bootstrapDrupalDatabase', + DRUSH_BOOTSTRAP_DRUPAL_FULL => 'bootstrapDrupalFull', + ]; + } + + public function bootstrapPhaseMap() + { + return parent::bootstrapPhaseMap() + [ + 'root' => DRUSH_BOOTSTRAP_DRUPAL_ROOT, + 'site' => DRUSH_BOOTSTRAP_DRUPAL_SITE, + 'config' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, + 'configuration' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, + 'db' => DRUSH_BOOTSTRAP_DRUPAL_DATABASE, + 'database' => DRUSH_BOOTSTRAP_DRUPAL_DATABASE, + 'full' => DRUSH_BOOTSTRAP_DRUPAL_FULL, + ]; + } + + /** + * Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase. + * + * In this function, we will check if a valid Drupal directory is available. + */ + public function bootstrapDrupalRootValidate(BootstrapManager $manager) + { + $drupal_root = $manager->getRoot(); + return (bool) $drupal_root; + } + + /** + * Bootstrap Drush with a valid Drupal Directory. + * + * In this function, the pwd will be moved to the root + * of the Drupal installation. + * + * We also now load the drush.yml for this specific Drupal site. + * We can now include files from the Drupal tree, and figure + * out more context about the codebase, such as the version of Drupal. + */ + public function bootstrapDrupalRoot(BootstrapManager $manager) + { + $drupal_root = $manager->getRoot(); + chdir($drupal_root); + $this->logger->log(LogLevel::BOOTSTRAP, dt("Change working directory to !drupal_root", ['!drupal_root' => $drupal_root])); + // For backward compat purposes, keep setting this context. + drush_set_context('DRUSH_DRUPAL_ROOT', $drupal_root); + + $core = $this->bootstrapDrupalCore($manager, $drupal_root); + + // Make sure we are not bootstrapping twice + if (defined('DRUSH_DRUPAL_CORE')) { + if (DRUSH_DRUPAL_CORE != $core) { + $this->logger->warning('Attempted to redefine DRUSH_DRUPAL_CORE. Original value: ' . DRUSH_DRUPAL_CORE . '; new value: ' . $core); + } + return; + } + + // DRUSH_DRUPAL_CORE should point to the /core folder in Drupal 8+. + define('DRUSH_DRUPAL_CORE', $core); + + $this->logger->log(LogLevel::BOOTSTRAP, dt("Initialized Drupal !version root directory at !drupal_root", ["!version" => Drush::bootstrap()->getVersion($drupal_root), '!drupal_root' => $drupal_root])); + } + + /** + * VALIDATE the DRUSH_BOOTSTRAP_DRUPAL_SITE phase. + * + * In this function we determine the URL used for the command, + * and check for a valid settings.php file. + */ + public function bootstrapDrupalSiteValidate(BootstrapManager $manager) + { + } + + /** + * Initialize a site on the Drupal root. + * + * We now set various contexts that we determined and confirmed to be valid. + * Additionally we load an optional drush.yml file in the site directory. + */ + public function bootstrapDrupalSite(BootstrapManager $manager) + { + $this->bootstrapDoDrupalSite($manager); + } + + /** + * Initialize and load the Drupal configuration files. + */ + public function bootstrapDrupalConfiguration(BootstrapManager $manager) + { + } + + /** + * Validate the DRUSH_BOOTSTRAP_DRUPAL_DATABASE phase + * + * Attempt to make a working database connection using the + * database credentials that were loaded during the previous + * phase. + */ + public function bootstrapDrupalDatabaseValidate(BootstrapManager $manager) + { + } + + /** + * Bootstrap the Drupal database. + */ + public function bootstrapDrupalDatabase(BootstrapManager $manager) + { + // We presume that our derived classes will connect and then + // either fail, or call us via parent:: + $this->logger->log(LogLevel::BOOTSTRAP, dt("Successfully connected to the Drupal database.")); + } + + /** + * Attempt to load the full Drupal system. + */ + public function bootstrapDrupalFull(BootstrapManager $manager) + { + } +} diff --git a/vendor/drush/drush/src/Boot/DrupalBoot8.php b/vendor/drush/drush/src/Boot/DrupalBoot8.php new file mode 100644 index 0000000000000000000000000000000000000000..472ed86ebada10a9166219ed1b2a5fe5ee13fb7c --- /dev/null +++ b/vendor/drush/drush/src/Boot/DrupalBoot8.php @@ -0,0 +1,298 @@ +<?php + +namespace Drush\Boot; + +use Consolidation\AnnotatedCommand\AnnotationData; +use Drupal\Core\Database\Database; +use Drupal\Core\DrupalKernel; +use Drush\Drupal\DrushServiceModifier; +use Drush\Drush; +use Drush\Log\DrushLog; +use Drush\Log\LogLevel; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Webmozart\PathUtil\Path; +use Psr\Log\LoggerInterface; + +class DrupalBoot8 extends DrupalBoot implements AutoloaderAwareInterface +{ + use AutoloaderAwareTrait; + + /** + * @var LoggerInterface + */ + protected $drupalLoggerAdapter; + + /** + * @var \Drupal\Core\DrupalKernelInterface + */ + protected $kernel; + + /** + * @var \Symfony\Component\HttpFoundation\Request + */ + protected $request; + + /** + * @return \Symfony\Component\HttpFoundation\Request + */ + public function getRequest() + { + return $this->request; + } + + /** + * @param \Symfony\Component\HttpFoundation\Request $request + */ + public function setRequest($request) + { + $this->request = $request; + } + + /** + * @return \Drupal\Core\DrupalKernelInterface + */ + public function getKernel() + { + return $this->kernel; + } + + /** + * Sometimes (e.g. in the integration tests), the DrupalBoot + * object will be cached, and re-injected into a fresh set + * of preflight / bootstrap objects. When this happens, the + * new Drush logger will be injected into the boot object. If + * this happens after we have created the Drupal logger adapter + * (i.e., after bootstrapping Drupal), then we also need to + * update the logger reference in that adapter. + */ + public function setLogger(LoggerInterface $logger) + { + if ($this->drupalLoggerAdapter) { + $this->drupalLoggerAdapter->setLogger($logger); + } + parent::setLogger($logger); + } + + public function validRoot($path) + { + if (!empty($path) && is_dir($path) && file_exists($path . '/autoload.php')) { + // Additional check for the presence of core/composer.json to + // grant it is not a Drupal 7 site with a base folder named "core". + $candidate = 'core/includes/common.inc'; + if (file_exists($path . '/' . $candidate) && file_exists($path . '/core/core.services.yml')) { + if (file_exists($path . '/core/misc/drupal.js') || file_exists($path . '/core/assets/js/drupal.js')) { + return $candidate; + } + } + } + } + + public function getVersion($drupal_root) + { + // Are the class constants available? + if (!$this->hasAutoloader()) { + throw new \Exception('Cannot access Drupal 8 class constants - Drupal autoloader not loaded yet.'); + } + // Drush depends on bootstrap being loaded at this point. + require_once $drupal_root .'/core/includes/bootstrap.inc'; + if (defined('\Drupal::VERSION')) { + return \Drupal::VERSION; + } + } + + public function confPath($require_settings = true, $reset = false) + { + + if (\Drupal::hasService('kernel')) { + $site_path = \Drupal::service('kernel')->getSitePath(); + } + if (!isset($site_path) || empty($site_path)) { + $site_path = DrupalKernel::findSitePath($this->getRequest(), $require_settings); + } + return $site_path; + } + + public function addLogger() + { + // Provide a logger which sends + // output to drush_log(). This should catch every message logged through every + // channel. + $container = \Drupal::getContainer(); + $parser = $container->get('logger.log_message_parser'); + + $drushLogger = Drush::logger(); + $this->drupalLoggerAdapter = new DrushLog($parser, $drushLogger); + $container->get('logger.factory')->addLogger($this->drupalLoggerAdapter); + } + + public function bootstrapDrupalCore(BootstrapManager $manager, $drupal_root) + { + return Path::join($drupal_root, 'core'); + } + + public function bootstrapDrupalSiteValidate(BootstrapManager $manager) + { + parent::bootstrapDrupalSiteValidate($manager); + + // Normalize URI. + $uri = rtrim($this->uri, '/') . '/'; + $parsed_url = parse_url($uri); + + // Account for users who omit the http:// prefix. + if (empty($parsed_url['scheme'])) { + $this->uri = 'http://' . $this->uri; + $parsed_url = parse_url('http://' . $uri); + } + + $server = [ + 'SCRIPT_FILENAME' => getcwd() . '/index.php', + 'SCRIPT_NAME' => isset($parsed_url['path']) ? $parsed_url['path'] . 'index.php' : '/index.php', + ]; + $request = Request::create($this->uri, 'GET', [], [], [], $server); + $this->setRequest($request); + return true; + } + + /** + * Called by bootstrapDrupalSite to do the main work + * of the drush drupal site bootstrap. + */ + public function bootstrapDoDrupalSite(BootstrapManager $manager) + { + $this->logger->log(LogLevel::BOOTSTRAP, dt("Initialized Drupal site !site at !site_root", ['!site' => $this->getRequest()->getHttpHost(), '!site_root' => $this->confPath()])); + } + + public function bootstrapDrupalConfigurationValidate(BootstrapManager $manager) + { + $conf_file = $this->confPath() . '/settings.php'; + if (!file_exists($conf_file)) { + $msg = dt("Could not find a Drupal settings.php file at !file.", ['!file' => $conf_file]); + $this->logger->debug($msg); + // Cant do this because site:install deliberately bootstraps to configure without a settings.php file. + // return drush_set_error($msg); + } + return true; + } + + public function bootstrapDrupalDatabaseValidate(BootstrapManager $manager) + { + // Drupal requires PDO, and Drush requires php 5.6+ which ships with PDO + // but PHP may be compiled with --disable-pdo. + if (!class_exists('\PDO')) { + $this->logger->log(LogLevel::BOOTSTRAP, dt('PDO support is required.')); + return false; + } + + try { + // @todo Log queries in addition to logging failure messages? + $connection = Database::getConnection(); + $connection->query('SELECT 1;'); + } catch (\Exception $e) { + $this->logger->log(LogLevel::BOOTSTRAP, 'Unable to connect to database. More information may be available by running `drush status`. This may occur when Drush is trying to bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See `drush topic docs-aliases` for details.'); + return false; + } + if (!$connection->schema()->tableExists('key_value')) { + $this->logger->log(LogLevel::BOOTSTRAP, 'key_value table not found. Database may be empty.'); + return false; + } + return true; + } + + public function bootstrapDrupalDatabase(BootstrapManager $manager) + { + // D8 omits this bootstrap level as nothing special needs to be done. + parent::bootstrapDrupalDatabase($manager); + } + + public function bootstrapDrupalConfiguration(BootstrapManager $manager, AnnotationData $annotationData = null) + { + // Default to the standard kernel. + $kernel = Kernels::DRUPAL; + if (!empty($annotationData)) { + $kernel = $annotationData->get('kernel', Kernels::DRUPAL); + } + $classloader = $this->autoloader(); + $request = $this->getRequest(); + $kernel_factory = Kernels::getKernelFactory($kernel); + $allow_dumping = $kernel !== Kernels::UPDATE; + /** @var \Drupal\Core\DrupalKernelInterface kernel */ + $this->kernel = $kernel_factory($request, $classloader, 'prod', $allow_dumping); + // Include Drush services in the container. + // @see Drush\Drupal\DrupalKernel::addServiceModifier() + $this->kernel->addServiceModifier(new DrushServiceModifier()); + + // Unset drupal error handler and restore Drush's one. + restore_error_handler(); + + // Disable automated cron if the module is enabled. + $GLOBALS['config']['automated_cron.settings']['interval'] = 0; + + parent::bootstrapDrupalConfiguration($manager); + } + + public function bootstrapDrupalFull(BootstrapManager $manager) + { + $this->logger->debug(dt('Start bootstrap of the Drupal Kernel.')); + $this->kernel->boot(); + $this->kernel->prepareLegacyRequest($this->getRequest()); + $this->logger->debug(dt('Finished bootstrap of the Drupal Kernel.')); + + parent::bootstrapDrupalFull($manager); + $this->addLogger(); + $this->addDrupalModuleDrushCommands($manager); + } + + public function addDrupalModuleDrushCommands($manager) + { + $application = Drush::getApplication(); + $runner = Drush::runner(); + + // We have to get the service command list from the container, because + // it is constructed in an indirect way during the container initialization. + // The upshot is that the list of console commands is not available + // until after $kernel->boot() is called. + $container = \Drupal::getContainer(); + + // Set the command info alterers. + if ($container->has(DrushServiceModifier::DRUSH_COMMAND_INFO_ALTERER_SERVICES)) { + $serviceCommandInfoAltererlist = $container->get(DrushServiceModifier::DRUSH_COMMAND_INFO_ALTERER_SERVICES); + $commandFactory = Drush::commandFactory(); + foreach ($serviceCommandInfoAltererlist->getCommandList() as $altererHandler) { + $commandFactory->addCommandInfoAlterer($altererHandler); + $this->logger->debug(dt('Commands are potentially altered in !class.', ['!class' => get_class($altererHandler)])); + } + } + + $serviceCommandlist = $container->get(DrushServiceModifier::DRUSH_CONSOLE_SERVICES); + if ($container->has(DrushServiceModifier::DRUSH_CONSOLE_SERVICES)) { + foreach ($serviceCommandlist->getCommandList() as $command) { + $manager->inflect($command); + $this->logger->log(LogLevel::DEBUG_NOTIFY, dt('Add a command: !name', ['!name' => $command->getName()])); + $application->add($command); + } + } + // Do the same thing with the annotation commands. + if ($container->has(DrushServiceModifier::DRUSH_COMMAND_SERVICES)) { + $serviceCommandlist = $container->get(DrushServiceModifier::DRUSH_COMMAND_SERVICES); + foreach ($serviceCommandlist->getCommandList() as $commandHandler) { + $manager->inflect($commandHandler); + $this->logger->log(LogLevel::DEBUG_NOTIFY, dt('Add a commandfile class: !name', ['!name' => get_class($commandHandler)])); + $runner->registerCommandClass($application, $commandHandler); + } + } + } + + /** + * {@inheritdoc} + */ + public function terminate() + { + parent::terminate(); + + if ($this->kernel) { + $response = Response::create(''); + $this->kernel->terminate($this->getRequest(), $response); + } + } +} diff --git a/vendor/drush/drush/src/Boot/EmptyBoot.php b/vendor/drush/drush/src/Boot/EmptyBoot.php new file mode 100644 index 0000000000000000000000000000000000000000..dfdcd3f007e6f0f6142dd2f6564961a6dd4377c9 --- /dev/null +++ b/vendor/drush/drush/src/Boot/EmptyBoot.php @@ -0,0 +1,34 @@ +<?php + +namespace Drush\Boot; + +use Psr\Log\LoggerInterface; + +/** + * This is a do-nothing 'Boot' class that is used when there + * is no site at --root, or when no root is specified. + * + * The 'empty' boot must be careful to never change state, + * in case bootstrap code might later come along and set + * a site (e.g. in command completion). + */ +class EmptyBoot extends BaseBoot +{ + + public function validRoot($path) + { + return false; + } + + public function bootstrapPhases() + { + return [ + DRUSH_BOOTSTRAP_DRUSH => '_drush_bootstrap_drush', + ]; + } + + public function bootstrapInitPhases() + { + return [DRUSH_BOOTSTRAP_DRUSH]; + } +} diff --git a/vendor/drush/drush/src/Boot/Kernels.php b/vendor/drush/drush/src/Boot/Kernels.php new file mode 100644 index 0000000000000000000000000000000000000000..dc7278a9b5808d9b55fdbb64d90a61e6cf78c216 --- /dev/null +++ b/vendor/drush/drush/src/Boot/Kernels.php @@ -0,0 +1,66 @@ +<?php + +namespace Drush\Boot; + +use Drush\Drupal\DrupalKernel as DrushDrupalKernel; +use Drush\Drupal\UpdateKernel as DrushUpdateKernel; +use Drush\Drupal\InstallerKernel as DrushInstallerKernel; + +/** + * Defines the available kernels that can be bootstrapped. + */ +final class Kernels +{ + + /** + * The default kernel that is used on standard requests. + * + * @var string + */ + const DRUPAL = 'drupal'; + + /** + * The kernel that is used during database updates. + * + * @var string + */ + const UPDATE = 'update'; + + /** + * The kernel that is used during site installation. + * + * @var string + */ + const INSTALLER = 'installer'; + + /** + * Returns the available kernels. + */ + public static function availableKernels() + { + return [ + static::DRUPAL, + static::UPDATE, + static::INSTALLER, + ]; + } + + /** + * Returns the factory method that can be used to retrieve the given kernel. + * + * @param string $kernel + * The kernel to retrieve. + * + * @return callable + * The factory method. + */ + public static function getKernelFactory($kernel) + { + $factories = [ + Kernels::DRUPAL => [DrushDrupalKernel::class, 'createFromRequest'], + Kernels::UPDATE => [DrushUpdateKernel::class, 'createFromRequest'], + Kernels::INSTALLER => [DrushInstallerKernel::class, 'createFromRequest'], + ]; + return $factories[$kernel]; + } +} diff --git a/vendor/drush/drush/src/Cache/CacheInterface.php b/vendor/drush/drush/src/Cache/CacheInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..5cf54469e9fdd6e4c576f66df43871c7e3a019db --- /dev/null +++ b/vendor/drush/drush/src/Cache/CacheInterface.php @@ -0,0 +1,114 @@ +<?php + +/** + * @file + * Definition of Drush\Cache\CacheInterface. + */ + +namespace Drush\Cache; + +/** + * Interface for cache implementations. + * + * All cache implementations have to implement this interface. + * JSONCache provides the default implementation, which can be + * consulted as an example. + * + * To make Drush use your implementation for a certain cache bin, you have to + * set a variable with the name of the cache bin as its key and the name of + * your class as its value. For example, if your implementation of + * CacheInterface was called MyCustomCache, the following line in + * drushrc.php would make Drush use it for the 'example' bin: + * @code + * $options['cache-class-example'] = 'MyCustomCache; + * @endcode + * + * Additionally, you can register your cache implementation to be used by + * default for all cache bins by setting the option 'cache-default-class' to + * the name of your implementation of the CacheInterface, e.g. + * @code + * $options['cache-default-class'] = 'MyCustomCache; + * @endcode + * + * @see \Drupal\Core\Cache\CacheBackendInterface + * + * @deprecated + */ +interface CacheInterface +{ + + /** + * Constructor. + * + * @param $bin + * The cache bin for which the object is created. + */ + public function __construct($bin); + + /** + * Return data from the persistent cache. + * + * @param string $cid + * The cache ID of the data to retrieve. + * + * @return + * The cache or FALSE on failure. + */ + public function get($cid); + + /** + * Return data from the persistent cache when given an array of cache IDs. + * + * @param array $cids + * An array of cache IDs for the data to retrieve. This is passed by + * reference, and will have the IDs successfully returned from cache + * removed. + * + * @return + * An array of the items successfully returned from cache indexed by cid. + */ + public function getMultiple(&$cids); + + /** + * Store data in the persistent cache. + * + * @param string $cid + * The cache ID of the data to store. + * @param array $data + * The data to store in the cache. + * @param $expire + * One of the following values: + * - DRUSH_CACHE_PERMANENT: Indicates that the item should never be removed unless + * explicitly told to using _drush_cache_clear_all() with a cache ID. + * - DRUSH_CACHE_TEMPORARY: Indicates that the item should be removed at the next + * general cache wipe. + * - A Unix timestamp: Indicates that the item should be kept at least until + * the given time, after which it behaves like CACHE_TEMPORARY. + */ + public function set($cid, $data, $expire = DRUSH_CACHE_PERMANENT); + + /** + * Expire data from the cache. If called without arguments, expirable + * entries will be cleared from all known cache bins. + * + * @param string $cid + * If set, the cache ID to delete. Otherwise, all cache entries that can + * expire are deleted. + * @param bool $wildcard + * If set to TRUE, the $cid is treated as a substring + * to match rather than a complete ID. The match is a right hand + * match. If '*' is given as $cid, the bin $bin will be emptied. + */ + public function clear($cid = null, $wildcard = false); + + /** + * Check if a cache bin is empty. + * + * A cache bin is considered empty if it does not contain any valid data for + * any cache ID. + * + * @return + * TRUE if the cache bin specified is empty. + */ + public function isEmpty(); +} diff --git a/vendor/drush/drush/src/Cache/CommandCache.php b/vendor/drush/drush/src/Cache/CommandCache.php new file mode 100644 index 0000000000000000000000000000000000000000..39661d526d7c8fffd6572ceed0b1e315272f3d79 --- /dev/null +++ b/vendor/drush/drush/src/Cache/CommandCache.php @@ -0,0 +1,64 @@ +<?php + +namespace Drush\Cache; + +use Consolidation\AnnotatedCommand\Cache\SimpleCacheInterface; + +/** + * Command cache implementation. + * + * This wrapper implements a cache usable with the annotated-command + * library's command cache. It uses a Drush JSONCache for its back-end. + */ +class CommandCache implements SimpleCacheInterface +{ + + protected $cacheBackend; + + public function __construct(CacheInterface $cacheBackend) + { + $this->cacheBackend = $cacheBackend; + } + + /** + * Test for an entry from the cache + * @param string $key + * @return boolean + */ + public function has($key) + { + $cacheItem = $this->cacheBackend->get($key); + return $this->valid($cacheItem); + } + /** + * Get an entry from the cache + * @param string $key + * @return array + */ + public function get($key) + { + $cacheItem = $this->cacheBackend->get($key); + if (!$this->valid($cacheItem)) { + return []; + } + // TODO: FileCache::get() should just return the + // data element, not the entire cacheItem. Then we + // could make it implement SimpleCacheInterface & do + // away with this adapter class. + return $cacheItem->data; + } + /** + * Store an entry in the cache + * @param string $key + * @param array $data + */ + public function set($key, $data) + { + $this->cacheBackend->set($key, $data); + } + + protected function valid($cacheItem) + { + return is_object($cacheItem) && isset($cacheItem->data); + } +} diff --git a/vendor/drush/drush/src/Cache/FileCache.php b/vendor/drush/drush/src/Cache/FileCache.php new file mode 100644 index 0000000000000000000000000000000000000000..848fdd6f7041dfbd4014624ac7dd0d94f7c77704 --- /dev/null +++ b/vendor/drush/drush/src/Cache/FileCache.php @@ -0,0 +1,175 @@ +<?php + +/** + * @file + * Definition of Drush\Cache\FileCache. + */ + +namespace Drush\Cache; + +use Drush\Drush; +use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Finder\Finder; +use Webmozart\PathUtil\Path; + +/** + * Default cache implementation. + * + * This cache implementation uses plain text files + * containing serialized php to store cached data. Each cache bin corresponds + * to a directory by the same name. + * + * @deprecated + */ +class FileCache implements CacheInterface +{ + const EXTENSION = '.cache'; + protected $bin; + + public function __construct($bin) + { + $this->bin = $bin; + $this->directory = $this->cacheDirectory(); + } + + /** + * Returns the cache directory for the given bin. + * + * @param string $bin + */ + public function cacheDirectory($bin = null) + { + $bin = $bin ? $bin : $this->bin; + return Path::join(Drush::config()->cache(), $bin); + } + + public function get($cid) + { + $cids = [$cid]; + $cache = $this->getMultiple($cids); + return reset($cache); + } + + public function getMultiple(&$cids) + { + try { + $cache = []; + foreach ($cids as $cid) { + $filename = $this->getFilePath($cid); + if (!file_exists($filename)) { + return []; + } + + $item = $this->readFile($filename); + if ($item) { + $cache[$cid] = $item; + } + } + $cids = array_diff($cids, array_keys($cache)); + return $cache; + } catch (\Exception $e) { + return []; + } + } + + /** + * Returns the contents of the given filename unserialized. + * + * @param string $filename + * Absolute path to filename to read contents from. + */ + public function readFile($filename) + { + $item = file_get_contents($filename); + return $item ? unserialize($item) : false; + } + + public function set($cid, $data, $expire = DRUSH_CACHE_PERMANENT) + { + $created = time(); + + $cache = new \stdClass; + $cache->cid = $cid; + $cache->data = is_object($data) ? clone $data : $data; + $cache->created = $created; + if ($expire == DRUSH_CACHE_TEMPORARY) { + $cache->expire = $created + 2591999; + } elseif ($expire != DRUSH_CACHE_PERMANENT && $expire < 2592000) { + // Expire time is in seconds if less than 30 days, otherwise is a timestamp. + $cache->expire = $created + $expire; + } else { + $cache->expire = $expire; + } + + // Ensure the cache directory still exists, in case a backend process + // cleared the cache after the cache was initialized. + $fs = new Filesystem(); + $fs->mkdir($this->directory); + + $filename = $this->getFilePath($cid); + return $this->writeFile($filename, $cache); + } + + /** + * Serializes data and write it to the given filename. + * + * @param string $filename + * Absolute path to filename to write cache data. + * @param $cache + * Cache data to serialize and write to $filename. + */ + public function writeFile($filename, $cache) + { + return file_put_contents($filename, serialize($cache)); + } + + public function clear($cid = null, $wildcard = false) + { + $fs = new Filesystem(); + $bin_dir = $this->cacheDirectory(); + $files = []; + if (empty($cid)) { + $fs->remove($bin_dir); + } else { + if ($wildcard) { + if ($cid == '*') { + $fs->remove($bin_dir); + } else { + $files = Finder::create() + ->files() + ->name($cid) + ->in($bin_dir); + } + } else { + $files[] = $this->getFilePath($cid); + } + + $fs->remove($files); + } + } + + public function isEmpty() + { + $files = Finder::create() + ->files() + ->name() + ->exclude() + ->depth(0) + ->in($this->directory); + return empty($files); + } + + /** + * Converts a cache id to a full path. + * + * @param $cid + * The cache ID of the data to retrieve. + * + * @return + * The full path to the cache file. + */ + protected function getFilePath($cid) + { + return $this->directory . '/' . str_replace([':', '\\', '/'], '.', $cid) . self::EXTENSION; + } +} diff --git a/vendor/drush/drush/src/Cache/JSONCache.php b/vendor/drush/drush/src/Cache/JSONCache.php new file mode 100644 index 0000000000000000000000000000000000000000..5f5c8ffd9745b6bb8f9e5ed1e56f373d2cd5ce96 --- /dev/null +++ b/vendor/drush/drush/src/Cache/JSONCache.php @@ -0,0 +1,32 @@ +<?php + +/** + * @file + * Definition of Drush\Cache\JSONCache. + */ + +namespace Drush\Cache; + +/** + * JSON cache storage backend. + * + * @deprecated + */ +class JSONCache extends FileCache +{ + const EXTENSION = '.json'; + + public function readFile($filename) + { + $item = file_get_contents($filename); + return $item ? (object)json_decode($item, true) : false; + } + + public function writeFile($filename, $cache) + { + $json = json_encode($cache, JSON_PRETTY_PRINT); + // json_encode() does not escape <, > and &, so we do it with str_replace(). + $json = str_replace(['<', '>', '&'], ['\u003c', '\u003e', '\u0026'], $json); + return file_put_contents($filename, $json); + } +} diff --git a/vendor/drush/drush/src/Command/DrushCommandInfoAlterer.php b/vendor/drush/drush/src/Command/DrushCommandInfoAlterer.php new file mode 100644 index 0000000000000000000000000000000000000000..8b6effabcac86aec5c96fbcfe9bc809590d4b72e --- /dev/null +++ b/vendor/drush/drush/src/Command/DrushCommandInfoAlterer.php @@ -0,0 +1,28 @@ +<?php +namespace Drush\Command; + +use Consolidation\AnnotatedCommand\CommandInfoAltererInterface; +use Consolidation\AnnotatedCommand\Parser\CommandInfo; + +class DrushCommandInfoAlterer implements CommandInfoAltererInterface +{ + public function alterCommandInfo(CommandInfo $commandInfo, $commandFileInstance) + { + // If a command has a @filter-default-field annotation, that + // implies that it also has an implicit @filter-output annotation. + if ($commandInfo->hasAnnotation('filter-default-field') && !$commandInfo->hasAnnotation('filter-output')) { + $commandInfo->addAnnotation('filter-output', true); + } + // Automatically add the help topic for output formatters to + // any command that has any annotations related to output filters + if ($commandInfo->hasAnnotation('filter-output') || $commandInfo->hasAnnotation('field-labels')) { + if ($commandInfo->hasAnnotation('topics')) { + // Topic value may have multiple values separated by a comma. + $values = $commandInfo->getAnnotationList('topics'); + $commandInfo->removeAnnotation('topics'); + $commandInfo->addAnnotation('topics', $values); + } + $commandInfo->addAnnotation('topics', 'docs:output-formats-filters'); + } + } +} diff --git a/vendor/drush/drush/src/Command/GlobalOptionsEventListener.php b/vendor/drush/drush/src/Command/GlobalOptionsEventListener.php new file mode 100644 index 0000000000000000000000000000000000000000..ac455cbad1ef22872f70dd33c43921a333ef220b --- /dev/null +++ b/vendor/drush/drush/src/Command/GlobalOptionsEventListener.php @@ -0,0 +1,41 @@ +<?php +namespace Drush\Command; + +use Symfony\Component\Console\ConsoleEvents; +use Symfony\Component\Console\Event\ConsoleCommandEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +use Drush\Preflight\LegacyPreflight; + +class GlobalOptionsEventListener implements EventSubscriberInterface +{ + /** + * @{@inheritdoc} + */ + public static function getSubscribedEvents() + { + // Register our 'setGlobalOptions' command to run prior to + // command dispatch. + return [ConsoleEvents::COMMAND => 'setGlobalOptions']; + } + + /** + * Before a Console command runs, examine the global + * commandline options from the event Input, and set + * configuration values as appropriate. + * + * @param ConsoleCommandEvent $event + */ + public function setGlobalOptions(ConsoleCommandEvent $event) + { + /* @var Input $input */ + $input = $event->getInput(); + $output = $event->getOutput(); + + // TODO: We need a good strategy for managing global options. + // $simulate = $input->getOption('simulate'); + + // Set up legacy contexts (deprecated) + LegacyPreflight::setGlobalOptionContexts($input, $output); + } +} diff --git a/vendor/drush/drush/src/Command/RemoteCommandProxy.php b/vendor/drush/drush/src/Command/RemoteCommandProxy.php new file mode 100644 index 0000000000000000000000000000000000000000..488f4033e378624e5baad735f85c6ea9002ee730 --- /dev/null +++ b/vendor/drush/drush/src/Command/RemoteCommandProxy.php @@ -0,0 +1,51 @@ +<?php +namespace Drush\Command; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Drush\Symfony\IndiscriminateInputDefinition; + +use Drush\Runtime\RedispatchHook; + +/** + * Create a placeholder proxy command to represent an unknown command. + * We use these only when executing remote commands that do not exist + * locally. We will let the remote end decide whether these will be + * "command not found," or some other behavior, as the remote end might + * have additional functionality installed. + * + * Also note that, for remote commands, we create the proxy command prior + * to attempting to bootstrap Drupal further, so the proxy command may + * be used in place of some command name that is available only for + * Drupal sites (e.g. pm:list and friends, etc.). + */ +class RemoteCommandProxy extends Command +{ + /** @var RedispatchHook */ + protected $redispatchHook; + + public function __construct($name, RedispatchHook $redispatchHook) + { + parent::__construct($name); + $this->redispatchHook = $redispatchHook; + + // Put in a special input definition to avoid option validation errors. + $this->setDefinition(new IndiscriminateInputDefinition()); + + // Put in a placeholder array argument to avoid validation errors. + $this->addArgument( + 'arguments', + InputArgument::IS_ARRAY, + 'Proxy for command arguments' + ); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->redispatchHook->redispatchIfRemote($input); + $name = $this->getName(); + throw new \Exception("Command $name could not be executed remotely."); + } +} diff --git a/vendor/drush/drush/lib/Drush/Command/ServiceCommandlist.php b/vendor/drush/drush/src/Command/ServiceCommandlist.php similarity index 75% rename from vendor/drush/drush/lib/Drush/Command/ServiceCommandlist.php rename to vendor/drush/drush/src/Command/ServiceCommandlist.php index b0bcfc3044a040d4b99e56daf46cf493c341a422..c8dabf9cceaefe18d8e68e36d82e230f3cc43e68 100644 --- a/vendor/drush/drush/lib/Drush/Command/ServiceCommandlist.php +++ b/vendor/drush/drush/src/Command/ServiceCommandlist.php @@ -1,18 +1,16 @@ <?php namespace Drush\Command; -use Drush\Log\LogLevel; - /** * Keep a list of all of the service commands that we can find when the * Drupal Kernel is booted. */ -class ServiceCommandlist { +class ServiceCommandlist +{ protected $commandList = []; public function addCommandReference($command) { - drush_log(dt("add command reference"), LogLevel::DEBUG); $this->commandList[] = $command; } diff --git a/vendor/drush/drush/src/Commands/DrushCommands.php b/vendor/drush/drush/src/Commands/DrushCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..86bceeebc262824e14a30e0e1b4c232fd05380b4 --- /dev/null +++ b/vendor/drush/drush/src/Commands/DrushCommands.php @@ -0,0 +1,90 @@ +<?php +namespace Drush\Commands; + +use Drush\Drush; +use Drush\Style\DrushStyle; +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; +use Psr\Log\LoggerInterface; +use Drush\Config\ConfigAwareTrait; +use Robo\Contract\ConfigAwareInterface; +use Robo\Contract\IOAwareInterface; +use Robo\Common\IO; +use Symfony\Component\Console\Input\InputOption; +use Consolidation\SiteProcess\ProcessManagerAwareTrait; +use Consolidation\SiteProcess\ProcessManagerAwareInterface; + +abstract class DrushCommands implements IOAwareInterface, LoggerAwareInterface, ConfigAwareInterface, ProcessManagerAwareInterface +{ + use ProcessManagerAwareTrait; + + // This is more readable. + const REQ=InputOption::VALUE_REQUIRED; + const OPT=InputOption::VALUE_OPTIONAL; + + // Common exit codes. + const EXIT_SUCCESS = 0; + const EXIT_FAILURE = 1; + + use LoggerAwareTrait; + use ConfigAwareTrait; + use IO { + io as roboIo; + } + + public function __construct() + { + } + + /** + * Returns a logger object. + * + * @return LoggerInterface + */ + protected function logger() + { + return $this->logger; + } + + /** + * Override Robo's IO function with our custom style. + */ + protected function io() + { + if (!$this->io) { + // Specify our own Style class when needed. + $this->io = new DrushStyle($this->input(), $this->output()); + } + return $this->io; + } + + /** + * Print the contents of a file. + * + * @param string $file + * Full path to a file. + */ + protected function printFile($file) + { + if ((substr($file, -4) == ".htm") || (substr($file, -5) == ".html")) { + $tmp_file = drush_tempnam(basename($file)); + file_put_contents($tmp_file, drush_html_to_text(file_get_contents($file))); + $file = $tmp_file; + } + + if (self::input()->isInteractive()) { + ; + $process = $this->processManager()->process(['less', $file])->setTty(true); + if ($process->run() === 0) { + return; + } else { + $process = $this->processManager()->process(['more', $file]); + if ($process->run() === 0) { + return; + } else { + $this->output()->writeln(file_get_contents($file)); + } + } + } + } +} diff --git a/vendor/drush/drush/lib/Drush/CommandFiles/ExampleCommandFile.php b/vendor/drush/drush/src/Commands/ExampleCommands.php similarity index 50% rename from vendor/drush/drush/lib/Drush/CommandFiles/ExampleCommandFile.php rename to vendor/drush/drush/src/Commands/ExampleCommands.php index ec764dd6f4a795df9bdf5561dd61d5e78eda3ed0..11d4a32862818ad7511443ebd4c2aa5324407815 100644 --- a/vendor/drush/drush/lib/Drush/CommandFiles/ExampleCommandFile.php +++ b/vendor/drush/drush/src/Commands/ExampleCommands.php @@ -1,52 +1,69 @@ <?php -namespace Drush\CommandFiles; +namespace Drush\Commands; /** * @file * Set up local Drush configuration. */ -use Drush\Log\LogLevel; -use Consolidation\AnnotatedCommand\AnnotationData; use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Consolidation\OutputFormatters\Options\FormatterOptions; use Consolidation\AnnotatedCommand\CommandData; -class ExampleCommandFile +class ExampleCommands extends DrushCommands { /** - * Demonstrate Robo formatters. Default format is 'table'. + * Demonstrate output formatters. Default format is 'table'. * + * @command example:table * @field-labels * first: I * second: II * third: III * @default-string-field second - * @usage example:formatters --format=yaml - * @usage example:formatters --format=csv - * @usage example:formatters --fields=first,third - * @usage example:formatters --fields=III,II + * @usage example-table --format=yaml + * @usage example-table --format=csv + * @usage example-table --fields=first,third + * @usage example-table --fields=III,II * @aliases tf + * @hidden * * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields */ - public function exampleTable($options = ['format' => 'table', 'fields' => '']) + public function exampleTable($options = ['format' => 'table']) { - $outputData = [ + $tableData = [ 'en' => [ 'first' => 'One', 'second' => 'Two', 'third' => 'Three' ], 'de' => [ 'first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei' ], 'jp' => [ 'first' => 'Ichi', 'second' => 'Ni', 'third' => 'San' ], 'es' => [ 'first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres' ], ]; - return new RowsOfFields($outputData); + $data = new RowsOfFields($tableData); + + // Add a render function to transform cell data when the output + // format is a table, or similar. This allows us to add color + // information to the output without modifying the data cells when + // using yaml or json output formats. + $data->addRendererFunction( + // n.b. There is a fourth parameter $rowData that may be added here. + function ($key, $cellData, FormatterOptions $options, $rowData) { + if ($key == 'first') { + return "<comment>$cellData</>"; + } + return $cellData; + } + ); + + return $data; } /** * Demonstrate an alter hook with an option * - * @hook alter example:table + * @hook alter example-table * @option french Add a row with French numbers. - * @usage example:formatters --french + * @usage example-table --french */ public function alterFormatters($result, CommandData $commandData) { diff --git a/vendor/drush/drush/src/Commands/LegacyCommands.php b/vendor/drush/drush/src/Commands/LegacyCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..5828261e332727479bc94e91f7468e74389f594e --- /dev/null +++ b/vendor/drush/drush/src/Commands/LegacyCommands.php @@ -0,0 +1,155 @@ +<?php +namespace Drush\Commands; + +class LegacyCommands extends DrushCommands +{ + + /** + * Drupal 8 does not support disabling modules. See pm:uninstall command. + * + * @command pm:disable + * @aliases dis,pm-disable + * @hidden + * @obsolete + */ + public function disable() + { + } + + /** + * The pm-info command was deprecated. Please see `drush pm:list` and `composer show` + * + * @command pm:info + * @aliases pmi,pm-info + * @hidden + * @obsolete + */ + public function info() + { + } + + /** + * The pm-projectinfo command was deprecated. Please see `drush pm:list` and `composer show` + * + * @command pm:projectinfo + * @allow-additional-options + * @aliases pm-projectinfo + * @hidden + * @obsolete + */ + public function projectInfo() + { + } + + /** + * The pm-refresh command was deprecated. It is no longer useful. + * + * @command pm:refresh + * @aliases rf,pm-refresh + * @hidden + * @obsolete + */ + public function refresh() + { + } + + /** + * The pm-updatestatus command was deprecated. Please see `composer show` + * and `composer update --dry-run`. For security release notification, + * see `drush pm:security`. + * + * @command pm:updatestatus + * @aliases ups,pm-updatestatus + * @hidden + * @obsolete + */ + public function updatestatus() + { + } + + /** + * The pm-updatecode command was deprecated. Please see + * `composer update --dry-run` and `composer update`. + * For security release notification, see `drush pm:security`. + * + * @command pm:updatecode + * @aliases upc,pm-update,pm-updatecode + * @hidden + * @obsolete + */ + public function updatecode() + { + } + + /** + * The pm-releasenotes command was deprecated. No replacement available. + * + * @command pm:releasenotes + * @aliases rln,pm-releasenotes + * @hidden + * @obsolete + */ + public function releaseNotes() + { + } + + /** + * The pm-releases command was deprecated. Please see `composer show <packagename>` + * + * @command pm:releases + * @aliases rl,pm-releases + * @hidden + * @obsolete + */ + public function releases() + { + } + + /** + * Make has been removed, in favor of Composer. Use the make-convert command in Drush 8 to quickly upgrade your build to Composer. + * + * @command make + * @aliases make-convert,make-generate,make-lock,make-update + * @hidden + * @obsolete + */ + public function make() + { + } + + /** + * dl has been deprecated. Please build your site using Composer. Add new projects with composer require drupal/[project-name]. Use https://www.drupal.org/project/composer_generate to build a composer.json which represents the enabled modules on your site. + * + * @command pm:download + * @aliases dl,pm-download + * @hidden + * @obsolete + */ + public function download() + { + } + + /** + * field-create has been deprecated. Please try `generate field` command. + * + * @command field:create + * @aliases field-create + * @hidden + * @obsolete + */ + public function field() + { + } + + /** + * core:execute has been deprecated. Please try `site:ssh` command. + * + * @command core:execute + * @aliases core-execute + * @hidden + * @obsolete + */ + public function execute() + { + } +} diff --git a/vendor/drush/drush/src/Commands/OptionsCommands.php b/vendor/drush/drush/src/Commands/OptionsCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..707cb89cdc4bff2f603a391d6a847d76253385c5 --- /dev/null +++ b/vendor/drush/drush/src/Commands/OptionsCommands.php @@ -0,0 +1,68 @@ +<?php +namespace Drush\Commands; + +/* + * Common options providers. Use them by adding an annotation to your method. + */ +use Symfony\Component\Console\Input\InputOption; + +class OptionsCommands +{ + + const REQ=InputOption::VALUE_REQUIRED; + + /** + * @hook option @optionset_proc_build + * @option ssh-options A string of extra options that will be passed to the ssh command (e.g. "-p 100") + * @option tty Create a tty (e.g. to run an interactive program). + */ + public function optionsetProcBuild($options = ['ssh-options' => self::REQ, 'tty' => false]) + { + } + + /** + * @hook option @optionset_get_editor + * @option editor A string of bash which launches user's preferred text editor. Defaults to ${VISUAL-${EDITOR-vi}}. + * @option bg Run editor in the background. Does not work with editors such as `vi` that run in the terminal. + */ + public function optionsetGetEditor($options = ['editor' => '', 'bg' => false]) + { + } + + /** + * @hook option @optionset_ssh + * @option ssh-options A string appended to ssh command during rsync, sql-sync, etc. + */ + public function optionsetSsh($options = ['ssh-options' => self::REQ]) + { + } + + /** + * @hook option @optionset_sql + * @option database The DB connection key if using multiple connections in settings.php. + * @option db-url A Drupal 6 style database URL. + * @option target The name of a target within the specified database connection. Defaults to default + */ + public function optionsetSql($options = ['database' => 'default', 'target' => 'default', 'db-url' => self::REQ]) + { + } + + /** + * @hook option @optionset_table_selection + * @option skip-tables-key A key in the $skip_tables array. @see example.drush.yml + * @option structure-tables-key A key in the $structure_tables array. @see example.drush.yml + * @option tables-key A key in the $tables array. + * @option skip-tables-list A comma-separated list of tables to exclude completely. + * @option structure-tables-list A comma-separated list of tables to include for structure, but not data. + * @option tables-list A comma-separated list of tables to transfer. + */ + public function optionsetTableSelection($options = [ + 'skip-tables-key' => self::REQ, + 'structure-tables-key' => self::REQ, + 'tables-key' => self::REQ, + 'skip-tables-list' => self::REQ, + 'structure-tables-list' => self::REQ, + 'tables-list' => self::REQ]) + { + } +} diff --git a/vendor/drush/drush/src/Commands/ValidatorsCommands.php b/vendor/drush/drush/src/Commands/ValidatorsCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..6fef9e227f4e676a4d148e58ae631f8124f3959d --- /dev/null +++ b/vendor/drush/drush/src/Commands/ValidatorsCommands.php @@ -0,0 +1,136 @@ +<?php +namespace Drush\Commands; + +use Consolidation\AnnotatedCommand\AnnotationData; +use Consolidation\AnnotatedCommand\CommandError; +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Utils\StringUtils; +use Symfony\Component\Console\Input\Input; + +/* + * Common validation providers. Use them by adding an annotation to your method. + */ +class ValidatorsCommands +{ + + /** + * Validate that passed entity names are valid. + * @see \Drush\Commands\core\ViewsCommands::execute for an example. + * + * @hook validate @validate-entity-load + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @return \Consolidation\AnnotatedCommand\CommandError|null + */ + public function validateEntityLoad(CommandData $commandData) + { + list($entity_type, $arg_name) = explode(' ', $commandData->annotationData()->get('validate-entity-load', null)); + $names = StringUtils::csvToArray($commandData->input()->getArgument($arg_name)); + $loaded = \Drupal::entityTypeManager()->getStorage($entity_type)->loadMultiple($names); + if ($missing = array_diff($names, array_keys($loaded))) { + $msg = dt('Unable to load the !type: !str', ['!type' => $entity_type, '!str' => implode(', ', $missing)]); + return new CommandError($msg); + } + } + + /** + * Validate that passed module names are enabled. We use pre-init phase because interact() methods run early and they + * need to know that their module is enabled (e.g. image-flush). + * + * @see \Drush\Commands\core\WatchdogCommands::show for an example. + * + * @hook pre-init @validate-module-enabled + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @return \Consolidation\AnnotatedCommand\CommandError|null + */ + public function validateModuleEnabled(Input $input, AnnotationData $annotationData) + { + $names = StringUtils::csvToArray($annotationData->get('validate-module-enabled')); + $loaded = \Drupal::moduleHandler()->getModuleList(); + if ($missing = array_diff($names, array_keys($loaded))) { + $msg = dt('Missing module: !str', ['!str' => implode(', ', $missing)]); + throw new \Exception($msg); + } + } + + /** + * Validate that the file path exists. + * + * Annotation value should be the name of the argument containing the path. + * + * @hook validate @validate-file-exists + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @return \Consolidation\AnnotatedCommand\CommandError|null + */ + public function validateFileExists(CommandData $commandData) + { + $missing = []; + $arg_names = _convert_csv_to_array($commandData->annotationData()->get('validate-file-exists', null)); + foreach ($arg_names as $arg_name) { + if ($commandData->input()->hasArgument($arg_name)) { + $path = $commandData->input()->getArgument($arg_name); + } elseif ($commandData->input()->hasOption($arg_name)) { + $path = $commandData->input()->getOption($arg_name); + } + if (!empty($path) && !file_exists($path)) { + $missing[] = $path; + } + unset($path); + } + + if ($missing) { + $msg = dt('File(s) not found: !paths', ['!paths' => implode(', ', $missing)]); + return new CommandError($msg); + } + } + + /** + * Validate that required PHP extension exists. + * + * Annotation value should be extension name. If multiple, delimit by a comma. + * + * @hook validate @validate-php-extension + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @return \Consolidation\AnnotatedCommand\CommandError|null + */ + public function validatePHPExtension(CommandData $commandData) + { + $missing = []; + $arg_names = _convert_csv_to_array($commandData->annotationData()->get('validate-php-extension', null)); + foreach ($arg_names as $arg_name) { + if (!extension_loaded($arg_name)) { + $missing[] = $arg_name; + } + } + + if ($missing) { + $args = ['!command' => $commandData->input(), '!dependencies' => implode(', ', $missing)]; + return new CommandError(dt('Command !command needs the following PHP extensions installed and enabled: !dependencies.', $args)); + } + } + + /** + * Validate that the permission exists. + * + * Annotation value should be the name of the argument/option containing the permission(s). + * + * @hook validate @validate-permissions + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @return \Consolidation\AnnotatedCommand\CommandError|null + */ + public function validatePermissions(CommandData $commandData) + { + $missing = []; + $arg_or_option_name = $commandData->annotationData()->get('validate-permissions', null); + if ($commandData->input()->hasArgument($arg_or_option_name)) { + $permissions = StringUtils::csvToArray($commandData->input()->getArgument($arg_or_option_name)); + } else { + $permissions = StringUtils::csvToArray($commandData->input()->getOption($arg_or_option_name)); + } + $all_permissions = array_keys(\Drupal::service('user.permissions')->getPermissions()); + $missing = array_diff($permissions, $all_permissions); + if ($missing) { + $msg = dt('Permission(s) not found: !perms', ['!perms' => implode(', ', $missing)]); + return new CommandError($msg); + } + } +} diff --git a/vendor/drush/drush/src/Commands/config/ConfigPullCommands.php b/vendor/drush/drush/src/Commands/config/ConfigPullCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..74c9f5617c4def4dccaf64b0acd1c553659bda28 --- /dev/null +++ b/vendor/drush/drush/src/Commands/config/ConfigPullCommands.php @@ -0,0 +1,105 @@ +<?php +namespace Drush\Commands\config; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Consolidation\SiteAlias\HostPath; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Consolidation\OutputFormatters\StructuredData\PropertyList; +use Consolidation\SiteProcess\ProcessBase; + +class ConfigPullCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + /** + * Export and transfer config from one environment to another. + * + * @command config:pull + * @param string $source A site-alias or the name of a subdirectory within /sites whose config you want to copy from. + * @param string $destination A site-alias or the name of a subdirectory within /sites whose config you want to replace. + * @param array $options + * @throws \Exception + * @option safe Validate that there are no git uncommitted changes before proceeding + * @option label A config directory label (i.e. a key in \$config_directories array in settings.php). Defaults to 'sync' + * @option runner Where to run the rsync command; defaults to the local site. Can also be 'source' or 'destination' + * @usage drush config:pull @prod @stage + * Export config from @prod and transfer to @stage. + * @usage drush config:pull @prod @self --label=vcs + * Export config from @prod and transfer to the 'vcs' config directory of current site. + * @usage drush config:pull @prod @self:../config/sync + * Export config to a custom directory. Relative paths are calculated from Drupal root. + * @aliases cpull,config-pull + * @topics docs:aliases,docs:config:exporting + * @field-labels + * path: Path + * @return \Consolidation\OutputFormatters\StructuredData\PropertyList + */ + public function pull($source, $destination, $options = ['safe' => false, 'label' => 'sync', 'runner' => null, 'format' => 'null']) + { + $global_options = Drush::redispatchOptions() + ['strict' => 0]; + $sourceRecord = $this->siteAliasManager()->get($source); + + $export_options = [ + // Use the standard backup directory on Destination. + 'destination' => true, + 'yes' => null, + 'format' => 'string', + ]; + $this->logger()->notice(dt('Starting to export configuration on :destination.', [':destination' => $destination])); + $process = $this->processManager()->drush($sourceRecord, 'config-export', [], $export_options + $global_options); + $process->mustRun(); + + if ($this->getConfig()->simulate()) { + $export_path = '/simulated/path'; + } elseif (empty(trim($process->getOutput()))) { + throw new \Exception(dt('The Drush config:export command did not report the path to the export directory.')); + } else { + // Trailing slash ensures that we transfer files and not the containing dir. + $export_path = trim($process->getOutput()) . '/'; + } + + if (strpos($destination, ':') === false) { + $destination .= ':%config-' . $options['label']; + } + $destinationHostPath = HostPath::create($this->siteAliasManager(), $destination); + + if (!$runner = $options['runner']) { + $destinationRecord = $destinationHostPath->getSiteAlias(); + $runner = $sourceRecord->isRemote() && $destinationRecord->isRemote() ? $destinationRecord : $this->siteAliasManager()->getSelf(); + } + $this->logger() + ->notice(dt('Starting to rsync configuration files from !source to !dest.', [ + '!source' => "$source:$export_path", + '!dest' => $destinationHostPath->getOriginal(), + ])); + $args = ["$source:$export_path", $destinationHostPath->getOriginal()]; + $options_double_dash = [ + 'remove-source-files' => true, + 'delete' => true, + 'exclude' => '.htaccess', + ]; + $process = $this->processManager()->drush($runner, 'core-rsync', $args, ['yes' => true, 'debug' => true], $options_double_dash); + $process->mustRun(); + drush_backend_set_result($destinationHostPath->getOriginal()); + return new PropertyList(['path' => $destinationHostPath->getOriginal()]); + } + + /** + * @hook validate config-pull + */ + public function validateConfigPull(CommandData $commandData) + { + if ($commandData->input()->getOption('safe')) { + $destinationRecord = $this->siteAliasManager()->get($commandData->input()->getArgument('destination')); + $process = $this->processManager()->siteProcess($destinationRecord, ['git', 'diff', '--quiet']); + $process->chdirToSiteRoot(); + $process->run(); + if (!$process->isSuccessful()) { + throw new \Exception('There are uncommitted changes in your git working copy.'); + } + } + } +} diff --git a/vendor/drush/drush/src/Commands/core/BrowseCommands.php b/vendor/drush/drush/src/Commands/core/BrowseCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..eb6bcf72d06ee2ba37df437b567d90267d8c5479 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/BrowseCommands.php @@ -0,0 +1,56 @@ +<?php +namespace Drush\Commands\core; + +use Drupal\Core\Url; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exec\ExecTrait; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; + +class BrowseCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use ExecTrait; + use SiteAliasManagerAwareTrait; + + /** + * Display a link to a given path or open link in a browser. + * + * @command browse + * + * @param string|null $path Path to open. If omitted, the site front page will be opened. + * @param array $options An associative array of options whose values come from cli, aliases, config, etc. + * @option string $browser Specify a particular browser (defaults to operating system default). Use --no-browser to suppress opening a browser. + * @option integer $redirect-port The port that the web server is redirected to (e.g. when running within a Vagrant environment). + * @usage drush browse + * Open default web browser (if configured or detected) to the site front page. + * @usage drush browse node/1 + * Open web browser to the path node/1. + * @usage drush @example.prod + * Open a browser to the web site specified in a site alias. + * @usage drush browse --browser=firefox admin + * Open Firefox web browser to the path 'admin'. + * @handle-remote-commands true + */ + public function browse($path = '', array $options = ['browser' => self::REQ, 'redirect-port' => self::REQ]) + { + $aliasRecord = $this->siteAliasManager()->getSelf(); + // Redispatch if called against a remote-host so a browser is started on the + // the *local* machine. + if ($this->processManager()->hasTransport($aliasRecord)) { + $process = $this->processManager()->drush($aliasRecord, 'browse', [$path], Drush::redispatchOptions()); + $process->mustRun(); + $link = $process->getOutput(); + } else { + if (!Drush::bootstrapManager()->doBootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + // Fail gracefully if unable to bootstrap Drupal. drush_bootstrap() has + // already logged an error. + return false; + } + $link = Url::fromUserInput('/' . $path, ['absolute' => true])->toString(); + } + + $this->startBrowser($link, false, $options['redirect-port']); + return $link; + } +} diff --git a/vendor/drush/drush/src/Commands/core/CacheCommands.php b/vendor/drush/drush/src/Commands/core/CacheCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..e66adf7d8e26ba5154f6470348ab626ad36fa766 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/CacheCommands.php @@ -0,0 +1,339 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\AnnotatedCommand\Events\CustomEventAwareInterface; +use Consolidation\AnnotatedCommand\Events\CustomEventAwareTrait; +use Consolidation\OutputFormatters\StructuredData\PropertyList; +use Drush\Boot\AutoloaderAwareInterface; +use Drush\Boot\AutoloaderAwareTrait; +use Drush\Commands\DrushCommands; +use Drupal\Core\DrupalKernel; +use Drupal\Core\Site\Settings; +use Drupal\Core\Cache\Cache; +use Drush\Drush; +use Drush\Utils\StringUtils; +use Consolidation\AnnotatedCommand\Input\StdinAwareInterface; +use Consolidation\AnnotatedCommand\Input\StdinAwareTrait; + +/* + * Interact with Drupal's Cache API. + */ +class CacheCommands extends DrushCommands implements CustomEventAwareInterface, AutoloaderAwareInterface, StdinAwareInterface +{ + + use CustomEventAwareTrait; + use AutoloaderAwareTrait; + use StdinAwareTrait; + + /** + * Fetch a cached object and display it. + * + * @command cache:get + * @param $cid The id of the object to fetch. + * @param $bin The cache bin to fetch from. + * @usage drush cache:get hook_info bootstrap + * Display the data for the cache id "hook_info" from the "bootstrap" bin. + * @usage drush cache:get update_available_releases update + * Display the data for the cache id "update_available_releases" from the "update" bin. + * @aliases cg,cache-get + * @bootstrap full + * @field-labels + * cid: Cache ID + * data: Data + * created: Created + * expire: Expire + * tags: Tags + * checksum: Checksum + * valid: Valid + * @default-fields cid,data,created,expire,tags + * @return \Consolidation\OutputFormatters\StructuredData\PropertyList + */ + public function get($cid, $bin = 'default', $options = ['format' => 'json']) + { + $result = \Drupal::cache($bin)->get($cid); + if (empty($result)) { + throw new \Exception(dt('The !cid object in the !bin bin was not found.', ['!cid' => $cid, '!bin' => $bin])); + } + return new PropertyList($result); + } + + /** + * Clear a specific cache, or all Drupal caches. + * + * @command cache:clear + * @param string $type The particular cache to clear. Omit this argument to choose from available types. + * @param array $args Additional arguments as might be expected (e.g. bin name). + * @option cache-clear Set to 0 to suppress normal cache clearing; the caller should then clear if needed. + * @hidden-options cache-clear + * @aliases cc,cache-clear + * @bootstrap max + * @notify Caches have been cleared. + * @usage drush cc bin entity,bootstrap + * Clear the entity and bootstrap cache bins. + */ + public function clear($type, array $args, $options = ['cache-clear' => true]) + { + $boot_manager = Drush::bootstrapManager(); + + if (!$options['cache-clear']) { + $this->logger()->info(dt("Skipping cache-clear operation due to --cache-clear=0 option.")); + return null; + } + + $types = $this->getTypes($boot_manager->hasBootstrapped((DRUSH_BOOTSTRAP_DRUPAL_FULL))); + + // Do it. + drush_op($types[$type], $args); + $this->logger()->success(dt("'!name' cache was cleared.", ['!name' => $type])); + } + + /** + * @hook interact cache-clear + */ + public function interact($input, $output) + { + $boot_manager = Drush::bootstrapManager(); + if (empty($input->getArgument('type'))) { + $types = $this->getTypes($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)); + $choices = array_combine(array_keys($types), array_keys($types)); + $type = $this->io()->choice(dt("Choose a cache to clear"), $choices, 'all'); + $input->setArgument('type', $type); + } + } + + /** + * Cache an object expressed in JSON or var_export() format. + * + * @command cache:set + * @param $cid The id of the object to set. + * @param $data The object to set in the cache. Use - to read the object from STDIN. + * @param $bin The cache bin to store the object in. + * @param $expire 'CACHE_PERMANENT', or a Unix timestamp. + * @param $tags A comma delimited list of cache tags. + * @option input-format The format of value. Use 'json' for complex values. + * @option cache-get If the object is the result a previous fetch from the cache, only store the value in the 'data' property of the object in the cache. + * @aliases cs,cache-set + * @bootstrap full + */ + public function set($cid, $data, $bin = 'default', $expire = null, $tags = null, $options = ['input-format' => 'string', 'cache-get' => false]) + { + $tags = is_string($tags) ? StringUtils::csvToArray($tags) : []; + // In addition to prepare, this also validates. Can't easily be in own validate callback as + // reading once from STDIN empties it. + $data = $this->setPrepareData($data, $options); + + if (!isset($expire) || $expire == 'CACHE_PERMANENT') { + $expire = Cache::PERMANENT; + } + + return \Drupal::cache($bin)->set($cid, $data, $expire, $tags); + } + + protected function setPrepareData($data, $options) + { + if ($data == '-') { + $data = $this->stdin()->contents(); + } + + // Now, we parse the object. + switch ($options['input-format']) { + case 'json': + $data = json_decode($data, true); + if ($data === false) { + throw new \Exception('Unable to parse JSON.'); + } + break; + } + + if ($options['cache-get']) { + // $data might be an object. + if (is_object($data) && $data->data) { + $data = $data->data; + } elseif (is_array($data) && isset($data['data'])) { + // But $data returned from `drush cache-get --format=json` will be an array. + $data = $data['data']; + } else { + // If $data is neither object nor array and cache-get was specified, then + // there is a problem. + throw new \Exception(dt("'cache-get' was specified as an option, but the data is neither an object or an array.")); + } + } + + return $data; + } + + /** + * Rebuild a Drupal 8 site. + * + * This is a copy of core/rebuild.php. Additionally + * it also clears Drush cache and Drupal's render cache. + + * + * @command cache:rebuild + * @option cache-clear Set to 0 to suppress normal cache clearing; the caller should then clear if needed. + * @hidden-options cache-clear + * @aliases cr,rebuild,cache-rebuild + * @bootstrap site + */ + public function rebuild($options = ['cache-clear' => true]) + { + if (!$options['cache-clear']) { + $this->logger()->info(dt("Skipping cache-clear operation due to --no-cache-clear option.")); + return true; + } + chdir(DRUPAL_ROOT); + + // We no longer clear APC and similar caches as they are useless on CLI. + // See https://github.com/drush-ops/drush/pull/2450 + + $autoloader = $this->loadDrupalAutoloader(DRUPAL_ROOT); + require_once DRUSH_DRUPAL_CORE . '/includes/utility.inc'; + + $request = Drush::bootstrap()->getRequest(); + // Manually resemble early bootstrap of DrupalKernel::boot(). + require_once DRUSH_DRUPAL_CORE . '/includes/bootstrap.inc'; + DrupalKernel::bootEnvironment(); + + // Avoid 'Only variables should be passed by reference' + $root = DRUPAL_ROOT; + $site_path = DrupalKernel::findSitePath($request); + Settings::initialize($root, $site_path, $autoloader); + + // drupal_rebuild() calls drupal_flush_all_caches() itself, so we don't do it manually. + drupal_rebuild($autoloader, $request); + $this->logger()->success(dt('Cache rebuild complete.')); + + // As this command replaces `drush cache-clear all` for Drupal 8 users, clear + // the Drush cache as well, for consistency with that behavior. + CacheCommands::clearDrush(); + } + + /** + * @hook validate cache-clear + */ + public function validate(CommandData $commandData) + { + $boot_manager = Drush::bootstrapManager(); + $types = $this->getTypes($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)); + $type = $commandData->input()->getArgument('type'); + // Check if the provided type ($type) is a valid cache type. + if ($type && !array_key_exists($type, $types)) { + if ($type === 'all') { + throw new \Exception(dt('`cache-clear all` is deprecated for Drupal 8 and later. Please use the `cache-rebuild` command instead.')); + } + // If we haven't done a full bootstrap, provide a more + // specific message with instructions to the user on + // bootstrapping a Drupal site for more options. + if (!$boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + $all_types = $this->getTypes(true); + if (array_key_exists($type, $all_types)) { + throw new \Exception(dt("'!type' cache requires a working Drupal site to operate on. Use the --root and --uri options, or a site @alias, or cd to a directory containing a Drupal settings.php file.", ['!type' => $type])); + } else { + throw new \Exception(dt("'!type' cache is not a valid cache type. There may be more cache types available if you select a working Drupal site.", ['!type' => $type])); + } + } + throw new \Exception(dt("'!type' cache is not a valid cache type.", ['!type' => $type])); + } + } + + /** + * Types of caches available for clearing. Contrib commands can hook in their own. + */ + public function getTypes($include_bootstrapped_types = false) + { + $types = [ + 'drush' => [$this, 'clearDrush'], + ]; + if ($include_bootstrapped_types) { + $types += [ + 'theme-registry' => [$this, 'clearThemeRegistry'], + 'router' => [$this, 'clearRouter'], + 'css-js' => [$this, 'clearCssJs'], + 'render' => [$this, 'clearRender'], + 'plugin' => [$this, 'clearPlugin'], + 'bin' => [$this, 'clearBins'], + ]; + } + + // Command files may customize $types as desired. + $handlers = $this->getCustomEventHandlers('cache-clear'); + foreach ($handlers as $handler) { + $handler($types, $include_bootstrapped_types); + } + return $types; + } + + /** + * Clear caches internal to Drush core. + */ + public static function clearDrush() + { + drush_cache_clear_all(null, 'default'); // commandfiles, etc. + drush_cache_clear_all(null, 'factory'); // command info from annotated-command library + } + + /** + * Clear one or more cache bins. + */ + public static function clearBins($args = ['default']) + { + $bins = StringUtils::csvToArray($args); + foreach ($bins as $bin) { + \Drupal::service("cache.$bin")->deleteAll(); + } + } + + public static function clearThemeRegistry() + { + \Drupal::service('theme.registry')->reset(); + } + + public static function clearRouter() + { + /** @var \Drupal\Core\Routing\RouteBuilderInterface $router_builder */ + $router_builder = \Drupal::service('router.builder'); + $router_builder->rebuild(); + } + + public static function clearCssJs() + { + _drupal_flush_css_js(); + \Drupal::service('asset.css.collection_optimizer')->deleteAll(); + \Drupal::service('asset.js.collection_optimizer')->deleteAll(); + } + + /** + * Clears the render cache entries. + */ + public static function clearRender() + { + Cache::invalidateTags(['rendered']); + } + + public static function clearPlugin() + { + \Drupal::getContainer()->get('plugin.cache_clearer')->clearCachedDefinitions(); + } + + /** + * Loads the Drupal autoloader and returns the instance. + */ + public function loadDrupalAutoloader($drupal_root) + { + static $autoloader = false; + + $autoloadFilePath = $drupal_root .'/autoload.php'; + if (!$autoloader && file_exists($autoloadFilePath)) { + $autoloader = require $autoloadFilePath; + } + + if ($autoloader === true) { + // The autoloader was already required. Assume that Drush and Drupal share an autoloader per + // "Point autoload.php to the proper vendor directory" - https://www.drupal.org/node/2404989 + $autoloader = $this->autoloader(); + } + + return $autoloader; + } +} diff --git a/vendor/drush/drush/src/Commands/core/CoreCommands.php b/vendor/drush/drush/src/Commands/core/CoreCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..d32f1f7b948e6b62b7e4a8e854c10772d81f8de8 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/CoreCommands.php @@ -0,0 +1,78 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\PropertyList; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; + +class CoreCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + + use SiteAliasManagerAwareTrait; + + /** + * All global options. + * + * @command core:global-options + * @hidden + * @topic + * @table-style default + * @field-labels + * name: Name + * description: Description + * @default-fields name,description + * @aliases core-global-options + * + * @filter-default-field name + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function globalOptions($options = ['format' => 'table']) + { + $application = Drush::getApplication(); + $def = $application->getDefinition(); + foreach ($def->getOptions() as $key => $value) { + $name = '--'. $key; + if ($value->getShortcut()) { + $name = '-' . $value->getShortcut() . ', ' . $name; + } + $rows[] = [ + 'name' => $name, + 'description' => $value->getDescription(), + ]; + } + + // Also document the keys that are recognized by PreflightArgs. It would be possible to redundantly declare + // those as global options. We don't do that for now, to avoid confusion. + $ancient = drush_get_global_options(); + foreach (['config', 'alias-path', 'include', 'local', 'backend', 'strict', 'ssh-options'] as $name) { + $rows[] = [ + 'name' => '--' . $name, + 'description' => $ancient[$name]['description'], + ]; + } + usort($rows, function ($a, $b) { + return strnatcmp($a['name'], $b['name']); + }); + return new RowsOfFields($rows); + } + + /** + * Show Drush version. + * + * @command version + * @table-style compact + * @list-delimiter : + * @field-labels + * drush-version: Drush version + * + * @return \Consolidation\OutputFormatters\StructuredData\PropertyList + * + */ + public function version($options = ['format' => 'table']) + { + return new PropertyList(['drush-version' => Drush::getVersion()]); + } +} diff --git a/vendor/drush/drush/src/Commands/core/DocsCommands.php b/vendor/drush/drush/src/Commands/core/DocsCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..0a30b705acc3ea42c16902b95b41d33855275978 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/DocsCommands.php @@ -0,0 +1,197 @@ +<?php +namespace Drush\Commands\core; + +use Drush\Commands\DrushCommands; + +/** + * Topic commands. + * Any commandfile may add topics. + * Set 'topic' => TRUE to indicate the command is a topic (REQUIRED) + * Begin the topic name with the name of the commandfile (just like + * any other command). + */ +class DocsCommands extends DrushCommands +{ + /** + * README.md + * + * @command docs:readme + * @aliases docs-readme + * @hidden + * @topic + */ + public function readme() + { + self::printFile(DRUSH_BASE_PATH. '/README.md'); + } + + /** + * Drush's support for Git Bisect. + * + * @command docs:bisect + * @aliases docs-bisect + * @hidden + * @topic + */ + public function bisect() + { + self::printFile(DRUSH_BASE_PATH. '/examples/git-bisect.example.sh'); + } + + /** + * Bashrc customization examples for Drush. + * + * @command docs:bashrc + * @aliases docs-bashrc + * @hidden + * @topic + */ + public function bashrc() + { + self::printFile(DRUSH_BASE_PATH. '/examples/example.bashrc'); + } + + /** + * Configuration overview with examples from example.drush.yml. + * + * @command docs:configuration + * @aliases docs-configuration + * @hidden + * @topic + */ + public function config() + { + self::printFile(DRUSH_BASE_PATH. '/examples/example.drush.yml'); + } + + /** + * Drupal config export instructions, including customizing config by environment. + * + * @command docs:config:exporting + * @aliases docs-config-exporting + * @hidden + * @topic + */ + public function configExport() + { + self::printFile(DRUSH_BASE_PATH. '/docs/config-exporting.md'); + } + + /** + * Output formatters and filters: how to control the output produced by Drush commands + * + * @command docs:output-formats-filters + * @aliases docs:output + * @aliases docs-output + * @hidden + * @topic + */ + public function outputFormatsFilters() + { + self::printFile(DRUSH_BASE_PATH. '/docs/output-formats-filters.md'); + } + + /** + * Creating site aliases for running Drush on remote sites. + * + * @command docs:aliases + * @aliases docs-aliases + * @hidden + * @topic + */ + public function siteAliases() + { + self::printFile(DRUSH_BASE_PATH. '/examples/example.site.yml'); + } + + /** + * Bootstrap explanation: how Drush starts up and prepares the Drupal environment. + * + * @command docs:bootstrap + * @aliases docs-bootstrap + * @hidden + * @topic + */ + public function bootstrap() + { + self::printFile(DRUSH_BASE_PATH. '/docs/bootstrap.md'); + } + + /** + * Crontab instructions for running your Drupal cron tasks via `drush cron`. + * + * @command docs:cron + * @aliases docs-cron + * @hidden + * @topic + */ + public function cron() + { + self::printFile(DRUSH_BASE_PATH. '/docs/cron.md'); + } + + /** + * Instructions on creating your own Drush commands. + * + * @command docs:commands + * @aliases docs-commands + * @hidden + * @topic + */ + public function commands() + { + self::printFile(DRUSH_BASE_PATH. '/docs/commands.md'); + } + + /** + * Instructions on creating your own Drush Generators. + * + * @command docs:generators + * @aliases docs-generators + * @hidden + * @topic + */ + public function generators() + { + self::printFile(DRUSH_BASE_PATH. '/docs/generators.md'); + } + + /** + * Example Drush command file. + * + * @command docs:examplecommand + * @aliases docs-examplecommand + * @hidden + * @topic + */ + public function exampleCommand() + { + self::printFile(DRUSH_BASE_PATH. '/examples/Commands/ArtCommands.php'); + } + + /** + * Extend sql-sync to allow transfer of the sql dump file via http. + * + * @command docs:example-sync-via-http + * @aliases docs-example-sync-via-http + * @hidden + * @topic + */ + public function syncHttp() + { + self::printFile(DRUSH_BASE_PATH. '/examples/Commands/SyncViaHttpCommands.php'); + } + + /** + * Example policy file. + * + * @command docs:policy + * @aliases docs-policy + * @hidden + * @topic + */ + public function policy() + { + self::printFile(DRUSH_BASE_PATH. '/examples/Commands/PolicyCommands.php'); + } +} diff --git a/vendor/drush/drush/src/Commands/core/DrupalDirectoryCommands.php b/vendor/drush/drush/src/Commands/core/DrupalDirectoryCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..3506002e8b308dcc9960023649a3e13c7198081f --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/DrupalDirectoryCommands.php @@ -0,0 +1,83 @@ +<?php +namespace Drush\Commands\core; + +use Drush\Commands\DrushCommands; +use Consolidation\SiteAlias\HostPath; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; + +use Drush\Backend\BackendPathEvaluator; + +class DrupalDirectoryCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + + use SiteAliasManagerAwareTrait; + + /** @var BackendPathEvaluator */ + protected $pathEvaluator; + + public function __construct() + { + $this->pathEvaluator = new BackendPathEvaluator(); + } + + /** + * Return the filesystem path for modules/themes and other key folders. + * + * @command drupal:directory + * @param string $target A module/theme name, or special names like root, files, private, or an alias : path alias string such as @alias:%files. Defaults to root. + * @option component The portion of the evaluated path to return. Defaults to 'path'; 'name' returns the site alias of the target. + * @option local-only Reject any target that specifies a remote site. + * @usage cd `drush dd devel` + * Navigate into the devel module directory + * @usage cd `drush dd` + * Navigate to the root of your Drupal site + * @usage cd `drush dd files` + * Navigate to the files directory. + * @usage drush dd @alias:%files + * Print the path to the files directory on the site @alias. + * @usage edit `drush dd devel`/devel.module + * Open devel module in your editor (customize 'edit' for your editor) + * @aliases dd,drupal-directory + */ + public function drupalDirectory($target = 'root', $options = ['local-only' => false]) + { + $path = $this->getPath($target, $options['local-only']); + + // If getPath() is working right, it will turn + // %blah into the path to the item referred to by the key 'blah'. + // If there is no such key, then no replacement is done. In the + // case of the dd command, we will consider it an error if + // any keys are -not- replaced. + if ($path && (strpos($path, '%') === false)) { + return $path; + } else { + throw new \Exception(dt("Target '{target}' not found.", ['target' => $target])); + } + } + + /** + * Given a target (e.g. @site:%modules), return the evaluated directory path. + * + * @param $target + * The target to evaluate. Can be @site or /path or @site:path + * or @site:%pathalias, etc. (just like rsync parameters) + * @param $local_only + * When true, fail if the site alias is remote. + */ + protected function getPath($target = 'root', $local_only = false) + { + // In the dd command, if the path does not begin with / or % or @ ett., + // then we will assume an implicit "%". + if (preg_match('#^[a-zA-Z0-9_-]*$#', $target)) { + $target = "%$target"; + } + // Set up the evaluated path; fail if --local-only and the site alias is remote + $evaluatedPath = HostPath::create($this->siteAliasManager(), $target); + if ($local_only && $evaluatedPath->isRemote()) { + throw new \Exception(dt('{target} was remote, and --local-only was specified', ['target' => $target])); + } + $this->pathEvaluator->evaluate($evaluatedPath); + return $evaluatedPath->fullyQualifiedPath(); + } +} diff --git a/vendor/drush/drush/src/Commands/core/DrupliconCommands.php b/vendor/drush/drush/src/Commands/core/DrupliconCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..3fdb02af7f5ca81220f235cb9d75c6b567b322bf --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/DrupliconCommands.php @@ -0,0 +1,47 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; + +class DrupliconCommands extends DrushCommands +{ + protected $printed = false; + + /** + * @hook option * + * @option druplicon Shows the druplicon as glorious ASCII art. + */ + public function optionset($options = ['druplicon' => false]) + { + } + + /** + * Print druplicon as post-command output. + * + * @hook post-command * + */ + public function druplicon($result, CommandData $commandData) + { + // If one command does a drush_invoke to another command, + // then this hook will be called multiple times. Only print + // once. (n.b. If drush_invoke_process passes along the + // --druplicon option, then we still get multiple output) + if ($this->printed) { + return; + } + $this->printed = true; + $annotationData = $commandData->annotationData(); + $commandName = $annotationData['command']; + if ($commandData->input()->hasOption('druplicon') && $commandData->input()->getOption('druplicon')) { + $this->logger()->debug(dt('Displaying Druplicon for "!command" command.', ['!command' => $commandName])); + $misc_dir = DRUSH_BASE_PATH . '/misc'; + if ($commandData->input()->getOption('no-ansi')) { + $content = file_get_contents($misc_dir . '/druplicon-no_color.txt'); + } else { + $content = file_get_contents($misc_dir . '/druplicon-color.txt'); + } + $commandData->output()->writeln($content); + } + } +} diff --git a/vendor/drush/drush/src/Commands/core/EditCommands.php b/vendor/drush/drush/src/Commands/core/EditCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..bb3be309529e67dee39e458a5fef04d0188d6dc5 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/EditCommands.php @@ -0,0 +1,164 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\SiteProcess\Util\Escape; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; + +class EditCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + /** + * Edit drushrc, site alias, and Drupal settings.php files. + * + * @command core:edit + * @bootstrap max + * @param $filter A substring for filtering the list of files. Omit this argument to choose from loaded files. + * @optionset_get_editor + * @usage drush core:config + * Pick from a list of config/alias/settings files. Open selected in editor. + * @usage drush --bg core-config + * Return to shell prompt as soon as the editor window opens. + * @usage drush core:config etc + * Edit the global configuration file. + * @usage drush core:config demo.alia + * Edit a particular alias file. + * @usage drush core:config sett + * Edit settings.php for the current Drupal site. + * @usage drush core:config --choice=2 + * Edit the second file in the choice list. + * @aliases conf,config,core-edit + */ + public function edit($filter = null) + { + $all = $this->load(); + + // Apply any filter that was supplied. + if ($filter) { + foreach ($all as $file => $display) { + if (strpos($file, $filter) === false) { + unset($all[$file]); + } + } + } + + $editor = drush_get_editor(); + if (count($all) == 1) { + $filepath = current($all); + } else { + $choice = $this->io()->choice(dt("Choose a file to edit"), $all); + $filepath = $choice; + // We don't yet support launching editor at a start line. + if ($pos = strpos($filepath, ':')) { + $filepath = substr($filepath, 0, $pos); + } + } + + // A bit awkward due to backward compat. + $cmd = sprintf($editor, Escape::shellArg($filepath)); + $process = $this->processManager()->shell($cmd); + $process->setTty(true); + $process->mustRun(); + } + + public function load($headers = true) + { + $php_header = $php = $rcs_header = $rcs = $aliases_header = $aliases = $drupal_header = $drupal = []; + $php = $this->phpIniFiles(); + if (!empty($php)) { + if ($headers) { + $php_header = ['phpini' => '-- PHP ini files --']; + } + } + + $bash = $this->bashFiles(); + if (!empty($bash)) { + if ($headers) { + $bash_header = ['bash' => '-- Bash files --']; + } + } + + if ($rcs = $this->getConfig()->configPaths()) { + // @todo filter out any files that are within Drush. + $rcs = array_combine($rcs, $rcs); + if ($headers) { + $rcs_header = ['drushrc' => '-- Drushrc --']; + } + } + + if ($aliases = $this->siteAliasManager()->listAllFilePaths()) { + sort($aliases); + $aliases = array_combine($aliases, $aliases); + if ($headers) { + $aliases_header = ['aliases' => '-- Aliases --']; + } + } + if ($site_root = Drush::bootstrap()->confPath()) { + $path = realpath($site_root . '/settings.php'); + $drupal[$path] = $path; + if (file_exists($site_root . '/settings.local.php')) { + $path = realpath($site_root . '/settings.local.php'); + $drupal[$path] = $path; + } + $path = realpath(DRUPAL_ROOT . '/.htaccess'); + $drupal[$path] = $path; + if ($headers) { + $drupal_header = ['drupal' => '-- Drupal --']; + } + } + + return array_merge($php_header, $php, $bash_header, $bash, $rcs_header, $rcs, $aliases_header, $aliases, $drupal_header, $drupal); + } + + public static function phpIniFiles() + { + $ini_files = []; + $path = php_ini_loaded_file(); + $ini_files[$path] = $path; + if ($drush_ini = getenv('DRUSH_INI')) { + if (file_exists($drush_ini)) { + $ini_files[$drush_ini] = $drush_ini; + } + } + foreach ([DRUSH_BASE_PATH, '/etc/drush', Drush::config()->user() . '/.drush'] as $ini_dir) { + if (file_exists($ini_dir . "/drush.ini")) { + $path = realpath($ini_dir . "/drush.ini"); + $ini_files[$path] = $path; + } + } + return $ini_files; + } + + public static function bashFiles() + { + $bashFiles = []; + $home = $this->getConfig()->home(); + if ($bashrc = self::findBashrc($home)) { + $bashFiles[$bashrc] = $bashrc; + } + $prompt = $home . '/.drush/drush.prompt.sh'; + if (file_exists($prompt)) { + $bashFiles[$prompt] = $prompt; + } + return $bashFiles; + } + + /** + * Determine which .bashrc file is best to use on this platform. + * + * TODO: Also exists as InitCommands::findBashrc. Decide on class-based + * way to share code like this. + */ + public static function findBashrc($home) + { + return $home . "/.bashrc"; + } + + public function complete() + { + return ['values' => $this->load(false)]; + } +} diff --git a/vendor/drush/drush/src/Commands/core/InitCommands.php b/vendor/drush/drush/src/Commands/core/InitCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..e617ea6122d7d5bd23fcd5c5ca1fd783b1b03f82 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/InitCommands.php @@ -0,0 +1,191 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\SiteProcess\Util\Escape; +use Drush\Drush; +use Drush\Commands\DrushCommands; +use Drush\Exceptions\UserAbortException; +use Drush\Exec\ExecTrait; +use Drush\Log\LogLevel; +use Robo\LoadAllTasks; +use Robo\Contract\IOAwareInterface; +use Robo\Contract\BuilderAwareInterface; + +class InitCommands extends DrushCommands implements BuilderAwareInterface, IOAwareInterface +{ + use LoadAllTasks; + use ExecTrait; + + /** + * Enrich the bash startup file with bash aliases and a smart command prompt. + * + * @command core:init + * + * @option $edit Open the new config file in an editor. + * @option $add-path Always add Drush to the $PATH in the user's .bashrc + * file, even if it is already in the $PATH. Use --no-add-path to skip + * updating .bashrc with the Drush $PATH. Default is to update .bashrc + * only if Drush is not already in the $PATH. + * @optionset_get_editor + * @aliases init,core-init + * @usage core-init --edit + * Enrich Bash and open drush config file in editor. + * @usage core-init --edit --bg + * Return to shell prompt as soon as the editor window opens + */ + public function initializeDrush($options = ['edit' => false, 'add-path' => '']) + { + $home = $this->getConfig()->home(); + $drush_config_dir = $home . "/.drush"; + $drush_config_file = $drush_config_dir . "/drush.yml"; + $drush_bashrc = $drush_config_dir . "/drush.bashrc"; + $drush_prompt = $drush_config_dir . "/drush.prompt.sh"; + $examples_dir = DRUSH_BASE_PATH . "/examples"; + $example_configuration = $examples_dir . "/example.drush.yml"; + $example_bashrc = $examples_dir . "/example.bashrc"; + $example_prompt = $examples_dir . "/example.prompt.sh"; + + /** + * That's right. Robo collections and tasks are usable in Drush. + */ + $collection = $this->collectionBuilder(); + + // Create a ~/.drush directory if it does not yet exist + $collection->taskFilesystemStack()->mkdir($drush_config_dir); + + // If there is no ~/.drush/drush.yml, copy example there. + if (!is_file($drush_config_file)) { + $collection->taskWriteToFile($drush_config_file)->textFromFile($example_configuration); + $collection->progressMessage('Copied example.drush.yml to {path}', ['path' => $drush_config_file], LogLevel::OK); + $this->logger()->notice('Copied drush.yml to ' . $drush_config_file); + } else { + $this->logger()->debug($drush_config_file . ' already exists. Skip copy.'); + } + + // Decide whether we want to add our Bash commands to + // ~/.bashrc or ~/.bash_profile, and create a task to + // update it with includes of the various files we write, + // as needed. If it is, then we will add it to the collection. + $bashrc = $this->findBashrc($home); + $taskUpdateBashrc = $this->taskWriteToFile($bashrc)->append(); + + // List of Drush bash configuration files, and + // their source templates. + $drushBashFiles = [ + $drush_bashrc => $example_bashrc, + $drush_prompt => $example_prompt, + ]; + + // Mapping from Drush bash configuration files + // to a description of what each one is. + $drushBashFileDescriptions = [ + $drush_bashrc => 'Drush bash customizations', + $drush_prompt => 'Drush prompt customizations', + ]; + + foreach ($drushBashFiles as $destFile => $sourceFile) { + // If the destination file does not exist, then + // copy the example file there. + if (!is_file($destFile)) { + $collection->taskWriteToFile($destFile)->textFromFile($sourceFile); + $description = $drushBashFileDescriptions[$destFile]; + $collection->progressMessage('Copied {description} to {path}', ['description' => $description, 'path' => $destFile], LogLevel::OK); + $pattern = basename($destFile); + $taskUpdateBashrc->appendUnlessMatches("#$pattern#", "\n# Include $description.". $this->bashAddition($destFile)); + } + } + + // If Drush is not in the $PATH, then figure out which + // path to add so that Drush can be found globally. + $add_path = $options['add-path']; + if ((!self::programExists('drush') || $add_path) && ($add_path !== false)) { + $drush_path = $this->findPathToDrush(); + $drush_path = preg_replace("%^" . preg_quote($home) . "/%", '$HOME/', $drush_path); + $pattern = "$drush_path"; + $taskUpdateBashrc->appendUnlessMatches("#$pattern#", "\n# Path to Drush, added by 'drush init'.\nexport PATH=\"\$PATH:$drush_path\"\n\n"); + } + + $openEditor = false; + if ($taskUpdateBashrc->wouldChange()) { + if ($this->io()->confirm(dt("Modify !file to include Drush configuration files?", ['!file' => $bashrc]))) { + $collection->addTask($taskUpdateBashrc); + $collection->progressMessage('Updated bash configuration file {path}', ['path' => $bashrc], LogLevel::OK); + $collection->progressMessage('Start a new shell in order to experience the improvements (e.g. `{shell}`).', ['shell' => 'bash'], LogLevel::OK); + $openEditor = $options['edit']; + } else { + throw new UserAbortException(); + } + } else { + $collection->progressMessage('No code added to {path}', ['path' => $bashrc]); + } + $result = $collection->run(); + + if ($result->wasSuccessful() && $openEditor) { + $editor = drush_get_editor(); + // A bit awkward due to backward compat. + $cmd = sprintf($editor, Escape::shellArg($drush_config_file)); + $process = $this->processManager()->shell($cmd); + $process->setTty(true); + $process->mustRun(); + } + + return $result; + } + + /** + * Determine which .bashrc file is best to use on this platform. + */ + protected function findBashrc($home) + { + # Set a default value in case nothing else exists. + $file = $home . '/.bashrc'; + + if (!empty($_ENV['SHELL']) && strstr($_ENV['SHELL'], 'zsh')) { + $file = $home . '/.zshrc'; + } elseif (file_exists($home . '/.bash_profile')) { + $file = $home . '/.bash_profile'; + } elseif (file_exists($home . '/.bashrc')) { + $file = $home . '/.bashrc'; + } elseif (file_exists($home . '/.profile')) { + $file = $home . '/.profile'; + } elseif (file_exists($home . '/.functions')) { + $file = $home . '/.functions'; + } + + return $file; + } + + /** + * Determine where Drush is located, so that we can add + * that location to the $PATH. + */ + protected function findPathToDrush() + { + // First test: is Drush inside a vendor directory? + // Does vendor/bin exist? If so, use that. We do + // not have a good way to locate the 'bin' directory + // if it has been relocated in the composer.json config + // section. + if ($vendor_pos = strpos(DRUSH_BASE_PATH, "/vendor/")) { + $vendor_dir = substr(DRUSH_BASE_PATH, 0, $vendor_pos + 7); + $vendor_bin = $vendor_dir . '/bin'; + if (is_dir($vendor_bin)) { + return $vendor_bin; + } + } + + // Fallback is to use the directory that Drush is in. + return DRUSH_BASE_PATH; + } + + protected function bashAddition($file) + { + return <<<EOD + +if [ -f "$file" ] ; then + source $file +fi + +EOD; + } +} diff --git a/vendor/drush/drush/src/Commands/core/LoginCommands.php b/vendor/drush/drush/src/Commands/core/LoginCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..98c7840d68d78a4292d26ae1fae5a859e59651d7 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/LoginCommands.php @@ -0,0 +1,85 @@ +<?php +namespace Drush\Commands\core; + +use Drupal\user\Entity\User; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exec\ExecTrait; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; + +class LoginCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + + use SiteAliasManagerAwareTrait; + use ExecTrait; + + /** + * Display a one time login link for user ID 1, or another user. + * + * @command user:login + * + * @param string $path Optional path to redirect to after logging in. + * @option name A user name to log in as. + * @option uid A uid to log in as. + * @option mail A user mail address to log in as. + * @option browser Optional value denotes which browser to use (defaults to operating system default). Use --no-browser to suppress opening a browser. + * @option redirect-port A custom port for redirecting to (e.g., when running within a Vagrant environment) + * @bootstrap none + * @handle-remote-commands + * @aliases uli,user-login + * @usage drush user:login + * Open default web browser and browse to homepage, logged in as uid=1. + * @usage drush user:login --name=ryan node/add/blog + * Open default web browser (if configured or detected) for a one-time login link for username ryan that redirects to node/add/blog. + * @usage drush user:login --uid=123 + * Open default web browser and login as user with uid "123". + * @usage drush user:login --mail=foo@bar.com + * Open default web browser and login as user with mail "foo@bar.com". + * @usage drush user:login --browser=firefox --name=$(drush user:information --mail="drush@example.org" --fields=name --format=string) + * Open firefox web browser, and login as the user with the e-mail address drush@example.org. + */ + public function login($path = '', $options = ['name' => null, 'uid' => null, 'mail' => null, 'browser' => true, 'redirect-port' => self::REQ]) + { + + // Redispatch if called against a remote-host so a browser is started on the + // the *local* machine. + $aliasRecord = $this->siteAliasManager()->getSelf(); + if ($this->processManager()->hasTransport($aliasRecord)) { + $process = $this->processManager()->drush($aliasRecord, 'user-login', [$path], Drush::redispatchOptions()); + $process->mustRun(); + $link = $process->getOutput(); + } else { + if (!Drush::bootstrapManager()->doBootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + throw new \Exception(dt('Unable to bootstrap Drupal.')); + } + + $account = null; + if (!is_null($options['name']) && !$account = user_load_by_name($options['name'])) { + throw new \Exception(dt('Unable to load user by name: !name', ['!name' => $options['name']])); + } + + if (!is_null($options['uid']) && !$account = User::load($options['uid'])) { + throw new \Exception(dt('Unable to load user by uid: !uid', ['!uid' => $options['uid']])); + } + + if (!is_null($options['mail']) && !$account = user_load_by_mail($options['mail'])) { + throw new \Exception(dt('Unable to load user by mail: !mail', ['!mail' => $options['mail']])); + } + + if (empty($account)) { + $account = User::load(1); + } + + $link = user_pass_reset_url($account). '/login'; + if ($path) { + $link .= '?destination=' . $path; + } + } + $port = $options['redirect-port']; + $this->startBrowser($link, false, $port, $options['browser']); + // Use an array for backwards compat. Going forward, please expect a string. + drush_backend_set_result([$link]); + return $link; + } +} diff --git a/vendor/drush/drush/src/Commands/core/NotifyCommands.php b/vendor/drush/drush/src/Commands/core/NotifyCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..9cdcc728fb6e08c47110943540e3673fe5ff21fe --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/NotifyCommands.php @@ -0,0 +1,115 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\SiteProcess\Util\Escape; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Webmozart\PathUtil\Path; + +class NotifyCommands extends DrushCommands +{ + /** + * @hook option * + * @option notify Notify upon command completion. If set to a number, commands that finish in fewer seconds won't notify. + */ + public function optionsetNotify() + { + } + + /** + * @hook pre-command * + */ + public function registerShutdown(CommandData $commandData) + { + register_shutdown_function([$this, 'shutdown'], $commandData); + } + + public function shutdown(CommandData $commandData) + { + + $annotationData = $commandData->annotationData(); + if (!$cmd = $annotationData['command']) { + return; + } + + if ($this->getConfig()->get('notify.duration')) { + if (self::isAllowed()) { + $msg = dt("Command '!command' completed.", ['!command' => $cmd]); + self::shutdownSend($msg, $commandData); + } + } + } + + /** + * Prepares and dispatches notifications to delivery mechanisms. + * + * You may avoid routing a message to secondary messaging mechanisms (e.g. audio), + * by direct use of the delivery functions. + * + * @param string $msg + * Message to send via notification. + */ + public static function shutdownSend($msg, CommandData $commandData) + { + self::shutdownSendText($msg, $commandData); + } + + /** + * Send text-based system notification. + * + * This is the automatic, default behavior. It is intended for use with tools + * such as libnotify in Linux and Notification Center on OSX. + * + * @param string $msg + * Message text for delivery. + * + * @return bool + * TRUE on success, FALSE on failure + */ + public static function shutdownSendText($msg, CommandData $commandData) + { + $override = Drush::config()->get('notify.cmd'); + + if (!empty($override)) { + $cmd = $override; + } else { + switch (PHP_OS) { + case 'Darwin': + $cmd = 'terminal-notifier -message %s -title Drush'; + $error_message = dt('terminal-notifier command failed. Please install it from https://github.com/alloy/terminal-notifier.'); + break; + case 'Linux': + default: + $icon = Path::join(DRUSH_BASE_PATH, 'drush_logo-black.png'); + $cmd = "notify-send %s -i $icon"; + $error_message = dt('notify-send command failed. Please install it as per http://coderstalk.blogspot.com/2010/02/how-to-install-notify-send-in-ubuntu.html.'); + break; + } + } + + // Keep backward compat and prepare a string here. + $cmd = sprintf($cmd, Escape::shellArg($msg)); + $process = Drush::shell($cmd); + $process->run(); + if (!$process->isSuccessful()) { + Drush::logger()->warning($error_message); + } + + return true; + } + + /** + * Identify if the given Drush request should trigger a notification. + * + * @return bool + */ + public static function isAllowed() + { + $duration = Drush::config()->get('notify.duration'); + $execution = time() - $_SERVER['REQUEST_TIME']; + + return ($duration === true || + (is_numeric($duration) && $duration > 0 && $execution > $duration)); + } +} diff --git a/vendor/drush/drush/src/Commands/core/PhpCommands.php b/vendor/drush/drush/src/Commands/core/PhpCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..5ae95dfcddcbbb43b0f8acbec0a141f10b2fa883 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/PhpCommands.php @@ -0,0 +1,120 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\AnnotatedCommand\Input\StdinAwareInterface; +use Consolidation\AnnotatedCommand\Input\StdinAwareTrait; +use Drush\Commands\DrushCommands; +use Symfony\Component\Finder\Finder; + +class PhpCommands extends DrushCommands implements StdinAwareInterface +{ + use StdinAwareTrait; + + /** + * Evaluate arbitrary php code after bootstrapping Drupal (if available). + * + * @command php:eval + * @param $code PHP code + * @usage drush php:eval 'variable_set("hello", "world");' + * Sets the hello variable using Drupal API.' + * @usage drush php:eval '$node = node_load(1); print $node->title;' + * Loads node with nid 1 and then prints its title. + * @usage drush php:eval "file_unmanaged_copy(\'$HOME/Pictures/image.jpg\', \'public://image.jpg\');" + * Copies a file whose path is determined by an environment\'s variable. Note the use of double quotes so the variable $HOME gets replaced by its value. + * @usage drush php:eval "node_access_rebuild();" + * Rebuild node access permissions. + * @aliases eval,ev,php-eval + * @bootstrap max + */ + public function evaluate($code, $options = ['format' => 'var_export']) + { + return eval($code . ';'); + } + + /** + * Run php a script after a full Drupal bootstrap. + * + * A useful alternative to eval command when your php is lengthy or you + * can't be bothered to figure out bash quoting. If you plan to share a + * script with others, consider making a full Drush command instead, since + * that's more self-documenting. Drush provides commandline options to the + * script via a variable called $extra. + * + * @command php:script + * @option script-path Additional paths to search for scripts, separated by + * : (Unix-based systems) or ; (Windows). + * @usage drush php:script example --script-path=/path/to/scripts:/another/path + * Run a script named example.php from specified paths + * @usage drush php:script - + * Run PHP code from standard input. + * @usage drush php:script + * List all available scripts. + * @usage drush php:script foo -- apple --cider + * Run foo.php script with argument 'apple' and option 'cider'. Note the + * -- separator. + * @aliases scr,php-script + * @bootstrap max + * @throws \Exception + */ + public function script(array $extra, $options = ['format' => 'var_export', 'script-path' => self::REQ]) + { + $found = false; + $script = array_shift($extra); + + if ($script == '-') { + return eval($this->stdin()->contents()); + } elseif (file_exists($script)) { + $found = $script; + } else { + // Array of paths to search for scripts + $searchpath['cwd'] = $this->getConfig()->cwd(); + + // Additional script paths, specified by 'script-path' option + if ($script_path = $options['script-path']) { + foreach (explode(PATH_SEPARATOR, $script_path) as $path) { + $searchpath[] = $path; + } + } + $this->logger()->debug(dt('Searching for scripts in ') . implode(',', $searchpath)); + + if (empty($script)) { + $all = []; + // List all available scripts. + $files = Finder::create() + ->files() + ->name('*.php') + ->depth(0) + ->in($searchpath); + foreach ($files as $file) { + $all[] = $file->getRelativePathname(); + } + return implode("\n", $all); + } else { + // Execute the specified script. + foreach ($searchpath as $path) { + $script_filename = $path . '/' . $script; + if (file_exists($script_filename . '.php')) { + $script_filename .= '.php'; + } + if (file_exists($script_filename)) { + $found = $script_filename; + break; + } + $all[] = $script_filename; + } + if (!$found) { + throw new \Exception(dt('Unable to find any of the following: @files', ['@files' => implode(', ', $all)])); + } + } + } + + if ($found) { + $return = include($found); + // 1 just means success so don't return it. + // http://us3.php.net/manual/en/function.include.php#example-120 + if ($return !== 1) { + return $return; + } + } + } +} diff --git a/vendor/drush/drush/src/Commands/core/RsyncCommands.php b/vendor/drush/drush/src/Commands/core/RsyncCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..e7bf12b1b7f24284695fb3555b06c41273d25578 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/RsyncCommands.php @@ -0,0 +1,169 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\SiteProcess\ProcessBase; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exceptions\UserAbortException; +use Consolidation\SiteAlias\HostPath; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Drush\Backend\BackendPathEvaluator; +use Drush\Config\ConfigLocator; +use Symfony\Component\Console\Event\ConsoleCommandEvent; + +class RsyncCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + /** + * These are arguments after the aliases and paths have been evaluated. + * @see validate(). + */ + /** @var HostPath */ + public $sourceEvaluatedPath; + /** @var HostPath */ + public $targetEvaluatedPath; + /** @var BackendPathEvaluator */ + protected $pathEvaluator; + + public function __construct() + { + // TODO: once the BackendInvoke service exists, inject it here + // and use it to get the path evaluator + $this->pathEvaluator = new BackendPathEvaluator(); + } + + /** + * Rsync Drupal code or files to/from another server using ssh. + * + * @command core:rsync + * @param $source A site alias and optional path. See rsync documentation and example.site.yml. + * @param $target A site alias and optional path. See rsync documentation and example.site.yml.', + * @param $extra Additional parameters after the ssh statement. + * @optionset_ssh + * @option exclude-paths List of paths to exclude, seperated by : (Unix-based systems) or ; (Windows). + * @option include-paths List of paths to include, seperated by : (Unix-based systems) or ; (Windows). + * @option mode The unary flags to pass to rsync; --mode=rultz implies rsync -rultz. Default is -akz. + * @usage drush rsync @dev @stage + * Rsync Drupal root from Drush alias dev to the alias stage. + * @usage drush rsync ./ @stage:%files/img + * Rsync all files in the current directory to the 'img' directory in the file storage folder on the Drush alias stage. + * @usage drush rsync @dev @stage -- --exclude=*.sql --delete + * Rsync Drupal root from the Drush alias dev to the alias stage, excluding all .sql files and delete all files on the destination that are no longer on the source. + * @usage drush rsync @dev @stage --ssh-options="-o StrictHostKeyChecking=no" -- --delete + * Customize how rsync connects with remote host via SSH. rsync options like --delete are placed after a --. + * @aliases rsync,core-rsync + * @topics docs:aliases + */ + public function rsync($source, $target, array $extra, $options = ['exclude-paths' => self::REQ, 'include-paths' => self::REQ, 'mode' => 'akz']) + { + // Prompt for confirmation. This is destructive. + if (!$this->getConfig()->simulate()) { + $replacements = ['!source' => $this->sourceEvaluatedPath->fullyQualifiedPathPreservingTrailingSlash(), '!target' => $this->targetEvaluatedPath->fullyQualifiedPath()]; + if (!$this->io()->confirm(dt("Replace files in !target with !source?", $replacements))) { + throw new UserAbortException(); + } + } + + $rsync_options = $this->rsyncOptions($options); + $parameters = array_merge([$rsync_options], $extra); + $parameters[] = $this->sourceEvaluatedPath->fullyQualifiedPathPreservingTrailingSlash(); + $parameters[] = $this->targetEvaluatedPath->fullyQualifiedPath(); + + $ssh_options = $this->getConfig()->get('ssh.options', ''); + $exec = "rsync -e 'ssh $ssh_options'". ' '. implode(' ', array_filter($parameters)); + $process = $this->processManager()->shell($exec); + $process->run($process->showRealtime()); + + if ($process->isSuccessful()) { + drush_backend_set_result($this->targetEvaluatedPath->fullyQualifiedPath()); + } else { + throw new \Exception(dt("Could not rsync from !source to !dest", ['!source' => $this->sourceEvaluatedPath->fullyQualifiedPathPreservingTrailingSlash(), '!dest' => $this->targetEvaluatedPath->fullyQualifiedPath()])); + } + } + + public function rsyncOptions($options) + { + $verbose = $paths = ''; + // Process --include-paths and --exclude-paths options the same way + foreach (['include', 'exclude'] as $include_exclude) { + // Get the option --include-paths or --exclude-paths and explode to an array of paths + // that we will translate into an --include or --exclude option to pass to rsync + $inc_ex_path = explode(PATH_SEPARATOR, @$options[$include_exclude . '-paths']); + foreach ($inc_ex_path as $one_path_to_inc_ex) { + if (!empty($one_path_to_inc_ex)) { + $paths .= ' --' . $include_exclude . '="' . $one_path_to_inc_ex . '"'; + } + } + } + + $mode = '-'. $options['mode']; + if ($this->output()->isVerbose()) { + $mode .= 'v'; + $verbose = ' --stats --progress'; + } + + return implode(' ', array_filter([$mode, $verbose, $paths])); + } + + /** + * Evaluate the path aliases in the source and destination + * parameters. We do this in the pre-command-event so that + * we can set up the configuration object to include options + * from the source and target aliases, if any, so that these + * values may participate in configuration injection. + * + * @hook command-event core:rsync + * @param ConsoleCommandEvent $event + * @throws \Exception + * @return void + */ + public function preCommandEvent(ConsoleCommandEvent $event) + { + $input = $event->getInput(); + $this->sourceEvaluatedPath = $this->injectAliasPathParameterOptions($input, 'source'); + $this->targetEvaluatedPath = $this->injectAliasPathParameterOptions($input, 'target'); + } + + protected function injectAliasPathParameterOptions($input, $parameterName) + { + // The Drush configuration object is a ConfigOverlay; fetch the alias + // context, that already has the options et. al. from the + // site-selection alias ('drush @site rsync ...'), @self. + $aliasConfigContext = $this->getConfig()->getContext(ConfigLocator::ALIAS_CONTEXT); + $manager = $this->siteAliasManager(); + + $aliasName = $input->getArgument($parameterName); + $evaluatedPath = HostPath::create($manager, $aliasName); + $this->pathEvaluator->evaluate($evaluatedPath); + + $aliasRecord = $evaluatedPath->getSiteAlias(); + + // If the path is remote, then we will also inject the global + // options into the alias config context so that we pick up + // things like ssh-options. + if ($aliasRecord->isRemote()) { + $aliasConfigContext->combine($aliasRecord->export()); + } + + return $evaluatedPath; + } + + /** + * Validate that passed aliases are valid. + * + * @hook validate core-rsync + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @throws \Exception + * @return void + */ + public function validate(CommandData $commandData) + { + if ($this->sourceEvaluatedPath->isRemote() && $this->targetEvaluatedPath->isRemote()) { + $msg = dt("Cannot specify two remote aliases. Instead, use one of the following alternate options:\n\n `drush {source} rsync @self {target}`\n `drush {source} rsync @self {fulltarget}\n\nUse the second form if the site alias definitions are not available at {source}.", ['source' => $source, 'target' => $target, 'fulltarget' => $this->targetEvaluatedPath->fullyQualifiedPath()]); + throw new \Exception($msg); + } + } +} diff --git a/vendor/drush/drush/src/Commands/core/RunserverCommands.php b/vendor/drush/drush/src/Commands/core/RunserverCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..1a18958792367e946b180b4e06e36039188b5652 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/RunserverCommands.php @@ -0,0 +1,163 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\SiteProcess\Util\Tty; +use Drush\Drush; +use Drupal\Core\Url; +use Drush\Commands\DrushCommands; +use Drush\Exec\ExecTrait; +use Webmozart\PathUtil\Path; + +class RunserverCommands extends DrushCommands +{ + + use ExecTrait; + + protected $uri; + + /** + * Runs PHP's built-in http server for development. + * + * - Don't use this for production, it is neither scalable nor secure for this use. + * - If you run multiple servers simultaneously, you will need to assign each a unique port. + * - Use Ctrl-C or equivalent to stop the server when complete. + * + * @command runserver + * @param $uri Host IP address and port number to bind to and path to open in web browser. Format is addr:port/path. Only opens a browser if a path is specified. + * @option default-server A default addr:port/path to use for any values not specified as an argument. + * @option browser If opening a web browser, which browser to use (defaults to operating system default). Use --no-browser to avoid opening a browser. + * @option dns Resolve hostnames/IPs using DNS/rDNS (if possible) to determine binding IPs and/or human friendly hostnames for URLs and browser. + * @bootstrap full + * @aliases rs,serve + * @usage drush rs 8080 + * Start a web server on 127.0.0.1, port 8080. + * @usage drush rs 10.0.0.28:80 + * Start runserver on 10.0.0.28, port 80. + * @usage drush rs [::1]:80 + * Start runserver on IPv6 localhost ::1, port 80. + * @usage drush rs --dns localhost:8888/user + * Start runserver on localhost (using rDNS to determine binding IP), port 8888, and open /user in browser. + * @usage drush rs / + * Start runserver on default IP/port (127.0.0.1, port 8888), and open / in browser. + * @usage drush rs --default-server=127.0.0.1:8080/ - + * Use a default (would be specified in your drushrc) that starts runserver on port 8080, and opens a browser to the front page. Set path to a single hyphen path in argument to prevent opening browser for this session. + * @usage drush rs :9000/admin + * Start runserver on 127.0.0.1, port 9000, and open /admin in browser. Note that you need a colon when you specify port and path, but no IP. + * @usage drush --quiet rs + * Silence logging the printing of web requests to the console. + */ + public function runserver($uri = null, $options = ['default-server' => self::REQ, 'browser' => true, 'dns' => false]) + { + // Determine active configuration. + $uri = $this->uri($uri, $options); + if (!$uri) { + return false; + } + + // Remove any leading slashes from the path, since that is what url() expects. + $path = ltrim($uri['path'], '/'); + + // $uri['addr'] is a special field set by runserver_uri() + $hostname = $uri['host']; + $addr = $uri['addr']; + + $this->uri = 'http://' . $hostname . ':' . $uri['port']; + + // We delete any registered files here, since they are not caught by Ctrl-C. + _drush_delete_registered_files(); + + $link = Url::fromUserInput('/' . $path, ['absolute' => true])->toString(); + $this->logger()->notice(dt('HTTP server listening on !addr, port !port (see http://!hostname:!port/!path), serving site, !site', ['!addr' => $addr, '!hostname' => $hostname, '!port' => $uri['port'], '!path' => $path, '!site' => Drush::bootstrap()->confPath()])); + // Start php built-in server. + if (!empty($path)) { + // Start a browser if desired. Include a 2 second delay to allow the server to come up. + $this->startBrowser($link, 2); + } + // Start the server using 'php -S'. + $router = Path::join(DRUSH_BASE_PATH, '/misc/d8-rs-router.php'); + $php = $this->getConfig()->get('php', 'php'); + $process = $this->processManager()->process([$php, '-S', $addr . ':' . $uri['port'], $router]); + $process->setWorkingDirectory(Drush::bootstrapManager()->getRoot()); + $process->setTty(Tty::isTtySupported()); + if ($options['quiet']) { + $process->disableOutput(); + } + $process->mustRun(); + } + + /** + * Determine the URI to use for this server. + */ + public function uri($uri, $options) + { + $drush_default = [ + 'host' => '127.0.0.1', + 'port' => '8888', + 'path' => '', + ]; + $user_default = $this->parseUri($options['default-server']); + $site_default = $this->parseUri($uri); + $uri = $this->parseUri($uri); + if (is_array($uri)) { + // Populate defaults. + $uri = $uri + $user_default + $site_default + $drush_default; + if (ltrim($uri['path'], '/') == '-') { + // Allow a path of a single hyphen to clear a default path. + $uri['path'] = ''; + } + // Determine and set the new URI. + $uri['addr'] = $uri['host']; + if ($options['dns']) { + if (ip2long($uri['host'])) { + $uri['host'] = gethostbyaddr($uri['host']); + } else { + $uri['addr'] = gethostbyname($uri['host']); + } + } + } + return $uri; + } + + /** + * Parse a URI or partial URI (including just a port, host IP or path). + * + * @param string $uri + * String that can contain partial URI. + * + * @return array + * URI array as returned by parse_url. + */ + public function parseUri($uri) + { + if (empty($uri)) { + return []; + } + if ($uri[0] == ':') { + // ':port/path' shorthand, insert a placeholder hostname to allow parsing. + $uri = 'placeholder-hostname' . $uri; + } + // FILTER_VALIDATE_IP expects '[' and ']' to be removed from IPv6 addresses. + // We check for colon from the right, since IPv6 addresses contain colons. + $to_path = trim(substr($uri, 0, strpos($uri, '/')), '[]'); + $to_port = trim(substr($uri, 0, strrpos($uri, ':')), '[]'); + if (filter_var(trim($uri, '[]'), FILTER_VALIDATE_IP) || filter_var($to_path, FILTER_VALIDATE_IP) || filter_var($to_port, FILTER_VALIDATE_IP)) { + // 'IP', 'IP/path' or 'IP:port' shorthand, insert a schema to allow parsing. + $uri = 'http://' . $uri; + } + $uri = parse_url($uri); + if (empty($uri)) { + throw new \Exception(dt('Invalid argument - should be in the "host:port/path" format, numeric (port only) or non-numeric (path only).')); + } + if (count($uri) == 1 && isset($uri['path'])) { + if (is_numeric($uri['path'])) { + // Port only shorthand. + $uri['port'] = $uri['path']; + unset($uri['path']); + } + } + if (isset($uri['host']) && $uri['host'] == 'placeholder-hostname') { + unset($uri['host']); + } + return $uri; + } +} diff --git a/vendor/drush/drush/src/Commands/core/SiteCommands.php b/vendor/drush/drush/src/Commands/core/SiteCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..fd6184f06601ab7b1dcfebd260db919923198b9a --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/SiteCommands.php @@ -0,0 +1,224 @@ +<?php +namespace Drush\Commands\core; + +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\SiteAlias\LegacyAliasConverter; +use Consolidation\SiteAlias\SiteAliasFileDiscovery; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Consolidation\OutputFormatters\StructuredData\UnstructuredListData; +use Drush\Utils\StringUtils; +use Symfony\Component\Console\Input\Input; +use Symfony\Component\Console\Output\Output; +use Webmozart\PathUtil\Path; + +class SiteCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + /** + * Set a site alias that will persist for the current session. + * + * Stores the site alias being used in the current session in a temporary + * file. + * + * @command site:set + * + * @param string $site Site specification to use, or "-" for previous site. Omit this argument to unset. + * + * @throws \Exception + * @handle-remote-commands + * @validate-php-extension posix + * @usage drush site:set @dev + * Set the current session to use the @dev alias. + * @usage drush site:set user@server/path/to/drupal#sitename + * Set the current session to use a remote site via site specification. + * @usage drush site:set /path/to/drupal#sitename + * Set the current session to use a local site via site specification. + * @usage drush site:set - + * Go back to the previously-set site (like `cd -`). + * @usage drush site:set + * Without an argument, any existing site becomes unset. + * @aliases use,site-set + */ + public function siteSet($site = '@none') + { + $filename = $this->getConfig()->get('runtime.site-file-current'); + if ($filename) { + $last_site_filename = $this->getConfig()->get('runtime.site-file-previous'); + if ($site == '-') { + if (file_exists($last_site_filename)) { + $site = file_get_contents($last_site_filename); + } else { + $site = '@none'; + } + } + if ($site == '@self') { + // TODO: Add a method of SiteAliasManager to find a local + // alias by directory / by env.cwd. + // $path = drush_cwd(); + // $site_record = drush_sitealias_lookup_alias_by_path($path, true); + $site_record = []; // This should be returned as an SiteAlias, not an array. + if (isset($site_record['#name'])) { + $site = '@' . $site_record['#name']; // $site_record->name(); + } else { + $site = '@none'; + } + // Using 'site:set @self' is quiet if there is no change. + $current = is_file($filename) ? trim(file_get_contents($filename)) : "@none"; + if ($current == $site) { + return; + } + } + // Alias record lookup exists. + $aliasRecord = $this->siteAliasManager()->get($site); + if ($aliasRecord) { + if (file_exists($filename)) { + @unlink($last_site_filename); + @rename($filename, $last_site_filename); + } + $success_message = dt('Site set to @site', ['@site' => $site]); + if ($site == '@none' || $site == '') { + if (drush_delete_dir($filename)) { + $this->logger()->success(dt('Site unset.')); + } + } elseif (drush_mkdir(dirname($filename), true)) { + if (file_put_contents($filename, $site)) { + $this->logger()->success($success_message); + $this->logger()->info(dt('Site information stored in @file', ['@file' => $filename])); + } + } + } else { + throw new \Exception(dt('Could not find a site definition for @site.', ['@site' => $site])); + } + } + } + + /** + * Show site alias details, or a list of available site aliases. + * + * @command site:alias + * + * @param string $site Site alias or site specification. + * @param array $options + * + * @return \Consolidation\OutputFormatters\StructuredData\UnstructuredListData + * @throws \Exception + * @aliases sa + * @filter-default-field id + * @usage drush site:alias + * List all alias records known to drush. + * @usage drush site:alias @dev + * Print an alias record for the alias 'dev'. + * @topics docs:aliases + * + */ + public function siteAlias($site = null, $options = ['format' => 'yaml']) + { + // First check to see if the user provided a specification that matches + // multiple sites. + $aliasList = $this->siteAliasManager()->getMultiple($site); + if (is_array($aliasList) && !empty($aliasList)) { + return new UnstructuredListData($this->siteAliasExportList($aliasList, $options)); + } + + // Next check for a specific alias or a site specification. + $aliasRecord = $this->siteAliasManager()->get($site); + if ($aliasRecord !== false) { + return new UnstructuredListData([$aliasRecord->name() => $aliasRecord->export()]); + } + + if ($site) { + throw new \Exception('Site alias not found.'); + } else { + $this->logger()->success('No site aliases found.'); + } + } + + /** + * Convert legacy site alias files to the new yml format. + * + * @command site:alias-convert + * @param $destination An absolute path to a directory for writing new alias files.If omitted, user will be prompted. + * @option sources A comma delimited list of paths to search. Overrides the default paths. + * @usage drush site:alias-convert + * Find legacy alias files and convert them to yml. You will be prompted for a destination directory. + * @usage drush site:alias-convert --simulate + * List the files to be converted but do not actually do anything. + * @bootstrap max + * @aliases sa-convert,sac + * @return array + */ + public function siteAliasConvert($destination, $options = ['format' => 'yaml', 'sources' => self::REQ]) + { + /** + * @todo + * - remove checksum system? + */ + $config = $this->getConfig(); + if (!$paths = StringUtils::csvToArray($options['sources'])) { + $paths = [ + $config->get('drush.user-dir'), + $config->get('drush.system-dir'), + ]; + if ($siteRoot = Drush::bootstrapManager()->getRoot()) { + $paths = array_merge($paths, [ dirname($siteRoot) . '/drush', "$siteRoot/drush", "$siteRoot/sites/all/drush" ]); + } + } + + // Configure legacy converter. + $discovery = new SiteAliasFileDiscovery(); + array_map([$discovery, 'addSearchLocation'], $paths); + $discovery->depth('< 9'); + $legacyAliasConverter = new LegacyAliasConverter($discovery); + $legacyAliasConverter->setTargetDir($destination); + $legacyAliasConverter->setSimulate($this->getConfig()->simulate()); + + // Find and convert. + drush_mkdir($destination, true); + $legacyFiles = $discovery->findAllLegacyAliasFiles(); + if ($convertedFiles = $legacyAliasConverter->convert()) { + $args = ['!num' => count($convertedFiles), '!dest' => $destination]; + $message = dt('Created !num file(s) at !dest. Usually, one commits them to /drush/sites in your Composer project.', $args); + $this->logger()->success($message); + } + + $return = [ + 'legacy_files' => $legacyFiles, + 'converted_files' => $convertedFiles, + ]; + return $return; + } + + /** + * @hook interact site:alias-convert + */ + public function interactSiteAliasConvert(Input $input, Output $output) + { + if (!$input->getArgument('destination')) { + $default = Path::join($this->getConfig()->home(), '.drush/sites'); + if ($composerRoot = Drush::bootstrapManager()->getComposerRoot()) { + $default = Path::join($composerRoot, 'drush/sites'); + } + $destination = $this->io()->ask('Absolute path to a directory for writing new alias files', $default); + $input->setArgument('destination', $destination); + } + } + + /** + * @param array $aliasList + * @param $options + * @return array + */ + protected function siteAliasExportList($aliasList, $options) + { + $result = array_map( + function ($aliasRecord) { + return $aliasRecord->export(); + }, + $aliasList + ); + return $result; + } +} diff --git a/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php b/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..3ddc7ce95e4e2b61e0385c9959e66f9bbdbb92f0 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php @@ -0,0 +1,469 @@ +<?php +namespace Drush\Commands\core; + +use Composer\Semver\Comparator; +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\SiteProcess\ProcessBase; +use Drupal\Component\FileCache\FileCacheFactory; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exceptions\UserAbortException; +use Drupal\Core\Config\FileStorage; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Drush\Exec\ExecTrait; +use Drush\Sql\SqlBase; +use Drush\Utils\StringUtils; +use Webmozart\PathUtil\Path; + +class SiteInstallCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + use ExecTrait; + + /** + * Install Drupal along with modules/themes/configuration/profile. + * + * @command site:install + * @param $profile An install profile name. Defaults to 'standard' unless an install profile is marked as a distribution. Additional info for the install profile may also be provided with additional arguments. The key is in the form [form name].[parameter name] + * @option db-url A Drupal 6 style database URL. Required for initial install, not re-install. If omitted and required, Drush prompts for this item. + * @option db-prefix An optional table prefix to use for initial install. + * @option db-su Account to use when creating a new database. Must have Grant permission (mysql only). Optional. + * @option db-su-pw Password for the "db-su" account. Optional. + * @option account-name uid1 name. Defaults to admin + * @option account-pass uid1 pass. Defaults to a randomly generated password. If desired, set a fixed password in config.yml. + * @option account-mail uid1 email. Defaults to admin@example.com + * @option locale A short language code. Sets the default site language. Language files must already be present. + * @option site-name Defaults to Site-Install + * @option site-mail From: for system mailings. Defaults to admin@example.com + * @option sites-subdir Name of directory under 'sites' which should be created. + * @option config-dir Deprecated - only use with Drupal 8.5-. A path pointing to a full set of configuration which should be installed during installation. + * @option existing-config Configuration from "sync" directory should be imported during installation. Use with Drupal 8.6+. + * @usage drush si expert --locale=uk + * (Re)install using the expert install profile. Set default language to Ukrainian. + * @usage drush si --db-url=mysql://root:pass@localhost:port/dbname + * Install using the specified DB params. + * @usage drush si --db-url=sqlite://sites/example.com/files/.ht.sqlite + * Install using SQLite + * @usage drush si --account-pass=mom + * Re-install with specified uid1 password. + * @usage drush si --existing-config + * Install based on the yml files stored in the config export/import directory. + * @usage drush si standard install_configure_form.enable_update_status_emails=NULL + * Disable email notification during install and later. If your server has no mail transfer agent, this gets rid of an error during install. + * @bootstrap root + * @kernel installer + * @aliases si,sin,site-install + * + */ + public function install(array $profile, $options = ['db-url' => self::REQ, 'db-prefix' => self::REQ, 'db-su' => self::REQ, 'db-su-pw' => self::REQ, 'account-name' => 'admin', 'account-mail' => 'admin@example.com', 'site-mail' => 'admin@example.com', 'account-pass' => self::REQ, 'locale' => 'en', 'site-name' => 'Drush Site-Install', 'site-pass' => self::REQ, 'sites-subdir' => self::REQ, 'config-dir' => self::REQ, 'existing-config' => false]) + { + $additional = $profile; + $profile = array_shift($additional) ?: ''; + $form_options = []; + foreach ((array)$additional as $arg) { + list($key, $value) = explode('=', $arg, 2); + + // Allow for numeric and NULL values to be passed in. + if (is_numeric($value)) { + $value = intval($value); + } elseif ($value == 'NULL') { + $value = null; + } + + $form_options[$key] = $value; + } + + $this->serverGlobals(Drush::bootstrapManager()->getUri()); + $class_loader = Drush::service('loader'); + $profile = $this->determineProfile($profile, $options, $class_loader); + + $sql = SqlBase::create($options); + $db_spec = $sql->getDbSpec(); + + $account_pass = $options['account-pass'] ?: StringUtils::generatePassword(); + + // Was giving error during validate() so its here for now. + if ($options['existing-config']) { + $existing_config_dir = config_get_config_directory(CONFIG_SYNC_DIRECTORY); + if (!is_dir($existing_config_dir)) { + throw new \Exception(dt('Existing config directory @dir not found', ['@dir' => $existing_config_dir])); + } + $this->logger()->info(dt('Installing from existing config at @dir', ['@dir' => $existing_config_dir])); + } + + $settings = [ + 'parameters' => [ + 'profile' => $profile, + 'langcode' => $options['locale'], + 'existing_config' => $options['existing-config'], + ], + 'forms' => [ + 'install_settings_form' => [ + 'driver' => $db_spec['driver'], + $db_spec['driver'] => $db_spec, + 'op' => dt('Save and continue'), + ], + 'install_configure_form' => [ + 'site_name' => $options['site-name'], + 'site_mail' => $options['site-mail'], + 'account' => [ + 'name' => $options['account-name'], + 'mail' => $options['account-mail'], + 'pass' => [ + 'pass1' => $account_pass, + 'pass2' => $account_pass, + ], + ], + 'enable_update_status_module' => true, + 'enable_update_status_emails' => true, + 'clean_url' => true, + 'op' => dt('Save and continue'), + ], + ], + 'config_install_path' => $options['config-dir'], + ]; + + // Merge in the additional options. + foreach ($form_options as $key => $value) { + $current = &$settings['forms']; + foreach (explode('.', $key) as $param) { + $current = &$current[$param]; + } + $current = $value; + } + + $msg = 'Starting Drupal installation. This takes a while.'; + $this->logger()->notice(dt($msg)); + + // Define some functions which alter away the install_finished task. + require_once Path::join(DRUSH_BASE_PATH, 'includes/site_install.inc'); + + require_once DRUSH_DRUPAL_CORE . '/includes/install.core.inc'; + // This can lead to an exit() in Drupal. See install_display_output() (e.g. config validation failure). + // @todo Get Drupal to not call that function when on the CLI. + drush_op('install_drupal', $class_loader, $settings); + if (empty($options['account-pass'])) { + $this->logger()->success(dt('Installation complete. User name: @name User password: @pass', ['@name' => $options['account-name'], '@pass' => $account_pass])); + } else { + $this->logger()->success(dt('Installation complete.')); + } + } + + protected function determineProfile($profile, $options, $class_loader) + { + // --config-dir fails with Standard profile and any other one that carries content entities. + // Force to minimal install profile only for drupal < 8.6. + if ($options['config-dir'] && Comparator::lessThan(self::getVersion(), '8.6')) { + $this->logger()->info(dt("Using 'minimal' install profile since --config-dir option was provided.")); + $profile = 'minimal'; + } + + // Try to get profile from existing config if not provided as an argument. + // @todo Arguably Drupal core [$boot->getKernel()->getInstallProfile()] could do this - https://github.com/drupal/drupal/blob/8.6.x/core/lib/Drupal/Core/DrupalKernel.php#L1606 reads from DB storage but not file storage. + if (empty($profile) && $options['existing-config']) { + FileCacheFactory::setConfiguration([FileCacheFactory::DISABLE_CACHE => true]); + $source_storage = new FileStorage(config_get_config_directory(CONFIG_SYNC_DIRECTORY)); + if (!$source_storage->exists('core.extension')) { + throw new \Exception('Existing configuration directory not found or does not contain a core.extension.yml file.".'); + } + $config = $source_storage->read('core.extension'); + $profile = $config['profile']; + } + + if (empty($profile)) { + $boot = Drush::bootstrap(); + $profile = $boot->getKernel()->getInstallProfile(); + } + + if (empty($profile)) { + // If there is an installation profile that acts as a distribution, use it. + // You can turn your installation profile into a distribution by providing a + // @code + // distribution: + // name: 'Distribution name' + // @endcode + // block in the profile's info YAML file. + // See https://www.drupal.org/node/2210443 for more information. + require_once DRUSH_DRUPAL_CORE . '/includes/install.core.inc'; + $install_state = ['interactive' => false] + install_state_defaults(); + try { + install_begin_request($class_loader, $install_state); + $profile = _install_select_profile($install_state); + } catch (\Exception $e) { + // This is only a best effort to provide a better default, no harm done + // if it fails. + } + } + + // Drupal currently requires that non-interactive installs provide a profile. + if (empty($profile)) { + $profile = 'standard'; + } + return $profile; + } + + /** + * Post installation, run the configuration import. + * + * @hook post-command site-install + */ + public function post($result, CommandData $commandData) + { + if ($config = $commandData->input()->getOption('config-dir') && Comparator::lessThan(self::getVersion(), '8.6')) { + // Set the destination site UUID to match the source UUID, to bypass a core fail-safe. + $source_storage = new FileStorage($config); + $options = ['yes' => true]; + $selfRecord = $this->siteAliasManager()->getSelf(); + + $process = $this->processManager()->drush($selfRecord, 'config-set', ['system.site', 'uuid', $source_storage->read('system.site')['uuid']], $options); + $process->mustRun(); + + $process = $this->processManager()->drush($selfRecord, 'config-import', [], ['source' => $config] + $options); + $process->mustRun($process->showRealtime()); + } + } + + /** + * Check to see if there are any .yml files in the provided config directory. + */ + protected function hasConfigFiles($config) + { + $files = glob("$config/*.yml"); + return !empty($files); + } + + /** + * @hook validate site-install + */ + public function validate(CommandData $commandData) + { + if ($sites_subdir = $commandData->input()->getOption('sites-subdir')) { + $lower = strtolower($sites_subdir); + if ($sites_subdir != $lower) { + $this->logger()->warning(dt('Only lowercase sites-subdir are valid. Switching to !lower.', ['!lower' => $lower])); + $commandData->input()->setOption('sites-subdir', $lower); + } + // Make sure that we will bootstrap to the 'sites-subdir' site. + $bootstrapManager = Drush::bootstrapManager(); + $bootstrapManager->setUri('http://' . $sites_subdir); + } + + if ($config = $commandData->input()->getOption('config-dir')) { + $this->validateConfigDir($commandData, $config); + } + + try { + // Get AnnotationData. @todo Find a better way. + $annotationData = Drush::getApplication()->find('site:install')->getAnnotationData(); + Drush::bootstrapManager()->bootstrapMax(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, $annotationData); + $sql = SqlBase::create($commandData->input()->getOptions()); + } catch (\Exception $e) { + // Ask questions to get our data. + // TODO: we should only 'ask' in hook interact, never in hook validate + if ($commandData->input()->getOption('db-url') == '') { + // Prompt for the db-url data if it was not provided via --db-url. + $database = $this->io()->ask('Database name', 'drupal'); + $driver = $this->io()->ask('Database driver', 'mysql'); + $username = $this->io()->ask('Database username', 'drupal'); + $password = $this->io()->ask('Database password', 'drupal'); + $host = $this->io()->ask('Database host', '127.0.0.1'); + $port = $this->io()->ask('Database port', '3306'); + $db_url = "$driver://$username:$password@$host:$port/$database"; + $commandData->input()->setOption('db-url', $db_url); + + try { + $sql = SqlBase::create($commandData->input()->getOptions()); + } catch (\Exception $e) { + throw new \Exception(dt('Could not determine database connection parameters. Pass --db-url option.')); + } + } + } + } + + /** + * Perform setup tasks before installation. + * + * @hook pre-command site-install + */ + public function pre(CommandData $commandData) + { + $sql = SqlBase::create($commandData->input()->getOptions()); + $db_spec = $sql->getDbSpec(); + + // This command is 'bootstrap root', so we should always have a + // Drupal root. If we do not, $aliasRecord->root will throw. + $aliasRecord = $this->siteAliasManager()->getSelf(); + $root = $aliasRecord->root(); + + $dir = $commandData->input()->getOption('sites-subdir'); + if (!$dir) { + // We will allow the 'uri' from the site alias to provide + // a fallback name when '--sites-subdir' is not specified, but + // only if the uri and the folder name match, and only if + // the sites directory has already been created. + $dir = $this->getSitesSubdirFromUri($root, $aliasRecord->get('uri')); + } + + if (!$dir) { + throw new \Exception(dt('Could not determine target sites directory for site to install. Use --sites-subdir to specify.')); + } + + $sites_subdir = Path::join('sites', $dir); + $confPath = $sites_subdir; + $settingsfile = Path::join($confPath, 'settings.php'); + $sitesfile = "sites/sites.php"; + $default = realpath(Path::join($root, 'sites/default')); + $sitesfile_write = realpath($confPath) != $default && !file_exists($sitesfile); + + if (!file_exists($settingsfile)) { + $msg[] = dt('create a @settingsfile file', ['@settingsfile' => $settingsfile]); + } + if ($sitesfile_write) { + $msg[] = dt('create a @sitesfile file', ['@sitesfile' => $sitesfile]); + } + + $program_exists = $this->programExists($sql->command()); + if (!$program_exists) { + $msg[] = dt('Program @program not found. Proceed if you have already created or emptied the Drupal database.', ['@program' => $sql->command()]); + } elseif ($sql->dbExists()) { + $msg[] = dt("DROP all tables in your '@db' database.", ['@db' => $db_spec['database']]); + } else { + $msg[] = dt("CREATE the '@db' database.", ['@db' => $db_spec['database']]); + } + + if (!$this->io()->confirm(dt('You are about to ') . implode(dt(' and '), $msg) . ' Do you want to continue?')) { + throw new UserAbortException(); + } + + // Can't install without sites subdirectory and settings.php. + if (!file_exists($confPath)) { + if (!drush_mkdir($confPath) && !$this->getConfig()->simulate()) { + throw new \Exception(dt('Failed to create directory @confPath', ['@confPath' => $confPath])); + } + } else { + $this->logger()->info(dt('Sites directory @subdir already exists - proceeding.', ['@subdir' => $confPath])); + } + + if (!drush_file_not_empty($settingsfile)) { + if (!drush_op('copy', 'sites/default/default.settings.php', $settingsfile) && !$this->getConfig()->simulate()) { + throw new \Exception(dt('Failed to copy sites/default/default.settings.php to @settingsfile', ['@settingsfile' => $settingsfile])); + } + } + + // Write an empty sites.php if we using multi-site. + if ($sitesfile_write) { + if (!drush_op('copy', 'sites/example.sites.php', $sitesfile) && !$this->getConfig()->simulate()) { + throw new \Exception(dt('Failed to copy sites/example.sites.php to @sitesfile', ['@sitesfile' => $sitesfile])); + } + } + + // We need to be at least at DRUSH_BOOTSTRAP_DRUPAL_SITE to select the site uri to install to + define('MAINTENANCE_MODE', 'install'); + $bootstrapManager = Drush::bootstrapManager(); + $bootstrapManager->doBootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE); + + if ($program_exists && !$sql->dropOrCreate()) { + throw new \Exception(dt('Failed to drop or create the database: @error', ['@error' => $sql->getProcess()->getOutput()])); + } + } + + /** + * Determine an appropriate site subdir name to use for the + * provided uri. + */ + protected function getSitesSubdirFromUri($root, $uri) + { + $dir = strtolower($uri); + // Always accept simple uris (e.g. 'dev', 'stage', etc.) + if (preg_match('#^[a-z0-9_-]*$#', $dir)) { + return $dir; + } + // Strip off the protocol from the provided uri -- however, + // now we will require that the sites subdir already exist. + $dir = preg_replace('#[^/]*/*#', '', $dir); + if ($dir && file_exists(Path::join($root, $dir))) { + return $dir; + } + // Find the dir from sites.php file + $sites_file = $root . '/sites/sites.php'; + if (file_exists($sites_file)) { + include $sites_file; + /** @var array $sites */ + if (array_key_exists($uri, $sites)) { + return $sites[$uri]; + } + } + // Fall back to default directory if it exists. + if (file_exists(Path::join($root, 'sites', 'default'))) { + return 'default'; + } + return false; + } + + public static function getVersion() + { + $drupal_root = Drush::bootstrapManager()->getRoot(); + return Drush::bootstrap()->getVersion($drupal_root); + } + + /** + * Fake the necessary HTTP headers that the Drupal installer still needs: + * @see https://github.com/drupal/drupal/blob/d260101f1ea8a6970df88d2f1899248985c499fc/core/includes/install.core.inc#L287 + */ + public function serverGlobals($drupal_base_url) + { + $drupal_base_url = parse_url($drupal_base_url); + + // Fill in defaults. + $drupal_base_url += [ + 'scheme' => null, + 'path' => '', + 'host' => null, + 'port' => null, + ]; + $_SERVER['HTTP_HOST'] = $drupal_base_url['host']; + + if ($drupal_base_url['scheme'] == 'https') { + $_SERVER['HTTPS'] = 'on'; + } + + if ($drupal_base_url['port']) { + $_SERVER['HTTP_HOST'] .= ':' . $drupal_base_url['port']; + } + $_SERVER['SERVER_PORT'] = $drupal_base_url['port']; + + $_SERVER['REQUEST_URI'] = $drupal_base_url['path'] . '/'; + + $_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'] . 'index.php'; + $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF']; + $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; + $_SERVER['REQUEST_METHOD'] = 'GET'; + + $_SERVER['SERVER_SOFTWARE'] = null; + $_SERVER['HTTP_USER_AGENT'] = null; + $_SERVER['SCRIPT_FILENAME'] = DRUPAL_ROOT . '/index.php'; + } + + /** + * Assure that a config directory exists and is populated. + * + * @param CommandData $commandData + * @param $directory + * @throws \Exception + */ + protected function validateConfigDir(CommandData $commandData, $directory) + { + if (!file_exists($directory)) { + throw new \Exception(dt('The config source directory @config does not exist.', ['@config' => $directory])); + } + if (!is_dir($directory)) { + throw new \Exception(dt('The config source @config is not a directory.', ['@config' => $directory])); + } + // Skip config import with a warning if specified config dir is empty. + if (!$this->hasConfigFiles($directory)) { + $this->logger()->warning(dt('Configuration import directory @config does not contain any configuration; will skip import.', ['@config' => $directory])); + $commandData->input()->setOption('config-dir', ''); + } + } +} diff --git a/vendor/drush/drush/src/Commands/core/SshCommands.php b/vendor/drush/drush/src/Commands/core/SshCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..c7036ab8e3d1af7a104903dfb546f2d6de66e4e5 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/SshCommands.php @@ -0,0 +1,56 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\SiteProcess\Util\Shell; +use Drush\Commands\DrushCommands; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; + +class SshCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + /** + * Connect to a Drupal site's server via SSH. + * + * @command site:ssh + * @option cd Directory to change to. Defaults to Drupal root. + * @optionset_proc_build + * @handle-remote-commands + * @usage drush @mysite ssh + * Open an interactive shell on @mysite's server. + * @usage drush @prod ssh ls /tmp + * Run "ls /tmp" on @prod site. + * @usage drush @prod ssh git pull + * Run "git pull" on the Drupal root directory on the @prod site. + * @aliases ssh,site-ssh + * @topics docs:aliases + */ + public function ssh(array $args, $options = ['cd' => self::REQ, 'tty' => false]) + { + $alias = $this->siteAliasManager()->getSelf(); + if ($alias->isNone()) { + throw new \Exception('A site alias is required. The way you call ssh command has changed to `drush @alias ssh`.'); + } + + if (empty($args)) { + $args[] = 'bash'; + $args[] = '-l'; + + // We're calling an interactive 'bash' shell, so we want to + // force tty to true. + $options['tty'] = true; + } + + if ((count($args) == 1)) { + $args = [Shell::preEscaped($args[0])]; + } + + $process = $this->processManager()->siteProcess($alias, $args); + $process->setTty($options['tty']); + // The transport handles the chdir during processArgs(). + $fallback = $alias->hasRoot() ? $alias->root() : null; + $process->setWorkingDirectory($options['cd'] ?: $fallback); + $process->mustRun($process->showRealtime()); + } +} diff --git a/vendor/drush/drush/src/Commands/core/StatusCommands.php b/vendor/drush/drush/src/Commands/core/StatusCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..becf5f66ad959f43948aaa7487bca25337589ea4 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/StatusCommands.php @@ -0,0 +1,252 @@ +<?php + +namespace Drush\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\PropertyList; +use Drupal\Core\StreamWrapper\PrivateStream; +use Drupal\Core\StreamWrapper\PublicStream; +use Drush\Boot\BootstrapManager; +use Drush\Boot\DrupalBoot; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Sql\SqlBase; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Consolidation\OutputFormatters\Options\FormatterOptions; +use Consolidation\AnnotatedCommand\CommandData; + +class StatusCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + /** + * An overview of the environment - Drush and Drupal. + * + * @command core:status + * @param $filter A field to filter on. @deprecated - use --field option instead. + * @option project A comma delimited list of projects. Their paths will be added to path-aliases section. + * @usage drush core-status --field=files + * Emit just one field, not all the default fields. + * @usage drush core-status --fields=* + * Emit all fields, not just the default ones. + * @aliases status,st,core-status + * @table-style compact + * @list-delimiter : + * @field-labels + * drupal-version: Drupal version + * uri: Site URI + * db-driver: DB driver + * db-hostname: DB hostname + * db-port: DB port + * db-username: DB username + * db-password: DB password + * db-name: DB name + * db-status: Database + * bootstrap: Drupal bootstrap + * theme: Default theme + * admin-theme: Admin theme + * php-bin: PHP binary + * php-conf: PHP config + * php-os: PHP OS + * drush-script: Drush script + * drush-version: Drush version + * drush-temp: Drush temp + * drush-cache-directory: Drush cache folder + * drush-conf: Drush configs + * drush-alias-files: Drush aliases + * alias-searchpaths: Alias search paths + * install-profile: Install profile + * root: Drupal root + * drupal-settings-file: Drupal Settings + * site-path: Site path + * site: Site path + * themes: Themes path + * modules: Modules path + * files: Files, Public + * private: Files, Private + * temp: Files, Temp + * config-sync: Drupal config + * files-path: Files, Public + * temp-path: Files, Temp + * %paths: Other paths + * @default-fields drupal-version,uri,db-driver,db-hostname,db-port,db-username,db-name,db-status,bootstrap,theme,admin-theme,php-bin,php-conf,php-os,drush-script,drush-version,drush-temp,drush-conf,install-profile,root,site,files,private,temp + * @pipe-format json + * @hidden-options project + * @bootstrap max + * @topics docs:readme + * + * @return \Consolidation\OutputFormatters\StructuredData\PropertyList + */ + public function status($filter = '', $options = ['project' => self::REQ, 'format' => 'table']) + { + $data = $this->getPropertyList($options); + + $result = new PropertyList($data); + $result->addRendererFunction([$this, 'renderStatusCell']); + + return $result; + } + + public function getPropertyList($options) + { + $boot_manager = Drush::bootstrapManager(); + $boot_object = Drush::bootstrap(); + if (($drupal_root = $boot_manager->getRoot()) && ($boot_object instanceof DrupalBoot)) { + $status_table['drupal-version'] = $boot_object->getVersion($drupal_root); + $conf_dir = $boot_object->confPath(); + $settings_file = "$conf_dir/settings.php"; + $status_table['drupal-settings-file'] = file_exists($settings_file) ? $settings_file : ''; + if ($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_SITE)) { + $status_table['uri'] = $boot_manager->getUri(); + try { + $sql = SqlBase::create($options); + $db_spec = $sql->getDbSpec(); + $status_table['db-driver'] = $db_spec['driver']; + if (!empty($db_spec['unix_socket'])) { + $status_table['db-socket'] = $db_spec['unix_socket']; + } elseif (isset($db_spec['host'])) { + $status_table['db-hostname'] = $db_spec['host']; + } + $status_table['db-username'] = isset($db_spec['username']) ? $db_spec['username'] : null; + $status_table['db-password'] = isset($db_spec['password']) ? $db_spec['password'] : null; + $status_table['db-name'] = isset($db_spec['database']) ? $db_spec['database'] : null; + $status_table['db-port'] = isset($db_spec['port']) ? $db_spec['port'] : null; + if ($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)) { + if (method_exists('Drupal', 'installProfile')) { + $status_table['install-profile'] = \Drupal::installProfile(); + } + if ($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_DATABASE)) { + $status_table['db-status'] = dt('Connected'); + if ($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + $status_table['bootstrap'] = dt('Successful'); + } + } + } + } catch (\Exception $e) { + // Don't worry be happy. + } + } + if ($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + $status_table['theme'] = \Drupal::config('system.theme')->get('default'); + $status_table['admin-theme'] = $theme = \Drupal::config('system.theme')->get('admin') ?: 'seven'; + } + } + $status_table['php-bin'] = PHP_BINARY; + $status_table['php-os'] = PHP_OS; + if ($phpIniFiles = EditCommands::phpIniFiles()) { + $status_table['php-conf'] = $phpIniFiles; + } + $status_table['drush-script'] = $this->getConfig()->get('runtime.drush-script'); + $status_table['drush-version'] = Drush::getVersion(); + $status_table['drush-temp'] = $this->getConfig()->tmp(); + $status_table['drush-cache-directory'] = $this->getConfig()->cache(); + $status_table['drush-conf'] = $this->getConfig()->configPaths(); + // List available alias files + $alias_files = $this->siteAliasManager()->listAllFilePaths(); + sort($alias_files); + $status_table['drush-alias-files'] = $alias_files; + $alias_searchpaths = $this->siteAliasManager()->searchLocations(); + $status_table['alias-searchpaths'] = $alias_searchpaths; + + $paths = self::pathAliases($options, $boot_manager, $boot_object); + if (!empty($paths)) { + foreach ($paths as $target => $one_path) { + $name = $target; + if (substr($name, 0, 1) == '%') { + $name = substr($name, 1); + } + $status_table[$name] = $one_path; + } + } + + // Store the paths into the '%paths' index; this will be + // used by other code, but will not be included in the output + // of the drush status command. + $status_table['%paths'] = $paths; + + return $status_table; + } + + public function renderStatusCell($key, $cellData, FormatterOptions $options) + { + if (is_array($cellData)) { + return implode("\n", $cellData); + } + return $cellData; + } + + /** + * @hook pre-command core-status + */ + public function adjustStatusOptions(CommandData $commandData) + { + $input = $commandData->input(); + $args = $input->getArguments(); + if (!empty($args['filter'])) { + $input->setOption('fields', '*' . $args['filter'] . '*'); + } + } + + /** + * @param array $options + * @param BootstrapManager $boot_manager + * @return array + */ + public static function pathAliases(array $options, BootstrapManager $boot_manager, $boot) + { + $paths = []; + $site_wide = 'sites/all'; + if ($drupal_root = $boot_manager->getRoot()) { + $paths['%root'] = $drupal_root; + if (($boot instanceof DrupalBoot) && ($site_root = $boot->confPath())) { + $paths['%site'] = $site_root; + if (is_dir($modules_path = $site_root . '/modules')) { + $paths['%modules'] = $modules_path; + } else { + $paths['%modules'] = ltrim($site_wide . '/modules', '/'); + } + if (is_dir($themes_path = $site_root . '/themes')) { + $paths['%themes'] = $themes_path; + } else { + $paths['%themes'] = ltrim($site_wide . '/themes', '/'); + } + if ($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)) { + try { + if (isset($GLOBALS['config_directories'])) { + foreach ($GLOBALS['config_directories'] as $label => $unused) { + $paths["%config-$label"] = config_get_config_directory($label); + } + } + } catch (\Exception $e) { + // Nothing to do. + } + } + + if ($boot_manager->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + $paths['%files'] = PublicStream::basePath(); + $paths['%temp'] = file_directory_temp(); + if ($private_path = PrivateStream::basePath()) { + $paths['%private'] = $private_path; + } + + $modules = \Drupal::moduleHandler()->getModuleList(); + $themes = \Drupal::service('theme_handler')->listInfo(); + $projects = array_merge($modules, $themes); + foreach (explode(',', $options['project']) as $target) { + if (array_key_exists($target, $projects)) { + $paths['%' . $target] = $drupal_root . '/' . $projects[$target]->getPath(); + } + } + } + } + } + + // Add in all of the global paths from $options['path-aliases'] + // @todo is this used? + if (isset($options['path-aliases'])) { + $paths = array_merge($paths, $options['path-aliases']); + } + + return $paths; + } +} diff --git a/vendor/drush/drush/src/Commands/core/TopicCommands.php b/vendor/drush/drush/src/Commands/core/TopicCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..928eab8a0753abc5902136d4a229559bf9e94187 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/TopicCommands.php @@ -0,0 +1,98 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\AnnotatedCommand\AnnotatedCommand; +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class TopicCommands extends DrushCommands +{ + + /** + * Read detailed documentation on a given topic. + * + * @command core:topic + * @param $topic_name The name of the topic you wish to view. If omitted, list all topic descriptions (and names in parenthesis). + * @usage drush topic + * Pick from all available topics. + * @usage drush topic docs-repl + * Show documentation for the Drush interactive shell + * @usage drush docs:r + * Filter topics for those starting with 'docs-r'. + * @remote-tty + * @aliases topic,core-topic + * @bootstrap max + * @topics docs:readme + */ + public function topic($topic_name) + { + $application = Drush::getApplication(); + $input = new ArrayInput([$topic_name], null); + return $application->run($input); + } + + /** + * @hook interact topic + */ + public function interact(InputInterface $input, OutputInterface $output) + { + $topics = self::getAllTopics(); + $topic_name = $input->getArgument('topic_name'); + if (!empty($topic_name)) { + // Filter the topics to those matching the query. + foreach ($topics as $key => $topic) { + if (strstr($key, $topic_name) === false) { + unset($topics[$key]); + } + } + } + if (count($topics) > 1) { + // Show choice list. + foreach ($topics as $key => $topic) { + $choices[$key] = $topic->getDescription() . " ($key)"; + } + natcasesort($choices); + $topic_name = $this->io()->choice(dt('Choose a topic'), $choices); + $input->setArgument('topic_name', $topic_name); + } + } + + /** + * @hook validate topic + */ + public function validate(CommandData $commandData) + { + $topic_name = $commandData->input()->getArgument('topic_name'); + if (!in_array($topic_name, array_keys(self::getAllTopics()))) { + throw new \Exception(dt("!topic topic not found.", ['!topic' => $topic_name])); + } + } + + /** + * Retrieve all defined topics + * + * @return Command[] + */ + public static function getAllTopics() + { + /** @var Application $application */ + $application = Drush::getApplication(); + $all = $application->all(); + foreach ($all as $key => $command) { + if ($command instanceof AnnotatedCommand) { + /** @var \Consolidation\AnnotatedCommand\AnnotationData $annotationData */ + $annotationData = $command->getAnnotationData(); + if ($annotationData->has('topic')) { + $topics[$command->getName()] = $command; + } + } + } + return $topics; + } +} diff --git a/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php b/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..9132552003bea7376b1d2b9feb1a17a048a39a23 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php @@ -0,0 +1,671 @@ +<?php +namespace Drush\Commands\core; + +use Consolidation\Log\ConsoleLogLevel; +use DrushBatchContext; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Consolidation\OutputFormatters\StructuredData\UnstructuredListData; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Drupal\Core\Utility\Error; +use Drupal\Core\Entity\EntityStorageException; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exceptions\UserAbortException; +use Psr\Log\LogLevel; + +class UpdateDBCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + protected $cache_clear; + + protected $maintenanceModeOriginalState; + + /** + * Apply any database updates required (as with running update.php). + * + * @command updatedb + * @option cache-clear Clear caches upon completion. + * @option entity-updates Run automatic entity schema updates at the end of any update hooks. Not supported in Drupal >= 8.7.0. + * @option post-updates Run post updates after hook_update_n and entity updates. + * @bootstrap full + * @kernel update + * @aliases updb + */ + public function updatedb($options = ['cache-clear' => true, 'entity-updates' => false, 'post-updates' => true]) + { + $this->cache_clear = $options['cache-clear']; + require_once DRUPAL_ROOT . '/core/includes/install.inc'; + require_once DRUPAL_ROOT . '/core/includes/update.inc'; + drupal_load_updates(); + + if ($options['entity-updates'] && version_compare(drush_drupal_version(), '8.7.0', '>=')) { + $this->logger()->warning(dt('Drupal removed its automatic entity-updates API in 8.7. See https://www.drupal.org/node/3034742.')); + $options['entity-updates'] = false; + } + + // Disables extensions that have a lower Drupal core major version, or too high of a PHP requirement. + // Those are rare, and this function does a full rebuild. So commenting it out for now. + // update_fix_compatibility(); + + // Check requirements before updating. + if (!$this->updateCheckRequirements()) { + if (!$this->io()->confirm(dt('Requirements check reports errors. Do you wish to continue?'))) { + throw new UserAbortException(); + } + } + + $status_options = [ + // @see https://github.com/drush-ops/drush/pull/3855. + 'no-entity-updates' => !$options['entity-updates'], + 'no-post-updates' => !$options['post-updates'], + ]; + $process = $this->processManager()->drush($this->siteAliasManager()->getSelf(), 'updatedb:status', [], $status_options); + $process->mustRun(); + if ($output = $process->getOutput()) { + // We have pending updates - let's run em. + $this->output()->writeln($output); + if (!$this->io()->confirm(dt('Do you wish to run the specified pending updates?'))) { + throw new UserAbortException(); + } + if ($this->getConfig()->simulate()) { + $success = true; + } else { + $success = $this->updateBatch($options); + // Caches were just cleared in updateFinished callback. + } + + $level = $success ? ConsoleLogLevel::SUCCESS : LogLevel::ERROR; + $this->logger()->log($level, dt('Finished performing updates.')); + } else { + $this->logger()->success(dt('No pending updates.')); + $success = true; + } + + return $success ? self::EXIT_SUCCESS : self::EXIT_FAILURE; + } + + /** + * Apply pending entity schema updates. + * + * @command entity:updates + * @option cache-clear Set to 0 to suppress normal cache clearing; the caller should then clear if needed. + * @bootstrap full + * @kernel update + * @aliases entup,entity-updates + * @usage drush updatedb:status --entity-updates | grep entity-update + * Use updatedb:status to detect pending updates. + * + */ + public function entityUpdates($options = ['cache-clear' => true]) + { + if ($this->getConfig()->simulate()) { + throw new \Exception(dt('entity-updates command does not support --simulate option.')); + } + + // @todo - Do same check for updatedb as well. + if (version_compare(drush_drupal_version(), '8.7.0', '>=')) { + throw new \Exception(dt('Drupal removed its automatic entity-updates API in 8.7. See https://www.drupal.org/node/3034742.')); + } + + if ($this->entityUpdatesMain() === false) { + throw new \Exception('Entity updates not run.'); + } + + if ($options['cache-clear']) { + drush_drupal_cache_clear_all(); + } + + $this->logger()->success(dt('Finished performing updates.')); + } + + /** + * List any pending database updates. + * + * @command updatedb:status + * @option entity-updates Show entity schema updates. + * @option post-updates Show post updates. + * @bootstrap full + * @kernel update + * @aliases updbst,updatedb-status + * @field-labels + * module: Module + * update_id: Update ID + * description: Description + * type: Type + * @default-fields module,update_id,type,description + * @filter-default-field type + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function updatedbStatus($options = ['format'=> 'table', 'entity-updates' => true, 'post-updates' => true]) + { + require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; + drupal_load_updates(); + list($pending, $start) = $this->getUpdatedbStatus($options); + if (empty($pending)) { + $this->logger()->success(dt("No database updates required.")); + } else { + return new RowsOfFields($pending); + } + } + + /** + * Process operations in the specified batch set. + * + * @command updatedb:batch-process + * @param string $batch_id The batch id that will be processed. + * @bootstrap full + * @kernel update + * @hidden + * + * @return \Consolidation\OutputFormatters\StructuredData\UnstructuredListData + */ + public function process($batch_id, $options = ['format' => 'json']) + { + $result = drush_batch_command($batch_id); + return new UnstructuredListData($result); + } + + /** + * Perform one update and store the results which will later be displayed on + * the finished page. + * + * An update function can force the current and all later updates for this + * module to abort by returning a $ret array with an element like: + * $ret['#abort'] = array('success' => FALSE, 'query' => 'What went wrong'); + * The schema version will not be updated in this case, and all the + * aborted updates will continue to appear on update.php as updates that + * have not yet been run. + * + * This method is static since since it is called by _drush_batch_worker(). + * + * @param string $module + * The module whose update will be run. + * @param int $number + * The update number to run. + * @param array $dependency_map + * The update dependency map. + * @param DrushBatchContext $context + * The batch context object. + */ + public static function updateDoOne($module, $number, array $dependency_map, DrushBatchContext $context) + { + $function = $module . '_update_' . $number; + + // Disable config entity overrides. + if (!defined('MAINTENANCE_MODE')) { + define('MAINTENANCE_MODE', 'update'); + } + + // If this update was aborted in a previous step, or has a dependency that + // was aborted in a previous step, go no further. + if (!empty($context['results']['#abort']) && array_intersect($context['results']['#abort'], array_merge($dependency_map, [$function]))) { + return; + } + + $context['log'] = false; + + \Drupal::moduleHandler()->loadInclude($module, 'install'); + + $ret = []; + if (function_exists($function)) { + try { + if ($context['log']) { + Database::startLog($function); + } + + if (empty($context['results'][$module][$number]['type'])) { + Drush::logger()->notice("Update started: $function"); + } + + $ret['results']['query'] = $function($context['sandbox']); + $ret['results']['success'] = true; + $ret['type'] = 'update'; + } catch (\Throwable $e) { + // PHP 7 introduces Throwable, which covers both Error and Exception throwables. + $ret['#abort'] = ['success' => false, 'query' => $e->getMessage()]; + Drush::logger()->error($e->getMessage()); + } catch (\Exception $e) { + // In order to be compatible with PHP 5 we also catch regular Exceptions. + $ret['#abort'] = ['success' => false, 'query' => $e->getMessage()]; + Drush::logger()->error($e->getMessage()); + } + + if ($context['log']) { + $ret['queries'] = Database::getLog($function); + } + } else { + $ret['#abort'] = ['success' => false]; + Drush::logger()->warning(dt('Update function @function not found', ['@function' => $function])); + } + + if (isset($context['sandbox']['#finished'])) { + $context['finished'] = $context['sandbox']['#finished']; + unset($context['sandbox']['#finished']); + } + + if (!isset($context['results'][$module])) { + $context['results'][$module] = []; + } + if (!isset($context['results'][$module][$number])) { + $context['results'][$module][$number] = []; + } + $context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret); + + // Log the message that was returned. + if (!empty($ret['results']['query'])) { + Drush::logger()->notice(strip_tags((string) $ret['results']['query'])); + } + + if (!empty($ret['#abort'])) { + // Record this function in the list of updates that were aborted. + $context['results']['#abort'][] = $function; + // Setting this value will output an error message. + // @see \DrushBatchContext::offsetSet() + $context['error_message'] = "Update failed: $function"; + } + + // Record the schema update if it was completed successfully. + if ($context['finished'] == 1 && empty($ret['#abort'])) { + drupal_set_installed_schema_version($module, $number); + // Setting this value will output a success message. + // @see \DrushBatchContext::offsetSet() + $context['message'] = "Update completed: $function"; + } + } + + /** + * Batch command that executes a single post-update. + * + * @param string $function + * The post-update function to execute. + * @param DrushBatchContext $context + * The batch context object. + */ + public static function updateDoOnePostUpdate($function, DrushBatchContext $context) + { + $ret = []; + + // Disable config entity overrides. + if (!defined('MAINTENANCE_MODE')) { + define('MAINTENANCE_MODE', 'update'); + } + + // If this update was aborted in a previous step, or has a dependency that was + // aborted in a previous step, go no further. + if (!empty($context['results']['#abort'])) { + return; + } + + list($module, $name) = explode('_post_update_', $function, 2); + module_load_include('php', $module, $module . '.post_update'); + if (function_exists($function)) { + if (empty($context['results'][$module][$name]['type'])) { + Drush::logger()->notice("Update started: $function"); + } + try { + $ret['results']['query'] = $function($context['sandbox']); + $ret['results']['success'] = true; + $ret['type'] = 'post_update'; + + if (!isset($context['sandbox']['#finished']) || (isset($context['sandbox']['#finished']) && $context['sandbox']['#finished'] >= 1)) { + \Drupal::service('update.post_update_registry')->registerInvokedUpdates([$function]); + } + } catch (\Exception $e) { + // @TODO We may want to do different error handling for different exception + // types, but for now we'll just log the exception and return the message + // for printing. + // @see https://www.drupal.org/node/2564311 + Drush::logger()->error($e->getMessage()); + + $variables = Error::decodeException($e); + unset($variables['backtrace']); + $ret['#abort'] = [ + 'success' => false, + 'query' => t('%type: @message in %function (line %line of %file).', $variables), + ]; + } + } + + if (isset($context['sandbox']['#finished'])) { + $context['finished'] = $context['sandbox']['#finished']; + unset($context['sandbox']['#finished']); + } + if (!isset($context['results'][$module][$name])) { + $context['results'][$module][$name] = []; + } + $context['results'][$module][$name] = array_merge($context['results'][$module][$name], $ret); + + // Log the message that was returned. + if (!empty($ret['results']['query'])) { + Drush::logger()->notice(strip_tags((string) $ret['results']['query'])); + } + + if (!empty($ret['#abort'])) { + // Record this function in the list of updates that were aborted. + $context['results']['#abort'][] = $function; + // Setting this value will output an error message. + // @see \DrushBatchContext::offsetSet() + $context['error_message'] = "Update failed: $function"; + } elseif ($context['finished'] == 1 && empty($ret['#abort'])) { + // Setting this value will output a success message. + // @see \DrushBatchContext::offsetSet() + $context['message'] = "Update completed: $function"; + } + } + + /** + * Batch finished callback. + * + * @param boolean $success Whether the batch ended without a fatal error. + * @param array $results + * @param array $operations + */ + public static function updateFinished($success, $results, $operations) + { + // No code needed but the batch result bookkeeping fails without a finished callback. + $noop = 1; + } + + + /** + * Start the database update batch process. + * @param $options + * @return bool + */ + public function updateBatch($options) + { + $start = $this->getUpdateList(); + // Resolve any update dependencies to determine the actual updates that will + // be run and the order they will be run in. + $updates = update_resolve_dependencies($start); + + // Store the dependencies for each update function in an array which the + // batch API can pass in to the batch operation each time it is called. (We + // do not store the entire update dependency array here because it is + // potentially very large.) + $dependency_map = []; + foreach ($updates as $function => $update) { + $dependency_map[$function] = !empty($update['reverse_paths']) ? array_keys($update['reverse_paths']) : []; + } + + $operations = []; + + foreach ($updates as $update) { + if ($update['allowed']) { + // Set the installed version of each module so updates will start at the + // correct place. (The updates are already sorted, so we can simply base + // this on the first one we come across in the above foreach loop.) + if (isset($start[$update['module']])) { + drupal_set_installed_schema_version($update['module'], $update['number'] - 1); + unset($start[$update['module']]); + } + // Add this update function to the batch. + $function = $update['module'] . '_update_' . $update['number']; + $operations[] = ['\Drush\Commands\core\UpdateDBCommands::updateDoOne', [$update['module'], $update['number'], $dependency_map[$function]]]; + } + } + + // Perform entity definition updates, which will update storage + // schema if needed. If module update functions need to work with specific + // entity schema they should call the entity update service for the specific + // update themselves. + // @see \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::applyEntityUpdate() + // @see \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::applyFieldUpdate() + if ($options['entity-updates'] && \Drupal::entityDefinitionUpdateManager()->needsUpdates()) { + $operations[] = [[$this, 'updateEntityDefinitions'], []]; + } + + // Lastly, apply post update hooks if specified. + if ($options['post-updates']) { + $post_updates = \Drupal::service('update.post_update_registry')->getPendingUpdateFunctions(); + if ($post_updates) { + if ($operations) { + // Only needed if we performed updates earlier. + $operations[] = ['\Drush\Commands\core\UpdateDBCommands::cacheRebuild', []]; + } + foreach ($post_updates as $function) { + $operations[] = ['\Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate', [$function]]; + } + } + } + + $original_maint_mode = \Drupal::service('state')->get('system.maintenance_mode'); + if (!$original_maint_mode) { + \Drupal::service('state')->set('system.maintenance_mode', true); + $operations[] = ['\Drush\Commands\core\UpdateDBCommands::restoreMaintMode', [false]]; + } + + $batch['operations'] = $operations; + $batch += [ + 'title' => 'Updating', + 'init_message' => 'Starting updates', + 'error_message' => 'An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.', + 'finished' => '\Drush\Commands\core\UpdateDBCommands::updateFinished', + 'file' => 'core/includes/update.inc', + ]; + batch_set($batch); + $result = drush_backend_batch_process('updatedb:batch-process'); + + $success = false; + if (!is_array($result)) { + $this->logger()->error(dt('Batch process did not return a result array. Returned: !type', ['!type' => gettype($result)])); + } elseif (!empty($result[0]['#abort'])) { + // Whenever an error occurs the batch process does not continue, so + // this array should only contain a single item, but we still output + // all available data for completeness. + $this->logger()->error(dt('Update aborted by: !process', [ + '!process' => implode(', ', $result[0]['#abort']), + ])); + } else { + $success = true; + } + + return $success; + } + + public static function restoreMaintMode($status) + { + \Drupal::service('state')->set('system.maintenance_mode', $status); + } + + /** + * Apply entity schema updates. + */ + public function updateEntityDefinitions(&$context) + { + try { + \Drupal::entityDefinitionUpdateManager()->applyupdates(); + } catch (EntityStorageException $e) { + watchdog_exception('update', $e); + $variables = Error::decodeException($e); + unset($variables['backtrace']); + // The exception message is run through + // \Drupal\Component\Utility\SafeMarkup::checkPlain() by + // \Drupal\Core\Utility\Error::decodeException(). + $ret['#abort'] = ['success' => false, 'query' => t('%type: !message in %function (line %line of %file).', $variables)]; + $context['results']['core']['update_entity_definitions'] = $ret; + $context['results']['#abort'][] = 'update_entity_definitions'; + } + } + + // Copy of protected \Drupal\system\Controller\DbUpdateController::getModuleUpdates. + public function getUpdateList() + { + $return = []; + $updates = update_get_update_list(); + foreach ($updates as $module => $update) { + $return[$module] = $update['start']; + } + + return $return; + } + + /** + * Clears caches and rebuilds the container. + * + * This is called in between regular updates and post updates. Do not use + * drush_drupal_cache_clear_all() as the cache clearing and container rebuild + * must happen in the same process that the updates are run in. + * + * Drupal core's update.php uses drupal_flush_all_caches() directly without + * explicitly rebuilding the container as the container is rebuilt on the next + * HTTP request of the batch. + * + * @see drush_drupal_cache_clear_all() + * @see \Drupal\system\Controller\DbUpdateController::triggerBatch() + */ + public static function cacheRebuild() + { + drupal_flush_all_caches(); + \Drupal::service('kernel')->rebuildContainer(); + // Load the module data which has been removed when the container was + // rebuilt. + $module_handler = \Drupal::moduleHandler(); + $module_handler->loadAll(); + $module_handler->invokeAll('rebuild'); + } + + /** + * Return a 2 item array with + * - an array where each item is a 4 item associative array describing a pending update. + * - an array listing the first update to run, keyed by module. + */ + public function getUpdatedbStatus(array $options) + { + require_once DRUPAL_ROOT . '/core/includes/update.inc'; + $pending = \update_get_update_list(); + + $return = []; + // Ensure system module's updates run first. + $start['system'] = []; + + foreach ($pending as $module => $updates) { + if (isset($updates['start'])) { + foreach ($updates['pending'] as $update_id => $description) { + // Strip cruft from front. + $description = str_replace($update_id . ' - ', '', $description); + $return[$module . "_update_$update_id"] = [ + 'module' => $module, + 'update_id' => $update_id, + 'description' => $description, + 'type'=> 'hook_update_n' + ]; + } + if (isset($updates['start'])) { + $start[$module] = $updates['start']; + } + } + } + + // Append row(s) for pending entity definition updates. + if ($options['entity-updates']) { + foreach (\Drupal::entityDefinitionUpdateManager() + ->getChangeSummary() as $entity_type_id => $changes) { + foreach ($changes as $change) { + $return[] = [ + 'module' => dt('@type entity type', ['@type' => $entity_type_id]), + 'update_id' => '', + 'description' => strip_tags($change), + 'type' => 'entity-update' + ]; + } + } + } + + // Pending hook_post_update_X() implementations. + $post_updates = \Drupal::service('update.post_update_registry')->getPendingUpdateInformation(); + if ($options['post-updates']) { + foreach ($post_updates as $module => $post_update) { + foreach ($post_update as $key => $list) { + if ($key == 'pending') { + foreach ($list as $id => $item) { + $return[$module . '-post-' . $id] = [ + 'module' => $module, + 'update_id' => $id, + 'description' => $item, + 'type' => 'post-update' + ]; + } + } + } + } + } + + return [$return, $start]; + } + + /** + * Apply pending entity schema updates. + */ + public function entityUpdatesMain() + { + $change_summary = \Drupal::entityDefinitionUpdateManager()->getChangeSummary(); + if (!empty($change_summary)) { + $this->output()->writeln(dt('The following updates are pending:')); + $this->io()->newLine(); + + foreach ($change_summary as $entity_type_id => $changes) { + $this->output()->writeln($entity_type_id . ' entity type : '); + foreach ($changes as $change) { + $this->output()->writeln(strip_tags($change), 2); + } + } + + if (!$this->io()->confirm(dt('Do you wish to run all pending updates?'))) { + throw new UserAbortException(); + } + + $operations[] = [[$this, 'updateEntityDefinitions'], []]; + + + $batch['operations'] = $operations; + $batch += [ + 'title' => 'Updating', + 'init_message' => 'Starting updates', + 'error_message' => 'An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.', + 'finished' => [$this, 'updateFinished'], + ]; + batch_set($batch); + + // See updateFinished() for the restore of maint mode. + $this->maintenanceModeOriginalState = \Drupal::service('state')->get('system.maintenance_mode'); + \Drupal::service('state')->set('system.maintenance_mode', true); + drush_backend_batch_process(); + } else { + $this->logger()->success(dt("No entity schema updates required")); + } + } + + /** + * Log messages for any requirements warnings/errors. + */ + public function updateCheckRequirements() + { + $return = true; + + \Drupal::moduleHandler()->resetImplementations(); + $requirements = update_check_requirements(); + $severity = drupal_requirements_severity($requirements); + + // If there are issues, report them. + if ($severity != REQUIREMENT_OK) { + if ($severity === REQUIREMENT_ERROR) { + $return = false; + } + foreach ($requirements as $requirement) { + if (isset($requirement['severity']) && $requirement['severity'] != REQUIREMENT_OK) { + $message = isset($requirement['description']) ? $requirement['description'] : ''; + if (isset($requirement['value']) && $requirement['value']) { + $message .= ' (Currently using '. $requirement['title'] .' '. $requirement['value'] .')'; + } + $log_level = $requirement['severity'] === REQUIREMENT_ERROR ? LogLevel::ERROR : LogLevel::WARNING; + $this->logger()->log($log_level, $message); + } + } + } + + return $return; + } +} diff --git a/vendor/drush/drush/src/Commands/core/XhprofCommands.php b/vendor/drush/drush/src/Commands/core/XhprofCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..0fc120c8c14d1f87b9330e1f1ae11249ce652947 --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/XhprofCommands.php @@ -0,0 +1,137 @@ +<?php + +namespace Drush\Commands\core; + +use Consolidation\AnnotatedCommand\AnnotationData; +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Drush; +use Symfony\Component\Console\Input\InputInterface; +use Drush\Commands\DrushCommands; + +/** + * Class XhprofCommands + * @package Drush\Commands\core + * + * Supports profiling Drush commands using either XHProf or Tideways XHProf. + * + * Note that XHProf is only compatible with PHP 5.6. For PHP 7+, you must use + * the Tideways XHProf fork. The Tideways XHProf extension recently underwent a + * major refactor; Drush is only compatible with the newer version. + * @see https://tideways.com/profiler/blog/releasing-new-tideways-xhprof-extension + * + * @todo Remove support for XHProf extension once PHP 5.6 is EOL. + */ +class XhprofCommands extends DrushCommands +{ + + const XH_PROFILE_MEMORY = false; + const XH_PROFILE_CPU = false; + const XH_PROFILE_BUILTINS = true; + + + // @todo Add a command for launching the built-in web server pointing to the HTML site of xhprof. + // @todo Write a topic explaining how to use this. + + /** + * @hook option * + * + * @option xh-link URL to your XHProf report site. + */ + public function optionsetXhProf($options = ['xh-link' => self::REQ]) + { + } + + /** + * Enable profiling via XHProf + * + * @hook post-command * + */ + public function xhprofPost($result, CommandData $commandData) + { + if (self::xhprofIsEnabled()) { + $namespace = 'Drush'; + $run_id = self::xhprofFinishRun($namespace); + $url = $this->getConfig()->get('xh.link') . '/index.php?run=' . urlencode($run_id) . '&source=' . urlencode($namespace); + $this->logger()->notice(dt('XHProf run saved. View report at !url', ['!url' => $url])); + } + } + + /** + * Enable profiling via XHProf + * + * @hook init * + */ + public function xhprofInitialize(InputInterface $input, AnnotationData $annotationData) + { + if (self::xhprofIsEnabled()) { + $config = $this->getConfig()->get('xh'); + $flags = self::xhprofFlags($config); + self::xhprofEnable($flags); + } + } + + public static function xhprofIsEnabled() + { + if (Drush::config()->get('xh.link')) { + if (!extension_loaded('xhprof') && !extension_loaded('tideways_xhprof')) { + if (extension_loaded('tideways')) { + throw new \Exception(dt('You are using an older incompatible version of the tideways extension. Please upgrade to the new tideways_xhprof extension.')); + } else { + throw new \Exception(dt('You must enable the xhprof or tideways_xhprof PHP extensions in your CLI PHP in order to profile.')); + } + } + return true; + } + return false; + } + + /** + * Determines flags. + * + * TODO: Make these work for Tideways as well. + */ + public static function xhprofFlags(array $config) + { + $flags = 0; + if (!(isset($config['profile-builtins']) ? $config['profile-builtins']: self::XH_PROFILE_BUILTINS)) { + $flags |= XHPROF_FLAGS_NO_BUILTINS; + } + if (isset($config['profile-cpu']) ? $config['profile-cpu'] : self::XH_PROFILE_CPU) { + $flags |= XHPROF_FLAGS_CPU; + } + if (isset($config['profile-memory']) ? $config['profile-memory'] : self::XH_PROFILE_MEMORY) { + $flags |= XHPROF_FLAGS_MEMORY; + } + return $flags; + } + + /** + * Enable profiling. + */ + public static function xhprofEnable($flags) + { + if (extension_loaded('tideways_xhprof')) { + \tideways_xhprof_enable(TIDEWAYS_XHPROF_FLAGS_MEMORY | TIDEWAYS_XHPROF_FLAGS_CPU); + } else { + \xhprof_enable($flags); + } + } + + /** + * Disable profiling and save results. + */ + public function xhprofFinishRun($namespace) + { + if (extension_loaded('tideways_xhprof')) { + $data = \tideways_xhprof_disable(); + $dir = $this->getConfig()->tmp(); + $run_id = uniqid(); + file_put_contents($dir . DIRECTORY_SEPARATOR . $run_id . '.' . $namespace . '.xhprof', serialize($data)); + return $run_id; + } else { + $xhprof_data = \xhprof_disable(); + $xhprof_runs = new \XHProfRuns_Default(); + return $xhprof_runs->save_run($xhprof_data, $namespace); + } + } +} diff --git a/vendor/drush/drush/src/Commands/generate/GenerateCommands.php b/vendor/drush/drush/src/Commands/generate/GenerateCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..4dbbf2214b325b1248940067a224629950c789be --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/GenerateCommands.php @@ -0,0 +1,162 @@ +<?php + +namespace Drush\Commands\generate; + +use Consolidation\SiteProcess\Util\Escape; +use DrupalCodeGenerator\GeneratorDiscovery; +use DrupalCodeGenerator\Helper\Dumper; +use DrupalCodeGenerator\Helper\Renderer; +use DrupalCodeGenerator\TwigEnvironment; +use Drush\Commands\DrushCommands; +use Drush\Commands\generate\Helper\InputHandler; +use Drush\Commands\generate\Helper\OutputHandler; +use Drush\Commands\help\ListCommands; +use Drush\Drush; +use Drush\Drupal\DrushServiceModifier; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Input\StringInput; +use Symfony\Component\Filesystem\Filesystem; + +/** + * Drush generate command. + */ +class GenerateCommands extends DrushCommands +{ + + /** + * Generate boilerplate code for modules/plugins/services etc. + * + * Drush asks questions so that the generated code is as polished as possible. After + * generating, Drush lists the files that were created. + * + * @command generate + * @aliases gen + * @param string $generator A generator name. Omit to pick from available Generators. + * @option answers A JSON string containing pairs of question and answers. + * @option directory Absolute path to a base directory for file writing. + * @usage drush generate + * Pick from available generators and then run it. + * @usage drush generate controller + * Generate a controller class for your module. + * @usage drush generate drush-command-file + * Generate a Drush commandfile for your module. + * @topics docs:generators + * @bootstrap max + */ + public function generate($generator = '', $options = ['answers' => self::REQ, 'directory' => self::REQ]) + { + // Disallow default Symfony console commands. + if ($generator == 'help' || $generator == 'list') { + $generator = null; + } + + $application = $this->createApplication(); + if (!$generator) { + $all = $application->all(); + unset($all['help'], $all['list']); + $namespaced = ListCommands::categorize($all, '-'); + $preamble = dt('Run `drush generate [command]` and answer a few questions in order to write starter code to your project.'); + ListCommands::renderListCLI($application, $namespaced, $this->output(), $preamble); + return null; + } else { + // Symfony console cannot recognize the command by alias when + // multiple commands have the same prefix. + if ($generator == 'module') { + $generator = 'module-standard'; + } + + // Create an isolated input. + $argv = [ + $generator, + '--answers=' . Escape::shellArg($options['answers'], 'LINUX'), + '--directory=' . $options['directory'] + ]; + if ($options['ansi']) { + $argv[] = '--ansi'; + } + if ($options['no-ansi']) { + $argv[] = '--no-ansi'; + } + return $application->run(new StringInput(implode(' ', $argv))); + } + } + + /** + * Creates Drush generate application. + * + * @return \Symfony\Component\Console\Application + * Symfony console application. + */ + protected function createApplication() + { + $application = new Application('Drush generate', Drush::getVersion()); + $helperSet = $application->getHelperSet(); + + $override = null; + if (Drush::affirmative()) { + $override = true; + } elseif (Drush::negative()) { + $override = false; + } + $dumper = new Dumper(new Filesystem(), $override); + $helperSet->set($dumper); + + $twig_loader = new \Twig_Loader_Filesystem(); + $renderer = new Renderer(new TwigEnvironment($twig_loader)); + $helperSet->set($renderer); + + $helperSet->set(new InputHandler()); + $helperSet->set(new OutputHandler()); + + // Discover generators. + $discovery = new GeneratorDiscovery(new Filesystem()); + + /** + * Discover generators. + */ + $dcg_generators = $discovery->getGenerators([DCG_ROOT . '/src/Command/Drupal_8'], '\DrupalCodeGenerator\Command\Drupal_8'); + $drush_generators = $discovery->getGenerators([__DIR__ . '/Generators'], '\Drush\Commands\generate\Generators'); + $config_paths = $this->getConfig()->get('runtime.commandfile.paths', []); + + $global_paths = []; + + foreach ($config_paths as $path) { + $global_paths[] = $path . '/Generators'; + $global_paths[] = $path . '/src/Generators'; + } + + $global_paths = array_filter($global_paths, 'file_exists'); + $global_generators = $discovery->getGenerators($global_paths, '\Drush\Generators'); + + $module_generators = []; + + if (Drush::bootstrapManager()->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + $container = \Drupal::getContainer(); + if ($container->has(DrushServiceModifier::DRUSH_GENERATOR_SERVICES)) { + $module_generators = $container->get(DrushServiceModifier::DRUSH_GENERATOR_SERVICES)->getCommandList(); + } + } + + /** @var \Symfony\Component\Console\Command\Command[] $generators */ + $generators = array_merge($dcg_generators, $drush_generators, $global_generators, $module_generators); + + foreach ($generators as $generator) { + $sub_names = explode(':', $generator->getName()); + if ($sub_names[0] == 'd8') { + // Remove d8 namespace. + array_shift($sub_names); + } + $new_name = implode('-', $sub_names); + $generator->setName($new_name); + // Remove alias if it is same as new name. + if ($aliases = $generator->getAliases()) { + $generator->setAliases(array_diff($aliases, [$new_name])); + } + } + + $application->addCommands($generators); + + $application->setAutoExit(false); + return $application; + } +} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/DrushAliasFile.php b/vendor/drush/drush/src/Commands/generate/Generators/Drush/DrushAliasFile.php new file mode 100644 index 0000000000000000000000000000000000000000..f6b30a58e56c89ab2280bdf2f944fd6ce715cc38 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Drush/DrushAliasFile.php @@ -0,0 +1,42 @@ +<?php + +namespace Drush\Commands\generate\Generators\Drush; + +use DrupalCodeGenerator\Command\BaseGenerator; +use Drush\Drush; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements drush-alias-file command. + */ +class DrushAliasFile extends BaseGenerator +{ + + protected $name = 'drush-alias-file'; + protected $description = 'Generates a Drush site alias file.'; + protected $alias = 'daf'; + protected $templatePath = __DIR__; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) + { + $questions['prefix'] = new Question('File prefix (one word)', 'self'); + $questions['root'] = new Question('Path to Drupal root', Drush::bootstrapManager()->getRoot()); + $questions['uri'] = new Question('Drupal uri', Drush::bootstrapManager()->getUri()); + $questions['host'] = new Question('Remote host'); + $vars = $this->collectVars($input, $output, $questions); + + if ($vars['host']) { + $remote_questions['user'] = new Question('Remote user', Drush::config()->user()); + $this->collectVars($input, $output, $remote_questions); + } + + $this->addFile() + ->path('../drush/{prefix}.site.yml') + ->template('drush-alias-file.twig'); + } +} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/DrushCommandFile.php b/vendor/drush/drush/src/Commands/generate/Generators/Drush/DrushCommandFile.php new file mode 100644 index 0000000000000000000000000000000000000000..e2cb28be263661301986099e56f7f1606297ce68 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Drush/DrushCommandFile.php @@ -0,0 +1,147 @@ +<?php + +namespace Drush\Commands\generate\Generators\Drush; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements drush-command-file command. + */ +class DrushCommandFile extends BaseGenerator +{ + + protected $name = 'drush-command-file'; + protected $description = 'Generates a Drush command file.'; + protected $alias = 'dcf'; + protected $templatePath = __DIR__; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) + { + $questions = Utils::defaultQuestions(); + $questions['source'] = new Question('Absolute path to legacy Drush command file (optional - for porting)'); + $questions['source']->setValidator(function ($path) { + if ($path && !is_file($path)) { + throw new \UnexpectedValueException(sprintf('Could not open file "%s".', $path)); + } + return $path; + }); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['class'] = Utils::camelize($vars['machine_name'] . 'Commands'); + if ($vars['source']) { + require_once $vars['source']; + $filename = str_replace(['.drush.inc', '.drush8.inc'], '', basename($vars['source'])); + $command_hook = $filename . '_drush_command'; + if (!function_exists($command_hook)) { + throw new \InvalidArgumentException('Drush command hook "' . $command_hook . '" does not exist.'); + } + $commands = call_user_func($filename . '_drush_command'); + $vars['commands'] = $this->adjustCommands($commands); + } + + $this->addFile() + ->path('src/Commands/{class}.php') + ->template('drush-command-file.twig'); + + $json = $this->getComposerJson($vars); + $content = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); + $this->addFile() + ->path('composer.json') + ->content($content) + ->action('replace'); + + $this->addFile() + ->path('drush.services.yml') + ->template('drush.services.twig'); + } + + protected function getComposerJson(array $vars) + { + $composer_json_template_path = __DIR__ . '/dcf-composer.json'; + // TODO: look up the path of the 'machine_name' module. + $composer_json_existing_path = DRUPAL_ROOT . '/modules/' . $vars['machine_name'] . '/composer.json'; + $composer_json_path = file_exists($composer_json_existing_path) ? $composer_json_existing_path : $composer_json_template_path; + $composer_json_contents = file_get_contents($composer_json_path); + $composer_json_data = json_decode($composer_json_contents, true); + + // If there is no name, fill something in + if (empty($composer_json_data['name'])) { + $composer_json_data['name'] = 'org/' . $vars['machine_name']; + } + + // Add an entry for the drush services file. + $composer_json_data['extra']['drush']['services'] = [ + 'drush.services.yml' => '^9', + ]; + + return $composer_json_data; + } + + protected function getOwningModulePath(array $vars) + { + $module_name = $vars['machine_name']; + + $modules = \Drupal::moduleHandler()->getModuleList(); + $themes = \Drupal::service('theme_handler')->listInfo(); + $projects = array_merge($modules, $themes); + + if (!isset($projects[$module_name])) { + throw new \Exception(dt('{module} does not exist. Run `drush generate module-standard` to create it.', ['module' => $module_name])); + } + return $projects[$module_name]->getPath(); + } + + protected function adjustCommands(array $commands) + { + foreach ($commands as $name => &$command) { + // Drush9 uses colons in command names. Replace first dash with colon. + $pos = strpos($name, '-'); + if ($pos !== false) { + $command['name'] = substr_replace($name, ':', $pos, 1); + } + + if ($command['name'] !== $name) { + $command['aliases'][] = $name; + } + + $command['method'] = $name; + if (($pos = strpos($name, '-')) !== false) { + $command['method'] = substr($name, $pos + 1); + } + $command['method'] = Utils::camelize(str_replace('-', '_', $command['method']), false); + if ($command['arguments']) { + foreach ($command['arguments'] as $aName => $description) { + // Prepend name with a '$' and replace dashes. + $command['arguments']['$' . Utils::human2machine($aName)] = $description; + unset($command['arguments'][$aName]); + } + $command['argumentsConcat'] = implode(', ', array_keys($command['arguments'])); + } + if ($command['options']) { + foreach ($command['options'] as $oName => &$option) { + // We only care about option description so make value a simple string. + if (is_array($option)) { + $option = $option['description']; + } + $oNames[] = "'$oName' => null"; + } + $command['optionsConcat'] = 'array $options = [' . implode(', ', $oNames) . ']'; + if (!empty($command['arguments'])) { + $command['optionsConcat'] = ', ' . $command['optionsConcat']; + } + unset($oNames); + } + if ($deps = $command['drupal dependencies']) { + $command['depsConcat'] = implode(',', $deps); + } + } + return $commands; + } +} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/dcf-composer.json b/vendor/drush/drush/src/Commands/generate/Generators/Drush/dcf-composer.json new file mode 100644 index 0000000000000000000000000000000000000000..49aef4c67dda348a81dca888213153e41378535e --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Drush/dcf-composer.json @@ -0,0 +1,11 @@ +{ + "name": "", + "description": "This extension provides new commands for Drush.", + "type": "drupal-drush", + "authors": [ + { "name": "Author name", "email": "author@example.com" } + ], + "require": { + "php": ">=5.6.0" + } +} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/default-methods.twig b/vendor/drush/drush/src/Commands/generate/Generators/Drush/default-methods.twig new file mode 100644 index 0000000000000000000000000000000000000000..c95861a8759f60c49d0ff166db667dac1b492306 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Drush/default-methods.twig @@ -0,0 +1,49 @@ + /** + * Command description here. + * + * @param $arg1 + * Argument description. + * @param array $options + * An associative array of options whose values come from cli, aliases, config, etc. + * @option option-name + * Description + * @usage {{ machine_name }}-commandName foo + * Usage description + * + * @command {{ machine_name }}:commandName + * @aliases foo + */ + public function commandName($arg1, $options = ['option-name' => 'default']) { + $this->logger()->success(dt('Achievement unlocked.')); + } + + /** + * An example of the table output format. + * + * @param array $options An associative array of options whose values come from cli, aliases, config, etc. + * + * @field-labels + * group: Group + * token: Token + * name: Name + * @default-fields group,token,name + * + * @command {{ machine_name }}:token + * @aliases token + * + * @filter-default-field name + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function token($options = ['format' => 'table']) { + $all = \Drupal::token()->getInfo(); + foreach ($all['tokens'] as $group => $tokens) { + foreach ($tokens as $key => $token) { + $rows[] = [ + 'group' => $group, + 'token' => $key, + 'name' => $token['name'], + ]; + } + } + return new RowsOfFields($rows); + } diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush-alias-file.twig b/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush-alias-file.twig new file mode 100644 index 0000000000000000000000000000000000000000..fa2f3b66ffe8dea1dc29fead871a4cec4b763494 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush-alias-file.twig @@ -0,0 +1,70 @@ +# Although most aliases will contain only a few options, a number +# of settings that are commonly used appear below: +# +# - 'uri': The value of --uri should always be the same as +# when the site is being accessed from a web browser (e.g. http://example.com) +# - 'root': The Drupal root; must not be specified as a relative path. +# - 'host': The fully-qualified domain name of the remote system +# hosting the Drupal instance. **Important Note: The remote-host option +# must be omitted for local sites, as this option controls various +# operations, such as whether or not rsync parameters are for local or +# remote machines, and so on. @see hook_drush_sitealias_alter() in drush.api.php +# - 'user': The username to log in as when using ssh or rsync. +# - 'os': The operating system of the remote server. Valid values +# are 'Windows' and 'Linux'. Be sure to set this value for all remote +# aliases because the default value is PHP_OS if 'remote-host' +# is not set, and 'Linux' (or $options['remote-os']) if it is. Therefore, +# if you set a 'remote-host' value, and your remote OS is Windows, if you +# do not set the 'OS' value, it will default to 'Linux' and could cause +# unintended consequences, particularly when running 'drush sql-sync'. +# - 'ssh': If the target requires special options, such as a non- +# standard port, alternative identity file, or alternative +# authentication method, the `option` entry under the `ssh` item may +# contain a string of extra options that are used with the ssh command, +# e.g. "-p 100" +# - 'paths': An array of aliases for common rsync targets. +# Relative aliases are always taken from the Drupal root. +# - 'files': Path to 'files' directory. This will be looked up if not +# specified. +# - 'drush-script': Path to the remot Drush command. +# - 'command': These options will only be set if the alias +# is used with the specified command. In the example below, the option +# `--no-dump` will be selected whenever the @stage alias +# is used in any of the following ways: +# - `drush @stage sql-sync @self @live` +# - `drush sql-sync @stage @live` +# - `drush sql-sync @live @stage` +# NOTE: Setting boolean options broke with Symfony 3. This will be fixed +# in a future release. See: https://github.com/drush-ops/drush/issues/2956 +# +# Complex example: +# +# @code +# # File: remote.alias.yml +# live: +# host: server.domain.com +# user: www-admin +# root: /other/path/to/drupal +# uri: http://example.com +# ssh: +# options: '-p 100' +# paths: +# drush-script: '/path/to/drush' +# command: +# site: +# install: +# options: +# admin-password: 'secret-secret' +# @endcode +# +# Altering aliases: +# +# See examples/Commands/SiteAliasAlter.php for an example. + +dev: + root: {{ root }} + uri: {{ uri }} +{% if host %} + host: {{ host }} + user: {{ user }} +{% endif %} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush-command-file.twig b/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush-command-file.twig new file mode 100644 index 0000000000000000000000000000000000000000..fa19659cedd45326ed558711f8147c3c6e2b5209 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush-command-file.twig @@ -0,0 +1,28 @@ +<?php + +namespace Drupal\{{ machine_name }}\Commands; + +{% if not source %} +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +{% endif %} +use Drush\Commands\DrushCommands; + +/** + * A Drush commandfile. + * + * In addition to this file, you need a drush.services.yml + * in root of your module, and a composer.json file that provides the name + * of the services file to use. + * + * See these files for an example of injecting Drupal services: + * - http://cgit.drupalcode.org/devel/tree/src/Commands/DevelCommands.php + * - http://cgit.drupalcode.org/devel/tree/drush.services.yml + */ +class {{ class }} extends DrushCommands { + +{% if source %} +{% include 'ported-methods.twig' %} +{% else %} +{% include 'default-methods.twig' %} +{% endif %} +} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush.services.twig b/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush.services.twig new file mode 100644 index 0000000000000000000000000000000000000000..a244ac097f6446d05342c94a4e595696daa21a07 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Drush/drush.services.twig @@ -0,0 +1,5 @@ +services: + {{ machine_name }}.commands: + class: \Drupal\{{ machine_name }}\Commands\{{ class }} + tags: + - { name: drush.command } diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/ported-methods.twig b/vendor/drush/drush/src/Commands/generate/Generators/Drush/ported-methods.twig new file mode 100644 index 0000000000000000000000000000000000000000..d1caa803ef74564458697d25d3fa5df7fe7e78b9 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Drush/ported-methods.twig @@ -0,0 +1,36 @@ +{% for key, command in commands %} + /** + * {{ command.description|raw }} + * +{% if command.arguments %} +{% for argName, argDescription in command.arguments %} + * @param {{ argName }} + * {{ argDescription|raw }} +{% endfor %} +{% endif %} +{% if command.optionsConcat|raw %} + * @param array $options An associative array of options whose values come from cli, aliases, config, etc. +{% endif %} +{% if command.options %} +{% for optionName, optionDescription in command.options %} + * @option {{ optionName }} + * {{ optionDescription|raw }} +{% endfor %} +{% endif %} +{% for usageName, usageDescription in command.examples %} + * @usage {{ usageName|raw }} + * {{ usageDescription|raw }} +{% endfor %} +{% if command.depsConcat|raw %} + * @validate-module-enabled {{ command.depsConcat|raw }} +{% endif %} + * + * @command {{ command.name }} + * @aliases {{ command.aliases|join(',') }} + */ + public function {{ command.method }}({{ command.argumentsConcat|raw }}{{ command.optionsConcat|raw }}) { + // See bottom of https://weitzman.github.io/blog/port-to-drush9 for details on what to change when porting a + // legacy command. + } + +{% endfor %} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Migrate/MigrationGenerator.php b/vendor/drush/drush/src/Commands/generate/Generators/Migrate/MigrationGenerator.php new file mode 100644 index 0000000000000000000000000000000000000000..a7ac4ecf316225b9284616ff8273a417d766178d --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Migrate/MigrationGenerator.php @@ -0,0 +1,42 @@ +<?php + +namespace Drush\Commands\generate\Generators\Migrate; + +use DrupalCodeGenerator\Command\BaseGenerator; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +/** + * Implements `generate migration` command. + */ +class MigrationGenerator extends BaseGenerator +{ + + protected $name = 'migration'; + protected $description = 'Generates the yml and PHP class for a Migration'; + protected $templatePath = __DIR__; + + /** + * {@inheritdoc} + */ + protected function interact(InputInterface $input, OutputInterface $output) + { + $questions = Utils::defaultPluginQuestions() + [ + 'migration_group' => new Question('Migration group', 'default'), + 'destination_plugin' => new Question('Destination plugin', 'entity:node'), + ]; + + $vars = &$this->collectVars($input, $output, $questions); + $vars['class'] = Utils::camelize($vars['plugin_label']); + + $this->addFile() + ->path('src/Plugin/migrate/source/{class}.php') + ->template('migration.twig'); + + $this->addFile() + ->path('config/install/migrate_plus.migration.{plugin_id}.yml') + ->template('migration.yml.twig'); + } +} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Migrate/migration.twig b/vendor/drush/drush/src/Commands/generate/Generators/Migrate/migration.twig new file mode 100644 index 0000000000000000000000000000000000000000..0fb1be413c46353c6da13d76c6d544515a47a5d6 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Migrate/migration.twig @@ -0,0 +1,98 @@ +<?php +namespace Drupal\{{ machine_name }}\Plugin\migrate\source; + +use Drupal\migrate\Plugin\migrate\source\SqlBase; +use Drupal\migrate\Row; + +/** + * Migrate Source plugin. + * + * @MigrateSource( + * id = "{{ plugin_id }}" + * ) + */ +class {{ class }} extends SqlBase { + + /** + * {@inheritdoc} + */ + public function query() { + /** + * An important point to note is that your query *must* return a single row + * for each item to be imported. Here we might be tempted to add a join to + * migrate_example_beer_topic_node in our query, to pull in the + * relationships to our categories. Doing this would cause the query to + * return multiple rows for a given node, once per related value, thus + * processing the same node multiple times, each time with only one of the + * multiple values that should be imported. To avoid that, we simply query + * the base node data here, and pull in the relationships in prepareRow() + * below. + */ + $query = $this->select('migrate_example_beer_node', 'b') + ->fields('b', ['bid', 'name', 'body', 'excerpt', 'aid', + 'countries', 'image', 'image_alt', 'image_title', + 'image_description']); + return $query; + } + + /** + * {@inheritdoc} + */ + public function fields() { + $fields = [ + 'bid' => $this->t('Beer ID'), + 'name' => $this->t('Name of beer'), + 'body' => $this->t('Full description of the beer'), + 'excerpt' => $this->t('Abstract for this beer'), + 'aid' => $this->t('Account ID of the author'), + 'countries' => $this->t('Countries of origin. Multiple values, delimited by pipe'), + 'image' => $this->t('Image path'), + 'image_alt' => $this->t('Image ALT'), + 'image_title' => $this->t('Image title'), + 'image_description' => $this->t('Image description'), + // Note that this field is not part of the query above - it is populated + // by prepareRow() below. You should document all source properties that + // are available for mapping after prepareRow() is called. + 'terms' => $this->t('Applicable styles'), + ]; + + return $fields; + } + + /** + * {@inheritdoc} + */ + public function getIds() { + return [ + 'bid' => [ + 'type' => 'integer', + 'alias' => 'b', + ], + ]; + } + + /** + * {@inheritdoc} + */ + public function prepareRow(Row $row) { + /** + * As explained above, we need to pull the style relationships into our + * source row here, as an array of 'style' values (the unique ID for + * the beer_term migration). + */ + $terms = $this->select('migrate_example_beer_topic_node', 'bt') + ->fields('bt', ['style']) + ->condition('bid', $row->getSourceProperty('bid')) + ->execute() + ->fetchCol(); + $row->setSourceProperty('terms', $terms); + + // As we did for favorite beers in the user migration, we need to explode + // the multi-value country names. + if ($value = $row->getSourceProperty('countries')) { + $row->setSourceProperty('countries', explode('|', $value)); + } + return parent::prepareRow($row); + } + +} diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Migrate/migration.yml.twig b/vendor/drush/drush/src/Commands/generate/Generators/Migrate/migration.yml.twig new file mode 100644 index 0000000000000000000000000000000000000000..4e2e330f2d46cac08ed96a720c7d8201b1b99ea9 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Generators/Migrate/migration.yml.twig @@ -0,0 +1,54 @@ +# Migration configuration for {{ plugin_id }} content. +id: {{ plugin_id }} +label: {{ plugin_label }} +migration_group: {{ migration_group }} +source: + plugin: {{ plugin_id }} +destination: + # Specify the destination plugin (usually entity:entity_type). + plugin: {{ destination_plugin }} +process: + # Hardcode the destination node type (bundle) as 'migrate_example_beer'. + type: + plugin: default_value + default_value: migrate_example_beer + title: name + nid: bid + uid: + plugin: migration + migration: beer_user + source: aid + sticky: + plugin: default_value + default_value: 0 + field_migrate_example_country: countries + field_migrate_example_beer_style: + plugin: migration + migration: beer_term + source: terms + # Some Drupal fields may have multiple components we may want to set + # separately. For example, text fields may have summaries (teasers) in + # addition to the full text value. We use / to separate the field name from + # the internal field value being set, and put it in quotes because / is a + # YAML special character. + 'body/value': body + 'body/summary': excerpt +# Our beer nodes have references to terms and users, so we want those to be +# imported first. We make that dependency explicit here - by putting those +# migrations under the 'required' key, we ensure that the tools will prevent +# us from running the beer_node migration unless the beer_term and beer_user +# migrations are complete (although we can override the dependency check by +# passing --force to the drush migrate-import command). We can also add +# 'optional' dependencies - these affect the order in which migrations are +# displayed, and run by default, but does not force you run them in that +# order. +# The general rule of thumb is that any migrations referenced by migration +# process plugins should be required here. +migration_dependencies: + required: + - beer_term + - beer_user +dependencies: + enforced: + module: + - migrate_example diff --git a/vendor/drush/drush/src/Commands/generate/Helper/InputHandler.php b/vendor/drush/drush/src/Commands/generate/Helper/InputHandler.php new file mode 100644 index 0000000000000000000000000000000000000000..251a4eba7b44a703100a7ff855f1d16481723393 --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Helper/InputHandler.php @@ -0,0 +1,187 @@ +<?php + +namespace Drush\Commands\generate\Helper; + +use Drush\Drush; +use DrupalCodeGenerator\Helper\InputHandler as BaseInputHandler; +use DrupalCodeGenerator\Utils; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Generators input handler. + */ +class InputHandler extends BaseInputHandler +{ + + /** + * {@inheritdoc} + */ + public function collectVars(InputInterface $input, OutputInterface $output, array $questions, array $vars = []) + { + /** @var \DrupalCodeGenerator\Command\GeneratorInterface $command */ + $command = $this->getHelperSet()->getCommand(); + $destination = $command->getDestination(); + + $this->preprocessQuestions($questions, $destination); + + $existing_extension = in_array($destination, ['modules/%', 'themes/%']); + + // If both name and machine_name questions are defined it is quite + // possible that we can provide the extension name without interacting + // with a user. + if (isset($questions['name'], $questions['machine_name']) && $existing_extension) { + // Collect only machine_name answer. + $vars += parent::collectVars($input, $output, ['machine_name' => $questions['machine_name']]); + unset($questions['machine_name']); + + if ($destination == 'modules/%') { + $moduleHandler = \Drupal::moduleHandler(); + if ($moduleHandler->moduleExists($vars['machine_name'])) { + $vars['name'] = $moduleHandler->getName($vars['machine_name']); + unset($questions['name']); + } + } elseif ($destination == 'themes/%') { + $themeHandler = \Drupal::service('theme_handler'); + if ($themeHandler->themeExists($vars['machine_name'])) { + $vars['name'] = $themeHandler->getName($vars['machine_name']); + unset($questions['name']); + } + } + } + + // Collect all other variables. + $vars += parent::collectVars($input, $output, $questions, $vars); + + // Set an appropriate directory for dumped files. + if (empty($input->getOption('directory')) && ($directory = $this->getDirectory($vars, $destination))) { + $command->setDirectory($directory); + } + + return $vars; + } + + /** + * Modifies questions for better DX. + * + * @param \Symfony\Component\Console\Question\Question[] $questions + * List of questions to modify. + * @param string $destination + * The destination for dumped files. + */ + protected function preprocessQuestions(array &$questions, $destination) + { + if (!isset($questions['machine_name'])) { + return; + } + + $root_directory = basename(Utils::getExtensionRoot(Drush::config()->cwd())); + + // Module related generators. + if ($destination == 'modules/%') { + // Prepare list of modules. + $modules = []; + $moduleHandler = \Drupal::moduleHandler(); + foreach ($moduleHandler->getModuleList() as $machine_name => $module) { + $modules[$machine_name] = $moduleHandler->getName($machine_name); + } + + // Name question. + if (isset($questions['name'])) { + $questions['name']->setAutocompleterValues($modules); + $default_name = $root_directory ? Utils::machine2human($root_directory) : ''; + $this->setQuestionDefault($questions['name'], $default_name); + } + + // Machine name question. + $questions['machine_name']->setAutocompleterValues(array_keys($modules)); + $default_machine_name = $root_directory ? Utils::human2machine($root_directory) : ''; + $this->setQuestionDefault($questions['machine_name'], $default_machine_name); + + // Theme related generators. + } elseif ($destination == 'themes/%') { + // Prepare list of themes. + $themes = []; + foreach (\Drupal::service('theme_handler')->listInfo() as $machine_name => $theme) { + $themes[$machine_name] = $theme->info['name']; + } + + // Name question. + if (isset($questions['name'])) { + $questions['name']->setAutocompleterValues(array_values($themes)); + } + + // Machine name question. + $questions['machine_name']->setAutocompleterValues(array_keys($themes)); + $default_machine_name = $root_directory ? Utils::human2machine($root_directory) : ''; + $this->setQuestionDefault($questions['machine_name'], $default_machine_name); + } elseif (isset($questions['name'])) { + // For other generator types simply reset default value set by DCG. + $this->setQuestionDefault($questions['name'], ''); + } + } + + /** + * Defines the directory where generated files should be dumped. + * + * @param array $vars + * Collected variables. + * @param string|bool $destination + * The destination for dumped files. + * + * @return string $directory + * The directory to dump file or false it cannot be determined. + */ + protected function getDirectory(array $vars, $destination) + { + + // Check if the generator can handle it itself. + if (is_callable($destination)) { + $directory = $destination($vars); + } else { + $modules_dir = is_dir(DRUPAL_ROOT . '/modules/custom') ? + 'modules/custom' : 'modules'; + + $directory = false; + switch ($destination) { + case 'modules': + $directory = $modules_dir; + break; + + case 'themes': + $directory = 'themes'; + break; + + case 'modules/%': + if (isset($vars['machine_name'])) { + $machine_name = $vars['machine_name']; + $modules = \Drupal::moduleHandler()->getModuleList(); + $directory = isset($modules[$machine_name]) + ? $modules[$machine_name]->getPath() + : $modules_dir . '/' . $machine_name; + } + break; + + case 'themes/%': + if (isset($vars['machine_name'])) { + $machine_name = $vars['machine_name']; + $themes = \Drupal::service('theme_handler')->listInfo(); + $directory = isset($themes[$machine_name]) + ? $themes[$machine_name]->getPath() + : 'themes/' . $machine_name; + } + break; + + case 'profiles': + $directory = 'profiles'; + break; + + case 'sites/default': + $directory = 'sites/default'; + break; + } + } + + return $directory; + } +} diff --git a/vendor/drush/drush/src/Commands/generate/Helper/OutputHandler.php b/vendor/drush/drush/src/Commands/generate/Helper/OutputHandler.php new file mode 100644 index 0000000000000000000000000000000000000000..f74d6b8b5b2d0e2a001b93e98fa9d956840f0bdd --- /dev/null +++ b/vendor/drush/drush/src/Commands/generate/Helper/OutputHandler.php @@ -0,0 +1,40 @@ +<?php + +namespace Drush\Commands\generate\Helper; + +use Consolidation\SiteProcess\Util\Escape; +use DrupalCodeGenerator\Helper\OutputHandler as BaseOutputHandler; +use Drush\Drush; +use Symfony\Component\Console\Output\OutputInterface; +use Webmozart\PathUtil\Path; + +/** + * Output printer form generators. + */ +class OutputHandler extends BaseOutputHandler +{ + + /** + * {@inheritdoc} + */ + public function printSummary(OutputInterface $output, array $dumped_files) + { + /** @var \DrupalCodeGenerator\Command\GeneratorInterface $command */ + $command = $this->getHelperSet()->getCommand(); + $directory = $command->getDirectory(); + + // Make the paths relative to Drupal root directory. + foreach ($dumped_files as &$file) { + $file = Path::join($directory, $file); + } + + if (defined('DRUPAL_ROOT') && $dumped_files) { + $exec = drush_get_editor(); + $exec = str_replace('%s', Escape::shellArg(Path::makeAbsolute($dumped_files[0], DRUPAL_ROOT)), $exec); + $process = Drush::shell($exec); + // Use start() in order to get an async fork. + $process->start(); + } + parent::printSummary($output, $dumped_files); + } +} diff --git a/vendor/drush/drush/src/Commands/help/DrushHelpDocument.php b/vendor/drush/drush/src/Commands/help/DrushHelpDocument.php new file mode 100644 index 0000000000000000000000000000000000000000..1d28c42e53b8a634ceb4356e2db049bf173313b8 --- /dev/null +++ b/vendor/drush/drush/src/Commands/help/DrushHelpDocument.php @@ -0,0 +1,26 @@ +<?php + +namespace Drush\Commands\help; + +use Consolidation\AnnotatedCommand\Help\HelpDocument; +use Symfony\Component\Console\Command\Command; + +class DrushHelpDocument extends HelpDocument +{ + + /** + * @inheritdoc + */ + public function generateBaseHelpDom(Command $command) + { + // Global options should not appear in our help output. + $command->setApplication(null); + + return parent::generateBaseHelpDom($command); + } + + protected function alterHelpDocument(Command $command, \DomDocument $dom) + { + return parent::alterHelpDocument($command, $dom); + } +} diff --git a/vendor/drush/drush/src/Commands/help/HelpCLIFormatter.php b/vendor/drush/drush/src/Commands/help/HelpCLIFormatter.php new file mode 100644 index 0000000000000000000000000000000000000000..b632a433567dbb51d96360a72788ae88e5f68ecb --- /dev/null +++ b/vendor/drush/drush/src/Commands/help/HelpCLIFormatter.php @@ -0,0 +1,144 @@ +<?php +namespace Drush\Commands\help; + +use Consolidation\OutputFormatters\FormatterManager; +use Consolidation\OutputFormatters\Formatters\FormatterInterface; +use Consolidation\OutputFormatters\Options\FormatterOptions; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drush\Drush; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Format an array into CLI help string. + */ +class HelpCLIFormatter implements FormatterInterface +{ + + /** + * @inheritdoc + */ + public function write(OutputInterface $output, $data, FormatterOptions $options) + { + $formatterManager = new FormatterManager(); + + $output->writeln($data['description']); + if (array_key_exists('help', $data) && $data['help'] != $data['description']) { + $output->writeln(''); + $output->writeln($data['help']); + } + + if (array_key_exists('examples', $data)) { + $output->writeln(''); + $output->writeln('<comment>Examples:</comment>'); + foreach ($data['examples'] as $example) { + $rows[] = [' ' . $example['usage'], $example['description']]; + } + $formatterManager->write($output, 'table', new RowsOfFields($rows), $options); + } + + if (array_key_exists('arguments', $data)) { + $rows = []; + $output->writeln(''); + $output->writeln('<comment>Arguments:</comment>'); + foreach ($data['arguments'] as $argument) { + $formatted = $this->formatArgumentName($argument); + $description = $argument['description']; + // @todo No argument default in Helpdocument + // if ($argument['default']) { + // $description .= ' [default: ' . $argument->getDefault() . ']'; + // } + $rows[] = [' ' . $formatted, $description]; + } + $formatterManager->write($output, 'table', new RowsOfFields($rows), $options); + } + + $this->cleanOptions($data); + if (!empty($data['options'])) { + $rows = []; + $output->writeln(''); + $output->writeln('<comment>Options:</comment>'); + foreach ($data['options'] as $option) { + if (substr($option['name'], 0, 8) !== '--notify' && substr($option['name'], 0, 5) !== '--xh-' && substr($option['name'], 0, 11) !== '--druplicon') { + $rows[] = [$this->formatOptionKeys($option), $this->formatOptionDescription($option)]; + } + } + $formatterManager->write($output, 'table', new RowsOfFields($rows), $options); + } + + if (array_key_exists('topics', $data)) { + $rows = []; + $output->writeln(''); + $output->writeln('<comment>Topics:</comment>'); + foreach ($data['topics'] as $topic) { + $topic_command = Drush::getApplication()->find($topic); + $rows[] = [' drush topic ' . $topic, $topic_command->getDescription()]; + } + $formatterManager->write($output, 'table', new RowsOfFields($rows), $options); + } + + // @todo Fix this variability in key name upstream. + if (array_key_exists('aliases', $data) ? $data['aliases'] : (array_key_exists('alias', $data) ? [$data['alias']] : [])) { + $output->writeln(''); + $output->writeln('<comment>Aliases:</comment> ' . implode(', ', $data['aliases'])); + } + } + + /** + * @param array $option + * @return string + */ + public static function formatOptionKeys($option) + { + // Remove leading dashes. + $option['name'] = substr($option['name'], 2); + + $value = ''; + if ($option['accept_value']) { + $value = '='.strtoupper($option['name']); + + if (!$option['is_value_required']) { + $value = '['.$value.']'; + } + } + + $synopsis = sprintf( + '%s%s', + $option['shortcut'] ? sprintf('-%s, ', $option['shortcut']) : ' ', + sprintf('--%s%s', $option['name'], $value) + ); + return $synopsis; + } + + public static function formatOptionDescription($option) + { + $defaults = array_key_exists('defaults', $option) ? ' [default: "' . implode(' ', $option['defaults']) . '"]' : ''; + return $option['description'] . $defaults; + } + + public function formatArgumentName($argument) + { + $element = $argument['name']; + if (!$argument['is_required']) { + $element = '['.$element.']'; + } elseif ($argument['is_array']) { + $element = $element.' ('.$element.')'; + } + + if ($argument['is_array']) { + $element .= '...'; + } + + return $element; + } + + protected function cleanOptions(&$data) + { + if (array_key_exists('options', $data)) { + foreach ($data['options'] as $key => $option) { + if (substr($option['name'], 0, 8) == '--notify' || substr($option['name'], 0, 5) == '--xh-' || substr($option['name'], 0, 11) == '--druplicon') { + unset($data['options'][$key]); + } + } + } + } +} diff --git a/vendor/drush/drush/src/Commands/help/HelpCommands.php b/vendor/drush/drush/src/Commands/help/HelpCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..46eb304ca8f758201acb2d0b2e2eed925da34f30 --- /dev/null +++ b/vendor/drush/drush/src/Commands/help/HelpCommands.php @@ -0,0 +1,62 @@ +<?php +namespace Drush\Commands\help; + +use Consolidation\AnnotatedCommand\AnnotatedCommand; +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Drush\Drush; + +class HelpCommands extends DrushCommands +{ + + /** + * Display usage details for a command. + * + * @command help + * @param $command_name A command name + * @usage drush help pm-uninstall + * Show help for a command. + * @usage drush help pmu + * Show help for a command using an alias. + * @usage drush help --format=xml + * Show all available commands in XML format. + * @usage drush help --format=json + * All available commands, in JSON format. + * @bootstrap max + * @topics docs:readme + * + * @return \Consolidation\AnnotatedCommand\Help\HelpDocument + */ + public function help($command_name = '', $options = ['format' => 'helpcli', 'include-field-labels' => false, 'table-style' => 'compact']) + { + $application = Drush::getApplication(); + $command = $application->get($command_name); + if ($command instanceof AnnotatedCommand) { + $command->optionsHook(); + } + $helpDocument = new DrushHelpDocument($command); + + // This serves as example about how a command can add a custom Formatter. + $formatter = new HelpCLIFormatter(); + $formatterManager = Drush::getContainer()->get('formatterManager'); + $formatterManager->addFormatter('helpcli', $formatter); + + return $helpDocument; + } + + /** + * @hook validate help + */ + public function validate(CommandData $commandData) + { + $name = $commandData->input()->getArgument('command_name'); + if (empty($name)) { + throw new \Exception(dt("The help command requires that a command name be provided. Run `drush list` to see a list of available commands.")); + } else { + $application = Drush::getApplication(); + if (!in_array($name, array_keys($application->all()))) { + throw new \Exception(dt("!name command not found.", ['!name' => $name])); + } + } + } +} diff --git a/vendor/drush/drush/src/Commands/help/ListCommands.php b/vendor/drush/drush/src/Commands/help/ListCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..1c7a967403c63462af2048758fa369cf122086a3 --- /dev/null +++ b/vendor/drush/drush/src/Commands/help/ListCommands.php @@ -0,0 +1,224 @@ +<?php +namespace Drush\Commands\help; + +use Consolidation\AnnotatedCommand\Help\HelpDocument; +use Consolidation\OutputFormatters\FormatterManager; +use Consolidation\OutputFormatters\Options\FormatterOptions; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Descriptor\JsonDescriptor; +use Symfony\Component\Console\Descriptor\XmlDescriptor; +use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Output\OutputInterface; + +class ListCommands extends DrushCommands +{ + /** + * List available commands. + * + * @command list + * @option filter Restrict command list to those commands defined in the specified file. Omit value to choose from a list of names. + * @option raw Show a simple table of command names and descriptions. + * @bootstrap max + * @usage drush list + * List all commands. + * @usage drush list --filter=devel_generate + * Show only commands starting with devel- + * @usage drush list --format=xml + * List all commands in Symfony compatible xml format. + * + * @return string + */ + public function helpList($options = ['format' => 'listcli', 'raw' => false, 'filter' => self::REQ]) + { + $application = Drush::getApplication(); + $all = $application->all(); + $namespaced = $this->categorize($all); + + // Filter out namespaces that the user does not want to see + $filter_category = $options['filter']; + if (!empty($filter_category)) { + if (!array_key_exists($filter_category, $namespaced)) { + throw new \Exception(dt("The specified command category !filter does not exist.", ['!filter' => $filter_category])); + } + $namespaced = [$filter_category => $namespaced[$filter_category]]; + } + + /** + * The listcli,json and raw formats don't yet go through the output formatter system. + * because \Consolidation\OutputFormatters\Transformations\DomToArraySimplifier + * can't yet handle the DomDocument that produces the Symfony expected XML. For consistency, the XML + * output chooses to use the Symfony descriptor as well. + */ + if ($options['raw']) { + $this->renderListRaw($namespaced); + return null; + } elseif ($options['format'] == 'listcli') { + $preamble = dt('Run `drush help [command]` to view command-specific help. Run `drush topic` to read even more documentation.'); + $this->renderListCLI($application, $namespaced, $this->output(), $preamble); + if (!Drush::bootstrapManager()->hasBootstrapped((DRUSH_BOOTSTRAP_DRUPAL_ROOT))) { + $this->io()->note(dt('Drupal root not found. Pass --root or a @siteAlias in order to see Drupal-specific commands.')); + } + return null; + } elseif ($options['format'] == 'xml') { + $descriptor = new XmlDescriptor($this->output(), []); + return $descriptor->describe($this->output, $application, []); + } elseif ($options['format'] == 'json') { + $descriptor = new JsonDescriptor($this->output(), []); + return $descriptor->describe($this->output, $application, []); + } else { + // No longer used. Works for XML, but gives error for JSON. + // $dom = $this->buildDom($namespaced, $application); + // return $dom; + } + } + + /** + * @param $namespaced + * @param $application + * @return \DOMDocument + */ + public function buildDom($namespaced, $application) + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + $rootXml = $dom->createElement('symfony'); + $rootXml->setAttribute('name', $application->getName()); + if ($application->getVersion() !== 'UNKNOWN') { + $rootXml->setAttribute('version', $application->getVersion()); + } + + + // Create two top level elements. + $commandsXML = $dom->createElement('commands'); + $namespacesXML = $dom->createElement('namespaces'); + + foreach ($namespaced as $namespace => $commands) { + $namespaceXML = $dom->createElement('namespace'); + $namespaceXML->setAttribute('id', $namespace); + foreach ($commands as $key => $command) { + $helpDocument = new HelpDocument($command); + $domData = $helpDocument->getDomData(); + $node = $domData->getElementsByTagName("command")->item(0); + $element = $dom->importNode($node, true); + $commandsXML->appendChild($element); + + $ncommandXML = $dom->createElement('command', $key); + $namespaceXML->appendChild($ncommandXML); + } + $namespacesXML->appendChild($namespaceXML); + } + + // Append top level elements to root element in correct order. + $rootXml->appendChild($commandsXML); + $rootXml->appendChild($namespacesXML); + $dom->appendChild($rootXml); + return $dom; + } + + /** + * @param \Symfony\Component\Console\Application $application + * @param array $namespaced + * @param OutputInterface $output + * @param string $preamble + */ + public static function renderListCLI($application, $namespaced, $output, $preamble) + { + $output->writeln($application->getHelp()); + $output->writeln(''); + $output + ->writeln($preamble); + $output->writeln(''); + + $rows[] = ['Available commands:', '']; + foreach ($namespaced as $namespace => $list) { + $rows[] = ['<comment>' . $namespace . ':</comment>', '']; + foreach ($list as $name => $command) { + $description = $command->getDescription(); + + // For commands such as foo:bar, remove + // any alias 'foo-bar' from the alias list. + $aliasList = array_filter( + $command->getAliases(), + function ($aliasName) use ($name) { + return $aliasName != str_replace(':', '-', $name); + } + ); + + $aliases = implode(', ', $aliasList); + $suffix = $aliases ? " ($aliases)" : ''; + $rows[] = [' ' . $name . $suffix, $description]; + } + } + $formatterManager = new FormatterManager(); + list($terminalWidth,) = $application->getTerminalDimensions(); + $opts = [ + FormatterOptions::INCLUDE_FIELD_LABELS => false, + FormatterOptions::TABLE_STYLE => 'compact', + FormatterOptions::TERMINAL_WIDTH => $terminalWidth, + ]; + $formatterOptions = new FormatterOptions([], $opts); + + $formatterManager->write($output, 'table', new RowsOfFields($rows), $formatterOptions); + } + + public function getTerminalWidth() + { + // From \Consolidation\AnnotatedCommand\Options\PrepareTerminalWidthOption::getTerminalWidth + $application = Drush::getApplication(); + $dimensions = $application->getTerminalDimensions(); + if ($dimensions[0] == null) { + return 0; + } + return $dimensions[0]; + } + + /** + * @param array $namespaced + */ + public function renderListRaw($namespaced) + { + $table = new Table($this->output()); + $table->setStyle('compact'); + foreach ($namespaced as $namespace => $commands) { + foreach ($commands as $command) { + $table->addRow([$command->getName(), $command->getDescription()]); + } + } + $table->render(); + } + + /** + * @param Command[] $all + * @param string $separator + * + * @return array + */ + public static function categorize($all, $separator = ':') + { + foreach ($all as $key => $command) { + if (!in_array($key, $command->getAliases()) && !$command->isHidden()) { + $parts = explode($separator, $key); + $namespace = count($parts) >= 2 ? array_shift($parts) : '_global'; + $namespaced[$namespace][$key] = $command; + } + } + + // Avoid solo namespaces. + foreach ($namespaced as $namespace => $commands) { + if (count($commands) == 1) { + $namespaced['_global'] += $commands; + unset($namespaced[$namespace]); + } + } + + ksort($namespaced); + + // Sort inside namespaces. + foreach ($namespaced as $key => &$items) { + ksort($items); + } + return $namespaced; + } +} diff --git a/vendor/drush/drush/src/Commands/pm/SecurityUpdateCommands.php b/vendor/drush/drush/src/Commands/pm/SecurityUpdateCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..95cdc82fac746c3b8db5c6e665a806e267ac8a4e --- /dev/null +++ b/vendor/drush/drush/src/Commands/pm/SecurityUpdateCommands.php @@ -0,0 +1,146 @@ +<?php +namespace Drush\Commands\pm; + +use Composer\Semver\Semver; +use Consolidation\AnnotatedCommand\CommandResult; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Exception; +use Webmozart\PathUtil\Path; + +/** + * Check Drupal Composer packages for security updates. + */ +class SecurityUpdateCommands extends DrushCommands +{ + /** + * Check Drupal Composer packages for pending security updates. + * + * This uses the Drupal security advisories package to determine if updates + * are available. + * + * @see https://github.com/drupal-composer/drupal-security-advisories + * + * @command pm:security + * @aliases sec,pm-security + * @bootstrap none + * @table-style default + * @field-labels + * name: Name + * version: Installed Version + * @default-fields name,version + * + * @filter-default-field name + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + * + * @throws \Exception + */ + public function security() + { + $security_advisories_composer_json = $this->fetchAdvisoryComposerJson(); + $composer_lock_data = $this->loadSiteComposerLock(); + $updates = $this->calculateSecurityUpdates($composer_lock_data, $security_advisories_composer_json); + if ($updates) { + $this->suggestComposerCommand($updates); + return CommandResult::dataWithExitCode(new RowsOfFields($updates), self::EXIT_FAILURE); + } else { + $this->logger()->success("<info>There are no outstanding security updates for Drupal projects.</info>"); + } + } + + /** + * Emit suggested Composer command for security updates. + */ + public function suggestComposerCommand($updates) + { + $suggested_command = 'composer require '; + foreach ($updates as $package) { + $suggested_command .= $package['name'] . ' '; + } + $suggested_command .= '--update-with-dependencies'; + $this->logger()->warning('One or more of your dependencies has an outstanding security update.'); + $this->logger()->notice("Try running: <comment>$suggested_command</comment>"); + $this->logger()->notice("If that fails due to a conflict then you must update one or more root dependencies."); + } + + /** + * Fetches the generated composer.json from drupal-security-advisories. + * + * @return mixed + * + * @throws \Exception + */ + protected function fetchAdvisoryComposerJson() + { + try { + // We use the v2 branch for now, as per https://github.com/drupal-composer/drupal-security-advisories/pull/11. + $response_body = file_get_contents('https://raw.githubusercontent.com/drupal-composer/drupal-security-advisories/8.x-v2/composer.json'); + if ($response_body === false) { + throw new Exception("Unable to fetch drupal-security-advisories information."); + } + } catch (Exception $e) { + throw new Exception("Unable to fetch drupal-security-advisories information."); + } + $security_advisories_composer_json = json_decode($response_body, true); + return $security_advisories_composer_json; + } + + /** + * Loads the contents of the local Drupal application's composer.lock file. + * + * @return array + * + * @throws \Exception + */ + protected function loadSiteComposerLock() + { + $composer_root = Drush::bootstrapManager()->getComposerRoot(); + $composer_lock_file_name = getenv('COMPOSER') ? str_replace( + '.json', + '', + getenv('COMPOSER') + ) : 'composer'; + $composer_lock_file_name .= '.lock'; + $composer_lock_file_path = Path::join( + $composer_root, + $composer_lock_file_name + ); + if (!file_exists($composer_lock_file_path)) { + throw new Exception("Cannot find $composer_lock_file_path!"); + } + $composer_lock_contents = file_get_contents($composer_lock_file_path); + $composer_lock_data = json_decode($composer_lock_contents, true); + if (!array_key_exists('packages', $composer_lock_data)) { + throw new Exception("No packages were found in $composer_lock_file_path! Contents:\n $composer_lock_contents"); + } + return $composer_lock_data; + } + + /** + * Return available security updates. + * + * @param array $composer_lock_data + * The contents of the local Drupal application's composer.lock file. + * @param array $security_advisories_composer_json + * The composer.json array from drupal-security-advisories. + * + * @return array + */ + protected function calculateSecurityUpdates($composer_lock_data, $security_advisories_composer_json) + { + $updates = []; + $both = array_merge($composer_lock_data['packages-dev'], $composer_lock_data['packages']); + $conflict = $security_advisories_composer_json['conflict']; + foreach ($both as $package) { + $name = $package['name']; + if (!empty($conflict[$name]) && Semver::satisfies($package['version'], $security_advisories_composer_json['conflict'][$name])) { + $updates[$name] = [ + 'name' => $name, + 'version' => $package['version'], + ]; + } + } + return $updates; + } +} diff --git a/vendor/drush/drush/src/Commands/sql/SqlCommands.php b/vendor/drush/drush/src/Commands/sql/SqlCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..8d31329d79606f460fe6fa9354dcde6d8bdb0518 --- /dev/null +++ b/vendor/drush/drush/src/Commands/sql/SqlCommands.php @@ -0,0 +1,274 @@ +<?php +namespace Drush\Commands\sql; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\AnnotatedCommand\Input\StdinAwareInterface; +use Consolidation\AnnotatedCommand\Input\StdinAwareTrait; +use Consolidation\SiteProcess\Util\Tty; +use Drupal\Core\Database\Database; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exceptions\UserAbortException; +use Drush\Exec\ExecTrait; +use Drush\Sql\SqlBase; +use Consolidation\OutputFormatters\StructuredData\PropertyList; +use Symfony\Component\Console\Input\InputInterface; + +class SqlCommands extends DrushCommands implements StdinAwareInterface +{ + use ExecTrait; + use StdinAwareTrait; + + /** + * Print database connection details. + * + * @command sql:conf + * @aliases sql-conf + * @option all Show all database connections, instead of just one. + * @option show-passwords Show database password. + * @optionset_sql + * @bootstrap max configuration + * @hidden + */ + public function conf($options = ['format' => 'yaml', 'all' => false, 'show-passwords' => false]) + { + if ($options['all']) { + $return = Database::getAllConnectionInfo(); + foreach ($return as $key1 => $value) { + foreach ($value as $key2 => $spec) { + if (!$options['show-passwords']) { + unset($return[$key1][$key2]['password']); + } + } + } + } else { + $sql = SqlBase::create($options); + $return = $sql->getDbSpec(); + if (!$options['show-passwords']) { + unset($return['password']); + } + } + return $return; + } + + /** + * A string for connecting to the DB. + * + * @command sql:connect + * @aliases sql-connect + * @option extra Add custom options to the connect string (e.g. --extra=--skip-column-names) + * @optionset_sql + * @bootstrap max configuration + * @usage `drush sql-connect` < example.sql + * Bash: Import SQL statements from a file into the current database. + * @usage eval (drush sql-connect) < example.sql + * Fish: Import SQL statements from a file into the current database. + */ + public function connect($options = ['extra' => self::REQ]) + { + $sql = SqlBase::create($options); + return $sql->connect(false); + } + + /** + * Create a database. + * + * @command sql:create + * @aliases sql-create + * @option db-su Account to use when creating a new database. + * @option db-su-pw Password for the db-su account. + * @optionset_sql + * @usage drush sql:create + * Create the database for the current site. + * @usage drush @site.test sql-create + * Create the database as specified for @site.test. + * @usage drush sql:create --db-su=root --db-su-pw=rootpassword --db-url="mysql://drupal_db_user:drupal_db_password@127.0.0.1/drupal_db" + * Create the database as specified in the db-url option. + * @bootstrap max configuration + */ + public function create($options = ['db-su' => self::REQ, 'db-su-pw' => self::REQ]) + { + $sql = SqlBase::create($options); + $db_spec = $sql->getDbSpec(); + // Prompt for confirmation. + + // @todo odd - maybe for sql-sync. + $txt_destination = (isset($db_spec['remote-host']) ? $db_spec['remote-host'] . '/' : '') . $db_spec['database']; + $this->output()->writeln(dt("Creating database !target. Any existing database will be dropped!", ['!target' => $txt_destination])); + + if (!$this->getConfig()->simulate() && !$this->io()->confirm(dt('Do you really want to continue?'))) { + throw new UserAbortException(); + } + + if (!$sql->createdb(true)) { + throw new \Exception('Unable to create database. Rerun with --debug to see any error message.'); + } + } + + /** + * Drop all tables in a given database. + * + * @command sql:drop + * @aliases sql-drop + * @optionset_sql + * @bootstrap max configuration + * @topics docs:policy + */ + public function drop($options = []) + { + $sql = SqlBase::create($options); + $db_spec = $sql->getDbSpec(); + if (!$this->io()->confirm(dt('Do you really want to drop all tables in the database !db?', ['!db' => $db_spec['database']]))) { + throw new UserAbortException(); + } + $tables = $sql->listTables(); + if (!$sql->drop($tables)) { + throw new \Exception('Unable to drop database. Rerun with --debug to see any error message.'); + } + } + + /** + * Open a SQL command-line interface using Drupal's credentials. + * + * @command sql:cli + * @option extra Add custom options to the connect string + * @optionset_sql + * @aliases sqlc,sql-cli + * @usage drush sql:cli + * Open a SQL command-line interface using Drupal's credentials. + * @usage drush sql:cli --extra=--progress-reports + * Open a SQL CLI and skip reading table information. + * @usage drush sql:cli < example.sql + * Import sql statements from a file into the current database. + * @remote-tty + * @bootstrap max configuration + */ + public function cli(InputInterface $input, $options = ['extra' => self::REQ]) + { + $sql = SqlBase::create($options); + $process = $this->processManager()->shell($sql->connect(), null, $sql->getEnv()); + if (!Tty::isTtySupported()) { + $process->setInput($this->stdin()->getStream()); + } else { + $process->setTty($this->getConfig()->get('ssh.tty', $input->isInteractive())); + } + $process->mustRun($process->showRealtime()); + } + + /** + * Execute a query against a database. + * + * @command sql:query + * @param $query An SQL query. Ignored if --file is provided. + * @optionset_sql + * @option result-file Save to a file. The file should be relative to Drupal root. + * @option file Path to a file containing the SQL to be run. Gzip files are accepted. + * @option file-delete Delete the --file after running it. + * @option extra Add custom options to the connect string (e.g. --extra=--skip-column-names) + * @option db-prefix Enable replacement of braces in your query. + * @validate-file-exists file + * @aliases sqlq,sql-query + * @usage drush sql:query "SELECT * FROM users WHERE uid=1" + * Browse user record. Table prefixes, if used, must be added to table names by hand. + * @usage drush sql:query --db-prefix "SELECT * FROM {users}" + * Browse user record. Table prefixes are honored. Caution: All curly-braces will be stripped. + * @usage `drush sql-connect` < example.sql + * Import sql statements from a file into the current database. + * @usage drush sql:query --file=example.sql + * Alternate way to import sql statements from a file. + * @bootstrap max configuration + * + */ + public function query($query = '', $options = ['result-file' => null, 'file' => self::REQ, 'file-delete' => false, 'extra' => self::REQ, 'db-prefix' => false]) + { + $filename = $options['file']; + // Enable prefix processing when db-prefix option is used. + if ($options['db-prefix']) { + Drush::bootstrapManager()->bootstrapMax(DRUSH_BOOTSTRAP_DRUPAL_DATABASE); + } + if ($this->getConfig()->simulate()) { + if ($query) { + $this->output()->writeln(dt('Simulating sql:query: !q', ['!q' => $query])); + } else { + $this->output()->writeln(dt('Simulating sql:query from file !f', ['!f' => $options['file']])); + } + } else { + $sql = SqlBase::create($options); + $result = $sql->query($query, $filename, $options['result-file']); + if (!$result) { + throw new \Exception(dt('Query failed.')); + } + $this->output()->writeln($sql->getProcess()->getOutput()); + } + return true; + } + + /** + * Exports the Drupal DB as SQL using mysqldump or equivalent. + * + * @command sql:dump + * @aliases sql-dump + * @optionset_sql + * @optionset_table_selection + * @option result-file Save to a file. The file should be relative to Drupal root. If --result-file is provided with the value 'auto', a date-based filename will be created under ~/drush-backups directory. + * @option create-db Omit DROP TABLE statements. Used by Postgres and Oracle only. + * @option data-only Dump data without statements to create any of the schema. + * @option ordered-dump Order by primary key and add line breaks for efficient diffs. Slows down the dump. Mysql only. + * @option gzip Compress the dump using the gzip program which must be in your $PATH. + * @option extra Add custom arguments/options when connecting to database (used internally to list tables). + * @option extra-dump Add custom arguments/options to the dumping of the database (e.g. mysqldump command). + * @usage drush sql:dump --result-file=../18.sql + * Save SQL dump to the directory above Drupal root. + * @usage drush sql:dump --skip-tables-key=common + * Skip standard tables. @see example.drush.yml + * @usage drush sql:dump --extra-dump=--no-data + * Pass extra option to mysqldump command. + * @hidden-options create-db + * @bootstrap max configuration + * @field-labels + * path: Path + * + * @return \Consolidation\OutputFormatters\StructuredData\PropertyList + * + * @notes + * createdb is used by sql-sync, since including the DROP TABLE statements interfere with the import when the database is created. + */ + public function dump($options = ['result-file' => self::REQ, 'create-db' => false, 'data-only' => false, 'ordered-dump' => false, 'gzip' => false, 'extra' => self::REQ, 'extra-dump' => self::REQ, 'format' => 'null']) + { + $sql = SqlBase::create($options); + $return = $sql->dump(); + if ($return === false) { + throw new \Exception('Unable to dump database. Rerun with --debug to see any error message.'); + } + + // SqlBase::dump() returns null if 'result-file' option is empty. + if ($return) { + $this->logger()->success(dt('Database dump saved to !path', ['!path' => $return])); + } + return new PropertyList(['path' => $return]); + } + + /** + * Assert that `mysql` or similar are on the user's PATH. + * + * @hook validate + * @param CommandData $commandData + * @return bool + * @throws \Exception + */ + public function validate(CommandData $commandData) + { + if (in_array($commandData->annotationData()->get('command'), ['sql:connect', 'sql:conf'])) { + // These commands don't require a program. + return; + } + + $sql = SqlBase::create($commandData->options()); + $program = $sql->command(); + + if (!$this->programExists($program)) { + $this->logger->warning(dt('The shell command \'!command\' is required but cannot be found. Please install it and retry.', ['!command' => $program])); + return false; + } + } +} diff --git a/vendor/drush/drush/src/Commands/sql/SqlSyncCommands.php b/vendor/drush/drush/src/Commands/sql/SqlSyncCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..4c7e556519e549c9e90b304425749e70f26a00ca --- /dev/null +++ b/vendor/drush/drush/src/Commands/sql/SqlSyncCommands.php @@ -0,0 +1,247 @@ +<?php +namespace Drush\Commands\sql; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exceptions\UserAbortException; +use Consolidation\SiteAlias\SiteAlias; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Webmozart\PathUtil\Path; + +class SqlSyncCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + /** + * Copy DB data from a source site to a target site. Transfers data via rsync. + * + * @command sql:sync + * @aliases sql-sync + * @param $source A site-alias or the name of a subdirectory within /sites whose database you want to copy from. + * @param $target A site-alias or the name of a subdirectory within /sites whose database you want to replace. + * @optionset_table_selection + * @option no-dump Do not dump the sql database; always use an existing dump file. + * @option no-sync Do not rsync the database dump file from source to target. + * @option runner Where to run the rsync command; defaults to the local site. Can also be 'source' or 'target'. + * @option create-db Create a new database before importing the database dump on the target machine. + * @option db-su Account to use when creating a new database (e.g. root). + * @option db-su-pw Password for the db-su account. + * @option source-dump The path for retrieving the sql-dump on source machine. + * @option target-dump The path for storing the sql-dump on target machine. + * @option extra-dump Add custom arguments/options to the dumping of the database (e.g. mysqldump command). + * @usage drush sql:sync @source @self + * Copy the database from the site with the alias 'source' to the local site. + * @usage drush sql:sync @self @target + * Copy the database from the local site to the site with the alias 'target'. + * @usage drush sql:sync #prod #dev + * Copy the database from the site in /sites/prod to the site in /sites/dev (multisite installation). + * @usage drush sql:sync @source @self --database=foo --strict=0 + * Copy a secondary database whose $databases key is named 'foo'. Additional options to sql:dump may also be passed. + * @topics docs:aliases,docs:policy,docs:configuration,docs:example-sync-via-http + * @throws \Exception + */ + public function sqlsync($source, $target, $options = ['no-dump' => false, 'no-sync' => false, 'runner' => self::REQ, 'create-db' => false, 'db-su' => self::REQ, 'db-su-pw' => self::REQ, 'target-dump' => self::REQ, 'source-dump' => self::OPT]) + { + $manager = $this->siteAliasManager(); + $sourceRecord = $manager->get($source); + $targetRecord = $manager->get($target); + + // Append --strict in case we are calling older versions of Drush. + $global_options = Drush::redispatchOptions() + ['strict' => 0]; + + // Create target DB if needed. + if ($options['create-db']) { + $this->logger()->notice(dt('Starting to create database on target.')); + $process = $this->processManager()->drush($targetRecord, 'sql-create', [], $global_options); + $process->mustRun(); + } + + $source_dump_path = $this->dump($options, $global_options, $sourceRecord); + + $target_dump_path = $this->rsync($options, $sourceRecord, $targetRecord, $source_dump_path); + + $this->import($global_options, $target_dump_path, $targetRecord); + } + + /** + * @hook validate sql-sync + * @throws \Exception + */ + public function validate(CommandData $commandData) + { + $source = $commandData->input()->getArgument('source'); + $target = $commandData->input()->getArgument('target'); + // Get target info for confirmation prompt. + $manager = $this->siteAliasManager(); + if (!$sourceRecord = $manager->get($source)) { + throw new \Exception(dt('Error: no alias record could be found for source !source', ['!source' => $source])); + } + if (!$targetRecord = $manager->get($target)) { + throw new \Exception(dt('Error: no alias record could be found for target !target', ['!target' => $target])); + } + if (!$commandData->input()->getOption('no-dump') && !$source_db_name = $this->databaseName($sourceRecord)) { + throw new \Exception(dt('Error: no database record could be found for source !source', ['!source' => $source])); + } + if (!$target_db_name = $this->databaseName($targetRecord)) { + throw new \Exception(dt('Error: no database record could be found for target !target', ['!target' => $target])); + } + $txt_source = ($sourceRecord->remoteHost() ? $sourceRecord->remoteHost() . '/' : '') . $source_db_name; + $txt_target = ($targetRecord->remoteHost() ? $targetRecord->remoteHost() . '/' : '') . $target_db_name; + + if ($commandData->input()->getOption('no-dump') && !$commandData->input()->getOption('source-dump')) { + throw new \Exception(dt('The --source-dump option must be supplied when --no-dump is specified.')); + } + + if ($commandData->input()->getOption('no-sync') && !$commandData->input()->getOption('target-dump')) { + throw new \Exception(dt('The --target-dump option must be supplied when --no-sync is specified.')); + } + + if (!$this->getConfig()->simulate()) { + $this->output()->writeln(dt("You will destroy data in !target and replace with data from !source.", [ + '!source' => $txt_source, + '!target' => $txt_target + ])); + if (!$this->io()->confirm(dt('Do you really want to continue?'))) { + throw new UserAbortException(); + } + } + } + + public function databaseName(SiteAlias $record) + { + if ($this->processManager()->hasTransport($record) && $this->getConfig()->simulate()) { + return 'simulated_db'; + } + + $process = $this->processManager()->drush($record, 'core-status', ['db-name'], ['format' => 'json']); + $process->setSimulated(false); + $process->mustRun(); + $data = $process->getOutputAsJson(); + if (!isset($data['db-name'])) { + throw new \Exception('Could not look up database name for ' . $record->name()); + } + return trim($data['db-name']); + } + + /** + * Perform sql-dump on source unless told otherwise. + * + * @param $options + * @param $global_options + * @param $sourceRecord + * + * @return string + * Path to the source dump file. + * @throws \Exception + */ + public function dump($options, $global_options, $sourceRecord) + { + $dump_options = $global_options + [ + 'gzip' => true, + 'result-file' => $options['source-dump'] ?: 'auto', + ]; + if (!$options['no-dump']) { + $this->logger()->notice(dt('Starting to dump database on source.')); + // Set --backend=json. Drush 9.6+ changes that to --format=json. See \Drush\Preflight\PreflightArgs::setBackend. + // Drush 9.5- handles this as --backend. + $process = $this->processManager()->drush($sourceRecord, 'sql-dump', [], $dump_options + ['backend' => 'json']); + $process->mustRun(); + + if ($this->getConfig()->simulate()) { + $source_dump_path = '/simulated/path/to/dump.tgz'; + } else { + // First try a Drush 9.6+ return format. + $json = $process->getOutputAsJson(); + if (!empty($json['path'])) { + $source_dump_path = $json['path']; + } else { + // Next, try 9.5- format. + $return = drush_backend_parse_output($process->getOutput()); + if (!$return['error_status'] || !empty($return['object'])) { + $source_dump_path = $return['object']; + } + } + } + } else { + $source_dump_path = $options['source-dump']; + } + + if (empty($source_dump_path)) { + throw new \Exception(dt('The Drush sql:dump command did not report the path to the dump file.')); + } + return $source_dump_path; + } + + /** + * @param array $options + * @param SiteAlias $sourceRecord + * @param SiteAlias $targetRecord + * @param $source_dump_path + * @return string + * Path to the target file. + * @throws \Exception + */ + public function rsync($options, SiteAlias $sourceRecord, SiteAlias $targetRecord, $source_dump_path) + { + $do_rsync = !$options['no-sync']; + // Determine path/to/dump on target. + if ($options['target-dump']) { + $target_dump_path = $options['target-dump']; + } elseif (!$sourceRecord->isRemote() && !$targetRecord->isRemote()) { + $target_dump_path = $source_dump_path; + $do_rsync = false; + } else { + $tmp = '/tmp'; // Our fallback plan. + $this->logger()->notice(dt('Starting to discover temporary files directory on target.')); + $process = $this->processManager()->drush($targetRecord, 'core-status', ['drush-temp'], ['format' => 'string']); + $process->setSimulated(false); + $process->run(); + + if ($process->isSuccessful()) { + $tmp = trim($process->getOutput()); + } + $target_dump_path = Path::join($tmp, basename($source_dump_path)); + } + + if ($do_rsync) { + $double_dash_options = []; + if (!$options['no-dump']) { + // Cleanup if this command created the dump file. + $double_dash_options['remove-source-files'] = true; + } + if (!$runner = $options['runner']) { + $runner = $sourceRecord->isRemote() && $targetRecord->isRemote() ? $targetRecord : $this->siteAliasManager()->getSelf(); + } + if ($runner == 'source') { + $runner = $sourceRecord; + } + if (($runner == 'target') || ($runner == 'destination')) { + $runner = $targetRecord; + } + $this->logger()->notice(dt('Copying dump file from source to target.')); + $process = $this->processManager()->drush($runner, 'core-rsync', [$sourceRecord->name() . ":$source_dump_path", $targetRecord->name() . ":$target_dump_path"], [], $double_dash_options); + $process->mustRun($process->showRealtime()); + } + return $target_dump_path; + } + + /** + * Import file into target. + * + * @param $global_options + * @param $target_dump_path + * @param $targetRecord + */ + public function import($global_options, $target_dump_path, $targetRecord) + { + $this->logger()->notice(dt('Starting to import dump file onto target database.')); + $query_options = $global_options + [ + 'file' => $target_dump_path, + 'file-delete' => true, + ]; + $process = $this->processManager()->drush($targetRecord, 'sql-query', [], $query_options); + $process->mustRun(); + } +} diff --git a/vendor/drush/drush/src/Config/ConfigAwareTrait.php b/vendor/drush/drush/src/Config/ConfigAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..c0f317c84f8a1a75b0f4da768445d1154f2ecd7f --- /dev/null +++ b/vendor/drush/drush/src/Config/ConfigAwareTrait.php @@ -0,0 +1,22 @@ +<?php +namespace Drush\Config; + +trait ConfigAwareTrait +{ + use \Robo\Common\ConfigAwareTrait { + \Robo\Common\ConfigAwareTrait::getConfig as parentGetConfig; + } + + /** + * Replaces same method in ConfigAwareTrait in order to provide a + * DrushConfig as return type. Helps with IDE completion. + * + * @see https://stackoverflow.com/a/37687295. + * + * @return \Drush\Config\DrushConfig + */ + public function getConfig() + { + return $this->parentGetConfig(); + } +} diff --git a/vendor/drush/drush/src/Config/ConfigLocator.php b/vendor/drush/drush/src/Config/ConfigLocator.php new file mode 100644 index 0000000000000000000000000000000000000000..445a18d6af5d924b025a7f47e24c7b6b64e9af45 --- /dev/null +++ b/vendor/drush/drush/src/Config/ConfigLocator.php @@ -0,0 +1,557 @@ +<?php +namespace Drush\Config; + +use Consolidation\Config\Loader\ConfigLoaderInterface; +use Drush\Config\Loader\YamlConfigLoader; +use Consolidation\Config\Loader\ConfigProcessor; +use Consolidation\Config\Util\EnvConfig; +use Webmozart\PathUtil\Path; + +/** + * Locate Drush configuration files and load them into the configuration + * instance. + * + * This class knows how to find all of the global and site-local + * configuration files for Drush, as long as it is provided with + * the necessary base directories: + * + * - The user's home directory + * - The values provided for --config and --alias-path + * - The Drupal root + * + * There are two operating modes that are supported: + * + * - Normal: All config locations are used. + * - Local: The global locations are omitted. + * + * The mode is set via the `setLocal()` method. + */ +class ConfigLocator +{ + /** + * @var \Robo\Config + */ + protected $config; + + protected $isLocal; + + protected $sources = false; + + protected $siteRoots = []; + + protected $composerRoot; + + protected $configFilePaths = []; + + protected $configFileVariant; + + protected $processedConfigPaths = []; + + /* + * From context.inc: + * + * Specified by the script itself : + * process : Generated in the current process. + * cli : Passed as --option=value to the command line. + * stdin : Passed as a JSON encoded string through stdin. + * specific : Defined in a command-specific option record, and + * set in the command context whenever that command is used. + * alias : Defined in an alias record, and set in the + * alias context whenever that alias is used. + * + * Specified by config files : + * custom : Loaded from the config file specified by --config or -c + * site : Loaded from the drush.yml file in the Drupal site directory. + * drupal : Loaded from the drush.yml file in the Drupal root directory. + * user : Loaded from the drush.yml file in the user's home directory. + * home.drush Loaded from the drush.yml file in the $HOME/.drush directory. + * system : Loaded from the drush.yml file in the system's $PREFIX/etc/drush directory. + * drush : Loaded from the drush.yml file in the same directory as drush.php. + * + * Specified by the script, but has the lowest priority : + * default : The script might provide some sensible defaults during init. + */ + + // 'process' context is provided by ConfigOverlay + const ENVIRONMENT_CONTEXT = 'environment'; // This is more of a 'runtime' context + const PREFLIGHT_CONTEXT = 'cli'; + // 'stdin' context not implemented + // 'specific' context obsolete; command-specific options handled differently by annotated command library + const ALIAS_CONTEXT = 'alias'; + // custom context is obsolete (loaded in USER_CONTEXT) + const SITE_CONTEXT = 'site'; + const DRUPAL_CONTEXT = 'drupal'; + const USER_CONTEXT = 'user'; + // home.drush is obsolete (loaded in USER_CONTEXT) + // system context is obsolete (loaded in USER_CONTEXT - note priority change) + const ENV_CONTEXT = 'env'; + const DRUSH_CONTEXT = 'drush'; + + // 'default' context is provided by ConfigOverlay + + /** + * ConfigLocator constructor + */ + public function __construct($envPrefix = '', $configFileVariant = '') + { + $this->configFileVariant = $configFileVariant; + $this->config = new DrushConfig(); + + // Add placeholders to establish priority. We add + // contexts from lowest to highest priority. + $this->config->addPlaceholder(self::DRUSH_CONTEXT); + if (!empty($envPrefix)) { + $envConfig = new EnvConfig($envPrefix); + $this->config->addContext(self::ENV_CONTEXT, $envConfig); + } + $this->config->addPlaceholder(self::USER_CONTEXT); + $this->config->addPlaceholder(self::DRUPAL_CONTEXT); + $this->config->addPlaceholder(self::SITE_CONTEXT); // not implemented yet (multisite) + $this->config->addPlaceholder(self::ALIAS_CONTEXT); + $this->config->addPlaceholder(self::PREFLIGHT_CONTEXT); + $this->config->addPlaceholder(self::ENVIRONMENT_CONTEXT); + + $this->isLocal = false; + + $this->configFilePaths = []; + } + + /** + * Put the config locator into 'local 'mode. + * + * @param bool $isLocal + */ + public function setLocal($isLocal) + { + $this->isLocal = $isLocal; + } + + /** + * Keep track of the source that every config item originally came from. + * Potentially useful in debugging. If collectSources(true) is called, + * then the sources will be accumulated as config files are loaded. Otherwise, + * this information will not be saved. + * + * @param bool $collect + * @return $this + */ + public function collectSources($collect = true) + { + $this->sources = $collect ? [] : false; + return $this; + } + + /** + * Return all of the sources for every configuration item. The key + * is the address of the configuration item, and the value is the + * configuration file it was loaded from. Note that this method will + * return just an empty array unless collectSources(true) is called + * prior to loading configuration files. + * + * @return array + */ + public function sources() + { + return $this->sources; + } + + /** + * Return a list of all configuration files that were loaded. + * + * @return string[] + */ + public function configFilePaths() + { + return $this->configFilePaths; + } + + /** + * Accumulate the sources provided by the configuration loader. + */ + protected function addToSources(array $sources) + { + if (!is_array($this->sources)) { + return; + } + $this->sources = array_merge_recursive($this->sources, $sources); + } + + /** + * Return the configuration object. Create it and load it with + * all identified configuration if necessary. + * + * @return Config + */ + public function config() + { + return $this->config; + } + + /** + * Exports all of the information stored in the environment, and adds + * it to the configuration. The Environment object itself is only + * available during preflight; the information exported here may be + * obtained by commands et. al. as needed. @see Environment::exportConfigData() + * + * @param Environment $environent + * @return $this + */ + public function addEnvironment(Environment $environment) + { + $this->config->getContext(self::ENVIRONMENT_CONTEXT)->import($environment->exportConfigData()); + return $this; + } + + /** + * Add config paths defined in preflight configuration. + * + * @param array $paths + * @return $this + */ + public function addPreflightConfigFiles($filepaths) + { + $this->addConfigPaths(self::PREFLIGHT_CONTEXT, (array) $filepaths); + return $this; + } + + /** + * Take any configuration from the active alias record, and add it + * to our configuratino. + * @return $this + */ + public function addAliasConfig($aliasConfig) + { + $this->config->addContext(self::ALIAS_CONTEXT, $aliasConfig); + return $this; + } + + + /** + * Given the path provided via --config and the user's home directory, + * add all of the user configuration paths. + * + * In 'local' mode, only the --config location is used. + * @return $this + */ + public function addUserConfig($configPaths, $systemConfigPath, $userConfigDir) + { + $paths = $configPaths; + if (!$this->isLocal) { + $paths = array_merge($paths, [ $systemConfigPath, $userConfigDir ]); + } + $this->addConfigPaths(self::USER_CONTEXT, $paths); + return $this; + } + + /** + * Add the Drush project directory as a configuration search location. + * + * @param $drushProjectDir path to the drush project directory + * @return $this + */ + public function addDrushConfig($drushProjectDir) + { + if (!$this->isLocal) { + $this->addConfigPaths(self::DRUSH_CONTEXT, [ $drushProjectDir ]); + } + return $this; + } + + /** + * Add any configuration files found around the Drupal root of the + * selected site. + * + * @param Path to the selected Drupal site + * @return $this + */ + public function addSitewideConfig($siteRoot) + { + // There might not be a site. + if (!is_dir($siteRoot)) { + return; + } + + // We might have already processed this root. + $siteRoot = realpath($siteRoot); + if (in_array($siteRoot, $this->siteRoots)) { + return; + } + + // Remember that we've seen this location. + $this->siteRoots[] = $siteRoot; + + $this->addConfigPaths(self::DRUPAL_CONTEXT, [ dirname($siteRoot) . '/drush', "$siteRoot/drush", "$siteRoot/sites/all/drush" ]); + return $this; + } + + /** + * Add any configuration file found at any of the provided paths. Both the + * provided location, and the directory `config` inside each provided location + * is searched for a drush.yml file. + * + * @param string $contextName Which context to put all configuration files in. + * @param string[] $paths List of paths to search for configuration. + * @return $this + */ + public function addConfigPaths($contextName, $paths) + { + $loader = new YamlConfigLoader(); + // Make all of the config values parsed so far available in evaluations. + $reference = $this->config()->export(); + $processor = new ConfigProcessor(); + $processor->useMergeStrategyForKeys(['drush.paths.include', 'drush.paths.alias-path']); + $context = $this->config->getContext($contextName); + $processor->add($context->export()); + + $candidates = [ + 'drush.yml', + ]; + if ($this->configFileVariant) { + $candidates[] = "drush{$this->configFileVariant}.yml"; + } + $candidates = $this->expandCandidates($candidates, 'config/'); + $config_files = $this->findConfigFiles($paths, $candidates); + $this->addConfigFiles($processor, $loader, $config_files); + + // Complete config import. + $this->addToSources($processor->sources()); + $context->import($processor->export($reference)); + $this->config->addContext($contextName, $context); + $this->processedConfigPaths = array_merge($this->processedConfigPaths, $paths); + + // Recursive case. + if ($context->has('drush.paths.config')) { + $new_config_paths = array_diff((array) $context->get('drush.paths.config'), $this->processedConfigPaths); + if ($new_config_paths) { + $this->addConfigPaths($contextName, $new_config_paths); + } + } + + return $this; + } + + /** + * Adds $configFiles config files. + * + * @param ConfigProcessor $processor + * @param ConfigLoaderInterface $loader + * @param array $configFiles + */ + protected function addConfigFiles(ConfigProcessor $processor, ConfigLoaderInterface $loader, array $configFiles) + { + foreach ($configFiles as $configFile) { + $processor->extend($loader->load($configFile)); + $this->configFilePaths[] = Path::canonicalize($configFile); + } + } + + /** + * Given a list of paths, and candidates that might exist at each path, + * return all of the candidates that can be found. Candidates may be + * either directories or files. + * + * @param string[] $paths + * @param string[] $candidates + * @return string[] paths + */ + protected function identifyCandidates($paths, $candidates) + { + $configFiles = []; + foreach ($paths as $path) { + $configFiles = array_merge($configFiles, $this->identifyCandidatesAtPath($path, $candidates)); + } + return $configFiles; + } + + /** + * Search for all matching candidate locations at a single path. + * Candidate locations may be either directories or files. + * + * @param string $path + * @param string[] $candidates + * @return string[] + */ + protected function identifyCandidatesAtPath($path, $candidates) + { + if (!is_dir($path)) { + return []; + } + + $result = []; + foreach ($candidates as $candidate) { + $configFile = empty($candidate) ? $path : "$path/$candidate"; + if (file_exists($configFile)) { + $result[] = $configFile; + } + } + return $result; + } + + /** + * Get the site aliases according to preflight arguments and environment. + * + * @param $preflightArgs + * @param Environment $environment + * + * @return array + */ + public function getSiteAliasPaths($paths, Environment $environment) + { + // In addition to the paths passed in to us (from --alias-paths + // commandline options), add some site-local locations. + $siteroot_parents = array_map( + function ($dir) { + return dirname($dir); + }, + $this->siteRoots + ); + $base_dirs = array_filter(array_merge($this->siteRoots, $siteroot_parents, [$this->composerRoot])); + $site_local_paths = array_map( + function ($item) { + return Path::join($item, '/drush/sites'); + }, + array_unique($base_dirs) + ); + $paths = array_merge($paths, $site_local_paths); + + return $paths; + } + + /** + * Get the commandfile paths according to preflight arguments. + * + * @param $preflightArgs + * + * @return array + */ + public function getCommandFilePaths($commandPaths, $root) + { + $builtin = $this->getBuiltinCommandFilePaths(); + $included = $this->getIncludedCommandFilePaths($commandPaths); + $site = $this->getSiteCommandFilePaths($root); + + return array_merge( + $builtin, + $included, + $site + ); + } + + /** + * Return all of the built-in commandfile locations + */ + protected function getBuiltinCommandFilePaths() + { + return [ + dirname(__DIR__), + ]; + } + + /** + * Return all of the commandfile locations specified via + * an 'include' option. + */ + protected function getIncludedCommandFilePaths($commandPaths) + { + $searchpath = []; + + // Commands specified by 'include' option + foreach ($commandPaths as $key => $commandPath) { + // Check to see if there is a `#` in the include path. + // This indicates an include path that has a namespace, + // e.g. `namespace#/path`. + if (is_numeric($key) && strpos($commandPath, '#') !== false) { + list($key, $commandPath) = explode('#', $commandPath, 2); + } + $sep = ($this->config->isWindows()) ? ';' : ':'; + foreach (explode($sep, $commandPath) as $path) { + if (is_dir($path)) { + if (is_numeric($key)) { + $searchpath[] = $path; + } else { + $key = strtr($key, '-/', '_\\'); + $searchpath[$key] = $path; + } + } + } + } + + return $searchpath; + } + + /** + * Return all of the commandfile paths in any '$root/drush' or + * 'dirname($root)/drush' directory that contains a composer.json + * file or a 'Commands' or 'src/Commands' directory. + */ + protected function getSiteCommandFilePaths($root) + { + $directories = ["$root/drush", dirname($root) . '/drush', "$root/sites/all/drush"]; + + return array_filter($directories, 'is_dir'); + } + + /** + * Sets the composer root. + * + * @param $selectedComposerRoot + */ + public function setComposerRoot($selectedComposerRoot) + { + $this->composerRoot = $selectedComposerRoot; + + // Also export the project directory: the composer root of the + // project that contains the selected site. + $this->config->getContext(self::ENVIRONMENT_CONTEXT)->set('runtime.project', $this->composerRoot); + } + + /** + * Double the candidates, adding '$prefix' before each existing one. + */ + public function expandCandidates($candidates, $prefix) + { + $additional = array_map( + function ($item) use ($prefix) { + return $prefix . $item; + }, + $candidates + ); + return array_merge($candidates, $additional); + } + + /** + * Given an array of paths, separates files and directories. + * + * @param array $paths + * An array of config paths. These may be config files or paths to dirs + * containing config files. + * @param array $candidates + * An array filenames that are considered config files. + * + * @return array + * An array. The first row is an array of files, the second row is an + * array of dirs. + */ + protected function findConfigFiles($paths, $candidates) + { + $files = []; + $dirs = []; + foreach ($paths as $path) { + if (file_exists($path)) { + if (is_dir($path)) { + $dirs[] = realpath($path); + } else { + $files[] = realpath($path); + } + } + } + + // Search directories for config file candidates. + $discovered_config_files = $this->identifyCandidates($dirs, $candidates); + + // Merge discoverd candidates with explicitly specified config files. + $config_files = array_merge($discovered_config_files, $files); + + return $config_files; + } +} diff --git a/vendor/drush/drush/src/Config/DrushConfig.php b/vendor/drush/drush/src/Config/DrushConfig.php new file mode 100644 index 0000000000000000000000000000000000000000..d0663af760f21d29d047f3c8d653782213708853 --- /dev/null +++ b/vendor/drush/drush/src/Config/DrushConfig.php @@ -0,0 +1,96 @@ +<?php +namespace Drush\Config; + +use Consolidation\Config\Util\ConfigOverlay; +use Symfony\Component\Filesystem\Exception\IOException; +use Symfony\Component\Filesystem\Filesystem; +use Webmozart\PathUtil\Path; + +// TODO: Not sure if we should have a reference to PreflightArgs here. +// Maybe these constants should be in config, and PreflightArgs can +// reference them from there as well. +use Drush\Preflight\PreflightArgs; + +/** + * Accessors for common Drush config keys. + */ +class DrushConfig extends ConfigOverlay +{ + public function cwd() + { + return $this->get('env.cwd'); + } + + public function home() + { + return $this->get('env.home'); + } + + public function user() + { + return $this->get('env.user'); + } + + public function isWindows() + { + return $this->get('env.is-windows'); + } + + public function tmp() + { + return $this->get('env.tmp'); + } + + /** + * Return the path to this Drush + */ + public function drushScript() + { + return $this->get('runtime.drush-script', 'drush'); + } + + /** + * Return 'true' if we are in simulated mode. + */ + public function simulate() + { + return $this->get(\Robo\Config\Config::SIMULATE); + } + + /** + * Return 'true' if we are in backend mode. + */ + public function backend() + { + return $this->get(PreflightArgs::BACKEND); + } + + /** + * Return the list of paths to active Drush configuration files. + * @return array + */ + public function configPaths() + { + return $this->get('runtime.config.paths', []); + } + + public function cache() + { + $candidates = [ + $this->get('drush.paths.cache-directory'), + Path::join($this->home(), '.drush/cache'), + Path::join($this->tmp(), 'drush-' . $this->user() . '/cache'), + ]; + + $fs = new Filesystem(); + foreach (array_filter($candidates) as $candidate) { + try { + $fs->mkdir($candidate); + return $candidate; + } catch (IOException $ioException) { + // Do nothing. Jump to the next candidate. + } + } + throw new \Exception('Cannot create the Drush cache directory. Tried next candidates: ' . implode(', ', $candidates)); + } +} diff --git a/vendor/drush/drush/src/Config/Environment.php b/vendor/drush/drush/src/Config/Environment.php new file mode 100644 index 0000000000000000000000000000000000000000..ed5419547b8208fc8323783309c729f0a2f6a314 --- /dev/null +++ b/vendor/drush/drush/src/Config/Environment.php @@ -0,0 +1,508 @@ +<?php +namespace Drush\Config; + +use Composer\Autoload\ClassLoader; + +use Drush\Drush; +use Drush\Utils\FsUtils; +use Webmozart\PathUtil\Path; + +/** + * Store information about the environment + */ +class Environment +{ + protected $homeDir; + protected $originalCwd; + protected $etcPrefix; + protected $sharePrefix; + protected $drushBasePath; + protected $vendorDir; + + protected $docPrefix; + protected $configFileVariant; + + protected $loader; + protected $siteLoader; + + /** + * Environment constructor + * @param string $homeDir User home directory. + * @param string $cwd The current working directory at the time Drush was called. + * @param string $autoloadFile Path to the autoload.php file. + */ + public function __construct($homeDir, $cwd, $autoloadFile) + { + $this->homeDir = $homeDir; + $this->originalCwd = Path::canonicalize(FsUtils::realpath($cwd)); + $this->etcPrefix = ''; + $this->sharePrefix = ''; + $this->drushBasePath = Path::canonicalize(dirname(dirname(__DIR__))); + $this->vendorDir = FsUtils::realpath(dirname($autoloadFile)); + } + + /** + * Load the autoloader for the selected Drupal site + * + * @param string $root + * @return ClassLoader + */ + public function loadSiteAutoloader($root) + { + $autloadFilePath = "$root/autoload.php"; + if (!file_exists($autloadFilePath)) { + return $this->loader; + } + + if ($this->siteLoader) { + return $this->siteLoader; + } + + $this->siteLoader = require $autloadFilePath; + if ($this->siteLoader === false) { + // Nothing more to do. See https://github.com/drush-ops/drush/issues/3741. + return $this->loader; + } + if ($this->siteLoader === true) { + // The autoloader was already required. Assume that Drush and Drupal share an autoloader per + // "Point autoload.php to the proper vendor directory" - https://www.drupal.org/node/2404989 + $this->siteLoader = $this->loader; + } + + // Ensure that the site's autoloader has highest priority. Usually, + // the first classloader registered gets the first shot at loading classes. + // We want Drupal's classloader to be used first when a class is loaded, + // and have Drush's classloader only be called as a fallback measure. + $this->siteLoader->unregister(); + $this->siteLoader->register(true); + + return $this->siteLoader; + } + + /** + * Return the name of the user running drush. + * + * @return string + */ + protected function getUsername() + { + $name = null; + if (!$name = getenv("username")) { // Windows + if (!$name = getenv("USER")) { + // If USER not defined, use posix + if (function_exists('posix_getpwuid')) { + $processUser = posix_getpwuid(posix_geteuid()); + $name = $processUser['name']; + } + } + } + return $name; + } + + protected function getTmp() + { + $directories = []; + + // Get user specific and operating system temp folders from system environment variables. + // See http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true + $tempdir = getenv('TEMP'); + if (!empty($tempdir)) { + $directories[] = $tempdir; + } + $tmpdir = getenv('TMP'); + if (!empty($tmpdir)) { + $directories[] = $tmpdir; + } + // Operating system specific dirs. + if (self::isWindows()) { + $windir = getenv('WINDIR'); + if (isset($windir)) { + // WINDIR itself is not writable, but it always contains a /Temp dir, + // which is the system-wide temporary directory on older versions. Newer + // versions only allow system processes to use it. + $directories[] = Path::join($windir, 'Temp'); + } + } else { + $directories[] = Path::canonicalize('/tmp'); + } + $directories[] = Path::canonicalize(sys_get_temp_dir()); + + foreach ($directories as $directory) { + if (is_dir($directory) && is_writable($directory)) { + $temporary_directory = $directory; + break; + } + } + + if (empty($temporary_directory)) { + // If no directory has been found, create one in cwd. + $temporary_directory = Path::join(Drush::config()->cwd(), 'tmp'); + drush_mkdir($temporary_directory, true); + if (!is_dir($temporary_directory)) { + throw new \Exception(dt("Unable to create a temporary directory.")); + } + // Function not available yet - this is not likely to get reached anyway. + // drush_register_file_for_deletion($temporary_directory); + } + return $temporary_directory; + } + + /** + * Convert the environment object into an exported configuration + * array. + * + * @see PreflightArgs::applyToConfig(), which also exports information to config. + * + * @return array Nested associative array that is overlayed on configuration. + */ + public function exportConfigData() + { + return [ + // Information about the environment presented to Drush + 'env' => [ + 'cwd' => $this->cwd(), + 'home' => $this->homeDir(), + 'user' => $this->getUsername(), + 'is-windows' => $this->isWindows(), + 'tmp' => $this->getTmp(), + ], + // These values are available as global options, and + // will be passed in to the FormatterOptions et. al. + 'options' => [ + 'width' => $this->calculateColumns(), + ], + // Information about the directories where Drush found assets, etc. + 'drush' => [ + 'base-dir' => $this->drushBasePath, + 'vendor-dir' => $this->vendorPath(), + 'docs-dir' => $this->docsPath(), + 'user-dir' => $this->userConfigPath(), + 'system-dir' => $this->systemConfigPath(), + 'system-command-dir' => $this->systemCommandFilePath(), + ], + 'runtime' => [ + 'site-file-previous' => $this->getSiteSetAliasFilePath('drush-drupal-prev-site-'), + 'site-file-current' => $this->getSiteSetAliasFilePath(), + ], + ]; + } + + /** + * The base directory of the Drush application itself + * (where composer.json et.al. are found) + * + * @return string + */ + public function drushBasePath() + { + return $this->drushBasePath; + } + + /** + * Get the site:set alias from the current site:set file path. + * + * @return bool|string + */ + public function getSiteSetAliasName() + { + $site_filename = $this->getSiteSetAliasFilePath(); + if (file_exists($site_filename)) { + $site = file_get_contents($site_filename); + if ($site) { + return $site; + } + } + return false; + } + + /** + * User's home directory + * + * @return string + */ + public function homeDir() + { + return $this->homeDir; + } + + /** + * The user's Drush configuration directory, ~/.drush + * + * @return string + */ + public function userConfigPath() + { + return $this->homeDir() . '/.drush'; + } + + public function setConfigFileVariant($variant) + { + $this->configFileVariant = $variant; + } + + /** + * Get the config file variant -- defined to be + * the Drush major version number. This is for + * loading drush.yml and drush9.yml, etc. + */ + public function getConfigFileVariant() + { + return $this->configFileVariant; + } + + /** + * The original working directory + * + * @return string + */ + public function cwd() + { + return $this->originalCwd; + } + + /** + * Return the path to Drush's vendor directory + * + * @return string + */ + public function vendorPath() + { + return $this->vendorDir; + } + + /** + * The class loader returned when the autoload.php file is included. + * + * @return \Composer\Autoload\ClassLoader + */ + public function loader() + { + return $this->loader; + } + + /** + * Set the class loader from the autload.php file, if available. + * + * @param \Composer\Autoload\ClassLoader $loader + */ + public function setLoader(ClassLoader $loader) + { + $this->loader = $loader; + } + + /** + * Alter our default locations based on the value of environment variables + * + * @return $this + */ + public function applyEnvironment() + { + // Copy ETC_PREFIX and SHARE_PREFIX from environment variables if available. + // This alters where we check for server-wide config and alias files. + // Used by unit test suite to provide a clean environment. + $this->setEtcPrefix(getenv('ETC_PREFIX')); + $this->setSharePrefix(getenv('SHARE_PREFIX')); + + return $this; + } + + /** + * Set the directory prefix to locate the directory that Drush will + * use as /etc (e.g. during the functional tests) + * + * @param string $etcPrefix + * @return $this + */ + public function setEtcPrefix($etcPrefix) + { + if (isset($etcPrefix)) { + $this->etcPrefix = $etcPrefix; + } + return $this; + } + + /** + * Set the directory prefix to locate the directory that Drush will + * use as /user/share (e.g. during the functional tests) + * @param string $sharePrefix + * @return $this + */ + public function setSharePrefix($sharePrefix) + { + if (isset($sharePrefix)) { + $this->sharePrefix = $sharePrefix; + $this->docPrefix = null; + } + return $this; + } + + /** + * Return the directory where Drush's documentation is stored. Usually + * this is within the Drush application, but some Drush RPM distributions + * & c. for Linux platforms slice-and-dice the contents and put the docs + * elsewhere. + * + * @return string + */ + public function docsPath() + { + if (!$this->docPrefix) { + $this->docPrefix = $this->findDocsPath($this->drushBasePath); + } + return $this->docPrefix; + } + + /** + * Locate the Drush documentation. This is recalculated whenever the + * share prefix is changed. + * + * @param string $drushBasePath + * @return string + */ + protected function findDocsPath($drushBasePath) + { + $candidates = [ + "$drushBasePath/README.md", + static::systemPathPrefix($this->sharePrefix, '/usr') . '/share/docs/drush/README.md', + ]; + return $this->findFromCandidates($candidates); + } + + /** + * Check a list of directories and return the first one that exists. + * + * @param array $candidates + * @return string|boolean + */ + protected function findFromCandidates($candidates) + { + foreach ($candidates as $candidate) { + if (file_exists($candidate)) { + return dirname($candidate); + } + } + return false; + } + + /** + * Return the appropriate system path prefix, unless an override is provided. + * @param string $override + * @param string $defaultPrefix + * @return string + */ + protected static function systemPathPrefix($override = '', $defaultPrefix = '') + { + if ($override) { + return $override; + } + return static::isWindows() ? Path::join(getenv('ALLUSERSPROFILE'), 'Drush') : $defaultPrefix; + } + + /** + * Return the system configuration path (default: /etc/drush) + * + * @return string + */ + public function systemConfigPath() + { + return static::systemPathPrefix($this->etcPrefix, '') . '/etc/drush'; + } + + /** + * Return the system shared commandfile path (default: /usr/share/drush/commands) + * + * @return string + */ + public function systemCommandFilePath() + { + return static::systemPathPrefix($this->sharePrefix, '/usr') . '/share/drush/commands'; + } + + /** + * Determine whether current OS is a Windows variant. + * + * @return boolean + */ + public static function isWindows($os = null) + { + return strtoupper(substr($os ?: PHP_OS, 0, 3)) === 'WIN'; + } + + /** + * Verify that we are running PHP through the command line interface. + * + * @return boolean + * A boolean value that is true when PHP is being run through the command line, + * and false if being run through cgi or mod_php. + */ + public function verifyCLI() + { + return (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)); + } + + /** + * Calculate the terminal width used for wrapping table output. + * Normally this is exported using tput in the drush script. + * If this is not present we do an additional check using stty here. + * On Windows in CMD and PowerShell is this exported using mode con. + * + * @return integer + */ + public function calculateColumns() + { + if ($columns = getenv('COLUMNS')) { + return $columns; + } + + // Trying to export the columns using stty. + exec('stty size 2>&1', $columns_output, $columns_status); + $matched = false; + if (!$columns_status && $matched = preg_match('/^\d+\s(\d+)$/', $columns_output[0], $matches, 0)) { + $columns = $matches[1]; + } + + // If stty fails and Drush is running on Windows are we trying with mode con. + if (($columns_status || !$matched) && static::isWindows()) { + $columns_output = []; + exec('mode con', $columns_output, $columns_status); + if (!$columns_status && is_array($columns_output)) { + $columns = (int)preg_replace('/\D/', '', $columns_output[4], -1, $columns_count); + } + // TODO: else { 'Drush could not detect the console window width. Set a Windows Environment Variable of COLUMNS to the desired width.' + } + + // Failling back to default columns value + if (empty($columns)) { + $columns = 80; + } + + // TODO: should we deal with reserve-margin here, or adjust it later? + return $columns; + } + + /** + * Returns the filename for the file that stores the DRUPAL_SITE variable. + * + * @param string $filename_prefix + * An arbitrary string to prefix the filename with. + * + * @return string|false + * Returns the full path to temp file if possible, or FALSE if not. + */ + protected function getSiteSetAliasFilePath($filename_prefix = 'drush-drupal-site-') + { + $shell_pid = getenv('DRUSH_SHELL_PID'); + if (!$shell_pid && function_exists('posix_getppid')) { + $shell_pid = posix_getppid(); + } + if (!$shell_pid) { + return false; + } + + // The env variables below must match the variables in example.prompt.sh + $tmp = getenv('TMPDIR') ? getenv('TMPDIR') : '/tmp'; + $username = $this->getUsername(); + + return "{$tmp}/drush-env-{$username}/{$filename_prefix}" . $shell_pid; + } +} diff --git a/vendor/drush/drush/src/Config/Loader/YamlConfigLoader.php b/vendor/drush/drush/src/Config/Loader/YamlConfigLoader.php new file mode 100644 index 0000000000000000000000000000000000000000..4a5d7bb2bbab03fee2b75e81d54124f0df88a001 --- /dev/null +++ b/vendor/drush/drush/src/Config/Loader/YamlConfigLoader.php @@ -0,0 +1,27 @@ +<?php + +namespace Drush\Config\Loader; + +use Drush\Internal\Config\Yaml\Yaml; +use Consolidation\Config\Loader\ConfigLoader; + +/** + * Load configuration files, and fill in any property values that + * need to be expanded. + */ +class YamlConfigLoader extends ConfigLoader +{ + public function load($path) + { + $this->setSourceName($path); + + // We silently skip any nonexistent config files, so that + // clients may simply `load` all of their candidates. + if (!file_exists($path)) { + $this->config = []; + return $this; + } + $this->config = (array) Yaml::parse(file_get_contents($path)); + return $this; + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php b/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..e49ad072e7b8d1044c07657098fa714158ab7d5d --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php @@ -0,0 +1,524 @@ +<?php +namespace Drush\Drupal\Commands\config; + +use Consolidation\AnnotatedCommand\CommandError; +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\AnnotatedCommand\Input\StdinAwareInterface; +use Consolidation\AnnotatedCommand\Input\StdinAwareTrait; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Consolidation\SiteProcess\Util\Escape; +use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Config\FileStorage; +use Drupal\Core\Config\StorageComparer; +use Drupal\Core\Config\StorageInterface; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exec\ExecTrait; +use Drush\Utils\FsUtils; +use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Yaml\Parser; +use Webmozart\PathUtil\Path; + +class ConfigCommands extends DrushCommands implements StdinAwareInterface +{ + use StdinAwareTrait; + use ExecTrait; + + /** + * @var ConfigFactoryInterface + */ + protected $configFactory; + + /** + * @return ConfigFactoryInterface + */ + public function getConfigFactory() + { + return $this->configFactory; + } + + + /** + * ConfigCommands constructor. + * @param ConfigFactoryInterface $configFactory + */ + public function __construct($configFactory) + { + parent::__construct(); + $this->configFactory = $configFactory; + } + + /** + * Display a config value, or a whole configuration object. + * + * @command config:get + * @validate-config-name + * @interact-config-name + * @param $config_name The config object name, for example "system.site". + * @param $key The config key, for example "page.front". Optional. + * @option source The config storage source to read. Additional labels may be defined in settings.php. + * @option include-overridden Apply module and settings.php overrides to values. + * @usage drush config:get system.site + * Displays the system.site config. + * @usage drush config:get system.site page.front + * Gets system.site:page.front value. + * @aliases cget,config-get + */ + public function get($config_name, $key = '', $options = ['format' => 'yaml', 'source' => 'active', 'include-overridden' => false]) + { + // Displaying overrides only applies to active storage. + $factory = $this->getConfigFactory(); + $config = $options['include-overridden'] ? $factory->get($config_name) : $factory->getEditable($config_name); + $value = $config->get($key); + // @todo If the value is TRUE (for example), nothing gets printed. Is this yaml formatter's fault? + return $key ? ["$config_name:$key" => $value] : $value; + } + + /** + * Set config value directly. Does not perform a config import. + * + * @command config:set + * @validate-config-name + * @todo @interact-config-name deferred until we have interaction for key. + * @param $config_name The config object name, for example "system.site". + * @param $key The config key, for example "page.front". + * @param $value The value to assign to the config key. Use '-' to read from STDIN. + * @option input-format Format to parse the object. Use "string" for string (default), and "yaml" for YAML. + * @option value The value to assign to the config key (if any). + * @hidden-options value + * @usage drush config:set system.site page.front '/path/to/page' + * Sets the given URL path as value for the config item with key "page.front" of "system.site" config object. + * @aliases cset,config-set + */ + public function set($config_name, $key, $value = null, $options = ['input-format' => 'string', 'value' => self::REQ]) + { + // This hidden option is a convenient way to pass a value without passing a key. + $data = $options['value'] ?: $value; + + if (!isset($data)) { + throw new \Exception(dt('No config value specified.')); + } + + $config = $this->getConfigFactory()->getEditable($config_name); + // Check to see if config key already exists. + $new_key = $config->get($key) === null; + + // Special flag indicating that the value has been passed via STDIN. + if ($data === '-') { + $data = $this->stdin()->contents(); + } + + // Now, we parse the value. + switch ($options['input-format']) { + case 'yaml': + $parser = new Parser(); + $data = $parser->parse($data, true); + } + + if (is_array($data) && $this->io()->confirm(dt('Do you want to update or set multiple keys on !name config.', ['!name' => $config_name]))) { + foreach ($data as $data_key => $value) { + $config->set("$key.$data_key", $value); + } + return $config->save(); + } else { + $confirmed = false; + if ($config->isNew() && $this->io()->confirm(dt('!name config does not exist. Do you want to create a new config object?', ['!name' => $config_name]))) { + $confirmed = true; + } elseif ($new_key && $this->io()->confirm(dt('!key key does not exist in !name config. Do you want to create a new config key?', ['!key' => $key, '!name' => $config_name]))) { + $confirmed = true; + } elseif ($this->io()->confirm(dt('Do you want to update !key key in !name config?', ['!key' => $key, '!name' => $config_name]))) { + $confirmed = true; + } + if ($confirmed && !$this->getConfig()->simulate()) { + return $config->set($key, $data)->save(); + } + } + } + + /** + * Open a config file in a text editor. Edits are imported after closing editor. + * + * @command config:edit + * @validate-config-name + * @interact-config-name + * @param $config_name The config object name, for example "system.site". + * @optionset_get_editor + * @allow_additional_options config-import + * @hidden-options source,partial + * @usage drush config:edit image.style.large + * Edit the image style configurations. + * @usage drush config:edit + * Choose a config file to edit. + * @usage drush --bg config-edit image.style.large + * Return to shell prompt as soon as the editor window opens. + * @aliases cedit,config-edit + * @validate-module-enabled config + */ + public function edit($config_name, $options = []) + { + $config = $this->getConfigFactory()->get($config_name); + $active_storage = $config->getStorage(); + $contents = $active_storage->read($config_name); + + // Write tmp YAML file for editing + $temp_dir = drush_tempdir(); + $temp_storage = new FileStorage($temp_dir); + $temp_storage->write($config_name, $contents); + + // Note that `drush_get_editor` returns a string that contains a + // %s placeholder for the config file path. + $exec = drush_get_editor(); + $cmd = sprintf($exec, Escape::shellArg($temp_storage->getFilePath($config_name))); + $process = $this->processManager()->shell($cmd); + $process->setTty(true); + $process->mustRun(); + + // Perform import operation if user did not immediately exit editor. + if (!$options['bg']) { + $redispatch_options = Drush::redispatchOptions() + ['partial' => true, 'source' => $temp_dir]; + $process = $this->processManager()->drush(Drush::aliasManager()->getSelf(), 'config-import', [], $redispatch_options); + $process->mustRun($process->showRealtime()); + } + } + + /** + * Delete a configuration key, or a whole object. + * + * @command config:delete + * @validate-config-name + * @interact-config-name + * @param $config_name The config object name, for example "system.site". + * @param $key A config key to clear, for example "page.front". + * @usage drush config:delete system.site + * Delete the the system.site config object. + * @usage drush config:delete system.site page.front + * Delete the 'page.front' key from the system.site object. + * @aliases cdel,config-delete + */ + public function delete($config_name, $key = null) + { + $config = $this->getConfigFactory()->getEditable($config_name); + if ($key) { + if ($config->get($key) === null) { + throw new \Exception(dt('Configuration key !key not found.', ['!key' => $key])); + } + $config->clear($key)->save(); + } else { + $config->delete(); + } + } + + /** + * Display status of configuration (differences between the filesystem configuration and database configuration). + * + * @command config:status + * @option state A comma-separated list of states to filter results. + * @option prefix Prefix The config prefix. For example, "system". No prefix will return all names in the system. + * @option string $label A config directory label (i.e. a key in \$config_directories array in settings.php). + * @usage drush config:status + * Display configuration items that need to be synchronized. + * @usage drush config:status --state=Identical + * Display configuration items that are in default state. + * @usage drush config:status --state='Only in sync dir' --prefix=node.type. + * Display all content types that would be created in active storage on configuration import. + * @usage drush config:status --state=Any --format=list + * List all config names. + * @field-labels + * name: Name + * state: State + * @default-fields name,state + * @aliases cst,config-status + * @filter-default-field name + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function status($options = ['state' => 'Only in DB,Only in sync dir,Different', 'prefix' => self::REQ, 'label' => self::REQ]) + { + $config_list = array_fill_keys( + $this->configFactory->listAll($options['prefix']), + 'Identical' + ); + + $directory = $this->getDirectory($options['label']); + $storage = $this->getStorage($directory); + $state_map = [ + 'create' => 'Only in DB', + 'update' => 'Different', + 'delete' => 'Only in sync dir', + ]; + foreach ($this->getChanges($storage) as $collection) { + foreach ($collection as $operation => $configs) { + foreach ($configs as $config) { + if (!$options['prefix'] || strpos($config, $options['prefix']) === 0) { + $config_list[$config] = $state_map[$operation]; + } + } + } + } + + if ($options['state']) { + $allowed_states = explode(',', $options['state']); + if (!in_array('Any', $allowed_states)) { + $config_list = array_filter($config_list, function ($state) use ($allowed_states) { + return in_array($state, $allowed_states); + }); + } + } + + ksort($config_list); + + $rows = []; + $color_map = [ + 'Only in DB' => 'green', + 'Only in sync dir' => 'red', + 'Different' => 'yellow', + 'Identical' => 'white', + ]; + + foreach ($config_list as $config => $state) { + if ($options['format'] == 'table' && $state != 'Identical') { + $state = "<fg={$color_map[$state]};options=bold>$state</>"; + } + $rows[$config] = [ + 'name' => $config, + 'state' => $state, + ]; + } + + if ($rows) { + return new RowsOfFields($rows); + } else { + $this->logger()->notice(dt('No differences between DB and sync directory.')); + } + } + + /** + * Determine which configuration directory to use and return directory path. + * + * Directory path is determined based on the following precedence: + * 1. User-provided $directory. + * 2. Directory path corresponding to $label (mapped via $config_directories in settings.php). + * 3. Default sync directory + * + * @param string $label + * A configuration directory label. + * @param string $directory + * A configuration directory. + */ + public static function getDirectory($label, $directory = null) + { + $return = null; + // If the user provided a directory, use it. + if (!empty($directory)) { + if ($directory === true) { + // The user did not pass a specific directory, make one. + $return = FsUtils::prepareBackupDir('config-import-export'); + } else { + // The user has specified a directory. + drush_mkdir($directory); + $return = $directory; + } + } else { + // If a directory isn't specified, use the label argument or default sync directory. + $return = \config_get_config_directory($label ?: CONFIG_SYNC_DIRECTORY); + } + return Path::canonicalize($return); + } + + /** + * Returns the difference in configuration between active storage and target storage. + */ + public function getChanges($target_storage) + { + /** @var StorageInterface $active_storage */ + $active_storage = \Drupal::service('config.storage'); + + $config_comparer = new StorageComparer($active_storage, $target_storage, \Drupal::service('config.manager')); + + $change_list = []; + if ($config_comparer->createChangelist()->hasChanges()) { + foreach ($config_comparer->getAllCollectionNames() as $collection) { + $change_list[$collection] = $config_comparer->getChangelist(null, $collection); + } + } + return $change_list; + } + + /** + * Get storage corresponding to a configuration directory. + */ + public function getStorage($directory) + { + if ($directory == Path::canonicalize(\config_get_config_directory(CONFIG_SYNC_DIRECTORY))) { + return \Drupal::service('config.storage.sync'); + } else { + return new FileStorage($directory); + } + } + + /** + * Build a table of config changes. + * + * @param array $config_changes + * An array of changes keyed by collection. + * + * @return Table A Symfony table object. + */ + public static function configChangesTable(array $config_changes, OutputInterface $output, $use_color = true) + { + $rows = []; + foreach ($config_changes as $collection => $changes) { + foreach ($changes as $change => $configs) { + switch ($change) { + case 'delete': + $colour = '<fg=white;bg=red>'; + break; + case 'update': + $colour = '<fg=black;bg=yellow>'; + break; + case 'create': + $colour = '<fg=white;bg=green>'; + break; + default: + $colour = "<fg=black;bg=cyan>"; + break; + } + if ($use_color) { + $prefix = $colour; + $suffix = '</>'; + } else { + $prefix = $suffix = ''; + } + foreach ($configs as $config) { + $rows[] = [ + $collection, + $config, + $prefix . ucfirst($change) . $suffix, + ]; + } + } + } + $table = new Table($output); + $table->setHeaders(['Collection', 'Config', 'Operation']); + $table->addRows($rows); + return $table; + } + + /** + * @hook interact @interact-config-name + */ + public function interactConfigName($input, $output) + { + if (empty($input->getArgument('config_name'))) { + $config_names = $this->getConfigFactory()->listAll(); + $choice = $this->io()->choice('Choose a configuration', drush_map_assoc($config_names)); + $input->setArgument('config_name', $choice); + } + } + + /** + * @hook interact @interact-config-label + */ + public function interactConfigLabel(InputInterface $input, ConsoleOutputInterface $output) + { + global $config_directories; + + $option_name = $input->hasOption('destination') ? 'destination' : 'source'; + if (empty($input->getArgument('label') && empty($input->getOption($option_name)))) { + $choices = drush_map_assoc(array_keys($config_directories)); + unset($choices[CONFIG_ACTIVE_DIRECTORY]); + if (count($choices) >= 2) { + $label = $this->io()->choice('Choose a '. $option_name, $choices); + $input->setArgument('label', $label); + } + } + } + + /** + * Validate that a config name is valid. + * + * If the argument to be validated is not named $config_name, pass the + * argument name as the value of the annotation. + * + * @hook validate @validate-config-name + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @return \Consolidation\AnnotatedCommand\CommandError|null + */ + public function validateConfigName(CommandData $commandData) + { + $arg_name = $commandData->annotationData()->get('validate-config-name', null) ?: 'config_name'; + $config_name = $commandData->input()->getArgument($arg_name); + $config = \Drupal::config($config_name); + if ($config->isNew()) { + $msg = dt('Config !name does not exist', ['!name' => $config_name]); + return new CommandError($msg); + } + } + + /** + * Copies configuration objects from source storage to target storage. + * + * @param StorageInterface $source + * The source config storage service. + * @param StorageInterface $destination + * The destination config storage service. + */ + public static function copyConfig(StorageInterface $source, StorageInterface $destination) + { + // Make sure the source and destination are on the default collection. + if ($source->getCollectionName() != StorageInterface::DEFAULT_COLLECTION) { + $source = $source->createCollection(StorageInterface::DEFAULT_COLLECTION); + } + if ($destination->getCollectionName() != StorageInterface::DEFAULT_COLLECTION) { + $destination = $destination->createCollection(StorageInterface::DEFAULT_COLLECTION); + } + + // Export all the configuration. + foreach ($source->listAll() as $name) { + $destination->write($name, $source->read($name)); + } + + // Export configuration collections. + foreach ($source->getAllCollectionNames() as $collection) { + $source = $source->createCollection($collection); + $destination = $destination->createCollection($collection); + foreach ($source->listAll() as $name) { + $destination->write($name, $source->read($name)); + } + } + } + + /** + * Get diff between two config sets. + * + * @param StorageInterface $destination_storage + * @param StorageInterface $source_storage + * @param OutputInterface $output + * @return array|bool + * An array of strings containing the diff. + */ + public static function getDiff(StorageInterface $destination_storage, StorageInterface $source_storage, OutputInterface $output) + { + // Copy active storage to a temporary directory. + $temp_destination_dir = drush_tempdir(); + $temp_destination_storage = new FileStorage($temp_destination_dir); + self::copyConfig($destination_storage, $temp_destination_storage); + + // Copy source storage to a temporary directory as it could be + // modified by the partial option or by decorated sync storages. + $temp_source_dir = drush_tempdir(); + $temp_source_storage = new FileStorage($temp_source_dir); + self::copyConfig($source_storage, $temp_source_storage); + + $prefix = ['diff']; + if (self::programExists('git') && $output->isDecorated()) { + $prefix = ['git', 'diff', '--color=always']; + } + $args = array_merge($prefix, ['-u', $temp_destination_dir, $temp_source_dir]); + $process = Drush::process($args); + $process->run(); + return $process->getOutput(); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php b/vendor/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..7db236f0bd299cdc20a5d5249691828d6aa7834e --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php @@ -0,0 +1,211 @@ +<?php +namespace Drush\Drupal\Commands\config; + +use Consolidation\AnnotatedCommand\CommandData; +use Drupal\Core\Config\ConfigManagerInterface; +use Drupal\Core\Config\StorageComparer; +use Drupal\Core\Config\FileStorage; +use Drupal\Core\Config\StorageInterface; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exceptions\UserAbortException; +use Symfony\Component\Console\Output\BufferedOutput; +use Webmozart\PathUtil\Path; + +class ConfigExportCommands extends DrushCommands +{ + /** + * @var ConfigManagerInterface + */ + protected $configManager; + + /** + * @var StorageInterface + */ + protected $configStorage; + + /** + * @var StorageInterface + */ + protected $configStorageSync; + + /** + * @return ConfigManagerInterface + */ + public function getConfigManager() + { + return $this->configManager; + } + + /** + * @return StorageInterface + */ + public function getConfigStorage() + { + return $this->configStorage; + } + + /** + * @return StorageInterface + */ + public function getConfigStorageSync() + { + return $this->configStorageSync; + } + + + /** + * @param ConfigManagerInterface $configManager + * @param StorageInterface $configStorage + * @param StorageInterface $configStorageSync + */ + public function __construct(ConfigManagerInterface $configManager, StorageInterface $configStorage, StorageInterface $configStorageSync) + { + parent::__construct(); + $this->configManager = $configManager; + $this->configStorage = $configStorage; + $this->configStorageSync = $configStorageSync; + } + + /** + * Export Drupal configuration to a directory. + * + * @command config:export + * @interact-config-label + * @param string $label A config directory label (i.e. a key in $config_directories array in settings.php). + * @option add Run `git add -p` after exporting. This lets you choose which config changes to sync for commit. + * @option commit Run `git add -A` and `git commit` after exporting. This commits everything that was exported without prompting. + * @option message Commit comment for the exported configuration. Optional; may only be used with --commit. + * @option destination An arbitrary directory that should receive the exported files. A backup directory is used when no value is provided. + * @option diff Show preview as a diff, instead of a change list. + * @usage drush config:export --destination + * Export configuration; Save files in a backup directory named config-export. + * @aliases cex,config-export + */ + public function export($label = null, $options = ['add' => false, 'commit' => false, 'message' => self::REQ, 'destination' => self::OPT, 'diff' => false, 'format' => null]) + { + // Get destination directory. + $destination_dir = ConfigCommands::getDirectory($label, $options['destination']); + + // Do the actual config export operation. + $preview = $this->doExport($options, $destination_dir); + + // Do the VCS operations. + $this->doAddCommit($options, $destination_dir, $preview); + + return ['destination-dir' => $destination_dir]; + } + + public function doExport($options, $destination_dir) + { + // Prepare the configuration storage for the export. + if ($destination_dir == Path::canonicalize(\config_get_config_directory(CONFIG_SYNC_DIRECTORY))) { + $target_storage = $this->getConfigStorageSync(); + } else { + $target_storage = new FileStorage($destination_dir); + } + + if (count(glob($destination_dir . '/*')) > 0) { + // Retrieve a list of differences between the active and target configuration (if any). + $config_comparer = new StorageComparer($this->getConfigStorage(), $target_storage, $this->getConfigManager()); + if (!$config_comparer->createChangelist()->hasChanges()) { + $this->logger()->notice(dt('The active configuration is identical to the configuration in the export directory (!target).', ['!target' => $destination_dir])); + return; + } + $preamble = "Differences of the active config to the export directory:\n"; + + if ($options['diff']) { + $diff = ConfigCommands::getDiff($target_storage, $this->getConfigStorage(), $this->output()); + $this->logger()->notice($preamble . $diff); + } else { + $change_list = []; + foreach ($config_comparer->getAllCollectionNames() as $collection) { + $change_list[$collection] = $config_comparer->getChangelist(null, $collection); + } + // Print a table with changes in color, then re-generate again without + // color to place in the commit comment. + $bufferedOutput = new BufferedOutput(); + $table = ConfigCommands::configChangesTable($change_list, $bufferedOutput, false); + $table->render(); + $preview = $bufferedOutput->fetch(); + $this->logger()->notice($preamble . $preview); + } + + if (!$this->io()->confirm(dt('The .yml files in your export directory (!target) will be deleted and replaced with the active config.', ['!target' => $destination_dir]))) { + throw new UserAbortException(); + } + + // Only delete .yml files, and not .htaccess or .git. + $target_storage->deleteAll(); + + // Also delete collections. + foreach ($target_storage->getAllCollectionNames() as $collection_name) { + $target_collection = $target_storage->createCollection($collection_name); + $target_collection->deleteAll(); + } + } + + // Write all .yml files. + ConfigCommands::copyConfig($this->getConfigStorage(), $target_storage); + + $this->logger()->success(dt('Configuration successfully exported to !target.', ['!target' => $destination_dir])); + drush_backend_set_result($destination_dir); + return isset($preview) ? $preview : 'No existing configuration to diff against.'; + } + + public function doAddCommit($options, $destination_dir, $preview) + { + // Commit or add exported configuration if requested. + if ($options['commit']) { + // There must be changed files at the destination dir; if there are not, then + // we will skip the commit step. + $process = $this->processManager()->process(['git', 'status', '--porcelain', '.'], $destination_dir); + $process->mustRun(); + $uncommitted_changes = $process->getOutput(); + if (!empty($uncommitted_changes)) { + $process = $this->processManager()->process(['git', 'add', '-A', '.'], $destination_dir); + $process->mustRun(); + $comment_file = drush_save_data_to_temp_file($options['message'] ?: 'Exported configuration.'. $preview); + $process = $this->processManager()->process(['git', 'commit', "--file=$comment_file"], $destination_dir); + $process->mustRun(); + } + } elseif ($options['add']) { + $this->processManager()->process(['git', 'add', '-p', $destination_dir])->run(); + } + } + + /** + * @hook validate config-export + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + */ + public function validate(CommandData $commandData) + { + $destination = $commandData->input()->getOption('destination'); + + if ($destination === true) { + // We create a dir in command callback. No need to validate. + return; + } + + if (!empty($destination)) { + // TODO: evaluate %files et. al. in destination + // $commandData->input()->setOption('destination', $destination); + if (!file_exists($destination)) { + $parent = dirname($destination); + if (!is_dir($parent)) { + throw new \Exception('The destination parent directory does not exist.'); + } + if (!is_writable($parent)) { + throw new \Exception('The destination parent directory is not writable.'); + } + } else { + if (!is_dir($destination)) { + throw new \Exception('The destination is not a directory.'); + } + if (!is_writable($destination)) { + throw new \Exception('The destination directory is not writable.'); + } + } + } + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php b/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..09909e0f1baa745a3b8ad4af8eadbe1b542d4dad --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php @@ -0,0 +1,291 @@ +<?php +namespace Drush\Drupal\Commands\config; + +use Consolidation\AnnotatedCommand\CommandError; +use Consolidation\AnnotatedCommand\CommandData; +use Drupal\config\StorageReplaceDataWrapper; +use Drupal\Core\Config\ConfigManagerInterface; +use Drupal\Core\Config\StorageComparer; +use Drupal\Core\Config\ConfigImporter; +use Drupal\Core\Config\ConfigException; +use Drupal\Core\Config\FileStorage; +use Drupal\Core\Config\StorageInterface; +use Drupal\Core\Config\TypedConfigManagerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Extension\ModuleInstallerInterface; +use Drupal\Core\Extension\ThemeHandlerInterface; +use Drupal\Core\Lock\LockBackendInterface; +use Drupal\Core\StringTranslation\TranslationInterface; +use Drush\Commands\DrushCommands; +use Drush\Exceptions\UserAbortException; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Webmozart\PathUtil\Path; + +class ConfigImportCommands extends DrushCommands +{ + + /** + * @var ConfigManagerInterface + */ + protected $configManager; + + protected $configStorage; + + protected $configStorageSync; + + protected $eventDispatcher; + + protected $lock; + + protected $configTyped; + + protected $moduleInstaller; + + protected $themeHandler; + + protected $stringTranslation; + + /** + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + /** + * @return ConfigManagerInterface + */ + public function getConfigManager() + { + return $this->configManager; + } + + /** + * @return StorageInterface + */ + public function getConfigStorage() + { + return $this->configStorage; + } + + /** + * @return StorageInterface + */ + public function getConfigStorageSync() + { + return $this->configStorageSync; + } + + public function getModuleHandler() + { + return $this->moduleHandler; + } + + /** + * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface + */ + public function getEventDispatcher() + { + return $this->eventDispatcher; + } + + /** + * @return \Drupal\Core\Lock\LockBackendInterface + */ + public function getLock() + { + return $this->lock; + } + + /** + * @return \Drupal\Core\Config\TypedConfigManagerInterface + */ + public function getConfigTyped() + { + return $this->configTyped; + } + + /** + * @return \Drupal\Core\Extension\ModuleInstallerInterface + */ + public function getModuleInstaller() + { + return $this->moduleInstaller; + } + + /** + * @return \Drupal\Core\Extension\ThemeHandlerInterface + */ + public function getThemeHandler() + { + return $this->themeHandler; + } + + /** + * @return \Drupal\Core\StringTranslation\TranslationInterface + */ + public function getStringTranslation() + { + return $this->stringTranslation; + } + + /** + * @param ConfigManagerInterface $configManager + * @param StorageInterface $configStorage + * @param StorageInterface $configStorageSync + */ + public function __construct(ConfigManagerInterface $configManager, StorageInterface $configStorage, StorageInterface $configStorageSync, ModuleHandlerInterface $moduleHandler, EventDispatcherInterface $eventDispatcher, LockBackendInterface $lock, TypedConfigManagerInterface $configTyped, ModuleInstallerInterface $moduleInstaller, ThemeHandlerInterface $themeHandler, TranslationInterface $stringTranslation) + { + parent::__construct(); + $this->configManager = $configManager; + $this->configStorage = $configStorage; + $this->configStorageSync = $configStorageSync; + $this->moduleHandler = $moduleHandler; + $this->eventDispatcher = $eventDispatcher; + $this->lock = $lock; + $this->configTyped = $configTyped; + $this->moduleInstaller = $moduleInstaller; + $this->themeHandler = $themeHandler; + $this->stringTranslation = $stringTranslation; + } + + /** + * Import config from a config directory. + * + * @command config:import + * @param $label A config directory label (i.e. a key in \$config_directories array in settings.php). + * @interact-config-label + * @option diff Show preview as a diff. + * @option preview Deprecated. Format for displaying proposed changes. Recognized values: list, diff. + * @option source An arbitrary directory that holds the configuration files. An alternative to label argument + * @option partial Allows for partial config imports from the source directory. Only updates and new configs will be processed with this flag (missing configs will not be deleted). + * @aliases cim,config-import + */ + public function import($label = null, $options = ['preview' => 'list', 'source' => self::REQ, 'partial' => false, 'diff' => false]) + { + // Determine source directory. + + $source_storage_dir = ConfigCommands::getDirectory($label, $options['source']); + + // Prepare the configuration storage for the import. + if ($source_storage_dir == Path::canonicalize(\config_get_config_directory(CONFIG_SYNC_DIRECTORY))) { + $source_storage = $this->getConfigStorageSync(); + } else { + $source_storage = new FileStorage($source_storage_dir); + } + + // Determine $source_storage in partial case. + $active_storage = $this->getConfigStorage(); + if ($options['partial']) { + $replacement_storage = new StorageReplaceDataWrapper($active_storage); + foreach ($source_storage->listAll() as $name) { + $data = $source_storage->read($name); + $replacement_storage->replaceData($name, $data); + } + $source_storage = $replacement_storage; + } + + $config_manager = $this->getConfigManager(); + $storage_comparer = new StorageComparer($source_storage, $active_storage, $config_manager); + + + if (!$storage_comparer->createChangelist()->hasChanges()) { + $this->logger()->notice(('There are no changes to import.')); + return; + } + + if ($options['preview'] == 'list' && !$options['diff']) { + $change_list = []; + foreach ($storage_comparer->getAllCollectionNames() as $collection) { + $change_list[$collection] = $storage_comparer->getChangelist(null, $collection); + } + $table = ConfigCommands::configChangesTable($change_list, $this->output()); + $table->render(); + } else { + $output = ConfigCommands::getDiff($active_storage, $source_storage, $this->output()); + + $this->output()->writeln($output); + } + + if (!$this->io()->confirm(dt('Import the listed configuration changes?'))) { + throw new UserAbortException(); + } + return drush_op([$this, 'doImport'], $storage_comparer); + } + + // Copied from submitForm() at /core/modules/config/src/Form/ConfigSync.php + public function doImport($storage_comparer) + { + $config_importer = new ConfigImporter( + $storage_comparer, + $this->getEventDispatcher(), + $this->getConfigManager(), + $this->getLock(), + $this->getConfigTyped(), + $this->getModuleHandler(), + $this->getModuleInstaller(), + $this->getThemeHandler(), + $this->getStringTranslation() + ); + if ($config_importer->alreadyImporting()) { + $this->logger()->warning('Another request may be synchronizing configuration already.'); + } else { + try { + // This is the contents of \Drupal\Core\Config\ConfigImporter::import. + // Copied here so we can log progress. + if ($config_importer->hasUnprocessedConfigurationChanges()) { + $sync_steps = $config_importer->initialize(); + foreach ($sync_steps as $step) { + $context = []; + do { + $config_importer->doSyncStep($step, $context); + if (isset($context['message'])) { + $this->logger()->notice(str_replace('Synchronizing', 'Synchronized', (string)$context['message'])); + } + } while ($context['finished'] < 1); + } + } + if ($config_importer->getErrors()) { + throw new ConfigException('Errors occurred during import'); + } else { + $this->logger()->success('The configuration was imported successfully.'); + } + } catch (ConfigException $e) { + // Return a negative result for UI purposes. We do not differentiate + // between an actual synchronization error and a failed lock, because + // concurrent synchronizations are an edge-case happening only when + // multiple developers or site builders attempt to do it without + // coordinating. + $message = 'The import failed due to the following reasons:' . "\n"; + $message .= implode("\n", $config_importer->getErrors()); + + watchdog_exception('config_import', $e); + throw new \Exception($message); + } + } + } + + /** + * @hook validate config-import + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @return \Consolidation\AnnotatedCommand\CommandError|null + */ + public function validate(CommandData $commandData) + { + $msgs = []; + if ($commandData->input()->getOption('partial') && !$this->getModuleHandler()->moduleExists('config')) { + $msgs[] = 'Enable the config module in order to use the --partial option.'; + } + + if ($source = $commandData->input()->getOption('source')) { + if (!file_exists($source)) { + $msgs[] = 'The source directory does not exist.'; + } + if (!is_dir($source)) { + $msgs[] = 'The source is not a directory.'; + } + } + + if ($msgs) { + return new CommandError(implode(' ', $msgs)); + } + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/config/drush.services.yml b/vendor/drush/drush/src/Drupal/Commands/config/drush.services.yml new file mode 100644 index 0000000000000000000000000000000000000000..e7de8edc47f1235d5d7c8dd94f760d7bf200dfc7 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/config/drush.services.yml @@ -0,0 +1,17 @@ +#Loaded by Drush\Drupal\DrupalKernel::discoverServiceProviders +services: + config.commands: + class: \Drush\Drupal\Commands\config\ConfigCommands + arguments: ['@config.factory'] + tags: + - { name: drush.command } + config.export.commands: + class: \Drush\Drupal\Commands\config\ConfigExportCommands + arguments: ['@config.manager', '@config.storage', '@config.storage.sync'] + tags: + - { name: drush.command } + config.import.commands: + class: \Drush\Drupal\Commands\config\ConfigImportCommands + arguments: ['@config.manager', '@config.storage', '@config.storage.sync', '@module_handler', '@event_dispatcher', '@lock', '@config.typed', '@module_installer', '@theme_handler', '@string_translation'] + tags: + - { name: drush.command } diff --git a/vendor/drush/drush/src/Drupal/Commands/core/BatchCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/BatchCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..01c625640d24821cfeb704f90eb724fab34cb3e1 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/BatchCommands.php @@ -0,0 +1,25 @@ +<?php +namespace Drush\Drupal\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\UnstructuredListData; +use Drush\Commands\DrushCommands; + +class BatchCommands extends DrushCommands +{ + + /** + * Process operations in the specified batch set. + * + * @command batch:process + * @aliases batch-process + * @param $batch_id The batch id that will be processed. + * @hidden + * + * @return \Consolidation\OutputFormatters\StructuredData\UnstructuredListData + */ + public function process($batch_id, $options = ['format' => 'json']) + { + $return = drush_batch_command($batch_id); + return new UnstructuredListData($return); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/CliCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/CliCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..30742d87af599a7bafac73859cc683247776894a --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/CliCommands.php @@ -0,0 +1,282 @@ +<?php + +namespace Drush\Drupal\Commands\core; + +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Psysh\DrushCommand; +use Drush\Psysh\DrushHelpCommand; +use Drupal\Component\Assertion\Handle; +use Drush\Psysh\Shell; +use Drush\Runtime\Runtime; +use Psy\Configuration; +use Psy\VersionUpdater\Checker; +use Webmozart\PathUtil\Path; + +class CliCommands extends DrushCommands +{ + + /** + * Drush's PHP Shell. + * + * @command docs:repl + * @aliases docs-repl + * @hidden + * @topic + */ + public function docs() + { + self::printFile(DRUSH_BASE_PATH. '/docs/repl.md'); + } + + /** + * @command php:cli + * @description Open an interactive shell on a Drupal site. + * @aliases php,core:cli,core-cli + * @option $version-history Use command history based on Drupal version + * (Default is per site). + * @option $cwd Changes the working directory of the shell + * (Default is the project root directory) + * @topics docs:repl + * @remote-tty + */ + public function cli(array $options = ['version-history' => false, 'cwd' => null]) + { + $configuration = new Configuration(); + + // Set the Drush specific history file path. + $configuration->setHistoryFile($this->historyPath($options)); + + // Disable checking for updates. Our dependencies are managed with Composer. + $configuration->setUpdateCheck(Checker::NEVER); + + $shell = new Shell($configuration); + + + // Register the assertion handler so exceptions are thrown instead of errors + // being triggered. This plays nicer with PsySH. + Handle::register(); + $shell->setScopeVariables(['container' => \Drupal::getContainer()]); + + // Add Drupal 8 specific casters to the shell configuration. + $configuration->addCasters($this->getCasters()); + + // Add Drush commands to the shell. + $shell->addCommands([new DrushHelpCommand()]); + $shell->addCommands($this->getDrushCommands()); + + // PsySH will never return control to us, but our shutdown handler will still + // run after the user presses ^D. Mark this command as completed to avoid a + // spurious error message. + Runtime::setCompleted(); + + // Run the terminate event before the shell is run. Otherwise, if the shell + // is forking processes (the default), any child processes will close the + // database connection when they are killed. So when we return back to the + // parent process after, there is no connection. This will be called after the + // command in preflight still, but the subscriber instances are already + // created from before. Call terminate() regardless, this is a no-op for all + // DrupalBoot classes except DrupalBoot8. + if ($bootstrap = Drush::bootstrap()) { + $bootstrap->terminate(); + } + + // If the cwd option is passed, lets change the current working directory to wherever + // the user wants to go before we lift psysh. + if ($options['cwd']) { + chdir($options['cwd']); + } + + $shell->run(); + } + + /** + * Returns a filtered list of Drush commands used for CLI commands. + * + * @return array + */ + protected function getDrushCommands() + { + $application = Drush::getApplication(); + $commands = $application->all(); + + $ignored_commands = [ + 'help', + 'php:cli', + 'core:cli', + 'php', + 'php:eval', + 'eval', + 'ev', + 'php:script', + 'scr', + ]; + $php_keywords = $this->getPhpKeywords(); + + /** @var \Consolidation\AnnotatedCommand\AnnotatedCommand $command */ + foreach ($commands as $name => $command) { + $definition = $command->getDefinition(); + + // Ignore some commands that don't make sense inside PsySH, are PHP keywords + // are hidden, or are aliases. + if (in_array($name, $ignored_commands) || in_array($name, $php_keywords) || ($name !== $command->getName())) { + unset($commands[$name]); + } else { + $aliases = $command->getAliases(); + // Make sure the command aliases don't contain any PHP keywords. + if (!empty($aliases)) { + $command->setAliases(array_diff($aliases, $php_keywords)); + } + } + } + + return array_map(function ($command) { + return new DrushCommand($command); + }, $commands); + } + + /** + * Returns a mapped array of casters for use in the shell. + * + * These are Symfony VarDumper casters. + * See http://symfony.com/doc/current/components/var_dumper/advanced.html#casters + * for more information. + * + * @return array. + * An array of caster callbacks keyed by class or interface. + */ + protected function getCasters() + { + return [ + 'Drupal\Core\Entity\ContentEntityInterface' => 'Drush\Psysh\Caster::castContentEntity', + 'Drupal\Core\Field\FieldItemListInterface' => 'Drush\Psysh\Caster::castFieldItemList', + 'Drupal\Core\Field\FieldItemInterface' => 'Drush\Psysh\Caster::castFieldItem', + 'Drupal\Core\Config\Entity\ConfigEntityInterface' => 'Drush\Psysh\Caster::castConfigEntity', + 'Drupal\Core\Config\ConfigBase' => 'Drush\Psysh\Caster::castConfig', + 'Drupal\Component\DependencyInjection\Container' => 'Drush\Psysh\Caster::castContainer', + 'Drupal\Component\Render\MarkupInterface' => 'Drush\Psysh\Caster::castMarkup', + ]; + } + + /** + * Returns the file path for the CLI history. + * + * This can either be site specific (default) or Drupal version specific. + * + * @param array $options + * + * @return string. + */ + protected function historyPath(array $options) + { + $cli_directory = Path::join($this->getConfig()->cache(), 'cli'); + $drupal_major_version = Drush::getMajorVersion(); + + // If there is no drupal version (and thus no root). Just use the current + // path. + // @todo Could use a global file within drush? + if (!$drupal_major_version) { + $file_name = 'global-' . md5($this->getConfig()->cwd()); + } elseif ($options['version-history']) { + // If only the Drupal version is being used for the history. + $file_name = "drupal-$drupal_major_version"; + } else { + // If there is an alias, use that in the site specific name. Otherwise, + // use a hash of the root path. + $aliasRecord = Drush::aliasManager()->getSelf(); + + if ($aliasRecord->name()) { + $site_suffix = ltrim($aliasRecord->name(), '@'); + } else { + $drupal_root = Drush::bootstrapManager()->getRoot(); + $site_suffix = md5($drupal_root); + } + + $file_name = "drupal-site-$site_suffix"; + } + + $full_path = "$cli_directory/$file_name"; + + $this->logger()->info(dt('History: @full_path', ['@full_path' => $full_path])); + + return $full_path; + } + + /** + * Returns a list of PHP keywords. + * + * This will act as a blacklist for command and alias names. + * + * @return array + */ + protected function getPhpKeywords() + { + return [ + '__halt_compiler', + 'abstract', + 'and', + 'array', + 'as', + 'break', + 'callable', + 'case', + 'catch', + 'class', + 'clone', + 'const', + 'continue', + 'declare', + 'default', + 'die', + 'do', + 'echo', + 'else', + 'elseif', + 'empty', + 'enddeclare', + 'endfor', + 'endforeach', + 'endif', + 'endswitch', + 'endwhile', + 'eval', + 'exit', + 'extends', + 'final', + 'for', + 'foreach', + 'function', + 'global', + 'goto', + 'if', + 'implements', + 'include', + 'include_once', + 'instanceof', + 'insteadof', + 'interface', + 'isset', + 'list', + 'namespace', + 'new', + 'or', + 'print', + 'private', + 'protected', + 'public', + 'require', + 'require_once', + 'return', + 'static', + 'switch', + 'throw', + 'trait', + 'try', + 'unset', + 'use', + 'var', + 'while', + 'xor', + ]; + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/DrupalCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/DrupalCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..e1a4486acd19d1e9f1fcfbdf4e56b69ca270e3dd --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/DrupalCommands.php @@ -0,0 +1,136 @@ +<?php +namespace Drush\Drupal\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal\Core\CronInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drush\Commands\DrushCommands; +use Drush\Drupal\DrupalUtil; +use Drush\Utils\StringUtils; + +class DrupalCommands extends DrushCommands +{ + + /** + * @var \Drupal\Core\CronInterface + */ + protected $cron; + + /** + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + /** + * @return \Drupal\Core\CronInterface + */ + public function getCron() + { + return $this->cron; + } + + /** + * @return \Drupal\Core\Extension\ModuleHandlerInterface + */ + public function getModuleHandler() + { + return $this->moduleHandler; + } + + /** + * @param \Drupal\Core\CronInterface $cron + * @param ModuleHandlerInterface $moduleHandler + */ + public function __construct(CronInterface $cron, ModuleHandlerInterface $moduleHandler) + { + $this->cron = $cron; + $this->moduleHandler = $moduleHandler; + } + + /** + * Run all cron hooks in all active modules for specified site. + * + * @command core:cron + * @aliases cron,core-cron + * @topics docs:cron + */ + public function cron() + { + $result = $this->getCron()->run(); + if (!$result) { + throw new \Exception(dt('Cron run failed.')); + } + } + + /** + * Information about things that may be wrong in your Drupal installation. + * + * @command core:requirements + * @option severity Only show status report messages with a severity greater than or equal to the specified value. + * @option ignore Comma-separated list of requirements to remove from output. Run with --format=yaml to see key values to use. + * @aliases status-report,rq,core-requirements + * @usage drush core:requirements + * Show all status lines from the Status Report admin page. + * @usage drush core:requirements --severity=2 + * Show only the red lines from the Status Report admin page. + * @table-style default + * @field-labels + * title: Title + * severity: Severity + * sid: SID + * description: Description + * value: Summary + * @default-fields title,severity,value + * @filter-default-field severity + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function requirements($options = ['format' => 'table', 'severity' => -1, 'ignore' => '']) + { + include_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; + $severities = [ + REQUIREMENT_INFO => dt('Info'), + REQUIREMENT_OK => dt('OK'), + REQUIREMENT_WARNING => dt('Warning'), + REQUIREMENT_ERROR => dt('Error'), + ]; + + drupal_load_updates(); + + $requirements = $this->getModuleHandler()->invokeAll('requirements', ['runtime']); + // If a module uses "$requirements[] = " instead of + // "$requirements['label'] = ", then build a label from + // the title. + foreach ($requirements as $key => $info) { + if (is_numeric($key)) { + unset($requirements[$key]); + $new_key = strtolower(str_replace(' ', '_', $info['title'])); + $requirements[$new_key] = $info; + } + } + $ignore_requirements = StringUtils::csvToArray($options['ignore']); + foreach ($ignore_requirements as $ignore) { + unset($requirements[$ignore]); + } + ksort($requirements); + + $min_severity = $options['severity']; + $i = 0; + foreach ($requirements as $key => $info) { + $info += ['value' => '', 'description' => '']; + $severity = array_key_exists('severity', $info) ? $info['severity'] : -1; + $rows[$i] = [ + 'title' => (string) $info['title'], + 'value' => (string) $info['value'], + 'description' => DrupalUtil::drushRender($info['description']), + 'sid' => $severity, + 'severity' => @$severities[$severity] + ]; + if ($severity < $min_severity) { + unset($rows[$i]); + } + $i++; + } + $result = new RowsOfFields($rows); + return $result; + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/EntityCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/EntityCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..c425ad7a7f71480e20c5cefe5faba515a6726943 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/EntityCommands.php @@ -0,0 +1,70 @@ +<?php + +namespace Drush\Drupal\Commands\core; + +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drush\Commands\DrushCommands; +use Drush\Utils\StringUtils; + +class EntityCommands extends DrushCommands +{ + + protected $entityTypeManager; + + /** + * EntityCommands constructor. + */ + public function __construct(EntityTypeManagerInterface $entityTypeManager) + { + $this->entityTypeManager = $entityTypeManager; + } + + /** + * Delete content entities. + * + * To delete configuration entities, see config:delete command. + * + * @param string $entity_type An entity machine name. + * @param string $ids A comma delimited list of Ids. + * @param array $options + * + * @option bundle Restrict deletion to the specified bundle. Ignored when ids is specified. + * @usage drush entity:delete node --bundle=article + * Delete all article entities. + * @usage drush entity:delete shortcut + * Delete all shortcut entities. + * @usage drush entity:delete node 22,24 + * Delete nodes 22 and 24. + * @usage drush entity:delete user + * Delete all users except uid=1. + * + * @command entity:delete + * @aliases edel,entity-delete + * @throws \Exception + */ + public function delete($entity_type, $ids = null, $options = ['bundle' => self::REQ]) + { + $storage = $this->entityTypeManager->getStorage($entity_type); + if ($ids = StringUtils::csvToArray($ids)) { + $entities = $storage->loadMultiple($ids); + } elseif ($bundle = $options['bundle']) { + $bundleKey = $this->entityTypeManager->getDefinition($entity_type)->getKey('bundle'); + $entities = $storage->loadByProperties([$bundleKey => $bundle]); + } else { + $entities = $storage->loadMultiple(); + } + + // Don't delete uid=1, uid=0. + if ($entity_type == 'user') { + unset($entities[1]); + unset($entities[0]); + } + + if (empty($entities)) { + $this->logger()->success(dt('No matching entities found.')); + } else { + $storage->delete($entities); + $this->logger()->success(dt('Deleted !type entity Ids: !ids', ['!type' => $entity_type, '!ids' => implode(', ', array_keys($entities))])); + } + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/ImageCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/ImageCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..df71f6f32216f5808c2fc4719b79d99fc057a025 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/ImageCommands.php @@ -0,0 +1,91 @@ +<?php + +namespace Drush\Drupal\Commands\core; + +use Consolidation\AnnotatedCommand\AnnotationData; +use Drupal\image\Entity\ImageStyle; +use Drush\Commands\DrushCommands; +use Drush\Utils\StringUtils; +use Symfony\Component\Console\Input\InputInterface; + +class ImageCommands extends DrushCommands +{ + + /** + * Flush all derived images for a given style. + * + * @command image:flush + * @param $style_names A comma delimited list of image style machine names. If not provided, user may choose from a list of names. + * @option all Flush all derived images + * @usage drush image:flush + * Pick an image style and then delete its derivatives. + * @usage drush image:flush thumbnail,large + * Delete all thumbnail and large derivatives. + * @usage drush image:flush --all + * Flush all derived images. They will be regenerated on demand. + * @validate-entity-load image_style style_names + * @validate-module-enabled image + * @aliases if,image-flush + */ + public function flush($style_names, $options = ['all' => false]) + { + foreach (ImageStyle::loadMultiple(StringUtils::csvToArray($style_names)) as $style_name => $style) { + $style->flush(); + $this->logger()->success(dt('Image style !style_name flushed', ['!style_name' => $style_name])); + } + } + + /** + * @hook interact image-flush + */ + public function interactFlush($input, $output) + { + $styles = array_keys(ImageStyle::loadMultiple()); + $style_names = $input->getArgument('style_names'); + + if (empty($style_names)) { + $styles_all = $styles; + array_unshift($styles_all, 'all'); + $choices = array_combine($styles_all, $styles_all); + $style_names = $this->io()->choice(dt("Choose a style to flush"), $choices, 'all'); + if ($style_names == 'all') { + $style_names = implode(',', $styles); + } + $input->setArgument('style_names', $style_names); + } + } + + /** + * @hook init image-flush + */ + public function initFlush(InputInterface $input, AnnotationData $annotationData) + { + // Needed for non-interactive calls. + if ($input->getOption('all')) { + $styles = array_keys(ImageStyle::loadMultiple()); + $input->setArgument('style_names', implode(",", $styles)); + } + } + + /** + * Create an image derivative. + * + * @command image:derive + * @param $style_name An image style machine name. + * @param $source Path to a source image. Optionally prepend stream wrapper scheme. + * @usage drush image:derive thumbnail core/themes/bartik/screenshot.png + * Save thumbnail sized derivative of logo image. + * @validate-file-exists source + * @validate-entity-load image_style style_name + * @validate-module-enabled image + * @aliases id,image-derive + */ + public function derive($style_name, $source) + { + $image_style = ImageStyle::load($style_name); + $derivative_uri = $image_style->buildUri($source); + if ($image_style->createDerivative($source, $derivative_uri)) { + return $derivative_uri; + } + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/JsonapiCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/JsonapiCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..4e157292c760bfe606b6e29e706f5fc35cca9229 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/JsonapiCommands.php @@ -0,0 +1,34 @@ +<?php +namespace Drush\Drupal\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\UnstructuredData; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\HttpKernelInterface; + +class JsonapiCommands extends DrushCommands +{ + + /** + * Execute a JSONAPI request. + * + * @command jn:get + * + * @param $url The JSONAPI URL to request. + * @usage drush jn:get jsonapi/node/article + * Get a list of articles back as JSON. + * @usage drush jn:get jsonapi/node/article | jq + * Pretty print JSON by piping to jq. See https://stedolan.github.io/jq/ for lots more jq features. + * @validate-module-enabled jsonapi + * + * @return UnstructuredData + */ + public function get($url, $options = ['format' => 'json']) + { + $kernel = Drush::bootstrap()->getKernel(); + $sub_request = Request::create($url, 'GET'); + $subResponse = $kernel->handle($sub_request, HttpKernelInterface::SUB_REQUEST); + return new UnstructuredData(json_decode($subResponse->getContent())); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/LanguageCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/LanguageCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..98230100ddcef75bef890300b6e8ea9740e3a58a --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/LanguageCommands.php @@ -0,0 +1,188 @@ +<?php + +namespace Drush\Drupal\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Language\LanguageManagerInterface; +use Drupal\language\Entity\ConfigurableLanguage; +use Drush\Commands\DrushCommands; +use Drush\Utils\StringUtils; + +class LanguageCommands extends DrushCommands +{ + + /** + * @var \Drupal\Core\Language\LanguageManagerInterface + */ + protected $languageManager; + + /** + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + /** + * @return \Drupal\Core\Language\LanguageManagerInterface + */ + public function getLanguageManager() + { + return $this->languageManager; + } + + /** + * @return \Drupal\Core\Extension\ModuleHandlerInterface + */ + public function getModuleHandler() + { + return $this->moduleHandler; + } + + public function __construct(LanguageManagerInterface $languageManager, ModuleHandlerInterface $moduleHandler) + { + $this->languageManager = $languageManager; + $this->moduleHandler = $moduleHandler; + } + + /** + * Add a configurable language. + * + * @command language:add + * @param $langcode A comma delimited list of language codes. + * @option skip-translations Prevent translations to be downloaded and/or imported. + * @usage drush language:add nl,fr + * Add Dutch and French language and import their translations. + * @usage drush language:add nl --skip-translations + * Add Dutch language without importing translations. + * @aliases language-add + * @validate-module-enabled language + * @hidden + * @throws \Exception + */ + public function add($langcode, $options = ['skip-translations' => false]) + { + if ($langcodes = StringUtils::csvToArray($langcode)) { + $langcodes = array_unique($langcodes); + $langcodes = $this->filterValidLangcode($langcodes); + $langcodes = $this->filterNewLangcode($langcodes); + if (empty($langcodes)) { + return; + } + + foreach ($langcodes as $langcode) { + $language = ConfigurableLanguage::createFromLangcode($langcode); + $language->save(); + + $this->logger->success(dt('Added language @language', [ + '@language' => $language->label(), + ])); + } + + if ($options['skip-translations']) { + return; + } + + if ($this->getModuleHandler()->moduleExists('locale')) { + $this->setBatchLanguageImport($langcodes); + drush_backend_batch_process(); + } + } + } + + /** + * Print the currently available languages. + * + * @command language:info + * @aliases language-info + * @hidden + * @field-labels + * language: Language + * direction: Direction + * default: Default + * locked: Locked + * @default-fields language,direction,default + * @filter-default-field language + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function info() + { + $rows = []; + $languages = $this->getLanguageManager()->getLanguages(); + + foreach ($languages as $key => $language) { + $row = [ + 'language' => $language->getName() . ' (' . $language->getId() . ')', + 'direction' => $language->getDirection(), + 'default' => $language->isDefault() ? dt('yes') : '', + 'locked' => $language->isLocked() ? dt('yes') : '', + ]; + $rows[$key] = $row; + } + + return new RowsOfFields($rows); + } + + /** + * Filters valid language codes. + * + * @param $langcodes + * @return array + * @throws \Exception + * Exception when a language code is not in the standard language list. + */ + private function filterValidLangcode($langcodes) + { + $standardLanguages = $this->getLanguageManager()->getStandardLanguageList(); + foreach ($langcodes as $key => $langcode) { + if (!isset($standardLanguages[$langcode])) { + throw new \Exception(dt('Unknown language: !langcode', [ + '!langcode' => $langcode + ])); + } + } + + return $langcodes; + } + + /** + * Filters new language codes. + * + * @param $langcodes + * @return array + */ + private function filterNewLangcode($langcodes) + { + $enabledLanguages = $this->getLanguageManager()->getLanguages(); + foreach ($langcodes as $key => $langcode) { + if (isset($enabledLanguages[$langcode])) { + $this->logger->warning(dt('The language !langcode is already enabled.', [ + '!langcode' => $langcode + ])); + unset($langcodes[$key]); + } + } + + return $langcodes; + } + + /** + * Sets a batch to download and import translations and update configurations. + * + * @param $langcodes + */ + private function setBatchLanguageImport($langcodes) + { + $moduleHandler = $this->getModuleHandler(); + $moduleHandler->loadInclude('locale', 'inc', 'locale.translation'); + $moduleHandler->loadInclude('locale', 'inc', 'locale.fetch'); + $moduleHandler->loadInclude('locale', 'inc', 'locale.bulk'); + $translationOptions = _locale_translation_default_update_options(); + + locale_translation_clear_status(); + $batch = locale_translation_batch_update_build([], $langcodes, $translationOptions); + batch_set($batch); + if ($batch = locale_config_batch_update_components($translationOptions, $langcodes)) { + batch_set($batch); + } + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/LocaleCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/LocaleCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..c6c85f417471dd22d352ea277ffd2393c3853cff --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/LocaleCommands.php @@ -0,0 +1,339 @@ +<?php + +namespace Drush\Drupal\Commands\core; + +use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Language\LanguageInterface; +use Drupal\Core\Language\LanguageManagerInterface; +use Drupal\Core\State\StateInterface; +use Drupal\language\Entity\ConfigurableLanguage; +use Drush\Commands\DrushCommands; + +class LocaleCommands extends DrushCommands +{ + + protected $languageManager; + + protected $configFactory; + + protected $moduleHandler; + + protected $state; + + /** + * @return \Drupal\Core\Language\LanguageManagerInterface + */ + protected function getLanguageManager() + { + return $this->languageManager; + } + + /** + * @return \Drupal\Core\Config\ConfigFactoryInterface + */ + protected function getConfigFactory() + { + return $this->configFactory; + } + + /** + * @return \Drupal\Core\Extension\ModuleHandlerInterface + */ + public function getModuleHandler() + { + return $this->moduleHandler; + } + + /** + * @return mixed + */ + public function getState() + { + return $this->state; + } + + public function __construct(LanguageManagerInterface $languageManager, ConfigFactoryInterface $configFactory, ModuleHandlerInterface $moduleHandler, StateInterface $state) + { + $this->languageManager = $languageManager; + $this->configFactory = $configFactory; + $this->moduleHandler = $moduleHandler; + $this->state = $state; + } + + /** + * Checks for available translation updates. + * + * @command locale:check + * @aliases locale-check + * @validate-module-enabled locale + */ + public function check() + { + $this->getModuleHandler()->loadInclude('locale', 'inc', 'locale.compare'); + + // Check translation status of all translatable project in all languages. + // First we clear the cached list of projects. Although not strictly + // necessary, this is helpful in case the project list is out of sync. + locale_translation_flush_projects(); + locale_translation_check_projects(); + + // Execute a batch if required. A batch is only used when remote files + // are checked. + if (batch_get()) { + drush_backend_batch_process(); + } + } + + /** + * Imports the available translation updates. + * + * @see TranslationStatusForm::buildForm() + * @see TranslationStatusForm::prepareUpdateData() + * @see TranslationStatusForm::submitForm() + * + * @todo This can be simplified once https://www.drupal.org/node/2631584 lands + * in Drupal core. + * + * @command locale:update + * @aliases locale-update + * @option langcodes A comma-separated list of language codes to update. If omitted, all translations will be updated. + * @validate-module-enabled locale + */ + public function update($options = ['langcodes' => self::REQ]) + { + $module_handler = $this->getModuleHandler(); + $module_handler->loadInclude('locale', 'fetch.inc'); + $module_handler->loadInclude('locale', 'bulk.inc'); + + $langcodes = []; + foreach (locale_translation_get_status() as $project_id => $project) { + foreach ($project as $langcode => $project_info) { + if (!empty($project_info->type) && !in_array($langcode, $langcodes)) { + $langcodes[] = $langcode; + } + } + } + + if ($passed_langcodes = $options['langcodes']) { + $langcodes = array_intersect($langcodes, explode(',', $passed_langcodes)); + // @todo Not selecting any language code in the user interface results in + // all translations being updated, so we mimick that behavior here. + } + + // Deduplicate the list of langcodes since each project may have added the + // same language several times. + $langcodes = array_unique($langcodes); + + // @todo Restricting by projects is not possible in the user interface and is + // broken when attempting to do it in a hook_form_alter() implementation so + // we do not allow for it here either. + $projects = []; + + // Set the translation import options. This determines if existing + // translations will be overwritten by imported strings. + $translationOptions = _locale_translation_default_update_options(); + + // If the status was updated recently we can immediately start fetching the + // translation updates. If the status is expired we clear it an run a batch to + // update the status and then fetch the translation updates. + $last_checked = $this->getState()->get('locale.translation_last_checked'); + if ($last_checked < REQUEST_TIME - LOCALE_TRANSLATION_STATUS_TTL) { + locale_translation_clear_status(); + $batch = locale_translation_batch_update_build([], $langcodes, $translationOptions); + batch_set($batch); + } else { + // Set a batch to download and import translations. + $batch = locale_translation_batch_fetch_build($projects, $langcodes, $translationOptions); + batch_set($batch); + // Set a batch to update configuration as well. + if ($batch = locale_config_batch_update_components($translationOptions, $langcodes)) { + batch_set($batch); + } + } + + drush_backend_batch_process(); + } + + /** + * Imports to a gettext translation file. + * + * @command locale:import + * @validate-module-enabled locale + * @param $langcode The language code of the imported translations. + * @param $file Path and file name of the gettext file. + * @option type The type of translations to be imported, defaults to 'not-customized'. Options: + * - customized: Treat imported strings as custom translations. + * - not-customized: Treat imported strings as not-custom translations. + * @option override Whether and how imported strings will override existing translations. Defaults to the Import behavior configurred in the admin interface. Options: + * - none: Don't overwrite existing translations. Only append new translations. + * - customized: Only override existing customized translations. + * - not-customized: Only override non-customized translations, customized translations are kept. + * - all: Override any existing translation. + * @usage drush locale-import nl drupal-8.4.2.nl.po + * Import the Dutch drupal core translation. + * @usage drush locale-import nl custom-translations.po --type=custom --override=all + * Import customized Dutch translations and override any existing translation. + * @aliases locale-import + * @throws \Exception + */ + public function import($langcode, $file, $options = ['type' => self::OPT, 'override' => self::OPT]) + { + if (!drush_file_not_empty($file)) { + throw new \Exception(dt('File @file not found or empty.', ['@file' => $file])); + } + + $language = $this->getTranslatableLanguage($langcode, true); + + $this->getModuleHandler()->loadInclude('locale', 'translation.inc'); + $this->getModuleHandler()->loadInclude('locale', 'bulk.inc'); + + $translationOptions = _locale_translation_default_update_options(); + $translationOptions['langcode'] = $language->getId(); + $translationOptions['customized'] = $this->convertCustomizedType($options['type']); + $override = $this->convertOverrideOption($options['override']); + if ($override) { + $translationOptions['overwrite_options'] = $override; + } + + $poFile = (object) [ + 'filename' => basename($file), + 'uri' => $file, + ]; + $poFile = locale_translate_file_attach_properties($poFile, $translationOptions); + + // Set a batch to download and import translations. + $batch = locale_translate_batch_build([$poFile->uri => $poFile], $translationOptions); + batch_set($batch); + if ($batch = locale_config_batch_update_components($translationOptions, [$language->getId()])) { + batch_set($batch); + } + + drush_backend_batch_process(); + } + + /** + * Converts input of translation type. + * + * @param $type + * @return integer + */ + private function convertCustomizedType($type) + { + switch ($type) { + case 'customized': + $result = LOCALE_CUSTOMIZED; + break; + + default: + $result = LOCALE_NOT_CUSTOMIZED; + break; + } + + return $result; + } + + /** + * Converts input of override option. + * + * @param $override + * @return array + */ + private function convertOverrideOption($override) + { + $result = []; + + switch ($override) { + case 'none': + $result = [ + 'not_customized' => false, + 'customized' => false, + ]; + break; + + case 'customized': + $result = [ + 'not_customized' => false, + 'customized' => true, + ]; + break; + + case 'not-customized': + $result = [ + 'not_customized' => true, + 'customized' => false, + ]; + break; + + case 'all': + $result = [ + 'not_customized' => true, + 'customized' => true, + ]; + break; + } + + return $result; + } + + /** + * Get translatable language object. + * + * @param string $langcode The language code of the language object. + * @param bool $addLanguage Create language when not available. + * @return LanguageInterface|null + * @throws \Exception + */ + private function getTranslatableLanguage($langcode, $addLanguage = false) + { + if (!$langcode) { + return null; + } + + $language = $this->getLanguageManager()->getLanguage($langcode); + + if (!$language) { + if ($addLanguage) { + $language = ConfigurableLanguage::createFromLangcode($langcode); + $language->save(); + + $this->logger->success(dt('Added language @language', [ + '@language' => $language->label(), + ])); + } else { + throw new \Exception(dt('Language code @langcode is not configured.', [ + '@langcode' => $langcode, + ])); + } + } + + if (!$this->isTranslatable($language)) { + throw new \Exception(dt('Language code @langcode is not translatable.', [ + '@langcode' => $langcode, + ])); + } + + return $language; + } + + /** + * Check if language is translatable. + * + * @param LanguageInterface $language + * @return bool + */ + private function isTranslatable(LanguageInterface $language) + { + if ($language->isLocked()) { + return false; + } + + if ($language->getId() != 'en') { + return true; + } + + return (bool)$this->getConfigFactory() + ->get('locale.settings') + ->get('translate_english'); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/MessengerCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/MessengerCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..09cd11db261fa2e7b6d96a2fd0b12a625de4644c --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/MessengerCommands.php @@ -0,0 +1,58 @@ +<?php + +namespace Drush\Drupal\Commands\core; + +use Drupal\Core\Messenger\MessengerInterface; +use Drush\Commands\DrushCommands; +use Drush\Drupal\DrupalUtil; + +class MessengerCommands extends DrushCommands +{ + protected $messenger; + + /** + * @inheritDoc + */ + public function __construct() + { + if (\Drupal::hasService('messenger')) { + // Inject this once Drupal 8.4 becomes unsupported. + $this->messenger = \Drupal::messenger(); + } + } + + /** + * @hook pre-command * + */ + public function pre() + { + self::log(); + } + + /** + * @hook post-command * + */ + public function post() + { + self::log(); + } + + public function log() + { + if (!\Drupal::hasService('messenger')) { + return; + } + + $prefix = 'Message: '; + foreach ($this->messenger->messagesByType(MessengerInterface::TYPE_ERROR) as $message) { + $this->logger()->error($prefix . DrupalUtil::drushRender($message)); + } + foreach ($this->messenger->messagesByType(MessengerInterface::TYPE_WARNING) as $message) { + $this->logger()->warning($prefix . DrupalUtil::drushRender($message)); + } + foreach ($this->messenger->messagesByType(MessengerInterface::TYPE_STATUS) as $message) { + $this->logger()->notice($prefix . DrupalUtil::drushRender($message)); + } + $this->messenger->deleteAll(); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/QueueCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/QueueCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..3bf4b514d29719969fe23fa98895a926c6b6790b --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/QueueCommands.php @@ -0,0 +1,175 @@ +<?php +namespace Drush\Drupal\Commands\core; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\AnnotatedCommand\CommandError; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal\Core\Queue\QueueFactory; +use Drupal\Core\Queue\QueueWorkerManagerInterface; +use Drupal\Core\Queue\RequeueException; +use Drupal\Core\Queue\SuspendQueueException; +use Drush\Commands\DrushCommands; + +class QueueCommands extends DrushCommands +{ + + /** + * @var \Drupal\Core\Queue\QueueWorkerManager + */ + protected $workerManager; + + protected $queueService; + + public function __construct(QueueWorkerManagerInterface $workerManager, QueueFactory $queueService) + { + $this->workerManager = $workerManager; + $this->queueService = $queueService; + } + + /** + * @return \Drupal\Core\Queue\QueueWorkerManager + */ + public function getWorkerManager() + { + return $this->workerManager; + } + + /** + * @return \Drupal\Core\Queue\QueueFactory + */ + public function getQueueService() + { + return $this->queueService; + } + + /** + * Keep track of queue definitions. + * + * @var array + */ + protected static $queues; + + /** + * Run a specific queue by name. + * + * @command queue:run + * @aliases queue-run + * @param string $name The name of the queue to run, as defined in either hook_queue_info or hook_cron_queue_info. + * @validate-queue name + * @option time-limit The maximum number of seconds allowed to run the queue + */ + public function run($name, $options = ['time-limit' => self::REQ]) + { + $time_limit = (int) $options['time-limit']; + $start = microtime(true); + $worker = $this->getWorkerManager()->createInstance($name); + $end = time() + $time_limit; + $queue = $this->getQueue($name); + $count = 0; + + while ((!$time_limit || time() < $end) && ($item = $queue->claimItem())) { + try { + $this->logger()->info(dt('Processing item @id from @name queue.', ['@name' => $name, '@id' => $item->item_id])); + $worker->processItem($item->data); + $queue->deleteItem($item); + $count++; + } catch (RequeueException $e) { + // The worker requested the task to be immediately requeued. + $queue->releaseItem($item); + } catch (SuspendQueueException $e) { + // If the worker indicates there is a problem with the whole queue, + // release the item. + $queue->releaseItem($item); + throw new \Exception($e->getMessage()); + } + } + $elapsed = microtime(true) - $start; + $this->logger()->success(dt('Processed @count items from the @name queue in @elapsed sec.', ['@count' => $count, '@name' => $name, '@elapsed' => round($elapsed, 2)])); + } + + /** + * Returns a list of all defined queues. + * + * @command queue:list + * @aliases queue-list + * @field-labels + * queue: Queue + * items: Items + * class: Class + * + * @filter-default-field queue + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function qList($options = ['format' => 'table']) + { + $result = []; + foreach (array_keys($this->getQueues()) as $name) { + $q = $this->getQueue($name); + $result[$name] = [ + 'queue' => $name, + 'items' => $q->numberOfItems(), + 'class' => get_class($q), + ]; + } + return new RowsOfFields($result); + } + + /** + * Delete all items in a specific queue. + * + * @command queue:delete + * @aliases queue-delete + * @param $name The name of the queue to run, as defined in either hook_queue_info or hook_cron_queue_info. + * @validate-queue name + */ + public function delete($name) + { + $queue = $this->getQueue($name); + $queue->deleteQueue(); + $this->logger()->success(dt('All items in @name queue deleted.', ['@name' => $name])); + } + + /** + * Validate that queue permission exists. + * + * Annotation value should be the name of the argument/option containing the name. + * + * @hook validate @validate-queue + * @param \Consolidation\AnnotatedCommand\CommandData $commandData + * @return \Consolidation\AnnotatedCommand\CommandError|null + */ + public function validateQueueName(CommandData $commandData) + { + $arg_name = $commandData->annotationData()->get('validate-queue', null); + $name = $commandData->input()->getArgument($arg_name); + $all = array_keys(self::getQueues()); + if (!in_array($name, $all)) { + $msg = dt('Queue not found: !name', ['!name' => $name]); + return new CommandError($msg); + } + } + + /** + * {@inheritdoc} + */ + public function getQueues() + { + if (!isset(static::$queues)) { + static::$queues = []; + foreach ($this->getWorkerManager()->getDefinitions() as $name => $info) { + static::$queues[$name] = $info; + } + } + return static::$queues; + } + + /** + * {@inheritdoc} + * + * @return \Drupal\Core\Queue\QueueInterface + */ + public function getQueue($name) + { + return $this->getQueueService()->get($name); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/RoleCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/RoleCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..abfc38a8e70e36773a4b7ac77387069d2a212d6f --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/RoleCommands.php @@ -0,0 +1,147 @@ +<?php +namespace Drush\Drupal\Commands\core; + +use Consolidation\OutputFormatters\Options\FormatterOptions; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Drupal\user\Entity\Role; +use Drush\Commands\DrushCommands; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drush\Drush; +use Drush\SiteAlias\SiteAliasManagerAwareInterface; +use Drush\Utils\StringUtils; + +class RoleCommands extends DrushCommands implements SiteAliasManagerAwareInterface +{ + use SiteAliasManagerAwareTrait; + + /** + * Create a new role. + * + * @command role:create + * @param $machine_name The symbolic machine name for the role. + * @param $human_readable_name A descriptive name for the role. + * @usage drush role:create 'test role' + * Create a new role 'test role'. On D8, the human-readable name will be 'Test role'. + * @usage drush role:create 'test role' 'Test role' + * Create a new role with a machine name of 'test role', and a human-readable name of 'Test role'. + * @aliases rcrt,role-create + */ + public function create($machine_name, $human_readable_name = null) + { + $role = Role::create([ + 'id' => $machine_name, + 'label' => $human_readable_name, + ], 'user_role'); + $role->save(); + $this->logger()->success(dt('Created "!role"', ['!role' => $machine_name])); + return $role; + } + + /** + * Delete a new role. + * + * @command role:delete + * @param $machine_name The symbolic machine name for the role. + * @validate-entity-load user_role machine_name + * @usage drush role:delete 'test role' + * Delete the role 'test role'. + * @aliases rdel,role-delete + */ + public function delete($machine_name) + { + $role = Role::load($machine_name); + $role->delete(); + $this->logger()->success(dt('Deleted "!role"', ['!role' => $machine_name])); + } + + /** + * Grant specified permission(s) to a role. + * + * @todo Add validation for permission names. + * + * @command role:perm:add + * @validate-entity-load user_role machine_name + * @validate-permissions permissions + * @param $machine_name The role to modify. + * @param $permissions The list of permission to grant, delimited by commas. + * @usage drush role-add-perm anonymous 'post comments' + * Allow anon users to post comments. + * @usage drush role:add-perm anonymous "'post comments','access content'" + * Allow anon users to post comments and access content. + * @usage drush pm:info --fields=permissions --format=csv aggregator + * Discover the permissions associated with given module (then use this command as needed). + * @aliases rap,role-add-perm + */ + public function roleAddPerm($machine_name, $permissions) + { + $perms = StringUtils::csvToArray($permissions); + user_role_grant_permissions($machine_name, $perms); + $this->logger()->success(dt('Added "!permissions" to "!role"', ['!permissions' => $permissions, '!role' => $machine_name])); + $this->processManager()->drush($this->siteAliasManager()->getSelf(), 'cache-rebuild'); + } + + /** + * Remove specified permission(s) from a role. + * + * @command role:perm:remove + * @validate-entity-load user_role machine_name + * @validate-permissions permissions + * @param $machine_name The role to modify. + * @param $permissions The list of permission to grant, delimited by commas. + * @usage drush role:remove-perm anonymous 'access content' + * Hide content from anon users. + * @aliases rmp,role-remove-perm + */ + public function roleRemovePerm($machine_name, $permissions) + { + $perms = StringUtils::csvToArray($permissions); + user_role_revoke_permissions($machine_name, $perms); + $this->logger()->success(dt('Removed "!permissions" to "!role"', ['!permissions' => $permissions, '!role' => $machine_name])); + $this->processManager()->drush($this->siteAliasManager()->getSelf(), 'cache-rebuild'); + } + + /** + * Display a list of all roles defined on the system. + * + * If a role name is provided as an argument, then all of the permissions of + * that role will be listed. If a permission name is provided as an option, + * then all of the roles that have been granted that permission will be listed. + * + * @command role:list + * @usage drush role:list --filter='administer nodes' + * Display a list of roles that have the administer nodes permission assigned. + * @aliases rls,role-list + * @field-labels + * rid: ID + * label: Role Label + * perms: Permissions + * + * @filter-default-field perms + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function roleList($options = ['format' => 'yaml']) + { + $rows = []; + $roles = Role::loadMultiple(); + foreach ($roles as $role) { + $rows[$role->id()] = [ + 'label' => $role->label(), + 'perms' => $role->getPermissions(), + ]; + } + $result = new RowsOfFields($rows); + $result->addRendererFunction([$this, 'renderPermsCell']); + return $result; + } + + /* + * Used in the unlikely event user specifies --format=table. + */ + public function renderPermsCell($key, $cellData, FormatterOptions $options) + { + if (is_array($cellData)) { + return implode(',', $cellData); + } + return $cellData; + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/StateCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/StateCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..f8631948bef8332d56f42ce76d470a6558684028 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/StateCommands.php @@ -0,0 +1,160 @@ +<?php + +namespace Drush\Drupal\Commands\core; + +use Consolidation\AnnotatedCommand\Input\StdinAwareInterface; +use Consolidation\AnnotatedCommand\Input\StdinAwareTrait; +use Consolidation\OutputFormatters\StructuredData\PropertyList; +use Drupal\Core\State\StateInterface; +use Drush\Commands\DrushCommands; +use Symfony\Component\Yaml\Yaml; + +class StateCommands extends DrushCommands implements StdinAwareInterface +{ + use StdinAwareTrait; + + protected $state; + + public function __construct(StateInterface $state) + { + $this->state = $state; + } + + /** + * @return \Drupal\Core\State\StateInterface + */ + public function getState() + { + return $this->state; + } + + /** + * Display a state value. + * + * @command state:get + * + * @param string $key The key name. + * @usage drush state:get system.cron_last + * Displays last cron run timestamp + * @aliases sget,state-get + * + * @return \Consolidation\OutputFormatters\StructuredData\PropertyList + */ + public function get($key, $options = ['format' => 'string']) + { + $value = $this->getState()->get($key); + return new PropertyList([$key => $value]); + } + + /** + * Set a state value. + * + * @command state:set + * + * @param string $key The state key, for example: system.cron_last. + * @param mixed $value The value to assign to the state key. Use '-' to read from STDIN. + * @option input-format Type for the value. Defaults to 'auto'. Other recognized values: string, integer float, boolean, json, yaml. + * @option value For internal use only. + * @hidden-options value + * @usage drush sset system.maintenance_mode 1 --input-format=integer + * Put site into Maintenance mode. + * @usage drush state:set system.cron_last 1406682882 --input-format=integer + * Sets a timestamp for last cron run. + * @usage php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush state-set --input-format=json foo.name - + * Set a key to a complex value (e.g. array) + * @aliases sset,state-set + * + * @return void + */ + public function set($key, $value, $options = ['input-format' => 'auto', 'value' => self::REQ]) + { + // A convenient way to pass a multiline value within a backend request. + $value = $options['value'] ?: $value; + + if (!isset($value)) { + throw new \Exception(dt('No state value specified.')); + } + + // Special flag indicating that the value has been passed via STDIN. + if ($value === '-') { + $value = $this->stdin()->contents(); + } + + // If the value is a string (usual case, unless we are called from code), + // then format the input. + if (is_string($value)) { + $value = $this->format($value, $options['input-format']); + } + + $this->getState()->set($key, $value); + } + + /** + * Delete a state entry. + * + * @command state:delete + * + * @param string $key The state key, for example "system.cron_last". + * @usage drush state:del system.cron_last + * Delete state entry for system.cron_last. + * @aliases sdel,state-delete + * + * @return void + */ + public function delete($key) + { + $this->getState()->delete($key); + } + + /* + * Cast a value according to the provided format + * + * @param mixed $value. + * @param string $format + * Allowed values: auto, integer, float, bool, boolean, json, yaml. + * + * @return $value + * The value, casted as needed. + */ + public static function format($value, $format) + { + if ($format == 'auto') { + if (is_numeric($value)) { + $value = $value + 0; // http://php.net/manual/en/function.is-numeric.php#107326 + $format = gettype($value); + } elseif (($value == 'TRUE') || ($value == 'FALSE')) { + $format = 'bool'; + } + } + + // Now, we parse the object. + switch ($format) { + case 'integer': + $value = (integer)$value; + break; + // from: http://php.net/gettype + // for historical reasons "double" is returned in case of a float, and not simply "float" + case 'double': + case 'float': + $value = (float)$value; + break; + case 'bool': + case 'boolean': + if ($value == 'TRUE') { + $value = true; + } elseif ($value == 'FALSE') { + $value = false; + } else { + $value = (bool)$value; + } + break; + case 'json': + $value = json_decode($value, true); + break; + case 'yaml': + $value = Yaml::parse($value, false, true); + break; + } + return $value; + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/TwigCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/TwigCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..8d5a7eaa2c3d5c0399e564cedfe21f6f40e9bb7e --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/TwigCommands.php @@ -0,0 +1,133 @@ +<?php + +namespace Drush\Drupal\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal\Core\PhpStorage\PhpStorageFactory; +use Drupal\Core\Template\TwigEnvironment; +use Drush\Commands\DrushCommands; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drush\Drush; +use Drush\Utils\StringUtils; +use Symfony\Component\Finder\Finder; +use Webmozart\PathUtil\Path; + +class TwigCommands extends DrushCommands +{ + /** + * @var \Drupal\Core\Template\TwigEnvironment + */ + protected $twig; + + /** + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + /** + * @return \Drupal\Core\Template\TwigEnvironment + */ + public function getTwig() + { + return $this->twig; + } + + /** + * @return \Drupal\Core\Extension\ModuleHandlerInterface + */ + public function getModuleHandler() + { + return $this->moduleHandler; + } + + /** + * @param \Drupal\Core\Template\TwigEnvironment $twig + * @param ModuleHandlerInterface $moduleHandler + */ + public function __construct(TwigEnvironment $twig, ModuleHandlerInterface $moduleHandler) + { + $this->twig = $twig; + $this->moduleHandler = $moduleHandler; + } + + /** + * Find potentially unused Twig templates. + * + * Immediately before running this command, crawl your entire web site. Or + * use your Production PHPStorage dir for comparison. + * + * @param $searchpaths A comma delimited list of paths to recursively search + * @usage drush twig:unused --field=template /var/www/mass.local/docroot/modules/custom,/var/www/mass.local/docroot/themes/custom + * Output a simple list of potentially unused templates. + * @table-style default + * @field-labels + * template: Template + * compiled: Compiled + * @default-fields template,compiled + * @filter-output + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + * + * @command twig:unused + */ + public function unused($searchpaths) + { + $unused = []; + $phpstorage = PhpStorageFactory::get('twig'); + + // Find all templates in the codebase. + $files = Finder::create() + ->files() + ->name('*.html.twig') + ->exclude('tests') + ->in(StringUtils::csvToArray($searchpaths)); + $this->logger()->notice(dt('Found !count templates', ['!count' => count($files)])); + + // Check to see if a compiled equivalent exists in PHPStorage + foreach ($files as $file) { + $relative = Path::makeRelative($file->getRealPath(), Drush::bootstrapManager()->getRoot()); + $mainCls = $this->getTwig()->getTemplateClass($relative); + $key = $this->getTwig()->getCache()->generateKey($relative, $mainCls); + if (!$phpstorage->exists($key)) { + $unused[$key] = [ + 'template' => $relative, + 'compiled' => $key, + ]; + } + } + $this->logger()->notice(dt('Found !count unused', ['!count' => count($unused)])); + return new RowsOfFields($unused); + } + + /** + * Compile all Twig template(s). + * + * @command twig:compile + * @aliases twigc,twig-compile + */ + public function twigCompile() + { + require_once DRUSH_DRUPAL_CORE . "/themes/engines/twig/twig.engine"; + // Scan all enabled modules and themes. + $modules = array_keys($this->getModuleHandler()->getModuleList()); + foreach ($modules as $module) { + $searchpaths[] = drupal_get_path('module', $module); + } + + $themes = \Drupal::service('theme_handler')->listInfo(); + foreach ($themes as $name => $theme) { + $searchpaths[] = $theme->getPath(); + } + + $files = Finder::create() + ->files() + ->name('*.html.twig') + ->exclude('tests') + ->in($searchpaths); + foreach ($files as $file) { + $relative = Path::makeRelative($file->getRealPath(), Drush::bootstrapManager()->getRoot()); + // @todo Dynamically disable twig debugging since there is no good info there anyway. + twig_render_template($relative, ['theme_hook_original' => '']); + $this->logger()->success(dt('Compiled twig template !path', ['!path' => $relative])); + } + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/UserCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/UserCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..ad65ad6fb2129ec649c263d89b424d118d47a386 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/UserCommands.php @@ -0,0 +1,348 @@ +<?php +namespace Drush\Drupal\Commands\core; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\AnnotatedCommand\CommandError; +use Consolidation\OutputFormatters\Options\FormatterOptions; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal\user\Entity\User; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Utils\StringUtils; + +class UserCommands extends DrushCommands +{ + + /** + * Print information about the specified user(s). + * + * @command user:information + * + * @param string $names A comma delimited list of user names. + * @option $uid A comma delimited list of user ids to lookup (an alternative to names). + * @option $mail A comma delimited list of emails to lookup (an alternative to names). + * @aliases uinf,user-information + * @usage drush user:information someguy,somegal + * Display information about the someguy and somegal user accounts. + * @usage drush user:information --mail=someguy@somegal.com + * Display information for a given email account. + * @usage drush user:information --uid=5 + * Display information for a given user id. + * @field-labels + * uid: User ID + * name: User name + * pass: Password + * mail: User mail + * theme: User theme + * signature: Signature + * signature_format: Signature format + * user_created: User created + * created: Created + * user_access: User last access + * access: Last access + * user_login: User last login + * login: Last login + * user_status: User status + * status: Status + * timezone: Time zone + * picture: User picture + * init: Initial user mail + * roles: User roles + * group_audience: Group Audience + * langcode: Language code + * uuid: Uuid + * @table-style default + * @default-fields uid,name,mail,roles,user_status + * + * @filter-default-field name + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function information($names = '', $options = ['format' => 'table', 'uid' => self::REQ, 'mail' => self::REQ]) + { + $accounts = []; + if ($mails = StringUtils::csvToArray($options['mail'])) { + foreach ($mails as $mail) { + if ($account = user_load_by_mail($mail)) { + $accounts[$account->id()] = $account; + } + } + } + if ($uids = StringUtils::csvToArray($options['uid'])) { + if ($loaded = User::loadMultiple($uids)) { + $accounts += $loaded; + } + } + if ($names = StringUtils::csvToArray($names)) { + foreach ($names as $name) { + if ($account = user_load_by_name($name)) { + $accounts[$account->id()] = $account; + } + } + } + if (empty($accounts)) { + throw new \Exception(dt('Unable to find a matching user')); + } + + foreach ($accounts as $id => $account) { + $outputs[$id] = $this->infoArray($account); + } + + $result = new RowsOfFields($outputs); + $result->addRendererFunction([$this, 'renderRolesCell']); + return $result; + } + + public function renderRolesCell($key, $cellData, FormatterOptions $options) + { + if (is_array($cellData)) { + return implode("\n", $cellData); + } + return $cellData; + } + + /** + * Block the specified user(s). + * + * @command user:block + * + * @param string $names A comma delimited list of user names. + * @aliases ublk,user-block + * @usage drush user:block user3 + * Block the users whose name is user3 + */ + public function block($names) + { + if ($names = StringUtils::csvToArray($names)) { + foreach ($names as $name) { + if ($account = user_load_by_name($name)) { + $account->block(); + $account->save(); + $this->logger->success(dt('Blocked user(s): !user', ['!user' => $name])); + } else { + $this->logger->warning(dt('Unable to load user: !user', ['!user' => $name])); + } + } + } + } + + /** + * UnBlock the specified user(s). + * + * @command user:unblock + * + * @param string $names A comma delimited list of user names. + * @aliases uublk,user-unblock + * @usage drush user:unblock user3 + * Unblock the users with name user3 + */ + public function unblock($names) + { + if ($names = StringUtils::csvToArray($names)) { + foreach ($names as $name) { + if ($account = user_load_by_name($name)) { + $account->activate(); + $account->save(); + $this->logger->success(dt('Unblocked user(s): !user', ['!user' => $name])); + } else { + $this->logger->warning(dt('Unable to load user: !user', ['!user' => $name])); + } + } + } + } + + /** + * Add a role to the specified user accounts. + * + * @command user:role:add + * + * @validate-entity-load user_role role + * @param string $role The name of the role to add. + * @param string $names A comma delimited list of user names. + * @aliases urol,user-add-role + * @usage drush user-add-role "power user" user3 + * Add the "power user" role to user3 + */ + public function addRole($role, $names) + { + if ($names = StringUtils::csvToArray($names)) { + foreach ($names as $name) { + if ($account = user_load_by_name($name)) { + $account->addRole($role); + $account->save(); + $this->logger->success(dt('Added !role role to !user', [ + '!role' => $role, + '!user' => $name, + ])); + } else { + $this->logger->warning(dt('Unable to load user: !user', ['!user' => $name])); + } + } + } + } + + /** + * Remove a role from the specified user accounts. + * + * @command user:role:remove + * + * @validate-entity-load user_role role + * @param string $role The name of the role to add + * @param string $names A comma delimited list of user names. + * @aliases urrol,user-remove-role + * @usage drush user:remove-role "power user" user3 + * Remove the "power user" role from user3 + */ + public function removeRole($role, $names) + { + if ($names = StringUtils::csvToArray($names)) { + foreach ($names as $name) { + if ($account = user_load_by_name($name)) { + $account->removeRole($role); + $account->save(); + $this->logger->success(dt('Removed !role role from !user', [ + '!role' => $role, + '!user' => $name, + ])); + } else { + $this->logger->warning(dt('Unable to load user: !user', ['!user' => $name])); + } + } + } + } + + /** + * Create a user account. + * + * @command user:create + * + * @param string $name The name of the account to add + * @option password The password for the new account + * @option mail The email address for the new account + * @aliases ucrt,user-create + * @usage drush user:create newuser --mail="person@example.com" --password="letmein" + * Create a new user account with the name newuser, the email address person@example.com, and the password letmein + */ + public function create($name, $options = ['password' => self::REQ, 'mail' => self::REQ]) + { + $new_user = [ + 'name' => $name, + 'pass' => $options['password'], + 'mail' => $options['mail'], + 'access' => '0', + 'status' => 1, + ]; + if (!$this->getConfig()->simulate()) { + if ($account = User::create($new_user)) { + $account->save(); + drush_backend_set_result($this->infoArray($account)); + $this->logger()->success(dt('Created a new user with uid !uid', ['!uid' => $account->id()])); + } else { + return new CommandError("Could not create a new user account with the name " . $name . "."); + } + } + } + + /** + * Assure that provided username is available. + * + * @hook validate user-create + */ + public function createValidate(CommandData $commandData) + { + if ($mail = $commandData->input()->getOption('mail')) { + if (user_load_by_mail($mail)) { + throw new \Exception(dt('There is already a user account with the email !mail', ['!mail' => $mail])); + } + } + $name = $commandData->input()->getArgument('name'); + if (user_load_by_name($name)) { + throw new \Exception((dt('There is already a user account with the name !name', ['!name' => $name]))); + } + } + + /** + * Cancel user account(s) with the specified name(s). + * + * @command user:cancel + * + * @param string $names A comma delimited list of user names. + * @option delete-content Delete the user, and all content created by the user + * @aliases ucan,user-cancel + * @usage drush user:cancel username + * Cancel the user account with the name username and anonymize all content created by that user. + * @usage drush user:cancel --delete-content username + * Delete the user account with the name username and delete all content created by that user. + */ + public function cancel($names, $options = ['delete-content' => false]) + { + if ($names = StringUtils::csvToArray($names)) { + foreach ($names as $name) { + if ($account = user_load_by_name($name)) { + if ($options['delete-content']) { + $this->logger()->warning(dt('All content created by !name will be deleted.', ['!name' => $account->getUsername()])); + } + if ($this->io()->confirm('Cancel user account?: ')) { + $method = $options['delete-content'] ? 'user_cancel_delete' : 'user_cancel_block'; + user_cancel([], $account->id(), $method); + drush_backend_batch_process(); + // Drupal logs a message for us. + } + } else { + $this->logger()->warning(dt('Unable to load user: !user', ['!user' => $name])); + } + } + } + } + + /** + * Set the password for the user account with the specified name. + * + * @command user:password + * + * @param string $name The name of the account to modify. + * @param string $password The new password for the account. + * @aliases upwd,user-password + * @usage drush user:password someuser "correct horse battery staple" + * Set the password for the username someuser. @see xkcd.com/936 + */ + public function password($name, $password) + { + if ($account = user_load_by_name($name)) { + if (!$this->getConfig()->simulate()) { + $account->setpassword($password); + $account->save(); + $this->logger()->success(dt('Changed password for !name.', ['!name' => $name])); + } + } else { + throw new \Exception(dt('Unable to load user: !user', ['!user' => $name])); + } + } + + /** + * A flatter and simpler array presentation of a Drupal $user object. + * + * @param $account A user account + * @return array + */ + public function infoArray($account) + { + return [ + 'uid' => $account->id(), + 'name' => $account->getUsername(), + 'pass' => $account->getPassword(), + 'mail' => $account->getEmail(), + 'user_created' => $account->getCreatedTime(), + 'created' => format_date($account->getCreatedTime()), + 'user_access' => $account->getLastAccessedTime(), + 'access' => format_date($account->getLastAccessedTime()), + 'user_login' => $account->getLastLoginTime(), + 'login' => format_date($account->getLastLoginTime()), + 'user_status' => $account->get('status')->value, + 'status' => $account->isActive() ? 'active' : 'blocked', + 'timezone' => $account->getTimeZone(), + 'roles' => $account->getRoles(), + 'langcode' => $account->getPreferredLangcode(), + 'uuid' => $account->uuid->value, + ]; + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/ViewsCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/ViewsCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..cbd8e213eda2655b3c0d37fb0dc1f8477cf3ab7a --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/ViewsCommands.php @@ -0,0 +1,354 @@ +<?php +namespace Drush\Drupal\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Render\RendererInterface; +use Drush\Commands\DrushCommands; +use Drupal\views\Views; +use Drush\Utils\StringUtils; + +class ViewsCommands extends DrushCommands +{ + + protected $configFactory; + + protected $moduleHandler; + + protected $entityTypeManager; + + protected $renderer; + + /** + * ViewsCommands constructor. + * @param $moduleHandler + * @param $entityTypeManager + * @param $renderer + */ + public function __construct(ConfigFactoryInterface $configFactory, ModuleHandlerInterface $moduleHandler, EntityTypeManagerInterface $entityTypeManager, RendererInterface $renderer) + { + $this->moduleHandler = $moduleHandler; + $this->entityTypeManager = $entityTypeManager; + $this->renderer = $renderer; + $this->configFactory = $configFactory; + } + + /** + * @return \Drupal\Core\Config\ConfigFactoryInterface + */ + public function getConfigFactory() + { + return $this->configFactory; + } + + /** + * @return \Drupal\Core\Extension\ModuleHandlerInterface + */ + public function getModuleHandler() + { + return $this->moduleHandler; + } + + /** + * @return \Drupal\Core\Entity\EntityTypeManagerInterface + */ + public function getEntityTypeManager() + { + return $this->entityTypeManager; + } + + /** + * @return \Drupal\Core\Render\RendererInterface + */ + public function getRenderer() + { + return $this->renderer; + } + + /** + * Set several Views settings to more developer-oriented values. + * + * @command views:dev + * + * @validate-module-enabled views + * @aliases vd,views-dev + */ + public function dev() + { + $settings = [ + 'ui.show.listing_filters' => true, + 'ui.show.master_display' => true, + 'ui.show.advanced_column' => true, + 'ui.always_live_preview' => false, + 'ui.always_live_preview_button' => true, + 'ui.show.preview_information' => true, + 'ui.show.sql_query.enabled' => true, + 'ui.show.sql_query.where' => 'above', + 'ui.show.performance_statistics' => true, + 'ui.show.additional_queries' => true, + ]; + + $config = $this->getConfigFactory()->getEditable('views.settings'); + + foreach ($settings as $setting => $value) { + $config->set($setting, $value); + // Convert boolean values into a string to print. + if (is_bool($value)) { + $value = $value ? 'TRUE' : 'FALSE'; + } elseif (is_string($value)) { + // Wrap string values in quotes. + $value = "\"$value\""; + } + $this->logger()->success(dt('!setting set to !value', [ + '!setting' => $setting, + '!value' => $value + ])); + } + + // Save the new config. + $config->save(); + + $this->logger()->success(dt('New views configuration saved.')); + } + + /** + * Get a list of all views in the system. + * + * @command views:list + * + * @option name A string contained in the view's name to filter the results with. + * @option tags A comma-separated list of views tags by which to filter the results. + * @option status Filter views by status. Choices: enabled, disabled. + * @usage drush vl + * Show a list of all available views. + * @usage drush vl --name=blog + * Show a list of views which names contain 'blog'. + * @usage drush vl --tags=tag1,tag2 + * Show a list of views tagged with 'tag1' or 'tag2'. + * @usage drush vl --status=enabled + * Show a list of enabled views. + * @table-style default + * @field-labels + * machine-name: Machine name + * label: Name + * description: Description + * status: Status + * tag: Tag + * @default-fields machine-name,label,description,status + * @aliases vl,views-list + * @validate-module-enabled views + * + * @filter-default-field machine-name + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function vlist($options = ['name' => self::REQ, 'tags' => self::REQ, 'status' => self::REQ, 'format' => 'table']) + { + $disabled_views = []; + $enabled_views = []; + + $views = $this->getEntityTypeManager()->getStorage('view')->loadMultiple(); + + // Get the --name option. + $name = StringUtils::csvToArray($options['name']); + $with_name = !empty($name) ? true : false; + + // Get the --tags option. + $tags = \_convert_csv_to_array($options['tags']); + $with_tags = !empty($tags) ? true : false; + + // Get the --status option. Store user input apart to reuse it after. + $status = $options['status']; + + // @todo See https://github.com/consolidation/annotated-command/issues/53 + if ($status && !in_array($status, ['enabled', 'disabled'])) { + throw new \Exception(dt('Invalid status: @status. Available options are "enabled" or "disabled"', ['@status' => $status])); + } + + // Setup a row for each view. + foreach ($views as $view) { + // If options were specified, check that first mismatch push the loop to the + // next view. + if ($with_name && !stristr($view->id(), $name[0])) { + continue; + } + if ($with_tags && !in_array($view->get('tag'), $tags)) { + continue; + } + + $status_bool = $status == 'enabled'; + if ($status && ($view->status() !== $status_bool)) { + continue; + } + + $row = [ + 'machine-name' => $view->id(), + 'label' => $view->label(), + 'description' => $view->get('description'), + 'status' => $view->status() ? dt('Enabled') : dt('Disabled'), + 'tag' => $view->get('tag'), + ]; + + // Place the row in the appropriate array, so we can have disabled views at + // the bottom. + if ($view->status()) { + $enabled_views[] = $row; + } else { + $disabled_views[] = $row; + } + } + + // Sort alphabetically. + asort($disabled_views); + asort($enabled_views); + + if (count($enabled_views) || count($disabled_views)) { + $rows = array_merge($enabled_views, $disabled_views); + return new RowsOfFields($rows); + } else { + $this->logger()->notice(dt('No views found.')); + } + } + + /** + * Execute a view and show a count of the results, or the rendered HTML. + * + * @command views:execute + * + * @param string $view_name The name of the view to execute. + * @param string $display The display ID to execute. If none specified, the default display will be used. + * @param string $view_args A comma delimited list of values, corresponding to contextual filters. + * @option count Display a count of the results instead of each row. + * @option show-admin-links Show contextual admin links in the rendered markup. + * @usage drush views:execute my_view + * Show the rendered HTML for the default display for the my_view View. + * @usage drush views:execute my_view page_1 3 --count + * Show a count of my_view:page_1 where the first contextual filter value is 3. + * @usage drush views:execute my_view page_1 3,foo + * Show the rendered HTML of my_view:page_1 where the first two contextual filter values are 3 and 'foo' respectively. + * @validate-entity-load view view_name + * @aliases vex,views-execute + * @validate-module-enabled views + * + * @return string + */ + public function execute($view_name, $display = null, $view_args = null, $options = ['count' => 0, 'show-admin-links' => false]) + { + + $view = Views::getView($view_name); + + // Set the display and execute the view. + $view->setDisplay($display); + $view->preExecute(StringUtils::csvToArray($view_args)); + $view->execute(); + + if (empty($view->result)) { + $this->logger()->success(dt('No results returned for this View.')); + return null; + } elseif ($options['count']) { + drush_backend_set_result(count($view->result)); + $this->io()->writeln(count($view->result)); + return null; + } else { + // Don't show admin links in markup by default. + $view->hide_admin_links = !$options['show-admin-links']; + $build = $view->preview(); + return (string) $this->getRenderer()->renderPlain($build); + } + } + + /** + * Get a list of all Views and analyze warnings. + * + * @command views:analyze + * @todo Command has not been fully tested. How to generate a message? + * @field-labels + * type: Type + * message: Message + * @aliases va,views-analyze + * @validate-module-enabled views + * + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function analyze() + { + $messages = null; + $messages_count = 0; + $rows = []; + + $views = $this->getEntityTypeManager()->getStorage('view')->loadMultiple(); + + if (!empty($views)) { + $analyzer = \Drupal::service('views.analyzer'); + foreach ($views as $view_name => $view) { + $view = $view->getExecutable(); + + if ($messages = $analyzer->getMessages($view)) { + $rows[] = [$messages['type'], $messages['message']]; + } + } + + $this->logger()->success(dt('A total of @total views were analyzed and @messages problems were found.', ['@total' => count($views), '@messages' => $messages_count])); + return new RowsOfFields($rows); + } else { + $this->logger()->success(dt('There are no views to analyze')); + } + } + + /** + * Enable the specified views. + * + * @command views:enable + * @param string $views A comma delimited list of view names. + * @validate-entity-load view views + * @usage drush ven frontpage,taxonomy_term + * Enable the frontpage and taxonomy_term views. + * @aliases ven,views-enable + */ + public function enable($views) + { + $view_names = StringUtils::csvToArray($views); + if ($views = $this->getEntityTypeManager()->getStorage('view')->loadMultiple($view_names)) { + foreach ($views as $view) { + $view->enable(); + $view->save(); + } + } + $this->logger()->success(dt('!str enabled.', ['!str' => implode(', ', $view_names)])); + } + + /** + * Disable the specified views. + * + * @command views:disable + * @validate-entity-load view views + * @param string $views A comma delimited list of view names. + * @usage drush vdis frontpage taxonomy_term + * Disable the frontpage and taxonomy_term views. + * @aliases vdis,views-disable + */ + public function disable($views) + { + $view_names = StringUtils::csvToArray($views); + if ($views = $this->getEntityTypeManager()->getStorage('view')->loadMultiple($view_names)) { + foreach ($views as $view) { + $view->disable(); + $view->save(); + } + } + $this->logger()->success(dt('!str disabled.', ['!str' => implode(', ', $view_names)])); + } + + /** + * Adds a cache clear option for views. + * + * @hook on-event cache-clear + */ + public function cacheClear(&$types, $include_bootstrapped_types) + { + if ($include_bootstrapped_types && $this->getModuleHandler()->moduleExists('views')) { + $types['views'] = 'views_invalidate_cache'; + } + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/WatchdogCommands.php b/vendor/drush/drush/src/Drupal/Commands/core/WatchdogCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..a055c34d971d0ee55c3399aaf641854c23d25d9f --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/WatchdogCommands.php @@ -0,0 +1,331 @@ +<?php +namespace Drush\Drupal\Commands\core; + +use Consolidation\OutputFormatters\StructuredData\PropertyList; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal\Core\Database\Database; +use Drupal\Core\Logger\RfcLogLevel; +use Drush\Commands\DrushCommands; +use Drupal\Component\Utility\Unicode; +use Drupal\Component\Utility\Html; +use Drush\Drupal\DrupalUtil; +use Drush\Exceptions\UserAbortException; + +class WatchdogCommands extends DrushCommands +{ + + /** + * Show watchdog messages. + * + * @command watchdog:show + * @param $substring A substring to look search in error messages. + * @option count The number of messages to show. Defaults to 10. + * @option severity Restrict to messages of a given severity level. + * @option type Restrict to messages of a given type. + * @option extended Return extended information about each message. + * @usage drush watchdog-show + * Show a listing of most recent 10 messages. + * @usage drush watchdog:show "cron run succesful" + * Show a listing of most recent 10 messages containing the string "cron run succesful". + * @usage drush watchdog:show --count=46 + * Show a listing of most recent 46 messages. + * @usage drush watchdog:show --severity=Notice + * Show a listing of most recent 10 messages with a severity of notice. + * @usage drush watchdog:show --type=php + * Show a listing of most recent 10 messages of type php + * @aliases wd-show,ws,watchdog-show + * @validate-module-enabled dblog + * @field-labels + * wid: ID + * type: Type + * message: Message + * severity: Severity + * location: Location + * hostname: Hostname + * date: Date + * username: Username + * @default-fields wid,date,type,severity,message + * @filter-default-field message + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function show($substring = '', $options = ['format' => 'table', 'count' => 10, 'severity' => self::REQ, 'type' => self::REQ, 'extended' => false]) + { + $where = $this->where($options['type'], $options['severity'], $substring); + $query = Database::getConnection()->select('watchdog', 'w') + ->range(0, $options['count']) + ->fields('w') + ->orderBy('wid', 'DESC'); + if (!empty($where['where'])) { + $query->where($where['where'], $where['args']); + } + $rsc = $query->execute(); + while ($result = $rsc->fetchObject()) { + $row = $this->formatResult($result, $options['extended']); + $table[$row->wid] = (array)$row; + } + if (empty($table)) { + $this->logger()->notice(dt('No log messages available.')); + } else { + return new RowsOfFields($table); + } + } + + /** + * Interactively filter the watchdog message listing. + * + * @command watchdog:list + * @param $substring A substring to look search in error messages. + * @option count The number of messages to show. Defaults to 10. + * @option extended Return extended information about each message. + * @option severity Restrict to messages of a given severity level. + * @option type Restrict to messages of a given type. + * @usage drush watchdog-list + * Prompt for message type or severity, then run watchdog-show. + * @aliases wd-list,watchdog-list + * @hidden-options type,severity + * @validate-module-enabled dblog + * @field-labels + * wid: ID + * type: Type + * message: Message + * severity: Severity + * location: Location + * hostname: Hostname + * date: Date + * username: Username + * @default-fields wid,date,type,severity,message + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function watchdogList($substring = '', $options = ['format' => 'table', 'count' => 10, 'extended' => false]) + { + return $this->show($substring, $options); + } + + /** + * @hook interact watchdog-list + * @throws \Drush\Exceptions\UserAbortException + */ + public function interactList($input, $output) + { + + $choices['-- types --'] = dt('== message types =='); + $types = $this->messageTypes(); + foreach ($types as $key => $type) { + $choices[$key] = $type; + } + $choices['-- levels --'] = dt('== severity levels =='); + $severities = RfcLogLevel::getLevels(); + + foreach ($severities as $key => $value) { + $choices[$key] = $value; + } + $option = $this->io()->choice(dt('Select a message type or severity level'), $choices); + if (isset($types[$option])) { + $input->setOption('type', $types[$option]); + } else { + $input->setOption('severity', $option); + } + } + + /** + * Delete watchdog log records. + * + * @command watchdog:delete + * @param $substring Delete all log records with this text in the messages. + * @option severity Delete messages of a given severity level. + * @option type Delete messages of a given type. + * @usage drush watchdog:delete all + * Delete all messages. + * @usage drush watchdog:delete 64 + * Delete messages with id 64. + * @usage drush watchdog:delete "cron run succesful" + * Delete messages containing the string "cron run succesful". + * @usage drush watchdog:delete --severity=notice + * Delete all messages with a severity of notice. + * @usage drush watchdog:delete --type=cron + * Delete all messages of type cron. + * @aliases wd-del,wd-delete,wd,watchdog-delete + * @validate-module-enabled dblog + * @return void + */ + public function delete($substring = '', $options = ['severity' => self::REQ, 'type' => self::REQ]) + { + if ($substring == 'all') { + $this->output()->writeln(dt('All watchdog messages will be deleted.')); + if (!$this->io()->confirm(dt('Do you really want to continue?'))) { + throw new UserAbortException(); + } + $ret = Database::getConnection()->truncate('watchdog')->execute(); + $this->logger()->success(dt('All watchdog messages have been deleted.')); + } else if (is_numeric($substring)) { + $this->output()->writeln(dt('Watchdog message #!wid will be deleted.', ['!wid' => $substring])); + if (!$this->io()->confirm(dt('Do you want to continue?'))) { + throw new UserAbortException(); + } + $affected_rows = Database::getConnection()->delete('watchdog')->condition('wid', $substring)->execute(); + if ($affected_rows == 1) { + $this->logger()->success(dt('Watchdog message #!wid has been deleted.', ['!wid' => $substring])); + } else { + throw new \Exception(dt('Watchdog message #!wid does not exist.', ['!wid' => $substring])); + } + } else { + if ((empty($substring))&&(!isset($options['type']))&&(!isset($options['severity']))) { + throw new \Exception(dt('No options provided.')); + } + $where = $this->where($options['type'], $options['severity'], $substring, 'OR'); + $this->output()->writeln(dt('All messages with !where will be deleted.', ['!where' => preg_replace("/message LIKE %$substring%/", "message body containing '$substring'", strtr($where['where'], $where['args']))])); + if (!$this->io()->confirm(dt('Do you want to continue?'))) { + throw new UserAbortException(); + } + $affected_rows = Database::getConnection()->delete('watchdog') + ->where($where['where'], $where['args']) + ->execute(); + $this->logger()->success(dt('!affected_rows watchdog messages have been deleted.', ['!affected_rows' => $affected_rows])); + } + } + + /** + * Show one log record by ID. + * + * @command watchdog:show-one + * @param $id Watchdog Id + * @aliases wd-one,watchdog-show-one + * @validate-module-enabled dblog + * + * @return \Consolidation\OutputFormatters\StructuredData\PropertyList + */ + public function showOne($id, $options = ['format' => 'yaml']) + { + $rsc = Database::getConnection()->select('watchdog', 'w') + ->fields('w') + ->condition('wid', (int)$id) + ->range(0, 1) + ->execute(); + $result = $rsc->fetchObject(); + if (!$result) { + throw new \Exception(dt('Watchdog message #!wid not found.', ['!wid' => $id])); + } + return new PropertyList($this->formatResult($result)); + } + + /** + * Build a WHERE snippet based on given parameters. + * + * @param $type + * String. Valid watchdog type. + * @param $severity + * Int or String for a valid watchdog severity message. + * @param $filter + * String. Value to filter watchdog messages by. + * @param $criteria + * ('AND', 'OR'). Criteria for the WHERE snippet. + * @return + * An array with structure ('where' => string, 'args' => array()) + */ + protected function where($type = null, $severity = null, $filter = null, $criteria = 'AND') + { + $args = []; + $conditions = []; + if ($type) { + $types = $this->messageTypes(); + if (array_search($type, $types) === false) { + $msg = "Unrecognized message type: !type.\nRecognized types are: !types."; + throw new \Exception(dt($msg, ['!type' => $type, '!types' => implode(', ', $types)])); + } + $conditions[] = "type = :type"; + $args[':type'] = $type; + } + if (isset($severity)) { + $severities = RfcLogLevel::getLevels(); + if (isset($severities[$severity])) { + $level = $severity; + } elseif (($key = array_search($severity, $severities)) !== false) { + $level = $key; + } else { + $level = false; + } + if ($level === false) { + foreach ($severities as $key => $value) { + $levels[] = "$value($key)"; + } + $msg = "Unknown severity level: !severity.\nValid severity levels are: !levels."; + throw new \Exception(dt($msg, ['!severity' => $severity, '!levels' => implode(', ', $levels)])); + } + $conditions[] = 'severity = :severity'; + $args[':severity'] = $level; + } + if ($filter) { + $conditions[] = "message LIKE :filter"; + $args[':filter'] = '%'.$filter.'%'; + } + + $where = implode(" $criteria ", $conditions); + + return ['where' => $where, 'args' => $args]; + } + + /** + * Format a watchdog database row. + * + * @param $result + * Array. A database result object. + * @param $extended + * Boolean. Return extended message details. + * @return + * Array. The result object with some attributes themed. + */ + protected function formatResult($result, $extended = false) + { + // Severity. + $severities = RfcLogLevel::getLevels(); + $result->severity = trim(DrupalUtil::drushRender($severities[$result->severity])); + + // Date. + $result->date = format_date($result->timestamp, 'custom', 'd/M H:i'); + unset($result->timestamp); + + // Message. + $variables = $result->variables; + if (is_string($variables)) { + $variables = unserialize($variables); + } + if (is_array($variables)) { + $result->message = strtr($result->message, $variables); + } + unset($result->variables); + $message_length = 188; + + // Print all the data available + if ($extended) { + // Possible empty values. + if (empty($result->link)) { + unset($result->link); + } + if (empty($result->referer)) { + unset($result->referer); + } + // Username. + if ($account = user_load($result->uid)) { + $result->username = $account->name; + } else { + $result->username = dt('Anonymous'); + } + unset($result->uid); + $message_length = PHP_INT_MAX; + } + $result->message = Unicode::truncate(strip_tags(Html::decodeEntities($result->message)), $message_length, false, false); + + return $result; + } + + /** + * Helper function to obtain the message types based on drupal version. + * + * @return + * Array of watchdog message types. + */ + public static function messageTypes() + { + return _dblog_get_message_types(); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/core/drush.services.yml b/vendor/drush/drush/src/Drupal/Commands/core/drush.services.yml new file mode 100644 index 0000000000000000000000000000000000000000..748937f8ea8d4940184ddda325532b84f41ca18e --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/core/drush.services.yml @@ -0,0 +1,75 @@ +services: + batch.commands: + class: \Drush\Drupal\Commands\core\BatchCommands + tags: + - { name: drush.command } + cli.commands: + class: \Drush\Drupal\Commands\core\CliCommands + tags: + - { name: drush.command } + drupal.commands: + class: \Drush\Drupal\Commands\core\DrupalCommands + arguments: ['@cron', '@module_handler'] + tags: + - { name: drush.command } + entity.commands: + class: \Drush\Drupal\Commands\core\EntityCommands + arguments: ['@entity_type.manager'] + tags: + - { name: drush.command } + image.commands: + class: \Drush\Drupal\Commands\core\ImageCommands + tags: + - { name: drush.command } + jsonapi.commands: + class: \Drush\Drupal\Commands\core\JsonapiCommands + tags: + - { name: drush.command } + language.commands: + class: \Drush\Drupal\Commands\core\LanguageCommands + arguments: ['@language_manager', '@module_handler'] + tags: + - { name: drush.command } + locale.commands: + class: \Drush\Drupal\Commands\core\LocaleCommands + arguments: ['@language_manager', '@config.factory', '@module_handler', '@state'] + tags: + - { name: drush.command } + messenger.commands: + class: \Drush\Drupal\Commands\core\MessengerCommands + # Uncomment when Drupal 8.4 gets unsupported. + # arguments: ['@messenger'] + tags: + - { name: drush.command } + queue.commands: + class: \Drush\Drupal\Commands\core\QueueCommands + arguments: ['@plugin.manager.queue_worker', '@queue'] + tags: + - { name: drush.command } + role.commands: + class: \Drush\Drupal\Commands\core\RoleCommands + tags: + - { name: drush.command } + state.commands: + class: \Drush\Drupal\Commands\core\StateCommands + arguments: ['@state'] + tags: + - { name: drush.command } + twig.commands: + class: \Drush\Drupal\Commands\core\TwigCommands + arguments: ['@twig', '@module_handler'] + tags: + - { name: drush.command } + user.commands: + class: \Drush\Drupal\Commands\core\UserCommands + tags: + - { name: drush.command } + views.commands: + class: \Drush\Drupal\Commands\core\ViewsCommands + arguments: ['@config.factory', '@module_handler', '@entity_type.manager', '@renderer'] + tags: + - { name: drush.command } + watchdog.commands: + class: \Drush\Drupal\Commands\core\WatchdogCommands + tags: + - { name: drush.command } diff --git a/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php b/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..58b438b992d4a5f021799b74c9a62c0aae4eda98 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php @@ -0,0 +1,303 @@ +<?php +namespace Drush\Drupal\Commands\pm; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Extension\MissingDependencyException; +use Drupal\Core\Extension\ModuleInstallerInterface; +use Drupal\Core\Extension\ThemeHandlerInterface; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Exceptions\UserAbortException; +use Drush\Utils\StringUtils; + +class PmCommands extends DrushCommands +{ + + protected $configFactory; + + protected $moduleInstaller; + + protected $themeHandler; + + public function __construct(ConfigFactoryInterface $configFactory, ModuleInstallerInterface $moduleInstaller, ThemeHandlerInterface $themeHandler) + { + parent::__construct(); + $this->configFactory = $configFactory; + $this->moduleInstaller = $moduleInstaller; + $this->themeHandler = $themeHandler; + } + + /** + * @return \Drupal\Core\Config\ConfigFactoryInterface + */ + public function getConfigFactory() + { + return $this->configFactory; + } + + /** + * @return \Drupal\Core\Extension\ModuleInstallerInterface + */ + public function getModuleInstaller() + { + return $this->moduleInstaller; + } + + /** + * @return \Drupal\Core\Extension\ThemeHandlerInterface + */ + public function getThemeHandler() + { + return $this->themeHandler; + } + + /** + * Enable one or more modules. + * + * @command pm:enable + * @param $modules A comma delimited list of modules. + * @aliases en,pm-enable + */ + public function enable(array $modules) + { + $modules = StringUtils::csvToArray($modules); + $todo = $this->addInstallDependencies($modules); + $todo_str = ['!list' => implode(', ', $todo)]; + if (empty($todo)) { + $this->logger()->notice(dt('Already enabled: !list', ['!list' => implode(', ', $modules)])); + return; + } elseif (array_values($todo) !== $modules) { + $this->output()->writeln(dt('The following module(s) will be enabled: !list', $todo_str)); + if (!$this->io()->confirm(dt('Do you want to continue?'))) { + throw new UserAbortException(); + } + } + + if (!$this->getModuleInstaller()->install($modules, true)) { + throw new \Exception('Unable to install modules.'); + } + if (batch_get()) { + drush_backend_batch_process(); + } + $this->logger()->success(dt('Successfully enabled: !list', $todo_str)); + // Our logger got blown away during the container rebuild above. + $boot = Drush::bootstrapManager()->bootstrap(); + $boot->addLogger(); + } + + /** + * Uninstall one or more modules and their dependent modules. + * + * @command pm:uninstall + * @param $modules A comma delimited list of modules. + * @aliases pmu,pm-uninstall + */ + public function uninstall(array $modules) + { + $modules = StringUtils::csvToArray($modules); + $list = $this->addUninstallDependencies($modules); + if (array_values($list) !== $modules) { + $this->output()->writeln(dt('The following extensions will be uninstalled: !list', ['!list' => implode(', ', $list)])); + if (!$this->io()->confirm(dt('Do you want to continue?'))) { + throw new UserAbortException(); + } + } + if (!$this->getModuleInstaller()->uninstall($modules, true)) { + throw new \Exception('Unable to uninstall modules.'); + } + $this->logger()->success(dt('Successfully uninstalled: !list', ['!list' => implode(', ', $list)])); + // Our logger got blown away during the container rebuild above. + $boot = Drush::bootstrapManager()->bootstrap(); + $boot->addLogger(); + } + + /** + * @hook validate pm-uninstall + */ + public function validateUninstall(CommandData $commandData) + { + if ($modules = $commandData->input()->getArgument('modules')) { + $modules = StringUtils::csvToArray($modules); + if ($validation_reasons = $this->getModuleInstaller()->validateUninstall($modules)) { + foreach ($validation_reasons as $module => $list) { + foreach ($list as $markup) { + $reasons[$module] = "$module: " . (string) $markup; + } + } + throw new \Exception(implode("/n", $reasons)); + } + } + } + + /** + * Show a list of available extensions (modules and themes). + * + * @command pm:list + * @option type Only show extensions having a given type. Choices: module, theme. + * @option status Only show extensions having a given status. Choices: enabled or disabled. + * @option core Only show extensions that are in Drupal core. + * @option no-core Only show extensions that are not provided by Drupal core. + * @option package Only show extensions having a given project packages (e.g. Development). + * @field-labels + * package: Package + * display_name: Name + * name: Name + * type: Type + * path: Path + * status: Status + * version: Version + * @default-fields package,display_name,status,version + * @aliases pml,pm-list + * @filter-default-field display_name + * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields + */ + public function pmList($options = ['format' => 'table', 'type' => 'module,theme', 'status' => 'enabled,disabled', 'package' => self::REQ, 'core' => false, 'no-core' => false]) + { + $rows = []; + // @todo Update this and other usages once Drupal 8.5 is unsupported by Drush https://www.drupal.org/node/2709919. + $modules = \system_rebuild_module_data(); + $themes = $this->getThemeHandler()->rebuildThemeData(); + $both = array_merge($modules, $themes); + + $package_filter = StringUtils::csvToArray(strtolower($options['package'])); + $type_filter = StringUtils::csvToArray(strtolower($options['type'])); + $status_filter = StringUtils::csvToArray(strtolower($options['status'])); + + foreach ($both as $key => $extension) { + // Fill in placeholder values as needed. + $extension->info += ['package' => '']; + + // Filter out test modules/themes. + if (strpos($extension->getPath(), 'tests')) { + continue; + } + + $status = $this->extensionStatus($extension); + if (!in_array($extension->getType(), $type_filter)) { + unset($modules[$key]); + continue; + } + if (!in_array($status, $status_filter)) { + unset($modules[$key]); + continue; + } + + // Filter out core if --no-core specified. + if ($options['no-core']) { + if ($extension->origin == 'core') { + unset($modules[$key]); + continue; + } + } + + // Filter out non-core if --core specified. + if ($options['core']) { + if ($extension->origin != 'core') { + unset($modules[$key]); + continue; + } + } + + // Filter by package. + if (!empty($package_filter)) { + if (!in_array(strtolower($extension->info['package']), $package_filter)) { + unset($modules[$key]); + continue; + } + } + + $row = [ + 'package' => $extension->info['package'], + 'display_name' => $extension->info['name']. ' ('. $extension->getName(). ')', + 'name' => $extension->getName(), + 'type' => $extension->getType(), + 'path' => $extension->getPath(), + 'status' => ucfirst($status), + // Suppress notice when version is not present. + 'version' => @$extension->info['version'], + ]; + $rows[$key] = $row; + } + + return new RowsOfFields($rows); + } + + /** + * Calculate an extension status based on current status and schema version. + * + * @param $extension + * Object of a single extension info. + * + * @return + * String describing extension status. Values: enabled|disabled. + */ + public function extensionStatus($extension) + { + return $extension->status == 1 ? 'enabled' : 'disabled'; + } + + public function addInstallDependencies($modules) + { + $module_data = system_rebuild_module_data(); + $module_list = array_combine($modules, $modules); + if ($missing_modules = array_diff_key($module_list, $module_data)) { + // One or more of the given modules doesn't exist. + throw new MissingDependencyException(sprintf('Unable to install modules %s due to missing modules %s.', implode(', ', $module_list), implode(', ', $missing_modules))); + } + $extension_config = $this->getConfigFactory()->getEditable('core.extension'); + $installed_modules = $extension_config->get('module') ?: []; + + // Copied from \Drupal\Core\Extension\ModuleInstaller::install + // Add dependencies to the list. The new modules will be processed as + // the while loop continues. + foreach (array_keys($module_list) as $module) { + foreach (array_keys($module_data[$module]->requires) as $dependency) { + if (!isset($module_data[$dependency])) { + // The dependency does not exist. + throw new MissingDependencyException("Unable to install modules: module '$module' is missing its dependency module $dependency."); + } + + // Skip already installed modules. + if (!isset($module_list[$dependency]) && !isset($installed_modules[$dependency])) { + $module_list[$dependency] = $dependency; + } + } + } + + // Remove already installed modules. + $todo = array_diff_key($module_list, $installed_modules); + return $todo; + } + + public function addUninstallDependencies($modules) + { + // Get all module data so we can find dependencies and sort. + $module_data = system_rebuild_module_data(); + $module_list = array_combine($modules, $modules); + if ($diff = array_diff_key($module_list, $module_data)) { + throw new \Exception(dt('A specified extension does not exist: !diff', ['!diff' => implode(',', $diff)])); + } + $extension_config = $this->getConfigFactory()->getEditable('core.extension'); + $installed_modules = $extension_config->get('module') ?: []; + + // Add dependent modules to the list. The new modules will be processed as + // the while loop continues. + $profile = drupal_get_profile(); + foreach (array_keys($module_list) as $module) { + foreach (array_keys($module_data[$module]->required_by) as $dependent) { + if (!isset($module_data[$dependent])) { + // The dependent module does not exist. + return false; + } + + // Skip already uninstalled modules. + if (isset($installed_modules[$dependent]) && !isset($module_list[$dependent]) && $dependent != $profile) { + $module_list[$dependent] = $dependent; + } + } + } + return $module_list; + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/pm/ThemeCommands.php b/vendor/drush/drush/src/Drupal/Commands/pm/ThemeCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..8c3fa32dd20a307f39ca5d65a6fce50f6d36aa79 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/pm/ThemeCommands.php @@ -0,0 +1,62 @@ +<?php +namespace Drush\Drupal\Commands\pm; + +use Drupal\Core\Extension\ThemeInstallerInterface; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Drush\Utils\StringUtils; + +class ThemeCommands extends DrushCommands +{ + + protected $themeInstaller; + + public function __construct(ThemeInstallerInterface $themeInstaller) + { + parent::__construct(); + $this->themeInstaller = $themeInstaller; + } + + /** + * @return mixed + */ + public function getThemeInstaller() + { + return $this->themeInstaller; + } + + /** + * Enable one or more themes. + * + * @command theme:enable + * @param $themes A comma delimited list of themes. + * @aliases then,theme-enable + */ + public function enable($themes) + { + $themes = StringUtils::csvToArray($themes); + if (!$this->getThemeInstaller()->install($themes, true)) { + throw new \Exception('Unable to install themes.'); + } + $this->logger()->success(dt('Successfully enabled theme: !list', ['!list' => implode(', ', $themes)])); + } + + /** + * Uninstall theme. + * + * @command theme:uninstall + * @param $themes A comma delimited list of themes. + * @aliases thun,theme-uninstall + */ + public function uninstall($themes) + { + $themes = StringUtils::csvToArray($themes); + if (!$this->getThemeInstaller()->uninstall($themes, true)) { + throw new \Exception('Unable to uninstall themes.'); + } + $this->logger()->success(dt('Successfully uninstalled theme: !list', ['!list' => implode(', ', $themes)])); + // Our logger got blown away during the container rebuild above. + $boot = Drush::bootstrapManager()->bootstrap(); + $boot->addLogger(); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/pm/drush.services.yml b/vendor/drush/drush/src/Drupal/Commands/pm/drush.services.yml new file mode 100644 index 0000000000000000000000000000000000000000..367f01fe7b9818eb694dac8c0082df930d66a39e --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/pm/drush.services.yml @@ -0,0 +1,11 @@ +services: + pm.commands: + class: \Drush\Drupal\Commands\pm\PmCommands + arguments: ['@config.factory', '@module_installer', '@theme_handler'] + tags: + - { name: drush.command } + theme.commands: + class: \Drush\Drupal\Commands\pm\ThemeCommands + arguments: ['@theme_installer'] + tags: + - { name: drush.command } diff --git a/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeCommands.php b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..43729b5d3fa03c29499e03cd842458f447906dc7 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeCommands.php @@ -0,0 +1,55 @@ +<?php + +namespace Drush\Drupal\Commands\sql; + +use Consolidation\AnnotatedCommand\Events\CustomEventAwareInterface; +use Consolidation\AnnotatedCommand\Events\CustomEventAwareTrait; +use Drush\Commands\DrushCommands; +use Drush\Exceptions\UserAbortException; + +class SanitizeCommands extends DrushCommands implements CustomEventAwareInterface +{ + + use CustomEventAwareTrait; + + /** + * Sanitize the database by removing or obfuscating user data. + * + * Commandfiles may add custom operations by implementing: + * - @hook_on-event sql-sanitize-message + * Display summary to user before confirmation. + * - @hook post-command sql-sanitize + * Run queries or call APIs to perform sanitizing + * + * @command sql:sanitize + * @aliases sqlsan,sql-sanitize + * @usage drush sql:sanitize --sanitize-password=no + * Sanitize database without modifying any passwords. + * @usage drush sql:sanitize --whitelist-fields=field_biography,field_phone_number + * Sanitizes database but exempts two user fields from modification. + */ + public function sanitize() + { + /** + * In order to present only one prompt, collect all confirmations from + * commandfiles up front. sql-sanitize plugins are commandfiles that implement + * \Drush\Commands\sql\SanitizePluginInterface + */ + $messages = []; + $input = $this->input(); + $handlers = $this->getCustomEventHandlers('sql-sanitize-confirms'); + foreach ($handlers as $handler) { + $handler($messages, $input); + } + if (!empty($messages)) { + $this->output()->writeln(dt('The following operations will be performed:')); + $this->io()->listing($messages); + } + if (!$this->io()->confirm(dt('Do you want to sanitize the current database?'))) { + throw new UserAbortException(); + } + + // All sanitize operations defined in post-command hooks, including Drush + // core sanitize routines. See \Drush\Commands\sql\SanitizePluginInterface. + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeCommentsCommands.php b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeCommentsCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..7d2a685c86552ee0e53c110d6f7355c072c41309 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeCommentsCommands.php @@ -0,0 +1,76 @@ +<?php +namespace Drush\Drupal\Commands\sql; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Drush\Drush; +use Symfony\Component\Console\Input\InputInterface; + +/** + * This class is a good example of a sql-sanitize plugin. + */ +class SanitizeCommentsCommands extends DrushCommands implements SanitizePluginInterface +{ + protected $database; + protected $moduleHandler; + + /** + * SanitizeCommentsCommands constructor. + * @param $database + * @param $moduleHandler + */ + public function __construct($database, $moduleHandler) + { + $this->database = $database; + $this->moduleHandler = $moduleHandler; + } + + /** + * Sanitize comment names from the DB. + * + * @hook post-command sql-sanitize + * + * @inheritdoc + */ + public function sanitize($result, CommandData $commandData) + { + if ($this->applies()) { + //Update anon. + $this->database->update('comment_field_data') + ->fields([ + 'name' => 'Anonymous', + 'mail' => '', + 'homepage' => 'http://example.com' + ]) + ->condition('uid', 0) + ->execute(); + + // Update auth. + $this->database->update('comment_field_data') + ->expression('name', "CONCAT('User', uid)") + ->expression('mail', "CONCAT('user+', uid, '@example.com')") + ->fields(['homepage' => 'http://example.com']) + ->condition('uid', 1, '>=') + ->execute(); + $this->logger()->success(dt('Comment display names and emails removed.')); + } + } + + /** + * @hook on-event sql-sanitize-confirms + * + * @inheritdoc + */ + public function messages(&$messages, InputInterface $input) + { + if ($this->applies()) { + $messages[] = dt('Remove comment display names and emails.'); + } + } + + protected function applies() + { + Drush::bootstrapManager()->doBootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL); + return $this->moduleHandler->moduleExists('comment'); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/sql/SanitizePluginInterface.php b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizePluginInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..ddc8a99e35f39a1657f0f9027c9ccb7e25622093 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizePluginInterface.php @@ -0,0 +1,33 @@ +<?php + +namespace Drush\Drupal\Commands\sql; + +use Consolidation\AnnotatedCommand\CommandData; +use Symfony\Component\Console\Input\InputInterface; + +/** + * Implement this interface when building a Drush sql-sanitize plugin. + */ +interface SanitizePluginInterface +{ + /** + * Run your sanitization logic using standard Drupal APIs. + * + * @param $result Exit code from the main operation for sql-sanitize. + * @param CommandData $commandData Information about the current request. + * + * @hook post-command sql-sanitize + */ + public function sanitize($result, CommandData $commandData); + + /** + * @hook on-event sql-sanitize-confirms + * + * @param array $messages An array of messages to show during confirmation. + * @param InputInterface $input The effective commandline input for this request. + * + * @return String[] + * An array of messages. + */ + public function messages(&$messages, InputInterface $input); +} diff --git a/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeSessionsCommands.php b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeSessionsCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..577e580856d9e1a1b1883d2166593a0c5bad2842 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeSessionsCommands.php @@ -0,0 +1,51 @@ +<?php +namespace Drush\Drupal\Commands\sql; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Symfony\Component\Console\Input\InputInterface; + +/** + * This class is a good example of how to build a sql-sanitize plugin. + */ +class SanitizeSessionsCommands extends DrushCommands implements SanitizePluginInterface +{ + protected $database; + + public function __construct($database) + { + $this->database = $database; + } + + /** + * @return mixed + */ + public function getDatabase() + { + return $this->database; + } + + + /** + * Sanitize sessions from the DB. + * + * @hook post-command sql-sanitize + * + * @inheritdoc + */ + public function sanitize($result, CommandData $commandData) + { + $this->getDatabase()->truncate('sessions')->execute(); + $this->logger()->success(dt('Sessions table truncated.')); + } + + /** + * @hook on-event sql-sanitize-confirms + * + * @inheritdoc + */ + public function messages(&$messages, InputInterface $input) + { + $messages[] = dt('Truncate sessions table.'); + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeUserFieldsCommands.php b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeUserFieldsCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..0134e7e522563616738da9ec7eab43a118c6a6b9 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeUserFieldsCommands.php @@ -0,0 +1,136 @@ +<?php +namespace Drush\Drupal\Commands\sql; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Symfony\Component\Console\Input\InputInterface; + +/** + * This class is a good example of how to build a sql-sanitize plugin. + */ +class SanitizeUserFieldsCommands extends DrushCommands implements SanitizePluginInterface +{ + protected $database; + protected $entityManager; + protected $entityTypeManager; + + public function __construct($database, $entityManager, $entityTypeManager) + { + $this->database = $database; + $this->entityManager = $entityManager; + $this->entityTypeManager = $entityTypeManager; + } + + /** + * @return mixed + */ + public function getDatabase() + { + return $this->database; + } + + /** + * @return mixed + */ + public function getEntityManager() + { + return $this->entityManager; + } + + /** + * Sanitize string fields associated with the user. + * + * @todo Use Drupal services to get field info. + * + * @hook post-command sql-sanitize + * + * @inheritdoc + */ + public function sanitize($result, CommandData $commandData) + { + $options = $commandData->options(); + $conn = $this->getDatabase(); + $field_definitions = $this->getEntityManager()->getFieldDefinitions('user', 'user'); + $field_storage = $this->getEntityManager()->getFieldStorageDefinitions('user'); + foreach (explode(',', $options['whitelist-fields']) as $key) { + unset($field_definitions[$key], $field_storage[$key]); + } + + foreach ($field_definitions as $key => $def) { + $execute = false; + if (!isset($field_storage[$key]) || $field_storage[$key]->isBaseField()) { + continue; + } + + $table = 'user__' . $key; + $query = $conn->update($table); + $name = $def->getName(); + $field_type_class = \Drupal::service('plugin.manager.field.field_type')->getPluginClass($def->getType()); + $value_array = $field_type_class::generateSampleValue($def); + $value = $value_array['value']; + switch ($def->getType()) { + case 'email': + $query->fields([$name . '_value' => $value]); + $execute = true; + break; + case 'string': + $query->fields([$name . '_value' => $value]); + $execute = true; + break; + + case 'string_long': + $query->fields([$name . '_value' => $value]); + $execute = true; + break; + + case 'telephone': + $query->fields([$name . '_value' => '15555555555']); + $execute = true; + break; + + case 'text': + $query->fields([$name . '_value' => $value]); + $execute = true; + break; + + case 'text_long': + $query->fields([$name . '_value' => $value]); + $execute = true; + break; + + case 'text_with_summary': + $query->fields([ + $name . '_value' => $value, + $name . '_summary' => $value_array['summary'], + ]); + $execute = true; + break; + } + if ($execute) { + $query->execute(); + $this->entityTypeManager->getStorage('user')->resetCache(); + $this->logger()->success(dt('!table table sanitized.', ['!table' => $table])); + } else { + $this->logger()->success(dt('No text fields for users need sanitizing.', ['!table' => $table])); + } + } + } + + /** + * @hook on-event sql-sanitize-confirms + * + * @inheritdoc + */ + public function messages(&$messages, InputInterface $input) + { + $messages[] = dt('Sanitize text fields associated with users.'); + } + + /** + * @hook option sql-sanitize + * @option whitelist-fields A comma delimited list of fields exempt from sanitization. + */ + public function options($options = ['whitelist-fields' => '']) + { + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeUserTableCommands.php b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeUserTableCommands.php new file mode 100644 index 0000000000000000000000000000000000000000..29ff86f694566c53420de469dcecb03bb3a42379 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/sql/SanitizeUserTableCommands.php @@ -0,0 +1,124 @@ +<?php +namespace Drush\Drupal\Commands\sql; + +use Consolidation\AnnotatedCommand\CommandData; +use Drush\Commands\DrushCommands; +use Drush\Sql\SqlBase; +use Drush\Utils\StringUtils; +use Symfony\Component\Console\Input\InputInterface; + +/** + * A sql-sanitize plugin. + */ +class SanitizeUserTableCommands extends DrushCommands implements SanitizePluginInterface +{ + protected $database; + protected $passwordHasher; + protected $entityTypeManager; + + public function __construct($database, $passwordHasher, $entityTypeManager) + { + $this->database = $database; + $this->passwordHasher = $passwordHasher; + $this->entityTypeManager = $entityTypeManager; + } + + /** + * Sanitize usernames and passwords. This also an example of how to write a + * database sanitizer for sql-sync. + * + * @hook post-command sql-sanitize + * + * @inheritdoc + */ + public function sanitize($result, CommandData $commandData) + { + $options = $commandData->options(); + $query = $this->database->update('users_field_data')->condition('uid', 0, '>'); + $messages = []; + + // Sanitize passwords. + if ($this->isEnabled($options['sanitize-password'])) { + $password = $options['sanitize-password']; + if (is_null($password)) { + $password = StringUtils::generatePassword(); + } + + // Mimic Drupal's /scripts/password-hash.sh + $hash = $this->passwordHasher->hash($password); + $query->fields(['pass' => $hash]); + $messages[] = dt('User passwords sanitized.'); + } + + // Sanitize email addresses. + if ($this->isEnabled($options['sanitize-email'])) { + if (strpos($options['sanitize-email'], '%') !== false) { + // We need a different sanitization query for MSSQL, Postgres and Mysql. + $sql = SqlBase::create($commandData->input()->getOptions()); + $db_driver = $sql->scheme(); + if ($db_driver == 'pgsql') { + $email_map = ['%uid' => "' || uid || '", '%mail' => "' || replace(mail, '@', '_') || '", '%name' => "' || replace(name, ' ', '_') || '"]; + $new_mail = "'" . str_replace(array_keys($email_map), array_values($email_map), $options['sanitize-email']) . "'"; + } elseif ($db_driver == 'mssql') { + $email_map = ['%uid' => "' + uid + '", '%mail' => "' + replace(mail, '@', '_') + '", '%name' => "' + replace(name, ' ', '_') + '"]; + $new_mail = "'" . str_replace(array_keys($email_map), array_values($email_map), $options['sanitize-email']) . "'"; + } else { + $email_map = ['%uid' => "', uid, '", '%mail' => "', replace(mail, '@', '_'), '", '%name' => "', replace(name, ' ', '_'), '"]; + $new_mail = "concat('" . str_replace(array_keys($email_map), array_values($email_map), $options['sanitize-email']) . "')"; + } + $query->expression('mail', $new_mail); + $query->expression('init', $new_mail); + } else { + $query->fields(['mail' => $options['sanitize-email']]); + } + $messages[] = dt('User emails sanitized.'); + } + + if ($messages) { + $query->execute(); + $this->entityTypeManager->getStorage('user')->resetCache(); + foreach ($messages as $message) { + $this->logger()->success($message); + } + } + } + + /** + * @hook option sql-sanitize + * @option sanitize-email The pattern for test email addresses in the + * sanitization operation, or "no" to keep email addresses unchanged. May + * contain replacement patterns %uid, %mail or %name. + * @option sanitize-password + * By default, passwords are randomized. Specify 'no' to disable that. Specify any other value to set all passwords + * to that value. + */ + public function options($options = ['sanitize-email' => 'user+%uid@localhost.localdomain', 'sanitize-password' => null]) + { + } + + /** + * @hook on-event sql-sanitize-confirms + * + * @inheritdoc + */ + public function messages(&$messages, InputInterface $input) + { + $options = $input->getOptions(); + if ($this->isEnabled($options['sanitize-password'])) { + $messages[] = dt('Sanitize user passwords.'); + } + if ($this->isEnabled($options['sanitize-email'])) { + $messages[] = dt('Sanitize user emails.'); + } + } + + /** + * Test an option value to see if it is disabled. + * @param $value + * @return bool + */ + protected function isEnabled($value) + { + return $value != 'no' && $value != '0'; + } +} diff --git a/vendor/drush/drush/src/Drupal/Commands/sql/drush.services.yml b/vendor/drush/drush/src/Drupal/Commands/sql/drush.services.yml new file mode 100644 index 0000000000000000000000000000000000000000..ad0385182191129fb92e094d0fb52db4ef702719 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/Commands/sql/drush.services.yml @@ -0,0 +1,26 @@ +services: + sanitize.commands: + class: \Drush\Drupal\Commands\sql\SanitizeCommands + arguments: [] + tags: + - { name: drush.command } + sanitize.comments.commands: + class: \Drush\Drupal\Commands\sql\SanitizeCommentsCommands + arguments: ['@database', '@module_handler',] + tags: + - { name: drush.command } + sanitize.sessions.commands: + class: \Drush\Drupal\Commands\sql\SanitizeSessionsCommands + arguments: ['@database'] + tags: + - { name: drush.command } + sanitize.userfields.commands: + class: \Drush\Drupal\Commands\sql\SanitizeUserFieldsCommands + arguments: ['@database', '@entity.manager', '@entity_type.manager'] + tags: + - { name: drush.command } + sanitize.usertable.commands: + class: \Drush\Drupal\Commands\sql\SanitizeUserTableCommands + arguments: ['@database', '@password', '@entity_type.manager'] + tags: + - { name: drush.command } diff --git a/vendor/drush/drush/src/Drupal/DrupalKernel.php b/vendor/drush/drush/src/Drupal/DrupalKernel.php new file mode 100644 index 0000000000000000000000000000000000000000..023078b2c9bda4ab69bbbd48a8135d57271af170 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/DrupalKernel.php @@ -0,0 +1,13 @@ +<?php + +namespace Drush\Drupal; + +use Drupal\Core\DrupalKernel as DrupalDrupalKernel; + +/** + * Overridden version of DrupalKernel adapted to the needs of Drush. + */ +class DrupalKernel extends DrupalDrupalKernel +{ + use DrupalKernelTrait; +} diff --git a/vendor/drush/drush/src/Drupal/DrupalKernelTrait.php b/vendor/drush/drush/src/Drupal/DrupalKernelTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..0d896a5a956c63167dd904a46cc86e6e1a28af2d --- /dev/null +++ b/vendor/drush/drush/src/Drupal/DrupalKernelTrait.php @@ -0,0 +1,209 @@ +<?php + +namespace Drush\Drupal; + +use Composer\Semver\Semver; +use Drupal\Core\DependencyInjection\ServiceModifierInterface; +use Drupal\Core\Site\Settings; +use Drush\Drush; +use Drush\Log\LogLevel; + +/** + * Common functionality for overridden kernels. + */ +trait DrupalKernelTrait +{ + /** @var ServiceModifierInterface[] */ + protected $serviceModifiers = []; + + /** + * Add a service modifier to the container builder. + * + * The container is not compiled until $kernel->boot(), so there is a chance + * for clients to add compiler passes et. al. before then. + */ + public function addServiceModifier(ServiceModifierInterface $serviceModifier) + { + Drush::logger()->debug((dt("Add service modifier"))); + $this->serviceModifiers[] = $serviceModifier; + } + + /** + * @inheritdoc + */ + protected function getContainerBuilder() + { + Drush::logger()->debug(dt("Get container builder")); + $container = parent::getContainerBuilder(); + foreach ($this->serviceModifiers as $serviceModifier) { + $serviceModifier->alter($container); + } + return $container; + } + + /** + * Initializes the service container. + * + * @return \Symfony\Component\DependencyInjection\ContainerInterface + */ + protected function initializeContainer() + { + $container_definition = $this->getCachedContainerDefinition(); + + if ($this->shouldDrushInvalidateContainer()) { + // Normally when the container is being rebuilt, the existing + // container is still available for use until the newly built one + // replaces it. Certain contrib modules rely on services (like State + // or the config factory) being available for things like defining + // event subscriptions. + // @see https://github.com/drush-ops/drush/issues/3123 + if (isset($container_definition)) { + $class = Settings::get('container_base_class', '\Drupal\Core\DependencyInjection\Container'); + $container = new $class($container_definition); + $this->attachSynthetic($container); + \Drupal::setContainer($container); + } + + $this->invalidateContainer(); + } + return parent::initializeContainer(); + } + + protected function shouldDrushInvalidateContainer() + { + if (empty($this->moduleList) && !$this->containerNeedsRebuild) { + $container_definition = $this->getCachedContainerDefinition(); + foreach ($this->serviceModifiers as $serviceModifier) { + if (!$serviceModifier->check($container_definition)) { + return true; + } + } + } + return false; + } + + /** + * {@inheritdoc} + */ + public function discoverServiceProviders() + { + // Let Drupal discover all of its service providers + parent::discoverServiceProviders(); + + // Add those Drush service providers from Drush core that + // need references to the Drupal DI container. This includes + // Drush commands, and those services needed by those Drush + // commands. + // + // Note that: + // - We list all of the individual service files we use here. + // - These commands are not available until Drupal is bootstrapped. + $this->addDrushServiceProvider("_drush__config", DRUSH_BASE_PATH . '/src/Drupal/Commands/config/drush.services.yml'); + $this->addDrushServiceProvider("_drush__core", DRUSH_BASE_PATH . '/src/Drupal/Commands/core/drush.services.yml'); + $this->addDrushServiceProvider("_drush__pm", DRUSH_BASE_PATH . '/src/Drupal/Commands/pm/drush.services.yml'); + $this->addDrushServiceProvider("_drush__sql", DRUSH_BASE_PATH . '/src/Drupal/Commands/sql/drush.services.yml'); + + // TODO: We could potentially also add service providers from: + // - DRUSH_BASE_PATH . '/drush/drush.services.yml'); + // - DRUSH_BASE_PATH . '/../drush/drush.services.yml'); + // Or, perhaps better yet, from every Drush command directory + // (e.g. DRUSH_BASE_PATH/drush/mycmd/drush.services.yml) in + // any of these `drush` folders. In order to do this, it is + // necessary that the class files in these commands are available + // in the autoloader. + + // Also add Drush services from all modules + $module_filenames = $this->getModuleFileNames(); + // Load each module's serviceProvider class. + foreach ($module_filenames as $module => $filename) { + $this->addModuleDrushServiceProvider($module, $filename); + } + } + + /** + * Determine whether or not the Drush services.yml file is applicable + * for this version of Drush. + */ + protected function addModuleDrushServiceProvider($module, $filename) + { + $serviceYmlPath = $this->findModuleDrushServiceProvider($module, dirname($filename)); + $this->addDrushServiceProvider("_drush.$module", $serviceYmlPath); + } + + protected function findModuleDrushServiceProvider($module, $dir) + { + $services = $this->findModuleDrushServiceProviderFromComposer($dir); + if (!$services) { + return $this->findDefaultServicesFile($module, $dir); + } + return $this->findAppropriateServicesFile($module, $services, $dir); + } + + protected function findDefaultServicesFile($module, $dir) + { + $result = $dir . "/drush.services.yml"; + if (!file_exists($result)) { + return; + } + Drush::logger()->debug(dt("!module should have an extra.drush.services section in its composer.json. See http://docs.drush.org/en/master/commands/#specifying-the-services-file.", ['!module' => $module])); + return $result; + } + + /** + * In composer.json, the Drush version constraints will appear + * in the 'extra' section like so: + * + * "extra": { + * "drush": { + * "services": { + * "drush.services.yml": "^9" + * } + * } + * } + * + * There may be multiple drush service files listed; the first + * one that has a version constraint that matches the Drush version + * is used. + */ + protected function findModuleDrushServiceProviderFromComposer($dir) + { + $composerJsonPath = "$dir/composer.json"; + if (!file_exists($composerJsonPath)) { + return false; + } + $composerJsonContents = file_get_contents($composerJsonPath); + $info = json_decode($composerJsonContents, true); + if (!$info) { + Drush::logger()->warning(dt('Invalid json in {composer}', ['composer' => $composerJsonPath])); + return false; + } + if (!isset($info['extra']['drush']['services'])) { + return false; + } + return $info['extra']['drush']['services']; + } + + protected function findAppropriateServicesFile($module, $services, $dir) + { + $version = Drush::getVersion(); + foreach ($services as $serviceYmlPath => $versionConstraint) { + $version = preg_replace('#-dev.*#', '', $version); + if (Semver::satisfies($version, $versionConstraint)) { + Drush::logger()->debug(dt('Found {services} for {module} Drush commands', ['module' => $module, 'services' => $serviceYmlPath])); + return $dir . '/' . $serviceYmlPath; + } + } + Drush::logger()->debug(dt('{module} has Drush commands, but none of {constraints} match the current Drush version "{version}"', ['module' => $module, 'constraints' => implode(',', $services), 'version' => $version])); + return false; + } + + /** + * Add a services.yml file if it exists. + */ + protected function addDrushServiceProvider($serviceProviderName, $serviceYmlPath) + { + if (file_exists($serviceYmlPath)) { + $this->serviceYamls['app'][$serviceProviderName] = $serviceYmlPath; + } + } +} diff --git a/vendor/drush/drush/src/Drupal/DrupalUtil.php b/vendor/drush/drush/src/Drupal/DrupalUtil.php new file mode 100644 index 0000000000000000000000000000000000000000..c44884c8940e072b24fb579a44c46f67ad3bcefc --- /dev/null +++ b/vendor/drush/drush/src/Drupal/DrupalUtil.php @@ -0,0 +1,25 @@ +<?php +namespace Drush\Drupal; + +class DrupalUtil +{ + + /** + * Output a Drupal render array, object or string as plain text. + * + * @param string $data + * Data to render. + * + * @return string + * The plain-text representation of the input. + */ + public static function drushRender($data) + { + if (is_array($data)) { + $data = \Drupal::service('renderer')->renderRoot($data); + } + + $data = \Drupal\Core\Mail\MailFormatHelper::htmlToText($data); + return $data; + } +} diff --git a/vendor/drush/drush/src/Drupal/DrushServiceModifier.php b/vendor/drush/drush/src/Drupal/DrushServiceModifier.php new file mode 100644 index 0000000000000000000000000000000000000000..685d12b8775f2c406df6e8d766191e3365f97712 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/DrushServiceModifier.php @@ -0,0 +1,53 @@ +<?php + +namespace Drush\Drupal; + +use Drush\Drush; +use Drush\Log\LogLevel; +use Drupal\Core\DependencyInjection\ServiceModifierInterface; +use Drupal\Core\DependencyInjection\ContainerBuilder; + +class DrushServiceModifier implements ServiceModifierInterface +{ + // Holds list of command classes implementing Symfony\Console\Component\Command + const DRUSH_CONSOLE_SERVICES = 'drush.console.services'; + // Holds list of command classes implemented with annotated commands + const DRUSH_COMMAND_SERVICES = 'drush.command.services'; + // Holds list of command info alterer classes. + const DRUSH_COMMAND_INFO_ALTERER_SERVICES = 'drush.command_info_alterer.services'; + // Holds list of classes implementing Drupal Code Generator classes + const DRUSH_GENERATOR_SERVICES = 'drush.generator.services'; + + /** + * @inheritdoc + */ + public function alter(ContainerBuilder $container) + { + Drush::logger()->log(LogLevel::DEBUG_NOTIFY, dt("Service modifier alter.")); + // http://symfony.com/doc/2.7/components/dependency_injection/tags.html#register-the-pass-with-the-container + $container->register(self::DRUSH_CONSOLE_SERVICES, 'Drush\Command\ServiceCommandlist'); + $container->addCompilerPass(new FindCommandsCompilerPass(self::DRUSH_CONSOLE_SERVICES, 'console.command')); + $container->register(self::DRUSH_COMMAND_SERVICES, 'Drush\Command\ServiceCommandlist'); + $container->addCompilerPass(new FindCommandsCompilerPass(self::DRUSH_COMMAND_SERVICES, 'drush.command')); + $container->register(self::DRUSH_COMMAND_INFO_ALTERER_SERVICES, 'Drush\Command\ServiceCommandlist'); + $container->addCompilerPass(new FindCommandsCompilerPass(self::DRUSH_COMMAND_INFO_ALTERER_SERVICES, 'drush.command_info_alterer')); + $container->register(self::DRUSH_GENERATOR_SERVICES, 'Drush\Command\ServiceCommandlist'); + $container->addCompilerPass(new FindCommandsCompilerPass(self::DRUSH_GENERATOR_SERVICES, 'drush.generator')); + } + + /** + * Checks existing service definitions for the presence of modification. + * + * @param $container_definition + * Cached container definition + * @return bool + */ + public function check($container_definition) + { + return + isset($container_definition['services'][self::DRUSH_CONSOLE_SERVICES]) && + isset($container_definition['services'][self::DRUSH_COMMAND_SERVICES]) && + isset($container_definition['services'][self::DRUSH_COMMAND_INFO_ALTERER_SERVICES]) && + isset($container_definition['services'][self::DRUSH_GENERATOR_SERVICES]); + } +} diff --git a/vendor/drush/drush/src/Drupal/ExtensionDiscovery.php b/vendor/drush/drush/src/Drupal/ExtensionDiscovery.php new file mode 100644 index 0000000000000000000000000000000000000000..3ceda8492c1fdb961bcf7fc281a08a5e3b3f69b0 --- /dev/null +++ b/vendor/drush/drush/src/Drupal/ExtensionDiscovery.php @@ -0,0 +1,13 @@ +<?php + +namespace Drush\Drupal; + +use Drupal\Core\Extension\ExtensionDiscovery as DrupalExtensionDiscovery; + +class ExtensionDiscovery extends DrupalExtensionDiscovery +{ + public static function reset() + { + static::$files = []; + } +} diff --git a/vendor/drush/drush/lib/Drush/Drupal/FindCommandsCompilerPass.php b/vendor/drush/drush/src/Drupal/FindCommandsCompilerPass.php similarity index 86% rename from vendor/drush/drush/lib/Drush/Drupal/FindCommandsCompilerPass.php rename to vendor/drush/drush/src/Drupal/FindCommandsCompilerPass.php index b1e515de1af3adc4fcbe2dbdc6e199bdc7809fa8..4c80e434618894d78c1ed9c5afbfeaf60d99a137 100644 --- a/vendor/drush/drush/lib/Drush/Drupal/FindCommandsCompilerPass.php +++ b/vendor/drush/drush/src/Drupal/FindCommandsCompilerPass.php @@ -1,6 +1,7 @@ <?php namespace Drush\Drupal; +use Drush\Drush; use Drush\Log\LogLevel; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; @@ -43,12 +44,12 @@ public function __construct($storageClassId, $tagId) public function process(ContainerBuilder $container) { - drush_log(dt("process !storage !tag", ['!storage' => $this->storageClassId, '!tag' => $this->tagId]), LogLevel::DEBUG); + Drush::logger()->debug(dt("process !storage !tag", ['!storage' => $this->storageClassId, '!tag' => $this->tagId])); // We expect that our called registered the storage // class under the storage class id before adding this // compiler pass, but we will test this presumption to be sure. if (!$container->has($this->storageClassId)) { - drush_log(dt("storage class not registered"), LogLevel::DEBUG); + Drush::logger()->debug(dt("storage class not registered")); return; } @@ -60,10 +61,10 @@ public function process(ContainerBuilder $container) $this->tagId ); foreach ($taggedServices as $id => $tags) { - drush_log(dt("found tagged service !id", ['!id' => $id]), LogLevel::DEBUG); + Drush::logger()->log(LogLevel::DEBUG_NOTIFY, dt("Found tagged service !id", ['!id' => $id])); $definition->addMethodCall( 'addCommandReference', - array(new Reference($id)) + [new Reference($id)] ); } } diff --git a/vendor/drush/drush/src/Drupal/InstallerKernel.php b/vendor/drush/drush/src/Drupal/InstallerKernel.php new file mode 100644 index 0000000000000000000000000000000000000000..f696bdd57c0a985d5420b57063ea8acfa421a4ff --- /dev/null +++ b/vendor/drush/drush/src/Drupal/InstallerKernel.php @@ -0,0 +1,12 @@ +<?php +namespace Drush\Drupal; + +use Drupal\Core\Installer\InstallerKernel as DrupalInstallerKernel; + +/** + * Overridden version of InstallerKernel adapted to the needs of Drush. + */ +class InstallerKernel extends DrupalInstallerKernel +{ + use DrupalKernelTrait; +} diff --git a/vendor/drush/drush/src/Drupal/UpdateKernel.php b/vendor/drush/drush/src/Drupal/UpdateKernel.php new file mode 100644 index 0000000000000000000000000000000000000000..5632fd38f8dcc69a8e71919e99bc388e9f97bc5f --- /dev/null +++ b/vendor/drush/drush/src/Drupal/UpdateKernel.php @@ -0,0 +1,12 @@ +<?php +namespace Drush\Drupal; + +use Drupal\Core\Update\UpdateKernel as DrupalUpdateKernel; + +/** + * Overridden version of UpdateKernel adapted to the needs of Drush. + */ +class UpdateKernel extends DrupalUpdateKernel +{ + use DrupalKernelTrait; +} diff --git a/vendor/drush/drush/lib/Drush/Drush.php b/vendor/drush/drush/src/Drush.php similarity index 52% rename from vendor/drush/drush/lib/Drush/Drush.php rename to vendor/drush/drush/src/Drush.php index 1a311b6f24d13569cdaf027506b13b61dd9a6ef2..a94c7ceac8460b3764158b172b81470a9b7fa199 100644 --- a/vendor/drush/drush/lib/Drush/Drush.php +++ b/vendor/drush/drush/src/Drush.php @@ -8,40 +8,65 @@ use Consolidation\SiteAlias\SiteAliasInterface; use Consolidation\SiteAlias\SiteAliasManager; -use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; -use Consolidation\SiteAlias\SiteAliasManagerInterface; use Consolidation\SiteProcess\ProcessBase; use Consolidation\SiteProcess\SiteProcess; -use Drush\Command\DrushOutputAdapter; -use Drush\ConfigAdapter; -use Drush\DrushConfig; -use Drush\SiteAlias\ProcessManager; -use Drush\SiteAlias\AliasManagerAdapter; +use Drush\Style\DrushStyle; +use League\Container\ContainerInterface; use Psr\Log\LoggerInterface; +use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; + +// TODO: Not sure if we should have a reference to PreflightArgs here. +// Maybe these constants should be in config, and PreflightArgs can +// reference them from there as well. +use Drush\Preflight\PreflightArgs; use Symfony\Component\Process\Process; /** - * Static Service provider. + * Static Service Container wrapper. + * + * This code is analogous to the \Drupal class in Drupal 8. + * + * We would like to move Drush towards the model of using constructor + * injection rather than globals. This class serves as a unified global + * accessor to arbitrary services for use by legacy Drush code. + * + * Advice from Drupal 8's 'Drupal' class: * - * This is a back-port of the \Drush\Drush class from Drush 9. - * Drush 8 does not use a dependency injection container; however, - * some objects are injected into command files, and these should - * be used preferentially whenever possible. + * This class exists only to support legacy code that cannot be dependency + * injected. If your code needs it, consider refactoring it to be object + * oriented, if possible. When this is not possible, and your code is more + * than a few non-reusable lines, it is recommended to instantiate an object + * implementing the actual logic. + * + * @code + * // Legacy procedural code. + * $object = drush_get_context('DRUSH_CLASS_LABEL'); + * + * Better: + * $object = Drush::service('label'); * * @endcode */ class Drush { - protected static $config = null; - protected static $aliasManager = null; - protected static $processManager = null; - protected static $input = null; - protected static $output = null; - protected static $drushVersion = null; - protected static $drushMajorVersion = null; - protected static $drushMinorVersion = null; + + /** + * The version of Drush from the drush.info file, or FALSE if not read yet. + * + * @var string|FALSE + */ + protected static $version = false; + protected static $majorVersion = false; + protected static $minorVersion = false; + + /** + * The Robo Runner -- manages and constructs all commandfile classes + * + * @var \Robo\Runner + */ + protected static $runner; /** * Number of seconds before timeout for subprocesses. Can be customized via setTimeout() method. @@ -60,118 +85,182 @@ public static function getTimeout() /** * Return the current Drush version. + * + * n.b. Called before the DI container is initialized. + * Do not log, etc. here. */ public static function getVersion() { - if (!isset(self::$drushVersion)) { - $drush_info = self::ReadDrushInfo(); - self::$drushVersion = $drush_info['drush_version']; + if (!self::$version) { + $drush_info = self::drushReadDrushInfo(); + self::$version = $drush_info['drush_version']; } - - return self::$drushVersion; + return self::$version; } - /** - * Return the Drush major version, e.g. 8, 9 or 10 - */ public static function getMajorVersion() { - if (!isset(self::$drushMajorVersion)) { - $version_parts = explode('.', self::getVersion()); - self::$drushMajorVersion = $version_parts[0]; + if (!self::$majorVersion) { + $drush_version = self::getVersion(); + $version_parts = explode('.', $drush_version); + self::$majorVersion = $version_parts[0]; } - - return self::$drushMajorVersion; + return self::$majorVersion; } - /** - * Return the Drush minor version, e.g. the minor version of - * Drush 9.5.2 is "5". - */ public static function getMinorVersion() { - if (!isset(self::$drushMinorVersion)) { - $version_parts = explode('.', self::getVersion()); - self::$drushMinorVersion = $version_parts[1]; + if (!self::$minorVersion) { + $drush_version = self::getVersion(); + $version_parts = explode('.', $drush_version); + self::$minorVersion = $version_parts[1]; } - - return self::$drushMinorVersion; + return self::$minorVersion; } /** - * Read the drush info file. + * Sets a new global container. + * + * @param \League\Container\Container $container + * A new container instance to replace the current. */ - public static function ReadDrushInfo() + public static function setContainer(ContainerInterface $container) { - $drush_info_file = dirname(dirname(__DIR__)) . '/drush.info'; - - return parse_ini_file($drush_info_file); + \Robo\Robo::setContainer($container); } - // public static function setContainer(ContainerInterface $container) - - // public static function unsetContainer() + /** + * Unsets the global container. + */ + public static function unsetContainer() + { + \Robo\Robo::unsetContainer(); + } - // public static function getContainer() + /** + * Returns the currently active global container. + * + * @return \League\Container\ContainerInterface|null + * + * @throws RuntimeException + */ + public static function getContainer() + { + if (!\Robo\Robo::hasContainer()) { + debug_print_backtrace(); + throw new \RuntimeException('Drush::$container is not initialized yet. \Drush::setContainer() must be called with a real container.'); + } + return \Robo\Robo::getContainer(); + } + /** + * Returns TRUE if the container has been initialized, FALSE otherwise. + * + * @return bool + */ public static function hasContainer() { - return false; + return \Robo\Robo::hasContainer(); } - // public static function getApplication() + /** + * Get the current Symfony Console Application. + * + * @return Application + */ + public static function getApplication() + { + return self::getContainer()->get('application'); + } - // public static function runner() + /** + * Return the Robo runner. + * + * @return \Robo\Runner + */ + public static function runner() + { + if (!isset(self::$runner)) { + self::$runner = new \Robo\Runner(); + } + return self::$runner; + } - // public static function service($id) + /** + * Retrieves a service from the container. + * + * Use this method if the desired service is not one of those with a dedicated + * accessor method below. If it is listed below, those methods are preferred + * as they can return useful type hints. + * + * @param string $id + * The ID of the service to retrieve. + * + * @return mixed + * The specified service. + */ + public static function service($id) + { + return self::getContainer()->get($id); + } + /** + * Indicates if a service is defined in the container. + * + * @param string $id + * The ID of the service to check. + * + * @return bool + * TRUE if the specified service exists, FALSE otherwise. + */ public static function hasService($id) { - return false; + // Check hasContainer() first in order to always return a Boolean. + return self::hasContainer() && self::getContainer()->has($id); } - // public static function commandFactory() + /** + * Return command factory + * + * @return \Consolidation\AnnotatedCommand\AnnotatedCommandFactory + */ + public static function commandFactory() + { + return self::service('commandFactory'); + } /** * Return the Drush logger object. * * @return LoggerInterface * - * @deprecated Use injected logger if possible + * @deprecated Use injected logger instead. */ public static function logger() { - return drush_get_context('DRUSH_LOGGER');; + return self::service('logger'); } /** * Return the configuration object * - * @return \Drush\DrushConfig + * @return \Drush\Config\DrushConfig * - * @deprecated Use injected config if possible + * @deprecated Use injected configuration instead. */ public static function config() { - if (!static::$config) { - static::$config = new DrushConfig(); - } - - return static::$config; + return self::service('config'); } /** * @return SiteAliasManager * - * @deprecated Use injected alias manager if possible + * @deprecated Use injected alias manager instead. @see Drush::drush() */ public static function aliasManager() { - if (!static::$aliasManager) { - static::$aliasManager = new AliasManagerAdapter(); - } - - return static::$aliasManager; + return self::service('site.alias.manager'); } /** @@ -181,14 +270,7 @@ public static function aliasManager() */ public static function processManager() { - if (!static::$processManager) { - static::$processManager = new ProcessManager(); - ProcessManager::addTransports(static::$processManager); - static::$processManager->setConfig(new ConfigAdapter(new DrushConfig())); - // TODO: static::$processManager->setConfigRuntime() - } - - return static::$processManager; + return self::service('process.manager'); } /** @@ -198,11 +280,7 @@ public static function processManager() */ public static function input() { - if (!static::$input) { - static::$input = annotationcommand_adapter_input(); - } - - return static::$input; + return self::service('input'); } /** @@ -212,11 +290,7 @@ public static function input() */ public static function output() { - if (!static::$output) { - static::$output = new DrushOutputAdapter(); - } - - return static::$output; + return self::service('output'); } /** @@ -280,7 +354,7 @@ public static function output() */ public static function drush(SiteAliasInterface $siteAlias, $command, $args = [], $options = [], $options_double_dash = []) { - return static::processManager()->drush($siteAlias, $command, $args, $options, $options_double_dash); + return self::processManager()->drush($siteAlias, $command, $args, $options, $options_double_dash); } /** @@ -297,7 +371,7 @@ public static function drush(SiteAliasInterface $siteAlias, $command, $args = [] */ public static function siteProcess(SiteAliasInterface $siteAlias, $args = [], $options = [], $options_double_dash = []) { - return static::processManager()->siteProcess($siteAlias, $args, $options, $options_double_dash); + return self::processManager()->siteProcess($siteAlias, $args, $options, $options_double_dash); } /** @@ -320,7 +394,7 @@ public static function siteProcess(SiteAliasInterface $siteAlias, $args = [], $o */ public static function process($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60) { - return static::processManager()->process($commandline, $cwd, $env, $input, $timeout); + return self::processManager()->process($commandline, $cwd, $env, $input, $timeout); } /** @@ -337,7 +411,7 @@ public static function process($commandline, $cwd = null, array $env = null, $in */ public static function shell($command, $cwd = null, array $env = null, $input = null, $timeout = 60) { - return static::processManager()->shell($command, $cwd, $env, $input, $timeout); + return self::processManager()->shell($command, $cwd, $env, $input, $timeout); } /** @@ -375,7 +449,10 @@ public static function backend() */ public static function affirmative() { - return drush_get_context('DRUSH_AFFIRMATIVE'); + if (!self::hasService('input')) { + throw new \Exception('No input service available.'); + } + return Drush::input()->getOption('yes') || (Drush::backend() && !Drush::negative()); } /** @@ -383,7 +460,10 @@ public static function affirmative() */ public static function negative() { - return drush_get_context('DRUSH_NEGATIVE'); + if (!self::hasService('input')) { + throw new \Exception('No input service available.'); + } + return Drush::input()->getOption('no'); } /** @@ -391,7 +471,10 @@ public static function negative() */ public static function verbose() { - return drush_get_context('DRUSH_VERBOSE'); + if (!self::hasService('output')) { + return false; + } + return \Drush\Drush::output()->isVerbose(); } /** @@ -399,15 +482,56 @@ public static function verbose() */ public static function debug() { - return drush_get_context('DRUSH_DEBUG'); + if (!self::hasService('output')) { + return false; + } + return \Drush\Drush::output()->isDebug(); + } + + /** + * Return the Bootstrap Manager. + * + * @return \Drush\Boot\BootstrapManager + */ + public static function bootstrapManager() + { + return self::service('bootstrap.manager'); + } + + /** + * Return the Bootstrap object. + * + * @return \Drush\Boot\Boot + */ + public static function bootstrap() + { + return self::bootstrapManager()->bootstrap(); } - // public static function bootstrapManager() + public static function redispatchOptions($input = null) + { + $input = $input ?: self::input(); - // public static function bootstrap() + // $input->getOptions() returns an associative array of option => value + $options = $input->getOptions(); - public static function redispatchOptions() + // The 'runtime.options' config contains a list of option names on th cli + $optionNamesFromCommandline = self::config()->get('runtime.options'); + + // Remove anything in $options that was not on the cli + $options = array_intersect_key($options, array_flip($optionNamesFromCommandline)); + + // Add in the 'runtime.context' items, which includes --include, --alias-path et. al. + return $options + array_filter(self::config()->get(PreflightArgs::DRUSH_RUNTIME_CONTEXT_NAMESPACE)); + } + + /** + * Read the drush info file. + */ + private static function drushReadDrushInfo() { - return drush_redispatch_get_options(); + $drush_info_file = dirname(__FILE__) . '/../drush.info'; + + return parse_ini_file($drush_info_file); } } diff --git a/vendor/drush/drush/lib/Drush/Exceptions/UserAbortException.php b/vendor/drush/drush/src/Exceptions/UserAbortException.php similarity index 100% rename from vendor/drush/drush/lib/Drush/Exceptions/UserAbortException.php rename to vendor/drush/drush/src/Exceptions/UserAbortException.php diff --git a/vendor/drush/drush/src/Exec/ExecTrait.php b/vendor/drush/drush/src/Exec/ExecTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..42bfe92db2d44271ebfd2a1a27bb84c0c1140422 --- /dev/null +++ b/vendor/drush/drush/src/Exec/ExecTrait.php @@ -0,0 +1,101 @@ +<?php +namespace Drush\Exec; + +use Consolidation\SiteProcess\Util\Shell; +use Consolidation\SiteProcess\Util\Escape; +use Drush\Drush; + +trait ExecTrait +{ + /** + * Starts a background browser/tab for the current site or a specified URL. + * + * Uses a non-blocking Process call, so Drush execution will continue. + * + * @param $uri + * Optional URI or site path to open in browser. If omitted, or if a site path + * is specified, the current site home page uri will be prepended if the site's + * hostname resolves. + * @param int $sleep + * @param bool $port + * @param bool $browser + * @return bool + * TRUE if browser was opened. FALSE if browser was disabled by the user or a + * default browser could not be found. + */ + public function startBrowser($uri = null, $sleep = 0, $port = false, $browser = true) + { + if ($browser) { + // We can only open a browser if we have a DISPLAY environment variable on + // POSIX or are running Windows or OS X. + if (!Drush::simulate() && !getenv('DISPLAY') && !drush_is_windows() && !drush_is_osx()) { + $this->logger()->info(dt('No graphical display appears to be available, not starting browser.')); + return false; + } + $host = parse_url($uri, PHP_URL_HOST); + if (!$host) { + // Build a URI for the current site, if we were passed a path. + $site = $this->uri; + $host = parse_url($site, PHP_URL_HOST); + $uri = $site . '/' . ltrim($uri, '/'); + } + // Validate that the host part of the URL resolves, so we don't attempt to + // open the browser for http://default or similar invalid hosts. + $hosterror = (gethostbynamel($host) === false); + $iperror = (ip2long($host) && gethostbyaddr($host) == $host); + if (!Drush::simulate() && ($hosterror || $iperror)) { + $this->logger()->warning(dt('!host does not appear to be a resolvable hostname or IP, not starting browser. You may need to use the --uri option in your command or site alias to indicate the correct URL of this site.', ['!host' => $host])); + return false; + } + if ($port) { + $uri = str_replace($host, "localhost:$port", $uri); + } + if ($browser === true) { + // See if we can find an OS helper to open URLs in default browser. + if (self::programExists('xdg-open')) { + $browser = 'xdg-open'; + } else if (self::programExists('open')) { + $browser = 'open'; + } else if (!drush_has_bash()) { + $browser = 'start'; + } else { + // Can't find a valid browser. + $browser = false; + } + } + + if ($browser) { + $this->logger()->info(dt('Opening browser !browser at !uri', ['!browser' => $browser, '!uri' => $uri])); + $args = []; + if (!Drush::simulate()) { + if ($sleep) { + $args = ['sleep', $sleep, Shell::op('&&')]; + } + // @todo We implode because quoting is messing up the sleep. + $process = Drush::shell(implode(' ', array_merge($args, [$browser, $uri]))); + $process->run(); + } + return true; + } + } + return false; + } + + /* + * Determine if program exists on user's PATH. + * + * @return bool + * True if program exists on PATH. + */ + public static function programExists($program) + { + $command = Escape::isWindows() ? "where $program" : "command -v $program"; + $process = Drush::shell($command); + $process->setSimulated(false); + $process->run(); + if (!$process->isSuccessful()) { + Drush::logger()->debug($process->getErrorOutput()); + } + return $process->isSuccessful(); + } +} diff --git a/vendor/drush/drush/src/Formatters/DrushFormatterManager.php b/vendor/drush/drush/src/Formatters/DrushFormatterManager.php new file mode 100644 index 0000000000000000000000000000000000000000..04e2ef7a75dcc873bf8b1004ac3114e4a8290997 --- /dev/null +++ b/vendor/drush/drush/src/Formatters/DrushFormatterManager.php @@ -0,0 +1,17 @@ +<?php + +/** + * @file + * Definition of Drush\Formatters\DrushFormatterManager. + */ + +namespace Drush\Formatters; + +use \Consolidation\OutputFormatters\FormatterManager; + +/** + * Our own output formatter + */ +class DrushFormatterManager extends FormatterManager +{ +} diff --git a/vendor/drush/drush/src/Log/DrushLog.php b/vendor/drush/drush/src/Log/DrushLog.php new file mode 100644 index 0000000000000000000000000000000000000000..179068929a72aa60a49f301dae91f1d691821daa --- /dev/null +++ b/vendor/drush/drush/src/Log/DrushLog.php @@ -0,0 +1,113 @@ +<?php + +/** + * @file + * Contains \Drush\Log\DrushLog. + * + * This class is only used to convert logging calls made + * inside of Drupal into a logging format that is usable + * by Drush. This code is ONLY usable within the context + * of a bootstrapped Drupal 8 site. + * + * See Drush\Log\Logger for our actuall LoggerInterface + * implementation, that does the work of logging messages + * that originate from Drush. + */ + +namespace Drush\Log; + +use Drupal\Core\Logger\LogMessageParserInterface; +use Drupal\Core\Logger\RfcLoggerTrait; +use Drupal\Core\Logger\RfcLogLevel; +use Psr\Log\LoggerInterface; +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; + +/** + * Redirects Drupal logging messages to Drush log. + * + * Note that Drupal extends the LoggerInterface, and + * needlessly replaces Psr\Log\LogLevels with Drupal\Core\Logger\RfcLogLevel. + * Doing this arguably violates the Psr\Log contract, + * but we can't help that here -- we just need to convert back. + */ +class DrushLog implements LoggerInterface, LoggerAwareInterface +{ + use LoggerAwareTrait; + use RfcLoggerTrait; + + /** + * The message's placeholders parser. + * + * @var \Drupal\Core\Logger\LogMessageParserInterface + */ + protected $parser; + + /** + * Constructs a DrushLog object. + * + * @param \Drupal\Core\Logger\LogMessageParserInterface $parser + * The parser to use when extracting message variables. + */ + public function __construct(LogMessageParserInterface $parser, LoggerInterface $logger) + { + $this->parser = $parser; + $this->logger = $logger; + } + + /** + * {@inheritdoc} + */ + public function log($level, $message, array $context = []) + { + // Translate the RFC logging levels into their Drush counterparts, more or + // less. + // @todo ALERT, CRITICAL and EMERGENCY are considered show-stopping errors, + // and they should cause Drush to exit or panic. Not sure how to handle this, + // though. + switch ($level) { + case RfcLogLevel::ALERT: + case RfcLogLevel::CRITICAL: + case RfcLogLevel::EMERGENCY: + case RfcLogLevel::ERROR: + $error_type = LogLevel::ERROR; + break; + + case RfcLogLevel::WARNING: + $error_type = LogLevel::WARNING; + break; + + case RfcLogLevel::DEBUG: + $error_type = LogLevel::DEBUG; + break; + + case RfcLogLevel::INFO: + $error_type = LogLevel::INFO; + break; + + case RfcLogLevel::NOTICE: + $error_type = LogLevel::NOTICE; + break; + + // TODO: Unknown log levels that are not defined + // in Psr\Log\LogLevel or Drush\Log\LogLevel SHOULD NOT be used. See + // https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md + // We should convert these to 'notice'. + default: + $error_type = $level; + break; + } + + // Populate the message placeholders and then replace them in the message. + $message_placeholders = $this->parser->parseMessagePlaceholders($message, $context); + + // Filter out any placeholders that can not be cast to strings. + $message_placeholders = array_filter($message_placeholders, function ($element) { + return is_scalar($element) || is_callable([$element, '__toString']); + }); + + $message = empty($message_placeholders) ? $message : strtr($message, $message_placeholders); + + $this->logger->log($error_type, $message, $context); + } +} diff --git a/vendor/drush/drush/lib/Drush/Log/LogLevel.php b/vendor/drush/drush/src/Log/LogLevel.php similarity index 100% rename from vendor/drush/drush/lib/Drush/Log/LogLevel.php rename to vendor/drush/drush/src/Log/LogLevel.php diff --git a/vendor/drush/drush/src/Log/Logger.php b/vendor/drush/drush/src/Log/Logger.php new file mode 100644 index 0000000000000000000000000000000000000000..beb1bf636cff5fd6869f1957df1497954c18bfc9 --- /dev/null +++ b/vendor/drush/drush/src/Log/Logger.php @@ -0,0 +1,226 @@ +<?php + +/** + * @file + * Contains \Drush\Log\Logger. + * + * This is the actual Logger for Drush that is responsible + * for logging messages. + * + * This logger is designed such that it can be provided to + * other libraries that log to a Psr\Log\LoggerInterface. + * As such, it takes responsibility for passing log messages + * to backend invoke, as necessary (c.f. drush_backend_packet()). + * + * Drush supports all of the required log levels from Psr\Log\LogLevel, + * and also defines its own. See Drush\Log\LogLevel. + * + * Those who may wish to change the way logging works in Drush + * should therefore NOT attempt to replace this logger with their + * own LoggerInterface, as it will not work. It would be okay + * to extend Drush\Log\Logger, or perhaps we could provide a way + * to set an output I/O object here, in case output redirection + * was the only thing that needed to be swapped out. + */ + +namespace Drush\Log; + +use Drush\Drush; +use Drush\Log\LogLevel; +use Robo\Log\RoboLogger; +use Symfony\Component\Console\Output\OutputInterface; +use Drush\Utils\StringUtils; + +class Logger extends RoboLogger +{ + /** + * Array of logs. For use by backend responses. + * + * @var array + * + * @deprecated + */ + protected $logs = []; + + /** + * Array of error logs. For use by backend responses. + * + * @var array + * + * @deprecated + */ + protected $logs_error = []; + + public function __construct(OutputInterface $output) + { + parent::__construct($output); + } + + /** + * Get an array of logs for the current request. + * + * @return array + * + * @deprecated Used by drush_backend_output(). + */ + public function getLogs() + { + return $this->logs; + } + + /** + * Get an array of error logs for the current request. + * + * @return array + * + * @deprecated Used by drush_backend_output(). + */ + public function getErrorLogs() + { + return $this->logs_error; + } + + /** + * Empty log collections. + * + * @deprecated + */ + public function clearLogs() + { + $this->logs_error = $this->logs = []; + } + + public function log($level, $message, array $context = []) + { + $entry = $this->buildEntry($level, $message, $context); + + if (Drush::backend()) { + $this->logs[] = $entry; + } + + if ($level != LogLevel::DEBUG_NOTIFY) { + drush_backend_packet('log', $entry); + } + + if ($this->output->isDecorated()) { + $red = "\033[31;40m\033[1m[%s]\033[0m"; + $yellow = "\033[1;33;40m\033[1m[%s]\033[0m"; + $green = "\033[1;32;40m\033[1m[%s]\033[0m"; + } else { + $red = "[%s]"; + $yellow = "[%s]"; + $green = "[%s]"; + } + + $verbose = \Drush\Drush::verbose(); + $debug = Drush::debug(); + $debugnotify = drush_get_context('DRUSH_DEBUG_NOTIFY'); + + $oldStyleEarlyExit = drush_get_context('DRUSH_LEGACY_CONTEXT'); + + // Save the original level in the context name, then + // map it to a standard log level. + $context['name'] = $level; + switch ($level) { + case LogLevel::WARNING: + case LogLevel::CANCEL: + $type_msg = sprintf($yellow, $level); + $level = LogLevel::WARNING; + break; + case 'failed': // Obsolete; only here in case contrib is using it. + case LogLevel::EMERGENCY: // Not used by Drush + case LogLevel::ALERT: // Not used by Drush + case LogLevel::ERROR: + $type_msg = sprintf($red, $level); + break; + case LogLevel::OK: + case 'completed': // Obsolete; only here in case contrib is using it. + case LogLevel::SUCCESS: + case 'status': // Obsolete; only here in case contrib is using it. + // In quiet mode, suppress progress messages + if ($oldStyleEarlyExit && drush_get_context('DRUSH_QUIET')) { + return true; + } + $type_msg = sprintf($green, $level); + $level = LogLevel::NOTICE; + break; + case LogLevel::NOTICE: + $type_msg = sprintf("[%s]", $level); + break; + case 'message': // Obsolete; only here in case contrib is using it. + case LogLevel::INFO: + if ($oldStyleEarlyExit && !$verbose) { + // print nothing. exit cleanly. + return true; + } + $type_msg = sprintf("[%s]", $level); + $level = LogLevel::INFO; + break; + case LogLevel::DEBUG_NOTIFY: + $level = LogLevel::DEBUG; // Report 'debug', handle like 'preflight' + case LogLevel::PREFLIGHT: + if ($oldStyleEarlyExit && !$debugnotify) { + // print nothing unless --debug AND --verbose. exit cleanly. + return true; + } + $type_msg = sprintf("[%s]", $level); + $level = LogLevel::DEBUG; + break; + case LogLevel::BOOTSTRAP: + case LogLevel::DEBUG: + default: + if ($oldStyleEarlyExit && !$debug) { + // print nothing. exit cleanly. + return true; + } + $type_msg = sprintf("[%s]", $level); + $level = LogLevel::DEBUG; + break; + } + + // When running in backend mode, log messages are not displayed, as they will + // be returned in the JSON encoded associative array. + if (\Drush\Drush::backend()) { + return; + } + + $columns = drush_get_context('DRUSH_COLUMNS', 80); + + $width[1] = 11; + // Append timer and memory values. + if ($debug) { + $timer = sprintf('[%s sec, %s]', round($entry['timestamp']-DRUSH_REQUEST_TIME, 2), drush_format_size($entry['memory'])); + $entry['message'] = $entry['message'] . ' ' . $timer; + $message = $message . ' ' . $timer; + } + + // Robo-styled output + parent::log($level, $message, $context); + } + + public function error($message, array $context = []) + { + if (Drush::backend()) { + $this->logs_error[] = $this->buildEntry(LogLevel::ERROR, $message, $context); + } + parent::error($message, $context); + } + + /** + * @param $level + * @param $message + * @param array $context + * @return array + */ + protected function buildEntry($level, $message, array $context) + { + // Convert to old $entry array for b/c calls + $entry = $context + [ + 'type' => $level, + 'message' => StringUtils::interpolate($message, $context), + 'timestamp' => microtime(true), + 'memory' => memory_get_usage(), + ]; + return $entry; + } +} diff --git a/vendor/drush/drush/src/Preflight/ArgsPreprocessor.php b/vendor/drush/drush/src/Preflight/ArgsPreprocessor.php new file mode 100644 index 0000000000000000000000000000000000000000..b9ecaf1f763358e3b34f285b59f11310315422c0 --- /dev/null +++ b/vendor/drush/drush/src/Preflight/ArgsPreprocessor.php @@ -0,0 +1,207 @@ +<?php +namespace Drush\Preflight; + +use Consolidation\SiteAlias\SiteAliasName; +use Consolidation\SiteAlias\SiteSpecParser; + +/** + * Preprocess commandline arguments. + * + * - Record @sitealias, if present + * - Record a limited number of global options + * + * Anything not handled here is processed by Symfony Console. + */ +class ArgsPreprocessor +{ + /** @var SiteSpecParser */ + protected $specParser; + /** @var ArgsRemapper */ + protected $remapper; + + /** + * ArgsPreprocessor constructor + */ + public function __construct() + { + $this->specParser = new SiteSpecParser(); + } + + public function setArgsRemapper(ArgsRemapper $remapper) + { + $this->remapper = $remapper; + } + + /** + * Parse the argv array. + * + * @param string[] $argv + * Commandline arguments. The first element is + * the path to the application, which we will ignore. + * @param PreflightArgsInterface $storage + * A storage object to hold the arguments we remove + * from argv, plus the remaining argv arguments. + */ + public function parse($argv, PreflightArgsInterface $storage) + { + $sawArg = false; + + // Pull off the path to application. Add it to the + // 'unprocessed' args list. + $appName = array_shift($argv); + $storage->addArg($appName); + + if ($this->remapper) { + $argv = $this->remapper->remap($argv); + } + + $optionsTable = $storage->optionsWithValues(); + while (!empty($argv)) { + $opt = array_shift($argv); + + if ($opt == '--') { + $storage->addArg($opt); + return $storage->passArgs($argv); + } + + if (!$sawArg && !$storage->hasAlias() && $this->isAliasOrSiteSpec($opt)) { + $storage->setAlias($opt); + continue; + } + + if ($opt[0] != '-') { + if (!$sawArg) { + $storage->setCommandName($opt); + } + $sawArg = true; + } + + list($methodName, $value, $acceptsValueFromNextArg) = $this->findMethodForOptionWithValues($optionsTable, $opt); + if ($methodName) { + if (!isset($value) && $acceptsValueFromNextArg && static::nextCouldBeValue($argv)) { + $value = array_shift($argv); + } + $method = [$storage, $methodName]; + call_user_func($method, $value); + } else { + $storage->addArg($opt); + } + } + return $storage; + } + + /** + * nextCouldBeValue determines whether there is a next argument that + * exists and does not begin with a `-`. + */ + protected static function nextCouldBeValue($argv) + { + if (empty($argv)) { + return false; + } + return $argv[0][0] != '-'; + } + + /** + * Determine whether the provided argument is an alias or + * a site specification. + * + * @param string $arg + * Argument to test. + * @return bool + */ + protected function isAliasOrSiteSpec($arg) + { + if (SiteAliasName::isAliasName($arg)) { + return true; + } + return $this->specParser->validSiteSpec($arg); + } + + /** + * Check to see if '$opt' is one of the options that we record + * that takes a value. + * + * @param $optionsTable Table of option names and the name of the + * method that should be called to process that option. + * @param $opt The option string to check + * @return [$methodName, $optionValue, $acceptsValueFromNextArg] + */ + protected function findMethodForOptionWithValues($optionsTable, $opt) + { + // Skip $opt if it is empty, or if it is not an option. + if (empty($opt) || ($opt[0] != '-')) { + return [false, false, false]; + } + + // Check each entry in the option table in turn; return as soon + // as there is a match. + foreach ($optionsTable as $key => $methodName) { + $result = $this->checkMatchingOption($opt, $key, $methodName); + if ($result[0]) { + return $result; + } + } + + return [false, false, false]; + } + + /** + * Check to see if the provided option matches the entry from the + * option table. + * + * @param $opt The option string to check + * @param $key The key to test against. Must always start with '-' or + * '--'. If $key ends with '=', then the option must have a value. + * Otherwise, it cannot be supplied with a value, and always defaults + * to 'true'. + * @return [$methodName, $optionValue, $acceptsValueFromNextArg] + */ + protected function checkMatchingOption($opt, $keyParam, $methodName) + { + // Test to see if $key ends in '='; remove the character if present. + // If the char is removed, it means the option accepts a value. + $key = rtrim($keyParam, '=~'); + $acceptsValue = $key != $keyParam; + $acceptsValueFromNextArg = $keyParam[strlen($keyParam) - 1] != '~'; + + // If $opt does not begin with $key, then it cannot be a match. + if ($key != substr($opt, 0, strlen($key))) { + return [false, false, false]; + } + + // If $key and $opt are exact matches, then return a positive result. + // The returned $optionValue will be 'null' if the option requires + // a value; in this case, the value will be provided from the next + // argument in the calling function. If this option does not take a + // supplied value, then we set its value to 'true' + if (strlen($key) == strlen($opt)) { + return [$methodName, $acceptsValue ? null: true, $acceptsValueFromNextArg]; + } + + // If the option is not an exact match for the key, then the next + // character in the option after the key name must be an '='. Otherwise, + // we might confuse `--locale` for `--local`, etc. + if ($opt[strlen($key)] != '=') { + return [false, false, false]; + } + + // If $opt does not take a value, then we will ignore + // of the form --opt=value + if (!$acceptsValue) { + // TODO: We could fail with "The "--foo" option does not accept a value." here. + // It is important that we ignore the value for '--backend', but other options could throw. + // For now, we just ignore the value if it is there. This only affects --simulate and --local at the moment. + return [$methodName, true, $acceptsValueFromNextArg]; + } + + // If $opt is a double-dash option, and it contains an '=', then + // the option value is everything after the '='. + if ((strlen($key) < strlen($opt)) && ($opt[1] == '-') && ($opt[strlen($key)] == '=')) { + $value = substr($opt, strlen($key) + 1); + return [$methodName, $value, false]; + } + + return [false, false, $acceptsValueFromNextArg]; + } +} diff --git a/vendor/drush/drush/src/Preflight/ArgsRemapper.php b/vendor/drush/drush/src/Preflight/ArgsRemapper.php new file mode 100644 index 0000000000000000000000000000000000000000..d5abca8452bac99895bbabc87ffd1a9d36b787ea --- /dev/null +++ b/vendor/drush/drush/src/Preflight/ArgsRemapper.php @@ -0,0 +1,97 @@ +<?php +namespace Drush\Preflight; + +/** + * Map commandline arguments from one value to another during preflight. + */ +class ArgsRemapper +{ + protected $remapOptions; + protected $remapCommandAliases; + + /** + * ArgsRemapper constructor + */ + public function __construct($remapOptions, $remapCommandAliases) + { + $this->remapOptions = $remapOptions; + $this->remapCommandAliases = $remapCommandAliases; + } + + /** + * Given an $argv array, apply all remap operations on each item + * within it. + * + * @param string[] $argv + */ + public function remap($argv) + { + $result = []; + $sawCommand = false; + foreach ($argv as $arg) { + $arg = $this->checkRemap($arg, $sawCommand); + if (isset($arg)) { + $result[] = $arg; + } + } + return $result; + } + + /** + * Check to see if the provided single arg needs to be remapped. If + * it does, then the remapping is performed. + * + * @param string $arg One argument to inspect + * @param string $sawCommand True if drush command was found + * @return string The altered argument + */ + protected function checkRemap($arg, &$sawCommand) + { + if (!$sawCommand && ctype_alpha($arg[0])) { + $sawCommand = true; + return $this->remapCommandAlias($arg); + } + return $this->remapOptions($arg); + } + + protected function remapOptions($arg) + { + foreach ($this->remapOptions as $from => $to) { + if ($this->matches($arg, $from)) { + return $to . substr($arg, strlen($from)); + } + } + return $arg; + } + + protected function remapCommandAlias($arg) + { + foreach ($this->remapCommandAliases as $from => $to) { + if ($arg == $from) { + return $to; + } + } + return $arg; + } + + /** + * Check to see if the provided single arg matches the candidate. + * If the candidate is `--foo`, then we will match the exact string + * `--foo`, or the leading substring `--foo=`, and nothing else. + * @param string $arg + * @param string $candidate + * @return bool + */ + protected function matches($arg, $candidate) + { + if (strpos($arg, $candidate) !== 0) { + return false; + } + + if (strlen($arg) == strlen($candidate)) { + return true; + } + + return $arg[strlen($candidate)] == '='; + } +} diff --git a/vendor/drush/drush/src/Preflight/LegacyPreflight.php b/vendor/drush/drush/src/Preflight/LegacyPreflight.php new file mode 100644 index 0000000000000000000000000000000000000000..3d7c920d05b77eb22a2d782366b816fbb9b7ca31 --- /dev/null +++ b/vendor/drush/drush/src/Preflight/LegacyPreflight.php @@ -0,0 +1,148 @@ +<?php +namespace Drush\Preflight; + +use Drush\Drush; +use Drush\Config\Environment; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Webmozart\PathUtil\Path; + +/** + * Prepare to bootstrap Drupal + * + * - Determine the site to use + * - Set up the DI container + * - Start the bootstrap process + */ +class LegacyPreflight +{ + /** + * Define legacy constants. + */ + public static function defineConstants(Environment $environment, $applicationPath) + { + // 'define' is undesirable in that it will error if the same identifier + // is defined more than once. Ideally we would inject the legacy preflight + // object into the Preflight class, and wherever else it was needed, + // and omit it for the integration tests. This is probably not practicable + // at the moment, though. + if (defined('DRUSH_REQUEST_TIME')) { + return; + } + + $applicationPath = Path::makeAbsolute($applicationPath, $environment->cwd()); + + define('DRUSH_REQUEST_TIME', microtime(true)); + + /* + * @deprecated. Use $config->get('drush.base-dir') instead. + */ + define('DRUSH_BASE_PATH', $environment->drushBasePath()); + + /* + * @deprecated. Use Drush::getVersion(). + */ + define('DRUSH_VERSION', Drush::getVersion()); + + /* + * @deprecated. Use Drush::getMajorVersion(). + */ + define('DRUSH_MAJOR_VERSION', Drush::getMajorVersion()); + + /* + * @deprecated. Use Drush::getMinorVersion(). + */ + define('DRUSH_MINOR_VERSION', Drush::getMinorVersion()); + + /* + * @deprecated. + */ + define('DRUSH_COMMAND', $applicationPath); + + /* + * @deprecated. Use $config->cwd() instead. + */ + drush_set_context('DRUSH_OLDCWD', $environment->cwd()); + + /* + * @deprecated. Do not use + */ + drush_set_context('argc', $GLOBALS['argc']); + drush_set_context('argv', $GLOBALS['argv']); + + /* + * @deprecated. Use $config->get('drush.vendor-dir') instead. + */ + drush_set_context('DRUSH_VENDOR_PATH', $environment->vendorPath()); + } + + public static function setContexts(Environment $environment) + { + /* + * Obsolete. Presumed to be unnecessary; available in Environment if needed + * (just add a getter method). + */ + // drush_set_context('ETC_PREFIX', $environment->...); + // drush_set_context('SHARE_PREFIX', $environment->...); + + /* + * @deprecated. Use $config->get('drush.docs-dir') instead. + */ + drush_set_context('DRUSH_BASE_PATH', $environment->docsPath()); + + /* + * @deprecated. Use $config->get('drush.system-dir') instead. + */ + drush_set_context('DRUSH_SITE_WIDE_CONFIGURATION', $environment->systemConfigPath()); + + /* + * @deprecated. Use $config->get('drush.system-command-dir') instead. + */ + drush_set_context('DRUSH_SITE_WIDE_COMMANDFILES', $environment->systemCommandFilePath()); + + /* + * @deprecated. Use $config->get('drush.user-dir') instead. + */ + drush_set_context('DRUSH_PER_USER_CONFIGURATION', $environment->userConfigPath()); + } + + public static function setGlobalOptionContexts(InputInterface $input, OutputInterface $output) + { + $verbose = $output->isVerbose(); + $debug = $output->isDebug(); + $quiet = $input->getOption('quiet', false); + $pipe = $input->getOption('pipe', false); + $simulate = Drush::simulate(); + + drush_set_context('DRUSH_VERBOSE', $verbose || $debug); + drush_set_context('DRUSH_DEBUG', $debug); + drush_set_context('DRUSH_DEBUG_NOTIFY', $verbose && $debug); + drush_set_context('DRUSH_SIMULATE', $simulate); + + // Pipe implies quiet. + drush_set_context('DRUSH_QUIET', $quiet || $pipe); + } + + /** + * Include old code. It is an aspirational goal to remove or refactor + * all of this into more modular, class-based code. + */ + public static function includeCode($drushBasePath) + { + // We still need preflight for drush_shutdown() + require_once $drushBasePath . '/includes/preflight.inc'; + require_once $drushBasePath . '/includes/bootstrap.inc'; + require_once $drushBasePath . '/includes/environment.inc'; + require_once $drushBasePath . '/includes/command.inc'; + require_once $drushBasePath . '/includes/drush.inc'; + require_once $drushBasePath . '/includes/backend.inc'; + require_once $drushBasePath . '/includes/batch.inc'; + require_once $drushBasePath . '/includes/context.inc'; + require_once $drushBasePath . '/includes/sitealias.inc'; + require_once $drushBasePath . '/includes/exec.inc'; + require_once $drushBasePath . '/includes/drupal.inc'; + require_once $drushBasePath . '/includes/output.inc'; + require_once $drushBasePath . '/includes/cache.inc'; + require_once $drushBasePath . '/includes/filesystem.inc'; + } +} diff --git a/vendor/drush/drush/src/Preflight/Preflight.php b/vendor/drush/drush/src/Preflight/Preflight.php new file mode 100644 index 0000000000000000000000000000000000000000..e8901d00dc8936ff8539cbb63d1ca92b3e7e3fc8 --- /dev/null +++ b/vendor/drush/drush/src/Preflight/Preflight.php @@ -0,0 +1,394 @@ +<?php +namespace Drush\Preflight; + +use Drush\Config\Environment; +use Drush\Config\ConfigLocator; +use Drush\Config\EnvironmentConfigLoader; +use Consolidation\SiteAlias\SiteAliasManager; +use DrupalFinder\DrupalFinder; + +/** + * The Drush preflight determines what needs to be done for this request. + * The preflight happens after Drush has loaded its autoload file, but + * prior to loading Drupal's autoload file and setting up the DI container. + * + * - Pre-parse commandline arguments + * - Read configuration .yml files + * - Determine the site to use + */ +class Preflight +{ + /** + * @var Environment $environment + */ + protected $environment; + + /** + * @var PreflightVerify + */ + protected $verify; + + /** + * @var ConfigLocator + */ + protected $configLocator; + + /** + * @var DrupalFinder + */ + protected $drupalFinder; + + /** + * @var PreflightArgs + */ + protected $preflightArgs; + + /** + * @var SiteAliasManager + */ + protected $aliasManager; + + /** + * @var PreflightLog $logger An early logger, just for Preflight. + */ + protected $logger; + + /** + * Preflight constructor + */ + public function __construct(Environment $environment, $verify = null, $configLocator = null, $preflightLog = null) + { + $this->environment = $environment; + $this->verify = $verify ?: new PreflightVerify(); + $this->configLocator = $configLocator ?: new ConfigLocator('DRUSH_', $environment->getConfigFileVariant()); + $this->drupalFinder = new DrupalFinder(); + $this->logger = $preflightLog ?: new PreflightLog(); + } + + /** + * @return PreflightLog + */ + public function logger() + { + return $this->logger; + } + + /** + * @param PreflightLog $logger + */ + public function setLogger(PreflightLog $logger) + { + $this->logger = $logger; + } + + /** + * Perform preliminary initialization. This mostly involves setting up + * legacy systems. + */ + public function init() + { + // Define legacy constants, and include legacy files that Drush still needs + LegacyPreflight::includeCode($this->environment->drushBasePath()); + LegacyPreflight::defineConstants($this->environment, $this->preflightArgs->applicationPath()); + LegacyPreflight::setContexts($this->environment); + } + + /** + * Remapping table for arguments. Anything found in a key + * here will be converted to the corresponding value entry. + * + * For example: + * --ssh-options='-i mysite_dsa' + * will become: + * -Dssh.options='-i mysite_dsa' + * + * TODO: We could consider loading this from a file or some other + * source. However, this table is needed very early -- even earlier + * than config is loaded (since this is needed for preflighting the + * arguments, which can select config files to load). Hardcoding + * is probably best; we might want to move to another class, perhaps. + * We also need this prior to Dependency Injection, though. + * + * Eventually, we might want to expose this table to some form of + * 'help' output, so folks can see the available conversions. + */ + protected function remapOptions() + { + return [ + '--ssh-options' => '-Dssh.options', + '--php' => '-Druntime.php.path', + '--php-options' => '-Druntime.php.options', + '--php-notices' => '-Druntime.php.notices', + '--halt-on-error' => '-Druntime.php.halt-on-error', + '--output_charset' => '-Dio.output.charset', + '--output-charset' => '-Dio.output.charset', + '--notify' => '-Dnotify.duration', + '--xh-link' => '-Dxh.link', + ]; + } + + /** + * Symfony Console dislikes certain command aliases, because + * they are too similar to other Drush commands that contain + * the same characters. To avoid the "I don't know which + * command you mean"-type errors, we will replace problematic + * aliases with their longhand equivalents. + * + * This should be fixed in Symfony Console. + */ + protected function remapCommandAliases() + { + return [ + 'si' => 'site:install', + 'en' => 'pm:enable', + // php was an alias for core-cli which got renamed to php-cli. See https://github.com/drush-ops/drush/issues/3091. + 'php' => 'php:cli', + ]; + } + + /** + * Preprocess the args, removing any @sitealias that may be present. + * Arguments and options not used during preflight will be processed + * with an ArgvInput. + */ + public function preflightArgs($argv) + { + $argProcessor = new ArgsPreprocessor(); + $remapper = new ArgsRemapper($this->remapOptions(), $this->remapCommandAliases()); + $preflightArgs = new PreflightArgs(); + $preflightArgs->setHomeDir($this->environment()->homeDir()); + $argProcessor->setArgsRemapper($remapper); + + $argProcessor->parse($argv, $preflightArgs); + + return $preflightArgs; + } + + /** + * Create the initial config locator object, and inject any needed + * settings, paths and so on into it. + */ + public function prepareConfig(Environment $environment) + { + // Make our environment settings available as configuration items + $this->configLocator->addEnvironment($environment); + $this->configLocator->setLocal($this->preflightArgs->isLocal()); + $this->configLocator->addUserConfig($this->preflightArgs->configPaths(), $environment->systemConfigPath(), $environment->userConfigPath()); + $this->configLocator->addDrushConfig($environment->drushBasePath()); + } + + /** + * Start code coverage collection + */ + public function startCoverage() + { + if ($coverage_file = $this->preflightArgs->coverageFile()) { + // TODO: modernize code coverage handling + drush_set_context('DRUSH_CODE_COVERAGE', $coverage_file); + xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); + register_shutdown_function('drush_coverage_shutdown'); + } + } + + public function createInput() + { + return $this->preflightArgs->createInput(); + } + + public function getCommandFilePaths() + { + $commandlinePaths = $this->preflightArgs->commandPaths(); + $configPaths = $this->config()->get('drush.include', []); + + // Find all of the available commandfiles, save for those that are + // provided by modules in the selected site; those will be added + // during bootstrap. + return $this->configLocator->getCommandFilePaths(array_merge($commandlinePaths, $configPaths), $this->drupalFinder()->getDrupalRoot()); + } + + public function loadSiteAutoloader() + { + return $this->environment()->loadSiteAutoloader($this->drupalFinder()->getDrupalRoot()); + } + + public function config() + { + return $this->configLocator->config(); + } + + /** + * @param $argv + * @return bool + * True if the request was successfully redispatched remotely. False if the request should proceed. + */ + public function preflight($argv) + { + // Fail fast if there is anything in our environment that does not check out + $this->verify->verify($this->environment); + + // Get the preflight args and begin collecting configuration files. + $this->preflightArgs = $this->preflightArgs($argv); + $this->prepareConfig($this->environment); + + // Now that we know the value, set debug flag. + $this->logger()->setDebug($this->preflightArgs->get(PreflightArgs::DEBUG)); + + // Do legacy initialization (load static includes, define old constants, etc.) + $this->init(); + + // Start code coverage + $this->startCoverage(); + + // Get the config files provided by prepareConfig() + $config = $this->config(); + + // Copy items from the preflight args into configuration. + // This will also load certain config values into the preflight args. + $this->preflightArgs->applyToConfig($config); + + // Determine the local site targeted, if any. + // Extend configuration and alias files to include files in + // target site. + $root = $this->findSelectedSite(); + $this->configLocator->addSitewideConfig($root); + $this->configLocator->setComposerRoot($this->drupalFinder()->getComposerRoot()); + + // Look up the locations where alias files may be found. + $paths = $this->configLocator->getSiteAliasPaths($this->preflightArgs->aliasPaths(), $this->environment); + + // Configure alias manager. + $aliasFileLoader = new \Drush\SiteAlias\SiteAliasFileLoader(); + $this->aliasManager = (new SiteAliasManager($aliasFileLoader))->addSearchLocations($paths); + $this->aliasManager->setReferenceData($config->export()); + + // Find the local site + $siteLocator = new PreflightSiteLocator($this->aliasManager); + $selfSiteAlias = $siteLocator->findSite($this->preflightArgs, $this->environment, $root); + + // If we did not find a local site, then we are destined to fail + // UNLESS RedispatchToSiteLocal::redispatchIfSiteLocalDrush takes over. + // Before we try to redispatch to the site-local Drush, though, we must + // initialize the alias manager & c. based on any alias record we did find. + if ($selfSiteAlias) { + $this->aliasManager->setSelf($selfSiteAlias); + $this->configLocator->addAliasConfig($selfSiteAlias->exportConfig()); + + // Process the selected alias. This might change the selected site, + // so we will add new site-wide config location for the new root. + $root = $this->setSelectedSite($selfSiteAlias->localRoot(), false, $root); + } + + // Now that we have our final Drupal root, check to see if there is + // a site-local Drush. If there is, we will redispatch to it. + // NOTE: termination handlers have not been set yet, so it is okay + // to exit early without taking special action. + $status = RedispatchToSiteLocal::redispatchIfSiteLocalDrush($argv, $root, $this->environment->vendorPath(), $this->logger()); + if ($status !== false) { + return $status; + } + + // If the site locator couldn't find a local site, and we did not + // redispatch to a site-local Drush, then we cannot continue. + // This can happen when using Drush 9 to call a site-local Drush 8 + // using an alias record that is only defined in a Drush 8 format. + if (!$selfSiteAlias) { + // Note that PreflightSiteLocator::findSite only returns 'false' + // when preflightArgs->alias() returns an alias name. In all other + // instances we will get an alias record, even if it is only a + // placeholder 'self' with the root holding the cwd. + $aliasName = $this->preflightArgs->alias(); + throw new \Exception("The alias $aliasName could not be found."); + } + + // If we did not redispatch, then add the site-wide config for the + // new root (if the root did in fact change) and continue. + $this->configLocator->addSitewideConfig($root); + + // Remember the paths to all the files we loaded, so that we can + // report on it from Drush status or wherever else it may be needed. + $configFilePaths = $this->configLocator->configFilePaths(); + $config->set('runtime.config.paths', $configFilePaths); + $this->logger()->log(dt('Config paths: ' . implode(',', $configFilePaths))); + $this->logger()->log(dt('Alias paths: ' . implode(',', $paths))); + + // We need to check the php minimum version again, in case anyone + // has set it to something higher in one of the config files we loaded. + $this->verify->confirmPhpVersion($config->get('drush.php.minimum-version')); + + return false; + } + + /** + * Find the site the user selected based on --root or cwd. If neither of + * those result in a site, then we will fall back to the vendor path. + */ + protected function findSelectedSite() + { + // TODO: If we want to support ONLY site-local Drush (which is + // DIFFERENT than --local), then skip the call to `$preflightArgs->selectedSite` + // and just assign `false` to $selectedRoot. + + // Try two approaches. + $selectedRoot = $this->preflightArgs->selectedSite($this->environment->cwd()); + $fallBackPath = $this->preflightArgs->selectedSite(DRUSH_COMMAND); + return $this->setSelectedSite($selectedRoot, $fallBackPath); + } + + /** + * Use the DrupalFinder to locate the Drupal Root + Composer Root at + * the selected root, or, if nothing is found there, at a fallback path. + * + * @param string $selectedRoot The location to being searching for a site + * @param string|bool $fallbackPath The secondary location to search (usualy the vendor director) + */ + protected function setSelectedSite($selectedRoot, $fallbackPath = false, $originalSelection = null) + { + if ($selectedRoot || $fallbackPath) { + $foundRoot = $this->drupalFinder->locateRoot($selectedRoot); + // If we did not find a site at the selected root, check the + // PARENT directory of the fallback path. This will find a site + // that Drush is installed in while avoiding the SUT. + if (!$foundRoot && $fallbackPath) { + $foundRoot = $this->drupalFinder->locateRoot(dirname(dirname($fallbackPath))); + } + // If we can't find a site that Drush is installed in, and + // Drush has been installed with a sut (git or composer dev install), + // then look for the sut. + if (!$foundRoot && $fallbackPath && is_dir($fallbackPath . '/sut') && is_dir($fallbackPath . '/vendor')) { + $foundRoot = $this->drupalFinder->locateRoot($fallbackPath); + } + return $this->drupalFinder()->getDrupalRoot(); + } + return $originalSelection; + } + + /** + * Return the Drupal Finder + * + * @return DrupalFinder + */ + public function drupalFinder() + { + return $this->drupalFinder; + } + + /** + * Return the alias manager + * + * @return SiteAliasManager + */ + public function aliasManager() + { + return $this->aliasManager; + } + + /** + * Return the environment + * + * @return Environment + */ + public function environment() + { + return $this->environment; + } +} diff --git a/vendor/drush/drush/src/Preflight/PreflightArgs.php b/vendor/drush/drush/src/Preflight/PreflightArgs.php new file mode 100644 index 0000000000000000000000000000000000000000..52aeeeec1d9591ab51c8be5bf199e2de793e6bef --- /dev/null +++ b/vendor/drush/drush/src/Preflight/PreflightArgs.php @@ -0,0 +1,601 @@ +<?php +namespace Drush\Preflight; + +use Consolidation\Config\Config; +use Consolidation\Config\ConfigInterface; + +use Drush\Symfony\DrushArgvInput; +use Drush\Utils\StringUtils; +use Drush\Symfony\LessStrictArgvInput; + +/** + * Storage for arguments preprocessed during preflight. + * + * Holds @sitealias, if present, and a limited number of global options. + * + * TODO: The methods here with >~3 lines of logic could be refactored into a couple + * of different classes e.g. a helper to convert preflight args to configuration, + * and another to prepare the input object. + */ +class PreflightArgs extends Config implements PreflightArgsInterface +{ + /** + * @var array $args Remaining arguments not handled by the preprocessor + */ + protected $args; + + /** + * @var string $homeDir Path to directory to use when replacing ~ in paths + */ + protected $homeDir; + + protected $commandName; + + /** + * @return string + */ + public function homeDir() + { + return $this->homeDir; + } + + /** + * @param string $homeDir + */ + public function setHomeDir($homeDir) + { + $this->homeDir = $homeDir; + } + + const DRUSH_CONFIG_PATH_NAMESPACE = 'drush.paths'; + const DRUSH_RUNTIME_CONTEXT_NAMESPACE = 'runtime.contxt'; + const ALIAS = 'alias'; + const ALIAS_PATH = 'alias-path'; + const COMMAND_PATH = 'include'; + const CONFIG_PATH = 'config'; + const COVERAGE_FILE = 'coverage-file'; + const LOCAL = 'local'; + const ROOT = 'root'; + const URI = 'uri'; + const SIMULATE = 'simulate'; + const BACKEND = 'backend'; + const STRICT = 'strict'; + const DEBUG = 'preflight-debug'; + + /** + * PreflightArgs constructor + * + * @param array $data Initial data (not usually used) + */ + public function __construct($data = []) + { + parent::__construct($data + [self::STRICT => true]); + } + + /** + * @inheritdoc + */ + public function optionsWithValues() + { + return [ + '-r=' => 'setSelectedSite', + '--root=' => 'setSelectedSite', + '--debug' => 'setDebug', + '-d' => 'setDebug', + '-vv' => 'setDebug', + '-vvv' => 'setDebug', + '-l=' => 'setUri', + '--uri=' => 'setUri', + '-c=' => 'addConfigPath', + '--config=' => 'addConfigPath', + '--alias-path=' => 'addAliasPath', + '--include=' => 'addCommandPath', + '--local' => 'setLocal', + '--simulate' => 'setSimulate', + '-s' => 'setSimulate', + '--backend=' => 'setBackend', + '--drush-coverage=' => 'setCoverageFile', + '--strict=' => 'setStrict', + '--help' => 'adjustHelpOption', + '-h' => 'adjustHelpOption', + ]; + } + + /** + * If the user enters '--help' or '-h', thrown that + * option away and add a 'help' command to the beginning + * of the argument list. + */ + public function adjustHelpOption() + { + $drushPath = array_shift($this->args); + array_unshift($this->args, $drushPath, 'help'); + } + + /** + * Map of option key to the corresponding config key to store the + * preflight option in. The values of the config items in this map + * must be BOOLEANS or STRINGS. + */ + protected function optionConfigMap() + { + return [ + self::SIMULATE => \Robo\Config\Config::SIMULATE, + self::BACKEND => self::BACKEND, + self::LOCAL => self::DRUSH_RUNTIME_CONTEXT_NAMESPACE . '.' . self::LOCAL, + ]; + } + + /** + * Map of path option keys to the corresponding config key to store the + * preflight option in. The values of the items in this map must be + * STRINGS or ARRAYS OF STRINGS. + */ + protected function optionConfigPathMap() + { + return [ + self::ALIAS_PATH => self::DRUSH_CONFIG_PATH_NAMESPACE . '.' . self::ALIAS_PATH, + self::CONFIG_PATH => self::DRUSH_CONFIG_PATH_NAMESPACE . '.' . self::CONFIG_PATH, + self::COMMAND_PATH => self::DRUSH_CONFIG_PATH_NAMESPACE . '.' . self::COMMAND_PATH, + ]; + } + + /** + * @inheritdoc + * + * @see Environment::exportConfigData(), which also exports information to config. + */ + public function applyToConfig(ConfigInterface $config) + { + // Copy the relevant preflight options to the applicable configuration namespace + foreach ($this->optionConfigMap() as $option_key => $config_key) { + $config->set($config_key, $this->get($option_key)); + } + // Merging as they are lists. + foreach ($this->optionConfigPathMap() as $option_key => $config_key) { + $cli_paths = $this->get($option_key, []); + $config_paths = (array) $config->get($config_key, []); + + $merged_paths = array_unique(array_merge($cli_paths, $config_paths)); + $config->set($config_key, $merged_paths); + $this->set($option_key, $merged_paths); + } + + // Store the runtime arguments and options (sans the runtime context items) + // in runtime.argv et. al. + $config->set('runtime.drush-script', $this->applicationPath()); + $config->set('runtime.command', $this->commandName() ?: 'help'); + $config->set('runtime.argv', $this->args()); + $config->set('runtime.options', $this->getOptionNameList($this->args())); + } + + /** + * @inheritdoc + */ + public function args() + { + return $this->args; + } + + /** + * @inheritdoc + */ + public function applicationPath() + { + return realpath(reset($this->args)); + } + + /** + * @inheritdoc + */ + public function commandName() + { + return $this->commandName; + } + + /** + * @inheritdoc + */ + public function setCommandName($commandName) + { + $this->commandName = $commandName; + } + /** + * @inheritdoc + */ + public function addArg($arg) + { + $this->args[] = $arg; + return $this; + } + + /** + * @inheritdoc + */ + public function passArgs($args) + { + $this->args = array_merge($this->args, $args); + return $this; + } + + /** + * @inheritdoc + */ + public function alias() + { + return $this->get(self::ALIAS); + } + + /** + * @inheritdoc + */ + public function hasAlias() + { + return $this->has(self::ALIAS); + } + + /** + * @inheritdoc + */ + public function setAlias($alias) + { + // Treat `drush @self ...` as if an alias had not been used at all. + if ($alias == '@self') { + $alias = ''; + } + return $this->set(self::ALIAS, $alias); + } + + /** + * Get the selected site. Here, the default will typically be the cwd. + */ + public function selectedSite($default = false) + { + return $this->get(self::ROOT, $default); + } + + public function setDebug($value) + { + $this->set(self::DEBUG, $value); + $this->addArg('-vvv'); + } + + /** + * Set the selected site. + */ + public function setSelectedSite($root) + { + return $this->set(self::ROOT, StringUtils::replaceTilde($root, $this->homeDir())); + } + + /** + * Get the selected uri + */ + public function uri($default = false) + { + return $this->get(self::URI, $default); + } + + public function hasUri() + { + return $this->has(self::URI); + } + + /** + * Set the uri option + */ + public function setUri($uri) + { + return $this->set(self::URI, $uri); + } + + /** + * Get the config path where drush.yml files may be found + */ + public function configPaths() + { + return $this->get(self::CONFIG_PATH, []); + } + + /** + * Add another location where drush.yml files may be found + * + * @param string $path + */ + public function addConfigPath($path) + { + $paths = $this->configPaths(); + $paths[] = StringUtils::replaceTilde($path, $this->homeDir()); + return $this->set(self::CONFIG_PATH, $paths); + } + + /** + * Add multiple additional locations where drush.yml files may be found. + * + * @param string[] $configPaths + */ + public function mergeConfigPaths($configPaths) + { + $paths = $this->configPaths(); + $merged_paths = array_merge($paths, $configPaths); + return $this->set(self::CONFIG_PATH, $merged_paths); + } + + /** + * Get the alias paths where drush site.site.yml files may be found + */ + public function aliasPaths() + { + return $this->get(self::ALIAS_PATH, []); + } + + /** + * Set one more path where aliases may be found. + * + * @param string $path + */ + public function addAliasPath($path) + { + $paths = $this->aliasPaths(); + $paths[] = StringUtils::replaceTilde($path, $this->homeDir()); + return $this->set(self::ALIAS_PATH, $paths); + } + + /** + * Add multiple additional locations for alias paths. + * + * @param string $aliasPaths + */ + public function mergeAliasPaths($aliasPaths) + { + $aliasPaths = array_map( + function ($item) { + return StringUtils::replaceTilde($item, $this->homeDir()); + }, + $aliasPaths + ); + $paths = $this->aliasPaths(); + $merged_paths = array_merge($paths, $aliasPaths); + return $this->set(self::ALIAS_PATH, $merged_paths); + } + + /** + * Get the path where Drush commandfiles e.g. FooCommands.php may be found. + */ + public function commandPaths() + { + return $this->get(self::COMMAND_PATH, []); + } + + /** + * Add one more path where commandfiles might be found. + * + * @param string $path + */ + public function addCommandPath($path) + { + $paths = $this->commandPaths(); + $paths[] = StringUtils::replaceTilde($path, $this->homeDir()); + return $this->set(self::COMMAND_PATH, $paths); + } + + /** + * Add multiple paths where commandfiles might be found. + * + * @param $commanPaths + */ + public function mergeCommandPaths($commandPaths) + { + $paths = $this->commandPaths(); + $merged_paths = array_merge($paths, $commandPaths); + return $this->set(self::COMMAND_PATH, $merged_paths); + } + + /** + * Determine whether Drush is in "local" mode + */ + public function isLocal() + { + return $this->get(self::LOCAL); + } + + /** + * Set local mode + * + * @param bool $isLocal + */ + public function setLocal($isLocal) + { + return $this->set(self::LOCAL, $isLocal); + } + + /** + * Determine whether Drush is in "simulated" mode. + */ + public function isSimulated() + { + return $this->get(self::SIMULATE); + } + + /** + * Set simulated mode + * + * @param bool $simulated + */ + public function setSimulate($simulate) + { + return $this->set(self::SIMULATE, $simulate); + } + + /** + * Determine whether Drush was placed in simulated mode. + */ + public function isBackend() + { + return $this->get(self::BACKEND); + } + + /** + * Set backend mode + * + * @param bool $backend + */ + public function setBackend($backend) + { + if ($backend == 'json') { + // Remap to --format. See \Drush\Commands\sql\SqlSyncCommands::dump. + $this->addArg('--format=json'); + } else { + return $this->set(self::BACKEND, true); + } + } + + /** + * Get the path to the coverage file. + */ + public function coverageFile() + { + return $this->get(self::COVERAGE_FILE); + } + + /** + * Set the coverage file path. + * + * @param string + */ + public function setCoverageFile($coverageFile) + { + return $this->set(self::COVERAGE_FILE, StringUtils::replaceTilde($coverageFile, $this->homeDir())); + } + + /** + * Determine whether Drush is in "strict" mode or not. + */ + public function isStrict() + { + return $this->get(self::STRICT); + } + + /** + * Set strict mode. + * + * @param bool $strict + */ + public function setStrict($strict) + { + return $this->set(self::STRICT, $strict); + } + + /** + * Search through the provided argv list, and return + * just the option name of any item that is an option. + * + * @param array $argv e.g. ['foo', '--bar=baz', 'boz'] + * @return string[] e.g. ['bar'] + */ + protected function getOptionNameList($argv) + { + return array_filter( + array_map( + function ($item) { + // Ignore configuration definitions + if (substr($item, 0, 2) == '-D') { + return null; + } + // Regular expression matches: + // ^-+ # anything that begins with one or more '-' + // ([^= ]*) # any number of characters up to the first = or space + if (preg_match('#^-+([^= ]*)#', $item, $matches)) { + return $matches[1]; + } + }, + $argv + ) + ); + } + + /** + * Create a Symfony Input object. + */ + public function createInput() + { + // In strict mode (the default), create an ArgvInput. When + // strict mode is disabled, create a more forgiving input object. + if ($this->isStrict() && !$this->isBackend()) { + return new DrushArgvInput($this->args()); + } + + // If in backend mode, read additional options from stdin. + // TODO: Maybe reading stdin options should be the responsibility of some + // backend manager class? Could be called from preflight and injected here. + $input = new LessStrictArgvInput($this->args()); + $input->injectAdditionalOptions($this->readStdinOptions()); + + return $input; + } + + /** + * Read options fron STDIN during POST requests. + * + * This function will read any text from the STDIN pipe, + * and attempts to generate an associative array if valid + * JSON was received. + * + * @return + * An associative array of options, if successfull. Otherwise an empty array. + */ + protected function readStdinOptions() + { + // If we move this method to a backend manager, then testing for + // backend mode will be the responsibility of the caller. + if (!$this->isBackend()) { + return []; + } + + $fp = fopen('php://stdin', 'r'); + // Windows workaround: we cannot count on stream_get_contents to + // return if STDIN is reading from the keyboard. We will therefore + // check to see if there are already characters waiting on the + // stream (as there always should be, if this is a backend call), + // and if there are not, then we will exit. + // This code prevents drush from hanging forever when called with + // --backend from the commandline; however, overall it is still + // a futile effort, as it does not seem that backend invoke can + // successfully write data to that this function can read, + // so the argument list and command always come out empty. :( + // Perhaps stream_get_contents is the problem, and we should use + // the technique described here: + // http://bugs.php.net/bug.php?id=30154 + // n.b. the code in that issue passes '0' for the timeout in stream_select + // in a loop, which is not recommended. + // Note that the following DOES work: + // drush ev 'print(json_encode(array("test" => "XYZZY")));' | drush status --backend + // So, redirecting input is okay, it is just the proc_open that is a problem. + if (drush_is_windows()) { + // Note that stream_select uses reference parameters, so we need variables (can't pass a constant NULL) + $read = [$fp]; + $write = null; + $except = null; + // Question: might we need to wait a bit for STDIN to be ready, + // even if the process that called us immediately writes our parameters? + // Passing '100' for the timeout here causes us to hang indefinitely + // when called from the shell. + $changed_streams = stream_select($read, $write, $except, 0); + // Return on error or no changed streams (0). + // Oh, according to http://php.net/manual/en/function.stream-select.php, + // stream_select will return FALSE for streams returned by proc_open. + // That is not applicable to us, is it? Our stream is connected to a stream + // created by proc_open, but is not a stream returned by proc_open. + if ($changed_streams < 1) { + return []; + } + } + stream_set_blocking($fp, false); + $string = stream_get_contents($fp); + fclose($fp); + if (trim($string)) { + return json_decode($string, true); + } + return []; + } +} diff --git a/vendor/drush/drush/src/Preflight/PreflightArgsInterface.php b/vendor/drush/drush/src/Preflight/PreflightArgsInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..73e2415df7131dd6e67ab22459a20be02279be6e --- /dev/null +++ b/vendor/drush/drush/src/Preflight/PreflightArgsInterface.php @@ -0,0 +1,82 @@ +<?php +namespace Drush\Preflight; + +use Consolidation\Config\ConfigInterface; + +/** + * Storage for arguments preprocessed during preflight. + */ +interface PreflightArgsInterface +{ + /** + * Return an associative array of '--option' => 'methodName'. + * The 'option' string should begin with the appropriate number + * of dashes (one or two, as desired), and should end with a '=' + * if the option requires a value. + */ + public function optionsWithValues(); + + /** + * Copy any applicable arguments into the provided configuration + * object, as appropriate. + * + * @param ConfigInterface $config The configuration object to inject data into + */ + public function applyToConfig(ConfigInterface $config); + + /** + * Return all of the args from the inputs that were NOT processed + * by the ArgsPreprocessor (anything not listed in optionsWithValues). + */ + public function args(); + + /** + * Return the path to this application's executable ($argv[0]). + */ + public function applicationPath(); + + /** + * Return the command name from the runtime args. Note that the + * command name also exists inside the runtime args, because the + * runtime args maintain the order of the options relative to the + * command name (save for those options removed by preflight args). + */ + public function commandName(); + + /** + * Store the command name, once it is found. + */ + public function setCommandName($commandName); + + /** + * Add one argument to the end of the list returned by the `args()` method. + * + * @param string $arg One argument + */ + public function addArg($arg); + + /** + * Add everything in the provided array to the list returned by `args()` + * + * @param $args + */ + public function passArgs($args); + + /** + * Return any '@alias' that may have appeared before the argument + * holding the command name. + */ + public function alias(); + + /** + * Returns 'true' if an '@alias' was set. + */ + public function hasAlias(); + + /** + * Set an alias. Should always begin with '@'. + * + * @param string $alias The alias name '@site' + */ + public function setAlias($alias); +} diff --git a/vendor/drush/drush/src/Preflight/PreflightLog.php b/vendor/drush/drush/src/Preflight/PreflightLog.php new file mode 100644 index 0000000000000000000000000000000000000000..4f7072734c0076aec1a98b33c11752627eedf539 --- /dev/null +++ b/vendor/drush/drush/src/Preflight/PreflightLog.php @@ -0,0 +1,40 @@ +<?php + +namespace Drush\Preflight; + +use Symfony\Component\Console\Output\StreamOutput; + +class PreflightLog +{ + protected $debug; + + protected $output; + + public function __construct($output = null) + { + $this->output = $output ?: new StreamOutput(fopen('php://stderr', 'w')); + } + /** + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * @param bool $debug + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + public function log($message) + { + if ($this->getDebug()) { + $this->output->write(' [preflight] ' . $message . "\n"); + } + } +} diff --git a/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php b/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php new file mode 100644 index 0000000000000000000000000000000000000000..09375f77757e92fbf45d7e93ab9466d74af59b0f --- /dev/null +++ b/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php @@ -0,0 +1,132 @@ +<?php + +namespace Drush\Preflight; + +use Drush\Config\Environment; +use Drush\Preflight\PreflightArgsInterface; +use Consolidation\SiteAlias\SiteAlias; +use Consolidation\SiteAlias\SiteAliasManager; +use Consolidation\SiteAlias\SiteAliasName; +use Consolidation\SiteAlias\SiteSpecParser; + +class PreflightSiteLocator +{ + /** + * @var SiteAliasManager + */ + protected $siteAliasManager; + + public function __construct(SiteAliasManager $siteAliasManager) + { + $this->siteAliasManager = $siteAliasManager; + } + + /** + * During bootstrap, finds the currently selected site from the parameters + * provided on the commandline. + * + * If 'false' is returned, that indicates that there was an alias name + * provided on the commandline that is either missing or invalid. + * + * @param PreflightArgsInterface $preflightArgs An alias name or site specification + * @param \Drush\Config\Environment $environment + * @param string $root The default Drupal root (from site:set, --root or cwd) + * + * @return \Consolidation\SiteAlias\SiteAlias|false + */ + public function findSite(PreflightArgsInterface $preflightArgs, Environment $environment, $root) + { + $aliasName = $preflightArgs->alias(); + $self = $this->determineSelf($preflightArgs, $environment, $root); + + // If the user provided a uri on the commandline, inject it + // into the alias that we found. + if ($preflightArgs->hasUri()) { + $self->setUri($preflightArgs->uri()); + } + + return $self; + } + + /** + * Either look up the specified alias name / site spec, + * or, if those are invalid, then generate one from + * the provided root and URI. + * + * @param \Drush\Preflight\PreflightArgsInterface $preflightArgs + * @param \Drush\Config\Environment $environment + * @param $root + * + * @return \Consolidation\SiteAlias\SiteAlias + */ + protected function determineSelf(PreflightArgsInterface $preflightArgs, Environment $environment, $root) + { + $aliasName = $preflightArgs->alias(); + + // If the user specified an @alias, that takes precidence. + if (SiteAliasName::isAliasName($aliasName)) { + // TODO: Should we do something about `@self` here? At the moment that will cause getAlias to + // call getSelf(), but we haven't built @self yet. + return $this->siteAliasManager->getAlias($aliasName); + } + + // Ditto for a site spec (/path/to/drupal#uri) + $specParser = new SiteSpecParser(); + if ($specParser->validSiteSpec($aliasName)) { + return new SiteAlias($specParser->parse($aliasName, $root), $aliasName); + } + + // If the user provides the --root parameter then we don't want to use + // the site-set alias. + $selectedRoot = $preflightArgs->selectedSite(); + if (!$selectedRoot) { + $aliasName = $environment->getSiteSetAliasName(); + if (!empty($aliasName)) { + $alias = $this->siteAliasManager->getAlias($aliasName); + if ($alias) { + return $alias; + } + } + } + + return $this->buildSelf($preflightArgs, $root); + } + + /** + * Generate @self from the provided root and URI. + * + * @param \Drush\Preflight\PreflightArgsInterface $preflightArgs + * @param $root + * + * @return \Consolidation\SiteAlias\SiteAlias + */ + protected function buildSelf(PreflightArgsInterface $preflightArgs, $root) + { + // If there is no root, then return '@none' + if (!$root) { + return new SiteAlias([], '@none'); + } + + // If there is no URI specified, we will allow it to + // remain empty for now. We will refine it later via + // Application::refineUriSelection(), which is called + // in Preflight::doRun(). This method will set it to + // 'default' if no better directory can be devined. + + // Create the 'self' alias record. Note that the self + // record will be named '@self' if it is manually constructed + // here, and will otherwise have the name of the + // alias or site specification used by the user. Also note that if we + // pass in a falsy uri the drush config (i.e drush.yml) can not override + // it. + $uri = $preflightArgs->uri(); + $data = [ + 'root' => $root, + ]; + if ($uri) { + $data['uri'] = $uri; + } + + return new SiteAlias($data, '@self'); + } +} diff --git a/vendor/drush/drush/src/Preflight/PreflightVerify.php b/vendor/drush/drush/src/Preflight/PreflightVerify.php new file mode 100644 index 0000000000000000000000000000000000000000..d77fc09fac9faf4059c7d0fcb546e1a6a7a2d169 --- /dev/null +++ b/vendor/drush/drush/src/Preflight/PreflightVerify.php @@ -0,0 +1,116 @@ +<?php +namespace Drush\Preflight; + +use Drush\Config\Environment; +use Drush\Utils\StringUtils; + +/** + * Helper methods to verify preflight state. + */ +class PreflightVerify +{ + /** + * Throw an exception if the environment is not right for running Drush. + * + * @param Environment $environment + */ + public function verify(Environment $environment) + { + // Fail fast if the PHP version is not at least 5.6.0. + // We'll come back and check this again later, in case someone + // set a higher value in a configuration file. + $this->confirmPhpVersion('5.6.0'); + + // Fail if this is not a CLI php + $this->confirmUsingCLI($environment); + + // Fail if any mandatory functions have been disabled, or any + // illegal options have been set in php.ini. + $this->checkPhpIni(); + } + + /** + * Fail fast if the php version does not meet the minimum requirements. + * + * @param string $minimumPhpVersion + * The minimum allowable php version + */ + public function confirmPhpVersion($minimumPhpVersion) + { + if (version_compare(phpversion(), $minimumPhpVersion) < 0 && !getenv('DRUSH_NO_MIN_PHP')) { + throw new \Exception(StringUtils::interpolate('Your command line PHP installation is too old. Drush requires at least PHP {version}. To suppress this check, set the environment variable DRUSH_NO_MIN_PHP=1', ['version' => $minimumPhpVersion])); + } + } + + /** + * Fail if not being run from the command line. + * + * @param Environment $environment + */ + protected function confirmUsingCLI(Environment $environment) + { + if (!$environment->verifyCLI()) { + throw new \Exception(StringUtils::interpolate('Drush is designed to run via the command line.')); + } + } + + /** + * Evaluate the environment before command bootstrapping + * begins. If the php environment is too restrictive, then + * notify the user that a setting change is needed and abort. + */ + protected function checkPhpIni() + { + $ini_checks = ['safe_mode' => '', 'open_basedir' => '', 'disable_functions' => ['exec', 'system'], 'disable_classes' => '']; + + // Test to insure that certain php ini restrictions have not been enabled + $prohibited_list = []; + foreach ($ini_checks as $prohibited_mode => $disallowed_value) { + $ini_value = ini_get($prohibited_mode); + if ($this->invalidIniValue($ini_value, $disallowed_value)) { + $prohibited_list[] = $prohibited_mode; + } + } + if (!empty($prohibited_list)) { + throw new \Exception(StringUtils::interpolate('The following restricted PHP modes have non-empty values: {prohibited_list}. This configuration is incompatible with drush. {php_ini_msg}', ['prohibited_list' => implode(' and ', $prohibited_list), 'php_ini_msg' => $this->loadedPhpIniMessage()])); + } + } + + /** + * Determine whether an ini value is valid based on the criteria. + * + * @param string $ini_value + * The value of the ini setting being tested. + * @param string|string[] $disallowed_value + * The value that the ini seting cannot be, or a list of disallowed + * values that cannot appear in the setting. + * @return bool + */ + protected function invalidIniValue($ini_value, $disallowed_value) + { + if (empty($disallowed_value)) { + return !empty($ini_value) && (strcasecmp($ini_value, 'off') != 0); + } else { + foreach ($disallowed_value as $test_value) { + if (preg_match('/(^|,)' . $test_value . '(,|$)/', $ini_value)) { + return true; + } + } + } + return false; + } + + /** + * Returns a localizable message about php.ini that + * varies depending on whether the php_ini_loaded_file() + * is available or not. + */ + protected function loadedPhpIniMessage() + { + if (function_exists('php_ini_loaded_file')) { + return StringUtils::interpolate('Please check your configuration settings in !phpini or in your drush.ini file; see examples/example.drush.ini for details.', ['!phpini' => php_ini_loaded_file()]); + } else { + return StringUtils::interpolate('Please check your configuration settings in your php.ini file or in your drush.ini file; see examples/example.drush.ini for details.'); + } + } +} diff --git a/vendor/drush/drush/src/Preflight/RedispatchToSiteLocal.php b/vendor/drush/drush/src/Preflight/RedispatchToSiteLocal.php new file mode 100644 index 0000000000000000000000000000000000000000..abc52b6361753755f12705d35914b2333f2d6a42 --- /dev/null +++ b/vendor/drush/drush/src/Preflight/RedispatchToSiteLocal.php @@ -0,0 +1,81 @@ +<?php + +namespace Drush\Preflight; + +use Webmozart\PathUtil\Path; + +/** + * RedispatchToSiteLocal forces an `exec` to the site-local Drush if it + * exist. We must do this super-early, before loading Drupal's autoload + * file. If we do not, we will crash unless the site-local Drush and the + * global Drush are using the exact same versions of all dependencies, which + * will rarely line up sufficiently to prevent problems. + */ +class RedispatchToSiteLocal +{ + + /** + * Determine if a local redispatch is needed, and do so if it is. + * + * @param array $argv The commandline arguments + * @param string $root The selected site root or false if none + * @param string $vendor The path to the vendor directory + * @param PreflightLog $preflightLog A basic logger. + * + * @return bool + * True if redispatch occurred, and was returned successfully. + */ + public static function redispatchIfSiteLocalDrush($argv, $root, $vendor, PreflightLog $preflightLog) + { + + // Try to find the site-local Drush. If there is none, we are done. + $siteLocalDrush = static::findSiteLocalDrush($root); + if (!$siteLocalDrush) { + return false; + } + + // If the site-local Drush is us, then we do not need to redispatch. + if (Path::isBasePath($vendor, $siteLocalDrush)) { + return false; + } + + // Do another special check to detect symlinked Drush folder similar + // to what the SUT sets up for Drush functional tests. + if (dirname($vendor) == dirname($siteLocalDrush)) { + return false; + } + + // Redispatch! + $command = $siteLocalDrush; + $preflightLog->log(dt('Redispatch to site-local Drush: !cmd.', ['!cmd' => $command])); + array_shift($argv); + $args = array_map( + function ($item) { + return escapeshellarg($item); + }, + $argv + ); + $command .= ' ' . implode(' ', $args); + passthru($command, $status); + return $status; + } + + /** + * Find a site-local Drush, if there is one in the selected site's + * vendor directory. + * + * @param string $root The selected site root + */ + protected static function findSiteLocalDrush($root) + { + $candidates = [ + "$root/vendor/drush/drush/drush", + dirname($root) . '/vendor/drush/drush/drush', + ]; + foreach ($candidates as $candidate) { + if (file_exists($candidate)) { + return $candidate; + } + } + } +} diff --git a/vendor/drush/drush/src/Psysh/Caster.php b/vendor/drush/drush/src/Psysh/Caster.php new file mode 100644 index 0000000000000000000000000000000000000000..7e806b5aa57fdf63017d9d7e7112515d8a1be817 --- /dev/null +++ b/vendor/drush/drush/src/Psysh/Caster.php @@ -0,0 +1,114 @@ +<?php + +/** + * @file + * Contains \Drush\Psysh\Caster. + */ + +namespace Drush\Psysh; + +use Symfony\Component\VarDumper\Caster\Caster as BaseCaster; + +/** + * Caster class for VarDumper casters for the shell. + */ +class Caster +{ + + /** + * Casts \Drupal\Core\Entity\ContentEntityInterface classes. + */ + public static function castContentEntity($entity, $array, $stub, $isNested) + { + if (!$isNested) { + foreach ($entity as $property => $item) { + $array[BaseCaster::PREFIX_PROTECTED . $property] = $item; + } + } + + return $array; + } + + /** + * Casts \Drupal\Core\Field\FieldItemListInterface classes. + */ + public static function castFieldItemList($list_item, $array, $stub, $isNested) + { + if (!$isNested) { + foreach ($list_item as $delta => $item) { + $array[BaseCaster::PREFIX_VIRTUAL . $delta] = $item; + } + } + + return $array; + } + + /** + * Casts \Drupal\Core\Field\FieldItemInterface classes. + */ + public static function castFieldItem($item, $array, $stub, $isNested) + { + if (!$isNested) { + $array[BaseCaster::PREFIX_VIRTUAL . 'value'] = $item->getValue(); + } + + return $array; + } + + /** + * Casts \Drupal\Core\Config\Entity\ConfigEntityInterface classes. + */ + public static function castConfigEntity($entity, $array, $stub, $isNested) + { + if (!$isNested) { + foreach ($entity->toArray() as $property => $value) { + $array[BaseCaster::PREFIX_PROTECTED . $property] = $value; + } + } + + return $array; + } + + /** + * Casts \Drupal\Core\Config\ConfigBase classes. + */ + public static function castConfig($config, $array, $stub, $isNested) + { + if (!$isNested) { + foreach ($config->get() as $property => $value) { + $array[BaseCaster::PREFIX_VIRTUAL . $property] = $value; + } + } + + return $array; + } + + /** + * Casts \Drupal\Component\DependencyInjection\Container classes. + */ + public static function castContainer($container, $array, $stub, $isNested) + { + if (!$isNested) { + $service_ids = $container->getServiceIds(); + sort($service_ids); + foreach ($service_ids as $service_id) { + $service = $container->get($service_id); + $array[BaseCaster::PREFIX_VIRTUAL . $service_id] = is_object($service) ? get_class($service) : $service; + } + } + + return $array; + } + + /** + * Casts \Drupal\Component\Render\MarkupInterface classes. + */ + public static function castMarkup($markup, $array, $stub, $isNested) + { + if (!$isNested) { + $array[BaseCaster::PREFIX_VIRTUAL . 'markup'] = (string) $markup; + } + + return $array; + } +} diff --git a/vendor/drush/drush/src/Psysh/DrushCommand.php b/vendor/drush/drush/src/Psysh/DrushCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..dbd3f639547c111b84fba5d98daceb28e7c6d190 --- /dev/null +++ b/vendor/drush/drush/src/Psysh/DrushCommand.php @@ -0,0 +1,135 @@ +<?php +/** + * @file + * Contains \Drush\Psysh\DrushCommand. + * + * DrushCommand is a PsySH proxy command which accepts a Drush command config + * array and tries to build an appropriate PsySH command for it. + */ + +namespace Drush\Psysh; + +use Consolidation\AnnotatedCommand\AnnotatedCommand; +use Drush\Drush; +use Symfony\Component\Console\Command\Command; +use Psy\Command\Command as BaseCommand; +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Main Drush command. + */ +class DrushCommand extends BaseCommand +{ + + /** + * @var \Symfony\Component\Console\Command\Command + */ + private $command; + + /** + * DrushCommand constructor. + * + * @param \Symfony\Component\Console\Command\Command $command + * Original Drush command. + */ + public function __construct(Command $command) + { + $this->command = $command; + parent::__construct(); + } + + /** + * Get the namespace of this command. + */ + public function getNamespace() + { + $parts = explode(':', $this->getName()); + return count($parts) >= 2 ? array_shift($parts) : 'global'; + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName($this->command->getName()) + ->setAliases($this->command->getAliases()) + ->setDefinition($this->command->getDefinition()) + ->setDescription($this->command->getDescription()) + ->setHelp($this->buildHelpFromCommand()); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $args = $input->getArguments(); + $first = array_shift($args); + + // If the first argument is an alias, assign the next argument as the + // command. + if (strpos($first, '@') === 0) { + $alias = $first; + $command = array_shift($args); + } else { + // Otherwise, default the alias to '@self' and use the first argument as the + // command. + $alias = '@self'; + $command = $first; + } + + $options = array_diff_assoc($input->getOptions(), $this->getDefinition()->getOptionDefaults()); + $process = Drush::drush(Drush::aliasManager()->get($alias), $command, array_filter(array_values($args)), $options); + $process->run(); + + if ((!$process->isSuccessful()) && !empty($process->getErrorOutput())) { + $output->write($process->getErrorOutput()); + // Add a newline after so the shell returns on a new line. + $output->writeln(''); + } else { + $output->page($process->getOutput()); + } + } + + /** + * Build a command help from the Drush configuration array. + * + * Currently it's a word-wrapped description, plus any examples provided. + * + * @return string + * The help string. + */ + protected function buildHelpFromCommand() + { + $help = wordwrap($this->command->getDescription()); + + $examples = []; + + if ($this->command instanceof AnnotatedCommand) { + foreach ($this->command->getExampleUsages() as $ex => $def) { + // Skip empty examples and things with obvious pipes... + if (($ex === '') || (strpos($ex, '|') !== false)) { + continue; + } + + $ex = preg_replace('/^drush\s+/', '', $ex); + $examples[$ex] = $def; + } + } + + if (!empty($examples)) { + $help .= "\n\ne.g."; + + foreach ($examples as $ex => $def) { + $help .= sprintf("\n<return>// %s</return>\n", wordwrap(OutputFormatter::escape($def), 75, "</return>\n<return>// ")); + $help .= sprintf("<return>>>> %s</return>\n", OutputFormatter::escape($ex)); + } + } + + return $help; + } +} diff --git a/vendor/drush/drush/src/Psysh/DrushHelpCommand.php b/vendor/drush/drush/src/Psysh/DrushHelpCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..fb3f0a11c34086de8b68c9be70ff92161b438185 --- /dev/null +++ b/vendor/drush/drush/src/Psysh/DrushHelpCommand.php @@ -0,0 +1,128 @@ +<?php + +/** + * @file + * Contains \Drush\Psysh\DrushCommand. + */ + +namespace Drush\Psysh; + +use Psy\Command\Command as BaseCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Help command. + * + * Lists available commands, and gives command-specific help when asked nicely. + * + * This replaces the PsySH help command to list commands by category. + */ +class DrushHelpCommand extends BaseCommand +{ + + /** + * Label for PsySH commands. + */ + const PSYSH_CATEGORY = 'PsySH'; + + /** + * The currently set subcommand. + * + * @var \Symfony\Component\Console\Command\Command + */ + protected $command; + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('help') + ->setAliases(['?']) + ->setDefinition([ + new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', null), + ]) + ->setDescription('Show a list of commands. Type `help [foo]` for information about [foo].'); + } + + /** + * Helper for setting a subcommand to retrieve help for. + * + * @param \Symfony\Component\Console\Command\Command $command + */ + public function setCommand(Command $command) + { + $this->command = $command; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + if ($this->command !== null) { + // Help for an individual command. + $output->page($this->command->asText()); + $this->command = null; + } elseif ($name = $input->getArgument('command_name')) { + // Help for an individual command. + $output->page($this->getApplication()->get($name)->asText()); + } else { + $namespaces = []; + + // List available commands. + $commands = $this->getApplication()->all(); + + // Find the alignment width. + $width = 0; + foreach ($commands as $command) { + $width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width; + } + $width += 2; + + foreach ($commands as $name => $command) { + if ($name !== $command->getName()) { + continue; + } + + if ($command->getAliases()) { + $aliases = sprintf(' <comment>Aliases:</comment> %s', implode(', ', $command->getAliases())); + } else { + $aliases = ''; + } + + $namespace = ''; + if ($command instanceof DrushCommand) { + $namespace = $command->getNamespace(); + } + + if (empty($namespace)) { + $namespace = static::PSYSH_CATEGORY; + } + + if (!isset($namespaces[$namespace])) { + $namespaces[$namespace] = []; + } + + $namespaces[$namespace][] = sprintf(" <info>%-${width}s</info> %s%s", $name, $command->getDescription(), $aliases); + } + + $messages = []; + + foreach ($namespaces as $namespace => $command_messages) { + $messages[] = ''; + $messages[] = sprintf('<comment>%s</comment>', OutputFormatter::escape($namespace)); + foreach ($command_messages as $command_message) { + $messages[] = $command_message; + } + } + + $output->page($messages); + } + } +} diff --git a/vendor/drush/drush/src/Psysh/Shell.php b/vendor/drush/drush/src/Psysh/Shell.php new file mode 100644 index 0000000000000000000000000000000000000000..dad0127633dfaf50e2a0caedf12d2361f5ecb24c --- /dev/null +++ b/vendor/drush/drush/src/Psysh/Shell.php @@ -0,0 +1,65 @@ +<?php + +/** + * @file + * Contains \Drush\Psysh\Shell. + */ + +namespace Drush\Psysh; + +use Psy\Shell as BaseShell; +use Symfony\Component\Console\Input\StringInput; + +class Shell extends BaseShell +{ + + /** + * Get a command (if one exists) for the current input string. + * + * @param string $input + * + * @return null|string + */ + protected function getCommand($input) + { + if ($name = $this->getCommandFromInput($input)) { + return $this->get($name); + } + } + + /** + * Check whether a command is set for the current input string. + * + * @param string $input + * + * @return bool True if the shell has a command for the given input. + */ + protected function hasCommand($input) + { + if ($name = $this->getCommandFromInput($input)) { + return $this->has($name); + } + + return false; + } + + /** + * Get the command from the current input, takes aliases into account. + * + * @param string $input + * The raw input + * + * @return string|NULL + * The current command. + */ + protected function getCommandFromInput($input) + { + // Remove the alias from the start of the string before parsing and + // returning the command. Essentially, when choosing a command, we're + // ignoring the site alias. + $input = preg_replace('|^\@[^\s]+|', '', $input); + + $input = new StringInput($input); + return $input->getFirstArgument(); + } +} diff --git a/vendor/drush/drush/src/Runtime/DependencyInjection.php b/vendor/drush/drush/src/Runtime/DependencyInjection.php new file mode 100644 index 0000000000000000000000000000000000000000..4c46d99cbbc2172ded9d0242ddc7bb550190a5cc --- /dev/null +++ b/vendor/drush/drush/src/Runtime/DependencyInjection.php @@ -0,0 +1,176 @@ +<?php +namespace Drush\Runtime; + +use Drush\Command\GlobalOptionsEventListener; +use Drush\Drush; +use Drush\Cache\CommandCache; +use DrupalFinder\DrupalFinder; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Application; +use Consolidation\Config\ConfigInterface; +use Composer\Autoload\ClassLoader; +use League\Container\ContainerInterface; +use Consolidation\SiteAlias\SiteAliasManager; +use Drush\Command\DrushCommandInfoAlterer; +use Consolidation\Config\Util\ConfigOverlay; +use Drush\Config\DrushConfig; +use Drush\SiteAlias\ProcessManager; + +/** + * Prepare our Dependency Injection Container + */ +class DependencyInjection +{ + protected $handlers = []; + + public function desiredHandlers($handlerList) + { + $this->handlers = $handlerList; + } + + /** + * Set up our dependency injection container. + */ + public function initContainer( + Application $application, + ConfigInterface $config, + InputInterface $input, + OutputInterface $output, + ClassLoader $loader, + DrupalFinder $drupalFinder, + SiteAliasManager $aliasManager + ) { + + // Create default input and output objects if they were not provided + if (!$input) { + $input = new \Symfony\Component\Console\Input\StringInput(''); + } + if (!$output) { + $output = new \Symfony\Component\Console\Output\ConsoleOutput(); + } + // Set up our dependency injection container. + $container = new \League\Container\Container(); + + \Robo\Robo::configureContainer($container, $application, $config, $input, $output); + $container->add('container', $container); + + $this->addDrushServices($container, $loader, $drupalFinder, $aliasManager, $config); + + // Store the container in the \Drush object + Drush::setContainer($container); + + // Change service definitions as needed for our application. + $this->alterServicesForDrush($container, $application); + + // Inject needed services into our application object. + $this->injectApplicationServices($container, $application); + + return $container; + } + + /** + * Make sure we are notified on exit, and when bad things happen. + */ + public function installHandlers($container) + { + foreach ($this->handlers as $handlerId) { + $handler = $container->get($handlerId); + $handler->installHandler(); + } + } + + protected function addDrushServices(ContainerInterface $container, ClassLoader $loader, DrupalFinder $drupalFinder, SiteAliasManager $aliasManager, DrushConfig $config) + { + // Override Robo's logger with our own + $container->share('logger', 'Drush\Log\Logger') + ->withArgument('output') + ->withMethodCall('setLogOutputStyler', ['logStyler']); + + $container->share('loader', $loader); + $container->share('site.alias.manager', $aliasManager); + + // Fetch the runtime config, where -D et. al. are stored, and + // add a reference to it to the container. + $container->share('config.runtime', $config->getContext(ConfigOverlay::PROCESS_CONTEXT)); + + // Override Robo's formatter manager with our own + // @todo not sure that we'll use this. Maybe remove it. + $container->share('formatterManager', \Drush\Formatters\DrushFormatterManager::class) + ->withMethodCall('addDefaultFormatters', []) + ->withMethodCall('addDefaultSimplifiers', []); + + // Add some of our own objects to the container + $container->share('bootstrap.drupal8', 'Drush\Boot\DrupalBoot8'); + $container->share('bootstrap.manager', 'Drush\Boot\BootstrapManager') + ->withMethodCall('setDrupalFinder', [$drupalFinder]); + // TODO: Can we somehow add these via discovery (e.g. backdrop extension?) + $container->extend('bootstrap.manager') + ->withMethodCall('add', ['bootstrap.drupal8']); + $container->share('bootstrap.hook', 'Drush\Boot\BootstrapHook') + ->withArgument('bootstrap.manager'); + $container->share('tildeExpansion.hook', 'Drush\Runtime\TildeExpansionHook'); + $container->share('process.manager', ProcessManager::class) + ->withMethodCall('setConfig', ['config']) + ->withMethodCall('setConfigRuntime', ['config.runtime']); + $container->share('redispatch.hook', 'Drush\Runtime\RedispatchHook') + ->withArgument('process.manager'); + + // Robo does not manage the command discovery object in the container, + // but we will register and configure one for our use. + // TODO: Some old adapter code uses this, but the Symfony dispatcher does not. + // See Application::commandDiscovery(). + $container->share('commandDiscovery', 'Consolidation\AnnotatedCommand\CommandFileDiscovery') + ->withMethodCall('addSearchLocation', ['CommandFiles']) + ->withMethodCall('setSearchPattern', ['#.*(Commands|CommandFile).php$#']); + + // Error and Shutdown handlers + $container->share('errorHandler', 'Drush\Runtime\ErrorHandler'); + $container->share('shutdownHandler', 'Drush\Runtime\ShutdownHandler'); + + // Add inflectors. @see \Drush\Boot\BaseBoot::inflect + $container->inflector(\Drush\Boot\AutoloaderAwareInterface::class) + ->invokeMethod('setAutoloader', ['loader']); + $container->inflector(\Consolidation\SiteAlias\SiteAliasManagerAwareInterface::class) + ->invokeMethod('setSiteAliasManager', ['site.alias.manager']); + $container->inflector(\Consolidation\SiteProcess\ProcessManagerAwareInterface::class) + ->invokeMethod('setProcessManager', ['process.manager']); + } + + protected function alterServicesForDrush(ContainerInterface $container, Application $application) + { + // Add our own callback to the hook manager + $hookManager = $container->get('hookManager'); + $hookManager->addCommandEvent(new GlobalOptionsEventListener()); + $hookManager->addInitializeHook($container->get('redispatch.hook')); + $hookManager->addInitializeHook($container->get('bootstrap.hook')); + $hookManager->addPreValidator($container->get('tildeExpansion.hook')); + $hookManager->addOutputExtractor(new \Drush\Backend\BackendResultSetter()); + + // Install our command cache into the command factory + // TODO: Create class-based implementation of our cache management functions. + $cacheBackend = _drush_cache_get_object('factory'); + $commandCacheDataStore = new CommandCache($cacheBackend); + + $factory = $container->get('commandFactory'); + $factory->setIncludeAllPublicMethods(false); + $factory->setDataStore($commandCacheDataStore); + $factory->addCommandInfoAlterer(new DrushCommandInfoAlterer()); + + $commandProcessor = $container->get('commandProcessor'); + $commandProcessor->setPassExceptions(true); + + ProcessManager::addTransports($container->get('process.manager')); + } + + protected function injectApplicationServices(ContainerInterface $container, Application $application) + { + $application->setLogger($container->get('logger')); + $application->setBootstrapManager($container->get('bootstrap.manager')); + $application->setAliasManager($container->get('site.alias.manager')); + $application->setRedispatchHook($container->get('redispatch.hook')); + $application->setTildeExpansionHook($container->get('tildeExpansion.hook')); + $application->setDispatcher($container->get('eventDispatcher')); + $application->setConfig($container->get('config')); + } +} diff --git a/vendor/drush/drush/src/Runtime/ErrorHandler.php b/vendor/drush/drush/src/Runtime/ErrorHandler.php new file mode 100644 index 0000000000000000000000000000000000000000..578412f8eeb169c1fd01a0380c8480ce5bbbaacf --- /dev/null +++ b/vendor/drush/drush/src/Runtime/ErrorHandler.php @@ -0,0 +1,66 @@ +<?php +namespace Drush\Runtime; + +/** + * @file + * Drush's error handler + */ + +use Drush\Drush; +use Drush\Log\LogLevel; +use Webmozart\PathUtil\Path; + +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; + +/** + * Log PHP errors to the Drush log. This is in effect until Drupal's error + * handler takes over. + */ +class ErrorHandler implements LoggerAwareInterface, HandlerInterface +{ + use LoggerAwareTrait; + + public function installHandler() + { + set_error_handler([$this, 'errorHandler']); + } + + public function errorHandler($errno, $message, $filename, $line) + { + // E_DEPRECATED was added in PHP 5.3. Drupal 6 will not fix all the + // deprecated errors, but suppresses them. So we suppress them as well. + if (defined('E_DEPRECATED')) { + $errno = $errno & ~E_DEPRECATED; + } + + // "error_reporting" is usually set in php.ini, but may be changed by + // drush_errors_on() and drush_errors_off(). + if ($errno & error_reporting()) { + // By default we log notices. + $type = Drush::config()->get('runtime.php.notices', LogLevel::INFO); + $halt_on_error = Drush::config()->get('runtime.php.halt-on-error', (drush_drupal_major_version() != 6)); + + // Bitmask value that constitutes an error needing to be logged. + $error = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR; + if ($errno & $error) { + $type = 'error'; + } + + // Bitmask value that constitutes a warning being logged. + $warning = E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING; + if ($errno & $warning) { + $type = LogLevel::WARNING; + } + + $this->logger->log($type, $message . ' ' . basename($filename) . ':' . $line); + + if ($errno == E_RECOVERABLE_ERROR && $halt_on_error) { + $this->logger->error(dt('E_RECOVERABLE_ERROR encountered; aborting. To ignore recoverable errors, run again with --no-halt-on-error')); + exit(DRUSH_APPLICATION_ERROR); + } + + return true; + } + } +} diff --git a/vendor/drush/drush/src/Runtime/HandlerInterface.php b/vendor/drush/drush/src/Runtime/HandlerInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..4da4c96ed690db8f44942ced0e0a4454139f505b --- /dev/null +++ b/vendor/drush/drush/src/Runtime/HandlerInterface.php @@ -0,0 +1,16 @@ +<?php +namespace Drush\Runtime; + +/** + * @file + * Handler interface + */ + +/** + * HandlerInterface represents a PHP system handler (e.g. the error reporting + * handler, the shutdown handler) that may be globally installed. + */ +interface HandlerInterface +{ + public function installHandler(); +} diff --git a/vendor/drush/drush/src/Runtime/RedispatchHook.php b/vendor/drush/drush/src/Runtime/RedispatchHook.php new file mode 100644 index 0000000000000000000000000000000000000000..3649d5d134a07a291c7ef7024f30b1cbd26c166d --- /dev/null +++ b/vendor/drush/drush/src/Runtime/RedispatchHook.php @@ -0,0 +1,141 @@ +<?php + +namespace Drush\Runtime; + +use Consolidation\AnnotatedCommand\AnnotationData; +use Consolidation\AnnotatedCommand\Hooks\InitializeHookInterface; +use Consolidation\SiteAlias\SiteAlias; +use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; +use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; +use Consolidation\SiteProcess\ProcessManager; +use Consolidation\SiteProcess\Util\Tty; +use Drush\Drush; +use Drush\Log\LogLevel; +use Drush\Config\ConfigAwareTrait; +use Robo\Contract\ConfigAwareInterface; +use Symfony\Component\Console\Input\InputInterface; +use Drush\Utils\TerminalUtils; + +/** + * The RedispatchHook is installed as an init hook that runs before + * all commands. If the commandline contains an alias or a site specification + * that points at a remote machine, then we will stop execution of the + * current command and instead run the command remotely. + */ +class RedispatchHook implements InitializeHookInterface, ConfigAwareInterface, SiteAliasManagerAwareInterface +{ + use ConfigAwareTrait; + use SiteAliasManagerAwareTrait; + + /** @var ProcessManager */ + protected $processManager; + + public function __construct(ProcessManager $processManager) + { + $this->processManager = $processManager; + } + + /** + * Check to see if it is necessary to redispatch to a remote site. + * We do not redispatch to local sites here; usually, local sites may + * simply be selected and require no redispatch. When a local redispatch + * is needed, it happens in the RedispatchToSiteLocal class. + * + * @param InputInterface $input + * @param AnnotationData $annotationData + */ + public function initialize(InputInterface $input, AnnotationData $annotationData) + { + // See drush_preflight_command_dispatch; also needed are: + // - redispatch to a different site-local Drush on same system + // - site-list handling (REMOVED) + // These redispatches need to be done regardless of the presence + // of a @handle-remote-commands annotation. + + // If the command has the @handle-remote-commands annotation, then + // short-circuit redispatches to remote hosts. + if ($annotationData->has('handle-remote-commands')) { + return; + } + return $this->redispatchIfRemote($input); + } + + /** + * Check to see if the target of the command is remote. Call redispatch + * if it is. + * + * @param InputInterface $input + */ + public function redispatchIfRemote(InputInterface $input) + { + $aliasRecord = $this->siteAliasManager()->getSelf(); + // Determine if this is a remote command. + if ($this->processManager->hasTransport($aliasRecord)) { + return $this->redispatch($input); + } + } + + /** + * Called from RemoteCommandProxy::execute() to run remote commands. + * + * @param InputInterface $input + */ + public function redispatch(InputInterface $input) + { + // Get the command arguments, and shift off the Drush command. + $redispatchArgs = $this->getConfig()->get('runtime.argv'); + $drush_path = array_shift($redispatchArgs); + $command_name = $this->getConfig()->get('runtime.command'); + + Drush::logger()->debug('Redispatch hook {command}', ['command' => $command_name]); + + // Remove argument patterns that should not be propagated + $redispatchArgs = $this->alterArgsForRedispatch($redispatchArgs); + + // The options the user provided on the commandline will be included + // in $redispatchArgs. + $redispatchOptions = []; + + $aliasRecord = $this->siteAliasManager()->getSelf(); + $process = $this->processManager->drushSiteProcess($aliasRecord, $redispatchArgs, $redispatchOptions); + if (!Tty::isTtySupported()) { + $process->setInput(STDIN); + } else { + $process->setTty($this->getConfig()->get('ssh.tty', $input->isInteractive())); + } + $process->mustRun($process->showRealtime()); + + return $this->exitEarly($process->getExitCode()); + } + + /** + * Remove anything that is not necessary for the remote side. + * At the moment this is limited to configuration options + * provided via -D. + * + * @param array $redispatchArgs + */ + protected function alterArgsForRedispatch($redispatchArgs) + { + return array_filter($redispatchArgs, function ($item) { + return strpos($item, '-D') !== 0; + }); + } + + /** + * Abort the current execution without causing distress to our + * shutdown handler. + * + * @param int $exit_code. + */ + protected function exitEarly($exit_code) + { + Drush::logger()->debug('Redispatch hook exit early'); + + // Note that RemoteCommandProxy::execute() is expecting that + // the redispatch() method will not return, so that will need + // to be altered if this behavior is changed. + Runtime::setCompleted(); + exit($exit_code); + } +} diff --git a/vendor/drush/drush/src/Runtime/Runtime.php b/vendor/drush/drush/src/Runtime/Runtime.php new file mode 100644 index 0000000000000000000000000000000000000000..8c7c202e1326a7fa777cbcba7494acfdee2bb1b2 --- /dev/null +++ b/vendor/drush/drush/src/Runtime/Runtime.php @@ -0,0 +1,158 @@ +<?php +namespace Drush\Runtime; + +use Drush\Drush; +use Drush\Preflight\Preflight; +use Drush\Runtime\ErrorHandler; +use Drush\Runtime\ShutdownHandler; + +/** + * Control the Drush runtime environment + * + * - Preflight + * - Symfony application run + * - Bootstrap + * - Command execution + * - Termination + */ +class Runtime +{ + /** @var Preflight */ + protected $preflight; + + /** @var DependencyInjection */ + protected $di; + + const DRUSH_RUNTIME_COMPLETED_NAMESPACE = 'runtime.execution.completed'; + const DRUSH_RUNTIME_EXIT_CODE_NAMESPACE = 'runtime.exit_code'; + + /** + * Runtime constructor + * + * @param Preflight $preflight the preflight object + */ + public function __construct(Preflight $preflight, DependencyInjection $di) + { + $this->preflight = $preflight; + $this->di = $di; + } + + /** + * Run the application, catching any errors that may be thrown. + * Typically, this will happen only for code that fails fast during + * preflight. Later code should catch and handle its own exceptions. + */ + public function run($argv) + { + try { + $output = new \Symfony\Component\Console\Output\ConsoleOutput(); + $status = $this->doRun($argv, $output); + } catch (\Exception $e) { + $status = $e->getCode(); + $message = $e->getMessage(); + // Uncaught exceptions could happen early, before our logger + // and other classes are initialized. Print them and exit. + $this->preflight->logger()->setDebug(true)->log($message); + } + return $status; + } + + /** + * Start up Drush + */ + protected function doRun($argv, $output) + { + // Do the preflight steps + $status = $this->preflight->preflight($argv); + + // If preflight signals that we are done, then exit early. + if ($status !== false) { + return $status; + } + + $commandfileSearchpath = $this->preflight->getCommandFilePaths(); + $this->preflight->logger()->log('Commandfile search paths: ' . implode(',', $commandfileSearchpath)); + $this->preflight->config()->set('runtime.commandfile.paths', $commandfileSearchpath); + + // Require the Composer autoloader for Drupal (if different) + $loader = $this->preflight->loadSiteAutoloader(); + + // Create the Symfony Application et. al. + $input = $this->preflight->createInput(); + $application = new \Drush\Application('Drush Commandline Tool', Drush::getVersion()); + + // Set up the DI container. + $container = $this->di->initContainer( + $application, + $this->preflight->config(), + $input, + $output, + $loader, + $this->preflight->drupalFinder(), + $this->preflight->aliasManager() + ); + + // Our termination handlers are set up via dependency injection, + // as they require classes that are set up in the DI container. + // We therefore cannot configure them any earlier than this. + $this->di->installHandlers($container); + + // Now that the DI container has been set up, the Application object will + // have a reference to the bootstrap manager et. al., so we may use it + // as needed. Tell the application to coordinate between the Bootstrap + // manager and the alias manager to select a more specific URI, if + // one was not explicitly provided earlier in the preflight. + $application->refineUriSelection($this->preflight->environment()->cwd()); + + // Add global options and copy their values into Config. + $application->configureGlobalOptions(); + + // Configure the application object and register all of the commandfiles + // from the search paths we found above. After this point, the input + // and output objects are ready & we can start using the logger, etc. + $application->configureAndRegisterCommands($input, $output, $commandfileSearchpath); + + // Run the Symfony Application + // Predispatch: call a remote Drush command if applicable (via a 'pre-init' hook) + // Bootstrap: bootstrap site to the level requested by the command (via a 'post-init' hook) + $status = $application->run($input, $output); + + // Placate the Drush shutdown handler. + Runtime::setCompleted(); + // Placate drush_backend_output(). + Runtime::setExitCode($status); + + return $status; + } + + /** + * Mark the current request as having completed successfully. + */ + public static function setCompleted() + { + Drush::config()->set(self::DRUSH_RUNTIME_COMPLETED_NAMESPACE, true); + } + + /** + * @deprecated + * Used by backend.inc + * + * Mark the exit code for current request. + * @param int $code + */ + public static function setExitCode($code) + { + Drush::config()->set(self::DRUSH_RUNTIME_EXIT_CODE_NAMESPACE, $code); + } + + /** + * @deprecated + * Used by backend.inc + * + * Get the exit code for current request. + */ + public static function exitCode() + { + return Drush::config()->get(self::DRUSH_RUNTIME_EXIT_CODE_NAMESPACE, DRUSH_SUCCESS); + } +} diff --git a/vendor/drush/drush/src/Runtime/ShutdownHandler.php b/vendor/drush/drush/src/Runtime/ShutdownHandler.php new file mode 100644 index 0000000000000000000000000000000000000000..feb1e17c8793665e3c1d991d23e083caa4b26102 --- /dev/null +++ b/vendor/drush/drush/src/Runtime/ShutdownHandler.php @@ -0,0 +1,69 @@ +<?php +namespace Drush\Runtime; + +/** + * @file + * Drush's error handler + */ + +use Drush\Drush; +use Drush\Log\LogLevel; +use Drush\Commands\DrushCommands; +use Webmozart\PathUtil\Path; + +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; + +/** + * Drush's shutdown handler + * + * If the command is being executed with the --backend option, the script + * will return a json string containing the options and log information + * used by the script. + * + * The command will exit with '0' if it was successfully executed, and the + * result of Runtime::exitCode() if it wasn't. + * + */ +class ShutdownHandler implements LoggerAwareInterface, HandlerInterface +{ + use LoggerAwareTrait; + + public function installHandler() + { + register_shutdown_function([$this, 'shutdownHandler']); + } + + public function shutdownHandler() + { + // Avoid doing anything if our container has not been initialized yet. + if (!Drush::hasContainer()) { + return; + } + + if (!Drush::config()->get(Runtime::DRUSH_RUNTIME_COMPLETED_NAMESPACE)) { + Drush::logger()->warning('Drush command terminated abnormally. Check for an exit() in your Drupal site.'); + // Make sure that we will return an error code when we exit, + // even if the code that got us here did not. + if (!Runtime::exitCode()) { + Runtime::setExitCode(DrushCommands::EXIT_FAILURE); + } + } + + if (Drush::backend()) { + drush_backend_output(); + } + + // This way returnStatus() will always be the last shutdown function (unless other shutdown functions register shutdown functions...) + // and won't prevent other registered shutdown functions (IE from numerous cron methods) from running by calling exit() before they get a chance. + register_shutdown_function([$this, 'returnStatus']); + } + + /** + * @deprecated. This function will be removed in Drush 10. Throw an exception to indicate an error. + */ + public function returnStatus() + { + exit(Runtime::exitCode()); + } +} diff --git a/vendor/drush/drush/src/Runtime/TildeExpansionHook.php b/vendor/drush/drush/src/Runtime/TildeExpansionHook.php new file mode 100644 index 0000000000000000000000000000000000000000..93c13423140c6f89ec99437141c234e9a1345e63 --- /dev/null +++ b/vendor/drush/drush/src/Runtime/TildeExpansionHook.php @@ -0,0 +1,47 @@ +<?php + +namespace Drush\Runtime; + +use Consolidation\AnnotatedCommand\CommandData; +use Consolidation\AnnotatedCommand\Hooks\ValidatorInterface; +use Drush\Utils\StringUtils; +use Drush\Config\ConfigAwareTrait; +use Robo\Contract\ConfigAwareInterface; + +/** + * The TildeExpansionHook is installed as a preValidate hook that runs before + * all commands. Argument or option values containing a leading tilde will be expanded + * to an absolute path. + * + * This is a pre-validate hook because we do not want to do tilde expansion + * for commands that are redispatched to a remote site. That happens in the + * RedispatchHook, which happens in hook init. + */ +class TildeExpansionHook implements ValidatorInterface, ConfigAwareInterface +{ + use ConfigAwareTrait; + + public function validate(CommandData $commandData) + { + $input = $commandData->input(); + $args = $input->getArguments(); + $options = $input->getOptions(); + + foreach ($options as $name => $value) { + if (is_string($value)) { + $replaced = StringUtils::replaceTilde($value, $this->getConfig()->home()); + if ($value != $replaced) { + $input->setOption($name, $replaced); + } + } + } + foreach ($args as $name => $value) { + if (is_string($value)) { + $replaced = StringUtils::replaceTilde($value, $this->getConfig()->home()); + if ($value != $replaced) { + $input->setArgument($name, $replaced); + } + } + } + } +} diff --git a/vendor/drush/drush/src/SiteAlias/HostPath.php b/vendor/drush/drush/src/SiteAlias/HostPath.php new file mode 100644 index 0000000000000000000000000000000000000000..4fc895446cd4d6d0e67249d07e81c04ffbff67fd --- /dev/null +++ b/vendor/drush/drush/src/SiteAlias/HostPath.php @@ -0,0 +1,28 @@ +<?php +namespace Drush\SiteAlias; + +/** + * A host path is a path on some machine. The machine may be specified + * by a label, and the label may be an @alias or a site specification. + * If there is no label, then the local machine is assumed. + * + * Examples: + * + * @alias + * @alias:/path + * host:/path + * user@host:/path + * user@host/drupal-root#uri:/path + * /path + * + * Note that /path does not have to begin with a '/'; it may + * be a relative path, or it may begin with a path alias, + * e.g. '%files'. + * + * It is permissible to have an alias or site specification + * without a path, but it is not valid to have just a host + * with no path. + */ +class HostPath extends \Consolidation\SiteAlias\HostPath +{ +} diff --git a/vendor/drush/drush/src/SiteAlias/LegacyAliasConverter.php b/vendor/drush/drush/src/SiteAlias/LegacyAliasConverter.php new file mode 100644 index 0000000000000000000000000000000000000000..3bb1e7a00a9d93d2cd750abb314120f1ccfaa92b --- /dev/null +++ b/vendor/drush/drush/src/SiteAlias/LegacyAliasConverter.php @@ -0,0 +1,510 @@ +<?php +namespace Drush\SiteAlias; + +use Symfony\Component\Yaml\Yaml; +use Dflydev\DotAccessData\Data; +use Consolidation\SiteAlias\SiteAliasFileDiscovery; + +/** + * Find all legacy alias files and convert them to an equivalent '.yml' file. + * + * We will check the respective mod date of the legacy file and the generated + * file, and update the generated file when the legacy file changes. + */ +class LegacyAliasConverter +{ + /** + * @var SiteAliasFileDiscovery + */ + protected $discovery; + + /** + * @var string + */ + protected $target; + + /** + * @var boolean + */ + protected $converted; + + /** + * @var boolean + */ + protected $simulate = false; + + /** + * @var array + */ + protected $convertedFileMap = []; + + /** + * LegacyAliasConverter constructor. + * + * @param SiteAliasFileDiscovery $discovery Provide the same discovery + * object as used by the SiteAliasFileLoader to ensure that the same + * search locations are used for both classed. + */ + public function __construct(SiteAliasFileDiscovery $discovery) + { + $this->discovery = $discovery; + $this->target = ''; + } + + /** + * @return bool + */ + public function isSimulate() + { + return $this->simulate; + } + + /** + * @param bool $simulate + */ + public function setSimulate($simulate) + { + $this->simulate = $simulate; + } + + /** + * @param string $target + * A directory to write to. If not provided, writes go into same dir as the corresponding legacy file. + */ + public function setTargetDir($target) + { + $this->target = $target; + } + + public function convertOnce() + { + if ($this->converted) { + return; + } + return $this->convert(); + } + + public function convert() + { + $this->converted = true; + $legacyFiles = $this->discovery->findAllLegacyAliasFiles(); + + if (!$this->checkAnyNeedsConversion($legacyFiles)) { + return []; + } + + // We reconvert all legacy files together, because the aliases + // in the legacy files might be written into multiple different .yml + // files, depending on the naming conventions followed. + $convertedFiles = $this->convertAll($legacyFiles); + $this->writeAll($convertedFiles); + + return $convertedFiles; + } + + protected function checkAnyNeedsConversion($legacyFiles) + { + foreach ($legacyFiles as $legacyFile) { + $convertedFile = $this->determineConvertedFilename($legacyFile); + if ($this->checkNeedsConversion($legacyFile, $convertedFile)) { + return true; + } + } + return false; + } + + protected function convertAll($legacyFiles) + { + $result = []; + foreach ($legacyFiles as $legacyFile) { + $convertedFile = $this->determineConvertedFilename($legacyFile); + $conversionResult = $this->convertLegacyFile($legacyFile); + $result = static::arrayMergeRecursiveDistinct($result, $conversionResult); + + // If the conversion did not generate a similarly-named .yml file, then + // make sure that one is created simply to record the mod date. + if (!isset($result[$convertedFile])) { + $result[$convertedFile] = []; + } + } + return $result; + } + + protected function writeAll($convertedFiles) + { + foreach ($convertedFiles as $path => $data) { + $contents = $this->getContents($path, $data); + + // Write the converted file to the target directory + // if a target directory was set. + if (!empty($this->target)) { + $path = $this->target . '/' . basename($path); + } + $this->writeOne($path, $contents); + } + } + + protected function getContents($path, $data) + { + if (!empty($data)) { + $indent = 2; + return Yaml::dump($data, PHP_INT_MAX, $indent, false, true); + } + + $recoverSource = $this->recoverLegacyFile($path); + if (!$recoverSource) { + $recoverSource = 'the source alias file'; + } + $contents = <<<EOT +# This is a placeholder file used to track when $recoverSource was converted. +# If you delete $recoverSource, then you may delete this file. +EOT; + + return $contents; + } + + protected function writeOne($path, $contents) + { + $checksumPath = $this->checksumPath($path); + if ($this->safeToWrite($path, $contents, $checksumPath)) { + file_put_contents($path, $contents); + $this->saveChecksum($checksumPath, $path, $contents); + } + } + + /** + * Without any safeguards, the conversion process could be very + * dangerous to users who modify their converted alias files (as we + * would encourage them to do, if the goal is to convert!). + * + * This method determines whether it is safe to write to the converted + * alias file at the specified path. If the user has modified the target + * file, then we will not overwrite it. + */ + protected function safeToWrite($path, $contents, $checksumPath) + { + // Bail if simulate mode is enabled. + if ($this->isSimulate()) { + return true; + } + + // If the target file does not exist, it is always safe to write. + if (!file_exists($path)) { + return true; + } + + // If the user deletes the checksum file, then we will never + // overwrite the file again. This also covers potential collisions, + // where the user might not realize that a legacy alias file + // would write to a new site.yml file they created manually. + if (!file_exists($checksumPath)) { + return false; + } + + // Read the data that exists at the target path, and calculate + // the checksum of what exists there. + $previousContents = file_get_contents($path); + $previousChecksum = $this->calculateChecksum($previousContents); + $previousWrittenChecksum = $this->readChecksum($checksumPath); + + // If the checksum of what we wrote before is the same as + // the checksum we cached in the checksum file, then there has + // been no user modification of this file, and it is safe to + // overwrite it. + return $previousChecksum == $previousWrittenChecksum; + } + + public function saveChecksum($checksumPath, $path, $contents) + { + $name = basename($path); + $comment = <<<EOT +# Checksum for converted Drush alias file $name. +# Delete this checksum file or modify $name to prevent further updates to it. +EOT; + $checksum = $this->calculateChecksum($contents); + @mkdir(dirname($checksumPath)); + file_put_contents($checksumPath, "{$comment}\n{$checksum}"); + } + + protected function readChecksum($checksumPath) + { + $checksumContents = file_get_contents($checksumPath); + $checksumContents = preg_replace('/^#.*/m', '', $checksumContents); + + return trim($checksumContents); + } + + protected function checksumPath($path) + { + return dirname($path) . '/.checksums/' . basename($path, '.yml') . '.md5'; + } + + protected function calculateChecksum($data) + { + return md5($data); + } + + protected function determineConvertedFilename($legacyFile) + { + $convertedFile = preg_replace('#\.alias(|es)\.drushrc\.php$#', '.site.yml', $legacyFile); + // Sanity check: if no replacement was done on the filesystem, then + // we will presume that no conversion is needed here after all. + if ($convertedFile == $legacyFile) { + return false; + } + // If a target directory was set, then the converted file will + // be written there. This will be done in writeAll(); we will strip + // off everything except for the basename here. If no target + // directory was set, then we will keep the path to the converted + // file so that it may be written to the correct location. + if (!empty($this->target)) { + $convertedFile = basename($convertedFile); + } + $this->cacheConvertedFilePath($legacyFile, $convertedFile); + return $convertedFile; + } + + protected function cacheConvertedFilePath($legacyFile, $convertedFile) + { + $this->convertedFileMap[basename($convertedFile)] = basename($legacyFile); + } + + protected function recoverLegacyFile($convertedFile) + { + if (!isset($this->convertedFileMap[basename($convertedFile)])) { + return false; + } + return $this->convertedFileMap[basename($convertedFile)]; + } + + protected function checkNeedsConversion($legacyFile, $convertedFile) + { + // If determineConvertedFilename did not return a valid result, + // then force no conversion. + if (!$convertedFile) { + return; + } + + // Sanity check: the source file must exist. + if (!file_exists($legacyFile)) { + return false; + } + + // If the target file does not exist, then force a conversion + if (!file_exists($convertedFile)) { + return true; + } + + // We need to re-convert if the legacy file has been modified + // more recently than the converted file. + return filemtime($legacyFile) > filemtime($convertedFile); + } + + protected function convertLegacyFile($legacyFile) + { + $aliases = []; + $options = []; + // Include the legacy file. In theory, this will define $aliases &/or $options. + if (((@include $legacyFile) === false) || (!isset($aliases) && !isset($options))) { + // TODO: perhaps we should log a warning? + return; + } + + // Decide whether this is a single-alias file or a multiple-alias file. + if (preg_match('#\.alias\.drushrc\.php$#', $legacyFile)) { + return $this->convertSingleAliasLegacyFile($legacyFile, $options ?: current($aliases)); + } + return $this->convertMultipleAliasesLegacyFile($legacyFile, $aliases, $options); + } + + protected function convertSingleAliasLegacyFile($legacyFile, $options) + { + $aliasName = basename($legacyFile, '.alias.drushrc.php'); + + return $this->convertAlias($aliasName, $options, dirname($legacyFile)); + } + + protected function convertMultipleAliasesLegacyFile($legacyFile, $aliases, $options) + { + $result = []; + foreach ($aliases as $aliasName => $data) { + // 'array_merge' is how Drush 8 combines these records. + $data = array_merge($options, $data); + $convertedAlias = $this->convertAlias($aliasName, $data, dirname($legacyFile)); + $result = static::arrayMergeRecursiveDistinct($result, $convertedAlias); + } + return $result; + } + + protected function convertAlias($aliasName, $data, $dir = '') + { + $env = 'dev'; + // We allow $aliasname to be: + // - sitename + // - sitename.env + // - group.sitename.env + // In the case of the last, we will convert to + // 'group-sitename.env' (and so on for any additional dots). + // First, we will strip off the 'env' if it is present. + if (preg_match('/(.*)\.([^.]+)$/', $aliasName, $matches)) { + $aliasName = $matches[1]; + $env = $matches[2]; + } + // Convert all remaining dots to dashes. + $aliasName = strtr($aliasName, '.', '-'); + + $data = $this->fixSiteData($data); + + return $this->convertSingleFileAlias($aliasName, $env, $data, $dir); + } + + protected function fixSiteData($data) + { + $keyMap = $this->keyConversion(); + + $options = []; + foreach ($data as $key => $value) { + if ($key[0] == '#') { + unset($data[$key]); + } elseif (!isset($keyMap[$key])) { + $options[$key] = $data[$key]; + unset($data[$key]); + } + } + ksort($options); + + foreach ($keyMap as $fromKey => $toKey) { + if (isset($data[$fromKey]) && ($fromKey != $toKey)) { + $data[$toKey] = $data[$fromKey]; + unset($data[$fromKey]); + } + } + + if (!empty($options)) { + $data['options'] = $options; + } + if (isset($data['paths'])) { + $data['paths'] = $this->removePercentFromKey($data['paths']); + } + ksort($data); + + return $this->remapData($data); + } + + protected function remapData($data) + { + $converter = new Data($data); + + foreach ($this->dataRemap() as $from => $to) { + if ($converter->has($from)) { + $converter->set($to, $converter->get($from)); + $converter->remove($from); + } + } + + return $converter->export(); + } + + /** + * Anything in the key of the returned array is converted + * and written to a new top-level item in the result. + * + * Anything NOT identified by the key in the returned array + * is moved to the 'options' element. + */ + protected function keyConversion() + { + return [ + 'remote-host' => 'host', + 'remote-user' => 'user', + 'root' => 'root', + 'uri' => 'uri', + 'path-aliases' => 'paths', + ]; + } + + /** + * This table allows for flexible remapping from one location + * in the original alias to any other location in the target + * alias. + * + * n.b. Most arbitrary data from the original alias will have + * been moved into the 'options' element before this remapping + * table is consulted. + */ + protected function dataRemap() + { + return [ + 'options.ssh-options' => 'ssh.options', + ]; + } + + protected function removePercentFromKey($data) + { + return + array_flip( + array_map( + function ($item) { + return ltrim($item, '%'); + }, + array_flip($data) + ) + ); + } + + protected function convertSingleFileAlias($aliasName, $env, $data, $dir = '') + { + $filename = $this->outputFilename($aliasName, '.site.yml', $dir); + return [ + $filename => [ + $env => $data, + ], + ]; + } + + protected function outputFilename($name, $extension, $dir = '') + { + $filename = "{$name}{$extension}"; + // Just return the filename part if no directory was provided. Also, + // the directoy is irrelevant if a target directory is set. + if (empty($dir) || !empty($this->target)) { + return $filename; + } + return "$dir/$filename"; + } + + /** + * Merges arrays recursively while preserving. + * + * @param array $array1 + * @param array $array2 + * + * @return array + * + * @see http://php.net/manual/en/function.array-merge-recursive.php#92195 + * @see https://github.com/grasmash/bolt/blob/robo-rebase/src/Robo/Common/ArrayManipulator.php#L22 + */ + protected static function arrayMergeRecursiveDistinct( + array &$array1, + array &$array2 + ) { + $merged = $array1; + foreach ($array2 as $key => &$value) { + $merged[$key] = self::mergeRecursiveValue($merged, $key, $value); + } + ksort($merged); + return $merged; + } + + /** + * Process the value in an arrayMergeRecursiveDistinct - make a recursive + * call if needed. + */ + private static function mergeRecursiveValue(&$merged, $key, $value) + { + if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { + return self::arrayMergeRecursiveDistinct($merged[$key], $value); + } + return $value; + } +} diff --git a/vendor/drush/drush/lib/Drush/SiteAlias/ProcessManager.php b/vendor/drush/drush/src/SiteAlias/ProcessManager.php similarity index 97% rename from vendor/drush/drush/lib/Drush/SiteAlias/ProcessManager.php rename to vendor/drush/drush/src/SiteAlias/ProcessManager.php index 0060946cc34a812dc7a7518dd3c420a951e90879..cc26d8aa28fc949a7498a7cef4da41885f63ac57 100644 --- a/vendor/drush/drush/lib/Drush/SiteAlias/ProcessManager.php +++ b/vendor/drush/drush/src/SiteAlias/ProcessManager.php @@ -3,15 +3,15 @@ use Consolidation\SiteProcess\ProcessManager as ConsolidationProcessManager; +use Consolidation\SiteProcess\Util\Escape; +use Psr\Log\LoggerInterface; use Consolidation\SiteAlias\SiteAliasInterface; use Consolidation\SiteProcess\Factory\TransportFactoryInterface; +use Symfony\Component\Process\Process; +use Drush\Drush; +use Drush\Style\DrushStyle; use Consolidation\SiteProcess\ProcessBase; use Consolidation\SiteProcess\SiteProcess; -use Consolidation\SiteProcess\Util\Escape; -use Drush\Drush; -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Process\Process; use Webmozart\PathUtil\Path; /** @@ -152,7 +152,7 @@ protected static function configureProcess(ProcessBase $process) $process->setVerbose(Drush::verbose()); $process->inheritEnvironmentVariables(); $process->setLogger(Drush::logger()); - $process->setRealtimeOutput(new SymfonyStyle(Drush::input(), Drush::output())); + $process->setRealtimeOutput(new DrushStyle(Drush::input(), Drush::output())); $process->setTimeout(Drush::getTimeout()); return $process; } diff --git a/vendor/drush/drush/src/SiteAlias/SiteAliasFileLoader.php b/vendor/drush/drush/src/SiteAlias/SiteAliasFileLoader.php new file mode 100644 index 0000000000000000000000000000000000000000..dc6b617f1166beea99fa2daecfd270a50cc119fe --- /dev/null +++ b/vendor/drush/drush/src/SiteAlias/SiteAliasFileLoader.php @@ -0,0 +1,24 @@ +<?php +namespace Drush\SiteAlias; + +use Drush\SiteAlias\Util\InternalYamlDataFileLoader; + +/** + * Discover alias files: + * + * - sitename.site.yml: contains multiple aliases, one for each of the + * environments of 'sitename'. + */ +class SiteAliasFileLoader extends \Consolidation\SiteAlias\SiteAliasFileLoader +{ + /** + * SiteAliasFileLoader constructor + * + * @param SiteAliasFileDiscovery|null $discovery + */ + public function __construct($discovery = null) + { + parent::__construct($discovery); + $this->addLoader('yml', new InternalYamlDataFileLoader()); + } +} diff --git a/vendor/drush/drush/src/SiteAlias/SiteAliasManagerAwareInterface.php b/vendor/drush/drush/src/SiteAlias/SiteAliasManagerAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..dafb14e5b021b6535450cd44e9c7def7c95bb255 --- /dev/null +++ b/vendor/drush/drush/src/SiteAlias/SiteAliasManagerAwareInterface.php @@ -0,0 +1,9 @@ +<?php +namespace Drush\SiteAlias; + +/** + * Inflection interface for the site alias manager. + */ +interface SiteAliasManagerAwareInterface extends \Consolidation\SiteAlias\SiteAliasManagerAwareInterface +{ +} diff --git a/vendor/drush/drush/src/SiteAlias/SiteAliasManagerAwareTrait.php b/vendor/drush/drush/src/SiteAlias/SiteAliasManagerAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..f77a8fe6fc97d7ffc23ebf0676cd8d2851f1e733 --- /dev/null +++ b/vendor/drush/drush/src/SiteAlias/SiteAliasManagerAwareTrait.php @@ -0,0 +1,36 @@ +<?php +namespace Drush\SiteAlias; + +/** + * Inflection trait for the site alias manager. + * + * @deprecated Use \Consolidation\SiteAlias\SiteAliasManagerAwareTrait + */ +trait SiteAliasManagerAwareTrait +{ + protected $siteAliasManager; + + /** + * @inheritdoc + */ + public function setSiteAliasManager($siteAliasManager) + { + $this->siteAliasManager = $siteAliasManager; + } + + /** + * @return SiteAliasManager + */ + public function siteAliasManager() + { + return $this->siteAliasManager; + } + + /** + * @inheritdoc + */ + public function hasSiteAliasManager() + { + return isset($this->siteAliasManager); + } +} diff --git a/vendor/drush/drush/src/SiteAlias/SiteAliasName.php b/vendor/drush/drush/src/SiteAlias/SiteAliasName.php new file mode 100644 index 0000000000000000000000000000000000000000..f936c97a5830a549e9876aa405196fdc44f83d0e --- /dev/null +++ b/vendor/drush/drush/src/SiteAlias/SiteAliasName.php @@ -0,0 +1,47 @@ +<?php +namespace Drush\SiteAlias; + +/** + * Parse a string that contains a site alias name, and provide convenience + * methods to access the parts. + * + * When provided by users, aliases must be in one of the following forms: + * + * - @sitename.env: List only sitename and environment. + * + * - @env: Look up a named environment in instances where the site root + * is known (e.g. via cwd). In this form, there is an implicit sitename + * 'self' which is replaced by the actual site alias name once known. + * + * - @sitename: Provides only the sitename; uses the 'default' environment, + * or 'dev' if there is no 'default' (or whatever is there if there is + * only one). With this form, the site alias name has no environment + * until the appropriate default environment is looked up. This form + * is checked only after `@env` returns no matches. + * + * There are also two special aliases that are recognized: + * + * - @self: The current bootstrapped site. + * + * - @none: No alias ('root' and 'uri' unset). + * + * The special alias forms have no environment component. + * + * When provided to an API, the '@' is optional. + * + * Note that @sitename and @env are ambiguous. Aliases in this form + * (that are not one of the special aliases) will first be assumed + * to be @env, and may be converted to @sitename later. + * + * Note that: + * + * - 'sitename' and 'env' MUST NOT contain a '.' (unlike previous + * versions of Drush). + * - Users SHOULD NOT create any environments that have the same name + * as any site name (and visa-versa). + * - All environments in one site record SHOULD be different versions + * of the same site (e.g. dev / test / live). + */ +class SiteAliasName extends \Consolidation\SiteAlias\SiteAliasName +{ +} diff --git a/vendor/drush/drush/src/SiteAlias/SiteSpecParser.php b/vendor/drush/drush/src/SiteAlias/SiteSpecParser.php new file mode 100644 index 0000000000000000000000000000000000000000..896224fccd8673283150d6be175186e64e121913 --- /dev/null +++ b/vendor/drush/drush/src/SiteAlias/SiteSpecParser.php @@ -0,0 +1,15 @@ +<?php +namespace Drush\SiteAlias; + +/** + * Parse a string that contains a site specification. + * + * Site specifications contain some of the following elements: + * - user + * - host + * - path + * - uri (multisite selector) + */ +class SiteSpecParser extends \Consolidation\SiteAlias\SiteSpecParser +{ +} diff --git a/vendor/drush/drush/src/SiteAlias/Util/InternalYamlDataFileLoader.php b/vendor/drush/drush/src/SiteAlias/Util/InternalYamlDataFileLoader.php new file mode 100644 index 0000000000000000000000000000000000000000..be139be22697f08a5587af5e4b3b68abfd8f8a81 --- /dev/null +++ b/vendor/drush/drush/src/SiteAlias/Util/InternalYamlDataFileLoader.php @@ -0,0 +1,16 @@ +<?php +namespace Drush\SiteAlias\Util; + +use Drush\Internal\Config\Yaml\Yaml; +use Consolidation\SiteAlias\DataFileLoaderInterface; + +class InternalYamlDataFileLoader implements DataFileLoaderInterface +{ + /** + * @inheritdoc + */ + public function load($path) + { + return (array) Yaml::parse(file_get_contents($path)); + } +} diff --git a/vendor/drush/drush/src/Sql/SqlBase.php b/vendor/drush/drush/src/Sql/SqlBase.php new file mode 100644 index 0000000000000000000000000000000000000000..ca22aa66cd4a5efa33c5b8b6f509100bbdc9cd55 --- /dev/null +++ b/vendor/drush/drush/src/Sql/SqlBase.php @@ -0,0 +1,632 @@ +<?php + +namespace Drush\Sql; + +use Consolidation\SiteProcess\Util\Escape; +use Drupal\Core\Database\Database; +use Drush\Drush; +use Drush\Utils\FsUtils; +use Drush\Config\ConfigAwareTrait; +use Robo\Contract\ConfigAwareInterface; +use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Process\Process; +use Webmozart\PathUtil\Path; +use Consolidation\Config\Util\Interpolator; + +class SqlBase implements ConfigAwareInterface +{ + + use SqlTableSelectionTrait; + use ConfigAwareTrait; + + // An Drupal style array containing specs for connecting to database. + public $dbSpec; + + // Default code appended to sql connections. + public $queryExtra = ''; + + // The way you pass a sql file when issueing a query. + public $queryFile = '<'; + + // An options array. + public $options; + + /** + * @var Process + */ + protected $process; + + /** + * Typically, SqlBase instances are constructed via SqlBase::create($options). + */ + public function __construct($db_spec, $options) + { + $this->dbSpec = $db_spec; + $this->options = $options; + } + + /** + * Get environment variables to pass to Process. + */ + public function getEnv() + { + } + + /** + * Get the last used Process. + * + * @return Process + */ + public function getProcess() + { + return $this->process; + } + + /** + * @param Process $process + */ + public function setProcess($process) + { + $this->process = $process; + } + + /** + * Get a driver specific instance of this class. + * + * @param $options + * An options array as handed to a command callback. + * @return SqlBase + */ + public static function create($options = []) + { + // Set defaults in the unfortunate event that caller doesn't provide values. + $options += [ + 'database' => 'default', + 'target' => 'default', + 'db-url' => null, + 'databases' => null, + 'db-prefix' => null, + ]; + $database = $options['database']; + $target = $options['target']; + + if ($url = $options['db-url']) { + $url = is_array($url) ? $url[$database] : $url; + $db_spec = self::dbSpecFromDbUrl($url); + $db_spec['prefix'] = $options['db-prefix']; + return self::getInstance($db_spec, $options); + } elseif (($databases = $options['databases']) && (array_key_exists($database, $databases)) && (array_key_exists($target, $databases[$database]))) { + // @todo 'databases' option is not declared anywhere? + $db_spec = $databases[$database][$target]; + return self::getInstance($db_spec, $options); + } elseif ($info = Database::getConnectionInfo($database)) { + $db_spec = $info[$target]; + return self::getInstance($db_spec, $options); + } else { + throw new \Exception(dt('Unable to load Drupal settings. Check your --root, --uri, etc.')); + } + } + + public static function getInstance($db_spec, $options) + { + $driver = $db_spec['driver']; + $class_name = 'Drush\Sql\Sql'. ucfirst($driver); + $instance = new $class_name($db_spec, $options); + // Inject config + $instance->setConfig(Drush::config()); + return $instance; + } + + /* + * Get the current $db_spec. + */ + public function getDbSpec() + { + return $this->dbSpec; + } + + /** + * Set the current db spec. + * + * @param array $dbSpec + */ + public function setDbSpec($dbSpec) + { + $this->dbSpec = $dbSpec; + } + + /** + * The unix command used to connect to the database. + * @return string + */ + public function command() + { + } + + /** + * A string for connecting to a database. + * + * @param bool $hide_password + * If TRUE, DBMS should try to hide password from process list. + * On mysql, that means using --defaults-file to supply the user+password. + * + * @return string + */ + public function connect($hide_password = true) + { + return trim($this->command() . ' ' . $this->creds($hide_password) . ' ' . $this->getOption('extra', $this->queryExtra)); + } + + + /* + * Execute a SQL dump and return the path to the resulting dump file. + * + * @return string|bool + * Returns path to dump file, or false on failure. + */ + public function dump() + { + /** @var string|bool $file Path where dump file should be stored. If TRUE, generate a path based on usual backup directory and current date.*/ + $file = $this->getOption('result-file'); + $file_suffix = ''; + $table_selection = $this->getExpandedTableSelection($this->getOptions(), $this->listTables()); + $file = $this->dumpFile($file); + $cmd = $this->dumpCmd($table_selection); + $pipefail = ''; + // Gzip the output from dump command(s) if requested. + if ($this->getOption('gzip')) { + // See https://github.com/drush-ops/drush/issues/3816. + $pipefail = $this->getConfig()->get('sh.pipefail', 'bash -c "set -o pipefail; {{cmd}}"'); + $cmd .= " | gzip -f"; + $file_suffix .= '.gz'; + } + if ($file) { + $file .= $file_suffix; + $cmd .= ' > ' . Escape::shellArg($file); + } + $cmd = $this->addPipeFail($cmd, $pipefail); + + $process = Drush::shell($cmd, null, $this->getEnv()); + // Avoid the php memory of saving stdout. + $process->disableOutput(); + // Show dump in real-time on stdout, for backward compat. + $process->run($process->showRealtime()); + return $process->isSuccessful() ? $file : false; + } + + /** + * Handle 'pipefail' option for the specified command. + * + * @param string $cmd Script command to execute; should contain a pipe command + * @param string $pipefail Script statements to insert into / wrap around $cmd + * @return string Result varies based on value of $pipefail + * - empty: Return $cmd unmodified + * - simple string: Return $cmd appended to $pipefail + * - interpolated: Add slashes to $cmd and insert in $pipefail + * + * Interpolation is particularly for environments such as Ubuntu + * that use something other than bash as the default shell. To + * make pipefail work right in this instance, we must wrap it + * in 'bash -c', since pipefail is a bash feature. + */ + protected function addPipeFail($cmd, $pipefail) + { + if (empty($pipefail)) { + return $cmd; + } + if (strpos($pipefail, '{{cmd}}') === false) { + return $pipefail . ' ' . $cmd; + } + $interpolator = new Interpolator(); + $replacements = [ + 'cmd' => str_replace('"', '\\"', $cmd), + ]; + return $interpolator->interpolate($replacements, $pipefail); + } + + /* + * Build bash for dumping a database. + * + * @param array $table_selection + * Supported keys: 'skip', 'structure', 'tables'. + * @return string + * One or more mysqldump/pg_dump/sqlite3/etc statements that are ready for executing. + * If multiple statements are needed, enclose in parenthesis. + */ + public function dumpCmd($table_selection) + { + } + + /* + * Generate a path to an output file for a SQL dump when needed. + * + * @param string|bool @file + * If TRUE, generate a path based on usual backup directory and current date. + * Otherwise, just return the path that was provided. + */ + public function dumpFile($file) + { + $database = $this->dbSpec['database']; + + // $file is passed in to us usually via --result-file. If the user + // has set $options['result-file'] = 'auto', then we + // will generate an SQL dump file in the backup directory. + if ($file) { + if ($file === 'auto') { + $backup_dir = FsUtils::prepareBackupDir($database); + if (empty($backup_dir)) { + $backup_dir = $this->getConfig()->tmp(); + } + $file = Path::join($backup_dir, '@DATABASE_@DATE.sql'); + } + $file = str_replace(['@DATABASE', '@DATE'], [$database, gmdate('Ymd_His')], $file); + } + return $file; + } + + /** + * Execute a SQL query. Respect simulate mode. + * + * If you don't want to query results to print during --debug then + * provide a $result_file whose value can be drush_bit_bucket(). + * + * @param string $query + * The SQL to be executed. Should be NULL if $input_file is provided. + * @param string $input_file + * A path to a file containing the SQL to be executed. + * @param string $result_file + * A path to save query results to. Can be drush_bit_bucket() if desired. + * + * @return boolean + * TRUE on success, FALSE on failure + */ + public function query($query, $input_file = null, $result_file = '') + { + if (!Drush::simulate()) { + return $this->alwaysQuery($query, $input_file, $result_file); + } + $this->logQueryInDebugMode($query, $input_file); + } + + /** + * Execute a SQL query. Always execute regardless of simulate mode. + * + * If you don't want results to print during --debug then + * provide a $result_file whose value can be drush_bit_bucket(). + * + * @param string $query + * The SQL to be executed. Should be null if $input_file is provided. + * @param string $input_file + * A path to a file containing the SQL to be executed. + * @param string $result_file + * A path to save query results to. Can be drush_bit_bucket() if desired. + * + * @return boolean + * TRUE on success, FALSE on failure + */ + public function alwaysQuery($query, $input_file = null, $result_file = '') + { + $input_file_original = $input_file; + if ($input_file && drush_file_is_tarball($input_file)) { + $process = Drush::process(['gzip', '-df', $input_file]); + $process->setSimulated(false); + $process->run(); + $this->setProcess($process); + if ($process->isSuccessful()) { + $input_file = trim($input_file, '.gz'); + } else { + Drush::logger()->error(dt('Failed to decompress input file.')); + return false; + } + } + + // Save $query to a tmp file if needed. We redirect it in. + if (!$input_file) { + $query = $this->queryPrefix($query); + $query = $this->queryFormat($query); + $input_file = drush_save_data_to_temp_file($query); + } + + $parts = [ + $this->command(), + $this->creds(), + $this->silent(), // This removes column header and various helpful things in mysql. + $this->getOption('extra', $this->queryExtra), + $this->queryFile, + Escape::shellArg($input_file), + ]; + $exec = implode(' ', $parts); + + if ($result_file) { + $exec .= ' > '. Escape::shellArg($result_file); + } + + // In --verbose mode, Process will show the call to mysql/psql/sqlite, + // but the sql query itself is stored in a temp file and not displayed. + // We show the query when --debug is used and this function created the temp file. + $this->logQueryInDebugMode($query, $input_file_original); + + $process = Drush::shell($exec, null, $this->getEnv()); + $process->setSimulated(false); + $process->run(); + $success = $process->isSuccessful(); + $this->setProcess($process); + + if ($success && $this->getOption('file-delete')) { + $fs = new Filesystem(); + $fs->remove($input_file); + } + + return $success; + } + + /** + * Show the query in debug mode and simulate mode + */ + protected function logQueryInDebugMode($query, $input_file_original) + { + // In --verbose mode, Drush::process() will show the call to mysql/psql/sqlite, + // but the sql query itself is stored in a temp file and not displayed. + // We show the query when --debug is used and this function created the temp file. + if ((Drush::debug() || Drush::simulate()) && empty($input_file_original)) { + Drush::logger()->info('sql:query: ' . $query); + } + } + + /* + * A string to add to the command when queries should not print their results. + */ + public function silent() + { + } + + + public function queryPrefix($query) + { + // Inject table prefixes as needed. + if (Drush::bootstrapManager()->hasBootstrapped(DRUSH_BOOTSTRAP_DRUPAL_DATABASE)) { + // Enable prefix processing which can be dangerous so off by default. See http://drupal.org/node/1219850. + if ($this->getOption('db-prefix')) { + $query = Database::getConnection()->prefixTables($query); + } + } + return $query; + } + + + public function queryFormat($query) + { + return $query; + } + + /** + * Drop specified database. + * + * @param array $tables + * An array of table names + * @return boolean + * True if successful, FALSE if failed. + */ + public function drop($tables) + { + $return = true; + if ($tables) { + $sql = 'DROP TABLE '. implode(', ', $tables); + $return = $this->query($sql); + } + return $return; + } + + /** + * Build a SQL string for dropping and creating a database. + * + * @param string dbname + * The database name. + * @param boolean $quoted + * Quote the database name. Mysql uses backticks to quote which can cause problems + * in a Windows shell. Set TRUE if the CREATE is not running on the bash command line. + * @return string + */ + public function createdbSql($dbname, $quoted = false) + { + } + + /** + * Create a new database. + * + * @param boolean $quoted + * Quote the database name. Mysql uses backticks to quote which can cause problems + * in a Windows shell. Set TRUE if the CREATE is not running on the bash command line. + * @return boolean + * True if successful, FALSE otherwise. + */ + public function createdb($quoted = false) + { + $dbname = $this->getDbSpec()['database']; + $sql = $this->createdbSql($dbname, $quoted); + // Adjust connection to allow for superuser creds if provided. + $this->su(); + return $this->query($sql); + } + + /** + * Drop all tables (if DB exists) or CREATE target database. + * + * return boolean + * TRUE or FALSE depending on success. + */ + public function dropOrCreate() + { + if ($this->dbExists()) { + return $this->drop($this->listTables()); + } else { + return $this->createdb(); + } + } + + /* + * Determine if the specified DB already exists. + * + * @return bool + */ + public function dbExists() + { + } + + public function delete() + { + } + + /** + * Build a fragment connection parameters. + * + * @param bool $hide_password + * If TRUE, DBMS should try to hide password from process list. + * On mysql, that means using --defaults-file to supply the user+password. + * @return string + */ + public function creds($hide_password = true) + { + } + + /** + * The active database driver. + * @return string + */ + public function scheme() + { + return $this->dbSpec['driver']; + } + + /** + * Extract the name of all existing tables in the given database. + * + * @return array|null + * An array of table names which exist in the current database. + */ + public function listTables() + { + } + + /* + * Helper method to turn associative array into options with values. + * + * @return string + * A bash fragment. + */ + public function paramsToOptions($parameters) + { + // Turn each parameter into a valid parameter string. + $parameter_strings = []; + foreach ($parameters as $key => $value) { + // Only escape the values, not the keys or the rest of the string. + $value = drush_escapeshellarg($value); + $parameter_strings[] = "--$key=$value"; + } + + // Join the parameters and return. + return implode(' ', $parameter_strings); + } + + /** + * Adjust DB connection with superuser credentials if provided. + * + * The options 'db-su' and 'db-su-pw' will be retrieved from the + * specified site alias record. + * + * @return null + */ + public function su() + { + $create_db_target = $this->getDbSpec(); + + $create_db_target['database'] = ''; + $db_superuser = $this->getOption('db-su'); + if (!empty($db_superuser)) { + $create_db_target['username'] = $db_superuser; + } + $db_su_pw = $this->getOption('db-su-pw'); + // If --db-su-pw is not provided and --db-su is, default to empty password. + // This way db cli command will take password from .my.cnf or .pgpass. + if (!empty($db_su_pw)) { + $create_db_target['password'] = $db_su_pw; + } elseif (!empty($db_superuser)) { + unset($create_db_target['password']); + } + $this->setDbSpec($create_db_target); + } + + /** + * @return array + */ + public function getOptions() + { + return $this->options; + } + + public function getOption($name, $default = null) + { + $options = $this->getOptions(); + return array_key_exists($name, $options) && !is_null($options[$name]) ? $options[$name] : $default; + } + + /** + * @deprecated. + */ + public function db_spec() // @codingStandardsIgnoreLine + { + return $this->getDbSpec(); + } + + /** + * Convert from an old-style database URL to an array of database settings. + * + * @param db_url + * A Drupal 6 db url string to convert, or an array with a 'default' element. + * @return array + * An array of database values containing only the 'default' element of + * the db url. If the parse fails the array is empty. + */ + public static function dbSpecFromDbUrl($db_url) + { + $db_spec = []; + + if (is_array($db_url)) { + $db_url_default = $db_url['default']; + } else { + $db_url_default = $db_url; + } + + // If it's a sqlite database, pick the database path and we're done. + if (strpos($db_url_default, 'sqlite://') === 0) { + $db_spec = [ + 'driver' => 'sqlite', + 'database' => substr($db_url_default, strlen('sqlite://')), + ]; + } else { + $url = parse_url($db_url_default); + if ($url) { + // Fill in defaults to prevent notices. + $url += [ + 'scheme' => null, + 'user' => null, + 'pass' => null, + 'host' => null, + 'port' => null, + 'path' => null, + ]; + $url = (object)array_map('urldecode', $url); + $db_spec = [ + 'driver' => $url->scheme == 'mysqli' ? 'mysql' : $url->scheme, + 'username' => $url->user, + 'password' => $url->pass, + 'host' => $url->host, + 'port' => $url->port, + 'database' => ltrim($url->path, '/'), + ]; + } + } + + return $db_spec; + } +} diff --git a/vendor/drush/drush/src/Sql/SqlException.php b/vendor/drush/drush/src/Sql/SqlException.php new file mode 100644 index 0000000000000000000000000000000000000000..36b219fb9b6a5fd076973fc8d42be59d9b19941d --- /dev/null +++ b/vendor/drush/drush/src/Sql/SqlException.php @@ -0,0 +1,7 @@ +<?php + +namespace Drush\Sql; + +class SqlException extends \Exception +{ +} diff --git a/vendor/drush/drush/src/Sql/SqlMysql.php b/vendor/drush/drush/src/Sql/SqlMysql.php new file mode 100644 index 0000000000000000000000000000000000000000..ced026a2922fb99013f61d789b43870cd053d32b --- /dev/null +++ b/vendor/drush/drush/src/Sql/SqlMysql.php @@ -0,0 +1,180 @@ +<?php + +namespace Drush\Sql; + +use PDO; + +class SqlMysql extends SqlBase +{ + + public $queryExtra = '-A'; + + public function command() + { + return 'mysql'; + } + + public function creds($hide_password = true) + { + $dbSpec = $this->getDbSpec(); + if ($hide_password) { + // EMPTY password is not the same as NO password, and is valid. + $contents = <<<EOT +#This file was written by Drush's Sqlmysql.php. +[client] +user="{$dbSpec['username']}" +password="{$dbSpec['password']}" +EOT; + + $file = drush_save_data_to_temp_file($contents); + $parameters['defaults-file'] = $file; + } else { + // User is required. Drupal calls it 'username'. MySQL calls it 'user'. + $parameters['user'] = $dbSpec['username']; + // EMPTY password is not the same as NO password, and is valid. + if (isset($dbSpec['password'])) { + $parameters['password'] = $dbSpec['password']; + } + } + + // Some Drush commands (e.g. site-install) want to connect to the + // server, but not the database. Connect to the built-in database. + $parameters['database'] = empty($dbSpec['database']) ? 'information_schema' : $dbSpec['database']; + + // Default to unix socket if configured. + if (!empty($dbSpec['unix_socket'])) { + $parameters['socket'] = $dbSpec['unix_socket']; + } elseif (isset($dbSpec['host'])) { + // EMPTY host is not the same as NO host, and is valid (see unix_socket). + $parameters['host'] = $dbSpec['host']; + } + + if (!empty($dbSpec['port'])) { + $parameters['port'] = $dbSpec['port']; + } + + if (!empty($dbSpec['pdo']['unix_socket'])) { + $parameters['socket'] = $dbSpec['pdo']['unix_socket']; + } + + if (!empty($dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_CA])) { + $parameters['ssl-ca'] = $dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_CA]; + } + + if (!empty($dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_CAPATH])) { + $parameters['ssl-capath'] = $dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_CAPATH]; + } + + if (!empty($dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_CERT])) { + $parameters['ssl-cert'] = $dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_CERT]; + } + + if (!empty($dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_CIPHER])) { + $parameters['ssl-cipher'] = $dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_CIPHER]; + } + + if (!empty($dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_KEY])) { + $parameters['ssl-key'] = $dbSpec['pdo'][PDO::MYSQL_ATTR_SSL_KEY]; + } + + return $this->paramsToOptions($parameters); + } + + public function silent() + { + return '--silent'; + } + + public function createdbSql($dbname, $quoted = false) + { + $dbSpec = $this->getDbSpec(); + if ($quoted) { + $dbname = '`' . $dbname . '`'; + } + $sql[] = sprintf('DROP DATABASE IF EXISTS %s;', $dbname); + $sql[] = sprintf('CREATE DATABASE %s /*!40100 DEFAULT CHARACTER SET utf8 */;', $dbname); + $db_superuser = $this->getConfig()->get('sql.db-su'); + if (isset($db_superuser)) { + // - For a localhost database, create a localhost user. This is important for security. + // localhost is special and only allows local Unix socket file connections. + // - If the database is on a remote server, create a wildcard user with %. + // We can't easily know what IP address or hostname would represent our server. + $domain = ($dbSpec['host'] == 'localhost') ? 'localhost' : '%'; + $sql[] = sprintf('GRANT ALL PRIVILEGES ON %s.* TO \'%s\'@\'%s\'', $dbname, $dbSpec['username'], $domain); + $sql[] = sprintf("IDENTIFIED BY '%s';", $dbSpec['password']); + $sql[] = 'FLUSH PRIVILEGES;'; + } + return implode(' ', $sql); + } + + /** + * @inheritdoc + */ + public function dbExists() + { + // Suppress output. We only care about return value. + return $this->alwaysQuery("SELECT 1;"); + } + + public function listTables() + { + $tables = []; + $this->alwaysQuery('SHOW TABLES;'); + if ($out = trim($this->getProcess()->getOutput())) { + $tables = explode(PHP_EOL, $out); + } + return $tables; + } + + public function dumpCmd($table_selection) + { + $dbSpec = $this->getDbSpec(); + $parens = false; + $skip_tables = $table_selection['skip']; + $structure_tables = $table_selection['structure']; + $tables = $table_selection['tables']; + + $ignores = []; + $skip_tables = array_merge($structure_tables, $skip_tables); + $data_only = $this->getOption('data-only'); + // The ordered-dump option is only supported by MySQL for now. + $ordered_dump = $this->getOption('ordered-dump'); + + $exec = 'mysqldump '; + // mysqldump wants 'databasename' instead of 'database=databasename' for no good reason. + $only_db_name = str_replace('--database=', ' ', $this->creds()); + $exec .= $only_db_name; + + // We had --skip-add-locks here for a while to help people with insufficient permissions, + // but removed it because it slows down the import a lot. See http://drupal.org/node/1283978 + $extra = ' --no-autocommit --single-transaction --opt -Q'; + if ($data_only) { + $extra .= ' --no-create-info'; + } + if ($ordered_dump) { + $extra .= ' --skip-extended-insert --order-by-primary'; + } + if ($option = $this->getOption('extra-dump')) { + $extra .= " $option"; + } + $exec .= $extra; + + if (!empty($tables)) { + $exec .= ' ' . implode(' ', $tables); + } else { + // Append the ignore-table options. + foreach ($skip_tables as $table) { + $ignores[] = '--ignore-table=' . $dbSpec['database'] . '.' . $table; + $parens = true; + } + $exec .= ' '. implode(' ', $ignores); + + // Run mysqldump again and append output if we need some structure only tables. + if (!empty($structure_tables)) { + $exec .= " && mysqldump " . $only_db_name . " --no-data $extra " . implode(' ', $structure_tables); + $parens = true; + } + } + return $parens ? "($exec)" : $exec; + } +} diff --git a/vendor/drush/drush/src/Sql/SqlOracle.php b/vendor/drush/drush/src/Sql/SqlOracle.php new file mode 100644 index 0000000000000000000000000000000000000000..4886ad453b87a2baa9c38d81d35a600943546b2c --- /dev/null +++ b/vendor/drush/drush/src/Sql/SqlOracle.php @@ -0,0 +1,100 @@ +<?php + +namespace Drush\Sql; + +use Drush\Drush; +use Drush\Log\LogLevel; + +class SqlOracle extends SqlBase +{ + + // The way you pass a sql file when issueing a query. + public $queryFile = '@'; + + public function command() + { + // use rlwrap if available for readline support + if ($handle = popen('rlwrap -v', 'r')) { + $command = 'rlwrap sqlplus'; + pclose($handle); + } else { + $command = 'sqlplus'; + } + return $command; + } + + public function creds($hide_password = true) + { + return ' ' . $this->dbSpec['username'] . '/' . $this->dbSpec['password'] . ($this->dbSpec['host'] == 'USETNS' ? '@' . $this->dbSpec['database'] : '@//' . $this->dbSpec['host'] . ':' . ($db_spec['port'] ? $db_spec['port'] : '1521') . '/' . $this->dbSpec['database']); + } + + public function createdbSql($dbname, $quoted = false) + { + Drush::logger()->error("Unable to generate CREATE DATABASE sql for $dbname"); + return false; + } + + // @todo $suffix = '.sql'; + public function queryFormat($query) + { + // remove trailing semicolon from query if we have it + $query = preg_replace('/\;$/', '', $query); + + // some sqlplus settings + $settings[] = "set TRIM ON"; + $settings[] = "set FEEDBACK OFF"; + $settings[] = "set UNDERLINE OFF"; + $settings[] = "set PAGES 0"; + $settings[] = "set PAGESIZE 50000"; + + // are we doing a describe ? + if (!preg_match('/^ *desc/i', $query)) { + $settings[] = "set LINESIZE 32767"; + } + + // are we doing a show tables ? + if (preg_match('/^ *show tables/i', $query)) { + $settings[] = "set HEADING OFF"; + $query = "select object_name from user_objects where object_type='TABLE' order by object_name asc"; + } + + // create settings string + $sqlp_settings = implode("\n", $settings) . "\n"; + + // important for sqlplus to exit correctly + return "${sqlp_settings}${query};\nexit;\n"; + } + + public function listTables() + { + $return = $this->alwaysQuery("SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME NOT IN ('BLOBS','LONG_IDENTIFIERS')"); + $tables = drush_shell_exec_output(); + if (!empty($tables)) { + // Shift off the header of the column of data returned. + array_shift($tables); + return $tables; + } + } + + // @todo $file is no longer provided. We are supposed to return bash that can be piped to gzip. + // Probably Oracle needs to override dump() entirely - http://stackoverflow.com/questions/2236615/oracle-can-imp-exp-go-to-stdin-stdout. + public function dumpCmd($table_selection) + { + $create_db = $this->getOption('create-db'); + $exec = 'exp ' . $this->creds(); + // Change variable '$file' by reference in order to get drush_log() to report. + if (!$file) { + $file = $this->dbSpec['username'] . '.dmp'; + } + $exec .= ' file=' . $file; + + if (!empty($tables)) { + $exec .= ' tables="(' . implode(',', $tables) . ')"'; + } + $exec .= ' owner=' . $this->dbSpec['username']; + if ($option = $this->getOption('extra-dump', $this->queryExtra)) { + $exec .= " $option"; + } + return [$exec, $file]; + } +} diff --git a/vendor/drush/drush/src/Sql/SqlPgsql.php b/vendor/drush/drush/src/Sql/SqlPgsql.php new file mode 100644 index 0000000000000000000000000000000000000000..595252769edb8bba31e8529e30b516ee59425e34 --- /dev/null +++ b/vendor/drush/drush/src/Sql/SqlPgsql.php @@ -0,0 +1,181 @@ +<?php + +namespace Drush\Sql; + +use Drush\Drush; + +define('PSQL_SHOW_TABLES', "SELECT tablename FROM pg_tables WHERE schemaname='public';"); + +class SqlPgsql extends SqlBase +{ + + public $queryExtra = "--no-align --field-separator=\"\t\" --pset tuples_only=on"; + + public $queryFile = "--file"; + + private $password_file = null; + + private function createPasswordFile() + { + $dbSpec = $this->getDbSpec(); + if (null == ($this->getPasswordFile()) && isset($dbSpec['password'])) { + $pgpass_parts = [ + empty($dbSpec['host']) ? 'localhost' : $dbSpec['host'], + empty($dbSpec['port']) ? '5432' : $dbSpec['port'], + // Database + '*', + $dbSpec['username'], + $dbSpec['password'] + ]; + // Escape colon and backslash characters in entries. + // @see http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html + array_walk($pgpass_parts, function (&$part) { + // The order of the replacements is important so that backslashes are + // not replaced twice. + $part = str_replace(['\\', ':'], ['\\\\', '\:'], $part); + }); + $pgpass_contents = implode(':', $pgpass_parts); + $this->password_file = drush_save_data_to_temp_file($pgpass_contents); + chmod($this->password_file, 0600); + } + return $this->password_file; + } + + public function command() + { + return 'psql -q'; + } + + public function getEnv() + { + $pw_file = $this->createPasswordFile(); + if (isset($pw_file)) { + return ['PGPASSFILE' => $pw_file]; + } + } + + /* + * @param $hide_password + * Not used in postgres. Use .pgpass file instead. See http://drupal.org/node/438828. + */ + public function creds($hide_password = true) + { + $dbSpec = $this->getDbSpec(); + // Some drush commands (e.g. site-install) want to connect to the + // server, but not the database. Connect to the built-in database. + $parameters['dbname'] = empty($dbSpec['database']) ? 'template1' : $dbSpec['database']; + + // Host and port are optional but have defaults. + $parameters['host'] = empty($dbSpec['host']) ? 'localhost' : $dbSpec['host']; + $parameters['port'] = empty($dbSpec['port']) ? '5432' : $dbSpec['port']; + + // Username is required. + $parameters['username'] = $dbSpec['username']; + + // Don't set the password. + // @see http://drupal.org/node/438828 + + return $this->paramsToOptions($parameters); + } + + public function createdbSql($dbname, $quoted = false) + { + if ($quoted) { + $dbname = '"' . $dbname . '"'; + } + $sql[] = sprintf('drop database if exists %s;', $dbname); + $sql[] = sprintf("create database %s ENCODING 'UTF8';", $dbname); + return implode(' ', $sql); + } + + public function dbExists() + { + $dbSpec = $this->getDbSpec(); + $database = $dbSpec['database']; + // Get a new class instance that has no 'database'. + $db_spec_no_db = $dbSpec; + unset($db_spec_no_db['database']); + $sql_no_db = new SqlPgsql($db_spec_no_db, $this->getOptions()); + $query = "SELECT 1 AS result FROM pg_database WHERE datname='$database'"; + $process = Drush::shell($sql_no_db->connect() . ' -t -c ' . $query, null, $this->getEnv()); + $process->setSimulated(false); + $process->run(); + return $process->isSuccessful(); + } + + public function queryFormat($query) + { + if (strtolower($query) == 'show tables;') { + return PSQL_SHOW_TABLES; + } + return $query; + } + + public function listTables() + { + $return = $this->alwaysQuery(PSQL_SHOW_TABLES); + $tables = explode(PHP_EOL, trim($this->getProcess()->getOutput())); + return array_filter($tables); + } + + public function dumpCmd($table_selection) + { + $parens = false; + $skip_tables = $table_selection['skip']; + $structure_tables = $table_selection['structure']; + $tables = $table_selection['tables']; + + $ignores = []; + $skip_tables = array_merge($structure_tables, $skip_tables); + $data_only = $this->getOption('data-only'); + + $create_db = $this->getOption('create-db'); + + $environment = ""; + $pw_file = $this->createPasswordFile(); + if (isset($pw_file)) { + $environment = "PGPASSFILE={$pw_file} "; + } + $exec = "{$environment}pg_dump "; + // Unlike psql, pg_dump does not take a '--dbname=' before the database name. + $extra = str_replace('--dbname=', ' ', $this->creds()); + if ($data_only) { + $extra .= ' --data-only'; + } + if ($option = $this->getOption('extra-dump')) { + $extra .= " $option"; + } + $exec .= $extra; + $exec .= (!$create_db && !$data_only ? ' --clean' : ''); + + if (!empty($tables)) { + foreach ($tables as $table) { + $exec .= " --table=$table"; + } + } else { + foreach ($skip_tables as $table) { + $ignores[] = "--exclude-table=$table"; + } + $exec .= ' '. implode(' ', $ignores); + // Run pg_dump again and append output if we need some structure only tables. + if (!empty($structure_tables)) { + $parens = true; + $schemaonlies = []; + foreach ($structure_tables as $table) { + $schemaonlies[] = "--table=$table"; + } + $exec .= " && pg_dump --schema-only " . implode(' ', $schemaonlies) . $extra; + $exec .= (!$create_db && !$data_only ? ' --clean' : ''); + } + } + return $parens ? "($exec)" : $exec; + } + + /** + * @return string|null + */ + public function getPasswordFile() + { + return $this->password_file; + } +} diff --git a/vendor/drush/drush/src/Sql/SqlSqlite.php b/vendor/drush/drush/src/Sql/SqlSqlite.php new file mode 100644 index 0000000000000000000000000000000000000000..a78053fe46bfeedbc51c102b4549d7132a746220 --- /dev/null +++ b/vendor/drush/drush/src/Sql/SqlSqlite.php @@ -0,0 +1,111 @@ +<?php + +namespace Drush\Sql; + +use Drush\Drush; +use Drush\Log\LogLevel; +use mysql_xdevapi\Exception; + +class SqlSqlite extends SqlBase +{ + public function command() + { + return 'sqlite3'; + } + + public function creds($hide_password = true) + { + // SQLite doesn't do user management, instead relying on the filesystem + // for that. So the only info we really need is the path to the database + // file, and not as a "--key=value" parameter. + return ' ' . $this->getDbSpec()['database']; + } + + public function createdbSql($dbname, $quoted = false) + { + return ''; + } + + /** + * Create a new database. + * + * @param boolean $quoted + * Quote the database name. Mysql uses backticks to quote which can cause problems + * in a Windows shell. Set TRUE if the CREATE is not running on the bash command line. + */ + public function createdb($quoted = false) + { + $file = $this->getDbSpec()['database']; + if (file_exists($file)) { + Drush::logger()->debug("SQLITE: Deleting existing database '$file'"); + drush_delete_dir($file, true); + } + + // Make sure sqlite can create file + $path = dirname($file); + Drush::logger()->debug("SQLITE: creating '$path' for creating '$file'"); + if (!drush_mkdir($path)) { + throw new Exception("SQLITE: Cannot create $path"); + } + return file_exists($path); + } + + public function dbExists() + { + return file_exists($this->getDbSpec()['database']); + } + + public function listTables() + { + $return = $this->alwaysQuery('.tables'); + $tables_raw = explode(PHP_EOL, trim($this->getProcess()->getOutput())); + // SQLite's '.tables' command always outputs the table names in a column + // format, like this: + // table_alpha table_charlie table_echo + // table_bravo table_delta table_foxtrot + // …and there doesn't seem to be a way to fix that. So we need to do some + // clean-up. + $tables = []; + foreach ($tables_raw as $line) { + preg_match_all('/[^\s]+/', $line, $matches); + if (!empty($matches[0])) { + foreach ($matches[0] as $match) { + $tables[] = $match; + } + } + } + return $tables; + } + + public function drop($tables) + { + $return = true; + $sql = ''; + if ($tables) { + // SQLite only wants one table per DROP TABLE command (so we have to do + // "DROP TABLE foo; DROP TABLE bar;" instead of "DROP TABLE foo, bar;"). + foreach ($tables as $table) { + $sql .= "DROP TABLE $table; "; + } + $return = $this->query($sql); + } + return $return; + } + + public function dumpCmd($table_selection) + { + // Dumping is usually not necessary in SQLite, since all database data + // is stored in a single file which can be copied just + // like any other file. But it still has a use in migration purposes and + // building human-readable diffs and such, so let's do it anyway. + $exec = $this->connect(); + // SQLite's dump command doesn't support many of the features of its + // Postgres or MySQL equivalents. We may be able to fake some in the + // future, but for now, let's just support simple dumps. + $exec .= ' ".dump"'; + if ($option = $this->getOption('extra-dump')) { + $exec .= " $option"; + } + return $exec; + } +} diff --git a/vendor/drush/drush/src/Sql/SqlSqlsrv.php b/vendor/drush/drush/src/Sql/SqlSqlsrv.php new file mode 100644 index 0000000000000000000000000000000000000000..d8707c110edb8a08c48dfcea4d74f98ca43540a3 --- /dev/null +++ b/vendor/drush/drush/src/Sql/SqlSqlsrv.php @@ -0,0 +1,71 @@ +<?php + +namespace Drush\Sql; + +class SqlSqlsrv extends SqlBase +{ + + // The way you pass a sql file when issueing a query. + public $queryFile = '-h -1 -i'; + + public function command() + { + return 'sqlcmd'; + } + + public function creds($hide_password = true) + { + // Some drush commands (e.g. site-install) want to connect to the + // server, but not the database. Connect to the built-in database. + $dbSpec = $this->getDbSpec(); + $database = empty($dbSpec['database']) ? 'master' : $dbSpec['database']; + // Host and port are optional but have defaults. + $host = empty($dbSpec['host']) ? '.\SQLEXPRESS' : $dbSpec['host']; + if ($dbSpec['username'] == '') { + return ' -S ' . $host . ' -d ' . $database; + } else { + return ' -S ' . $host . ' -d ' . $database . ' -U ' . $dbSpec['username'] . ' -P ' . $dbSpec['password']; + } + } + + public function dbExists() + { + // TODO: untested, but the gist is here. + $dbSpec = $this->getDbSpec(); + $database = $dbSpec['database']; + // Get a new class instance that has no 'database'. + $db_spec_no_db = $dbSpec; + unset($db_spec_no_db['database']); + $sql_no_db = new SqlSqlsrv($db_spec_no_db, $this->getOptions()); + $query = "if db_id('$database') IS NOT NULL print 1"; + drush_always_exec($sql_no_db->connect() . ' -Q %s', $query); + $output = drush_shell_exec_output(); + return $output[0] == 1; + } + + public function listTables() + { + $return = $this->alwaysQuery('SELECT TABLE_NAME FROM information_schema.tables'); + $tables = drush_shell_exec_output(); + if (!empty($tables)) { + // Shift off the header of the column of data returned. + array_shift($tables); + return $tables; + } + } + + // @todo $file is no longer provided. We are supposed to return bash that can be piped to gzip. + // Probably sqlsrv needs to override dump() entirely. + public function dumpCmd($table_selection) + { + $dbSpec = $this->getDbSpec(); + if (!$file) { + $file = $dbSpec['database'] . '_' . date('Ymd_His') . '.bak'; + } + $exec = "sqlcmd -U \"" . $dbSpec['username'] . "\" -P \"" . $dbSpec['password'] . "\" -S \"" . $dbSpec['host'] . "\" -Q \"BACKUP DATABASE [" . $dbSpec['database'] . "] TO DISK='" . $file . "'\""; + if ($option = $this->getOption('extra-dump', $this->queryExtra)) { + $exec .= " $option"; + } + return [$exec, $file]; + } +} diff --git a/vendor/drush/drush/src/Sql/SqlTableSelectionTrait.php b/vendor/drush/drush/src/Sql/SqlTableSelectionTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..d998db1ff1b8f5653ba66681b0b22d426a99a177 --- /dev/null +++ b/vendor/drush/drush/src/Sql/SqlTableSelectionTrait.php @@ -0,0 +1,170 @@ +<?php +namespace Drush\Sql; + +use Drush\Utils\StringUtils; + +/** + * Note: when using this trait, also implement ConfigAwareInterface/ConfigAwareTrait. + * + * @package Drush\Sql + */ +trait SqlTableSelectionTrait +{ + + /** + * Given a list of all tables, expand the convert the wildcards in the + * option-provided lists into a list of actual table names. + * + * @param array $options An options array as passed to an Annotated Command. + * @param array $all_tables A list of all eligible tables. + * + * @return array + * An array of tables with each table name in the appropriate + * element of the array. + */ + public function getExpandedTableSelection($options, $all_tables) + { + $table_selection = $this->getTableSelection($options); + // Get the existing table names in the specified database. + if (isset($table_selection['skip'])) { + $table_selection['skip'] = $this->expandAndFilterTables($table_selection['skip'], $all_tables); + } + if (isset($table_selection['structure'])) { + $table_selection['structure'] = $this->expandAndFilterTables($table_selection['structure'], $all_tables); + } + if (isset($table_selection['tables'])) { + $table_selection['tables'] = $this->expandAndFilterTables($table_selection['tables'], $all_tables); + } + return $table_selection; + } + + /** + * Given the table names in the input array that may contain wildcards (`*`), + * expand the table names so that the array returned only contains table names + * that exist in the database. + * + * @param array $tables + * An array of table names where the table names may contain the + * `*` wildcard character. + * @param array $db_tables + * The list of tables present in a database. + * @return array + * An array of tables with non-existant tables removed. + */ + public function expandAndFilterTables($tables, $db_tables) + { + $expanded_tables = $this->ExpandWildcardTables($tables, $db_tables); + $tables = $this->filterTables(array_merge($tables, $expanded_tables), $db_tables); + $tables = array_unique($tables); + sort($tables); + return $tables; + } + + /** + * Expand wildcard tables. + * + * @param array $tables + * An array of table names, some of which may contain wildcards (`*`). + * @param array $db_tables + * An array with all the existing table names in the current database. + * @return + * $tables array with wildcards resolved to real table names. + */ + public function expandWildcardTables($tables, $db_tables) + { + // Table name expansion based on `*` wildcard. + $expanded_db_tables = []; + foreach ($tables as $k => $table) { + // Only deal with table names containing a wildcard. + if (strpos($table, '*') !== false) { + $pattern = '/^' . str_replace('*', '.*', $table) . '$/i'; + // Merge those existing tables which match the pattern with the rest of + // the expanded table names. + $expanded_db_tables += preg_grep($pattern, $db_tables); + } + } + return $expanded_db_tables; + } + + /** + * Filters tables. + * + * @param array $tables + * An array of table names to filter. + * @param array $db_tables + * An array with all the existing table names in the current database. + * @return + * An array with only valid table names (i.e. all of which actually exist in + * the database). + */ + public function filterTables($tables, $db_tables) + { + // Ensure all the tables actually exist in the database. + foreach ($tables as $k => $table) { + if (!in_array($table, $db_tables)) { + unset($tables[$k]); + } + } + + return $tables; + } + + /** + * Construct an array that places table names in appropriate + * buckets based on whether the table is to be skipped, included + * for structure only, or have structure and data dumped. + * The keys of the array are: + * - skip: tables to be skipped completed in the dump + * - structure: tables to only have their structure i.e. DDL dumped + * - tables: tables to have structure and data dumped + * + * @return array + * An array of table names with each table name in the appropriate + * element of the array. + */ + public function getTableSelection($options) + { + // Skip large core tables if instructed. Used by 'sql-drop/sql-dump/sql-sync' commands. + $skip_tables = $this->getRawTableList('skip-tables', $options); + // Skip any structure-tables as well. + $structure_tables = $this->getRawTableList('structure-tables', $options); + // Dump only the specified tables. Takes precedence over skip-tables and structure-tables. + $tables = $this->getRawTableList('tables', $options); + + return ['skip' => $skip_tables, 'structure' => $structure_tables, 'tables' => $tables]; + } + + /** + * Consult the specified options and return the list of tables specified. + * + * @param option_name + * The option name to check: skip-tables, structure-tables + * or tables. This function will check both *-key and *-list. + * @param array $options An options array as passed to an Annotated Command. + * @return array + * Returns an array of tables based on the first option + * found, or an empty array if there were no matches. + */ + public function getRawTableList($option_name, $options) + { + $key_list = StringUtils::csvToArray($options[$option_name . '-key']); + foreach ($key_list as $key) { + $all_tables = $this->getConfig()->get('sql.' . $option_name, []); + if (array_key_exists($key, $all_tables)) { + return $all_tables[$key]; + } + if ($option_name != 'tables') { + $all_tables = $this->getConfig()->get('sql.tables', []); + if (array_key_exists($key, $all_tables)) { + return $all_tables[$key]; + } + } + } + $table_list = $options[$option_name . '-list']; + if (!empty($table_list)) { + return StringUtils::csvToArray($table_list); + } + + return []; + } +} diff --git a/vendor/drush/drush/src/Style/DrushStyle.php b/vendor/drush/drush/src/Style/DrushStyle.php new file mode 100644 index 0000000000000000000000000000000000000000..89920a8f6963b4de2fa1fe9d7922392989f8659a --- /dev/null +++ b/vendor/drush/drush/src/Style/DrushStyle.php @@ -0,0 +1,60 @@ +<?php + +namespace Drush\Style; + +use Drush\Drush; +use Drush\Exceptions\UserAbortException; +use Symfony\Component\Console\Style\SymfonyStyle; + +class DrushStyle extends SymfonyStyle +{ + public function confirm($question, $default = true) + { + // Automatically accept confirmations if the --yes argument was supplied. + if (Drush::affirmative()) { + $this->comment($question . ': yes.'); + return true; + } elseif (Drush::negative()) { + // Automatically cancel confirmations if the --no argument was supplied. + $this->warning($question . ': no.'); + return false; + } + + $return = parent::confirm($question, $default); + return $return; + } + + /** + * @param string $question + * @param array $choices + * If an associative array is passed, the chosen *key* is returned. + * @param null $default + * @return mixed + */ + public function choice($question, array $choices, $default = null) + { + $choices = array_merge(['cancel' => 'Cancel'], $choices) ; + $choices_values = array_values($choices); + $return = parent::choice($question, $choices_values, $default); + if ($return == 'Cancel') { + throw new UserAbortException(); + } else { + return array_search($return, $choices); + } + } + + public function warning($message) + { + $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ! ', true); + } + + public function note($message) + { + $this->block($message, 'NOTE', 'fg=black;bg=yellow', ' ! '); + } + + public function caution($message) + { + $this->block($message, 'CAUTION', 'fg=black;bg=yellow', ' ! ', true); + } +} diff --git a/vendor/drush/drush/src/Symfony/BootstrapCompilerPass.php b/vendor/drush/drush/src/Symfony/BootstrapCompilerPass.php new file mode 100644 index 0000000000000000000000000000000000000000..11f0b97173673f70d47bfecf58f4ce8536cc0004 --- /dev/null +++ b/vendor/drush/drush/src/Symfony/BootstrapCompilerPass.php @@ -0,0 +1,31 @@ +<?php + +namespace Drush\Symfony; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Reference; + +class BootstrapCompilerPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container) + { + if (!$container->has('bootstrap.manager')) { + return; + } + + $definition = $container->findDefinition( + 'bootstrap.manager' + ); + + $taggedServices = $container->findTaggedServiceIds( + 'bootstrap.boot' + ); + foreach ($taggedServices as $id => $tags) { + $definition->addMethodCall( + 'add', + [new Reference($id)] + ); + } + } +} diff --git a/vendor/drush/drush/src/Symfony/BufferedConsoleOutput.php b/vendor/drush/drush/src/Symfony/BufferedConsoleOutput.php new file mode 100644 index 0000000000000000000000000000000000000000..7c2e4f7932fe79cb6a5bedf546f3dd287e8a97cc --- /dev/null +++ b/vendor/drush/drush/src/Symfony/BufferedConsoleOutput.php @@ -0,0 +1,44 @@ +<?php + +namespace Drush\Symfony; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; +use Symfony\Component\Console\Output\BufferedOutput; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * BufferedConsoleOutput supports separation of the stdout and stderr streams. + */ +class BufferedConsoleOutput extends BufferedOutput implements ConsoleOutputInterface +{ + protected $stderr; + + /** + * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) + * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) + * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) + */ + public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null) + { + parent::__construct($verbosity, $decorated, $formatter); + + $this->stderr = new BufferedOutput($this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); + } + + /** + * {@inheritdoc} + */ + public function getErrorOutput() + { + return $this->stderr; + } + + /** + * {@inheritdoc} + */ + public function setErrorOutput(OutputInterface $error) + { + $this->stderr = $error; + } +} diff --git a/vendor/drush/drush/src/Symfony/DrushArgvInput.php b/vendor/drush/drush/src/Symfony/DrushArgvInput.php new file mode 100644 index 0000000000000000000000000000000000000000..74e533155ba8b417fc0da619c70413bfdd36802e --- /dev/null +++ b/vendor/drush/drush/src/Symfony/DrushArgvInput.php @@ -0,0 +1,361 @@ +<?php + +/* + * + * A copy of ArgvInput (v3.4.2) while commenting out a section of hasParameterOption() per https://github.com/symfony/symfony/issues/25825. + * + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Symfony; + +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\InputDefinition; + +/** + * ArgvInput represents an input coming from the CLI arguments. + * + * Usage: + * + * $input = new ArgvInput(); + * + * By default, the `$_SERVER['argv']` array is used for the input values. + * + * This can be overridden by explicitly passing the input values in the constructor: + * + * $input = new ArgvInput($_SERVER['argv']); + * + * If you pass it yourself, don't forget that the first element of the array + * is the name of the running application. + * + * When passing an argument to the constructor, be sure that it respects + * the same rules as the argv one. It's almost always better to use the + * `StringInput` when you want to provide your own input. + * + * @author Fabien Potencier <fabien@symfony.com> + * + * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html + * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 + */ +class DrushArgvInput extends ArgvInput +{ + private $tokens; + private $parsed; + + /** + * @param array|null $argv An array of parameters from the CLI (in the argv format) + * @param InputDefinition|null $definition A InputDefinition instance + */ + public function __construct(array $argv = null, InputDefinition $definition = null) + { + if (null === $argv) { + $argv = $_SERVER['argv']; + } + + // strip the application name + array_shift($argv); + + $this->tokens = $argv; + + parent::__construct($definition); + } + + protected function setTokens(array $tokens) + { + $this->tokens = $tokens; + } + + /** + * {@inheritdoc} + */ + protected function parse() + { + $parseOptions = true; + $this->parsed = $this->tokens; + while (null !== $token = array_shift($this->parsed)) { + if ($parseOptions && '' == $token) { + $this->parseArgument($token); + } elseif ($parseOptions && '--' == $token) { + $parseOptions = false; + } elseif ($parseOptions && 0 === strpos($token, '--')) { + $this->parseLongOption($token); + } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { + $this->parseShortOption($token); + } else { + $this->parseArgument($token); + } + } + } + + /** + * Parses a short option. + * + * @param string $token The current token + */ + private function parseShortOption($token) + { + $name = substr($token, 1); + + if (strlen($name) > 1) { + if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { + // an option with a value (with no space) + $this->addShortOption($name[0], substr($name, 1)); + } else { + $this->parseShortOptionSet($name); + } + } else { + $this->addShortOption($name, null); + } + } + + /** + * Parses a short option set. + * + * @param string $name The current token + * + * @throws RuntimeException When option given doesn't exist + */ + private function parseShortOptionSet($name) + { + $len = strlen($name); + for ($i = 0; $i < $len; ++$i) { + if (!$this->definition->hasShortcut($name[$i])) { + throw new RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); + } + + $option = $this->definition->getOptionForShortcut($name[$i]); + if ($option->acceptValue()) { + $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); + + break; + } else { + $this->addLongOption($option->getName(), null); + } + } + } + + /** + * Parses a long option. + * + * @param string $token The current token + */ + private function parseLongOption($token) + { + $name = substr($token, 2); + + if (false !== $pos = strpos($name, '=')) { + if (0 === strlen($value = substr($name, $pos + 1))) { + // if no value after "=" then substr() returns "" since php7 only, false before + // see http://php.net/manual/fr/migration70.incompatible.php#119151 + if (\PHP_VERSION_ID < 70000 && false === $value) { + $value = ''; + } + array_unshift($this->parsed, $value); + } + $this->addLongOption(substr($name, 0, $pos), $value); + } else { + $this->addLongOption($name, null); + } + } + + /** + * Parses an argument. + * + * @param string $token The current token + * + * @throws RuntimeException When too many arguments are given + */ + private function parseArgument($token) + { + $c = count($this->arguments); + + // if input is expecting another argument, add it + if ($this->definition->hasArgument($c)) { + $arg = $this->definition->getArgument($c); + $this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token; + + // if last argument isArray(), append token to last argument + } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { + $arg = $this->definition->getArgument($c - 1); + $this->arguments[$arg->getName()][] = $token; + + // unexpected argument + } else { + $all = $this->definition->getArguments(); + if (count($all)) { + throw new RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all)))); + } + + throw new RuntimeException(sprintf('No arguments expected, got "%s".', $token)); + } + } + + /** + * Adds a short option value. + * + * @param string $shortcut The short option key + * @param mixed $value The value for the option + * + * @throws RuntimeException When option given doesn't exist + */ + private function addShortOption($shortcut, $value) + { + if (!$this->definition->hasShortcut($shortcut)) { + throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); + } + + $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); + } + + /** + * Adds a long option value. + * + * @param string $name The long option key + * @param mixed $value The value for the option + * + * @throws RuntimeException When option given doesn't exist + */ + private function addLongOption($name, $value) + { + if (!$this->definition->hasOption($name)) { + throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); + } + + $option = $this->definition->getOption($name); + + if (null !== $value && !$option->acceptValue()) { + throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + } + + if (in_array($value, array('', null), true) && $option->acceptValue() && count($this->parsed)) { + // if option accepts an optional or mandatory argument + // let's see if there is one provided + $next = array_shift($this->parsed); + if ((isset($next[0]) && '-' !== $next[0]) || in_array($next, array('', null), true)) { + $value = $next; + } else { + array_unshift($this->parsed, $next); + } + } + + if (null === $value) { + if ($option->isValueRequired()) { + throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); + } + + if (!$option->isArray() && !$option->isValueOptional()) { + $value = true; + } + } + + if ($option->isArray()) { + $this->options[$name][] = $value; + } else { + $this->options[$name] = $value; + } + } + + /** + * {@inheritdoc} + */ + public function getFirstArgument() + { + foreach ($this->tokens as $token) { + if ($token && '-' === $token[0]) { + continue; + } + + return $token; + } + } + + /** + * {@inheritdoc} + */ + public function hasParameterOption($values, $onlyParams = false) + { + $values = (array) $values; + + foreach ($this->tokens as $token) { + if ($onlyParams && '--' === $token) { + return false; + } + foreach ($values as $value) { + if ($token === $value || 0 === strpos($token, $value.'=')) { + return true; + } + +/** + * Commented out until https://github.com/symfony/symfony/issues/25825 is resolved and released. + */ +// if (0 === strpos($token, '-') && 0 !== strpos($token, '--')) { +// $noValue = explode('=', $token); +// $token = $noValue[0]; +// $searchableToken = str_replace('-', '', $token); +// $searchableValue = str_replace('-', '', $value); +// if ('' !== $searchableToken && '' !== $searchableValue && false !== strpos($searchableToken, $searchableValue)) { +// return true; +// } +// } + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function getParameterOption($values, $default = false, $onlyParams = false) + { + $values = (array) $values; + $tokens = $this->tokens; + + while (0 < count($tokens)) { + $token = array_shift($tokens); + if ($onlyParams && '--' === $token) { + return false; + } + + foreach ($values as $value) { + if ($token === $value || 0 === strpos($token, $value.'=')) { + if (false !== $pos = strpos($token, '=')) { + return substr($token, $pos + 1); + } + + return array_shift($tokens); + } + } + } + + return $default; + } + + /** + * Returns a stringified representation of the args passed to the command. + * + * @return string + */ + public function __toString() + { + $tokens = array_map(function ($token) { + if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { + return $match[1].$this->escapeToken($match[2]); + } + + if ($token && '-' !== $token[0]) { + return $this->escapeToken($token); + } + + return $token; + }, $this->tokens); + + return implode(' ', $tokens); + } +} diff --git a/vendor/drush/drush/src/Symfony/IndiscriminateInputDefinition.php b/vendor/drush/drush/src/Symfony/IndiscriminateInputDefinition.php new file mode 100644 index 0000000000000000000000000000000000000000..9d4713a703af8a3dc270a5acff66ddf62a9443f7 --- /dev/null +++ b/vendor/drush/drush/src/Symfony/IndiscriminateInputDefinition.php @@ -0,0 +1,47 @@ +<?php + +namespace Drush\Symfony; + +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * This is an InputDefinition that allows any option to be considered valid. + * Used when passing a command through to another dispatcher that will do + * the option validation. + * + * We use this instead of a LessStrictArgvInput in cases where we do not + * know in advance whether the input should be handled indiscriminately. + * In other words, an IndiscriminateInputDefinition is attached to individual + * Commands that should accept any option, whereas a LessStrictArgvInput + * should be used to make all command skip option validation. + */ +class IndiscriminateInputDefinition extends InputDefinition +{ + /** + * @inheritdoc + */ + public function hasShortcut($name) + { + return true; + } + + /** + * @inheritdoc + */ + public function hasOption($name) + { + return true; + } + + /** + * @inheritdoc + */ + public function getOption($name) + { + if (parent::hasOption($name)) { + return parent::getOption($name); + } + return new InputOption($name, null, InputOption::VALUE_OPTIONAL, '', []); + } +} diff --git a/vendor/drush/drush/src/Symfony/LessStrictArgvInput.php b/vendor/drush/drush/src/Symfony/LessStrictArgvInput.php new file mode 100644 index 0000000000000000000000000000000000000000..35af060caff5b60147d6e0a346ecf0bb9c95d3fb --- /dev/null +++ b/vendor/drush/drush/src/Symfony/LessStrictArgvInput.php @@ -0,0 +1,354 @@ +<?php + +namespace Drush\Symfony; + +use Symfony\Component\Console\Input\ArgvInput; + +use Symfony\Component\Console\Exception\RuntimeException; + +/** + * UnvalidatedArgvInput is an ArgvInput that never reports errors when + * extra options are provided. + * + * If the last argument of the command being called is not an array + * argument, then an error will be thrown if there are too many arguments. + * + * We use this instead of a IndiscriminateInputDefinition in cases where we + * know in advance that we wish to disable input validation for all commands. + * In contrast, an IndiscriminateInputDefinition is attached to individual + * Commands that should accept any option. + */ +class LessStrictArgvInput extends ArgvInput +{ + private $tokens; + private $parsed; + protected $additionalOptions = []; + + /** + * Constructor. + * + * @param array|null $argv An array of parameters from the CLI (in the argv format) + * @param InputDefinition|null $definition A InputDefinition instance + */ + public function __construct(array $argv = null, InputDefinition $definition = null) + { + // We have to duplicate the implementation of ArgvInput + // because of liberal use of `private` + if (null === $argv) { + $argv = $_SERVER['argv']; + } + + $this->tokens = $argv; + // strip the application name + array_shift($this->tokens); + + parent::__construct($argv, $definition); + } + + /** + * {@inheritdoc} + */ + public function getOption($name) + { + if (array_key_exists($name, $this->options)) { + return $this->options[$name]; + } + if ($this->definition->hasOption($name)) { + return $this->definition->getOption($name)->getDefault(); + } + return false; + } + + protected function setTokens(array $tokens) + { + $this->tokens = $tokens; + } + + /** + * {@inheritdoc} + */ + protected function parse() + { + $parseOptions = true; + $this->parsed = $this->tokens; + while (null !== $token = array_shift($this->parsed)) { + if ($parseOptions && '' == $token) { + $this->parseArgument($token); + } elseif ($parseOptions && '--' == $token) { + $parseOptions = false; + } elseif ($parseOptions && 0 === strpos($token, '--')) { + $this->parseLongOption($token); + } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { + $this->parseShortOption($token); + } else { + $this->parseArgument($token); + } + } + // Put back any options that were injected. + $this->options += $this->additionalOptions; + } + + /** + * Parses a short option. + * + * @param string $token The current token + */ + private function parseShortOption($token) + { + $name = substr($token, 1); + + if (strlen($name) > 1) { + if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { + // an option with a value (with no space) + $this->addShortOption($name[0], substr($name, 1)); + } else { + $this->parseShortOptionSet($name); + } + } else { + $this->addShortOption($name, null); + } + } + + /** + * Parses a short option set. + * + * @param string $name The current token + */ + private function parseShortOptionSet($name) + { + $len = strlen($name); + for ($i = 0; $i < $len; ++$i) { + if (!$this->definition->hasShortcut($name[$i])) { + $this->addShortOption($name[$i]); + } + + $option = $this->definition->getOptionForShortcut($name[$i]); + if ($option->acceptValue()) { + $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); + + break; + } else { + $this->addLongOption($option->getName(), null); + } + } + } + + /** + * Parses a long option. + * + * @param string $token The current token + */ + private function parseLongOption($token) + { + $name = substr($token, 2); + + if (false !== $pos = strpos($name, '=')) { + if (0 === strlen($value = substr($name, $pos + 1))) { + // if no value after "=" then substr() returns "" since php7 only, false before + // see http://php.net/manual/fr/migration70.incompatible.php#119151 + if (\PHP_VERSION_ID < 70000 && false === $value) { + $value = ''; + } + array_unshift($this->parsed, $value); + } + $this->addLongOption(substr($name, 0, $pos), $value); + } else { + $this->addLongOption($name, null); + } + } + + /** + * Parses an argument. + * + * @param string $token The current token + * + * @throws RuntimeException When too many arguments are given + */ + private function parseArgument($token) + { + $c = count($this->arguments); + + // if input is expecting another argument, add it + if ($this->definition->hasArgument($c)) { + $arg = $this->definition->getArgument($c); + $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; + + // if last argument isArray(), append token to last argument + } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { + $arg = $this->definition->getArgument($c - 1); + $this->arguments[$arg->getName()][] = $token; + + // unexpected argument + } else { + $all = $this->definition->getArguments(); + if (count($all)) { + throw new RuntimeException(sprintf('Too many arguments, expected arguments "%s", provided arguments "%s".', implode('" "', array_keys($all)), implode('" "', array_keys($this->arguments)))); + } + + throw new RuntimeException(sprintf('No arguments expected, got "%s".', $token)); + } + } + + /** + * Adds a short option value. + * + * @param string $shortcut The short option key + * @param mixed $value The value for the option + * + * @throws RuntimeException When option given doesn't exist + */ + private function addShortOption($shortcut, $value) + { + if (!$this->definition->hasShortcut($shortcut)) { + // Hard to know what to do with unknown short options. Maybe + // these should be added to the end of the arguments. This would only + // be a good strategy if the last argument was an array argument. + // We'll try adding as a long option for now. + $this->addLongOption($shortcut, $value); + } + + $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); + } + + public function injectAdditionalOptions($additionalOptions) + { + $this->additionalOptions += $additionalOptions; + $this->options += $additionalOptions; + } + + /** + * Adds a long option value. + * + * @param string $name The long option key + * @param mixed $value The value for the option + * + * @throws RuntimeException When option given doesn't exist + */ + private function addLongOption($name, $value) + { + if (!$this->definition->hasOption($name)) { + // If we don't know anything about this option, then we'll + // assume it is generic. + $this->options[$name] = $value; + return; + } + + $option = $this->definition->getOption($name); + + if (null !== $value && !$option->acceptValue()) { + throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + } + + if (in_array($value, ['', null], true) && $option->acceptValue() && count($this->parsed)) { + // if option accepts an optional or mandatory argument + // let's see if there is one provided + $next = array_shift($this->parsed); + if ((isset($next[0]) && '-' !== $next[0]) || in_array($next, ['', null], true)) { + $value = $next; + } else { + array_unshift($this->parsed, $next); + } + } + + if (null === $value) { + if ($option->isValueRequired()) { + throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); + } + + if (!$option->isArray() && !$option->isValueOptional()) { + $value = true; + } + } + + if ($option->isArray()) { + $this->options[$name][] = $value; + } else { + $this->options[$name] = $value; + } + } + + /** + * {@inheritdoc} + */ + public function getFirstArgument() + { + foreach ($this->tokens as $token) { + if ($token && '-' === $token[0]) { + continue; + } + + return $token; + } + } + + /** + * {@inheritdoc} + */ + public function hasParameterOption($values, $onlyParams = false) + { + $values = (array) $values; + + foreach ($this->tokens as $token) { + if ($onlyParams && $token === '--') { + return false; + } + foreach ($values as $value) { + if ($token === $value || 0 === strpos($token, $value.'=')) { + return true; + } + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function getParameterOption($values, $default = false, $onlyParams = false) + { + $values = (array) $values; + $tokens = $this->tokens; + + while (0 < count($tokens)) { + $token = array_shift($tokens); + if ($onlyParams && $token === '--') { + return false; + } + + foreach ($values as $value) { + if ($token === $value || 0 === strpos($token, $value.'=')) { + if (false !== $pos = strpos($token, '=')) { + return substr($token, $pos + 1); + } + + return array_shift($tokens); + } + } + } + + return $default; + } + + /** + * Returns a stringified representation of the args passed to the command. + * + * @return string + */ + public function __toString() + { + $tokens = array_map(function ($token) { + if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { + return $match[1].$this->escapeToken($match[2]); + } + + if ($token && $token[0] !== '-') { + return $this->escapeToken($token); + } + + return $token; + }, $this->tokens); + + return implode(' ', $tokens); + } +} diff --git a/vendor/drush/drush/src/TestTraits/OutputUtilsTrait.php b/vendor/drush/drush/src/TestTraits/OutputUtilsTrait.php index a8467cd6baabdc8f01622801b993a8ef71454698..ff7b9f7f46176d8edba0f78c9f0e5d57d3474ccf 100644 --- a/vendor/drush/drush/src/TestTraits/OutputUtilsTrait.php +++ b/vendor/drush/drush/src/TestTraits/OutputUtilsTrait.php @@ -17,7 +17,7 @@ trait OutputUtilsTrait * * @access public */ - public abstract function getOutputRaw(); + abstract public function getOutputRaw(); /** * Accessor for the last stderr output, non-trimmed. @@ -27,7 +27,7 @@ public abstract function getOutputRaw(); * * @access public */ - public abstract function getErrorOutputRaw(); + abstract public function getErrorOutputRaw(); /** * Get command output and simplify away things like full paths and extra diff --git a/vendor/drush/drush/src/Utils/FsUtils.php b/vendor/drush/drush/src/Utils/FsUtils.php new file mode 100644 index 0000000000000000000000000000000000000000..b16d08f21135933c1ee5c2559c3d57cf425934e0 --- /dev/null +++ b/vendor/drush/drush/src/Utils/FsUtils.php @@ -0,0 +1,80 @@ +<?php + +namespace Drush\Utils; + +use Drush\Drush; +use Drush\Sql\SqlBase; +use Symfony\Component\Filesystem\Filesystem; +use Webmozart\PathUtil\Path; + +class FsUtils +{ + + /** + * Decide where our backup directory should go + * + * @param string $subdir + * The name of the desired subdirectory(s) under drush-backups. + * Usually a database name. + * + * @return + * A path to the backup directory. + * @throws \Exception + */ + public static function getBackupDir($subdir = null) + { + // Try to use db name as subdir if none was provided. + if (empty($subdir)) { + $subdir = 'unknown'; + if ($sql = SqlBase::create()) { + $db_spec = $sql->getDbSpec(); + $subdir = $db_spec['database']; + } + } + + // Save the date to be used in the backup directory's path name. + $date = gmdate('YmdHis', $_SERVER['REQUEST_TIME']); + return Path::join( + Drush::config()->home(), + 'drush-backups', + $subdir, + $date + ); + } + + /** + * Prepare a backup directory. + * + * @param string $subdir + * A string naming the subdirectory of the backup directory. + * + * @return string + * Path to the specified backup directory. + * @throws \Exception + */ + public static function prepareBackupDir($subdir = null) + { + $fs = new Filesystem(); + $backup_dir = self::getBackupDir($subdir); + $fs->mkdir($backup_dir); + return $backup_dir; + } + + /** + * Returns canonicalized absolute pathname. + * + * The difference between this and PHP's realpath() is that this will + * return the original path even if it doesn't exist. + * + * @param string $path + * The path being checked. + * + * @return string + * The canonicalized absolute pathname. + */ + public static function realpath($path) + { + $realpath = realpath($path); + return $realpath ?: $path; + } +} diff --git a/vendor/drush/drush/src/Utils/StringUtils.php b/vendor/drush/drush/src/Utils/StringUtils.php new file mode 100644 index 0000000000000000000000000000000000000000..5b4b6fd2ee875adb8047e3b189cc219321caaac4 --- /dev/null +++ b/vendor/drush/drush/src/Utils/StringUtils.php @@ -0,0 +1,133 @@ +<?php + +namespace Drush\Utils; + +class StringUtils +{ + + /** + * Convert a csv string, or an array of items which + * may contain csv strings, into an array of items. + * + * @param $args + * A simple csv string; e.g. 'a,b,c' + * or a simple list of items; e.g. array('a','b','c') + * or some combination; e.g. array('a,b','c') or array('a,','b,','c,') + * + * @return array + * A simple list of items (e.g. array('a','b','c') + */ + public static function csvToArray($args) + { + // + // Step 1: implode(',',$args) converts from, say, array('a,','b,','c,') to 'a,,b,,c,' + // Step 2: explode(',', ...) converts to array('a','','b','','c','') + // Step 3: array_filter(...) removes the empty items + // Step 4: array_map(...) trims extra whitespace from each item + // (handles csv strings with extra whitespace, e.g. 'a, b, c') + // + return array_map('trim', array_filter(explode(',', is_array($args) ? implode(',', $args) : $args))); + } + + /** + * Replace placeholders in a string. + * + * Examples: + * interpolate('Hello, {var}', ['var' => 'world']) ==> 'Hello, world' + * interpolate('Do !what', ['!what' => 'work']) ==> 'Do work' + * + * @param string $message + * The string with placeholders to be interpolated. + * @param array $context + * An associative array of values to be inserted into the message. + * @return string + * The resulting string with all placeholders filled in. + */ + public static function interpolate($message, array $context = []) + { + // Take no action if there is no context + if (empty($context)) { + return $message; + } + + // build a replacement array with braces around the context keys + $replace = []; + foreach ($context as $key => $val) { + if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { + $replace[static::interpolationKey($key)] = $val; + } + } + + // interpolate replacement values into the message and return + return strtr($message, $replace); + } + + /** + * Wrap simple strings (with no special characters) in {}s + * + * @param string $key + * A key from an interpolation context. + * @return string + * The key prepared for interpolation. + */ + private static function interpolationKey($key) + { + if (ctype_alpha($key)) { + return sprintf('{%s}', $key); + } + return $key; + } + + /** + * Replace tilde in a path with the HOME directory. + * + * @param $path + * A path that may contain a ~ at front. + * + * @param $home + * The effective home dir for this request. + * + * @return string The path with tilde replaced, if applicable. + * The path with tilde replaced, if applicable. + */ + public static function replaceTilde($path, $home) + { + $replacement = $home . '/'; + $match = '#^~/#'; + if (preg_match($match, $path)) { + return preg_replace($match, $replacement, $path); + } + return $path; + } + + /** + * Generate a random alphanumeric password. Copied from user.module. + * + * @param int $length + * + * @return string + */ + public static function generatePassword($length = 10) + { + // This variable contains the list of allowable characters for the + // password. Note that the number 0 and the letter 'O' have been + // removed to avoid confusion between the two. The same is true + // of 'I', 1, and 'l'. + $allowable_characters = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'; + + // Zero-based count of characters in the allowable list: + $len = strlen($allowable_characters) - 1; + + // Declare the password as a blank string. + $pass = ''; + + // Loop the number of times specified by $length. + for ($i = 0; $i < $length; $i++) { + // Each iteration, pick a random character from the + // allowable string and append it to the password: + $pass .= $allowable_characters[mt_rand(0, $len)]; + } + + return $pass; + } +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Escaper.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Escaper.php new file mode 100644 index 0000000000000000000000000000000000000000..c86885a442b9ff9af10f0300872d8b1f59408e7e --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Escaper.php @@ -0,0 +1,101 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml; + +/** + * Escaper encapsulates escaping rules for single and double-quoted + * YAML strings. + * + * @author Matthew Lewinski <matthew@lewinski.org> + * + * @internal + */ +class Escaper +{ + // Characters that would cause a dumped string to require double quoting. + const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; + + // Mapping arrays for escaping a double quoted string. The backslash is + // first to ensure proper escaping because str_replace operates iteratively + // on the input arrays. This ordering of the characters avoids the use of strtr, + // which performs more slowly. + private static $escapees = array('\\', '\\\\', '\\"', '"', + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", + ); + private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', + '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', + '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', + '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', + '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', + '\\N', '\\_', '\\L', '\\P', + ); + + /** + * Determines if a PHP value would require double quoting in YAML. + * + * @param string $value A PHP value + * + * @return bool True if the value would require double quotes + */ + public static function requiresDoubleQuoting($value) + { + return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); + } + + /** + * Escapes and surrounds a PHP value with double quotes. + * + * @param string $value A PHP value + * + * @return string The quoted, escaped string + */ + public static function escapeWithDoubleQuotes($value) + { + return sprintf('"%s"', str_replace(self::$escapees, self::$escaped, $value)); + } + + /** + * Determines if a PHP value would require single quoting in YAML. + * + * @param string $value A PHP value + * + * @return bool True if the value would require single quotes + */ + public static function requiresSingleQuoting($value) + { + // Determines if a PHP value is entirely composed of a value that would + // require single quoting in YAML. + if (in_array(strtolower($value), array('null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'))) { + return true; + } + + // Determines if the PHP value contains any single characters that would + // cause it to require single quoting in YAML. + return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); + } + + /** + * Escapes and surrounds a PHP value with single quotes. + * + * @param string $value A PHP value + * + * @return string The quoted, escaped string + */ + public static function escapeWithSingleQuotes($value) + { + return sprintf("'%s'", str_replace('\'', '\'\'', $value)); + } +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/ExceptionInterface.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/ExceptionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..266a2f6f1d5015811b6936ec7561326fc1cdf98c --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/ExceptionInterface.php @@ -0,0 +1,21 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml\Exception; + +/** + * Exception interface for all exceptions thrown by the component. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +interface ExceptionInterface +{ +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/ParseException.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/ParseException.php new file mode 100644 index 0000000000000000000000000000000000000000..eca5a3265cef500cd2f88638f442b5666cd9f643 --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/ParseException.php @@ -0,0 +1,139 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml\Exception; + +/** + * Exception class thrown when an error occurs during parsing. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class ParseException extends RuntimeException +{ + private $parsedFile; + private $parsedLine; + private $snippet; + private $rawMessage; + + /** + * @param string $message The error message + * @param int $parsedLine The line where the error occurred + * @param string|null $snippet The snippet of code near the problem + * @param string|null $parsedFile The file name where the error occurred + * @param \Exception|null $previous The previous exception + */ + public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, \Exception $previous = null) + { + $this->parsedFile = $parsedFile; + $this->parsedLine = $parsedLine; + $this->snippet = $snippet; + $this->rawMessage = $message; + + $this->updateRepr(); + + parent::__construct($this->message, 0, $previous); + } + + /** + * Gets the snippet of code near the error. + * + * @return string The snippet of code + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * Sets the snippet of code near the error. + * + * @param string $snippet The code snippet + */ + public function setSnippet($snippet) + { + $this->snippet = $snippet; + + $this->updateRepr(); + } + + /** + * Gets the filename where the error occurred. + * + * This method returns null if a string is parsed. + * + * @return string The filename + */ + public function getParsedFile() + { + return $this->parsedFile; + } + + /** + * Sets the filename where the error occurred. + * + * @param string $parsedFile The filename + */ + public function setParsedFile($parsedFile) + { + $this->parsedFile = $parsedFile; + + $this->updateRepr(); + } + + /** + * Gets the line where the error occurred. + * + * @return int The file line + */ + public function getParsedLine() + { + return $this->parsedLine; + } + + /** + * Sets the line where the error occurred. + * + * @param int $parsedLine The file line + */ + public function setParsedLine($parsedLine) + { + $this->parsedLine = $parsedLine; + + $this->updateRepr(); + } + + private function updateRepr() + { + $this->message = $this->rawMessage; + + $dot = false; + if ('.' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $dot = true; + } + + if (null !== $this->parsedFile) { + $this->message .= sprintf(' in %s', json_encode($this->parsedFile, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); + } + + if ($this->parsedLine >= 0) { + $this->message .= sprintf(' at line %d', $this->parsedLine); + } + + if ($this->snippet) { + $this->message .= sprintf(' (near "%s")', $this->snippet); + } + + if ($dot) { + $this->message .= '.'; + } + } +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/RuntimeException.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/RuntimeException.php new file mode 100644 index 0000000000000000000000000000000000000000..37f65205e58fd9fb831b900092b3246a760e51f0 --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Exception/RuntimeException.php @@ -0,0 +1,21 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml\Exception; + +/** + * Exception class thrown when an error occurs during parsing. + * + * @author Romain Neutron <imprec@gmail.com> + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Inline.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Inline.php new file mode 100644 index 0000000000000000000000000000000000000000..eec8743ca368fa03de393c79bb233b6ee8cf075e --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Inline.php @@ -0,0 +1,833 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml; + +use Drush\Internal\Config\Yaml\Exception\ParseException; +use Drush\Internal\Config\Yaml\Exception\DumpException; +use Drush\Internal\Config\Yaml\Tag\TaggedValue; + +/** + * Inline implements a YAML parser/dumper for the YAML inline syntax. + * + * @author Fabien Potencier <fabien@symfony.com> + * + * @internal + */ +class Inline +{ + const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')'; + + public static $parsedLineNumber; + + private static $exceptionOnInvalidType = false; + private static $objectSupport = false; + private static $objectForMap = false; + private static $constantSupport = false; + + /** + * Converts a YAML string to a PHP value. + * + * @param string $value A YAML string + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * @param array $references Mapping of variable names to values + * + * @return mixed A PHP value + * + * @throws ParseException + */ + public static function parse($value, $flags = 0, $references = array()) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 3 && !is_array($references)) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT flag instead.', E_USER_DEPRECATED); + + if ($references) { + $flags |= Yaml::PARSE_OBJECT; + } + + if (func_num_args() >= 4) { + @trigger_error('Passing a boolean flag to toggle object for map support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT_FOR_MAP flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(3)) { + $flags |= Yaml::PARSE_OBJECT_FOR_MAP; + } + } + + if (func_num_args() >= 5) { + $references = func_get_arg(4); + } else { + $references = array(); + } + } + + self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags); + self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags); + self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags); + self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags); + + $value = trim($value); + + if ('' === $value) { + return ''; + } + + if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } + + $i = 0; + $tag = self::parseTag($value, $i, $flags); + switch ($value[$i]) { + case '[': + $result = self::parseSequence($value, $flags, $i, $references); + ++$i; + break; + case '{': + $result = self::parseMapping($value, $flags, $i, $references); + ++$i; + break; + default: + $result = self::parseScalar($value, $flags, null, $i, null === $tag, $references); + } + + if (null !== $tag) { + return new TaggedValue($tag, $result); + } + + // some comments are allowed at the end + if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) { + throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i))); + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return $result; + } + + /** + * Dumps a given PHP variable to a YAML string. + * + * @param mixed $value The PHP variable to convert + * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string + * + * @return string The YAML string representing the PHP value + * + * @throws DumpException When trying to dump PHP resource + */ + public static function dump($value, $flags = 0) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 3) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_OBJECT flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(2)) { + $flags |= Yaml::DUMP_OBJECT; + } + } + + switch (true) { + case is_resource($value): + if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { + throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); + } + + return 'null'; + case $value instanceof \DateTimeInterface: + return $value->format('c'); + case is_object($value): + if ($value instanceof TaggedValue) { + return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags); + } + + if (Yaml::DUMP_OBJECT & $flags) { + return '!php/object:'.serialize($value); + } + + if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) { + return self::dumpArray($value, $flags & ~Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); + } + + if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { + throw new DumpException('Object support when dumping a YAML file has been disabled.'); + } + + return 'null'; + case is_array($value): + return self::dumpArray($value, $flags); + case null === $value: + return 'null'; + case true === $value: + return 'true'; + case false === $value: + return 'false'; + case ctype_digit($value): + return is_string($value) ? "'$value'" : (int) $value; + case is_numeric($value): + $locale = setlocale(LC_NUMERIC, 0); + if (false !== $locale) { + setlocale(LC_NUMERIC, 'C'); + } + if (is_float($value)) { + $repr = (string) $value; + if (is_infinite($value)) { + $repr = str_ireplace('INF', '.Inf', $repr); + } elseif (floor($value) == $value && $repr == $value) { + // Preserve float data type since storing a whole number will result in integer value. + $repr = '!!float '.$repr; + } + } else { + $repr = is_string($value) ? "'$value'" : (string) $value; + } + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + + return $repr; + case '' == $value: + return "''"; + case self::isBinaryString($value): + return '!!binary '.base64_encode($value); + case Escaper::requiresDoubleQuoting($value): + return Escaper::escapeWithDoubleQuotes($value); + case Escaper::requiresSingleQuoting($value): + case Parser::pregMatch('{^[0-9]+[_0-9]*$}', $value): + case Parser::pregMatch(self::getHexRegex(), $value): + case Parser::pregMatch(self::getTimestampRegex(), $value): + return Escaper::escapeWithSingleQuotes($value); + default: + return $value; + } + } + + /** + * Check if given array is hash or just normal indexed array. + * + * @internal + * + * @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check + * + * @return bool true if value is hash array, false otherwise + */ + public static function isHash($value) + { + if ($value instanceof \stdClass || $value instanceof \ArrayObject) { + return true; + } + + $expectedKey = 0; + + foreach ($value as $key => $val) { + if ($key !== $expectedKey++) { + return true; + } + } + + return false; + } + + /** + * Dumps a PHP array to a YAML string. + * + * @param array $value The PHP array to dump + * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string + * + * @return string The YAML string representing the PHP array + */ + private static function dumpArray($value, $flags) + { + // array + if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) { + $output = array(); + foreach ($value as $val) { + $output[] = self::dump($val, $flags); + } + + return sprintf('[%s]', implode(', ', $output)); + } + + // hash + $output = array(); + foreach ($value as $key => $val) { + $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); + } + + return sprintf('{ %s }', implode(', ', $output)); + } + + /** + * Parses a YAML scalar. + * + * @param string $scalar + * @param int $flags + * @param string[] $delimiters + * @param int &$i + * @param bool $evaluate + * @param array $references + * + * @return string + * + * @throws ParseException When malformed inline YAML string is parsed + * + * @internal + */ + public static function parseScalar($scalar, $flags = 0, $delimiters = null, &$i = 0, $evaluate = true, $references = array(), $legacyOmittedKeySupport = false) + { + if (in_array($scalar[$i], array('"', "'"))) { + // quoted scalar + $output = self::parseQuotedScalar($scalar, $i); + + if (null !== $delimiters) { + $tmp = ltrim(substr($scalar, $i), ' '); + if (!in_array($tmp[0], $delimiters)) { + throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i))); + } + } + } else { + // "normal" string + if (!$delimiters) { + $output = substr($scalar, $i); + $i += strlen($output); + + // remove comments + if (Parser::pregMatch('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) { + $output = substr($output, 0, $match[0][1]); + } + } elseif (Parser::pregMatch('/^(.'.($legacyOmittedKeySupport ? '+' : '*').'?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { + $output = $match[1]; + $i += strlen($output); + } else { + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $scalar)); + } + + // a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >) + if ($output && ('@' === $output[0] || '`' === $output[0] || '|' === $output[0] || '>' === $output[0])) { + throw new ParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0])); + } + + if ($output && '%' === $output[0]) { + @trigger_error(sprintf('Not quoting the scalar "%s" starting with the "%%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0 on line %d.', $output, self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + + if ($evaluate) { + $output = self::evaluateScalar($output, $flags, $references); + } + } + + return $output; + } + + /** + * Parses a YAML quoted scalar. + * + * @param string $scalar + * @param int &$i + * + * @return string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseQuotedScalar($scalar, &$i) + { + if (!Parser::pregMatch('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { + throw new ParseException(sprintf('Malformed inline YAML string: %s.', substr($scalar, $i))); + } + + $output = substr($match[0], 1, strlen($match[0]) - 2); + + $unescaper = new Unescaper(); + if ('"' == $scalar[$i]) { + $output = $unescaper->unescapeDoubleQuotedString($output); + } else { + $output = $unescaper->unescapeSingleQuotedString($output); + } + + $i += strlen($match[0]); + + return $output; + } + + /** + * Parses a YAML sequence. + * + * @param string $sequence + * @param int $flags + * @param int &$i + * @param array $references + * + * @return array + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseSequence($sequence, $flags, &$i = 0, $references = array()) + { + $output = array(); + $len = strlen($sequence); + ++$i; + + // [foo, bar, ...] + while ($i < $len) { + if (']' === $sequence[$i]) { + return $output; + } + if (',' === $sequence[$i] || ' ' === $sequence[$i]) { + ++$i; + + continue; + } + + $tag = self::parseTag($sequence, $i, $flags); + switch ($sequence[$i]) { + case '[': + // nested sequence + $value = self::parseSequence($sequence, $flags, $i, $references); + break; + case '{': + // nested mapping + $value = self::parseMapping($sequence, $flags, $i, $references); + break; + default: + $isQuoted = in_array($sequence[$i], array('"', "'")); + $value = self::parseScalar($sequence, $flags, array(',', ']'), $i, null === $tag, $references); + + // the value can be an array if a reference has been resolved to an array var + if (is_string($value) && !$isQuoted && false !== strpos($value, ': ')) { + // embedded mapping? + try { + $pos = 0; + $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references); + } catch (\InvalidArgumentException $e) { + // no, it's not + } + } + + --$i; + } + + if (null !== $tag) { + $value = new TaggedValue($tag, $value); + } + + $output[] = $value; + + ++$i; + } + + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $sequence)); + } + + /** + * Parses a YAML mapping. + * + * @param string $mapping + * @param int $flags + * @param int &$i + * @param array $references + * + * @return array|\stdClass + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseMapping($mapping, $flags, &$i = 0, $references = array()) + { + $output = array(); + $len = strlen($mapping); + ++$i; + $allowOverwrite = false; + + // {foo: bar, bar:foo, ...} + while ($i < $len) { + switch ($mapping[$i]) { + case ' ': + case ',': + ++$i; + continue 2; + case '}': + if (self::$objectForMap) { + return (object) $output; + } + + return $output; + } + + // key + $isKeyQuoted = in_array($mapping[$i], array('"', "'"), true); + $key = self::parseScalar($mapping, $flags, array(':', ' '), $i, false, array(), true); + + if (':' !== $key && false === $i = strpos($mapping, ':', $i)) { + break; + } + + if (':' === $key) { + @trigger_error(sprintf('Omitting the key of a mapping is deprecated and will throw a ParseException in 4.0 on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + + if (!(Yaml::PARSE_KEYS_AS_STRINGS & $flags)) { + $evaluatedKey = self::evaluateScalar($key, $flags, $references); + + if ('' !== $key && $evaluatedKey !== $key && !is_string($evaluatedKey) && !is_int($evaluatedKey)) { + @trigger_error(sprintf('Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + } + + if (':' !== $key && !$isKeyQuoted && (!isset($mapping[$i + 1]) || !in_array($mapping[$i + 1], array(' ', ',', '[', ']', '{', '}'), true))) { + @trigger_error(sprintf('Using a colon after an unquoted mapping key that is not followed by an indication character (i.e. " ", ",", "[", "]", "{", "}") is deprecated since version 3.2 and will throw a ParseException in 4.0 on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + + if ('<<' === $key) { + $allowOverwrite = true; + } + + while ($i < $len) { + if (':' === $mapping[$i] || ' ' === $mapping[$i]) { + ++$i; + + continue; + } + + $tag = self::parseTag($mapping, $i, $flags); + switch ($mapping[$i]) { + case '[': + // nested sequence + $value = self::parseSequence($mapping, $flags, $i, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + foreach ($value as $parsedValue) { + $output += $parsedValue; + } + } elseif ($allowOverwrite || !isset($output[$key])) { + if (null !== $tag) { + $output[$key] = new TaggedValue($tag, $value); + } else { + $output[$key] = $value; + } + } elseif (isset($output[$key])) { + @trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + break; + case '{': + // nested mapping + $value = self::parseMapping($mapping, $flags, $i, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + $output += $value; + } elseif ($allowOverwrite || !isset($output[$key])) { + if (null !== $tag) { + $output[$key] = new TaggedValue($tag, $value); + } else { + $output[$key] = $value; + } + } elseif (isset($output[$key])) { + @trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + break; + default: + $value = self::parseScalar($mapping, $flags, array(',', '}'), $i, null === $tag, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + $output += $value; + } elseif ($allowOverwrite || !isset($output[$key])) { + if (null !== $tag) { + $output[$key] = new TaggedValue($tag, $value); + } else { + $output[$key] = $value; + } + } elseif (isset($output[$key])) { + @trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + --$i; + } + ++$i; + + continue 2; + } + } + + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $mapping)); + } + + /** + * Evaluates scalars and replaces magic values. + * + * @param string $scalar + * @param int $flags + * @param array $references + * + * @return mixed The evaluated YAML string + * + * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved + */ + private static function evaluateScalar($scalar, $flags, $references = array()) + { + $scalar = trim($scalar); + $scalarLower = strtolower($scalar); + + if (0 === strpos($scalar, '*')) { + if (false !== $pos = strpos($scalar, '#')) { + $value = substr($scalar, 1, $pos - 2); + } else { + $value = substr($scalar, 1); + } + + // an unquoted * + if (false === $value || '' === $value) { + throw new ParseException('A reference must contain at least one character.'); + } + + if (!array_key_exists($value, $references)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $value)); + } + + return $references[$value]; + } + + switch (true) { + case 'null' === $scalarLower: + case '' === $scalar: + case '~' === $scalar: + return; + case 'true' === $scalarLower: + return true; + case 'false' === $scalarLower: + return false; + case '!' === $scalar[0]: + switch (true) { + case 0 === strpos($scalar, '!str'): + return (string) substr($scalar, 5); + case 0 === strpos($scalar, '! '): + return (int) self::parseScalar(substr($scalar, 2), $flags); + case 0 === strpos($scalar, '!php/object:'): + if (self::$objectSupport) { + return unserialize(substr($scalar, 12)); + } + + if (self::$exceptionOnInvalidType) { + throw new ParseException('Object support when parsing a YAML file has been disabled.'); + } + + return; + case 0 === strpos($scalar, '!!php/object:'): + if (self::$objectSupport) { + @trigger_error(sprintf('The !!php/object tag to indicate dumped PHP objects is deprecated since version 3.1 and will be removed in 4.0. Use the !php/object tag instead on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED); + + return unserialize(substr($scalar, 13)); + } + + if (self::$exceptionOnInvalidType) { + throw new ParseException('Object support when parsing a YAML file has been disabled.'); + } + + return; + case 0 === strpos($scalar, '!php/const:'): + if (self::$constantSupport) { + if (defined($const = substr($scalar, 11))) { + return constant($const); + } + + throw new ParseException(sprintf('The constant "%s" is not defined.', $const)); + } + if (self::$exceptionOnInvalidType) { + throw new ParseException(sprintf('The string "%s" could not be parsed as a constant. Have you forgotten to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar)); + } + + return; + case 0 === strpos($scalar, '!!float '): + return (float) substr($scalar, 8); + case 0 === strpos($scalar, '!!binary '): + return self::evaluateBinaryScalar(substr($scalar, 9)); + default: + @trigger_error(sprintf('Using the unquoted scalar value "%s" is deprecated since version 3.3 and will be considered as a tagged value in 4.0. You must quote it on line %d.', $scalar, self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + + // Optimize for returning strings. + // no break + case '+' === $scalar[0] || '-' === $scalar[0] || '.' === $scalar[0] || is_numeric($scalar[0]): + switch (true) { + case Parser::pregMatch('{^[+-]?[0-9][0-9_]*$}', $scalar): + $scalar = str_replace('_', '', (string) $scalar); + // omitting the break / return as integers are handled in the next case + // no break + case ctype_digit($scalar): + $raw = $scalar; + $cast = (int) $scalar; + + return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); + case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): + $raw = $scalar; + $cast = (int) $scalar; + + return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw === (string) $cast) ? $cast : $raw); + case is_numeric($scalar): + case Parser::pregMatch(self::getHexRegex(), $scalar): + $scalar = str_replace('_', '', $scalar); + + return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; + case '.inf' === $scalarLower: + case '.nan' === $scalarLower: + return -log(0); + case '-.inf' === $scalarLower: + return log(0); + case Parser::pregMatch('/^(-|\+)?[0-9][0-9,]*(\.[0-9_]+)?$/', $scalar): + case Parser::pregMatch('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar): + if (false !== strpos($scalar, ',')) { + @trigger_error(sprintf('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0 on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED); + } + + return (float) str_replace(array(',', '_'), '', $scalar); + case Parser::pregMatch(self::getTimestampRegex(), $scalar): + if (Yaml::PARSE_DATETIME & $flags) { + // When no timezone is provided in the parsed date, YAML spec says we must assume UTC. + return new \DateTime($scalar, new \DateTimeZone('UTC')); + } + + $timeZone = date_default_timezone_get(); + date_default_timezone_set('UTC'); + $time = strtotime($scalar); + date_default_timezone_set($timeZone); + + return $time; + } + } + + return (string) $scalar; + } + + /** + * @param string $value + * @param int &$i + * @param int $flags + * + * @return null|string + */ + private static function parseTag($value, &$i, $flags) + { + if ('!' !== $value[$i]) { + return; + } + + $tagLength = strcspn($value, " \t\n", $i + 1); + $tag = substr($value, $i + 1, $tagLength); + + $nextOffset = $i + $tagLength + 1; + $nextOffset += strspn($value, ' ', $nextOffset); + + // Is followed by a scalar + if (!isset($value[$nextOffset]) || !in_array($value[$nextOffset], array('[', '{'), true)) { + // Manage scalars in {@link self::evaluateScalar()} + return; + } + + // Built-in tags + if ($tag && '!' === $tag[0]) { + throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag)); + } + + if (Yaml::PARSE_CUSTOM_TAGS & $flags) { + $i = $nextOffset; + + return $tag; + } + + throw new ParseException(sprintf('Tags support is not enabled. Enable the `Yaml::PARSE_CUSTOM_TAGS` flag to use "!%s".', $tag)); + } + + /** + * @param string $scalar + * + * @return string + * + * @internal + */ + public static function evaluateBinaryScalar($scalar) + { + $parsedBinaryData = self::parseScalar(preg_replace('/\s/', '', $scalar)); + + if (0 !== (strlen($parsedBinaryData) % 4)) { + throw new ParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', strlen($parsedBinaryData))); + } + + if (!Parser::pregMatch('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) { + throw new ParseException(sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData)); + } + + return base64_decode($parsedBinaryData, true); + } + + private static function isBinaryString($value) + { + return !preg_match('//u', $value) || preg_match('/[^\x00\x07-\x0d\x1B\x20-\xff]/', $value); + } + + /** + * Gets a regex that matches a YAML date. + * + * @return string The regular expression + * + * @see http://www.yaml.org/spec/1.2/spec.html#id2761573 + */ + private static function getTimestampRegex() + { + return <<<EOF + ~^ + (?P<year>[0-9][0-9][0-9][0-9]) + -(?P<month>[0-9][0-9]?) + -(?P<day>[0-9][0-9]?) + (?:(?:[Tt]|[ \t]+) + (?P<hour>[0-9][0-9]?) + :(?P<minute>[0-9][0-9]) + :(?P<second>[0-9][0-9]) + (?:\.(?P<fraction>[0-9]*))? + (?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?) + (?::(?P<tz_minute>[0-9][0-9]))?))?)? + $~x +EOF; + } + + /** + * Gets a regex that matches a YAML number in hexadecimal notation. + * + * @return string + */ + private static function getHexRegex() + { + return '~^0x[0-9a-f_]++$~i'; + } +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/LICENSE b/vendor/drush/drush/src/internal-forks/Config/Yaml/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..17d16a13367dd1c08e82d1de69e2c44852dcc3d2 --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2017 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Parser.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Parser.php new file mode 100644 index 0000000000000000000000000000000000000000..a3376deceea1c91f1cd02b0253f9e50a8eb51f07 --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Parser.php @@ -0,0 +1,1089 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml; + +use Drush\Internal\Config\Yaml\Exception\ParseException; +use Drush\Internal\Config\Yaml\Tag\TaggedValue; + +/** + * Parser parses YAML strings to convert them to PHP arrays. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Parser +{ + const TAG_PATTERN = '(?P<tag>![\w!.\/:-]+)'; + const BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?'; + + private $offset = 0; + private $totalNumberOfLines; + private $lines = array(); + private $currentLineNb = -1; + private $currentLine = ''; + private $refs = array(); + private $skippedLineNumbers = array(); + private $locallySkippedLineNumbers = array(); + + public function __construct() + { + if (func_num_args() > 0) { + @trigger_error(sprintf('The constructor arguments $offset, $totalNumberOfLines, $skippedLineNumbers of %s are deprecated and will be removed in 4.0', self::class), E_USER_DEPRECATED); + + $this->offset = func_get_arg(0); + if (func_num_args() > 1) { + $this->totalNumberOfLines = func_get_arg(1); + } + if (func_num_args() > 2) { + $this->skippedLineNumbers = func_get_arg(2); + } + } + } + + /** + * Parses a YAML string to a PHP value. + * + * @param string $value A YAML string + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * + * @return mixed A PHP value + * + * @throws ParseException If the YAML is not valid + */ + public function parse($value, $flags = 0) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 3) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(2)) { + $flags |= Yaml::PARSE_OBJECT; + } + } + + if (func_num_args() >= 4) { + @trigger_error('Passing a boolean flag to toggle object for map support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT_FOR_MAP flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(3)) { + $flags |= Yaml::PARSE_OBJECT_FOR_MAP; + } + } + + if (false === preg_match('//u', $value)) { + throw new ParseException('The YAML value does not appear to be valid UTF-8.'); + } + + $this->refs = array(); + + $mbEncoding = null; + $e = null; + $data = null; + + if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('UTF-8'); + } + + try { + $data = $this->doParse($value, $flags); + } catch (\Exception $e) { + } catch (\Throwable $e) { + } + + if (null !== $mbEncoding) { + mb_internal_encoding($mbEncoding); + } + + $this->lines = array(); + $this->currentLine = ''; + $this->refs = array(); + $this->skippedLineNumbers = array(); + $this->locallySkippedLineNumbers = array(); + + if (null !== $e) { + throw $e; + } + + return $data; + } + + private function doParse($value, $flags) + { + $this->currentLineNb = -1; + $this->currentLine = ''; + $value = $this->cleanup($value); + $this->lines = explode("\n", $value); + $this->locallySkippedLineNumbers = array(); + + if (null === $this->totalNumberOfLines) { + $this->totalNumberOfLines = count($this->lines); + } + + if (!$this->moveToNextLine()) { + return null; + } + + $data = array(); + $context = null; + $allowOverwrite = false; + + while ($this->isCurrentLineEmpty()) { + if (!$this->moveToNextLine()) { + return null; + } + } + + // Resolves the tag and returns if end of the document + if (null !== ($tag = $this->getLineTag($this->currentLine, $flags, false)) && !$this->moveToNextLine()) { + return new TaggedValue($tag, ''); + } + + do { + if ($this->isCurrentLineEmpty()) { + continue; + } + + // tab? + if ("\t" === $this->currentLine[0]) { + throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + $isRef = $mergeNode = false; + if (self::pregMatch('#^\-((?P<leadspaces>\s+)(?P<value>.+))?$#u', rtrim($this->currentLine), $values)) { + if ($context && 'mapping' == $context) { + throw new ParseException('You cannot define a sequence item when in a mapping', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + $context = 'sequence'; + + if (isset($values['value']) && self::pregMatch('#^&(?P<ref>[^ ]+) *(?P<value>.*)#u', $values['value'], $matches)) { + $isRef = $matches['ref']; + $values['value'] = $matches['value']; + } + + if (isset($values['value'][1]) && '?' === $values['value'][0] && ' ' === $values['value'][1]) { + @trigger_error(sprintf('Starting an unquoted string with a question mark followed by a space is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED); + } + + // array + if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + $data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $flags); + } elseif (null !== $subTag = $this->getLineTag(ltrim($values['value'], ' '), $flags)) { + $data[] = new TaggedValue( + $subTag, + $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $flags) + ); + } else { + if (isset($values['leadspaces']) + && self::pregMatch('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->trimTag($values['value']), $matches) + ) { + // this is a compact notation element, add to next block and parse + $block = $values['value']; + if ($this->isNextLineIndented()) { + $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + strlen($values['leadspaces']) + 1); + } + + $data[] = $this->parseBlock($this->getRealCurrentLineNb(), $block, $flags); + } else { + $data[] = $this->parseValue($values['value'], $flags, $context); + } + } + if ($isRef) { + $this->refs[$isRef] = end($data); + } + } elseif (self::pregMatch('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?(?:![^\s]++\s++)?[^ \'"\[\{!].*?) *\:(\s++(?P<value>.+))?$#u', rtrim($this->currentLine), $values) + && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'"))) + ) { + if ($context && 'sequence' == $context) { + throw new ParseException('You cannot define a mapping item when in a sequence', $this->currentLineNb + 1, $this->currentLine); + } + $context = 'mapping'; + + // force correct settings + Inline::parse(null, $flags, $this->refs); + try { + Inline::$parsedLineNumber = $this->getRealCurrentLineNb(); + $i = 0; + $evaluateKey = !(Yaml::PARSE_KEYS_AS_STRINGS & $flags); + + // constants in key will be evaluated anyway + if (isset($values['key'][0]) && '!' === $values['key'][0] && Yaml::PARSE_CONSTANT & $flags) { + $evaluateKey = true; + } + + $key = Inline::parseScalar($values['key'], 0, null, $i, $evaluateKey); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + + if (!(Yaml::PARSE_KEYS_AS_STRINGS & $flags) && !is_string($key) && !is_int($key)) { + $keyType = is_numeric($key) ? 'numeric key' : 'non-string key'; + @trigger_error(sprintf('Implicit casting of %s to string is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead on line %d.', $keyType, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED); + } + + // Convert float keys to strings, to avoid being converted to integers by PHP + if (is_float($key)) { + $key = (string) $key; + } + + if ('<<' === $key && (!isset($values['value']) || !self::pregMatch('#^&(?P<ref>[^ ]+)#u', $values['value'], $refMatches))) { + $mergeNode = true; + $allowOverwrite = true; + if (isset($values['value'][0]) && '*' === $values['value'][0]) { + $refName = substr(rtrim($values['value']), 1); + if (!array_key_exists($refName, $this->refs)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + $refValue = $this->refs[$refName]; + + if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $refValue instanceof \stdClass) { + $refValue = (array) $refValue; + } + + if (!is_array($refValue)) { + throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + $data += $refValue; // array union + } else { + if (isset($values['value']) && '' !== $values['value']) { + $value = $values['value']; + } else { + $value = $this->getNextEmbedBlock(); + } + $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags); + + if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsed instanceof \stdClass) { + $parsed = (array) $parsed; + } + + if (!is_array($parsed)) { + throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + if (isset($parsed[0])) { + // If the value associated with the merge key is a sequence, then this sequence is expected to contain mapping nodes + // and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier + // in the sequence override keys specified in later mapping nodes. + foreach ($parsed as $parsedItem) { + if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsedItem instanceof \stdClass) { + $parsedItem = (array) $parsedItem; + } + + if (!is_array($parsedItem)) { + throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem); + } + + $data += $parsedItem; // array union + } + } else { + // If the value associated with the key is a single mapping node, each of its key/value pairs is inserted into the + // current mapping, unless the key already exists in it. + $data += $parsed; // array union + } + } + } elseif ('<<' !== $key && isset($values['value']) && self::pregMatch('#^&(?P<ref>[^ ]++) *+(?P<value>.*)#u', $values['value'], $matches)) { + $isRef = $matches['ref']; + $values['value'] = $matches['value']; + } + + $subTag = null; + if ($mergeNode) { + // Merge keys + } elseif (!isset($values['value']) || '' === $values['value'] || 0 === strpos($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) { + // hash + // if next line is less indented or equal, then it means that the current value is null + if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if ($allowOverwrite || !isset($data[$key])) { + if (null !== $subTag) { + $data[$key] = new TaggedValue($subTag, ''); + } else { + $data[$key] = null; + } + } else { + @trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED); + } + } else { + // remember the parsed line number here in case we need it to provide some contexts in error messages below + $realCurrentLineNbKey = $this->getRealCurrentLineNb(); + $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags); + if ('<<' === $key) { + $this->refs[$refMatches['ref']] = $value; + + if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) { + $value = (array) $value; + } + + $data += $value; + } elseif ($allowOverwrite || !isset($data[$key])) { + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if (null !== $subTag) { + $data[$key] = new TaggedValue($subTag, $value); + } else { + $data[$key] = $value; + } + } else { + @trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, $realCurrentLineNbKey + 1), E_USER_DEPRECATED); + } + } + } else { + $value = $this->parseValue(rtrim($values['value']), $flags, $context); + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if ($allowOverwrite || !isset($data[$key])) { + $data[$key] = $value; + } else { + @trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $key, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED); + } + } + if ($isRef) { + $this->refs[$isRef] = $data[$key]; + } + } else { + // multiple documents are not supported + if ('---' === $this->currentLine) { + throw new ParseException('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine); + } + + if (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $this->currentLine[1]) { + @trigger_error(sprintf('Starting an unquoted string with a question mark followed by a space is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d.', $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED); + } + + // 1-liner optionally followed by newline(s) + if (is_string($value) && $this->lines[0] === trim($value)) { + try { + Inline::$parsedLineNumber = $this->getRealCurrentLineNb(); + $value = Inline::parse($this->lines[0], $flags, $this->refs); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + + return $value; + } + + // try to parse the value as a multi-line string as a last resort + if (0 === $this->currentLineNb) { + $parseError = false; + $previousLineWasNewline = false; + $previousLineWasTerminatedWithBackslash = false; + $value = ''; + + foreach ($this->lines as $line) { + try { + if (isset($line[0]) && ('"' === $line[0] || "'" === $line[0])) { + $parsedLine = $line; + } else { + $parsedLine = Inline::parse($line, $flags, $this->refs); + } + + if (!is_string($parsedLine)) { + $parseError = true; + break; + } + + if ('' === trim($parsedLine)) { + $value .= "\n"; + } elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) { + $value .= ' '; + } + + if ('' !== trim($parsedLine) && '\\' === substr($parsedLine, -1)) { + $value .= ltrim(substr($parsedLine, 0, -1)); + } elseif ('' !== trim($parsedLine)) { + $value .= trim($parsedLine); + } + + if ('' === trim($parsedLine)) { + $previousLineWasNewline = true; + $previousLineWasTerminatedWithBackslash = false; + } elseif ('\\' === substr($parsedLine, -1)) { + $previousLineWasNewline = false; + $previousLineWasTerminatedWithBackslash = true; + } else { + $previousLineWasNewline = false; + $previousLineWasTerminatedWithBackslash = false; + } + } catch (ParseException $e) { + $parseError = true; + break; + } + } + + if (!$parseError) { + return Inline::parse(trim($value)); + } + } + + throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } while ($this->moveToNextLine()); + + if (null !== $tag) { + $data = new TaggedValue($tag, $data); + } + + if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && !is_object($data) && 'mapping' === $context) { + $object = new \stdClass(); + + foreach ($data as $key => $value) { + $object->$key = $value; + } + + $data = $object; + } + + return empty($data) ? null : $data; + } + + private function parseBlock($offset, $yaml, $flags) + { + $skippedLineNumbers = $this->skippedLineNumbers; + + foreach ($this->locallySkippedLineNumbers as $lineNumber) { + if ($lineNumber < $offset) { + continue; + } + + $skippedLineNumbers[] = $lineNumber; + } + + $parser = new self(); + $parser->offset = $offset; + $parser->totalNumberOfLines = $this->totalNumberOfLines; + $parser->skippedLineNumbers = $skippedLineNumbers; + $parser->refs = &$this->refs; + + return $parser->doParse($yaml, $flags); + } + + /** + * Returns the current line number (takes the offset into account). + * + * @return int The current line number + */ + private function getRealCurrentLineNb() + { + $realCurrentLineNumber = $this->currentLineNb + $this->offset; + + foreach ($this->skippedLineNumbers as $skippedLineNumber) { + if ($skippedLineNumber > $realCurrentLineNumber) { + break; + } + + ++$realCurrentLineNumber; + } + + return $realCurrentLineNumber; + } + + /** + * Returns the current line indentation. + * + * @return int The current line indentation + */ + private function getCurrentLineIndentation() + { + return strlen($this->currentLine) - strlen(ltrim($this->currentLine, ' ')); + } + + /** + * Returns the next embed block of YAML. + * + * @param int $indentation The indent level at which the block is to be read, or null for default + * @param bool $inSequence True if the enclosing data structure is a sequence + * + * @return string A YAML string + * + * @throws ParseException When indentation problem are detected + */ + private function getNextEmbedBlock($indentation = null, $inSequence = false) + { + $oldLineIndentation = $this->getCurrentLineIndentation(); + $blockScalarIndentations = array(); + + if ($this->isBlockScalarHeader()) { + $blockScalarIndentations[] = $oldLineIndentation; + } + + if (!$this->moveToNextLine()) { + return; + } + + if (null === $indentation) { + $newIndent = $this->getCurrentLineIndentation(); + + $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem(); + + if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { + throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } else { + $newIndent = $indentation; + } + + $data = array(); + if ($this->getCurrentLineIndentation() >= $newIndent) { + $data[] = substr($this->currentLine, $newIndent); + } else { + $this->moveToPreviousLine(); + + return; + } + + if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) { + // the previous line contained a dash but no item content, this line is a sequence item with the same indentation + // and therefore no nested list or mapping + $this->moveToPreviousLine(); + + return; + } + + $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem(); + + if (empty($blockScalarIndentations) && $this->isBlockScalarHeader()) { + $blockScalarIndentations[] = $this->getCurrentLineIndentation(); + } + + $previousLineIndentation = $this->getCurrentLineIndentation(); + + while ($this->moveToNextLine()) { + $indent = $this->getCurrentLineIndentation(); + + // terminate all block scalars that are more indented than the current line + if (!empty($blockScalarIndentations) && $indent < $previousLineIndentation && '' !== trim($this->currentLine)) { + foreach ($blockScalarIndentations as $key => $blockScalarIndentation) { + if ($blockScalarIndentation >= $indent) { + unset($blockScalarIndentations[$key]); + } + } + } + + if (empty($blockScalarIndentations) && !$this->isCurrentLineComment() && $this->isBlockScalarHeader()) { + $blockScalarIndentations[] = $indent; + } + + $previousLineIndentation = $indent; + + if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) { + $this->moveToPreviousLine(); + break; + } + + if ($this->isCurrentLineBlank()) { + $data[] = substr($this->currentLine, $newIndent); + continue; + } + + if ($indent >= $newIndent) { + $data[] = substr($this->currentLine, $newIndent); + } elseif ($this->isCurrentLineComment()) { + $data[] = $this->currentLine; + } elseif (0 == $indent) { + $this->moveToPreviousLine(); + + break; + } else { + throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } + + return implode("\n", $data); + } + + /** + * Moves the parser to the next line. + * + * @return bool + */ + private function moveToNextLine() + { + if ($this->currentLineNb >= count($this->lines) - 1) { + return false; + } + + $this->currentLine = $this->lines[++$this->currentLineNb]; + + return true; + } + + /** + * Moves the parser to the previous line. + * + * @return bool + */ + private function moveToPreviousLine() + { + if ($this->currentLineNb < 1) { + return false; + } + + $this->currentLine = $this->lines[--$this->currentLineNb]; + + return true; + } + + /** + * Parses a YAML value. + * + * @param string $value A YAML value + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * @param string $context The parser context (either sequence or mapping) + * + * @return mixed A PHP value + * + * @throws ParseException When reference does not exist + */ + private function parseValue($value, $flags, $context) + { + if (0 === strpos($value, '*')) { + if (false !== $pos = strpos($value, '#')) { + $value = substr($value, 1, $pos - 2); + } else { + $value = substr($value, 1); + } + + if (!array_key_exists($value, $this->refs)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine); + } + + return $this->refs[$value]; + } + + if (self::pregMatch('/^(?:'.self::TAG_PATTERN.' +)?'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { + $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; + + $data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs($modifiers)); + + if ('' !== $matches['tag']) { + if ('!!binary' === $matches['tag']) { + return Inline::evaluateBinaryScalar($data); + } elseif ('!' !== $matches['tag']) { + @trigger_error(sprintf('Using the custom tag "%s" for the value "%s" is deprecated since version 3.3. It will be replaced by an instance of %s in 4.0 on line %d.', $matches['tag'], $data, TaggedValue::class, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED); + } + } + + return $data; + } + + try { + $quotation = '' !== $value && ('"' === $value[0] || "'" === $value[0]) ? $value[0] : null; + + // do not take following lines into account when the current line is a quoted single line value + if (null !== $quotation && self::pregMatch('/^'.$quotation.'.*'.$quotation.'(\s*#.*)?$/', $value)) { + return Inline::parse($value, $flags, $this->refs); + } + + $lines = array(); + + while ($this->moveToNextLine()) { + // unquoted strings end before the first unindented line + if (null === $quotation && 0 === $this->getCurrentLineIndentation()) { + $this->moveToPreviousLine(); + + break; + } + + $lines[] = trim($this->currentLine); + + // quoted string values end with a line that is terminated with the quotation character + if ('' !== $this->currentLine && substr($this->currentLine, -1) === $quotation) { + break; + } + } + + for ($i = 0, $linesCount = count($lines), $previousLineBlank = false; $i < $linesCount; ++$i) { + if ('' === $lines[$i]) { + $value .= "\n"; + $previousLineBlank = true; + } elseif ($previousLineBlank) { + $value .= $lines[$i]; + $previousLineBlank = false; + } else { + $value .= ' '.$lines[$i]; + $previousLineBlank = false; + } + } + + Inline::$parsedLineNumber = $this->getRealCurrentLineNb(); + $parsedValue = Inline::parse($value, $flags, $this->refs); + + if ('mapping' === $context && is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && false !== strpos($parsedValue, ': ')) { + throw new ParseException('A colon cannot be used in an unquoted mapping value.'); + } + + return $parsedValue; + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + } + + /** + * Parses a block scalar. + * + * @param string $style The style indicator that was used to begin this block scalar (| or >) + * @param string $chomping The chomping indicator that was used to begin this block scalar (+ or -) + * @param int $indentation The indentation indicator that was used to begin this block scalar + * + * @return string The text value + */ + private function parseBlockScalar($style, $chomping = '', $indentation = 0) + { + $notEOF = $this->moveToNextLine(); + if (!$notEOF) { + return ''; + } + + $isCurrentLineBlank = $this->isCurrentLineBlank(); + $blockLines = array(); + + // leading blank lines are consumed before determining indentation + while ($notEOF && $isCurrentLineBlank) { + // newline only if not EOF + if ($notEOF = $this->moveToNextLine()) { + $blockLines[] = ''; + $isCurrentLineBlank = $this->isCurrentLineBlank(); + } + } + + // determine indentation if not specified + if (0 === $indentation) { + if (self::pregMatch('/^ +/', $this->currentLine, $matches)) { + $indentation = strlen($matches[0]); + } + } + + if ($indentation > 0) { + $pattern = sprintf('/^ {%d}(.*)$/', $indentation); + + while ($notEOF && ( + $isCurrentLineBlank || + self::pregMatch($pattern, $this->currentLine, $matches) + ) + ) { + if ($isCurrentLineBlank && strlen($this->currentLine) > $indentation) { + $blockLines[] = substr($this->currentLine, $indentation); + } elseif ($isCurrentLineBlank) { + $blockLines[] = ''; + } else { + $blockLines[] = $matches[1]; + } + + // newline only if not EOF + if ($notEOF = $this->moveToNextLine()) { + $isCurrentLineBlank = $this->isCurrentLineBlank(); + } + } + } elseif ($notEOF) { + $blockLines[] = ''; + } + + if ($notEOF) { + $blockLines[] = ''; + $this->moveToPreviousLine(); + } elseif (!$notEOF && !$this->isCurrentLineLastLineInDocument()) { + $blockLines[] = ''; + } + + // folded style + if ('>' === $style) { + $text = ''; + $previousLineIndented = false; + $previousLineBlank = false; + + for ($i = 0, $blockLinesCount = count($blockLines); $i < $blockLinesCount; ++$i) { + if ('' === $blockLines[$i]) { + $text .= "\n"; + $previousLineIndented = false; + $previousLineBlank = true; + } elseif (' ' === $blockLines[$i][0]) { + $text .= "\n".$blockLines[$i]; + $previousLineIndented = true; + $previousLineBlank = false; + } elseif ($previousLineIndented) { + $text .= "\n".$blockLines[$i]; + $previousLineIndented = false; + $previousLineBlank = false; + } elseif ($previousLineBlank || 0 === $i) { + $text .= $blockLines[$i]; + $previousLineIndented = false; + $previousLineBlank = false; + } else { + $text .= ' '.$blockLines[$i]; + $previousLineIndented = false; + $previousLineBlank = false; + } + } + } else { + $text = implode("\n", $blockLines); + } + + // deal with trailing newlines + if ('' === $chomping) { + $text = preg_replace('/\n+$/', "\n", $text); + } elseif ('-' === $chomping) { + $text = preg_replace('/\n+$/', '', $text); + } + + return $text; + } + + /** + * Returns true if the next line is indented. + * + * @return bool Returns true if the next line is indented, false otherwise + */ + private function isNextLineIndented() + { + $currentIndentation = $this->getCurrentLineIndentation(); + $EOF = !$this->moveToNextLine(); + + while (!$EOF && $this->isCurrentLineEmpty()) { + $EOF = !$this->moveToNextLine(); + } + + if ($EOF) { + return false; + } + + $ret = $this->getCurrentLineIndentation() > $currentIndentation; + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the current line is blank or if it is a comment line. + * + * @return bool Returns true if the current line is empty or if it is a comment line, false otherwise + */ + private function isCurrentLineEmpty() + { + return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); + } + + /** + * Returns true if the current line is blank. + * + * @return bool Returns true if the current line is blank, false otherwise + */ + private function isCurrentLineBlank() + { + return '' == trim($this->currentLine, ' '); + } + + /** + * Returns true if the current line is a comment line. + * + * @return bool Returns true if the current line is a comment line, false otherwise + */ + private function isCurrentLineComment() + { + //checking explicitly the first char of the trim is faster than loops or strpos + $ltrimmedLine = ltrim($this->currentLine, ' '); + + return '' !== $ltrimmedLine && '#' === $ltrimmedLine[0]; + } + + private function isCurrentLineLastLineInDocument() + { + return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1); + } + + /** + * Cleanups a YAML string to be parsed. + * + * @param string $value The input YAML string + * + * @return string A cleaned up YAML string + */ + private function cleanup($value) + { + $value = str_replace(array("\r\n", "\r"), "\n", $value); + + // strip YAML header + $count = 0; + $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count); + $this->offset += $count; + + // remove leading comments + $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); + if (1 === $count) { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + } + + // remove start of the document marker (---) + $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); + if (1 === $count) { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + + // remove end of the document marker (...) + $value = preg_replace('#\.\.\.\s*$#', '', $value); + } + + return $value; + } + + /** + * Returns true if the next line starts unindented collection. + * + * @return bool Returns true if the next line starts unindented collection, false otherwise + */ + private function isNextLineUnIndentedCollection() + { + $currentIndentation = $this->getCurrentLineIndentation(); + $notEOF = $this->moveToNextLine(); + + while ($notEOF && $this->isCurrentLineEmpty()) { + $notEOF = $this->moveToNextLine(); + } + + if (false === $notEOF) { + return false; + } + + $ret = $this->getCurrentLineIndentation() === $currentIndentation && $this->isStringUnIndentedCollectionItem(); + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the string is un-indented collection item. + * + * @return bool Returns true if the string is un-indented collection item, false otherwise + */ + private function isStringUnIndentedCollectionItem() + { + return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- '); + } + + /** + * Tests whether or not the current line is the header of a block scalar. + * + * @return bool + */ + private function isBlockScalarHeader() + { + return (bool) self::pregMatch('~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~', $this->currentLine); + } + + /** + * A local wrapper for `preg_match` which will throw a ParseException if there + * is an internal error in the PCRE engine. + * + * This avoids us needing to check for "false" every time PCRE is used + * in the YAML engine + * + * DRUSH FORK: Renamed from preg_match to pregMatch. Not what I would have + * preferred, but easier / cleaner than customizing phpcs to not flag this + * one warning. + * + * @throws ParseException on a PCRE internal error + * + * @see preg_last_error() + * + * @internal + */ + public static function pregMatch($pattern, $subject, &$matches = null, $flags = 0, $offset = 0) + { + if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) { + switch (preg_last_error()) { + case PREG_INTERNAL_ERROR: + $error = 'Internal PCRE error.'; + break; + case PREG_BACKTRACK_LIMIT_ERROR: + $error = 'pcre.backtrack_limit reached.'; + break; + case PREG_RECURSION_LIMIT_ERROR: + $error = 'pcre.recursion_limit reached.'; + break; + case PREG_BAD_UTF8_ERROR: + $error = 'Malformed UTF-8 data.'; + break; + case PREG_BAD_UTF8_OFFSET_ERROR: + $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; + break; + default: + $error = 'Error.'; + } + + throw new ParseException($error); + } + + return $ret; + } + + /** + * Trim the tag on top of the value. + * + * Prevent values such as `!foo {quz: bar}` to be considered as + * a mapping block. + */ + private function trimTag($value) + { + if ('!' === $value[0]) { + return ltrim(substr($value, 1, strcspn($value, " \r\n", 1)), ' '); + } + + return $value; + } + + private function getLineTag($value, $flags, $nextLineCheck = true) + { + if ('' === $value || '!' !== $value[0] || 1 !== self::pregMatch('/^'.self::TAG_PATTERN.' *( +#.*)?$/', $value, $matches)) { + return; + } + + if ($nextLineCheck && !$this->isNextLineIndented()) { + return; + } + + $tag = substr($matches['tag'], 1); + + // Built-in tags + if ($tag && '!' === $tag[0]) { + throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag)); + } + + if (Yaml::PARSE_CUSTOM_TAGS & $flags) { + return $tag; + } + + throw new ParseException(sprintf('Tags support is not enabled. You must use the flag `Yaml::PARSE_CUSTOM_TAGS` to use "%s".', $matches['tag'])); + } +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/README.md b/vendor/drush/drush/src/internal-forks/Config/Yaml/README.md new file mode 100644 index 0000000000000000000000000000000000000000..730ce8aca4a43839f46191328ed28a497934986a --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/README.md @@ -0,0 +1,20 @@ +Yaml Component +============== + +The Yaml component loads and dumps YAML files. + +This is a COPY of symfony/yaml re-namespaced to Drush\Config\Yaml. This is +here so that Drush can parse its yaml config and aliasfiles prior to autoloading +any Symfony packages. This helps avoid dependency conflicts when the global +Drush includes the autoload file from Drupal. + +DO NOT USE THESE CLASSES OUTSIDE OF PREFLIGHT. Instead, use symfony/yaml. + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/components/yaml/index.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Tag/TaggedValue.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Tag/TaggedValue.php new file mode 100644 index 0000000000000000000000000000000000000000..5935bfa67d33977a1d03bf751ba000c9a6e10dcb --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Tag/TaggedValue.php @@ -0,0 +1,48 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml\Tag; + +/** + * @author Nicolas Grekas <p@tchwork.com> + * @author Guilhem N. <egetick@gmail.com> + */ +final class TaggedValue +{ + private $tag; + private $value; + + /** + * @param string $tag + * @param mixed $value + */ + public function __construct($tag, $value) + { + $this->tag = $tag; + $this->value = $value; + } + + /** + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * @return mixed + */ + public function getValue() + { + return $this->value; + } +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Unescaper.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Unescaper.php new file mode 100644 index 0000000000000000000000000000000000000000..02e6edefacf4c9be2e7e89351e81779997d6d4e6 --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Unescaper.php @@ -0,0 +1,142 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml; + +use Drush\Internal\Config\Yaml\Exception\ParseException; + +/** + * Unescaper encapsulates unescaping rules for single and double-quoted + * YAML strings. + * + * @author Matthew Lewinski <matthew@lewinski.org> + * + * @internal + */ +class Unescaper +{ + /** + * Regex fragment that matches an escaped character in a double quoted string. + */ + const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)'; + + /** + * Unescapes a single quoted string. + * + * @param string $value A single quoted string + * + * @return string The unescaped string + */ + public function unescapeSingleQuotedString($value) + { + return str_replace('\'\'', '\'', $value); + } + + /** + * Unescapes a double quoted string. + * + * @param string $value A double quoted string + * + * @return string The unescaped string + */ + public function unescapeDoubleQuotedString($value) + { + $callback = function ($match) { + return $this->unescapeCharacter($match[0]); + }; + + // evaluate the string + return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); + } + + /** + * Unescapes a character that was found in a double-quoted string. + * + * @param string $value An escaped character + * + * @return string The unescaped character + */ + private function unescapeCharacter($value) + { + switch ($value[1]) { + case '0': + return "\x0"; + case 'a': + return "\x7"; + case 'b': + return "\x8"; + case 't': + return "\t"; + case "\t": + return "\t"; + case 'n': + return "\n"; + case 'v': + return "\xB"; + case 'f': + return "\xC"; + case 'r': + return "\r"; + case 'e': + return "\x1B"; + case ' ': + return ' '; + case '"': + return '"'; + case '/': + return '/'; + case '\\': + return '\\'; + case 'N': + // U+0085 NEXT LINE + return "\xC2\x85"; + case '_': + // U+00A0 NO-BREAK SPACE + return "\xC2\xA0"; + case 'L': + // U+2028 LINE SEPARATOR + return "\xE2\x80\xA8"; + case 'P': + // U+2029 PARAGRAPH SEPARATOR + return "\xE2\x80\xA9"; + case 'x': + return self::utf8chr(hexdec(substr($value, 2, 2))); + case 'u': + return self::utf8chr(hexdec(substr($value, 2, 4))); + case 'U': + return self::utf8chr(hexdec(substr($value, 2, 8))); + default: + throw new ParseException(sprintf('Found unknown escape character "%s".', $value)); + } + } + + /** + * Get the UTF-8 character for the given code point. + * + * @param int $c The unicode code point + * + * @return string The corresponding UTF-8 character + */ + private static function utf8chr($c) + { + if (0x80 > $c %= 0x200000) { + return chr($c); + } + if (0x800 > $c) { + return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); + } + if (0x10000 > $c) { + return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } + + return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } +} diff --git a/vendor/drush/drush/src/internal-forks/Config/Yaml/Yaml.php b/vendor/drush/drush/src/internal-forks/Config/Yaml/Yaml.php new file mode 100644 index 0000000000000000000000000000000000000000..693aa0f67afd17f5166153408c9fe68725037d7a --- /dev/null +++ b/vendor/drush/drush/src/internal-forks/Config/Yaml/Yaml.php @@ -0,0 +1,84 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Drush\Internal\Config\Yaml; + +use Drush\Internal\Config\Yaml\Exception\ParseException; + +/** + * Yaml offers convenience methods to load and dump YAML. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Yaml +{ + const DUMP_OBJECT = 1; + const PARSE_EXCEPTION_ON_INVALID_TYPE = 2; + const PARSE_OBJECT = 4; + const PARSE_OBJECT_FOR_MAP = 8; + const DUMP_EXCEPTION_ON_INVALID_TYPE = 16; + const PARSE_DATETIME = 32; + const DUMP_OBJECT_AS_MAP = 64; + const DUMP_MULTI_LINE_LITERAL_BLOCK = 128; + const PARSE_CONSTANT = 256; + const PARSE_CUSTOM_TAGS = 512; + const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024; + const PARSE_KEYS_AS_STRINGS = 2048; + + /** + * Parses YAML into a PHP value. + * + * Usage: + * <code> + * $array = Yaml::parse(file_get_contents('config.yml')); + * print_r($array); + * </code> + * + * @param string $input A string containing YAML + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * + * @return mixed The YAML converted to a PHP value + * + * @throws ParseException If the YAML is not valid + */ + public static function parse($input, $flags = 0) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the PARSE_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = self::PARSE_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 3) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the PARSE_OBJECT flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(2)) { + $flags |= self::PARSE_OBJECT; + } + } + + if (func_num_args() >= 4) { + @trigger_error('Passing a boolean flag to toggle object for map support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT_FOR_MAP flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(3)) { + $flags |= self::PARSE_OBJECT_FOR_MAP; + } + } + + $yaml = new Parser(); + + return $yaml->parse($input, $flags); + } +} diff --git a/vendor/drush/drush/tests/COVERAGE.txt b/vendor/drush/drush/tests/COVERAGE.txt deleted file mode 100644 index e3f2c93a6b02b2493f3b17983bd3768396512a0e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/COVERAGE.txt +++ /dev/null @@ -1,89 +0,0 @@ -COMMANDS ------------- -pm-download: GOOD. - need test for `pm-download --select` (hard to test; depends on state of project releases on d.o.) -pm-updatecode: GOOD. -pm-update: FAIR. Implicitly tested by pm-updatecode but updatedb not yet tested. -pm-releasenotes -pm-releases -pm-enable: GOOD. testEnDisUnList(). -pm-disable: GOOD. testEnDisUnList(). -pm-uninstall: GOOD. testEnDisUnList(). -pm-list: GOOD. testEnDisUnList(). -pm-info: GOOD. testEnDisUnList(). -pm-refresh: -version-control: FAIR. See updatecode. To be deprecated all git workflow after git.drupal.org? -package-hander: - -sql-cli: -sql-connect: -sql-query: FAIR. Implicit by site-install, sql-sync -sql-dump: GOOD. tested by sqlDumpTest. -sql-sync: GOOD. testLocalSqlSync(). - need test: --source-dump, --target-dump, --source-dump-dir and --target-dump-dir and permutations of same used together. -sql-drop: FAIR. Implicit by site-install -sql-sanitize: FAIR. Implicit by testLocalSqlSync() - - -updatedb: NONE. Used to be implicitly tested by siteUpgradeTest. -archive-dump: GOOD -archive-restore: GOOD. Has own test and implicitly tested by environment cache in Unish framework. -help -version: GOOD. Implicit by testStandaloneScript() -php-eval: GOOD. Implicitly tested by many tests (e.g. completeTest). -php-script: GOOD. -drupal-directory: GOOD -cache-get: GOOD -cache-set: GOOD -cache-clear: GOOD -core-config: NONE -core-cron -core-status: FAIR: Implicit test by contextTest. -docs -core-rsync -core-quick-drupal: GOOD -image: GOOD -queue-*: GOOD -runserver -search-* -shellalias: GOOD - need test: shell alias with site alias -site-install: FAIR. Implicit test by setUpDrupal(). -state: NONE -ssh: GOOD -topic -usage-* -variable-*: GOOD -watchdog-*: GOOD - -user-*: GOOD. - -field-*: GOOD. - -make: GOOD - -INCLUDES ------------- -backend: GOOD - need test: --pipe with remote alias and --pipe with list of aliases -batch: GOOD -bootstrap: -command: FAIR -complete: GOOD -context: FAIR. Many functions implicitly tested. Option merging (config, include, alias-path) not tested. -drush: NONE. -environment -sitealias. FAIR. Explicit test for alias lists. Single aliases implicitly tested by contextTest. Option propagation tested by backendTest. Option recovery for @self alias tested by sqlDumpTest. -dbtng: Good. Implicit by variable-*. -drupal -exec: GOOD: Implicitly tested all over. -filesystem -output - - -ROOT -------------- -drush: - need test: drush.ini -drush.php -drush.complete.sh: N/A diff --git a/vendor/drush/drush/tests/Drush/Tests/Make/Parser/ParserIniTest.php b/vendor/drush/drush/tests/Drush/Tests/Make/Parser/ParserIniTest.php deleted file mode 100644 index 37f5d41c131d94fb6ef97f77cd53fa9f4483d633..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/Drush/Tests/Make/Parser/ParserIniTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drush\Tests\Make\Parser; - -use Drush\Make\Parser\ParserIni; - -/** - * @coversDefaultClass \Drush\Make\Parser\ParserIni - */ -class ParserIniTest extends \PHPUnit_Framework_TestCase { - - /** - * @covers ::supportedFile - */ - public function testSupportedFile() { - $this->assertFalse(ParserIni::supportedFile('-')); - $this->assertFalse(ParserIni::supportedFile('/tmp/foo/bar/baz.make.yml')); - $this->assertTrue(ParserIni::supportedFile('./baz/foo.make')); - } - - /** - * @dataProvider providerParse - * @covers ::parse - */ - public function testParse($ini, $expected) { - $parsed = ParserIni::parse($ini); - $this->assertSame($expected, $parsed); - } - - /** - * Provides INI snippets to test the parser. - */ - public function providerParse() { - $snippets[] = array('foo[bar][baz] = one', array('foo' => array('bar' => array('baz' => 'one')))); - $snippets[] = array("; A comment should not be part of the returned array\nprojects[] = drupal", array('projects' => array('drupal'))); - - // @todo make more tests. - return $snippets; - } - -} diff --git a/vendor/drush/drush/tests/Drush/Tests/Make/Parser/ParserYamlTest.php b/vendor/drush/drush/tests/Drush/Tests/Make/Parser/ParserYamlTest.php deleted file mode 100644 index cf2a67df702871de2f90996e30c59788c6fe4b5d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/Drush/Tests/Make/Parser/ParserYamlTest.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -namespace Drush\Tests\Make\Parser; - -use Drush\Make\Parser\ParserYaml; - -/** - * @coversDefaultClass \Drush\Make\Parser\ParserYaml - */ -class ParserYamlTest extends \PHPUnit_Framework_TestCase { - - /** - * @covers ::supportedFile - */ - public function testSupportedFile() { - // @todo allow stdin support for Yaml files as well. - $this->assertFalse(ParserYaml::supportedFile('-')); - $this->assertTrue(ParserYaml::supportedFile('/tmp/foo/bar/baz.make.yml')); - $this->assertFalse(ParserYaml::supportedFile('./baz/foo.make')); - } - - /** - * @dataProvider providerParse - * @covers ::parse - */ - public function testParse($yaml, $expected) { - $parsed = ParserYaml::parse($yaml); - $this->assertSame($expected, $parsed); - } - - /** - * Provides YAML snippets to test the parser. - */ - public function providerParse() { - $yaml = <<<'YAML' -foo: - bar: - baz: one -YAML; - $snippets[] = array($yaml, array('foo' => array('bar' => array('baz' => 'one')))); - - $yaml = <<<'YAML' -projects: - drupal: ~ - views: - version: '3.0' -YAML; - - $snippets[] = array($yaml, array('projects' => array('drupal' => NULL, 'views' => array('version' => '3.0')))); - - // @todo make more tests. - return $snippets; - } - -} diff --git a/vendor/drush/drush/tests/README.md b/vendor/drush/drush/tests/README.md deleted file mode 100644 index b86e0da667c3a6a4c772e5eeee2886adcd11dbd9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/README.md +++ /dev/null @@ -1,29 +0,0 @@ -Drush's test suite is based on [PHPUnit](http://www.phpunit.de). In order to maintain -high quality, our tests are run on every push by [Travis](https://travis-ci.org/drush-ops/drush) - -Usage --------- -1. Review the configuration settings in [tests/phpunit.xml.dist](phpunit.xml.dist). If customization is needed, copy to phpunit.xml and edit away. -1. Run unit tests: `unish.sh` - -Advanced usage ---------- -- Run only tests matching a regex: `unish.sh --filter=testVersionString` -- Skip slow tests (usually those with network usage): `unish.sh --exclude-group slow` -- XML results: `unish.sh --filter=testVersionString --log-junit results.xml` -- Use an alternate version of Drupal: `UNISH_DRUPAL_MAJOR_VERSION=8 unish.sh ...` -- Skip teardown (to examine test sites after a failure): `UNISH_DIRTY=1 unish.sh ...` - -Reuse by Drush Commandfiles ------------ -Drush commandfiles are encouraged to ship with PHPUnit test cases that -extend UnitUnishTestCase and CommandUnishTestCase. In order to run -the tests, you have to point to the phpunit.xml file that used by Drush. -The devel project has a wrapper script which demonstrates this - -http://drupalcode.org/project/devel.git/blob/refs/heads/8.x-1.x:/run-tests-drush.sh - -Cache ------------ -In order to speed up test runs, Unish (the Drush testing class) caches built Drupal sites -and restores them as requested by tests. Once in while, you might need to clear this cache -by deleting the <tmp>/drush-cache directory. diff --git a/vendor/drush/drush/tests/Unish/CommandUnishTestCase.php b/vendor/drush/drush/tests/Unish/CommandUnishTestCase.php deleted file mode 100644 index 86ba50bfa204a4dcebcd580dbbc67b49b25222c3..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/Unish/CommandUnishTestCase.php +++ /dev/null @@ -1,417 +0,0 @@ -<?php - -namespace Unish; - -use Symfony\Component\Process\Process; -use Symfony\Component\Process\Exception\ProcessTimedOutException; - -abstract class CommandUnishTestCase extends UnishTestCase { - - // Unix exit codes. - const EXIT_SUCCESS = 0; - const EXIT_ERROR = 1; - const UNISH_EXITCODE_USER_ABORT = 75; // Same as DRUSH_EXITCODE_USER_ABORT - - /** - * Code coverage data collected during a single test. - * - * @var array - */ - protected $coverage_data = array(); - - /** - * Process of last executed command. - * - * @var Process - */ - private $process; - - /** - * Default timeout for commands. - * - * @var int - */ - private $defaultTimeout = 60; - - /** - * Timeout for command. - * - * Reset to $defaultTimeout after executing a command. - * - * @var int - */ - protected $timeout = 60; - - /** - * Default idle timeout for commands. - * - * @var int - */ - private $defaultIdleTimeout = 15; - - /** - * Idle timeouts for commands. - * - * Reset to $defaultIdleTimeout after executing a command. - * - * @var int - */ - protected $idleTimeout = 15; - - /** - * Accessor for the last output, trimmed. - * - * @return string - * Trimmed output as text. - * - * @access public - */ - function getOutput() { - return trim($this->getOutputRaw()); - } - - /** - * Accessor for the last output, non-trimmed. - * - * @return string - * Raw output as text. - * - * @access public - */ - function getOutputRaw() { - return $this->process ? $this->process->getOutput() : ''; - } - - /** - * Accessor for the last output, rtrimmed and split on newlines. - * - * @return array - * Output as array of lines. - * - * @access public - */ - function getOutputAsList() { - return array_map('rtrim', explode("\n", $this->getOutput())); - } - - /** - * Accessor for the last stderr output, trimmed. - * - * @return string - * Trimmed stderr as text. - * - * @access public - */ - function getErrorOutput() { - return trim($this->getErrorOutputRaw()); - } - - /** - * Accessor for the last stderr output, non-trimmed. - * - * @return string - * Raw stderr as text. - * - * @access public - */ - function getErrorOutputRaw() { - return $this->process ? $this->process->getErrorOutput() : ''; - } - - /** - * Accessor for the last stderr output, rtrimmed and split on newlines. - * - * @return array - * Stderr as array of lines. - * - * @access public - */ - function getErrorOutputAsList() { - return array_map('rtrim', explode("\n", $this->getErrorOutput())); - } - - /** - * Accessor for the last output, decoded from json. - * - * @param string $key - * Optionally return only a top level element from the json object. - * - * @return object - * Decoded object. - */ - function getOutputFromJSON($key = NULL) { - $json = json_decode($this->getOutput()); - if (isset($key)) { - $json = $json->{$key}; // http://stackoverflow.com/questions/2925044/hyphens-in-keys-of-object - } - return $json; - } - - /** - * Actually runs the command. - * - * @param string $command - * The actual command line to run. - * @param integer $expected_return - * The return code to expect - * @param sting cd - * The directory to run the command in. - * @param array $env - * @todo: Not fully implemented yet. Inheriting environment is hard - http://stackoverflow.com/questions/3780866/why-is-my-env-empty. - * @see drush_env(). - * Extra environment variables. - * @param string $input - * A string representing the STDIN that is piped to the command. - * @return integer - * Exit code. Usually self::EXIT_ERROR or self::EXIT_SUCCESS. - */ - function execute($command, $expected_return = self::EXIT_SUCCESS, $cd = NULL, $env = NULL, $input = NULL) { - $return = 1; - $this->tick(); - - // Apply the environment variables we need for our test to the head of the - // command (excludes Windows). Process does have an $env argument, but it replaces the entire - // environment with the one given. This *could* be used for ensuring the - // test ran with a clean environment, but it also makes tests fail hard on - // Travis, for unknown reasons. - // @see https://github.com/drush-ops/drush/pull/646 - $prefix = ''; - if($env && !$this->is_windows()) { - foreach ($env as $env_name => $env_value) { - $prefix .= $env_name . '=' . self::escapeshellarg($env_value) . ' '; - } - } - $this->log("Executing: $command", 'warning'); - - try { - // Process uses a default timeout of 60 seconds, set it to 0 (none). - $this->process = new Process($command, $cd, NULL, $input, 0); - if (!getenv('UNISH_NO_TIMEOUTS')) { - $this->process->setTimeout($this->timeout) - ->setIdleTimeout($this->idleTimeout); - } - $return = $this->process->run(); - if ($expected_return !== $return) { - $message = 'Unexpected exit code ' . $return . ' (expected ' . $expected_return . ") for command:\n" . $command; - throw new UnishProcessFailedError($message, $this->process); - } - // Reset timeouts to default. - $this->timeout = $this->defaultTimeout; - $this->idleTimeout = $this->defaultIdleTimeout; - return $return; - } - catch (ProcessTimedOutException $e) { - if ($e->isGeneralTimeout()) { - $message = 'Command runtime exceeded ' . $this->timeout . " seconds:\n" . $command; - } - else { - $message = 'Command had no output for ' . $this->idleTimeout . " seconds:\n" . $command; - } - throw new UnishProcessFailedError($message, $this->process); - } - } - - /** - * Invoke drush in via execute(). - * - * @param command - * A defined drush command such as 'cron', 'status' or any of the available ones such as 'drush pm'. - * @param args - * Command arguments. - * @param $options - * An associative array containing options. - * @param $site_specification - * A site alias or site specification. Include the '@' at start of a site alias. - * @param $cd - * A directory to change into before executing. - * @param $expected_return - * The expected exit code. Usually self::EXIT_ERROR or self::EXIT_SUCCESS. - * @param $suffix - * Any code to append to the command. For example, redirection like 2>&1. - * @param array $env - * Environment variables to pass along to the subprocess. @todo - not used. - * @return integer - * An exit code. - */ - function drush($command, array $args = array(), array $options = array(), $site_specification = NULL, $cd = NULL, $expected_return = self::EXIT_SUCCESS, $suffix = NULL, $env = array()) { - $global_option_list = array('simulate', 'root', 'uri', 'include', 'config', 'alias-path', 'ssh-options', 'backend'); - $hide_stderr = FALSE; - $cmd[] = UNISH_DRUSH; - - // Insert global options. - foreach ($options as $key => $value) { - if (in_array($key, $global_option_list)) { - unset($options[$key]); - if ($key == 'backend') { - $hide_stderr = TRUE; - $value = NULL; - } - if (!isset($value)) { - $cmd[] = "--$key"; - } - else { - $cmd[] = "--$key=" . self::escapeshellarg($value); - } - } - } - - if ($level = $this->log_level()) { - $cmd[] = '--' . $level; - } - $cmd[] = "--nocolor"; - - // Insert code coverage argument before command, in order for it to be - // parsed as a global option. This matters for commands like ssh and rsync - // where options after the command are passed along to external commands. - $result = $this->getTestResultObject(); - if ($result->getCollectCodeCoverageInformation()) { - $coverage_file = tempnam(UNISH_TMP, 'drush_coverage'); - if ($coverage_file) { - $cmd[] = "--drush-coverage=" . $coverage_file; - } - } - - // Insert site specification and drush command. - $cmd[] = empty($site_specification) ? NULL : self::escapeshellarg($site_specification); - $cmd[] = $command; - - // Insert drush command arguments. - foreach ($args as $arg) { - $cmd[] = self::escapeshellarg($arg); - } - // insert drush command options - foreach ($options as $key => $value) { - if (!isset($value)) { - $cmd[] = "--$key"; - } - else { - $cmd[] = "--$key=" . self::escapeshellarg($value); - } - } - - $cmd[] = $suffix; - if ($hide_stderr) { - $cmd[] = '2>' . $this->bit_bucket(); - } - $exec = array_filter($cmd, 'strlen'); // Remove NULLs - // Set sendmail_path to 'true' to disable any outgoing emails - // that tests might cause Drupal to send. - - $php_options = (array_key_exists('PHP_OPTIONS', $env)) ? $env['PHP_OPTIONS'] . " " : ""; - // @todo The PHP Options below are not yet honored by execute(). See .travis.yml for an alternative way. - $env['PHP_OPTIONS'] = "${php_options}-d sendmail_path='true'"; - $return = $this->execute(implode(' ', $exec), $expected_return, $cd, $env); - - // Save code coverage information. - if (!empty($coverage_file)) { - $data = unserialize(file_get_contents($coverage_file)); - unlink($coverage_file); - // Save for appending after the test finishes. - $this->coverage_data[] = $data; - } - - return $return; - } - - /** - * Override the run method, so we can add in our code coverage data after the - * test has run. - * - * We have to collect all coverage data, merge them and append them as one, to - * avoid having phpUnit duplicating the test function as many times as drush - * has been invoked. - * - * Runs the test case and collects the results in a TestResult object. - * If no TestResult object is passed a new one will be created. - * - * @param PHPUnit_Framework_TestResult $result - * @return PHPUnit_Framework_TestResult - * @throws PHPUnit_Framework_Exception - */ - public function run(\PHPUnit_Framework_TestResult $result = NULL) { - $result = parent::run($result); - $data = array(); - foreach ($this->coverage_data as $merge_data) { - foreach ($merge_data as $file => $lines) { - if (!isset($data[$file])) { - $data[$file] = $lines; - } - else { - foreach ($lines as $num => $executed) { - if (!isset($data[$file][$num])) { - $data[$file][$num] = $executed; - } - else { - $data[$file][$num] = ($executed == 1 ? $executed : $data[$file][$num]); - } - } - } - } - } - - // Reset coverage data. - $this->coverage_data = array(); - if (!empty($data)) { - $result->getCodeCoverage()->append($data, $this); - } - return $result; - } - - /** - * A slightly less functional copy of drush_backend_parse_output(). - */ - function parse_backend_output($string) { - $regex = sprintf(UNISH_BACKEND_OUTPUT_DELIMITER, '(.*)'); - preg_match("/$regex/s", $string, $match); - if (isset($match[1])) { - // we have our JSON encoded string - $output = $match[1]; - // remove the match we just made and any non printing characters - $string = trim(str_replace(sprintf(UNISH_BACKEND_OUTPUT_DELIMITER, $match[1]), '', $string)); - } - - if (!empty($output)) { - $data = json_decode($output, TRUE); - if (is_array($data)) { - return $data; - } - } - return $string; - } - - /** - * Ensure that an expected log message appears in the Drush log. - * - * $this->drush('command', array(), array('backend' => NULL)); - * $parsed = $this->parse_backend_output($this->getOutput()); - * $this->assertLogHasMessage($parsed['log'], "Expected message", 'debug') - * - * @param $log Parsed log entries from backend invoke - * @param $message The expected message that must be contained in - * some log entry's 'message' field. Substrings will match. - * @param $logType The type of log message to look for; all other - * types are ignored. If FALSE (the default), then all log types - * will be searched. - */ - function assertLogHasMessage($log, $message, $logType = FALSE) { - foreach ($log as $entry) { - if (!$logType || ($entry['type'] == $logType)) { - if (strpos($entry['message'], $message) !== FALSE) { - return TRUE; - } - } - } - $this->fail("Could not find expected message in log: " . $message); - } - - function drush_major_version() { - static $major; - - if (!isset($major)) { - $this->drush('version', array('drush_version'), array('pipe' => NULL)); - $version = trim($this->getOutput()); - list($major) = explode('.', $version); - } - return (int)$major; - } -} diff --git a/vendor/drush/drush/tests/Unish/UnishProcessFailedError.php b/vendor/drush/drush/tests/Unish/UnishProcessFailedError.php deleted file mode 100644 index 765b42821f43a89f23c1e9bb1c6a297c77daf67d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/Unish/UnishProcessFailedError.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -namespace Unish; - -use Symfony\Component\Process\Process; - -class UnishProcessFailedError extends \PHPUnit_Framework_AssertionFailedError { - public function __construct($message, Process $process) { - if ($output = $process->getOutput()) { - $message .= "\n\nCommand output:\n" . $output; - } - if ($stderr = $process->getErrorOutput()) { - $message .= "\n\nCommand stderr:\n" . $stderr; - } - - parent::__construct($message); - } -} diff --git a/vendor/drush/drush/tests/Unish/UnishTestCase.php b/vendor/drush/drush/tests/Unish/UnishTestCase.php deleted file mode 100644 index c0b3144092c3af747dd1fdb5be2dfcf46868bfe2..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/Unish/UnishTestCase.php +++ /dev/null @@ -1,455 +0,0 @@ -<?php - -namespace Unish; - -abstract class UnishTestCase extends \PHPUnit_Framework_TestCase { - - /** - * A list of Drupal sites that have been recently installed. They key is the - * site name and values are details about each site. - * - * @var array - */ - private static $sites = array(); - - function __construct($name = NULL, array $data = array(), $dataName = '') { - parent::__construct($name, $data, $dataName); - } - - /** - * Assure that each class starts with an empty sandbox directory and - * a clean environment - http://drupal.org/node/1103568. - */ - public static function setUpBeforeClass() { - self::setUpFreshSandBox(); - } - - /** - * Remove any pre-existing sandbox, then create a new one. - */ - public static function setUpFreshSandBox() { - // Avoid perm denied error on Windows by moving out of the dir to be deleted. - chdir(dirname(UNISH_SANDBOX)); - $sandbox = UNISH_SANDBOX; - if (file_exists($sandbox)) { - unish_file_delete_recursive($sandbox); - } - $ret = mkdir($sandbox, 0777, TRUE); - chdir(UNISH_SANDBOX); - - mkdir(getenv('HOME') . '/.drush', 0777, TRUE); - mkdir($sandbox . '/etc/drush', 0777, TRUE); - mkdir($sandbox . '/share/drush/commands', 0777, TRUE); - - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - // Hack to make git use unix line endings on windows - // We need it to make hashes of files pulled from git match ones hardcoded in tests - if (!file_exists($sandbox . '\home')) { - mkdir($sandbox . '\home'); - } - exec("git config --file $sandbox\\home\\.gitconfig core.autocrlf false", $output, $return); - } - } - - /** - * Runs after all tests in a class are run. Remove sandbox directory. - */ - public static function tearDownAfterClass() { - chdir(dirname(UNISH_SANDBOX)); - $dirty = getenv('UNISH_DIRTY'); - if (file_exists(UNISH_SANDBOX) && empty($dirty)) { - unish_file_delete_recursive(UNISH_SANDBOX, TRUE); - } - self::$sites = array(); - } - - /** - * Print a log message to the console. - * - * @param string $message - * @param string $type - * Supported types are: - * - notice - * - verbose - * - debug - */ - function log($message, $type = 'notice') { - $line = "\nLog: $message\n"; - switch ($this->log_level()) { - case 'verbose': - if (in_array($type, array('notice', 'verbose'))) fwrite(STDERR, $line); - break; - case 'debug': - fwrite(STDERR, $line); - break; - default: - if ($type == 'notice') fwrite(STDERR, $line); - break; - } - } - - function log_level() { - // -d is reserved by `phpunit` - if (in_array('--debug', $_SERVER['argv'])) { - return 'debug'; - } - elseif (in_array('--verbose', $_SERVER['argv']) || in_array('-v', $_SERVER['argv'])) { - return 'verbose'; - } - } - - public static function is_windows() { - return strtoupper(substr(PHP_OS, 0, 3)) == "WIN"; - } - - public static function get_tar_executable() { - return self::is_windows() ? "bsdtar.exe" : "tar"; - } - - /** - * Print out a tick mark. - * - * Useful for longer running tests to indicate they're working. - */ - function tick() { - static $chars = array('/', '-', '\\', '|'); - static $counter = 0; - // ANSI support is flaky on Win32, so don't try to do ticks there. - if (!$this->is_windows()) { - print $chars[($counter++ % 4)] . "\033[1D"; - } - } - - /** - * Converts a Windows path (dir1\dir2\dir3) into a Unix path (dir1/dir2/dir3). - * Also converts a cygwin "drive emulation" path (/cygdrive/c/dir1) into a - * proper drive path, still with Unix slashes (c:/dir1). - * - * @copied from Drush's environment.inc - */ - function convert_path($path) { - $path = str_replace('\\','/', $path); - $path = preg_replace('/^\/cygdrive\/([A-Za-z])(.*)$/', '\1:\2', $path); - - return $path; - } - - /** - * Borrowed from Drush. - * Checks operating system and returns - * supported bit bucket folder. - */ - function bit_bucket() { - if (!$this->is_windows()) { - return '/dev/null'; - } - else { - return 'nul'; - } - } - - public static function escapeshellarg($arg) { - // Short-circuit escaping for simple params (keep stuff readable) - if (preg_match('|^[a-zA-Z0-9.:/_-]*$|', $arg)) { - return $arg; - } - elseif (self::is_windows()) { - return self::_escapeshellarg_windows($arg); - } - else { - return escapeshellarg($arg); - } - } - - public static function _escapeshellarg_windows($arg) { - // Double up existing backslashes - $arg = preg_replace('/\\\/', '\\\\\\\\', $arg); - - // Double up double quotes - $arg = preg_replace('/"/', '""', $arg); - - // Double up percents. - $arg = preg_replace('/%/', '%%', $arg); - - // Add surrounding quotes. - $arg = '"' . $arg . '"'; - - return $arg; - } - - /** - * Helper function to generate a random string of arbitrary length. - * - * Copied from drush_generate_password(), which is otherwise not available here. - * - * @param $length - * Number of characters the generated string should contain. - * @return - * The generated string. - */ - public function randomString($length = 10) { - // This variable contains the list of allowable characters for the - // password. Note that the number 0 and the letter 'O' have been - // removed to avoid confusion between the two. The same is true - // of 'I', 1, and 'l'. - $allowable_characters = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'; - - // Zero-based count of characters in the allowable list: - $len = strlen($allowable_characters) - 1; - - // Declare the password as a blank string. - $pass = ''; - - // Loop the number of times specified by $length. - for ($i = 0; $i < $length; $i++) { - - // Each iteration, pick a random character from the - // allowable string and append it to the password: - $pass .= $allowable_characters[mt_rand(0, $len)]; - } - - return $pass; - } - - public function mkdir($path) { - if (!is_dir($path)) { - if ($this->mkdir(dirname($path))) { - if (@mkdir($path)) { - return TRUE; - } - } - return FALSE; - } - return TRUE; - } - - public function recursive_copy($src, $dst) { - $dir = opendir($src); - $this->mkdir($dst); - while(false !== ( $file = readdir($dir)) ) { - if (( $file != '.' ) && ( $file != '..' )) { - if ( is_dir($src . '/' . $file) ) { - $this->recursive_copy($src . '/' . $file,$dst . '/' . $file); - } - else { - copy($src . '/' . $file,$dst . '/' . $file); - } - } - } - closedir($dir); - } - - function webroot() { - return UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'web'; - } - - function getSites() { - return self::$sites; - } - - function directory_cache($subdir = '') { - return getenv('CACHE_PREFIX') . '/' . $subdir; - } - - /** - * @param $env - * @return string - */ - function db_url($env) { - return substr(UNISH_DB_URL, 0, 6) == 'sqlite' ? "sqlite://sites/$env/files/unish.sqlite" : UNISH_DB_URL . '/unish_' . $env; - } - - function db_driver($db_url = UNISH_DB_URL) { - return parse_url(UNISH_DB_URL, PHP_URL_SCHEME); - } - - function defaultInstallationVersion() { - // There's a leading dot in UNISH_DRUPAL_MINOR_VERSION - return UNISH_DRUPAL_MAJOR_VERSION . UNISH_DRUPAL_MINOR_VERSION; - } - - function setUpDrupal($num_sites = 1, $install = FALSE, $version_string = NULL, $profile = NULL) { - if (!$version_string) { - $version_string = $this->defaultInstallationVersion(); - } - $sites_subdirs_all = array('dev', 'stage', 'prod', 'retired', 'elderly', 'dead', 'dust'); - $sites_subdirs = array_slice($sites_subdirs_all, 0, $num_sites); - $root = $this->webroot(); - $major_version = substr($version_string, 0, 1); - - if (!isset($profile)) { - $profile = $major_version >= 7 ? 'testing' : 'default'; - } - $db_driver = $this->db_driver(UNISH_DB_URL); - - $cache_keys = array($num_sites, $install ? 'install' : 'noinstall', $version_string, $profile, $db_driver); - $source = $this->directory_cache('environments') . '/' . implode('-', $cache_keys) . '.tar.gz'; - if (file_exists($source)) { - $this->log('Cache HIT. Environment: ' . $source, 'verbose'); - $this->drush('archive-restore', array($source), array('destination' => $root, 'overwrite' => NULL)); - } - else { - $this->log('Cache MISS. Environment: ' . $source, 'verbose'); - // Build the site(s), install (if needed), then cache. - foreach ($sites_subdirs as $subdir) { - $this->fetchInstallDrupal($subdir, $install, $version_string, $profile); - } - $options = array( - 'destination' => $source, - 'root' => $root, - 'uri' => reset($sites_subdirs), - 'overwrite' => NULL, - ); - if ($install) { - $this->drush('archive-dump', array('@sites'), $options); - } - } - // Write an empty sites.php if we are on D7+. Needed for multi-site on D8 and - // used on D7 in \Unish\saCase::testBackendHonorsAliasOverride. - if ($major_version >= 7 && !file_exists($root . '/sites/sites.php')) { - copy($root . '/sites/example.sites.php', $root . '/sites/sites.php'); - } - - // Print the result of a run of 'drush status' on the Drupal we are testing against - $options = array( - 'root' => $this->webroot(), - 'uri' => reset($sites_subdirs), - ); - $this->drush('core-status', array('Drupal version'), $options); - $header = "\nTesting on "; - fwrite(STDERR, $header . $this->getOutput() . "\n\n"); - - // Stash details about each site. - foreach ($sites_subdirs as $subdir) { - self::$sites[$subdir] = array( - 'root' => $root, - 'uri' => $subdir, - 'db_url' => $this->db_url($subdir), - ); - // Make an alias for the site - $this->writeSiteAlias($subdir, $root, $subdir); - } - return self::$sites; - } - - function fetchInstallDrupal($env = 'dev', $install = FALSE, $version_string = NULL, $profile = NULL, $separate_roots = FALSE) { - if (!$version_string) { - $version_string = UNISH_DRUPAL_MAJOR_VERSION; - } - $root = $this->webroot(); - $uri = $separate_roots ? "default" : "$env"; - $options = array(); - $site = "$root/sites/$uri"; - - if (substr($version_string, 0, 1) == 6 && $this->db_driver(UNISH_DB_URL) == 'sqlite') { - // Validate - $this->markTestSkipped("Drupal 6 does not support SQLite."); - } - - // Download Drupal if not already present. - if (!file_exists($root) && (substr($version_string, 0, 1) == 6)) { - if (!$this->downloadDrupal6($version_string, $root)) { - $this->markTestSkipped("Could not download d6lts."); - } - } - if (!file_exists($root)) { - $options += array( - 'destination' => dirname($root), - 'drupal-project-rename' => basename($root), - 'yes' => NULL, - 'quiet' => NULL, - 'cache' => NULL, - ); - $this->drush('pm-download', array("drupal-$version_string"), $options); - // @todo This path is not proper in D8. - mkdir($root . '/sites/all/drush', 0777, TRUE); - } - - // If specified, install Drupal as a multi-site. - if ($install) { - $options = array( - 'root' => $root, - 'db-url' => $this->db_url($env), - 'sites-subdir' => $uri, - 'yes' => NULL, - 'quiet' => NULL, - ); - $this->drush('site-install', array($profile), $options); - // Give us our write perms back. - chmod($site, 0777); - chmod("$site/settings.php", 0777); - } - else { - @mkdir($site); - touch("$site/settings.php"); - } - } - - // pm-download cannot download from d6lts, so we will rough in our own download function - function downloadDrupal6($drupal_6_test_version, $root) { - if (($drupal_6_test_version == '6') || ($drupal_6_test_version == '6.x')) { - $drupal_6_test_version = '6.46'; - } - return $this->downloadFromGitHub('d6lts/drupal', $drupal_6_test_version, $root, "drupal-$drupal_6_test_version"); - } - - function downloadFromGitHub($project, $version, $target, $rootDirToRemove = '') { - $url = "https://github.com/{$project}/archive/{$version}.zip"; - $tarPath = dirname($target) . '/' . basename($url); - if (!$this->cachedDownload($url, $tarPath)) { - return false; - } - $zipDir = $target; - if (!empty($rootDirToRemove)) { - $zipDir = dirname($zipDir); - } - passthru("unzip -od $zipDir $tarPath >/dev/null 2>&1", $status); - if ($status != 0) { - return false; - } - if (!empty($rootDirToRemove)) { - rename("$zipDir/$rootDirToRemove", $zipDir . '/' . basename($target)); - } - return file_exists($target); - } - - function cachedDownload($url, $target) { - $dlCacheDir = $this->directory_cache('dl'); - @mkdir($dlCacheDir); - $cacheFile = $dlCacheDir . '/' . basename($target); - if (!file_exists($cacheFile)) { - passthru("curl -L --output $cacheFile $url >/dev/null 2>&1", $status); - if ($status != 0) { - return false; - } - } - copy($cacheFile, $target); - return file_exists($target); - } - - function writeSiteAlias($name, $root, $uri) { - $alias_definition = array($name => array('root' => $root, 'uri' => $uri)); - file_put_contents(UNISH_SANDBOX . '/etc/drush/' . $name . '.alias.drushrc.php', $this->unish_file_aliases($alias_definition)); - } - - /** - * Prepare the contents of an aliases file. - */ - function unish_file_aliases($aliases) { - foreach ($aliases as $name => $alias) { - $records[] = sprintf('$aliases[\'%s\'] = %s;', $name, var_export($alias, TRUE)); - } - $contents = "<?php\n\n" . implode("\n\n", $records); - return $contents; - } - - /** - * @see drush_drupal_sitewide_directory() - */ - function drupalSitewideDirectory($major_version = NULL) { - if (!$major_version) { - $major_version = UNISH_DRUPAL_MAJOR_VERSION; - } - return ($major_version < 8) ? '/sites/all' : ''; - } -} diff --git a/vendor/drush/drush/tests/Unish/UnitUnishTestCase.php b/vendor/drush/drush/tests/Unish/UnitUnishTestCase.php deleted file mode 100644 index 554f6fe62a060d2823cec8c087c3fcc1929ee24f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/Unish/UnitUnishTestCase.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Unish; - -/** - * Base class for Drush unit tests - * - * Those tests will run in a bootstrapped Drush environment - * - * This should be ran in separate processes, which the following - * annotation should do in 3.6 and above: - * - * @runTestsInSeparateProcesses - */ -abstract class UnitUnishTestCase extends UnishTestCase { - - /** - * Minimally bootstrap drush - * - * This is equivalent to the level DRUSH_BOOTSTRAP_NONE, as we - * haven't run drush_bootstrap() yet. To do anything, you'll need to - * bootstrap to some level using drush_bootstrap(). - * - * @see drush_bootstrap() - */ - public static function setUpBeforeClass() { - parent::setUpBeforeClass(); - require_once(__DIR__ . '/../../includes/preflight.inc'); - drush_preflight_prepare(); - // Need to set DRUSH_COMMAND so that drush will be called and not phpunit - define('DRUSH_COMMAND', UNISH_DRUSH); - } - - public static function tearDownAfterClass() { - parent::tearDownAfterClass(); - \drush_postflight(); - } - - function drush_major_version() { - return DRUSH_MAJOR_VERSION; - } -} diff --git a/vendor/drush/drush/tests/annotatedCommandTest.php b/vendor/drush/drush/tests/annotatedCommandTest.php deleted file mode 100644 index 1446025cd6993e6092ec948039034d9a0b18b01d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/annotatedCommandTest.php +++ /dev/null @@ -1,189 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group base - */ -class annotatedCommandCase extends CommandUnishTestCase { - - public function testGlobal() { - $globalExtensions = $this->setupGlobalExtensionsForTests(); - - $options = []; - - // We modified the set of available Drush commands; we need to clear the Drush command cache - $this->drush('cc', array('drush'), $options); - - // drush foobar - $options['include'] = "$globalExtensions"; - $this->drush('foobar', array(), $options); - $output = $this->getOutput(); - $this->assertEquals('baz', $output); - - // Clear the Drush command cache again and test again with new includes - $this->drush('cc', array('drush'), $options); - - // drush foobar again, except include the 'Commands' folder when passing --include - $options['include'] = "$globalExtensions/Commands"; - $this->drush('foobar', array(), $options); - $output = $this->getOutput(); - $this->assertEquals('baz', $output); - } - - public function testExecute() { - $sites = $this->setUpDrupal(1, TRUE); - $uri = key($sites); - $root = $this->webroot(); - $options = array( - 'root' => $root, - 'uri' => $uri, - 'yes' => NULL, - ); - - // Copy the 'woot' module over to the Drupal site we just set up. - $this->setupModulesForTests($root); - - // These are not good asserts, but for the purposes of isolation.... - $targetDir = $root . DIRECTORY_SEPARATOR . $this->drupalSitewideDirectory() . '/modules/woot'; - if (UNISH_DRUPAL_MAJOR_VERSION == 8) { - $commandFile = $targetDir . "/src/Commands/WootCommands.php"; - } else { - $commandFile = $targetDir . "/Commands/WootCommands.php"; - } - $this->assertFileExists(dirname(dirname(dirname($commandFile)))); - $this->assertFileExists(dirname(dirname($commandFile))); - $this->assertFileExists(dirname($commandFile)); - $this->assertFileExists($commandFile); - - // Enable out module. This will also clear the commandfile cache. - $this->drush('pm-enable', array('woot'), $options); - - // In theory this is not necessary, but this test keeps failing. - $this->drush('cc', array('drush'), $options); - - // drush woot --help - $this->drush('woot', array(), $options + ['help' => NULL]); - $output = $this->getOutput(); - $this->assertContains('Woot mightily.', $output); - $this->assertContains('Aliases: wt', $output); - - // drush help woot - $this->drush('help', array('woot'), $options); - $output = $this->getOutput(); - $this->assertContains('Woot mightily.', $output); - - // drush woot - $this->drush('woot', array(), $options); - $output = $this->getOutput(); - $this->assertEquals('Woot!', $output); - - // drush my-cat --help - $this->drush('my-cat', array(), $options + ['help' => NULL]); - $output = $this->getOutput(); - $this->assertContains('This is the my-cat command', $output); - $this->assertContains('bet alpha --flip', $output); - $this->assertContains('The first parameter', $output); - $this->assertContains('The other parameter', $output); - $this->assertContains('Whether or not the second parameter', $output); - $this->assertContains('Aliases: c', $output); - - // drush help my-cat - $this->drush('help', array('my-cat'), $options); - $output = $this->getOutput(); - $this->assertContains('This is the my-cat command', $output); - - // drush my-cat bet alpha --flip - $this->drush('my-cat', array('bet', 'alpha'), $options + ['flip' => NULL]); - $output = $this->getOutput(); - $this->assertEquals('alphabet', $output); - - // drush woot --help with the 'woot' module ignored - $this->drush('woot', array(), $options + ['help' => NULL, 'ignored-modules' => 'woot'], NULL, NULL, self::EXIT_ERROR); - - // drush my-cat bet alpha --flip - $this->drush('my-cat', array('bet', 'alpha'), $options + ['flip' => NULL, 'ignored-modules' => 'woot'], NULL, NULL, self::EXIT_ERROR); - - $this->drush('try-formatters', array(), $options); - $output = $this->getOutput(); - $expected = <<<EOT - ------ ------ ------- - I II III - ------ ------ ------- - One Two Three - Eins Zwei Drei - Ichi Ni San - Uno Dos Tres - ------ ------ ------- -EOT; - $this->assertEquals(trim(preg_replace('#[ \n]+#', ' ', $expected)), trim(preg_replace('#[ \n]+#', ' ', $output))); - - $this->drush('try-formatters --format=yaml --fields=III,II', array(), $options, NULL, NULL, self::EXIT_SUCCESS); - $output = $this->getOutput(); - $expected = <<<EOT -en: - third: Three - second: Two -de: - third: Drei - second: Zwei -jp: - third: San - second: Ni -es: - third: Tres - second: Dos -EOT; - $this->assertEquals($expected, $output); - - $this->drush('try-formatters', array(), $options + ['backend' => NULL]); - $parsed = $this->parse_backend_output($this->getOutput()); - $data = $parsed['object']; - $expected = <<<EOT -{"en":{"first":"One","second":"Two","third":"Three"},"de":{"first":"Eins","second":"Zwei","third":"Drei"},"jp":{"first":"Ichi","second":"Ni","third":"San"},"es":{"first":"Uno","second":"Dos","third":"Tres"}} -EOT; - $this->assertEquals($expected, json_encode($data)); - - // drush try-formatters --help - $this->drush('try-formatters', array(), $options + ['help' => NULL], NULL, NULL, self::EXIT_SUCCESS); - $output = $this->getOutput(); - $this->assertContains('Demonstrate formatters', $output); - $this->assertContains('try:formatters --fields=first,third', $output); - $this->assertContains('try:formatters --fields=III,II', $output); - $this->assertContains('--fields=<first, second, third>', $output); - $this->assertContains('Fields to output. All available', $output); - $this->assertContains('--format=<table>', $output); - $this->assertContains('Select output format. Available:', $output); - $this->assertContains('Aliases: try-formatters', $output); - - // If we are running Drupal version 8 or later, then also check to - // see if the demo:greet and annotated:greet commands are available. - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - $this->drush('demo:greet symfony', array(), $options, NULL, NULL, self::EXIT_SUCCESS); - $output = $this->getOutput(); - $this->assertEquals('Hello symfony', $output); - - $this->drush('annotated:greet symfony', array(), $options, NULL, NULL, self::EXIT_SUCCESS); - $output = $this->getOutput(); - $this->assertEquals('Hello symfony', $output); - } - - // Flush the Drush cache so that our 'woot' command is not cached. - $this->drush('cache-clear', array('drush'), $options, NULL, NULL, self::EXIT_SUCCESS); - } - - public function setupGlobalExtensionsForTests() { - $globalExtension = __DIR__ . '/resources/global-includes'; - $targetDir = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'global-includes'; - $this->mkdir($targetDir); - $this->recursive_copy($globalExtension, $targetDir); - return $targetDir; - } - - public function setupModulesForTests($root) { - $wootModule = __DIR__ . '/resources/modules/d' . UNISH_DRUPAL_MAJOR_VERSION . '/woot'; - $targetDir = $root . DIRECTORY_SEPARATOR . $this->drupalSitewideDirectory() . '/modules/woot'; - $this->mkdir($targetDir); - $this->recursive_copy($wootModule, $targetDir); - } -} diff --git a/vendor/drush/drush/tests/archiveDumpTest.php b/vendor/drush/drush/tests/archiveDumpTest.php deleted file mode 100644 index cae2b48be864272d07d85179490b8c59ab6581c4..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/archiveDumpTest.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php - -namespace Unish; - -require_once dirname(__FILE__) . '/../includes/context.inc'; -require_once dirname(__FILE__) . '/../includes/filesystem.inc'; - -/** - * Tests for archive-dump and archive-restore - * - * @group commands - */ -class archiveDumpCase extends CommandUnishTestCase { - /** - * archive-dump behaves slightly different when archiving a site installed - * at sites/default so we make the test to use sites/default as the - * installation directory instead of default sites/dev. - */ - const uri = 'default'; - - /** - * Install a site and dump it to an archive. - */ - private function archiveDump($no_core) { - $profile = UNISH_DRUPAL_MAJOR_VERSION >= 7 ? 'testing' : 'default'; - $this->fetchInstallDrupal(self::uri, TRUE, NULL, $profile); - $root = $this->webroot(); - $dump_dest = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'dump.tar.gz'; - $options = array( - 'root' => $root, - 'uri' => self::uri, - 'yes' => NULL, - 'destination' => $dump_dest, - 'overwrite' => NULL, - ); - if ($no_core) { - $options['no-core'] = NULL; - } - $this->drush('archive-dump', array(self::uri), $options); - - return $dump_dest; - } - - /** - * Untar an archive and return the path to the untarred folder. - */ - private function unTar($dump_dest) { - $untar_dest = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'untar'; - unish_file_delete_recursive($untar_dest, TRUE); - $tar = self::get_tar_executable(); - $exec = sprintf("mkdir %s && cd %s && $tar -xzf %s", $untar_dest, $untar_dest, $dump_dest); - $this->execute($exec); - - return $untar_dest; - } - - /** - * Test if tarball generated by archive-dump looks right. - */ - public function testArchiveDump() { - $dump_dest = $this->archiveDump(FALSE); - $docroot = basename($this->webroot()); - - // Check the dump file is a gzip file. - $exec = sprintf('file %s', $dump_dest); - $this->execute($exec); - $output = $this->getOutput(); - $expected = '%sgzip compressed data%s'; - $this->assertStringMatchesFormat($expected, $output); - - // Untar the archive and make sure it looks right. - $untar_dest = $this->unTar($dump_dest); - - if (strpos(UNISH_DB_URL, 'mysql') !== FALSE) { - $this->execute(sprintf('head %s/unish_%s.sql | grep "MySQL dump"', $untar_dest, self::uri)); - } - $this->assertFileExists($untar_dest . '/MANIFEST.ini'); - $this->assertFileExists($untar_dest . '/' . $docroot); - - return $dump_dest; - } - - /** - * Test archive-restore. - * - * Restore the archive generated in testArchiveDump() and verify that the - * directory contents are identical. - * - * @depends testArchiveDump - */ - public function testArchiveRestore($dump_dest) { - $restore_dest = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'restore'; - $options = array( - 'yes' => NULL, - 'destination' => $restore_dest, - ); - $this->drush('archive-restore', array($dump_dest), $options); - $original_codebase = drush_dir_md5($this->webroot()); - $restored_codebase = drush_dir_md5($restore_dest); - $this->assertEquals($original_codebase, $restored_codebase); - } - - /** - * Test if tarball generated by archive-dump with --no-core looks right. - */ - public function testArchiveDumpNoCore() { - $dump_dest = $this->archiveDump(TRUE); - $untar_dest = $this->unTar($dump_dest); - $docroot = basename($this->webroot()); - $this->assertFileExists($untar_dest . '/MANIFEST.ini'); - $this->assertFileExists($untar_dest . '/' . $docroot); - $modules_dir = UNISH_DRUPAL_MAJOR_VERSION >= 8 ? '/core/modules' : '/modules'; - $this->assertFileNotExists($untar_dest . '/' . $docroot . $modules_dir, 'No modules directory should exist with --no-core'); - - return $dump_dest; - } - - /** - * Test archive-restore for a site archive (--no-core). - * - * @depends testArchiveDumpNoCore - */ - public function testArchiveRestoreNoCore($dump_dest) { - $root = $this->webroot(); - $original_codebase = drush_dir_md5($root); - unish_file_delete_recursive($root . '/sites/' . self::uri, TRUE); - $options = array( - 'yes' => NULL, - 'destination' => $root, - ); - $this->drush('archive-restore', array($dump_dest), $options); - - $restored_codebase = drush_dir_md5($root); - $this->assertEquals($original_codebase, $restored_codebase); - } -} diff --git a/vendor/drush/drush/tests/backendTest.php b/vendor/drush/drush/tests/backendTest.php deleted file mode 100644 index c41736fe121e6ab9adfd96e746c5e3a7d7263956..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/backendTest.php +++ /dev/null @@ -1,263 +0,0 @@ -<?php - -namespace Unish; - -/** - * We choose to test the backend system in two parts. - * - Origin. These tests assure that we are generate a proper ssh command - * when a backend invoke is needed. - * - Target. These tests assure that drush generates a delimited JSON array - * when called with --backend option. - * - * Advantages of this approach: - * - No network calls and thus more robust. - * - No network calls and thus faster. - * - * @group base - */ -class backendCase extends CommandUnishTestCase { - // Test to insure that calling drush_invoke_process() with 'dispatch-using-alias' - // will build a command string that uses the alias instead of --root and --uri. - function testDispatchUsingAlias() { - $this->markTestIncomplete('Started failing due to https://github.com/drush-ops/drush/pull/555'); - - $aliasPath = UNISH_SANDBOX . '/aliases'; - mkdir($aliasPath); - $aliasFile = $aliasPath . '/foo.aliases.drushrc.php'; - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['dev'] = array('root' => '/fake/path/to/root', 'uri' => 'default'); -EOD; - file_put_contents($aliasFile, $aliasContents); - $options = array( - 'alias-path' => $aliasPath, - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - 'script-path' => dirname(__FILE__) . '/resources', // Find unit.drush.inc commandfile. - 'backend' => TRUE, - ); - $this->drush('php-script', array('testDispatchUsingAlias_script'), $options); - $parsed = $this->parse_backend_output($this->getOutput()); - - // $parsed['with'] and $parsed['without'] now contain an array - // each with the original arguments passed in with and without - // 'dispatch-using-alias', respectively. - $argDifference = array_diff($parsed['object']['with'], $parsed['object']['without']); - $this->assertEquals(array_diff(array_values($argDifference), array('@foo.dev')), array()); - $argDifference = array_diff($parsed['object']['without'], $parsed['object']['with']); - $this->assertEquals(array_diff(array_values($argDifference), array('--root=/fake/path/to/root', '--uri=default')), array()); - } - - /** - * Covers the following origin responsibilities. - * - A remote host is recognized in site specification. - * - Generates expected ssh command. - * - * General handling of site aliases will be in sitealiasTest.php. - */ - function testOrigin() { - $site_specification = 'user@server/path/to/drupal#sitename'; - $exec = sprintf('%s %s version arg1 arg2 --simulate --ssh-options=%s 2>%s', UNISH_DRUSH, self::escapeshellarg($site_specification), self::escapeshellarg('-i mysite_dsa'), self::escapeshellarg($this->bit_bucket())); - $this->execute($exec); - $bash = $this->escapeshellarg('drush --uri=sitename --root=/path/to/drupal version arg1 arg2 2>&1'); - $expected = "Simulating backend invoke: ssh -i mysite_dsa user@server $bash 2>&1"; - $output = $this->getOutput(); - $this->assertContains($expected, $output, 'Expected ssh command was built'); - - // Assure that arguments and options are passed along to a command thats not recognized locally. - $this->drush('non-existent-command', array('foo'), array('bar' => 'baz', 'simulate' => NULL), $site_specification); - $output = $this->getOutput(); - $this->assertContains('foo', $output); - $this->assertContains('--bar=baz', $output); - } - - /** - * Covers the following target responsibilities. - * - Interpret stdin as options as per REST API. - * - Successfully execute specified command. - * - JSON object has expected contents (including errors). - * - JSON object is wrapped in expected delimiters. - */ - function testTarget() { - $stdin = json_encode(array('filter'=>'sql')); - $exec = sprintf('%s version --backend 2>%s', UNISH_DRUSH, self::escapeshellarg($this->bit_bucket())); - $this->execute($exec, self::EXIT_SUCCESS, NULL, NULL, $stdin); - $parsed = $this->parse_backend_output($this->getOutput()); - $this->assertTrue((bool) $parsed, 'Successfully parsed backend output'); - $this->assertArrayHasKey('log', $parsed); - $this->assertArrayHasKey('output', $parsed); - $this->assertArrayHasKey('object', $parsed); - $this->assertEquals(self::EXIT_SUCCESS, $parsed['error_status']); - // This assertion shows that `version` was called and that stdin options were respected. - $this->assertStringStartsWith(' Drush Version ', $parsed['output']); - $this->assertEquals('Starting Drush preflight.', $parsed['log'][1]['message']); - - // Check error propogation by requesting an invalid command (missing Drupal site). - $this->drush('core-cron', array(), array('backend' => NULL), NULL, NULL, self::EXIT_ERROR); - $parsed = $this->parse_backend_output($this->getOutput()); - $this->assertEquals(1, $parsed['error_status']); - $this->assertArrayHasKey('DRUSH_COMMAND_INSUFFICIENT_BOOTSTRAP', $parsed['error_log']); - } - - /** - * Covers the following target responsibilities. - * - Insures that the 'Drush version' line from drush status appears in the output. - * - Insures that the backend output start marker appears in the output (this is a backend command). - * - Insures that the drush output appears before the backend output start marker (output is displayed in 'real time' as it is produced). - */ - function testRealtimeOutput() { - $exec = sprintf('%s core-status --backend --nocolor 2>&1', UNISH_DRUSH); - $this->execute($exec); - - $output = $this->getOutput(); - $drush_version_offset = strpos($output, "Drush version"); - $backend_output_offset = strpos($output, "DRUSH_BACKEND_OUTPUT_START>>>"); - - $this->assertTrue($drush_version_offset !== FALSE, "'Drush version' string appears in output."); - $this->assertTrue($backend_output_offset !== FALSE, "Drush backend output marker appears in output."); - $this->assertTrue($drush_version_offset < $backend_output_offset, "Drush version string appears in output before the backend output marker."); - } - - /** - * Covers the following target responsibilities. - * - Insures that function result is returned in --backend mode - */ - function testBackendFunctionResult() { - $php = "return 'bar'"; - $this->drush('php-eval', array($php), array('backend' => NULL)); - $parsed = $this->parse_backend_output($this->getOutput()); - // assert that $parsed has 'bar' - $this->assertEquals("'bar'", var_export($parsed['object'], TRUE)); - } - - /** - * Covers the following target responsibilities. - * - Insures that backend_set_result is returned in --backend mode - * - Insures that the result code for the function does not overwrite - * the explicitly-set value - */ - function testBackendSetResult() { - $php = "drush_backend_set_result('foo'); return 'bar'"; - $this->drush('php-eval', array($php), array('backend' => NULL)); - $parsed = $this->parse_backend_output($this->getOutput()); - // assert that $parsed has 'foo' and not 'bar' - $this->assertEquals("'foo'", var_export($parsed['object'], TRUE)); - } - - /** - * Covers the following target responsibilities. - * - Insures that the backend option 'invoke-multiple' will cause multiple commands to be executed. - * - Insures that the right number of commands run. - * - Insures that the 'concurrent'-format result array is returned. - * - Insures that correct results are returned from each command. - */ - function testBackendInvokeMultiple() { - $options = array( - 'backend' => NULL, - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - ); - $php = "\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('x' => 'y', 'strict' => 0), array('invoke-multiple' => '3')); return \$values;"; - $this->drush('php-eval', array($php), $options); - $parsed = $this->parse_backend_output($this->getOutput()); - // assert that $parsed has a 'concurrent'-format output result - $this->assertEquals('concurrent', implode(',', array_keys($parsed['object']))); - // assert that the concurrent output has indexes 0, 1 and 2 (in any order) - $concurrent_indexes = array_keys($parsed['object']['concurrent']); - sort($concurrent_indexes); - $this->assertEquals('0,1,2', implode(',', $concurrent_indexes)); - foreach ($parsed['object']['concurrent'] as $index => $values) { - // assert that each result contains 'x' => 'y' and nothing else - $this->assertEquals("array ( - 'x' => 'y', -)", var_export($values['object'], TRUE)); - } - } - /** - * Covers the following target responsibilities. - * - Insures that arrays are stripped when using --backend mode's method GET - * - Insures that arrays can be returned as the function result of - * backend invoke. - */ - function testBackendMethodGet() { - $options = array( - 'backend' => NULL, - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - ); - $php = "\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('x' => 'y', 'strict' => 0, 'data' => array('a' => 1, 'b' => 2)), array('method' => 'GET')); return array_key_exists('object', \$values) ? \$values['object'] : 'no result';"; - $this->drush('php-eval', array($php), $options); - $parsed = $this->parse_backend_output($this->getOutput()); - // assert that $parsed has 'x' but not 'data' - $this->assertEquals("array ( - 'x' => 'y', -)", var_export($parsed['object'], TRUE)); - } - - /** - * Covers the following target responsibilities. - * - Insures that complex arrays can be passed through when using --backend mode's method POST - * - Insures that arrays can be returned as the function result of - * backend invoke. - */ - function testBackendMethodPost() { - $options = array( - 'backend' => NULL, - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - ); - $php = "\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('x' => 'y', 'strict' => 0, 'data' => array('a' => 1, 'b' => 2)), array('method' => 'POST')); return array_key_exists('object', \$values) ? \$values['object'] : 'no result';"; - $this->drush('php-eval', array($php), $options); - $parsed = $this->parse_backend_output($this->getOutput()); - // assert that $parsed has 'x' and 'data' - $this->assertEquals(array ( - 'x' => 'y', - 'data' => - array ( - 'a' => 1, - 'b' => 2, - ), -), $parsed['object']); - } - - /** - * Covers the following target responsibilities. - * - Insures that backend invoke can properly re-assemble packets - * that are split across process-read-size boundaries. - * - * This test works by repeating testBackendMethodGet(), while setting - * '#process-read-size' to a very small value, insuring that packets - * will be split. - */ - function testBackendReassembleSplitPackets() { - $options = array( - 'backend' => NULL, - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - ); - $min = 1; - $max = 4; - $read_sizes_to_test = array(4096); - if (in_array('--debug', $_SERVER['argv'])) { - $read_sizes_to_test[] = 128; - $read_sizes_to_test[] = 16; - $max = 16; - } - foreach ($read_sizes_to_test as $read_size) { - $log_message=""; - for ($i = $min; $i <= $max; $i++) { - $log_message .= "X"; - $php = "\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('log-message' => '$log_message', 'x' => 'y$read_size', 'strict' => 0, 'data' => array('a' => 1, 'b' => 2)), array('method' => 'GET', '#process-read-size' => $read_size)); return array_key_exists('object', \$values) ? \$values['object'] : 'no result';"; - $this->drush('php-eval', array($php), $options); - $parsed = $this->parse_backend_output($this->getOutput()); - // assert that $parsed has 'x' but not 'data' - $all_warnings=array(); - foreach ($parsed['log'] as $log) { - if ($log['type'] == 'warning') { - $all_warnings[] = $log['message']; - } - } - $this->assertEquals("$log_message,done", implode(',', $all_warnings), 'Log reconstruction with read_size ' . $read_size); - $this->assertEquals("array ( - 'x' => 'y$read_size', -)", var_export($parsed['object'], TRUE)); - } - } - } -} diff --git a/vendor/drush/drush/tests/backendUnitTest.php b/vendor/drush/drush/tests/backendUnitTest.php deleted file mode 100644 index 6d6ece0aff76435ecc3ad0c652943d5cfecdc3af..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/backendUnitTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Unish; - -class backendUnitCase extends UnitUnishTestCase { - - /** - * Covers the following target responsibilities. - * - Insures that drush_invoke_process() called with fork backend set is able - * to invoke a non-blocking process. - */ - function testBackendFork() { - if (self::is_windows()) { - $this->markTestSkipped('Fork tests not a priority on Windows.'); - } - - // Ensure that file that will be created by forked process does not exist - // before invocation. - $test_file = UNISH_SANDBOX . '/fork_test.txt'; - if (file_exists($test_file)) { - unlink($test_file); - } - - // Sleep for a millisecond, then create the file - $ev_php = "usleep(1000);fopen('$test_file','a');"; - drush_invoke_process("@none", "ev", array($ev_php), array(), array("fork" => TRUE)); - - // Test file does not exist immediate after process forked - $this->assertEquals(file_exists($test_file), FALSE); - // Check every 100th of a second for up to 4 seconds to see if the file appeared - $repetitions = 400; - while (!file_exists($test_file) && ($repetitions > 0)) { - usleep(10000); - } - // Assert that the file did finally appear - $this->assertEquals(file_exists($test_file), TRUE); - } -} diff --git a/vendor/drush/drush/tests/batchTest.php b/vendor/drush/drush/tests/batchTest.php deleted file mode 100644 index 3db4d768f1ab063b88822bf97f6d707ab974fc62..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/batchTest.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests the drush batch subsystem. - * - * @see includes/batch.inc - * - * @group base - */ -class batchCase extends CommandUnishTestCase { - - public function testBatch() { - $sites = $this->setUpDrupal(1, TRUE); - $options = array( - 'root' => $this->webroot(), - 'uri' => key($sites), - 'yes' => NULL, - 'include' => dirname(__FILE__), - ); - $this->drush('unit-batch', array(), $options); - // Collect log messages that begin with "!!!" (@see: _drush_unit_batch_operation()) - $parsed = $this->parse_backend_output($this->getOutput()); - $special_log_msgs = ''; - foreach ($parsed['log'] as $key => $log) { - if(substr($log['message'],0,3) == '!!!') { - $special_log_msgs .= $log['message']; - } - } - $this->assertEquals("!!! ArrayObject does its job.", $special_log_msgs, 'Batch messages were logged'); - } -} diff --git a/vendor/drush/drush/tests/bootstrap.inc b/vendor/drush/drush/tests/bootstrap.inc deleted file mode 100644 index e0294d5731bab3ba8fb3a702b29060170dc8322a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/bootstrap.inc +++ /dev/null @@ -1,188 +0,0 @@ -<?php - -/** - * @file - * Initialize a sandboxed environment. Starts with call unish_init() at bottom. - */ - -// This code copied from drush_bootstrap_prepare() except for 1st line. -$drush_base_path = dirname(__DIR__); -$local_vendor_path = $drush_base_path . '/vendor/autoload.php'; -$global_vendor_path = $drush_base_path . '/../../../vendor/autoload.php'; -// Check for a local composer install or a global composer install. Vendor dirs are in different spots. -if ((!@include $local_vendor_path) && (!@include $global_vendor_path)) { - $msg = "Unable to load autoload.php. Drush now requires Composer in order to install its dependencies and autoload classes. Please see http://docs.drush.org/en/master/install/\n"; - fwrite(STDERR, $msg); - return FALSE; -} - -unish_init(); - -/** - * Initialize our environment at the start of each run (i.e. suite). - */ -function unish_init() { - // Default drupal major version to run tests over. - $unish_drupal_major = '8'; - if (getenv('UNISH_DRUPAL_MAJOR_VERSION')) { - $unish_drupal_major = getenv('UNISH_DRUPAL_MAJOR_VERSION'); - } - elseif (isset($GLOBALS['UNISH_DRUPAL_MAJOR_VERSION'])) { - $unish_drupal_major = $GLOBALS['UNISH_DRUPAL_MAJOR_VERSION']; - } - define('UNISH_DRUPAL_MAJOR_VERSION', $unish_drupal_major); - $unish_drupal_minor = ''; - if ($unish_drupal_major == 8) { - if (getenv('UNISH_DRUPAL_MINOR_VERSION')) { - $unish_drupal_minor = '.' . getenv('UNISH_DRUPAL_MINOR_VERSION'); - } - elseif (isset($GLOBALS['UNISH_DRUPAL_MINOR_VERSION'])) { - $unish_drupal_minor = '.' . $GLOBALS['UNISH_DRUPAL_MINOR_VERSION']; - } - } - define('UNISH_DRUPAL_MINOR_VERSION', $unish_drupal_minor); - - // We read from env then globals then default to mysql. - $unish_db_url = 'mysql://root:@127.0.0.1'; - if (getenv('UNISH_DB_URL')) { - $unish_db_url = getenv('UNISH_DB_URL'); - } - elseif (isset($GLOBALS['UNISH_DB_URL'])) { - $unish_db_url = $GLOBALS['UNISH_DB_URL']; - } - if (UNISH_DRUPAL_MAJOR_VERSION == '6') { - $unish_db_url = preg_replace('#^mysql://#', 'mysqli://', $unish_db_url); - } - define('UNISH_DB_URL', $unish_db_url); - - // UNISH_DRUSH value can come from phpunit.xml. - if (!defined('UNISH_DRUSH')) { - // Let the UNISH_DRUSH environment variable override if set. - $unish_drush = isset($_SERVER['UNISH_DRUSH']) ? $_SERVER['UNISH_DRUSH'] : NULL; - $unish_drush = isset($GLOBALS['UNISH_DRUSH']) ? $GLOBALS['UNISH_DRUSH'] : $unish_drush; - if (empty($unish_drush)) { - $script = \Unish\UnitUnishTestCase::is_windows() ? 'dr.bat' : 'drush'; - $unish_drush = dirname(__DIR__) . DIRECTORY_SEPARATOR . $script; - } - define('UNISH_DRUSH', $unish_drush); - } - - define('UNISH_TMP', realpath(getenv('UNISH_TMP') ? getenv('UNISH_TMP') : (isset($GLOBALS['UNISH_TMP']) ? $GLOBALS['UNISH_TMP'] : sys_get_temp_dir()))); - define('UNISH_SANDBOX', UNISH_TMP . DIRECTORY_SEPARATOR . 'drush-sandbox'); - - // Cache dir lives outside the sandbox so that we get persistence across classes. - define('UNISH_CACHE', UNISH_TMP . DIRECTORY_SEPARATOR . 'drush-cache'); - putenv("CACHE_PREFIX=" . UNISH_CACHE); - // Wipe at beginning of run. - if (file_exists(UNISH_CACHE)) { - // TODO: We no longer clean up cache dir between runs. Much faster, but we - // we should watch for subtle problems. To manually clean up, delete the - // UNISH_TMP/drush-cache directory. - // unish_file_delete_recursive($cache, TRUE); - } - else { - $ret = mkdir(UNISH_CACHE, 0777, TRUE); - } - - $home = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'home'; - putenv("HOME=$home"); - putenv("HOMEDRIVE=$home"); - - putenv('ETC_PREFIX=' . UNISH_SANDBOX); - putenv('SHARE_PREFIX=' . UNISH_SANDBOX); - putenv('TEMP=' . UNISH_TMP); - - define('UNISH_USERGROUP', isset($GLOBALS['UNISH_USERGROUP']) ? $GLOBALS['UNISH_USERGROUP'] : NULL); - - define('UNISH_BACKEND_OUTPUT_DELIMITER', 'DRUSH_BACKEND_OUTPUT_START>>>%s<<<DRUSH_BACKEND_OUTPUT_END'); -} - -/** - * Deletes the specified file or directory and everything inside it. - * - * Usually respects read-only files and folders. To do a forced delete use - * drush_delete_tmp_dir() or set the parameter $forced. - * - * To avoid permission denied error on Windows, make sure your CWD is not - * inside the directory being deleted. - * - * This is essentially a copy of drush_delete_dir(). - * - * @todo This sort of duplication isn't very DRY. This is bound to get out of - * sync with drush_delete_dir(), as in fact it already has before. - * - * @param string $dir - * The file or directory to delete. - * @param bool $force - * Whether or not to try everything possible to delete the directory, even if - * it's read-only. Defaults to FALSE. - * @param bool $follow_symlinks - * Whether or not to delete symlinked files. Defaults to FALSE--simply - * unlinking symbolic links. - * - * @return bool - * FALSE on failure, TRUE if everything was deleted. - * - * @see drush_delete_dir() - */ -function unish_file_delete_recursive($dir, $force = TRUE, $follow_symlinks = FALSE) { - // Do not delete symlinked files, only unlink symbolic links - if (is_link($dir) && !$follow_symlinks) { - return unlink($dir); - } - // Allow to delete symlinks even if the target doesn't exist. - if (!is_link($dir) && !file_exists($dir)) { - return TRUE; - } - if (!is_dir($dir)) { - if ($force) { - // Force deletion of items with readonly flag. - @chmod($dir, 0777); - } - return unlink($dir); - } - if (unish_delete_dir_contents($dir, $force) === FALSE) { - return FALSE; - } - if ($force) { - // Force deletion of items with readonly flag. - @chmod($dir, 0777); - } - return rmdir($dir); -} - -/** - * Deletes the contents of a directory. - * - * This is essentially a copy of drush_delete_dir_contents(). - * - * @param string $dir - * The directory to delete. - * @param bool $force - * Whether or not to try everything possible to delete the contents, even if - * they're read-only. Defaults to FALSE. - * - * @return bool - * FALSE on failure, TRUE if everything was deleted. - * - * @see drush_delete_dir_contents() - */ -function unish_delete_dir_contents($dir, $force = FALSE) { - $scandir = @scandir($dir); - if (!is_array($scandir)) { - return FALSE; - } - - foreach ($scandir as $item) { - if ($item == '.' || $item == '..') { - continue; - } - if ($force) { - @chmod($dir, 0777); - } - if (!unish_file_delete_recursive($dir . '/' . $item, $force)) { - return FALSE; - } - } - return TRUE; -} diff --git a/vendor/drush/drush/tests/cacheCommandTest.php b/vendor/drush/drush/tests/cacheCommandTest.php deleted file mode 100644 index 5bebd154a079bc25bd7590a86112a1eb809e49ff..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/cacheCommandTest.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -namespace Unish; - -/** - * Cache command testing. - * - * @group base - */ -class cacheCommandCase extends CommandUnishTestCase { - - function setUp() { - if (!$this->getSites()) { - $this->setUpDrupal(1, TRUE); - } - } - - function testCacheGet() { - $options = $this->getOptions(); - // Test the cache get command. - $inputs = array( - 6 => array('variables', NULL), - 7 => array('schema', NULL), - 8 => array('system.date', 'config'), - ); - list($key, $bin) = $inputs[UNISH_DRUPAL_MAJOR_VERSION]; - $this->drush('cache-get', array($key, $bin), $options + array('format' => 'json')); - $schema = $this->getOutputFromJSON('data'); - $this->assertNotEmpty($schema); - - // Test that get-ing a non-existant cid fails. - $this->drush('cache-get', array('test-failure-cid'), $options + array('format' => 'json'), NULL, NULL, self::EXIT_ERROR); - } - - function testCacheSet() { - $options = $this->getOptions(); - // Test setting a new cache item. - $expected = 'cache test string'; - $this->drush('cache-set', array('cache-test-cid', $expected), $options); - $this->drush('cache-get', array('cache-test-cid'), $options + array('format' => 'json')); - $data = $this->getOutputFromJSON('data'); - $this->assertEquals($expected, $data); - - // Test cache-set using all arguments and many options. - $expected = array('key' => 'value'); - $input = array('data'=> $expected); - $stdin = json_encode($input); - $bin = UNISH_DRUPAL_MAJOR_VERSION >= 8 ? 'default' : 'cache'; - $exec = sprintf('%s cache-set %s %s my_cache_id - %s CACHE_PERMANENT --format=json --cache-get 2>%s', UNISH_DRUSH, "--root=" . self::escapeshellarg($options['root']), '--uri=' . $options['uri'], $bin, $this->bit_bucket()); - $return = $this->execute($exec, self::EXIT_SUCCESS, NULL, [], $stdin); - $this->drush('cache-get', array('my_cache_id'), $options + array('format' => 'json')); - $data = $this->getOutputFromJSON('data'); - $this->assertEquals((object)$expected, $data); - } - - function testCacheRebuild() { - $options = $this->getOptions(); - // Test cache-clear all and cache-rebuild (D8+). - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - $this->drush('cache-rebuild', array(), $options); - } - else { - $this->drush('cache-clear', array('all'), $options); - } - $this->drush('cache-get', array('cache-test-cid'), $options + array('format' => 'json'), NULL, NULL, self::EXIT_ERROR); - } - - function getOptions() { - return array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - ); - } -} diff --git a/vendor/drush/drush/tests/commandSpecificTest.php b/vendor/drush/drush/tests/commandSpecificTest.php deleted file mode 100644 index 250e259f942c3d68dbeeb308d1aeab233fe79c60..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/commandSpecificTest.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Unish; - -/** -* Assure that context API behaves as designed. Mostly implicitly tested, but we -* do have some edges that need explicit testing. -* -* @see drush/includes/context.inc. -* -* @group base -*/ -class commandSpecificCase extends CommandUnishTestCase { - - /** - * Try to write a tiny drushrc.php to each place that drush checks. Also - * write a sites/dev/aliases.drushrc.php file to the sandbox. - */ - function setUp() { - parent::setUp(); - - $path = UNISH_SANDBOX . '/aliases.drushrc.php'; - $aliases['site1'] = array( - 'root' => UNISH_SANDBOX, - 'uri' => 'site1.com', - 'source-command-specific' => array( - 'core-rsync' => array( - 'exclude-paths' => 'excluded_by_source', - ), - ), - 'target-command-specific' => array( - 'core-rsync' => array( - 'exclude-paths' => 'excluded_by_target', - ), - ), - 'path-aliases' => array( - '%files' => 'sites/default/files', - ), - ); - $contents = $this->unish_file_aliases($aliases); - $return = file_put_contents($path, $contents); - } - - function testCommandSpecific() { - $options = array( - 'alias-path' => UNISH_SANDBOX, - 'simulate' => NULL, - 'include-vcs' => NULL, - ); - $this->drush('core-rsync', array('/tmp', '@site1'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1'); - $output = trim($this->getOutput()); - $this->assertContains('excluded_by_target', $output); - $this->drush('core-rsync', array('@site1', '/tmp'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1'); - $output = trim($this->getOutput()); - $this->assertContains('excluded_by_source', $output); - $this->drush('core-rsync', array('@site1', '@site1'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1'); - $output = trim($this->getOutput()); - $this->assertContains('excluded_by_target', $output); - // Now do that all again with 'exclude-files' - $options['exclude-files'] = NULL; - $this->drush('core-rsync', array('/tmp', '@site1'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1'); - $output = trim($this->getOutput()); - $this->assertContains('sites/default/files', $output); - $this->assertContains('excluded_by_target', $output); - $this->assertNotContains('include-vcs', $output); - $this->assertNotContains('exclude-paths', $output); - $this->assertNotContains('exclude-files-processed', $output); - $this->drush('core-rsync', array('@site1', '/tmp'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1'); - $output = trim($this->getOutput()); - $this->assertContains('sites/default/files', $output); -// This one does not work. @see drush_sitealias_evaluate_path -// $this->assertContains('excluded_by_source', $output); - $this->assertNotContains('include-vcs', $output); - $this->assertNotContains('exclude-paths', $output); - $this->assertNotContains('exclude-files-processed', $output); - $this->drush('core-rsync', array('@site1', '@site1'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1'); - $output = trim($this->getOutput()); - $this->assertContains('sites/default/files', $output); - $this->assertContains('excluded_by_target', $output); - $this->assertNotContains('include-vcs', $output); - $this->assertNotContains('exclude-paths', $output); - $this->assertNotContains('exclude-files-processed', $output); - } -} diff --git a/vendor/drush/drush/tests/commandTest.php b/vendor/drush/drush/tests/commandTest.php deleted file mode 100644 index 141d12a6079a5f5df5d635d7420372472854f174..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/commandTest.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group base - */ -class commandCase extends CommandUnishTestCase { - public function testInvoke() { - $expected = array( - 'unit_drush_init', - 'drush_unit_invoke_init', - 'drush_unit_invoke_validate', - 'drush_unit_pre_unit_invoke', - 'drush_unit_invoke_primary', - // Primary callback is not invoked when command specifies a 'callback'. - // 'drush_unit_invoke', - 'drush_unit_post_unit_invoke', - 'drush_unit_post_unit_invoke_rollback', - 'drush_unit_pre_unit_invoke_rollback', - 'drush_unit_invoke_validate_rollback', - ); - - $options = array( - 'include' => dirname(__FILE__), - ); - $this->drush('unit-invoke', array(), $options, NULL, NULL, self::EXIT_ERROR); - $called = $this->getOutputFromJSON(); - $this->assertSame($expected, $called); - } - - /** - * Assert that minimum bootstrap phase is honored. - * - * Not testing dependency on a module since that requires an installed Drupal. - * Too slow for little benefit. - */ - public function testRequirementBootstrapPhase() { - // Assure that core-cron fails when run outside of a Drupal site. - $return = $this->drush('core-cron', array(), array('quiet' => NULL), NULL, NULL, self::EXIT_ERROR); - } - - /** - * Assert that unknown options are caught and flagged as errors - */ - public function testUnknownOptions() { - // Make sure an ordinary 'version' command works - $return = $this->drush('version', array(), array('pipe' => NULL)); - // Add an unknown option --magic=1234 and insure it fails - $return = $this->drush('version', array(), array('pipe' => NULL, 'magic' => 1234), NULL, NULL, self::EXIT_ERROR); - // Finally, add in a hook that uses hook_drush_help_alter to allow the 'magic' option. - // We need to run 'drush cc drush' to clear the commandfile cache; otherwise, our include will not be found. - $include_path = dirname(__FILE__) . '/hooks/magic_help_alter'; - $this->drush('version', array(), array('include' => $include_path, 'pipe' => NULL, 'magic' => '1234', 'strict' => NULL)); - } - - /** - * Assert that errors are thrown for commands with missing callbacks. - */ - public function testMissingCommandCallback() { - $options = array( - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - //'show-invoke' => TRUE, - ); - $this->drush('missing-callback', array(), $options, NULL, NULL, self::EXIT_ERROR); - } - - /** - * Assert that commands depending on unknown commandfiles are detected. - */ - public function testMissingDrushDependency() { - $options = array( - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - 'backend' => NULL, // To obtain and parse the error log. - ); - $this->drush('unit-drush-dependency', array(), $options, NULL, NULL, self::EXIT_ERROR); - $parsed = $this->parse_backend_output($this->getOutput()); - $this->assertArrayHasKey("DRUSH_COMMANDFILE_DEPENDENCY_ERROR", $parsed['error_log']); - } - - /** - * Assert that commands in disabled/uninstalled modules throw an error. - */ - public function testDisabledModule() { - $sites = $this->setUpDrupal(1, TRUE); - $uri = key($sites); - $root = $this->webroot(); - $options = array( - 'root' => $root, - 'uri' => $uri, - 'cache' => NULL, - ); - $this->drush('pm-download', array('devel'), $options); - $options += array( - 'backend' => NULL, // To obtain and parse the error log. - ); - // Assert that this has an error. - $this->drush('devel-reinstall', array(), $options, NULL, NULL, self::EXIT_ERROR); - } -} diff --git a/vendor/drush/drush/tests/commandUnitTest.php b/vendor/drush/drush/tests/commandUnitTest.php deleted file mode 100644 index 47e70289a7f5a03e4b4c2fe037678bae7430914e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/commandUnitTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace Unish; - -use Webmozart\PathUtil\Path; - -class commandUnitCase extends UnitUnishTestCase { - /** - * Assure that matching version-specific command files are loaded and others are ignored. - */ - function testCommandVersionSpecific() { - $path = Path::join(UNISH_SANDBOX, 'commandUnitCase'); - $major = $this->drush_major_version(); - $major_plus1 = $major + 1; - - // Write matched and unmatched files to the system search path. - $files = array( - Path::join($path, "$major.drush$major.inc"), - Path::join($path, "drush$major/drush$major.drush.inc"), - Path::join($path, "$major_plus1.drush$major_plus1.inc"), - Path::join($path, "drush$major_plus1/drush$major_plus1.drush.inc"), - ); - $this->mkdir(Path::join($path, 'drush'. $major)); - $this->mkdir(Path::join($path, 'drush'. $major_plus1)); - foreach ($files as $file) { - $contents = <<<EOD -<?php -// Written by Unish. This file is safe to delete. -\$GLOBALS['unish_foo'][] = '$file'; -EOD; - $return = file_put_contents($file, $contents); - } - drush_set_context('DRUSH_INCLUDE', array($path)); - drush_preflight(); - $loaded = drush_commandfile_list(); - $this->assertContains($files[0], $loaded); //Loaded a version-specific command file. - $this->assertContains($files[1], $loaded); //Loaded a version-specific command directory. - $this->assertNotContains($files[2], $loaded); //Did not load a mismatched version-specific command file. - $this->assertNotContains($files[3], $loaded); //Did not load a a mismatched version-specific command directory. - } - - /** - * Assert that $command has interesting properties. Reference command by - * it's alias (dl) to assure that those aliases are built as expected. - */ - public function testGetCommands() { - drush_preflight(); - $commands = drush_get_commands(); - $command = $commands['dl']; - - $this->assertEquals('dl', current($command['aliases'])); - $this->assertArrayHasKey('version_control', $command['engines']); - $this->assertArrayHasKey('package_handler', $command['engines']); - $this->assertArrayHasKey('release_info', $command['engines']); - $this->assertEquals('pm-download', $command['command']); - $this->assertEquals('pm', $command['commandfile']); - $this->assertEquals('drush_command', $command['callback']); - $this->assertArrayHasKey('examples', $command['sections']); - $this->assertTrue($command['is_alias']); - - $command = $commands['pm-download']; - $this->assertArrayNotHasKey('is_alias', $command); - } -} diff --git a/vendor/drush/drush/tests/completeTest.php b/vendor/drush/drush/tests/completeTest.php deleted file mode 100644 index 0afa2432b1219be1abaa6c870c3581c215e03adb..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/completeTest.php +++ /dev/null @@ -1,211 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group base - */ -class completeCase extends CommandUnishTestCase { - /** - * Write a config file that contains our configuration file. - */ - static function setUpBeforeClass() { - parent::setUpBeforeClass(); - $contents = " - <?php - - \$options['shell-aliases'] = array( - 'uninstall' => 'pm-uninstall', - ); - "; - file_put_contents(UNISH_SANDBOX . '/drushrc.php', trim($contents)); - } - - - - public function testComplete() { - if ($this->is_windows()) { - $this->markTestSkipped('Complete tests not fully working nor needed on Windows.'); - } - - // We copy our completetest commandfile into our path. - // We cannot use --include since complete deliberately avoids drush - // command dispatch. - copy(dirname(__FILE__) . '/completetest.drush.inc', getenv('HOME') . '/.drush/completetest.drush.inc'); - - $sites = $this->setUpDrupal(2); - $env = key($sites); - $root = $this->webroot(); - // We copy the unit test command into (only) our dev site, so we have a - // detectable difference we can use to detect cache correctness between - // sites. - mkdir("$root/sites/$env/modules"); - copy(dirname(__FILE__) . '/completetestsite.drush.inc', "$root/sites/$env/modules/completetestsite.drush.inc"); - // Clear the cache, so it finds our test command. - $this->drush('php-eval', array('drush_cache_clear_all();'), array(), '@' . $env); - - // Create a sample directory and file to test file/directory completion. - mkdir("astronaut"); - mkdir("asteroid"); - mkdir("asteroid/ceres"); - mkdir("asteroid/chiron"); - touch('astronaut/aldrin.tar.gz'); - touch('astronaut/armstrong.tar.gz'); - touch('astronaut/yuri gagarin.tar.gz'); - touch('zodiac.tar.gz'); - touch('zodiac.txt'); - - // Create directory for temporary debug logs. - mkdir(UNISH_SANDBOX . '/complete-debug'); - - // Test cache clearing for global cache, which should affect all - // environments. First clear the cache: - $this->drush('php-eval', array('drush_complete_cache_clear();')); - // Confirm we get cache rebuilds for runs both in and out of a site - // which is expected since these should resolve to separate cache IDs. - $this->verifyComplete('@dev aaaaaaaard-', 'aaaaaaaard-ant', 'aaaaaaaard-zebra', FALSE); - $this->verifyComplete('aaaaaaaard-', 'aaaaaaaard-ant', 'aaaaaaaard-wolf', FALSE); - // Next, rerun and check results to confirm cache IDs are generated - // correctly on our fast bootstrap when returning the cached result. - $this->verifyComplete('@dev aaaaaaaard-', 'aaaaaaaard-ant', 'aaaaaaaard-zebra'); - $this->verifyComplete('aaaaaaaard-', 'aaaaaaaard-ant', 'aaaaaaaard-wolf'); - - // Test cache clearing for a completion type, which should be effective only - // for current environment - i.e. a specific site should not be effected. - $this->drush('php-eval', array('drush_complete_cache_clear("command-names");')); - $this->verifyComplete('@dev aaaaaaaard-', 'aaaaaaaard-ant', 'aaaaaaaard-zebra'); - $this->verifyComplete('aaaaaaaard-', 'aaaaaaaard-ant', 'aaaaaaaard-wolf', FALSE); - - // Test cache clearing for a command specific completion type, which should - // be effective only for current environment. Prime caches first. - $this->verifyComplete('@dev aaaaaaaard a', 'aardvark', 'aardwolf', FALSE); - $this->verifyComplete('aaaaaaaard a', 'aardvark', 'aardwolf', FALSE); - $this->drush('php-eval', array('drush_complete_cache_clear("arguments", "aaaaaaaard");')); - // We cleared the global cache for this argument, not the site specific - // cache should still exist. - $this->verifyComplete('@dev aaaaaaaard a', 'aardvark', 'aardwolf'); - $this->verifyComplete('aaaaaaaard a', 'aardvark', 'aardwolf', FALSE); - - // Test overall context sensitivity - almost all of these are cache hits. - // No context (i.e. "drush <tab>"), should list aliases and commands. - $this->verifyComplete('""', '@dev', 'zzzzzzzzebra'); - // Site alias alone. - $this->verifyComplete('@', '@dev', '@stage'); - // Command alone. - $this->verifyComplete('aaaaaaaa', 'aaaaaaaard', 'aaaaaaaard-wolf'); - // Command with single result. - $this->verifyComplete('aaaaaaaard-v', 'aaaaaaaard-vark', 'aaaaaaaard-vark'); - // Command with no results should produce no output. - $this->verifyComplete('dont-name-a-command-like-this', '', ''); - // Commands that start the same as another command (i.e. aaaaaaaard is a - // valid command, but we should still list aaaaaaaardwolf when completing on - // "aaaaaaaard"). - $this->verifyComplete('@dev aaaaaaaard', 'aaaaaaaard', 'aaaaaaaard-zebra'); - // Global option alone. - $this->verifyComplete('--n', '--no', '--notify-audio'); - // Site alias + command. - $this->verifyComplete('@dev aaaaaaaa', 'aaaaaaaard', 'aaaaaaaard-zebra'); - // Site alias + command, should allow no further site aliases or commands. - $this->verifyComplete('@dev aaaaaaaard-wolf @', '', '', FALSE); - $this->verifyComplete('@dev aaaaaaaard-wolf aaaaaaaa', '', ''); - // Command + command option. - $this->verifyComplete('aaaaaaaard --', '--ears', '--nose'); - // Site alias + command + command option. - $this->verifyComplete('@dev aaaaaaaard --', '--ears', '--nose'); - // Command + all arguments - $this->verifyComplete('aaaaaaaard ""', 'aardvark', 'zebra'); - // Command + argument. - $this->verifyComplete('aaaaaaaard a', 'aardvark', 'aardwolf'); - // Site alias + command + regular argument. - // Note: this is checked implicitly by the argument cache testing above. - - // Site alias + command + file/directory argument tests. - // Current directory substrings. - // NOTE: This command arg has not been used yet, so cache miss is expected. - $this->verifyComplete('archive-restore ""', 'asteroid/', 'zodiac.tar.gz', FALSE); - $this->verifyComplete('archive-restore a', 'asteroid/', 'astronaut/'); - $this->verifyComplete('archive-restore ast', 'asteroid/', 'astronaut/'); - $this->verifyComplete('archive-restore aste', 'asteroid/', 'asteroid/'); - $this->verifyComplete('archive-restore asteroid', 'asteroid/', 'asteroid/'); - $this->verifyComplete('archive-restore asteroid/', 'ceres', 'chiron'); - $this->verifyComplete('archive-restore asteroid/ch', 'asteroid/chiron/', 'asteroid/chiron/'); - $this->verifyComplete('archive-restore astronaut/', 'aldrin.tar.gz', 'yuri gagarin.tar.gz'); - $this->verifyComplete('archive-restore astronaut/y', 'astronaut/yuri\ gagarin.tar.gz', 'astronaut/yuri\ gagarin.tar.gz'); - // Leading dot style current directory substrings. - $this->verifyComplete('archive-restore .', './asteroid/', './zodiac.tar.gz'); - $this->verifyComplete('archive-restore ./', './asteroid/', './zodiac.tar.gz'); - $this->verifyComplete('archive-restore ./a', './asteroid/', './astronaut/'); - $this->verifyComplete('archive-restore ./ast', './asteroid/', './astronaut/'); - $this->verifyComplete('archive-restore ./aste', './asteroid/', './asteroid/'); - $this->verifyComplete('archive-restore ./asteroid', './asteroid/', './asteroid/'); - $this->verifyComplete('archive-restore ./asteroid/', 'ceres', 'chiron'); - $this->verifyComplete('archive-restore ./asteroid/ch', './asteroid/chiron/', './asteroid/chiron/'); - $this->verifyComplete('archive-restore ./astronaut/', 'aldrin.tar.gz', 'yuri gagarin.tar.gz'); - $this->verifyComplete('archive-restore ./astronaut/y', './astronaut/yuri\ gagarin.tar.gz', './astronaut/yuri\ gagarin.tar.gz'); - // Absolute path substrings. - $path = getcwd(); - $this->verifyComplete('archive-restore ' . $path, $path . '/', $path . '/'); - $this->verifyComplete('archive-restore ' . $path . '/', 'asteroid', 'zodiac.tar.gz'); - $this->verifyComplete('archive-restore ' . $path . '/a', $path . '/asteroid', $path . '/astronaut'); - $this->verifyComplete('archive-restore ' . $path . '/ast', 'asteroid', 'astronaut'); - $this->verifyComplete('archive-restore ' . $path . '/aste', $path . '/asteroid/', $path . '/asteroid/'); - $this->verifyComplete('archive-restore ' . $path . '/asteroid', $path . '/asteroid/', $path . '/asteroid/'); - $this->verifyComplete('archive-restore ' . $path . '/asteroid/', $path . '/asteroid/ceres', $path . '/asteroid/chiron'); - $this->verifyComplete('archive-restore ' . $path . '/asteroid/ch', $path . '/asteroid/chiron/', $path . '/asteroid/chiron/'); - $this->verifyComplete('archive-restore ' . $path . '/astronaut/', 'aldrin.tar.gz', 'yuri gagarin.tar.gz'); - $this->verifyComplete('archive-restore ' . $path . '/astronaut/y', $path . '/astronaut/yuri\ gagarin.tar.gz', $path . '/astronaut/yuri\ gagarin.tar.gz'); - // Absolute via parent path substrings. - $this->verifyComplete('archive-restore ' . $path . '/asteroid/../astronaut/', 'aldrin.tar.gz', 'yuri gagarin.tar.gz'); - $this->verifyComplete('archive-restore ' . $path . '/asteroid/../astronaut/y', $path . '/asteroid/../astronaut/yuri\ gagarin.tar.gz', $path . '/asteroid/../astronaut/yuri\ gagarin.tar.gz'); - // Parent directory path substrings. - chdir('asteroid/chiron'); - $this->verifyComplete('archive-restore ../../astronaut/', 'aldrin.tar.gz', 'yuri gagarin.tar.gz'); - $this->verifyComplete('archive-restore ../../astronaut/y', '../../astronaut/yuri\ gagarin.tar.gz', '../../astronaut/yuri\ gagarin.tar.gz'); - chdir($path); - } - - /** - * Helper function to call completion and make common checks. - * - * @param $command - * The command line to attempt to complete. - * @param $first - * String indicating the expected first completion suggestion. - * @param $last - * String indicating the expected last completion suggestion. - * @param bool $cache_hit - * Optional parameter, if TRUE or omitted the debug log is checked to - * ensure a cache hit on the last cache debug log entry, if FALSE then a - * cache miss is checked for. - */ - function verifyComplete($command, $first, $last, $cache_hit = TRUE) { - // We capture debug output to a separate file, so we can check for cache - // hits/misses. - $debug_file = tempnam(UNISH_SANDBOX . '/complete-debug', 'complete-debug'); - // Commands should take the format: - // drush --early=includes/complete.inc [--complete-debug] drush [@alias] [command]... - $exec = sprintf('%s --early=includes/complete.inc --config=%s --complete-debug %s %s 2> %s', UNISH_DRUSH, UNISH_SANDBOX . '/drushrc.php', UNISH_DRUSH, $command, $debug_file); - $this->execute($exec); - $result = $this->getOutputAsList(); - $actual = reset($result); - $this->assertEquals("$command: (f) $first", "$command: (f) $actual"); - $actual = end($result); - $this->assertEquals("$command: (l) $last", "$command: (l) $actual"); - // If checking for HIT, we ensure no MISS exists, if checking for MISS we - // ensure no HIT exists. However, we exclude the first cache report, since - // it is expected that the command-names cache (loaded when matching - // command names) may sometimes be a HIT even when we are testing for a MISS - // in the actual cache we are loading to complete against. - $check_not_exist = 'HIT'; - if ($cache_hit) { - $check_not_exist = 'MISS'; - } - $contents = file_get_contents($debug_file); - // Find the all cache messages of type "-complete-" - preg_match_all("/Cache [A-Z]* cid:.*-complete-/", $contents, $matches); - $contents = implode("\n", $matches[0]); - $first_cache_pos = strpos($contents, 'Cache ') + 6; - $this->assertFalse(strpos($contents, 'Cache ' . $check_not_exist . ' cid', $first_cache_pos)); - unlink($debug_file); - } -} diff --git a/vendor/drush/drush/tests/completetest.drush.inc b/vendor/drush/drush/tests/completetest.drush.inc deleted file mode 100644 index deb7127bcce7895257921f5ee902cfd4be735ae9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/completetest.drush.inc +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * @file - * Commands and options for complete unit tests, to avoid relying on the - * ever-changing core command set. - */ - -/** - * Implementation of hook_drush_command(). - */ -function completetest_drush_command() { - $commands = array( - 'aaaaaaaard', - 'aaaaaaaard-ant', - 'aaaaaaaard-vark', - 'aaaaaaaard-wolf', - 'zzzzzzzzebra', - ); - foreach ($commands as $command) { - $items[$command] = array( - 'description' => 'No-op command, used to test various completions for commands that start the same as other commands.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_completetest_noop', - 'command-hook' => 'completetest_noop', - ); - } - $items['aaaaaaaard']['arguments'] = array('name' => 'Name'); - $items['aaaaaaaard']['options'] = array( - 'ears' => 'Ears', - 'eyes' => 'Eyes', - 'nose' => 'Nose', - 'legs' => 'Legs', - ); - return $items; -} - -function drush_completetest_noop() { - // No-op. -} - -/** - * Command argument complete callback. - * - * @return - * Array of completions. - */ -function completetest_completetest_noop_complete() { - return array( - 'values' => array( - 'aardvark', - 'aardwolf', - 'zebra', - ), - ); -} diff --git a/vendor/drush/drush/tests/completetestsite.drush.inc b/vendor/drush/drush/tests/completetestsite.drush.inc deleted file mode 100644 index 8fd224cfb38514a3fe78cca58d438486e19fae8a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/completetestsite.drush.inc +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Commands and options for complete unit tests, to avoid relying on the - * ever-changing core command set. - */ - -/** - * Implementation of hook_drush_command(). - */ -function completetestsite_drush_command() { - $items['aaaaaaaard-zebra'] = array( - 'description' => 'No-op command, used to test various completions for commands that start the same as other commands.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_completetest_noop', - ); - return $items; -} - diff --git a/vendor/drush/drush/tests/configPulltest.php b/vendor/drush/drush/tests/configPulltest.php deleted file mode 100644 index ed28f13ad2a732f71d074f69100cb349b9c3bc30..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/configPulltest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests for config-pull command. Sets up two Drupal sites. - * @group commands - * @group slow - * @group config - */ -class ConfigPullCase extends CommandUnishTestCase { - - function setUp() { - if (UNISH_DRUPAL_MAJOR_VERSION < 8) { - $this->markTestSkipped('Config only available on D8+.'); - } - - $this->setUpDrupal(2, TRUE); - } - - /* - * Make sure a change propogates using config-pull+config-import. - */ - function testConfigPull() { - list($source, $destination) = array_keys($this->getSites()); - $source = "@$source"; - $destination = "@$destination"; - $this->drush('config-set', array('system.site', 'name', 'testConfigPull'), array('yes' => NULL), $source); - $this->drush('config-pull', array($source, $destination), array()); - $this->drush('config-import', array(), array(), $destination); - $this->drush('config-get', array('system.site', 'name'), array(), $source); - $this->assertEquals("'system.site:name': testConfigPull", $this->getOutput(), 'Config was successfully pulled.'); - } -} diff --git a/vendor/drush/drush/tests/configTest.php b/vendor/drush/drush/tests/configTest.php deleted file mode 100644 index 77d9d075c18c39a2c14f093021704f9c399dd323..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/configTest.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests for Configuration Management commands for D8+. - * @group commands - * @group config - */ -class ConfigCase extends CommandUnishTestCase { - - function setUp() { - if (UNISH_DRUPAL_MAJOR_VERSION < 8) { - $this->markTestSkipped('Config only available on D8+.'); - } - - if (!$this->getSites()) { - $this->setUpDrupal(1, TRUE); - $this->drush('pm-enable', array('config'), $this->options()); - } - } - - function testConfigGetSet() { - $options = $this->options(); - $this->drush('config-set', array('system.site', 'name', 'config_test'), $options); - $this->drush('config-get', array('system.site', 'name'), $options); - $this->assertEquals("'system.site:name': config_test", $this->getOutput(), 'Config was successfully set and get.'); - } - - function testConfigList() { - $options = $this->options(); - $this->drush('config-list', array(), $options); - $result = $this->getOutputAsList(); - $this->assertNotEmpty($result, 'An array of config names was returned.'); - $this->assertTrue(in_array('update.settings', $result), 'update.settings name found in the config names.'); - - $this->drush('config-list', array('system'), $options); - $result = $this->getOutputAsList(); - $this->assertTrue(in_array('system.site', $result), 'system.site found in list of config names with "system" prefix.'); - - $this->drush('config-list', array('system'), $options + array('format' => 'json')); - $result = $this->getOutputFromJSON(); - $this->assertNotEmpty($result, 'Valid, non-empty JSON output was returned.'); - } - - function testConfigExportImport() { - $options = $this->options(); - // Get path to sync dir. - $this->drush('core-status', array('config-sync'), $options + array('format' => 'json')); - $sync = $this->webroot() . '/' . $this->getOutputFromJSON('config-sync'); - $system_site_yml = $sync . '/system.site.yml'; - $core_extension_yml = $sync . '/core.extension.yml'; - - // Test export - $this->drush('config-export', array(), $options); - $this->assertFileExists($system_site_yml); - - // Test import by finishing the round trip. - $contents = file_get_contents($system_site_yml); - $contents = preg_replace('/front: .*/', 'front: unish', $contents); - $contents = file_put_contents($system_site_yml, $contents); - $this->drush('config-import', array(), $options); - $this->drush('config-get', array('system.site', 'page'), $options + array('format' => 'json')); - $page = $this->getOutputFromJSON('system.site:page'); - $this->assertContains('unish', $page->front, 'Config was successfully imported.'); - - // Similar, but this time via --partial option. - $contents = file_get_contents($system_site_yml); - $contents = preg_replace('/front: .*/', 'front: unish partial', $contents); - $partial_path = UNISH_SANDBOX . '/partial'; - mkdir($partial_path); - $contents = file_put_contents($partial_path. '/system.site.yml', $contents); - $this->drush('config-import', array(), $options + array('partial' => NULL, 'source' => $partial_path)); - $this->drush('config-get', array('system.site', 'page'), $options + array('format' => 'json')); - $page = $this->getOutputFromJSON('system.site:page'); - $this->assertContains('unish partial', $page->front, '--partial was successfully imported.'); - } - - function options() { - return array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - ); - } -} diff --git a/vendor/drush/drush/tests/contextTest.php b/vendor/drush/drush/tests/contextTest.php deleted file mode 100644 index 0d0fb0fbfd7bdacb6ee34b615d0f1b779bba69ea..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/contextTest.php +++ /dev/null @@ -1,182 +0,0 @@ -<?php - -/** -* @file -* Assure that context API behaves as designed. Mostly implicitly tested, but we -* do have some edges that need explicit testing. -* -* @see drush/includes/context.inc. -* -* @group base -*/ - -namespace Unish; - -class contextCase extends CommandUnishTestCase { - - function setUpPaths() { - $this->log("webroot: " . $this->webroot() . "\n", 'warning'); - $this->env = key($this->getSites()); - $this->site = $this->webroot() . '/sites/' . $this->env; - $this->home = UNISH_SANDBOX . '/home'; - $this->paths = array( - 'custom' => UNISH_SANDBOX, - 'site' => $this->site, - 'drupal' => $this->webroot() . '/sites/all/drush', - 'drupal-parent' => dirname($this->webroot()) . '/drush', - 'user' => $this->home, - 'home.drush' => $this->home . '/.drush', - 'system' => UNISH_SANDBOX . '/etc/drush', - // We don't want to write a file into drush dir since it is not in the sandbox. - // 'drush' => dirname(realpath(UNISH_DRUSH)), - ); - // Run each path through realpath() since the paths we'll compare against - // will have already run through drush_load_config_file(). - foreach ($this->paths as $key => $path) { - @mkdir($path); - $this->paths[$key] = realpath($path); - } - } - - /** - * Try to write a tiny drushrc.php to each place that Drush checks. Also - * write a sites/dev/aliases.drushrc.php file to the sandbox. - */ - function setUp() { - parent::setUp(); - - if (!$this->getSites()) { - $this->setUpDrupal(); - } - $this->setUpPaths(); - - // These files are only written to sandbox so get automatically cleaned up. - foreach ($this->paths as $key => $path) { - $contents = <<<EOD -<?php -// Written by Drush's contextCase::setUp(). This file is safe to delete. -\$options['contextConfig'] = '$key'; -\$command_specific['unit-eval']['contextConfig'] = '$key-specific'; -EOD; - $path .= $key == 'user' ? '/.drushrc.php' : '/drushrc.php'; - if (file_put_contents($path, $contents)) { - $this->written[] = $this->convert_path($path); - } - } - - // Also write a site alias so we can test its supremacy in context hierarchy. - $path = $this->webroot() . '/sites/' . $this->env . '/aliases.drushrc.php'; - $aliases['contextAlias'] = array( - 'contextConfig' => 'alias1', - 'command-specific' => array ( - 'unit-eval' => array ( - 'contextConfig' => 'alias-specific', - ), - ), - ); - $contents = $this->unish_file_aliases($aliases); - $return = file_put_contents($path, $contents); - } - - /** - * Assure that all possible config files get loaded. - */ - function testConfigSearchPaths() { - $options = array( - 'pipe' => NULL, - 'config' => UNISH_SANDBOX, - 'root' => $this->webroot(), - 'uri' => key($this->getSites()) - ); - $this->drush('core-status', array('Drush configuration'), $options); - $loaded = $this->getOutputFromJSON('drush-conf'); - $loaded = array_map(array(&$this, 'convert_path'), $loaded); - $this->assertSame($this->written, $loaded); - } - - /** - * Assure that matching version-specific config files are loaded and others are ignored. - */ - function testConfigVersionSpecific() { - $major = $this->drush_major_version(); - // Arbitrarily choose the system search path. - $path = realpath(UNISH_SANDBOX . '/etc/drush'); - $contents = <<<EOD -<?php -// Written by Unish. This file is safe to delete. -\$options['unish_foo'] = 'bar'; -EOD; - - // Write matched and unmatched files to the system search path. - $files = array( - $path . '/drush' . $major . 'rc.php', - $path . '/drush999' . 'rc.php', - ); - mkdir($path . '/drush' . $major); - mkdir($path . '/drush999'); - foreach ($files as $file) { - file_put_contents($file, $contents); - } - - $this->drush('core-status', array('Drush configuration'), array('pipe' => NULL)); - $loaded = $this->getOutputFromJSON('drush-conf'); - // Next 2 lines needed for Windows compatibility. - $loaded = array_map(array(&$this, 'convert_path'), $loaded); - $files = array_map(array(&$this, 'convert_path'), $files); - $this->assertTrue(in_array($files[0], $loaded), 'Loaded a version-specific config file.'); - $this->assertFalse(in_array($files[1], $loaded), 'Did not load a mismatched version-specific config file.'); - } - - /** - * Assure that options are loaded into right context and hierarchy is - * respected by drush_get_option(). - * - * Stdin context not exercised here. See backendCase::testTarget(). - */ - function testContextHierarchy() { - // The 'custom' config file has higher priority than cli and regular config files. - $eval = '$contextConfig = drush_get_option("contextConfig", "n/a");'; - $eval .= '$cli1 = drush_get_option("cli1");'; - $eval .= 'print json_encode(get_defined_vars());'; - $config = UNISH_SANDBOX . '/drushrc.php'; - $options = array( - 'cli1' => NULL, - 'config' => $config, - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - ); - $this->drush('php-eval', array($eval), $options); - $output = $this->getOutput(); - $actuals = json_decode(trim($output)); - $this->assertEquals('custom', $actuals->contextConfig); - $this->assertTrue($actuals->cli1); - - // Site alias trumps 'custom'. - $eval = '$contextConfig = drush_get_option("contextConfig", "n/a");'; - $eval .= 'print json_encode(get_defined_vars());'; - $options = array( - 'config' => $config, - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - ); - $this->drush('php-eval', array($eval), $options, '@contextAlias'); - $output = $this->getOutput(); - $actuals = json_decode(trim($output)); - $this->assertEquals('alias1', $actuals->contextConfig); - - // Command specific wins over non-specific. If it did not, $expected would - // be 'site'. Note we call unit-eval command in order not to purturb - // php-eval with options in config file. - $eval = '$contextConfig = drush_get_option("contextConfig", "n/a");'; - $eval .= 'print json_encode(get_defined_vars());'; - $options = array( - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - ); - $this->drush('unit-eval', array($eval), $options); - $output = $this->getOutput(); - $actuals = json_decode(trim($output)); - $this->assertEquals('site-specific', $actuals->contextConfig); - } -} diff --git a/vendor/drush/drush/tests/coreTest.php b/vendor/drush/drush/tests/coreTest.php deleted file mode 100644 index 034596572217ab8d38ed7a12b1c3c2e523a69df7..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/coreTest.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests for core commands. - * - * @group commands - */ -class coreCase extends CommandUnishTestCase { - - function setUp() { - if (!$this->getSites()) { - $this->setUpDrupal(1, TRUE); - } - } - - /** - * Test to see if rsync @site:%files calculates the %files path correctly. - * This tests the non-optimized code path in drush_sitealias_resolve_path_references. - */ - function testRsyncPercentFiles() { - $root = $this->webroot(); - $site = key($this->getSites()); - $options = array( - 'root' => $root, - 'uri' => key($this->getSites()), - 'simulate' => NULL, - 'include-conf' => NULL, - 'include-vcs' => NULL, - 'yes' => NULL, - ); - $this->drush('core-rsync', array("@$site:%files", "/tmp"), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1;'); - $output = $this->getOutput(); - $level = $this->log_level(); - $pattern = in_array($level, array('verbose', 'debug')) ? "Calling system(rsync -e 'ssh ' -akzv --stats --progress --yes %s /tmp);" : "Calling system(rsync -e 'ssh ' -akz --yes %s /tmp);"; - $expected = sprintf($pattern, UNISH_SANDBOX . "/web/sites/$site/files"); - $this->assertEquals($expected, $output); - } - - /** - * Test to see if the optimized code path in drush_sitealias_resolve_path_references - * that avoids a call to backend invoke when evaluating %files works. - */ - function testPercentFilesOptimization() { - $root = $this->webroot(); - $site = key($this->getSites()); - $options = array( - 'root' => $root, - 'uri' => key($this->getSites()), - 'simulate' => NULL, - 'include-conf' => NULL, - 'include-vcs' => NULL, - 'yes' => NULL, - 'strict' => 0, // invoke from script: do not verify options - ); - $php = '$a=drush_sitealias_get_record("@' . $site . '"); drush_sitealias_resolve_path_references($a, "%files"); print_r($a["path-aliases"]["%files"]);'; - $this->drush('ev', array($php), $options); - $output = $this->getOutput(); - $expected = "sites/dev/files"; - $this->assertEquals($expected, $output); - } - - /** - * Test standalone php-script scripts. Assure that script args and options work. - */ - public function testStandaloneScript() { - if ($this->is_windows()) { - $this->markTestSkipped('Standalone scripts not currently available on Windows.'); - } - - $this->drush('version', array('drush_version'), array('pipe' => NULL)); - $standard = $this->getOutput(); - - // Write out a hellounish.script into the sandbox. The correct /path/to/drush - // is in the shebang line. - $filename = 'hellounish.script'; - $data = '#!/usr/bin/env [PATH-TO-DRUSH] - -$arg = drush_shift(); -drush_invoke("version", $arg); -'; - $data = str_replace('[PATH-TO-DRUSH]', UNISH_DRUSH, $data); - $script = UNISH_SANDBOX . '/' . $filename; - file_put_contents($script, $data); - chmod($script, 0755); - $this->execute("$script drush_version --pipe"); - $standalone = $this->getOutput(); - $this->assertEquals($standard, $standalone); - } - - function testDrupalDirectory() { - $root = $this->webroot(); - $sitewide = $this->drupalSitewideDirectory(); - $options = array( - 'root' => $root, - 'uri' => key($this->getSites()), - 'yes' => NULL, - 'skip' => NULL, - 'cache' => NULL, - 'strict' => 0, // invoke from script: do not verify options - ); - $this->drush('drupal-directory', array('%files'), $options); - $output = $this->getOutput(); - $this->assertEquals($root . '/sites/dev/files', $output); - - $this->drush('drupal-directory', array('%modules'), $options); - $output = $this->getOutput(); - $this->assertEquals($root . $sitewide . '/modules', $output); - - $this->drush('pm-download', array('devel'), $options); - $this->drush('pm-enable', array('devel'), $options); - $this->drush('pm-download', array('empty_theme'), $options); - - $this->drush('drupal-directory', array('devel'), $options); - $output = $this->getOutput(); - $this->assertEquals(realpath($root . $sitewide . '/modules/devel'), $output); - - $this->drush('drupal-directory', array('empty_theme'), $options); - $output = $this->getOutput(); - $this->assertEquals(realpath($root . $sitewide . '/themes/empty_theme'), $output); - } - - function testCoreRequirements() { - $root = $this->webroot(); - $options = array( - 'root' => $root, - 'uri' => key($this->getSites()), - 'pipe' => NULL, - 'ignore' => 'cron,http requests,update,update_core,trusted_host_patterns', // no network access when running in tests, so ignore these - 'strict' => 0, // invoke from script: do not verify options - ); - // Drupal 6 has reached EOL, so we will always get errors for 'update_contrib'; - // therefore, we ignore it for this release. - if (UNISH_DRUPAL_MAJOR_VERSION < 7) { - $options['ignore'] .= ',update_contrib'; - } - // Verify that there are no severity 2 items in the status report - $this->drush('core-requirements', array(), $options + array('severity' => '2')); - $output = $this->getOutput(); - $this->assertEquals('', $output); - - $this->drush('core-requirements', array(), $options); - $loaded = $this->getOutputFromJSON(); - // Pick a subset that are valid for D6/D7/D8. - $expected = array( - // 'install_profile' => -1, - // 'node_access' => -1, - 'php' => -1, - // 'php_extensions' => -1, - 'php_memory_limit' => -1, - 'php_register_globals' => -1, - 'settings.php' => -1, - ); - foreach ($expected as $key => $value) { - if (isset($loaded->$key)) { - $this->assertEquals($value, $loaded->$key->sid); - } - } - } -} diff --git a/vendor/drush/drush/tests/devel.xml b/vendor/drush/drush/tests/devel.xml deleted file mode 100644 index eb12be8801f59eee88e7137e3634843dd3b29c67..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/devel.xml +++ /dev/null @@ -1,1101 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<project xmlns:dc="http://purl.org/dc/elements/1.1/"> -<title>Devel</title> -<short_name>devel</short_name> -<dc:creator>moshe weitzman</dc:creator> -<api_version>6.x</api_version> -<!--MW: Changed to 2 for testing.--> -<recommended_major>2</recommended_major> -<supported_majors>1,2</supported_majors> -<default_major>2</default_major> -<project_status>published</project_status> - -<link>http://drupal.org/project/devel</link> - <terms> - <term><name>Projects</name><value>Modules</value></term> - <term><name>Projects</name><value>Administration</value></term> - <term><name>Projects</name><value>Developer</value></term> - <term><name>Projects</name><value>Utility</value></term> - - <term><name>Projects</name><value>Drush</value></term> - <term><name>Maintenance status</name><value>Actively maintained</value></term> - </terms> - - <releases> - - <!-- Start 3 releases added by MW--> - <release> - <name>devel 6.x-2.2</name> - <version>6.x-2.2</version> - - <tag>DRUPAL-6--2-2</tag> - <version_major>2</version_major> - <version_patch>2</version_patch> - <status>unpublished</status> - <release_link>http://drupal.org/node/990464</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-2.2.tar.gz</download_link> - - <date>1291650063</date> - <mdhash>07251c1cd56daf7d402fb5aea7dcfe48</mdhash> - <filesize>172845</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-2.2.tar.gz</url> - <archive_type>tar.gz</archive_type> - - <md5>07251c1cd56daf7d402fb5aea7dcfe48</md5> - <size>172845</size> - <filedate>1291650063</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-2.2.zip</url> - <archive_type>zip</archive_type> - - <md5>086412aa4c02ced793455486b48261e9</md5> - <size>219993</size> - <filedate>1293230730</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>New features</value></term> - - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - - <release> - <name>devel 6.x-2.2-rc1</name> - <version>6.x-2.2-rc1</version> - - <tag>DRUPAL-6--2-2-RC1</tag> - <version_major>2</version_major> - <version_extra>rc1</version_extra> - <version_patch>2</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/990464</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-2.2-rc1.tar.gz</download_link> - - <date>1291650063</date> - <mdhash>07251c1cd56daf7d402fb5aea7dcfe48</mdhash> - <filesize>172845</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-2.2-rc1.tar.gz</url> - <archive_type>tar.gz</archive_type> - - <md5>07251c1cd56daf7d402fb5aea7dcfe48</md5> - <size>172845</size> - <filedate>1291650063</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-2.2-rc1.zip</url> - <archive_type>zip</archive_type> - - <md5>086412aa4c02ced793455486b48261e9</md5> - <size>219993</size> - <filedate>1293230730</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>New features</value></term> - - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - - <release> - <name>devel 6.x-2.1</name> - <version>6.x-2.1</version> - - <tag>DRUPAL-6--2-1</tag> - <version_major>2</version_major> - <version_patch>1</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/990464</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-2.1.tar.gz</download_link> - - <date>1291650063</date> - <mdhash>07251c1cd56daf7d402fb5aea7dcfe48</mdhash> - <filesize>172845</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-2.1.tar.gz</url> - <archive_type>tar.gz</archive_type> - - <md5>07251c1cd56daf7d402fb5aea7dcfe48</md5> - <size>172845</size> - <filedate>1291650063</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-2.1.zip</url> - <archive_type>zip</archive_type> - - <md5>086412aa4c02ced793455486b48261e9</md5> - <size>219993</size> - <filedate>1293230730</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>New features</value></term> - - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <!--End added by MW--> - - <release> - <name>devel 6.x-1.23</name> - <version>6.x-1.23</version> - - <tag>DRUPAL-6--1-23</tag> - <version_major>1</version_major> - <version_patch>23</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/990464</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.23.tar.gz</download_link> - - <date>1291650063</date> - <mdhash>07251c1cd56daf7d402fb5aea7dcfe48</mdhash> - <filesize>172845</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.23.tar.gz</url> - <archive_type>tar.gz</archive_type> - - <md5>07251c1cd56daf7d402fb5aea7dcfe48</md5> - <size>172845</size> - <filedate>1291650063</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.23.zip</url> - <archive_type>zip</archive_type> - - <md5>086412aa4c02ced793455486b48261e9</md5> - <size>219993</size> - <filedate>1293230730</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>New features</value></term> - - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - - - <release> - <name>devel 6.x-1.22</name> - <version>6.x-1.22</version> - <tag>DRUPAL-6--1-22</tag> - - <version_major>1</version_major> - <version_patch>22</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/882460</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.22.tar.gz</download_link> - <date>1281718291</date> - - <mdhash>a8a87cae8f101c4aad46688524ab7583</mdhash> - <filesize>175140</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.22.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>a8a87cae8f101c4aad46688524ab7583</md5> - - <size>175140</size> - <filedate>1281718291</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.22.zip</url> - <archive_type>zip</archive_type> - <md5>cc207ab34421975216e6ee424c595001</md5> - - <size>222352</size> - <filedate>1293230727</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - - </release> - <release> - <name>devel 6.x-1.21</name> - <version>6.x-1.21</version> - <tag>DRUPAL-6--1-21</tag> - <version_major>1</version_major> - <version_patch>21</version_patch> - - <status>published</status> - <release_link>http://drupal.org/node/874116</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.21.tar.gz</download_link> - <date>1280961079</date> - <mdhash>15bf95b8c3fbe3f570f3f7b590f52ded</mdhash> - <filesize>175008</filesize> - - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.21.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>15bf95b8c3fbe3f570f3f7b590f52ded</md5> - <size>175008</size> - <filedate>1280961079</filedate> - - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.21.zip</url> - <archive_type>zip</archive_type> - <md5>f19fe1188a2774b383f146aee228a083</md5> - <size>222217</size> - <filedate>1293230734</filedate> - - </file> - </files> - <terms> - <term><name>Release type</name><value>Security update</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.20</name> - - <version>6.x-1.20</version> - <tag>DRUPAL-6--1-20</tag> - <version_major>1</version_major> - <version_patch>20</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/777998</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.20.tar.gz</download_link> - <date>1271886306</date> - <mdhash>b605d6a42e430660ef3418541d711c1c</mdhash> - <filesize>174042</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.20.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>b605d6a42e430660ef3418541d711c1c</md5> - <size>174042</size> - <filedate>1271886306</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.20.zip</url> - - <archive_type>zip</archive_type> - <md5>ff11ac877bdbbb29fa9dba024871e3bc</md5> - <size>221132</size> - <filedate>1293230727</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.19</name> - <version>6.x-1.19</version> - <tag>DRUPAL-6--1-19</tag> - - <version_major>1</version_major> - <version_patch>19</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/746888</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.19.tar.gz</download_link> - <date>1268976904</date> - - <mdhash>375c3b79e9e74fb636bf8a6d2fde87d6</mdhash> - <filesize>173570</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.19.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>375c3b79e9e74fb636bf8a6d2fde87d6</md5> - - <size>173570</size> - <filedate>1268976904</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.19.zip</url> - <archive_type>zip</archive_type> - <md5>b9da9992305f2aa8e26bd9550c119189</md5> - - <size>220677</size> - <filedate>1293230724</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - - </terms> - </release> - <release> - <name>devel 6.x-1.18</name> - <version>6.x-1.18</version> - <tag>DRUPAL-6--1-18</tag> - <version_major>1</version_major> - - <version_patch>18</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/585982</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.18.tar.gz</download_link> - <date>1253731829</date> - <mdhash>5f2b9e5f4b74beec35a1d1cff379ab5c</mdhash> - - <filesize>165785</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.18.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>5f2b9e5f4b74beec35a1d1cff379ab5c</md5> - <size>165785</size> - - <filedate>1253731829</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.18.zip</url> - <archive_type>zip</archive_type> - <md5>2e2808ec65aaa44d23f2a96c6af8bfbb</md5> - - <size>216330</size> - <filedate>1293230728</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - <term><name>Release type</name><value>Security update</value></term> - - </terms> - </release> - <release> - <name>devel 6.x-1.17</name> - <version>6.x-1.17</version> - <tag>DRUPAL-6--1-17</tag> - <version_major>1</version_major> - - <version_patch>17</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/554032</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.17.tar.gz</download_link> - <date>1250713853</date> - <mdhash>31b2cbea82226a729b11bbc91920a7cd</mdhash> - - <filesize>163024</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.17.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>31b2cbea82226a729b11bbc91920a7cd</md5> - <size>163024</size> - - <filedate>1250713853</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.17.zip</url> - <archive_type>zip</archive_type> - <md5>5e2a367f2e43c90de1e676e3037e1570</md5> - <size>213291</size> - - <filedate>1293230731</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - - </terms> - </release> - <release> - <name>devel 6.x-1.16</name> - <version>6.x-1.16</version> - <tag>DRUPAL-6--1-16</tag> - <version_major>1</version_major> - - <version_patch>16</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/430072</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.16.tar.gz</download_link> - <date>1239375932</date> - <mdhash>6dc83de5de101460f8eee2db3ea4b7d9</mdhash> - - <filesize>163998</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.16.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>6dc83de5de101460f8eee2db3ea4b7d9</md5> - <size>163998</size> - - <filedate>1239375932</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.16.zip</url> - <archive_type>zip</archive_type> - <md5>65ad91bc0308b10a9d11107f2d35bc2f</md5> - <size>215213</size> - - <filedate>1293230728</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - - <release> - <name>devel 6.x-1.15</name> - <version>6.x-1.15</version> - <tag>DRUPAL-6--1-15</tag> - <version_major>1</version_major> - <version_patch>15</version_patch> - - <status>published</status> - <release_link>http://drupal.org/node/419014</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.15.tar.gz</download_link> - <date>1238471715</date> - <mdhash>e7cd175671ed62a95bab7093c636e663</mdhash> - <filesize>163945</filesize> - - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.15.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>e7cd175671ed62a95bab7093c636e663</md5> - <size>163945</size> - <filedate>1238471715</filedate> - - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.15.zip</url> - <archive_type>zip</archive_type> - <md5>f0719bb64bdeb1d3c2f327457351b9d1</md5> - <size>215342</size> - <filedate>1293230731</filedate> - - </file> - </files> - <terms> - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - - <release> - <name>devel 6.x-1.14</name> - <version>6.x-1.14</version> - <tag>DRUPAL-6--1-14</tag> - <version_major>1</version_major> - <version_patch>14</version_patch> - - <status>published</status> - <release_link>http://drupal.org/node/368174</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.14.tar.gz</download_link> - <date>1233610814</date> - <mdhash>11af2d7fa3050febfe3def770683f173</mdhash> - <filesize>162780</filesize> - - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.14.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>11af2d7fa3050febfe3def770683f173</md5> - <size>162780</size> - <filedate>1233610814</filedate> - - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.14.zip</url> - <archive_type>zip</archive_type> - <md5>c691c6d03d1f605493807cf7dad7dce1</md5> - <size>214014</size> - <filedate>1293230725</filedate> - - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.13</name> - - <version>6.x-1.13</version> - <tag>DRUPAL-6--1-13</tag> - <version_major>1</version_major> - <version_patch>13</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/353382</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.13.tar.gz</download_link> - <date>1230872109</date> - <mdhash>669870433908fccd31e7de9b57434c64</mdhash> - <filesize>161893</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.13.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>669870433908fccd31e7de9b57434c64</md5> - <size>161893</size> - <filedate>1230872109</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.13.zip</url> - - <archive_type>zip</archive_type> - <md5>06ed93306fe8476af6aa62aac763afa4</md5> - <size>212645</size> - <filedate>1293230728</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.12</name> - - <version>6.x-1.12</version> - <tag>DRUPAL-6--1-12</tag> - <version_major>1</version_major> - <version_patch>12</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/319216</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.12.tar.gz</download_link> - <date>1223583012</date> - <mdhash>69b345c09ece34812b04e7ccbc2cdf23</mdhash> - <filesize>146188</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.12.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>69b345c09ece34812b04e7ccbc2cdf23</md5> - <size>146188</size> - <filedate>1223583012</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.12.zip</url> - - <archive_type>zip</archive_type> - <md5>8c66e91fc8c64388facf8e7e7054e58a</md5> - <size>197116</size> - <filedate>1293230726</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.11</name> - - <version>6.x-1.11</version> - <tag>DRUPAL-6--1-11</tag> - <version_major>1</version_major> - <version_patch>11</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/310335</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.11.tar.gz</download_link> - <date>1221759046</date> - <mdhash>93bc2cc8da26d759e46b24f1b9d4e3e2</mdhash> - <filesize>145693</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.11.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>93bc2cc8da26d759e46b24f1b9d4e3e2</md5> - <size>145693</size> - <filedate>1221759046</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.11.zip</url> - - <archive_type>zip</archive_type> - <md5>3c1063443d81927e3b90e129bc169a24</md5> - <size>196477</size> - <filedate>1293230729</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.10</name> - - <version>6.x-1.10</version> - <tag>DRUPAL-6--1-10</tag> - <version_major>1</version_major> - <version_patch>10</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/283183</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.10.tar.gz</download_link> - <date>1216171206</date> - <mdhash>688ed33b3a2a63bc1bce9da3c2d104de</mdhash> - <filesize>145188</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.10.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>688ed33b3a2a63bc1bce9da3c2d104de</md5> - <size>145188</size> - <filedate>1216171206</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.10.zip</url> - - <archive_type>zip</archive_type> - <md5>c9e85aac38d3c2f18015c820ec325206</md5> - <size>195931</size> - <filedate>1293230732</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.9</name> - - <version>6.x-1.9</version> - <tag>DRUPAL-6--1-9</tag> - <version_major>1</version_major> - <version_patch>9</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/270064</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.9.tar.gz</download_link> - <date>1213331113</date> - <mdhash>8b88659f45e31d8c05fd6990c491ea2a</mdhash> - <filesize>145153</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.9.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>8b88659f45e31d8c05fd6990c491ea2a</md5> - <size>145153</size> - <filedate>1213331113</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.9.zip</url> - - <archive_type>zip</archive_type> - <md5>0d934dafa2cedd0d1bc5ec450cc9570f</md5> - <size>195856</size> - <filedate>1293230729</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.8</name> - - <version>6.x-1.8</version> - <tag>DRUPAL-6--1-8</tag> - <version_major>1</version_major> - <version_patch>8</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/259615</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.8.tar.gz</download_link> - <date>1211039106</date> - <mdhash>d8d8f4ee8dd61ccad625443ebafbe421</mdhash> - <filesize>76796</filesize> - <files> - <file> - - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.8.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>d8d8f4ee8dd61ccad625443ebafbe421</md5> - <size>76796</size> - <filedate>1211039106</filedate> - </file> - - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.8.zip</url> - <archive_type>zip</archive_type> - <md5>72b3468d765e1f9e827d9399f2d7218c</md5> - <size>92505</size> - <filedate>1293230732</filedate> - - </file> - </files> - <terms> - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - - <release> - <name>devel 6.x-1.7</name> - <version>6.x-1.7</version> - <tag>DRUPAL-6--1-7</tag> - <version_major>1</version_major> - <version_patch>7</version_patch> - - <status>published</status> - <release_link>http://drupal.org/node/237840</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.7.tar.gz</download_link> - <date>1206300306</date> - <mdhash>b63eba9e1588baa2f8031589897eb376</mdhash> - <filesize>72504</filesize> - - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.7.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>b63eba9e1588baa2f8031589897eb376</md5> - <size>72504</size> - <filedate>1206300306</filedate> - - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.7.zip</url> - <archive_type>zip</archive_type> - <md5>9e4711ebace4e7cf0d7dc4e4a1386be3</md5> - <size>87847</size> - <filedate>1293230726</filedate> - - </file> - </files> - </release> - <release> - <name>devel 6.x-1.6</name> - <version>6.x-1.6</version> - <tag>DRUPAL-6--1-6</tag> - - <version_major>1</version_major> - <version_patch>6</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/229249</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.6.tar.gz</download_link> - <date>1204515005</date> - - <mdhash>dc2fd4030922e17258a0fa886557aa9f</mdhash> - <filesize>72109</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.6.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>dc2fd4030922e17258a0fa886557aa9f</md5> - - <size>72109</size> - <filedate>1204515005</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.6.zip</url> - <archive_type>zip</archive_type> - <md5>65cf489c56834571eaf43a30e87a25ef</md5> - - <size>87441</size> - <filedate>1293230732</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - - </release> - <release> - <name>devel 6.x-1.5</name> - <version>6.x-1.5</version> - <tag>DRUPAL-6--1-5</tag> - <version_major>1</version_major> - <version_patch>5</version_patch> - - <status>published</status> - <release_link>http://drupal.org/node/227742</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.5.tar.gz</download_link> - <date>1204163705</date> - <mdhash>4755dc85712f86c24a7615c83bf2d587</mdhash> - <filesize>72424</filesize> - - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.5.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>4755dc85712f86c24a7615c83bf2d587</md5> - <size>72424</size> - <filedate>1204163705</filedate> - - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.5.zip</url> - <archive_type>zip</archive_type> - <md5>3def5895dcd04439f2e7c69e33ae3ef7</md5> - <size>87108</size> - <filedate>1293230729</filedate> - - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.4</name> - - <version>6.x-1.4</version> - <tag>DRUPAL-6--1-4</tag> - <version_major>1</version_major> - <version_patch>4</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/224889</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.4.tar.gz</download_link> - <date>1203609008</date> - <mdhash>9361284333474368c49b807943e7eb09</mdhash> - <filesize>72289</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.4.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>9361284333474368c49b807943e7eb09</md5> - <size>72289</size> - <filedate>1203609008</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.4.zip</url> - - <archive_type>zip</archive_type> - <md5>0ee1899e32edcdb56ac13b067c8bb2aa</md5> - <size>86956</size> - <filedate>1293230733</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.3</name> - <version>6.x-1.3</version> - <tag>DRUPAL-6--1-3</tag> - - <version_major>1</version_major> - <version_patch>3</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/223052</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.3.tar.gz</download_link> - <date>1203291304</date> - - <mdhash>5dbb78276404810a219395d790bb349d</mdhash> - <filesize>72231</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.3.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>5dbb78276404810a219395d790bb349d</md5> - - <size>72231</size> - <filedate>1203291304</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.3.zip</url> - <archive_type>zip</archive_type> - <md5>293c305a758cd84b1a5b1e0f56c6883f</md5> - - <size>86893</size> - <filedate>1293230727</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - - </release> - <release> - <name>devel 6.x-1.2</name> - <version>6.x-1.2</version> - <tag>DRUPAL-6--1-2</tag> - <version_major>1</version_major> - <version_patch>2</version_patch> - - <status>published</status> - <release_link>http://drupal.org/node/223032</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.2.tar.gz</download_link> - <date>1203288005</date> - <mdhash>ec2d609a553289636f2388c54fc69e8b</mdhash> - <filesize>72232</filesize> - - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.2.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>ec2d609a553289636f2388c54fc69e8b</md5> - <size>72232</size> - <filedate>1203288005</filedate> - - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.2.zip</url> - <archive_type>zip</archive_type> - <md5>5855930a3427fdc2c3449aebf8ad68f9</md5> - <size>86895</size> - <filedate>1293230730</filedate> - - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.1</name> - - <version>6.x-1.1</version> - <tag>DRUPAL-6--1-1</tag> - <version_major>1</version_major> - <version_patch>1</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/222919</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.1.tar.gz</download_link> - <date>1203267606</date> - <mdhash>2d1065298518decda8eb0d0473851ed1</mdhash> - <filesize>72225</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.1.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>2d1065298518decda8eb0d0473851ed1</md5> - <size>72225</size> - <filedate>1203267606</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.1.zip</url> - - <archive_type>zip</archive_type> - <md5>f72a6870d67d929970c78151f7737ebc</md5> - <size>86896</size> - <filedate>1293230733</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>New features</value></term> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.0</name> - - <version>6.x-1.0</version> - <tag>DRUPAL-6--1-0</tag> - <version_major>1</version_major> - <version_patch>0</version_patch> - <status>published</status> - <release_link>http://drupal.org/node/208665</release_link> - - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.0.tar.gz</download_link> - <date>1200012604</date> - <mdhash>3dbd3cd4c15f001c1ac7067ca58c74ff</mdhash> - <filesize>53802</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.0.tar.gz</url> - - <archive_type>tar.gz</archive_type> - <md5>3dbd3cd4c15f001c1ac7067ca58c74ff</md5> - <size>53802</size> - <filedate>1200012604</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.0.zip</url> - - <archive_type>zip</archive_type> - <md5>10600179cfa8a301784839983fb49397</md5> - <size>64756</size> - <filedate>1293230727</filedate> - </file> - </files> - <terms> - - <term><name>Release type</name><value>Security update</value></term> - </terms> - </release> - <release> - <name>devel 6.x-1.x-dev</name> - <version>6.x-1.x-dev</version> - <tag>DRUPAL-6--1</tag> - - <version_major>1</version_major> - <version_extra>dev</version_extra> - <status>published</status> - <release_link>http://drupal.org/node/224617</release_link> - <download_link>http://ftp.drupal.org/files/projects/devel-6.x-1.x-dev.tar.gz</download_link> - <date>1295179817</date> - - <mdhash>fec92fdc9dd40f34b2e7f9876fd44014</mdhash> - <filesize>126254</filesize> - <files> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.x-dev.tar.gz</url> - <archive_type>tar.gz</archive_type> - <md5>fec92fdc9dd40f34b2e7f9876fd44014</md5> - - <size>126254</size> - <filedate>1295179817</filedate> - </file> - <file> - <url>http://ftp.drupal.org/files/projects/devel-6.x-1.x-dev.zip</url> - <archive_type>zip</archive_type> - <md5>91255187be4c5cd7bacf7112e6b0189b</md5> - - <size>171436</size> - <filedate>1295179818</filedate> - </file> - </files> - </release> - <release> - <name>devel 6.x-0.2</name> - - <version>6.x-0.2</version> - <tag>DRUPAL-6--0-2</tag> - <version_major>0</version_major> - <version_patch>2</version_patch> - <status>unpublished</status> - <date>1203287704</date> - - <mdhash>a071278bf76df5acf5320086f80ff4f5</mdhash> - <filesize>72235</filesize> - <files> - <file> - <archive_type>tar.gz</archive_type> - <md5>a071278bf76df5acf5320086f80ff4f5</md5> - <size>72235</size> - - <filedate>1203287704</filedate> - </file> - </files> - <terms> - <term><name>Release type</name><value>Bug fixes</value></term> - </terms> - </release> - -</releases> -</project> diff --git a/vendor/drush/drush/tests/drushScriptTest.php b/vendor/drush/drush/tests/drushScriptTest.php deleted file mode 100644 index f65e921d02b4e3b4efc0edff721cac4bce5c81b8..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/drushScriptTest.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -namespace Unish; -use Webmozart\PathUtil\Path; - -/** - * Tests for the 'drush' script itself - */ -class drushScriptCase extends CommandUnishTestCase { - - /** - * Test `PHP_OPTIONS=... drush` - */ - public function testPhpOptionsTest() { - $this->markTestSkipped('Environment variables not yet passed along to Process by execute().'); - - - // @todo: could probably run this test on mingw - if ($this->is_windows()) { - $this->markTestSkipped('Environment variable tests not currently functional on Windows.'); - } - - $options = array(); - $env = array('PHP_OPTIONS' => '-d default_mimetype="text/drush"'); - $this->drush('ev', array('print ini_get("default_mimetype");'), $options, NULL, NULL, self::EXIT_SUCCESS, NULL, $env); - $output = $this->getOutput(); - $this->assertEquals('text/drush', $output); - } - - public function testDrushFinder() { - // We don't really need a real Drupal site; we could - // create a fake site, as long as we had the right signature - // files to allow us to bootstrap to the DRUPAL_ROOT phase. - $this->setUpDrupal(1, TRUE); - - $globalDrushDotPhp = Path::join(UNISH_DRUSH, '../drush.php'); - - // Control: test `drush --root ` ... with no site-local Drush - $drush_location = $this->getDrushLocation(); - $this->assertEquals($globalDrushDotPhp, $drush_location); - - // We will try copying a site-local Drush to - // all of the various locations the 'drush finder' - // might expect to find it. - $drush_locations = array( - "vendor", - "../vendor", - "sites/all/vendor", - "sites/all", - ); - - foreach ($drush_locations as $drush_base) { - $drush_root = $this->create_site_local_drush($drush_base); - - // Test `drush --root ` ... with a site-local Drush - $drush_location = $this->getDrushLocation(array('root' => $this->webroot())); - $this->assertEquals(realpath($drush_root . '/drush.php'), realpath($drush_location)); - // Ensure that --local was NOT added - $result = $this->drush('ev', array('return drush_get_option("local");'), array('root' => $this->webroot())); - $output = $this->getOutput(); - $this->assertEquals("", $output); - - // Run the `drush --root` test again, this time with - // a drush.wrapper script in place. - $this->createDrushWrapper($drush_base); - $drush_location = $this->getDrushLocation(array('root' => $this->webroot())); - $this->assertEquals(realpath($drush_root . '/drush.php'), realpath($drush_location)); - // Test to see if --local was added - $result = $this->drush('ev', array('return drush_get_option("local");'), array('root' => $this->webroot())); - $output = $this->getOutput(); - $this->assertEquals("TRUE", $output); - - // Get rid of the symlink and site-local Drush we created - $this->remove_site_local_drush($drush_base); - } - - // Next, try again with a site-local Drush in a location - // that Drush does not search. - $mysterious_location = "path/drush/does/not/search"; - $drush_root = $this->create_site_local_drush($mysterious_location); - // We should not find the site-local Drush without a Drush wrapper. - $drush_location = $this->getDrushLocation(array('root' => $this->webroot())); - $this->assertEquals($globalDrushDotPhp, $drush_location); - $this->createDrushWrapper($mysterious_location); - // Now that there is a Drush wrapper, we should be able to find the site-local Drush. - $drush_location = $this->getDrushLocation(array('root' => $this->webroot())); - $this->assertEquals(realpath($drush_root . '/drush.php'), $drush_location); - } - - /** - * Copy UNISH_DRUSH into the specified site-local location. - */ - function create_site_local_drush($drush_base) { - $drush_root = $this->webroot() . '/' . $drush_base . '/drush/drush'; - $bin_dir = $this->webroot() . '/' . $drush_base . '/bin'; - - $this->mkdir(dirname($drush_root)); - $this->recursive_copy(dirname(UNISH_DRUSH), $drush_root); - @chmod($drush_root . '/drush', 0777); - @chmod($drush_root . '/drush.launcher', 0777); - $this->mkdir($bin_dir); - symlink($drush_root . '/drush', $bin_dir . '/drush'); - - return $drush_root; - } - - function remove_site_local_drush($drush_base) { - // Get rid of the symlink and site-local Drush we created - unish_file_delete_recursive($this->webroot() . '/' . $drush_base . '/drush/drush'); - unlink($this->webroot() . '/' . $drush_base . '/bin/drush'); - if (file_exists($this->webroot() . '/drush.wrapper')) { - unlink($this->webroot() . '/drush.wrapper'); - } - } - - /** - * TODO: Create a Drush wrapper script, and copy it to - * to the root of the fake Drupal site, and point it - * at the specified site-local Drush script. - */ - function createDrushWrapper($drush_base) { - $drush_launcher = $drush_base . '/drush/drush/drush.launcher'; - - $drush_wrapper_src = dirname(UNISH_DRUSH) . '/examples/drush.wrapper'; - $drush_wrapper_contents = file_get_contents($drush_wrapper_src); - $drush_wrapper_contents = preg_replace('#\.\./vendor/bin/drush.launcher#', $drush_launcher, $drush_wrapper_contents); - $drush_wrapper_target = $this->webroot() . '/drush.wrapper'; - - file_put_contents($drush_wrapper_target, $drush_wrapper_contents); - @chmod($drush_wrapper_target, 0777); - } - - /** - * Get the current location of the Drush script via - * `drush status 'Drush script' --format=yaml`. This - * will return results other than UNISH_DRUSH in the - * presence of a site-local Drush. - */ - function getDrushLocation($options = array()) { - $options += array( - 'format' => 'yaml', - 'verbose' => NULL, - ); - $result = $this->drush('status', array('Drush script'), $options); - - $output = $this->getOutput(); - list($key, $value) = explode(": ", $output); - return trim($value, "'"); - } -} diff --git a/vendor/drush/drush/tests/expandWildcardTablesUnitTest.php b/vendor/drush/drush/tests/expandWildcardTablesUnitTest.php deleted file mode 100644 index 3cbaf90384fb5f0a2ffd5e6cd26d300e68b025cc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/expandWildcardTablesUnitTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace Unish; - -/** - * Unit tests for drush_sql_expand_wildcard_tables and - * drush_sql_filter_tables. - * - * @group base - * @group sql - */ -class WildcardUnitCase extends UnitUnishTestCase { - - public static function setUpBeforeClass() { - parent::setUpBeforeClass(); - require_once(dirname(__FILE__) . '/../commands/sql/sql.drush.inc'); - } - - /** - * Tests drush_sql_expand_wildcard_tables(). - * - * @see drush_sql_expand_wildcard_tables(). - */ - public function testExpandWildcardTables() { - // Array of tables to search for. - $wildcard_input = array( - 'cache*', - ); - // Mock array of tables to test with. This is - // also the expected result. - $db_tables = array( - 'cache', - 'cache_bootstrap', - 'cache_field', - 'cache_filter', - 'cache_form', - 'cache_menu', - 'cache_page', - 'cache_path', - 'cache_update', - 'example', - ); - - $expanded_db_tables = drush_sql_expand_wildcard_tables($wildcard_input, $db_tables); - // We expect all but the last table to match. - array_pop($db_tables); - $this->assertEquals($db_tables, $expanded_db_tables); - } - - /** - * Tests drush_sql_filter_tables(). - * - * @see drush_sql_filter_tables(). - */ - public function testFilterTables() { - // Array of tables to search for. - $wildcard_input = array( - 'cache', - 'cache_*', - ); - // Mock array of tables to test with. - $db_tables = array( - 'cache', - 'cache_bootstrap', - 'cache_field', - 'cache_filter', - 'cache_form', - 'cache_menu', - 'cache_page', - 'cache_path', - 'cache_update', - ); - $expected_result = array( - 'cache', - ); - - $actual_result = drush_sql_filter_tables($wildcard_input, $db_tables); - $this->assertEquals($expected_result, $actual_result); - } -} diff --git a/vendor/drush/drush/tests/fieldTest.php b/vendor/drush/drush/tests/fieldTest.php deleted file mode 100644 index 8c3c5002c9ef35436b2e208eba97a24ca9db98a8..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/fieldTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests for field.drush.inc - * - * @group commands - */ -class fieldCase extends CommandUnishTestCase { - - public function testField() { - if (UNISH_DRUPAL_MAJOR_VERSION == 6) { - $this->markTestSkipped("Field API not available in Drupal 6."); - } - - if (UNISH_DRUPAL_MAJOR_VERSION == 8) { - $this->markTestSkipped("Field commands are not yet ported to D8."); - } - - $sites = $this->setUpDrupal(1, TRUE); - $options = array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - ); - - $expected_url = '/admin/config/people/accounts/fields/subtitle'; - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - // Prepend for D8. We might want to change setUpDrupal() to add clean url. - $expected_url = '/index.php' . $expected_url; - } - // Create two field instances on article content type. - $this->drush('field-create', array('user', 'city,text,text_textfield', 'subtitle,text,text_textfield'), $options + array('entity_type' => 'user')); - $output = $this->getOutput(); - list($city, $subtitle) = explode(' ', $output); - $url = parse_url($subtitle); - $this->assertEquals($expected_url, $url['path']); - - // Assure that the second field instance was created correctly (subtitle). - $this->verifyInstance('subtitle', $options); - - // Assure that field update URL looks correct. - $this->drush('field-update', array('subtitle'), $options); - $output = $this->getOutput(); - $url = parse_url($this->getOutput()); - $this->assertEquals($expected_url, $url['path']); - - // Assure that field-clone actually clones. - $this->drush('field-clone', array('subtitle', 'subtitlecloned'), $options); - $this->verifyInstance('subtitlecloned', $options); - - // Assure that delete works. - $this->drush('field-delete', array('subtitlecloned'), $options); - $this->verifyInstance('subtitlecloned', $options, FALSE); - } - - function verifyInstance($name, $options, $expected = TRUE) { - $this->drush('field-info', array('fields'), $options + array('format' => 'json')); - $output = $this->getOutputFromJSON(); - $found = FALSE; - foreach($output as $key => $field) { - if ($key == $name) { - $this->assertEquals('text', $field->type, $name . ' field is of type=text.'); - $this->assertEquals('user', current($field->bundle), $name . ' field was added to user bundle.'); - $found = TRUE; - break; - } - } - if ($expected) { - $this->assertTrue($found, $name . ' field was created.'); - } - else { - $this->assertFalse($found, $name . ' field was not present.'); - } - } -} diff --git a/vendor/drush/drush/tests/filesystemTest.php b/vendor/drush/drush/tests/filesystemTest.php deleted file mode 100644 index 03365403e6d2a6ac80cca1dbda2d69d85f4520f2..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/filesystemTest.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Unish; - -/** - * Filesystem related testing. - * - * @group base - */ -class FilesystemCase extends CommandUnishTestCase { - - public function testSbit() { - if ($this->is_windows()) { - $this->markTestSkipped("s-bit test doesn't apply on Windows."); - } - if (UNISH_USERGROUP === NULL) { - $this->markTestSkipped("s-bit test skipped because of UNISH_USERGROUP was not set."); - } - - $dest = UNISH_SANDBOX . '/test-filesystem-sbit'; - mkdir($dest); - chgrp($dest, UNISH_USERGROUP); - chmod($dest, 02755); // rwxr-sr-x - - $this->drush('pm-download', array('devel'), array('cache' => NULL, 'skip' => NULL, 'destination' => $dest)); - - $group = posix_getgrgid(filegroup($dest . '/devel/README.txt')); - $this->assertEquals($group['name'], UNISH_USERGROUP, 'Group is preserved.'); - - $perms = fileperms($dest . '/devel') & 02000; - $this->assertEquals($perms, 02000, 's-bit is preserved.'); - } - - public function testExecuteBits() { - if ($this->is_windows()) { - $this->markTestSkipped("execute bit test doesn't apply on Windows."); - } - - $dest = UNISH_SANDBOX . '/test-filesystem-execute'; - mkdir($dest); - $this->execute(sprintf("git clone --depth=1 https://github.com/drush-ops/drush.git %s", $dest . '/drush')); - - $perms = fileperms($dest . '/drush/drush') & 0111; - $this->assertEquals($perms, 0111, 'Execute permission is preserved.'); - } -} - diff --git a/vendor/drush/drush/tests/generateMakeTest.php b/vendor/drush/drush/tests/generateMakeTest.php deleted file mode 100644 index 027651b14df27b2d9b685c3c47861ed694a07f0f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/generateMakeTest.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php - -namespace Unish; -use Webmozart\PathUtil\Path; - -/** - * Generate makefile tests - * - * @group make - * @group slow - */ -class generateMakeCase extends CommandUnishTestCase { - function testGenerateMake() { - return $this->_testGenerateMake('devel', 'bootstrap'); - } - - function testGenerateMakeOmega() { - # TODO: Don't skip this test by default once the underlying issue is resolved. - # See: https://github.com/drush-ops/drush/issues/2030 - $run_omega_make_test = getenv("DRUSH_TEST_MAKE_OMEGA"); - if ($run_omega_make_test) { - return $this->_testGenerateMake('devel', 'omega'); - } - else { - $this->markTestSkipped('Set `DRUSH_TEST_MAKE_OMEGA=1`, in order to run this test. See: https://github.com/drush-ops/drush/issues/2028'); - } - } - - function _testGenerateMake($module, $theme) { - if (UNISH_DRUPAL_MAJOR_VERSION != '7') { - $this->markTestSkipped("Drush generate make tests depend on projects not available on older and newer versions of Drupal. Tests need updating, but Drush make is deprecated; Composer is recommended."); - } - $sites = $this->setUpDrupal(1, TRUE); - $major_version = UNISH_DRUPAL_MAJOR_VERSION . '.x'; - - $options = array( - 'yes' => NULL, - 'pipe' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - 'cache' => NULL, - 'strict' => 0, // Don't validate options - ); - // Omega requires these core modules. - $this->drush('pm-enable', array('block', 'search', 'help'), $options); - $this->drush('pm-download', array($theme, $module), $options); - $this->drush('pm-enable', array($theme, $module), $options); - - $makefile = UNISH_SANDBOX . '/dev.make.yml'; - - // First generate a simple makefile with no version information - $this->drush('generate-makefile', array($makefile), array('exclude-versions' => NULL) + $options); - $expected = <<<EOD -core: $major_version -api: 2 -projects: - drupal: { } - $module: { } - $theme: { } -EOD; - $actual = trim(file_get_contents($makefile)); - - $this->assertEquals($expected, $actual); - - // Next generate a simple makefile with no version information in .ini format - $makefile = UNISH_SANDBOX . '/dev.make'; - $this->drush('generate-makefile', array($makefile), array('exclude-versions' => NULL, 'format' => 'ini') + $options); - $expected = <<<EOD -; This file was auto-generated by drush make -core = $major_version -api = 2 - -; Core -projects[] = "drupal" -; Modules -projects[] = "$module" -; Themes -projects[] = "$theme" -EOD; - $actual = trim(file_get_contents($makefile)); - - $this->assertEquals($expected, $actual); - - // Download a module to a 'contrib' directory to test the subdir feature - $this->mkdir(Path::join($this->webroot(). '/sites/all/modules/contrib')); - $this->drush('pm-download', array('libraries'), array('destination' => 'sites/all/modules/contrib') + $options); - $this->drush('pm-enable', array('libraries'), $options); - $makefile = UNISH_SANDBOX . '/dev.make.yml'; - $this->drush('generate-makefile', array($makefile), array('exclude-versions' => NULL) + $options); - $expected = <<<EOD -core: $major_version -api: 2 -projects: - drupal: { } - $module: { } - libraries: - subdir: contrib - $theme: { } -EOD; - $actual = trim(file_get_contents($makefile)); - - $this->assertEquals($expected, $actual); - - // Again in .ini format. - $makefile = UNISH_SANDBOX . '/dev.make'; - $this->drush('generate-makefile', array($makefile), array('exclude-versions' => NULL, 'format' => 'ini') + $options); - $expected = <<<EOD -; This file was auto-generated by drush make -core = $major_version -api = 2 - -; Core -projects[] = "drupal" -; Modules -projects[] = "$module" -projects[libraries][subdir] = "contrib" - -; Themes -projects[] = "$theme" -EOD; - $actual = trim(file_get_contents($makefile)); - - $this->assertEquals($expected, $actual); - - // Generate a makefile with version numbers (in .ini format). - $this->drush('generate-makefile', array($makefile), array('format' => 'ini') + $options); - $actual = file_get_contents($makefile); - $this->assertContains('projects[' . $module . '][version] = "', $actual); - } -} diff --git a/vendor/drush/drush/tests/hooks/magic_help_alter/magic.drush.inc b/vendor/drush/drush/tests/hooks/magic_help_alter/magic.drush.inc deleted file mode 100644 index 9ad93d944e637ceba5eb129bb140d43c94823997..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/hooks/magic_help_alter/magic.drush.inc +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * Implement hook_drush_help_alter() - * - * @param type $command - */ -function magic_drush_help_alter(&$command) { - if ($command['command'] = 'version') { - $command['options']['magic'] = 'Some magic flag'; - } -} diff --git a/vendor/drush/drush/tests/imageTest.php b/vendor/drush/drush/tests/imageTest.php deleted file mode 100644 index 9b69238aaeca7217cd6b4a16dc08852316e3de62..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/imageTest.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests image-flush command - * - * @group commands - */ -class ImageCase extends CommandUnishTestCase { - - function testImage() { - if (UNISH_DRUPAL_MAJOR_VERSION == 6) { - $this->markTestSkipped("Image styles not available in Drupal 6 core."); - } - - $sites = $this->setUpDrupal(1, TRUE, null, 'standard'); - $options = array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - ); - $logo = UNISH_DRUPAL_MAJOR_VERSION >= 8 ? 'core/themes/bartik/screenshot.png' : 'themes/bartik/screenshot.png'; - $styles_dir = $options['root'] . '/sites/' . key($sites) . '/files/styles/'; - $thumbnail = $styles_dir . 'thumbnail/public/' . $logo; - $medium = $styles_dir . 'medium/public/' . $logo; - - // Test that "drush image-derive" works. - $style_name = 'thumbnail'; - $this->drush('image-derive', array($style_name, $logo), $options); - $this->assertFileExists($thumbnail); - - // Test that "drush image-flush thumbnail" deletes derivatives created by the thumbnail image style. - $this->drush('image-flush', array($style_name), $options); - $this->assertFileNotExists($thumbnail); - - // Check that "drush image-flush --all" deletes all image styles by creating two different ones and testing its - // existance afterwards. - $this->drush('image-derive', array('thumbnail', $logo), $options); - $this->assertFileExists($thumbnail); - $this->drush('image-derive', array('medium', $logo), $options); - $this->assertFileExists($medium); - $this->drush('image-flush', array(), array('all' => TRUE) + $options); - $this->assertFileNotExists($thumbnail); - $this->assertFileNotExists($medium); - } -} diff --git a/vendor/drush/drush/tests/initCommandTest.php b/vendor/drush/drush/tests/initCommandTest.php deleted file mode 100644 index b5b913d6fa47f96edd3a7647937f56dbb2f1fb6e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/initCommandTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Unish; - -/** - * Test to see if the `drush init` command does the - * setup that it is supposed to do. - * - * @group base - */ -class initCommandCase extends CommandUnishTestCase { - - function testInitCommand() { - // Call `drush core-init` - $this->drush('core-init', array(), array('backend' => NULL, 'add-path' => TRUE, 'yes' => NULL)); - $parsed = $this->parse_backend_output($this->getOutput()); - // First test to ensure that the command claimed to have made the expected progress - $this->assertLogHasMessage($parsed['log'], "Copied example Drush configuration file", 'ok'); - $this->assertLogHasMessage($parsed['log'], "Copied example Drush bash configuration file", 'ok'); - $this->assertLogHasMessage($parsed['log'], "Updated bash configuration file", 'ok'); - // Next we will test to see if there is evidence that those - // operations worked. - $home = getenv("HOME"); - $this->assertFileExists("$home/.drush/drushrc.php"); - $this->assertFileExists("$home/.drush/drush.bashrc"); - $this->assertFileExists("$home/.bashrc"); - - // Check to see if the .bashrc file sources our drush.bashrc file, - // and whether it adds the path to UNISH_DRUSH to the $PATH - $bashrc_contents = file_get_contents("$home/.bashrc"); - $this->assertContains('drush.bashrc', $bashrc_contents); - $this->assertContains(dirname(UNISH_DRUSH), $bashrc_contents); - } -} diff --git a/vendor/drush/drush/tests/lockMakeTest.php b/vendor/drush/drush/tests/lockMakeTest.php deleted file mode 100644 index 5f28cd77299abf6dd1c5497233ac8f1c27afd3c7..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/lockMakeTest.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -namespace Unish; - -/** - * Make makefile tests. - * @group make - * @group slow - */ -class lockMakefileCase extends CommandUnishTestCase { - /** - * Path to test make files. - */ - protected $makefile_path; - - /** - * Initialize $makefile_path. - */ - function __construct() { - $this->makefile_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'makefiles'; - } - - /** - * Run a given makefile test. - * - * @param $test - * The test makefile to run, as defined by $this->getMakefile(); - */ - private function runLockfileTest($test) { - $default_options = array( - 'result-file' => UNISH_SANDBOX . '/test.lock.yml', - ); - $config = $this->getLockfile($test); - $options = array_merge($config['options'], $default_options); - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $lockfile = $this->makefile_path . DIRECTORY_SEPARATOR . 'lockfiles' . DIRECTORY_SEPARATOR . $config['lockfile']; - $this->drush('make-lock', array($makefile), $options); - $expected = trim(file_get_contents($lockfile)); - $actual = trim(file_get_contents($options['result-file'])); - - $this->assertEquals($expected, $actual); - } - - function getLockfile($key) { - static $tests; - $tests = $this->listLockfileTests(); - return $tests[$key]; - } - - function listLockfileTests() { - $tests = array( - 'default' => array( - 'name' => 'lock', - 'makefile' => 'lock-default.make.yml', - 'lockfile' => 'default.lock.yml', - 'options' => array(), - ), - 'git' => array( - 'name' => 'git', - 'makefile' => 'lock-git.make.yml', - 'lockfile' => 'git.lock.yml', - 'options' => array(), - ), - ); - return $tests; - } - - /************************************************************************ - * * - * List of lock tests (in alphabetical order, for easier navigation.) * - * * - ************************************************************************/ - - /** - * Test locking basic version data. - */ - function testDefaultLock() { - $this->runLockfileTest('default'); - } - - /** - * Test locking git version data. - */ - function testGitLock() { - $this->runLockfileTest('git'); - } - -} diff --git a/vendor/drush/drush/tests/makeConvertTest.php b/vendor/drush/drush/tests/makeConvertTest.php deleted file mode 100644 index 2e3f9aec84356fa9aee79d83d673c38c39e97e11..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makeConvertTest.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -namespace Unish; - -/** - * Make makefile tests. - * @group make - * @group slow - */ -class makeConvertCase extends CommandUnishTestCase { - - /** - * Tests the conversion of make file to various formats. - * - * @param string $source_filename - * The source file to be converted. - * - * @param $options - * Options to be passed to the make-convert command. E.g., --format=yml. - * - * @param $expected_lines - * An array of lines expected to be present in the command output. - * - * @dataProvider providerTestMakeConvert - */ - public function testMakeConvert($source_filename, $options, $expected_lines) { - $makefile_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'makefiles'; - $source_file = $makefile_dir . DIRECTORY_SEPARATOR . $source_filename; - $return = $this->drush('make-convert', array($source_file), $options); - $output = $this->getOutput(); - foreach ($expected_lines as $expected_line) { - $this->assertContains($expected_line, $output); - } - } - - /** - * Data provider for testMakeConvert(). - * - * @return array - * An array of test case data. See testMakeConvert() signature. - */ - public function providerTestMakeConvert() { - return array( - array( - // Source filename in makefiles directory. - 'patches.make', - // Command pptions. - array('format' => 'yml'), - // Expected output lines. - array( - 'core: 7.x', - 'features:', - 'version: 1.0-beta4', - 'patch:', - "- 'http://drupal.org/files/issues/features-drush-backend-invoke-25.patch'", - ), - ), - array( - 'patches.make', - array('format' => 'composer'), - array( - '"drupal/drupal": "7.*",', - '"drupal/features": "^1.0-beta4",', - '"patches": {', - '"drupal/features": {', - '"Enter drupal/features patch #0 description here": "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch"', - ), - ), - array( - 'patches.make.yml', - array('format' => 'composer'), - array( - '"drupal/drupal": "7.*",', - '"drupal/features": "^1.0-beta4",', - '"patches": {', - '"drupal/features": {', - '"Enter drupal/features patch #0 description here": "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch"', - ), - ), - array( - 'composer.lock', - array('format' => 'make'), - array( - 'core = 7.x', - 'api = 2', - // Ensure Drupal core tag is set correctly. - 'projects[drupal][download][tag] = "7.43"', - 'projects[features][download][type] = "git"', - 'projects[features][download][url] = "https://git.drupal.org/project/features"', - 'projects[features][download][tag] = "7.x-1.0-beta4"', - 'projects[features][patch][0] = "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch"'), - ), - array( - 'composer.lock', - array('format' => 'yml'), - array( - 'core: 7.x', - 'api: 2', - // Ensure Drupal core tag is set correctly. - "tag: '7.43'", - 'features:', - 'tag: 7.x-1.0-beta4', - 'patch:', - "- 'http://drupal.org/files/issues/features-drush-backend-invoke-25.patch'", - ), - ), - ); - } - -} diff --git a/vendor/drush/drush/tests/makeTest.php b/vendor/drush/drush/tests/makeTest.php deleted file mode 100644 index 96569cccf038ce005fb8cb29f0f3a8863b0725ad..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makeTest.php +++ /dev/null @@ -1,791 +0,0 @@ -<?php - -namespace Unish; - -/** - * Make makefile tests. - * @group make - * @group slow - */ -class makeMakefileCase extends CommandUnishTestCase { - /** - * Path to test make files. - */ - protected $makefile_path; - - /** - * Initialize $makefile_path. - */ - function __construct() { - $this->makefile_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'makefiles'; - } - - /** - * Run a given makefile test. - * - * @param $test - * The test makefile to run, as defined by $this->getMakefile(); - */ - private function runMakefileTest($test) { - $default_options = array( - 'test' => NULL, - 'md5' => 'print', - ); - $config = $this->getMakefile($test); - $options = array_merge($config['options'], $default_options); - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $return = !empty($config['fail']) ? self::EXIT_ERROR : self::EXIT_SUCCESS; - $this->drush('make', array($makefile), $options, NULL, NULL, $return); - - // Check the log for the build hash if this test should pass. - if (empty($config['fail'])) { - $output = $this->getOutput(); - $this->assertContains($config['md5'], $output, $config['name'] . ' - build md5 matches expected value: ' . $config['md5']); - } - } - - function getMakefile($key) { - static $tests; - $tests = $this->listMakefileTests(); - return $tests[$key]; - } - - function listMakefileTests() { - $tests = array( - 'bzr' => array( - 'name' => 'Bzr', - 'makefile' => 'bzr.make', - 'build' => TRUE, - 'md5' => '272e2b9bb27794c54396f2f03c159725', - 'options' => array(), - ), - 'bz2' => array( - 'name' => 'bzip2', - 'makefile' => 'bz2.make', - 'build' => TRUE, - 'md5' => '5ec081203131a1a3277c8b23f9ddb995', - 'options' => array('no-core' => NULL), - ), - 'bz2-singlefile' => array( - 'name' => 'bzip2 single file', - 'makefile' => 'bz2-singlefile.make', - 'build' => TRUE, - 'md5' => '4f9d57f6caaf6ece0526d867327621cc', - 'options' => array('no-core' => NULL), - ), - 'contrib-destination' => array( - 'name' => 'Contrib-destination attribute', - 'makefile' => 'contrib-destination.make', - 'build' => TRUE, - 'md5' => '2aed36201ede1849ce43d9b7d6f7e9e1', - 'options' => array('no-core' => NULL, 'contrib-destination' => '.'), - ), - 'defaults' => array( - 'name' => 'Test defaults array.', - 'makefile' => 'defaults.make', - 'build' => TRUE, - 'md5' => 'e6c0d6b37cd8573cbd188742b95a274e', - 'options' => array('no-core' => NULL, 'contrib-destination' => '.'), - ), - 'file' => array( - 'name' => 'File extraction', - 'makefile' => 'file.make', - 'build' => TRUE, - 'md5' => '4e9883d6f9f6572af287635689c2545d', - 'options' => array('no-core' => NULL), - ), - 'file-extract' => array( - 'name' => 'Extract archives', - 'makefile' => 'file-extract.make', - 'build' => TRUE, - 'md5' => 'b43d271ab3510eb33c1e300c78893458', - // @todo This test often fails with concurrency set to more than one. - 'options' => array('no-core' => NULL, 'concurrency' => 1), - ), - 'get' => array( - 'name' => 'Test GET retrieval of projects', - 'makefile' => 'get.make', - 'build' => TRUE, - 'md5' => '4bf18507da89bed601548210c22a3bed', - 'options' => array('no-core' => NULL), - ), - 'git' => array( - 'name' => 'GIT integration', - 'makefile' => 'git.make', - 'build' => TRUE, - 'md5' => '4c80d78b50c89b5ba11a997bafec2b43', - 'options' => array('no-core' => NULL, 'no-gitinfofile' => NULL), - ), - 'git-simple' => array( - 'name' => 'Simple git integration', - 'makefile' => 'git-simple.make', - 'build' => TRUE, - 'md5' => '0147681209adef163a8ac2c0cff2a07e', - 'options' => array('no-core' => NULL, 'no-gitinfofile' => NULL), - ), - 'git-simple-8' => array( - 'name' => 'Simple git integration for D8', - 'makefile' => 'git-simple-8.make', - 'build' => TRUE, - 'options' => array('no-core' => NULL), - ), - 'gzip' => array( - 'name' => 'gzip', - 'makefile' => 'gzip.make', - 'build' => TRUE, - 'md5' => '25b514df18a87b655437388af083e22c', - 'options' => array('no-core' => NULL), - ), - 'ignore-checksums' => array( - 'name' => 'Ignore invalid checksum/s', - 'makefile' => 'md5-fail.make', - 'build' => TRUE, - 'md5' => 'f76ec174a775ce67f8e9edcb02336ef2', - 'options' => array('no-core' => NULL, 'ignore-checksums' => NULL), - ), - 'include' => array( - 'name' => 'Including files and property overrides', - 'makefile' => 'include.make', - 'build' => TRUE, - 'md5' => 'e2e230ec5eccaf5618050559ab11510d', - 'options' => array(), - ), - 'includes-git' => array( - 'name' => 'Including makefiles from remote repositories', - 'makefile' => 'includes-main.make', - 'build' => TRUE, - 'options' => array(), - ), - 'limit-libraries' => array( - 'name' => 'Limit libraries downloaded', - 'makefile' => 'limited-projects-libraries.make', - 'build' => TRUE, - 'md5' => 'cb0da4465d86eb34cafb167787862eb6', - 'options' => array('no-core' => NULL, 'libraries' => 'drush_make'), - ), - 'limit-libraries-multiple' => array( - 'name' => 'Limit multiple libraries downloaded', - 'makefile' => 'limited-projects-libraries.make', - 'build' => TRUE, - 'md5' => '7c10e6fc65728a77a2b0aed4ec2a29cd', - 'options' => array('no-core' => NULL, 'libraries' => 'drush_make,token'), - ), - 'limit-projects' => array( - 'name' => 'Limit projects downloaded', - 'makefile' => 'limited-projects-libraries.make', - 'build' => TRUE, - 'md5' => '3149650120e541d7d0fa577eef0ee9a3', - 'options' => array('no-core' => NULL, 'projects' => 'boxes'), - ), - 'limit-projects-multiple' => array( - 'name' => 'Limit multiple projects downloaded', - 'makefile' => 'limited-projects-libraries.make', - 'build' => TRUE, - 'md5' => 'ef8996c4d6c6f0d229e2237c73860071', - 'options' => array('no-core' => NULL, 'projects' => 'boxes,admin_menu'), - ), - 'md5-fail' => array( - 'name' => 'Failed MD5 validation test', - 'makefile' => 'md5-fail.make', - 'build' => FALSE, - 'md5' => FALSE, - 'options' => array('no-core' => NULL), - 'fail' => TRUE, - ), - 'md5-succeed' => array( - 'name' => 'MD5 validation', - 'makefile' => 'md5-succeed.make', - 'build' => TRUE, - 'md5' => 'f76ec174a775ce67f8e9edcb02336ef2', - 'options' => array('no-core' => NULL), - ), - 'no-patch-txt' => array( - 'name' => 'Test --no-patch-txt option', - 'makefile' => 'patches.make', - 'build' => TRUE, - 'md5' => '59267a04f98374ed5b0b75e90cefcd9c', - 'options' => array('no-core' => NULL, 'no-patch-txt' => NULL), - ), - 'options-array' => array( - 'name' => 'Test global options array', - 'makefile' => 'options-array.make', - 'build' => TRUE, - 'options' => array(), - ), - 'options-project' => array( - 'name' => 'Test per-project options array', - 'makefile' => 'options-project.make', - 'build' => TRUE, - 'options' => array(), - ), - 'patch' => array( - 'name' => 'Test patching and writing of PATCHES.txt file', - 'makefile' => 'patches.make', - 'build' => TRUE, - 'md5' => '536ee287344c24f47e0808622d7d091b', - 'options' => array('no-core' => NULL), - ), - 'recursion' => array( - 'name' => 'Recursion', - 'makefile' => 'recursion.make', - 'build' => TRUE, - 'md5' => 'cd095bd6dadb2f0d3e81f85f13685372', - 'options' => array( - 'no-core' => NULL, - 'contrib-destination' => 'profiles/drupal_forum', - ), - ), - 'recursion-override' => array( - 'name' => 'Recursion overrides', - 'makefile' => 'recursion-override.make', - 'build' => TRUE, - 'md5' => 'a13c3d5d416be9fa78569514844b96a2', - 'options' => array( - 'no-core' => NULL, - ), - ), - 'subtree' => array( - 'name' => 'Use subtree from downloaded archive', - 'makefile' => 'subtree.make', - 'build' => TRUE, - 'md5' => 'db3770d8b4c9ce77510cbbcc566da9b8', - 'options' => array('no-core' => NULL), - ), - 'svn' => array( - 'name' => 'SVN', - 'makefile' => 'svn.make', - 'build' => TRUE, - 'md5' => '0cb28a15958d7fc4bbf8bf6b00bc6514', - 'options' => array('no-core' => NULL), - ), - 'translations' => array( - 'name' => 'Translation downloads', - 'makefile' => 'translations.make', - 'options' => array( - 'translations' => 'es,pt-br', - 'no-core' => NULL, - ), - ), - 'translations-inside' => array( - 'name' => 'Translation downloads inside makefile', - 'makefile' => 'translations-inside.make', - ), - 'translations-inside7' => array( - 'name' => 'Translation downloads inside makefile, core 7.x', - 'makefile' => 'translations-inside7.make', - ), - 'use-distribution-as-core' => array( - 'name' => 'Use distribution as core', - 'makefile' => 'use-distribution-as-core.make', - 'build' => TRUE, - 'md5' => '643a603025a20d498eb583a1e7970bad', - 'options' => array(), - ), - ); - // Replicate ini tests for YAML format. - foreach ($tests as $id => $test) { - $id_yaml = $id . '-yaml'; - $tests[$id_yaml] = $test; - $tests[$id_yaml]['name'] = $tests[$id]['name'] . '(in YAML format)'; - $tests[$id_yaml]['makefile'] = $tests[$id]['makefile'] . '.yml'; - } - return $tests; - } - - /************************************************************************ - * * - * List of make tests (in alphabetical order, for easier navigation.) * - * * - ************************************************************************/ - - /** - * Test .info file writing and the use of a git reference cache for - * git downloads. - */ - function testInfoFileWritingGit() { - // Use the git-simple.make file. - $config = $this->getMakefile('git-simple'); - - $options = array('no-core' => NULL); - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $this->drush('make', array($makefile, UNISH_SANDBOX . '/test-build'), $options); - - // Test cck_signup.info file. - $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/cck_signup/cck_signup.info'); - $contents = file_get_contents(UNISH_SANDBOX . '/test-build/sites/all/modules/cck_signup/cck_signup.info'); - $this->assertContains('; Information added by drush on 2011-07-27', $contents); - $this->assertContains('version = "2fe932c"', $contents); - $this->assertContains('project = "cck_signup"', $contents); - - // Verify that a reference cache was created. - $cache_dir = UNISH_CACHE . DIRECTORY_SEPARATOR . 'cache'; - $this->assertFileExists($cache_dir . '/git/cck_signup-' . md5('https://git.drupal.org/project/cck_signup.git')); - - // Test context_admin.info file. - $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/context_admin/context_admin.info'); - $contents = file_get_contents(UNISH_SANDBOX . '/test-build/sites/all/modules/context_admin/context_admin.info'); - $this->assertContains('; Information added by drush on 2011-10-27', $contents); - $this->assertContains('version = "eb9f05e"', $contents); - $this->assertContains('project = "context_admin"', $contents); - - // Verify git reference cache exists. - $this->assertFileExists($cache_dir . '/git/context_admin-' . md5('https://git.drupal.org/project/context_admin.git')); - - // Text caption_filter .info rewrite. - $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/contrib/caption_filter/caption_filter.info'); - $contents = file_get_contents(UNISH_SANDBOX . '/test-build/sites/all/modules/contrib/caption_filter/caption_filter.info'); - $this->assertContains('; Information added by drush on 2011-09-20', $contents); - $this->assertContains('version = "7.x-1.2+0-dev"', $contents); - $this->assertContains('project = "caption_filter"', $contents); - } - - /** - * Test .info file writing and the use of a git reference cache for - * git downloads. - */ - function testInfoYamlFileWritingGit() { - // Use the Drupal 8 .make file. - $config = $this->getMakefile('git-simple-8'); - - $options = array('no-core' => NULL); - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $this->drush('make', array($makefile, UNISH_SANDBOX . '/test-build'), $options); - - $this->assertFileExists(UNISH_SANDBOX . '/test-build/modules/honeypot/honeypot.info.yml'); - $contents = file_get_contents(UNISH_SANDBOX . '/test-build/modules/honeypot/honeypot.info.yml'); - $this->assertContains('# Information added by drush on 2015-09-03', $contents); - $this->assertContains("version: '8.x-1.x-dev'", $contents); - $this->assertContains("project: 'honeypot'", $contents); - } - - function testMakeBzr() { - // Silently skip bzr test if bzr is not installed. - exec('which bzr', $output, $whichBzrErrorCode); - if (!$whichBzrErrorCode) { - $this->runMakefileTest('bzr'); - } - else { - $this->markTestSkipped('bzr command is not available.'); - } - } - - function testMakeBZ2() { - // Silently skip bz2 test if bz2 is not installed. - exec('which bzip2', $output, $whichBzip2ErrorCode); - if (!$whichBzip2ErrorCode) { - $this->runMakefileTest('bz2'); - } - else { - $this->markTestSkipped('bzip2 command not available.'); - } - } - - /* TODO: http://download.gna.org/wkhtmltopdf/obsolete/linux/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2 cannot be downloaded any longer - function testMakeBZ2SingleFile() { - // Silently skip bz2 test if bz2 is not installed. - exec('which bzip2', $output, $whichBzip2ErrorCode); - if (!$whichBzip2ErrorCode) { - $this->runMakefileTest('bz2-singlefile'); - } - else { - $this->markTestSkipped('bzip2 command not available.'); - } - } - */ - - function testMakeContribDestination() { - $this->runMakefileTest('contrib-destination'); - } - - /** @group make.yml */ - function testMakeContribDestinationYaml() { - $this->runMakefileTest('contrib-destination-yaml'); - } - - function testMakeDefaults() { - $this->runMakefileTest('defaults'); - } - - /** @group make.yml */ - function testMakeDefaultsYaml() { - $this->runMakefileTest('defaults-yaml'); - } - - function testMakeFile() { - $this->runMakefileTest('file'); - } - - function testMakeFileExtract() { - // Silently skip file extraction test if unzip is not installed. - exec('which unzip', $output, $whichUnzipErrorCode); - if (!$whichUnzipErrorCode) { - $this->runMakefileTest('file-extract'); - } - else { - $this->markTestSkipped('unzip command not available.'); - } - } - - function testMakeGet() { - $this->runMakefileTest('get'); - } - - function testMakeGit() { - $this->runMakefileTest('git'); - } - - function testMakeGitSimple() { - $this->runMakefileTest('git-simple'); - } - - function testMakeGZip() { - // Silently skip gzip test if either gzip or unzip is not installed. - exec('which gzip', $output, $whichGzipErrorCode); - if (!$whichGzipErrorCode) { - exec('which unzip', $output, $whichUnzipErrorCode); - if (!$whichUnzipErrorCode) { - $this->runMakefileTest('gzip'); - } - else { - $this->markTestSkipped('unzip command not available.'); - } - } - else { - $this->markTestSkipped('gzip command not available.'); - } - } - - function testMakeIgnoreChecksums() { - $this->runMakefileTest('ignore-checksums'); - } - - function testMakeInclude() { - $this->runMakefileTest('include'); - } - - /** @group make.yml */ - function testMakeIncludeYaml() { - $this->runMakefileTest('include-yaml'); - } - - /** - * Test git support on includes directive. - */ - function testMakeIncludesGit() { - $config = $this->getMakefile('includes-git'); - $options = array(); - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $this->drush('make', array($makefile, UNISH_SANDBOX . '/test-git-includes'), $options); - - // Verify that core and example main module were downloaded. - $this->assertFileExists(UNISH_SANDBOX . '/test-git-includes/README.txt'); - $this->assertFileExists(UNISH_SANDBOX . '/test-git-includes/sites/all/modules/contrib/apachesolr/README.txt'); - - // Verify that module included in sub platform was downloaded. - $this->assertFileExists(UNISH_SANDBOX . '/test-git-includes/sites/all/modules/contrib/jquery_update/README.txt'); - } - - function testMakeLimitProjects() { - $this->runMakefileTest('limit-projects'); - $this->runMakefileTest('limit-projects-multiple'); - } - - function testMakeLimitLibraries() { - $this->runMakefileTest('limit-libraries'); - $this->runMakefileTest('limit-libraries-multiple'); - } - - - function testMakeMd5Fail() { - $this->runMakefileTest('md5-fail'); - } - - function testMakeMd5Succeed() { - $this->runMakefileTest('md5-succeed'); - } - - /** - * Test that make_move_build() doesn't wipe out directories that it shouldn't. - */ - function testMakeMoveBuild() { - // Manually download a module. - $options = array( - 'default-major' => 6, // The makefile used below is core = "6.x". - 'destination' => UNISH_SANDBOX . '/sites/all/modules/contrib', - 'yes' => NULL, - 'dev' => NULL, - ); - $this->drush('pm-download', array('cck_signup'), $options); - - // Build a make file. - $config = $this->getMakefile('contrib-destination'); - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $this->drush('make', array($makefile, '.'), $config['options']); - - // Verify that the manually downloaded module still exists. - $this->assertFileExists(UNISH_SANDBOX . '/sites/all/modules/contrib/cck_signup/README.txt'); - } - - function testMakeNoPatchTxt() { - $this->runMakefileTest('no-patch-txt'); - } - - function testMakeNoRecursion() { - $config = $this->getMakefile('recursion'); - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - - $install_directory = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'norecursion'; - $this->drush('make', array('--no-core', '--no-recursion', $makefile, $install_directory)); - $this->assertNotContains("ctools", $this->getOutput(), "Make with --no-recursion does not recurse into drupal_forum to download ctools."); - } - - /** - * Test no-core and working-copy in options array. - */ - function testMakeOptionsArray() { - // Use the goptions-array.make file. - $config = $this->getMakefile('options-array'); - - $makefile_path = dirname(__FILE__) . '/makefiles'; - $makefile = $makefile_path . '/' . $config['makefile']; - $install_directory = UNISH_SANDBOX . '/options-array'; - $this->drush('make', array($makefile, $install_directory)); - - // Test cck_signup .git/HEAD file. - $this->assertFileExists($install_directory . '/sites/all/modules/cck_signup/.git/HEAD'); - $contents = file_get_contents($install_directory . '/sites/all/modules/cck_signup/.git/HEAD'); - $this->assertContains('2fe932c', $contents); - - // Test context_admin .git/HEAD file. - $this->assertFileExists($install_directory . '/sites/all/modules/context_admin/.git/HEAD'); - $contents = file_get_contents($install_directory . '/sites/all/modules/context_admin/.git/HEAD'); - $this->assertContains('eb9f05e', $contents); - } - - /** - * Test per project working-copy option. - */ - function testMakeOptionsProject() { - // Use the options-project.make file. - $config = $this->getMakefile('options-project'); - - $makefile_path = dirname(__FILE__) . '/makefiles'; - $options = array('no-core' => NULL); - $makefile = $makefile_path . '/' . $config['makefile']; - $install_directory = UNISH_SANDBOX . '/options-project'; - $this->drush('make', array($makefile, $install_directory), $options); - - // Test context_admin .git/HEAD file. - $this->assertFileExists($install_directory . '/sites/all/modules/context_admin/.git/HEAD'); - $contents = file_get_contents($install_directory . '/sites/all/modules/context_admin/.git/HEAD'); - $this->assertContains('eb9f05e', $contents); - - // Test cck_signup .git/HEAD file does not exist. - $this->assertFileNotExists($install_directory . '/sites/all/modules/cck_signup/.git/HEAD'); - - // Test caption_filter .git/HEAD file. - $this->assertFileExists($install_directory . '/sites/all/modules/contrib/caption_filter/.git/HEAD'); - $contents = file_get_contents($install_directory . '/sites/all/modules/contrib//caption_filter/.git/HEAD'); - $this->assertContains('c9794cf', $contents); - } - - function testMakePatch() { - $this->runMakefileTest('patch'); - } - - function testMakeRecursion() { - $this->runMakefileTest('recursion'); - } - - function testMakeRecursionOverride() { - // @todo This is skipped for now since the test relies on sourceforge. - // It can be replaced if a suitable module that installs projects (not - // libraries, which aren't properly overridable). - $this->markTestSkipped('skipping recursion-override test'); - return; - - // Silently skip file extraction test if unzip is not installed. - exec('which unzip', $output, $whichUnzipErrorCode); - if (!$whichUnzipErrorCode) { - $this->runMakefileTest('recursion-override'); - } - else { - $this->markTestSkipped('unzip command not available.'); - } - } - - function testMakeSubtree() { - // Silently skip subtree test if unzip is not installed. - exec('which unzip', $output, $whichUnzipErrorCode); - if (!$whichUnzipErrorCode) { - $config = $this->getMakefile('subtree'); - - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $install_directory = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'subtree'; - $this->drush('make', array('--no-core', $makefile, $install_directory)); - - $files['nivo-slider'] = array( - 'exists' => array( - 'jquery.nivo.slider.js', - 'jquery.nivo.slider.pack.js', - 'license.txt', - 'nivo-slider.css', - 'README', - ), - 'notexists' => array( - '__MACOSX', - 'nivo-slider', - ), - ); - $files['fullcalendar'] = array( - 'exists' => array( - 'fullcalendar.css', - 'fullcalendar.js', - 'fullcalendar.min.js', - 'fullcalendar.print.css', - 'gcal.js', - ), - 'notexists' => array( - 'changelog.txt', - 'demos', - 'fullcalendar', - 'GPL-LICENSE.txt', - 'jquery', - 'MIT-LICENSE.txt', - ), - ); - $basedir = $install_directory . DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . 'all' . DIRECTORY_SEPARATOR . 'libraries'; - foreach ($files as $lib => $details) { - $dir = $basedir . DIRECTORY_SEPARATOR . $lib; - if (!empty($details['exists'])) { - foreach ($details['exists'] as $file) { - $this->assertFileExists($dir . DIRECTORY_SEPARATOR . $file); - } - } - - if (!empty($details['notexists'])) { - foreach ($details['notexists'] as $file) { - $this->assertFileNotExists($dir . DIRECTORY_SEPARATOR . $file); - } - } - } - } - else { - $this->markTestSkipped('unzip command not available.'); - } - } - - function testMakeSvn() { - return $this->markTestSkipped('svn support is deprecated.'); - // Silently skip svn test if svn is not installed. - exec('which svn', $output, $whichSvnErrorCode); - if (!$whichSvnErrorCode) { - $this->runMakefileTest('svn'); - } - else { - $this->markTestSkipped('svn command not available.'); - } - } - - /** - * Translations can change arbitrarily, so these test for the existence of .po - * files, rather than trying to match a build hash. - */ - function testMakeTranslations() { - $config = $this->getMakefile('translations'); - - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $install_directory = UNISH_SANDBOX . '/translations'; - $this->drush('make', array($makefile, $install_directory), $config['options']); - - $po_files = array( - 'sites/all/modules/token/translations/pt-br.po', - 'sites/all/modules/token/translations/es.po', - ); - - foreach ($po_files as $po_file) { - $this->assertFileExists($install_directory . '/' . $po_file); - } - } - - /** - * Translations can change arbitrarily, so these test for the existence of .po - * files, rather than trying to match a build hash. - */ - function testMakeTranslationsInside() { - $config = $this->getMakefile('translations-inside'); - - $makefile = $this->makefile_path . '/' . $config['makefile']; - $install_directory = UNISH_SANDBOX . '/translations-inside'; - $this->drush('make', array($makefile, $install_directory)); - - $po_files = array( - 'profiles/default/translations/pt-br.po', - 'profiles/default/translations/es.po', - 'sites/all/modules/token/translations/pt-br.po', - 'sites/all/modules/token/translations/es.po', - 'modules/system/translations/pt-br.po', - 'modules/system/translations/es.po', - ); - - foreach ($po_files as $po_file) { - $this->assertFileExists($install_directory . '/' . $po_file); - } - } - - /** - * Translations can change arbitrarily, so these test for the existence of .po - * files, rather than trying to match a build hash. - */ - function testMakeTranslationsInside7() { - $config = $this->getMakefile('translations-inside7'); - - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $install_directory = UNISH_SANDBOX . '/translations-inside7'; - $this->drush('make', array($makefile, $install_directory)); - - $po_files = array( - 'profiles/minimal/translations/pt-br.po', - 'profiles/minimal/translations/es.po', - 'profiles/testing/translations/pt-br.po', - 'profiles/testing/translations/es.po', - 'profiles/standard/translations/pt-br.po', - 'profiles/standard/translations/es.po', - 'sites/all/modules/token/translations/pt-br.po', - 'sites/all/modules/token/translations/es.po', - 'modules/system/translations/pt-br.po', - 'modules/system/translations/es.po', - ); - - foreach ($po_files as $po_file) { - $this->assertFileExists($install_directory . '/' . $po_file); - } - } - - /** - * Test that a distribution can be used as a "core" project. - */ - function testMakeUseDistributionAsCore() { - $this->runMakefileTest('use-distribution-as-core'); - } - - /** - * Test that files without a core attribute are correctly identified. - */ - public function testNoCoreMakefileParsing() { - require_once __DIR__ . '/../commands/make/make.utilities.inc'; - - // INI. - $data = file_get_contents(__DIR__ . '/makefiles/no-core.make'); - $parsed = _make_determine_format($data); - $this->assertEquals('ini', $parsed['format']); - $this->assertEquals(42, $parsed['projects']['foo']['version']); - - // YAML. - $data = file_get_contents(__DIR__ . '/makefiles/no-core.make.yml'); - $parsed = _make_determine_format($data); - $this->assertEquals('yaml', $parsed['format']); - $this->assertEquals(42, $parsed['projects']['foo']['version']); - } - -} diff --git a/vendor/drush/drush/tests/makefiles/bz2-singlefile.make b/vendor/drush/drush/tests/makefiles/bz2-singlefile.make deleted file mode 100644 index bf31860ff8ab955a83c03eb5fdd32ba6a087f6d6..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/bz2-singlefile.make +++ /dev/null @@ -1,8 +0,0 @@ -api = 2 -core = 6.x - -; wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2 contains the single file "wkhtmltopdf-amd64". -; This should move that single file to sites/all/libraries/wkhtmltopdf . -libraries[wkhtmltopdf][destination] = libraries -libraries[wkhtmltopdf][download][type] = get -libraries[wkhtmltopdf][download][url] = http://download.gna.org/wkhtmltopdf/obsolete/linux/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2 diff --git a/vendor/drush/drush/tests/makefiles/bz2.make b/vendor/drush/drush/tests/makefiles/bz2.make deleted file mode 100644 index b972f0d565d4c6ed8f8c22235bd50f236bcc1ab7..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/bz2.make +++ /dev/null @@ -1,8 +0,0 @@ -core = 6.x -api = 2 - -; bison-1.30.tar.bz2 contains wrapper folder "bison-1.30/". -; This should move that wrapper folder to sites/all/libraries/bison/ . -libraries[bison][destination] = libraries -libraries[bison][download][type] = get -libraries[bison][download][url] = http://ftp.gnu.org/gnu/bison/bison-1.30.tar.bz2 diff --git a/vendor/drush/drush/tests/makefiles/bzr.make b/vendor/drush/drush/tests/makefiles/bzr.make deleted file mode 100644 index 538eff23befda722c8f1c8ccdffe3fefcaa768d5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/bzr.make +++ /dev/null @@ -1,7 +0,0 @@ -core = 6.x -api = 2 - -projects[mv][type] = "core" -projects[mv][download][type] = "bzr" -projects[mv][download][url] = "lp:mv" -projects[mv][download][revision] = 30 diff --git a/vendor/drush/drush/tests/makefiles/composer.json b/vendor/drush/drush/tests/makefiles/composer.json deleted file mode 100644 index 0af37c560c2ab7d90f5638f5676a7005066df841..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/composer.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "Enter project name here", - "description": "Enter project description here", - "type": "project", - "repositories": [ - { - "type": "composer", - "url": "https://packagist.drupal-composer.org" - } - ], - "require": { - "composer/installers": "^1.0.20", - "cweagans/composer-patches": "~1.0", - "drupal/drupal": "7.*", - "drupal/wysiwyg": "7.2.1", - "drupal/features": "7.1.0-beta4", - "drupal/context": "7.3.0-beta2" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "extra": { - "installer-paths": { - "core": [ - "type:drupal-core" - ], - "docroot/modules/contrib/{$name}": [ - "type:drupal-module" - ], - "docroot/profiles/contrib/{$name}": [ - "type:drupal-profile" - ], - "docroot/themes/contrib/{$name}": [ - "type:drupal-theme" - ], - "drush/contrib/{$name}": [ - "type:drupal-drush" - ] - }, - "patches": { - "drupal/wysiwyg": { - "Enter drupal/wysiwyg patch #0 description here": "http://drupal.org/files/0001-feature.inc-from-624018-211.patch", - "Enter drupal/wysiwyg patch #1 description here": "patches-local-test-wysiwyg.patch" - }, - "drupal/features": { - "Enter drupal/features patch #0 description here": "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch" - }, - "drupal/context": { - "Enter drupal/context patch #0 description here": "http://drupal.org/files/issues/custom_blocks_arent_editable-make.patch", - "Enter drupal/context patch #1 description here": "http://drupal.org/files/issues/661094-context-permissions.patch" - } - } - } -} diff --git a/vendor/drush/drush/tests/makefiles/composer.lock b/vendor/drush/drush/tests/makefiles/composer.lock deleted file mode 100644 index dded8a274c153ec0b624570f5a50384f8ad3248a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/composer.lock +++ /dev/null @@ -1,406 +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": "ded042990efb1c573ef284e73156d835", - "content-hash": "e03033724e81829af4933cd3370a66d9", - "packages": [ - { - "name": "composer/installers", - "version": "v1.0.23", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "6213d900e92647831f7a406d5c530ea1f3d4360e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/6213d900e92647831f7a406d5c530ea1f3d4360e", - "reference": "6213d900e92647831f7a406d5c530ea1f3d4360e", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" - }, - "type": "composer-plugin", - "extra": { - "class": "Composer\\Installers\\Plugin", - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Composer\\Installers\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "http://composer.github.com/installers/", - "keywords": [ - "Craft", - "Dolibarr", - "Hurad", - "MODX Evo", - "OXID", - "SMF", - "Thelia", - "WolfCMS", - "agl", - "aimeos", - "annotatecms", - "bitrix", - "cakephp", - "chef", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "elgg", - "fuelphp", - "grav", - "installer", - "joomla", - "kohana", - "laravel", - "lithium", - "magento", - "mako", - "mediawiki", - "modulework", - "moodle", - "phpbb", - "piwik", - "ppi", - "puppet", - "roundcube", - "shopware", - "silverstripe", - "symfony", - "typo3", - "wordpress", - "zend", - "zikula" - ], - "time": "2016-01-27 12:54:22" - }, - { - "name": "cweagans/composer-patches", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/cweagans/composer-patches.git", - "reference": "0d75c63b6de66144517a1da9084422b78c2ff251" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/0d75c63b6de66144517a1da9084422b78c2ff251", - "reference": "0d75c63b6de66144517a1da9084422b78c2ff251", - "shasum": "" - }, - "require": { - "composer-plugin-api": "~1.0", - "php": ">=5.3.0" - }, - "require-dev": { - "composer/composer": "~1.0", - "phpunit/phpunit": "~4.6" - }, - "type": "composer-plugin", - "extra": { - "class": "cweagans\\Composer\\Patches" - }, - "autoload": { - "psr-4": { - "cweagans\\Composer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "authors": [ - { - "name": "Cameron Eagans", - "email": "me@cweagans.net" - } - ], - "description": "Provides a way to patch Composer packages.", - "time": "2016-02-29 03:45:02" - }, - { - "name": "drupal/context", - "version": "7.3.0-beta2", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/context", - "reference": "289025b16464ecf8d1832ff49db3866f5aa40e1b" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/context-7.x-3.0-beta2.zip", - "reference": null, - "shasum": null - }, - "require": { - "drupal/ctools": "7.*", - "drupal/drupal": "7.*" - }, - "replace": { - "drupal/context_layouts": "self.version", - "drupal/context_ui": "self.version" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-7.x-3.x": "7.3.x-dev" - }, - "patches_applied": { - "Enter drupal/context patch #0 description here": "http://drupal.org/files/issues/custom_blocks_arent_editable-make.patch", - "Enter drupal/context patch #1 description here": "http://drupal.org/files/issues/661094-context-permissions.patch" - } - }, - "notification-url": "https://packagist.drupal-composer.org/downloads/", - "description": "Provide modules with a cache that lasts for a single page request.", - "homepage": "https://www.drupal.org/project/context" - }, - { - "name": "drupal/ctools", - "version": "7.1.9", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/ctools", - "reference": "1bf2f388cd7371ae16639349ae3b344732faafae" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/ctools-7.x-1.9.zip", - "reference": null, - "shasum": null - }, - "require": { - "drupal/drupal": "7.*" - }, - "replace": { - "drupal/bulk_export": "self.version", - "drupal/ctools_access_ruleset": "self.version", - "drupal/ctools_ajax_sample": "self.version", - "drupal/ctools_custom_content": "self.version", - "drupal/ctools_plugin_example": "self.version", - "drupal/page_manager": "self.version", - "drupal/stylizer": "self.version", - "drupal/term_depth": "self.version", - "drupal/views_content": "self.version" - }, - "suggest": { - "drupal/advanced_help": "Required by drupal/ctools_plugin_example", - "drupal/color": "Required by drupal/stylizer", - "drupal/page_manager": "Required by drupal/ctools_plugin_example", - "drupal/panels": "Required by drupal/ctools_plugin_example", - "drupal/views": "Required by drupal/views_content" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-7.x-1.x": "7.1.x-dev" - } - }, - "notification-url": "https://packagist.drupal-composer.org/downloads/", - "description": "A library of helpful tools by Merlin of Chaos.", - "homepage": "https://www.drupal.org/project/ctools" - }, - { - "name": "drupal/drupal", - "version": "7.43.0", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/drupal", - "reference": "c136d1347b9b92145590cb1f84cc02a695d721fe" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/drupal-7.43.zip", - "reference": null, - "shasum": null - }, - "replace": { - "drupal/aggregator": "self.version", - "drupal/bartik": "self.version", - "drupal/block": "self.version", - "drupal/blog": "self.version", - "drupal/book": "self.version", - "drupal/color": "self.version", - "drupal/comment": "self.version", - "drupal/contact": "self.version", - "drupal/contextual": "self.version", - "drupal/dashboard": "self.version", - "drupal/dblog": "self.version", - "drupal/field": "self.version", - "drupal/field_sql_storage": "self.version", - "drupal/field_ui": "self.version", - "drupal/file": "self.version", - "drupal/filter": "self.version", - "drupal/forum": "self.version", - "drupal/garland": "self.version", - "drupal/help": "self.version", - "drupal/image": "self.version", - "drupal/list": "self.version", - "drupal/locale": "self.version", - "drupal/menu": "self.version", - "drupal/minimal": "self.version", - "drupal/node": "self.version", - "drupal/number": "self.version", - "drupal/openid": "self.version", - "drupal/options": "self.version", - "drupal/overlay": "self.version", - "drupal/path": "self.version", - "drupal/php": "self.version", - "drupal/poll": "self.version", - "drupal/profile": "self.version", - "drupal/rdf": "self.version", - "drupal/search": "self.version", - "drupal/seven": "self.version", - "drupal/shortcut": "self.version", - "drupal/standard": "self.version", - "drupal/stark": "self.version", - "drupal/statistics": "self.version", - "drupal/syslog": "self.version", - "drupal/system": "self.version", - "drupal/taxonomy": "self.version", - "drupal/text": "self.version", - "drupal/toolbar": "self.version", - "drupal/tracker": "self.version", - "drupal/translation": "self.version", - "drupal/trigger": "self.version", - "drupal/update": "self.version", - "drupal/user": "self.version" - }, - "suggest": { - "drupal/block": "Required by drupal/dashboard, drupal/minimal, drupal/standard", - "drupal/color": "Required by drupal/standard", - "drupal/comment": "Required by drupal/forum, drupal/tracker, drupal/standard", - "drupal/contextual": "Required by drupal/standard", - "drupal/dashboard": "Required by drupal/standard", - "drupal/dblog": "Required by drupal/minimal, drupal/standard", - "drupal/field": "Required by drupal/field_sql_storage, drupal/list, drupal/number, drupal/options, drupal/text, drupal/field_ui, drupal/file", - "drupal/field_sql_storage": "Required by drupal/field", - "drupal/field_ui": "Required by drupal/standard", - "drupal/file": "Required by drupal/image, drupal/standard", - "drupal/help": "Required by drupal/standard", - "drupal/image": "Required by drupal/standard", - "drupal/list": "Required by drupal/standard", - "drupal/locale": "Required by drupal/translation", - "drupal/menu": "Required by drupal/standard", - "drupal/number": "Required by drupal/standard", - "drupal/options": "Required by drupal/list, drupal/taxonomy, drupal/standard", - "drupal/overlay": "Required by drupal/standard", - "drupal/path": "Required by drupal/standard", - "drupal/rdf": "Required by drupal/standard", - "drupal/search": "Required by drupal/standard", - "drupal/shortcut": "Required by drupal/standard", - "drupal/taxonomy": "Required by drupal/forum, drupal/standard", - "drupal/text": "Required by drupal/comment", - "drupal/toolbar": "Required by drupal/standard" - }, - "type": "drupal-core", - "extra": { - "branch-alias": { - "dev-7.x-": "7.x-dev" - } - }, - "notification-url": "https://packagist.drupal-composer.org/downloads/", - "description": "Handles general site configuration for administrators.", - "homepage": "https://www.drupal.org/project/drupal" - }, - { - "name": "drupal/features", - "version": "7.1.0-beta4", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/features", - "reference": "dc3297e5f4141f40f46635c1bbf05913d0ae662d" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/features-7.x-1.0-beta4.zip", - "reference": null, - "shasum": null - }, - "require": { - "drupal/drupal": "7.*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-7.x-1.x": "7.1.x-dev" - }, - "patches_applied": { - "Enter drupal/features patch #0 description here": "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch" - } - }, - "notification-url": "https://packagist.drupal-composer.org/downloads/", - "description": "Provides feature management for Drupal.", - "homepage": "https://www.drupal.org/project/features" - }, - { - "name": "drupal/wysiwyg", - "version": "7.2.1", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/wysiwyg", - "reference": "2602159043586a5878a08a48f6faa665a62b726a" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/wysiwyg-7.x-2.1.zip", - "reference": null, - "shasum": null - }, - "require": { - "drupal/drupal": "7.*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-7.x-2.x": "7.2.x-dev" - }, - "patches_applied": { - "Enter drupal/wysiwyg patch #0 description here": "http://drupal.org/files/0001-feature.inc-from-624018-211.patch", - "Enter drupal/wysiwyg patch #1 description here": "patches-local-test-wysiwyg.patch" - } - }, - "notification-url": "https://packagist.drupal-composer.org/downloads/", - "description": "Allows to edit content with client-side editors.", - "homepage": "https://www.drupal.org/project/wysiwyg" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": [], - "prefer-stable": true, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/vendor/drush/drush/tests/makefiles/contrib-destination.make b/vendor/drush/drush/tests/makefiles/contrib-destination.make deleted file mode 100644 index cbf8dc7ca3b60e09e61a1ab0e9031ba53a18cac6..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/contrib-destination.make +++ /dev/null @@ -1,12 +0,0 @@ -core = "6.x" -api = 2 - -projects[boxes][subdir] = "contrib" -projects[boxes][version] = "1.0" - -projects[admin][subdir] = "contrib" -projects[admin][version] = "2.0" - -projects[zen][subdir] = "contrib" -projects[zen][version] = "2.1" -projects[zen][type] = "theme" diff --git a/vendor/drush/drush/tests/makefiles/contrib-destination.make.yml b/vendor/drush/drush/tests/makefiles/contrib-destination.make.yml deleted file mode 100644 index 3ff3356578e18f4c600d4f12b08698c157e680f0..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/contrib-destination.make.yml +++ /dev/null @@ -1,13 +0,0 @@ -core: '6.x' -api: 2 -projects: - boxes: - subdir: 'contrib' - version: '1.0' - admin: - subdir: 'contrib' - version: '2.0' - zen: - subdir: 'contrib' - version: '2.1' - type: 'theme' diff --git a/vendor/drush/drush/tests/makefiles/defaults.make b/vendor/drush/drush/tests/makefiles/defaults.make deleted file mode 100644 index 368b8e4a7599130840a7bb3b18ad7ab7c45a467e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/defaults.make +++ /dev/null @@ -1,12 +0,0 @@ -core = "6.x" -api = 2 - -defaults[projects][subdir] = "contrib" - -projects[boxes][version] = "1.0" - -projects[admin][version] = "2.0" - -; Override project default -projects[devel][version] = "1.27" -projects[devel][subdir] = "development" diff --git a/vendor/drush/drush/tests/makefiles/defaults.make.yml b/vendor/drush/drush/tests/makefiles/defaults.make.yml deleted file mode 100644 index 33c8b3716a7dcfe825aee408b7e9f23b637c1edb..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/defaults.make.yml +++ /dev/null @@ -1,16 +0,0 @@ -core: 6.x -api: 2 - -defaults: - projects: - subdir: "contrib" - -projects: - boxes: - version: "1.0" - admin: - version: "2.0" - # Override project default - devel: - version: "1.27" - subdir: "development" diff --git a/vendor/drush/drush/tests/makefiles/file-extract.make b/vendor/drush/drush/tests/makefiles/file-extract.make deleted file mode 100644 index f2e05b54c997165798e486f9496774fcbea0eeb5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/file-extract.make +++ /dev/null @@ -1,17 +0,0 @@ -core = 6.x -api = 2 - -projects[admin_menu][download][type] = "file" -projects[admin_menu][download][url] = "http://ftp.drupal.org/files/projects/admin_menu-6.x-1.0-beta.zip?param=value" -projects[admin_menu][download][md5] = "673ec1bb431113142016d5eb0a0ef77f" - -projects[devel][download][type] = "file" -projects[devel][download][url] = "http://ftp.drupal.org/files/projects/devel-6.x-1.0.tar.gz?param=value" -projects[devel][download][md5] = "3dbd3cd4c15f001c1ac7067ca58c74ff" - -libraries[vegas][download][type] = "get" -libraries[vegas][download][url] = "https://github.com/jaysalvat/vegas/zipball/v1.2" - -libraries[autopager][download][type] = "get" -libraries[autopager][download][url] = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jquery-autopager/jquery.autopager-1.0.0.js" -libraries[autopager][directory_name] = "autopager" diff --git a/vendor/drush/drush/tests/makefiles/file.make b/vendor/drush/drush/tests/makefiles/file.make deleted file mode 100644 index ebff66d8763a41be3eb075c252262e4fe86eaf88..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/file.make +++ /dev/null @@ -1,11 +0,0 @@ -core = 6.x -api = 2 - -libraries[drush_make][download][type] = "file" -libraries[drush_make][download][url] = "https://cgit.drupalcode.org/drush_make/plain/README.txt?h=6.x-3.x&id=8d4e770aeb1cfc180d48b76b70f9bf5ee250eade" -libraries[drush_make][download][filename] = "README.txt" - -; Single file download -libraries[responsiveslides][download][type] = "get" -libraries[responsiveslides][download][url] = "https://raw.github.com/viljamis/ResponsiveSlides.js/v1.54/responsiveslides.min.js" -libraries[responsiveslides][download][filename] = "responsiveslides.js" diff --git a/vendor/drush/drush/tests/makefiles/get.make b/vendor/drush/drush/tests/makefiles/get.make deleted file mode 100644 index 0fc20cec7a5b31fe15d3b294f4ea7d8e89d87709..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/get.make +++ /dev/null @@ -1,9 +0,0 @@ -core = 6.x -api = 2 - -; Tarball file download -libraries[drush_make][download][type] = file -libraries[drush_make][download][url] = http://ftp.drupal.org/files/projects/drush_make-6.x-2.0-beta8.tar.gz -libraries[drush_make][directory_name] = drush_make -libraries[drush_make][destination] = libraries -libraries[drush_make][lock] = Locked diff --git a/vendor/drush/drush/tests/makefiles/git-simple-8.make b/vendor/drush/drush/tests/makefiles/git-simple-8.make deleted file mode 100644 index 008b8302e6164bdcfff705a9fef9d89583044d49..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/git-simple-8.make +++ /dev/null @@ -1,5 +0,0 @@ -core = 8.x -api = 2 - -projects[honeypot][download][branch] = "8.x-1.x" -projects[honeypot][download][revision] = "419477a" diff --git a/vendor/drush/drush/tests/makefiles/git-simple.make b/vendor/drush/drush/tests/makefiles/git-simple.make deleted file mode 100644 index 3061d70fcdd4b5d5a0fc68feccf0d769eb030097..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/git-simple.make +++ /dev/null @@ -1,16 +0,0 @@ -core = 6.x -api = 2 - -; Test that make defaults to download type of git if any download -; parameters are present. -projects[cck_signup][download][revision] = "2fe932c" - -; Test that make defaults to download type of git if any download -; parameters are present. -projects[context_admin][download][revision] = "eb9f05e" - -; When branch is passed in addition to revision, .info file rewriting has better versioning. -projects[caption_filter][subdir] = "contrib" -projects[caption_filter][download][type] = "git" -projects[caption_filter][download][branch] = "7.x-1.x" -projects[caption_filter][download][revision] = "c9794cf" diff --git a/vendor/drush/drush/tests/makefiles/git.make b/vendor/drush/drush/tests/makefiles/git.make deleted file mode 100644 index 266f8fb4adf6f9ffec93c00c222e815d9917affc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/git.make +++ /dev/null @@ -1,31 +0,0 @@ -core = 6.x -api = 2 - -; Test that a specific tag can be pulled. -projects[tao][type] = theme -projects[tao][download][type] = git -projects[tao][download][tag] = 6.x-3.2 - -; Test that a branch can be pulled. We use a super-old "stale" branch in the -; Drupalbin project that we expect not to change. -projects[drupalbin][type] = profile -projects[drupalbin][download][type] = git -projects[drupalbin][download][branch] = 5.x-1.x - -; Test that a specific revision can be pulled. Note that provision is not -; actually a module. -projects[visitor][type] = module -projects[visitor][download][type] = git -projects[visitor][download][revision] = 5f256032cd4bcc2db45c962306d12c85131388ef - -; Test a non-Drupal.org repository. -projects[os_lightbox][type] = "module" -projects[os_lightbox][download][type] = "git" -projects[os_lightbox][download][url] = "https://github.com/opensourcery/os_lightbox.git" -projects[os_lightbox][download][revision] = "8d60090f2" - -; Test a refspec fetch. -projects[storypal][type] = module -projects[storypal][download][type] = git -projects[storypal][download][url] = https://git.drupal.org/project/storypal.git -projects[storypal][download][refspec] = refs/tags/7.x-1.0 diff --git a/vendor/drush/drush/tests/makefiles/gzip.make b/vendor/drush/drush/tests/makefiles/gzip.make deleted file mode 100644 index b5989f261ba536f018fc6335b238cc7686ca608f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/gzip.make +++ /dev/null @@ -1,10 +0,0 @@ -api = 2 -core = 6.x - -; getid3 doesn't contain a wrapper folder. All files are in the root of the archive. -libraries[getid3][destination] = libraries -libraries[getid3][download][type] = get -libraries[getid3][download][url] = "https://github.com/JamesHeinrich/getID3/archive/v1.9.8.zip" -libraries[getid3][directory_name] = getid3 -; http://drupal.org/node/1336886 -libraries[getid3][patch][] = "https://www.drupal.org/files/issues/1336886-11.patch" diff --git a/vendor/drush/drush/tests/makefiles/include.make b/vendor/drush/drush/tests/makefiles/include.make deleted file mode 100644 index 33ea8bd51d5509b4501d23151e235b3f622b75f5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/include.make +++ /dev/null @@ -1,12 +0,0 @@ -core = 6.x -api = 2 - -projects[drupal] = 6.17 -projects[eldorado_superfly][version] = 1.1 -includes[] = included.make - -; Final build should contain: -; - drupal 6.17 -; - token -; - cck 2.6 -; - eldorado_superfly 1.1 \ No newline at end of file diff --git a/vendor/drush/drush/tests/makefiles/include.make.yml b/vendor/drush/drush/tests/makefiles/include.make.yml deleted file mode 100644 index fdd259049e8982e5d3baf8e49d59191c527f8000..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/include.make.yml +++ /dev/null @@ -1,16 +0,0 @@ -core: 6.x -api: 2 - -projects: - drupal: "6.17" - eldorado_superfly: - version: "1.1" - -includes: - - included.make.yml - -# Final build should contain: -# - drupal 6.17 -# - token -# - cck 2.6 -# - eldorado_superfly 1.1 diff --git a/vendor/drush/drush/tests/makefiles/included.make b/vendor/drush/drush/tests/makefiles/included.make deleted file mode 100644 index 7d1c03092bfa7840ea3b3ed8102304eab4be909f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/included.make +++ /dev/null @@ -1,6 +0,0 @@ -core = 6.x -api = 2 - -projects[cck] = 2.6 -projects[token] = FALSE -includes[] = included2.make \ No newline at end of file diff --git a/vendor/drush/drush/tests/makefiles/included.make.yml b/vendor/drush/drush/tests/makefiles/included.make.yml deleted file mode 100644 index 6893810b837803a33de848d74f4a6b89a5b1d329..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/included.make.yml +++ /dev/null @@ -1,9 +0,0 @@ -core: 6.x -api: 2 - -projects: - cck: "2.6" - token: FALSE - -includes: - - included2.make.yml diff --git a/vendor/drush/drush/tests/makefiles/included2.make b/vendor/drush/drush/tests/makefiles/included2.make deleted file mode 100644 index c8532d2c43c4d2d4d5a0435d5bf65eddf4247c05..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/included2.make +++ /dev/null @@ -1,6 +0,0 @@ -core = 6.x -api = 2 - -projects[views] = 2.11 -projects[token] = 1.13 -projects[eldorado_superfly] = 1.0 \ No newline at end of file diff --git a/vendor/drush/drush/tests/makefiles/included2.make.yml b/vendor/drush/drush/tests/makefiles/included2.make.yml deleted file mode 100644 index 530e58feaadaa332deda396a30fde749d4122446..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/included2.make.yml +++ /dev/null @@ -1,7 +0,0 @@ -core: 6.x -api: 2 - -projects: - views: "2.11" - token: "1.13" - eldorado_superfly: "1.0" diff --git a/vendor/drush/drush/tests/makefiles/includes-main.make b/vendor/drush/drush/tests/makefiles/includes-main.make deleted file mode 100644 index a3d5902e80369891c49142d6e304e172d71ca00b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/includes-main.make +++ /dev/null @@ -1,14 +0,0 @@ -core = 7.x -api = 2 - -; Main makefile containing drupal core -includes[platform][makefile] = 'tests/makefiles/includes-platform.make' -includes[platform][download][type] = "git" -includes[platform][download][url] = "https://github.com/pmatias/drush.git" -includes[platform][download][branch] = "includes-git-support" - -; Sub platform makefile -includes[subplatform][makefile] = 'tests/makefiles/includes-sub-platform.make' -includes[subplatform][download][type] = "git" -includes[subplatform][download][url] = "https://github.com/pmatias/drush.git" -includes[subplatform][download][branch] = "includes-git-support" diff --git a/vendor/drush/drush/tests/makefiles/includes-platform.make b/vendor/drush/drush/tests/makefiles/includes-platform.make deleted file mode 100644 index c885c5b4b34a7d3060475070cdd5d03d471d0acf..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/includes-platform.make +++ /dev/null @@ -1,10 +0,0 @@ -api = 2 -core = 7.x - -; Drupal core -projects[drupal][type] = "core" -projects[drupal][version] = 7.34 - -; Contrib modules -projects[apachesolr][subdir] = "contrib" -projects[apachesolr][version] = "1.6" diff --git a/vendor/drush/drush/tests/makefiles/includes-sub-platform.make b/vendor/drush/drush/tests/makefiles/includes-sub-platform.make deleted file mode 100644 index 8e1f403e603fecc69b6c4b965b23ecef76cb8ce6..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/includes-sub-platform.make +++ /dev/null @@ -1,6 +0,0 @@ -api = 2 -core = 7.x - -; Contrib modules -projects[jquery_update][version] = "2.4" -projects[jquery_update][subdir] = "contrib" diff --git a/vendor/drush/drush/tests/makefiles/limited-projects-libraries.make b/vendor/drush/drush/tests/makefiles/limited-projects-libraries.make deleted file mode 100644 index 72a0f152514b82f613b73e5eb65ed69a1158ea65..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/limited-projects-libraries.make +++ /dev/null @@ -1,15 +0,0 @@ -core = "7.x" -api = 2 - -projects[boxes][version] = "1.0-beta7" - -projects[admin_menu][version] = "3.0-rc1" - -; Use drupal.org as a nice stable source of libraries. -libraries[drush_make][download][type] = "file" -libraries[drush_make][download][url] = "http://ftp.drupal.org/files/projects/drush_make-6.x-2.3.tar.gz" - -; Use drupal.org as a nice stable source of libraries. -libraries[token][download][type] = "file" -libraries[token][download][url] = "http://ftp.drupal.org/files/projects/token-7.x-1.0-rc1.tar.gz" - diff --git a/vendor/drush/drush/tests/makefiles/lock-default.make.yml b/vendor/drush/drush/tests/makefiles/lock-default.make.yml deleted file mode 100644 index 451742a98e432726188c3d6c2cdd68b740afeabf..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/lock-default.make.yml +++ /dev/null @@ -1,8 +0,0 @@ -api: 2 -core: 7 - -projects: - drupal: - version: 7.42 - atom: - version: ~ diff --git a/vendor/drush/drush/tests/makefiles/lock-git.make.yml b/vendor/drush/drush/tests/makefiles/lock-git.make.yml deleted file mode 100644 index 6608da0f94f30422ee8709eef8d9a78af670d297..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/lock-git.make.yml +++ /dev/null @@ -1,9 +0,0 @@ -api: 2 -core: 7 - -projects: - drupal: - version: 7.42 - atom: - download: - url: https://git.drupal.org/project/atom.git diff --git a/vendor/drush/drush/tests/makefiles/lockfiles/default.lock.yml b/vendor/drush/drush/tests/makefiles/lockfiles/default.lock.yml deleted file mode 100644 index a73bda0cae5e6488ee8c275141632e3cb4461ae4..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/lockfiles/default.lock.yml +++ /dev/null @@ -1,8 +0,0 @@ -core: 7.x -api: 2 -projects: - drupal: - version: '7.42' - type: core - atom: - version: 1.0-beta1 diff --git a/vendor/drush/drush/tests/makefiles/lockfiles/git.lock.yml b/vendor/drush/drush/tests/makefiles/lockfiles/git.lock.yml deleted file mode 100644 index 4f7d87d028be34a857dd7d92863cac4765820566..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/lockfiles/git.lock.yml +++ /dev/null @@ -1,12 +0,0 @@ -core: 7.x -api: 2 -projects: - drupal: - version: '7.42' - type: core - atom: - download: - url: 'https://git.drupal.org/project/atom.git' - type: git - branch: 7.x-1.x - revision: a9e05aa6e6c45641a0b56dbeb55ede35f51ae3e1 diff --git a/vendor/drush/drush/tests/makefiles/md5-fail.make b/vendor/drush/drush/tests/makefiles/md5-fail.make deleted file mode 100644 index dae44eb6f79f918227025e839193eea12abeaa63..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/md5-fail.make +++ /dev/null @@ -1,7 +0,0 @@ -core = 6.x -api = 2 - -libraries[drush_make][download][type] = "file" -libraries[drush_make][download][url] = "https://cgit.drupalcode.org/drush_make/plain/README.txt?h=6.x-3.x&id=8d4e770aeb1cfc180d48b76b70f9bf5ee250eade" -libraries[drush_make][download][filename] = "README.txt" -libraries[drush_make][download][md5] = "- fail -" diff --git a/vendor/drush/drush/tests/makefiles/md5-succeed.make b/vendor/drush/drush/tests/makefiles/md5-succeed.make deleted file mode 100644 index a10608bb4b3dab9c35366bec84e5d19f32637654..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/md5-succeed.make +++ /dev/null @@ -1,7 +0,0 @@ -core = 6.x -api = 2 - -libraries[drush_make][download][type] = "file" -libraries[drush_make][download][url] = "https://cgit.drupalcode.org/drush_make/plain/README.txt?h=6.x-3.x&id=8d4e770aeb1cfc180d48b76b70f9bf5ee250eade" -libraries[drush_make][download][filename] = "README.txt" -libraries[drush_make][download][md5] = "c8968d801a953b9ea735364d6f3dfabc" diff --git a/vendor/drush/drush/tests/makefiles/no-core.make b/vendor/drush/drush/tests/makefiles/no-core.make deleted file mode 100644 index 53dc627ff632aa545546dad4b4a5e9fc76b7e7cd..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/no-core.make +++ /dev/null @@ -1,3 +0,0 @@ -; A file that does not include the `core` attribute (as is possible for included .make files). -; ============================================================================================ -projects[foo][version] = 42 diff --git a/vendor/drush/drush/tests/makefiles/no-core.make.yml b/vendor/drush/drush/tests/makefiles/no-core.make.yml deleted file mode 100644 index 872223c057712340263bd26da9c0e7fe8e611892..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/no-core.make.yml +++ /dev/null @@ -1,5 +0,0 @@ -# A file that does not include the `core` attribute (as is possible for included .make files). -# ============================================================================================ -projects: - foo: - version: 42 diff --git a/vendor/drush/drush/tests/makefiles/options-array.make b/vendor/drush/drush/tests/makefiles/options-array.make deleted file mode 100644 index 7dc9258217fb81ce624fc035647ce28d1daf4a29..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/options-array.make +++ /dev/null @@ -1,15 +0,0 @@ -core = 6.x -api = 2 - -; Test that make preserves VCS directories. -options[working-copy] = TRUE -; Test that make does not require a Drupal core project. -options[no-core] = TRUE - -; Test that make defaults to download type of git if any download -; parameters are present. -projects[cck_signup][download][revision] = "2fe932c" - -; Test that make defaults to download type of git if any download -; parameters are present. -projects[context_admin][download][revision] = "eb9f05e" diff --git a/vendor/drush/drush/tests/makefiles/options-project.make b/vendor/drush/drush/tests/makefiles/options-project.make deleted file mode 100644 index 1726f76028a079de44a99330bd3ecd6c7152c035..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/options-project.make +++ /dev/null @@ -1,19 +0,0 @@ -core = 6.x -api = 2 - -; Test that revision passed in uses git to download project. -projects[context_admin][download][revision] = "eb9f05e" - -; Test that make preserves VCS directories. -projects[context_admin][options][working-copy] = TRUE - -; Test that make defaults to download type of git if any download -; parameters are present. -projects[cck_signup][download][revision] = "2fe932c" - -; When branch is passed in addition to revision, .info file rewriting has better versioning. -projects[caption_filter][subdir] = "contrib" -projects[caption_filter][download][type] = "git" -projects[caption_filter][download][branch] = "7.x-1.x" -projects[caption_filter][download][revision] = "c9794cf" -projects[caption_filter][options][working-copy] = TRUE diff --git a/vendor/drush/drush/tests/makefiles/patches-local-test-wysiwyg.patch b/vendor/drush/drush/tests/makefiles/patches-local-test-wysiwyg.patch deleted file mode 100644 index b6ef7316d2e6fc74d30dc76f6e2bfa8044f2a98e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/patches-local-test-wysiwyg.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/wysiwyg.module b/wysiwyg.module -index 771cbd7..647ac31 100644 ---- a/wysiwyg.module -+++ b/wysiwyg.module -@@ -112,6 +112,12 @@ function wysiwyg_theme() { - } - - /** -+ * This patch doesn't really do anything. It just adds a comment to -+ * wysiwyg.module so that we can test Drush Make's support of applying patches -+ * that are on the local filesystem. -+ */ -+ -+/** - * Implementation of hook_help(). - */ - function wysiwyg_help($path, $arg) { diff --git a/vendor/drush/drush/tests/makefiles/patches.make b/vendor/drush/drush/tests/makefiles/patches.make deleted file mode 100644 index 08c653c73e8268ff87b4760ce0d52cda1641fab7..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/patches.make +++ /dev/null @@ -1,19 +0,0 @@ -core = 7.x -api = 2 - -; Test that patches work -projects[wysiwyg][version] = "2.1" -; http://drupal.org/node/624018#comment-5098162 -projects[wysiwyg][patch][] = "http://drupal.org/files/0001-feature.inc-from-624018-211.patch" -; Test local filesystem patches -projects[wysiwyg][patch][] = "patches-local-test-wysiwyg.patch" - -; http://drupal.org/node/1152908#comment-5010536 -projects[features][version] = "1.0-beta4" -projects[features][patch][] = "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch" - -projects[context][version] = "3.0-beta2" -; http://drupal.org/node/1251406#comment-5020012 -projects[context][patch][] = "http://drupal.org/files/issues/custom_blocks_arent_editable-make.patch" -; http://drupal.org/node/661094#comment-4735064 -projects[context][patch][] = "http://drupal.org/files/issues/661094-context-permissions.patch" diff --git a/vendor/drush/drush/tests/makefiles/patches.make.yml b/vendor/drush/drush/tests/makefiles/patches.make.yml deleted file mode 100644 index 318d6e1f4e062c4ed97aa839f11f975347b31ed9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/patches.make.yml +++ /dev/null @@ -1,18 +0,0 @@ -core: 7.x -api: '2' -projects: - wysiwyg: - version: '2.1' - patch: - - 'http://drupal.org/files/0001-feature.inc-from-624018-211.patch' - - patches-local-test-wysiwyg.patch - features: - version: 1.0-beta4 - patch: - - 'http://drupal.org/files/issues/features-drush-backend-invoke-25.patch' - context: - version: 3.0-beta2 - patch: - - 'http://drupal.org/files/issues/custom_blocks_arent_editable-make.patch' - - 'http://drupal.org/files/issues/661094-context-permissions.patch' - diff --git a/vendor/drush/drush/tests/makefiles/qd-devel.make b/vendor/drush/drush/tests/makefiles/qd-devel.make deleted file mode 100644 index 8f193fb8d8c93b7c8b4143b17909d0031c0ad570..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/qd-devel.make +++ /dev/null @@ -1,6 +0,0 @@ -core = "7.x" -api = 2 - -projects[drupal][version] = "7.42" -defaults[projects][subdir] = "contrib" -projects[devel] = "1.3" diff --git a/vendor/drush/drush/tests/makefiles/recursion-override.make b/vendor/drush/drush/tests/makefiles/recursion-override.make deleted file mode 100644 index bfbb3116ee05204cd483ffa3f1fa896f4afd760d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/recursion-override.make +++ /dev/null @@ -1,9 +0,0 @@ -core = 7.x -api = 2 - -defaults[projects][subdir] = "contrib" - -; Custom formatters contains the library module v1, we want v2. -projects[libraries][version] = 2.1 - -projects[custom_formatters][version] = 2.2 diff --git a/vendor/drush/drush/tests/makefiles/recursion.make b/vendor/drush/drush/tests/makefiles/recursion.make deleted file mode 100644 index 8edabadd4085711dc6c88354a0877eeaf5f6cd30..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/recursion.make +++ /dev/null @@ -1,7 +0,0 @@ -core = 7.x -api = 2 - -projects[drupal_forum][type] = "profile" -projects[drupal_forum][version] = "1.0-alpha2" - -projects[views] = "3.0-rc3" diff --git a/vendor/drush/drush/tests/makefiles/subtree.make b/vendor/drush/drush/tests/makefiles/subtree.make deleted file mode 100644 index bfd7536ec808db9982ede9e6f86b0efbb8797ada..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/subtree.make +++ /dev/null @@ -1,15 +0,0 @@ -core = 6.x -api = 2 - -; nivo-slider2.7.1.zip contains Mac OS X metadata (a "__MACOSX/" folder) in addition to the desired content in the "nivo-slider/" folder. -; Using the "subtree" directive, we tell Drush Make we only want the "nivo-slider/" folder. -libraries[nivo-slider][download][type] = get -libraries[nivo-slider][download][url] = https://github.com/downloads/gilbitron/Nivo-Slider/nivo-slider2.7.1.zip -libraries[nivo-slider][download][sha1] = bd8e14b82f5b9c6f533a4e1aa26a790cd66c3cb9 -libraries[nivo-slider][download][subtree] = nivo-slider - -; Tell Drush Make we only want the "fullcalendar-1.5.3/fullcalendar/" folder. -libraries[fullcalendar][download][type] = get -libraries[fullcalendar][download][url] = https://github.com/arshaw/fullcalendar/releases/download/v1.5.3/fullcalendar-1.5.3.zip -libraries[fullcalendar][download][sha1] = c7219b1ddd2b11ccdbf83ebd116872affbc45d7a -libraries[fullcalendar][download][subtree] = fullcalendar-1.5.3/fullcalendar diff --git a/vendor/drush/drush/tests/makefiles/svn.make b/vendor/drush/drush/tests/makefiles/svn.make deleted file mode 100644 index 2e6952275f85ebcffc0dad60b8806d4bff595fa7..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/svn.make +++ /dev/null @@ -1,7 +0,0 @@ -core = 6.x -api = 2 - -; Test an SVN repo with revision flag. -libraries[flot][download][type] = svn -libraries[flot][download][url] = http://flot.googlecode.com/svn/trunk -libraries[flot][download][revision] = 10 diff --git a/vendor/drush/drush/tests/makefiles/translations-inside.make b/vendor/drush/drush/tests/makefiles/translations-inside.make deleted file mode 100644 index 1bdb8e1f14c7b57efd705f7baed58a237c924c8c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/translations-inside.make +++ /dev/null @@ -1,9 +0,0 @@ -core = 6.x -api = 2 - -translations[] = es -translations[] = pt-br - -projects[drupal][version] = "6.22" -projects[token][version] = "1.18" - diff --git a/vendor/drush/drush/tests/makefiles/translations-inside7.make b/vendor/drush/drush/tests/makefiles/translations-inside7.make deleted file mode 100644 index a0298dbcf5b42d5fd139bbe5308f0da2da2efdb0..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/translations-inside7.make +++ /dev/null @@ -1,9 +0,0 @@ -core = 7.x -api = 2 - -translations[] = es -translations[] = pt-br - -projects[drupal][version] = "7.10" -projects[token][version] = "1.0-beta7" - diff --git a/vendor/drush/drush/tests/makefiles/translations.make b/vendor/drush/drush/tests/makefiles/translations.make deleted file mode 100644 index 6ae114eb1c92507942e68816f7cdf226f0d4030b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/translations.make +++ /dev/null @@ -1,6 +0,0 @@ -core = 6.x -api = 2 - -projects[token][version] = "1.18" - -; @TODO: Add a project that uses a custom l10n_server diff --git a/vendor/drush/drush/tests/makefiles/use-distribution-as-core.make b/vendor/drush/drush/tests/makefiles/use-distribution-as-core.make deleted file mode 100644 index 489c520f3aca744059278ea11ffbdc3e0952c276..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/makefiles/use-distribution-as-core.make +++ /dev/null @@ -1,7 +0,0 @@ -api = 2 -core = 7.x - -projects[commerce_kickstart][type] = core -projects[commerce_kickstart][version] = "7.x-1.19" -projects[oauth2_server][type] = module -projects[oauth2_server][version] = "1.0-beta2" diff --git a/vendor/drush/drush/tests/outputFormatUnitTest.php b/vendor/drush/drush/tests/outputFormatUnitTest.php deleted file mode 100644 index b6055cc14d6986a9ecb11066b3982ecf6f3f73d5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/outputFormatUnitTest.php +++ /dev/null @@ -1,166 +0,0 @@ -<?php - -/** - * @file - * Tests for outputformat.drush.inc - */ - -namespace Unish; - -class outputFormatUnitCase extends UnitUnishTestCase { - -/** - * Test various output formats using php-eval with no Drupal site. - * - * @dataProvider provider - **/ - public function testOutputFormat($name, $format, $data, $expected) { - drush_preflight(); - $this->assertEquals($expected, trim(drush_format($data, array(), $format)), $name . ': '. $format); - } - - public function provider() { - $json = '{"a":{"b":2,"c":3},"d":{"e":5,"f":6}}'; - if (version_compare(phpversion(), '5.4.0', '>=')) { - $json = json_encode(json_decode($json), JSON_PRETTY_PRINT); - } - - return array( - array( - 'name' => 'String test', - 'format' => 'string', - 'data' => array('drush version' => '6.0-dev'), - 'expected' => '6.0-dev', - ), - array( - 'name' => 'List test', - 'format' => 'list', - 'data' => array('drush version' => '6.0-dev'), - 'expected' => '6.0-dev', - ), - array( - 'name' => 'Key-value test', - 'format' => 'key-value', - 'data' => array('drush version' => '6.0-dev'), - 'expected' => 'drush version : 6.0-dev', - ), -// array( -// 'name' => 'Table test', -// 'format' => 'table', -// 'data' => array( -// 'a' => array('b' => 2, 'c' => 3), -// 'd' => array('b' => 5, 'c' => 6), -// ), -// 'expected' => "b c -// 2 3 -// 5 6", -// ), - array( - 'name' => 'print-r test', - 'format' => 'print-r', - 'data' => array( - 'a' => array('b' => 2, 'c' => 3), - 'd' => array('b' => 5, 'c' => 6), - ), - 'expected' => "Array -( - [a] => Array - ( - [b] => 2 - [c] => 3 - ) - - [d] => Array - ( - [b] => 5 - [c] => 6 - ) - -)", - ), - array( - 'name' => 'json test', - 'format' => 'json', - 'data' => array( - 'a' => array('b' => 2, 'c' => 3), - 'd' => array('e' => 5, 'f' => 6), - ), - 'expected' => $json, - ), -// array( -// 'name' => 'key-value test 1d array', -// 'format' => 'key-value', -// 'data' => array( -// 'b' => 'Two B or ! Two B, that is the comparison', -// 'c' => 'I see that C has gone to Sea', -// ), -// 'expected' => "b : Two B or ! Two B, that is the comparison -// c : I see that C has gone to Sea", -// ), -// array( -// 'name' => 'key-value test 2d array', -// 'format' => 'key-value', -// 'data' => array( -// 'a' => array( -// 'b' => 'Two B or ! Two B, that is the comparison', -// 'c' => 'I see that C has gone to Sea', -// ), -// 'd' => array( -// 'e' => 'Elephants and electron microscopes', -// 'f' => 'My margin is too small', -// ) -// ), -// 'expected' => "a : Two B or ! Two B, that is the comparison -// I see that C has gone to Sea -// d : Elephants and electron microscopes -// My margin is too small", -// ), - array( - 'name' => 'export test', - 'format' => 'var_export', - 'data' => array( - 'a' => array('b' => 2, 'c' => 3), - 'd' => array('e' => 5, 'f' => 6), - ), - 'expected' => "array( - 'a' => array( - 'b' => 2, - 'c' => 3, - ), - 'd' => array( - 'e' => 5, - 'f' => 6, - ), -)", - ), -// array( -// 'name' => 'config test', -// 'format' => 'config', -// 'data' => array( -// 'a' => array('b' => 2, 'c' => 3), -// 'd' => array('e' => 5, 'f' => 6), -// ), -// 'expected' => "\$config[\"a\"] = array ( -// 'b' => 2, -// 'c' => 3, -//); -//\$config[\"d\"] = array ( -// 'e' => 5, -// 'f' => 6, -//);", -// ), - array( - 'name' => 'variables test', - 'format' => 'variables', - 'data' => array( - 'a' => array('b' => 2, 'c' => 3), - 'd' => array('e' => 5, 'f' => 6), - ), - 'expected' => "\$a[\"b\"] = 2; -\$a[\"c\"] = 3; -\$d[\"e\"] = 5; -\$d[\"f\"] = 6;", - ), - ); - } -} diff --git a/vendor/drush/drush/tests/phpunit.xml.dist b/vendor/drush/drush/tests/phpunit.xml.dist deleted file mode 100644 index e9869d14bb4bf9f89b335611416b8646a159662a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/phpunit.xml.dist +++ /dev/null @@ -1,40 +0,0 @@ -<!-- Copy and rename to phpunit.xml. Customize as needed. --> -<phpunit backupGlobals="false" - backupStaticAttributes="false" - syntaxCheck="false" - bootstrap="bootstrap.inc" - colors="true"> - <testsuites> - <testsuite name="Drush Test Suite"> - <directory>.</directory> - </testsuite> - </testsuites> - - <php> - <!-- These variables may alternatively be set as environment variables. --> - - <!-- Drupal major version to run tests over --> - <!-- <var name="UNISH_DRUPAL_MAJOR_VERSION" value="8"/> --> - - <!--Uncomment and edit one of the lines below depending on DB platform.--> - <!--DB User must have create/drop permissions--> - <!-- <var name="UNISH_DB_URL" value="mysql://root:@127.0.0.1"/> --> - <!-- <var name="UNISH_DB_URL" value="pgsql://postgres:@localhost"/>--> - <!-- <var name="UNISH_DB_URL" value="sqlite://none/of/this/matters"/> --> - - <!--User must have write permissions to this directory.--> - <!--If not supplied, defaults to sys_get_temp_dir().--> - <!-- <var name="UNISH_TMP" value="/tmp"/> --> - - <!--Uncomment the line below if your path to drush differs from `which drush`. Use absolute path.--> - <!--<var name="UNISH_DRUSH" value="/Users/mw/bin/drush"/>--> - - <!--Uncomment to provide a group the user running the tests belong to. This is needed for some filesystem tests. --> - <!--<var name="UNISH_USERGROUP" value="staff"/>--> - - <!-- Uncomment to disable the total runtime and output timeouts for commands run through CommandUnishTestCase::execute(). --> - <!-- <env name="UNISH_NO_TIMEOUTS" value="y"/> --> - - <includePath>.</includePath> - </php> -</phpunit> diff --git a/vendor/drush/drush/tests/pmDownloadTest.php b/vendor/drush/drush/tests/pmDownloadTest.php deleted file mode 100644 index 431ed51b60faec4efb8913980a38e435df6eadd9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/pmDownloadTest.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group pm - */ -class pmDownloadCase extends CommandUnishTestCase { - public function testPmDownload() { - $this->drush('pm-download', array('devel'), array('cache' => NULL, 'skip' => NULL)); // No FirePHP - $this->assertFileExists(UNISH_SANDBOX . '/devel/README.txt'); - - $this->drush('pm-download', array('drupal-7.500'), array('backend' => NULL), NULL, NULL, self::EXIT_ERROR); - $parsed = $this->parse_backend_output($this->getOutput()); - $this->assertArrayHasKey('DRUSH_PM_COULD_NOT_FIND_VERSION', $parsed['error_log']); - } - - // @todo Test pure drush commandfile projects. They get special destination. - public function testDestination() { - // Setup two Drupal sites. Skip install for speed. - $sites = $this->setUpDrupal(2, FALSE); - $uri = key($sites); - $root = $this->webroot(); - - // Common options for the invocations below. - $devel_options = array( - 'cache' => NULL, - 'skip' => NULL, // No FirePHP - 'strict' => 0, // Invoke from script: do not verify options - ); - - // Default to Drupal sitewide directory. - $options = array( - 'root' => $root, - 'uri' => $uri, - ) + $devel_options; - $this->drush('pm-download', array('devel'), $options); - $this->assertFileExists($root . '/' . $this->drupalSitewideDirectory() . '/modules/devel/README.txt'); - - // --use-site-dir - // Expand above $options. - $options += array('use-site-dir' => NULL); - $this->drush('pm-download', array('devel'), $options); - $this->assertFileExists("$root/sites/$uri/modules/devel/README.txt"); - unish_file_delete_recursive("{$root}/sites/{$uri}/modules/devel", TRUE); - - // If we are in site specific dir, then download belongs there. - $path_stage = "$root/sites/$uri"; - // dir gets created by --use-site-dir above, - $options = $devel_options; - $this->drush('pm-download', array('devel'), $options, NULL, $path_stage); - $this->assertFileExists($path_stage . '/modules/devel/README.txt'); - - // --destination with absolute path. - $destination = UNISH_SANDBOX . '/test-destination1'; - mkdir($destination); - $options = array( - 'destination' => $destination, - ) + $devel_options; - $this->drush('pm-download', array('devel'), $options); - $this->assertFileExists($destination . '/devel/README.txt'); - - // --destination with a relative path. - $destination = 'test-destination2'; - mkdir(UNISH_SANDBOX . '/' . $destination); - $options = array( - 'destination' => $destination, - ) + $devel_options; - $this->drush('pm-download', array('devel'), $options); - $this->assertFileExists(UNISH_SANDBOX . '/' . $destination . '/devel/README.txt'); - } - - public function testSelect() { - $options = array( - 'select' => NULL, - 'choice' => 0, // Cancel. - ); - // --select. Specify 6.x since that has so many releases. - $this->drush('pm-download', array('devel-6.x'), $options, NULL, NULL, CommandUnishTestCase::UNISH_EXITCODE_USER_ABORT); - $items = $this->getOutputAsList(); - $output = $this->getOutput(); - // 4 items are: Select message + Cancel + 2 versions. - $this->assertEquals(4, count($items), '--select offerred 2 options.'); - $this->assertContains('6.x-1.x-dev', $output, 'Dev release was shown by --select.'); - - // --select --dev. Specify 6.x since that has so many releases. - $this->drush('pm-download', array('devel-6.x'), $options + array('dev' => NULL), NULL, NULL, CommandUnishTestCase::UNISH_EXITCODE_USER_ABORT); - $items = $this->getOutputAsList(); - $output = $this->getOutput(); - // 12 items are: Select message + Cancel + 1 option. - $this->assertEquals(3, count($items), '--select --dev expected to offer only one option.'); - $this->assertContains('6.x-1.x-dev', $output, 'Assure that --dev lists the only dev release.'); - - // --select --all. Specify 5.x since this is frozen. - $this->drush('pm-download', array('devel-5.x'), $options + array('all' => NULL), NULL, NULL, CommandUnishTestCase::UNISH_EXITCODE_USER_ABORT); - $items = $this->getOutputAsList(); - $output = $this->getOutput(); - // 12 items are: Select message + Cancel + 9 options. - $this->assertEquals(11, count($items), '--select --all offerred 8 options.'); - $this->assertContains('5.x-0.1', $output, 'Assure that --all lists very old releases.'); - } - - public function testPackageHandler() { - $options = array( - 'cache' => NULL, - 'package-handler' => 'git_drupalorg', - 'yes' => NULL, - ); - $this->drush('pm-download', array('devel'), $options); - $this->assertFileExists(UNISH_SANDBOX . '/devel/README.txt'); - $this->assertFileExists(UNISH_SANDBOX . '/devel/.git'); - } -} diff --git a/vendor/drush/drush/tests/pmEnDisUnListInfoTest.php b/vendor/drush/drush/tests/pmEnDisUnListInfoTest.php deleted file mode 100644 index e0278245e62e99292dc8e6a9fb05cecfefe9f5dd..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/pmEnDisUnListInfoTest.php +++ /dev/null @@ -1,135 +0,0 @@ -<?php - -/** - * @file - * Tests for enable, disable, uninstall, pm-list commands. - */ - -namespace Unish; - -/** - * @group slow - * @group pm - */ -class EnDisUnListInfoCase extends CommandUnishTestCase { - - public function testEnDisUnList() { - $sites = $this->setUpDrupal(1, TRUE); - $options_no_pipe = array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - 'cache' => NULL, - 'skip' => NULL, // No FirePHP - 'strict' => 0, // Don't validate options - ); - $options = $options_no_pipe + array( - 'pipe' => NULL, - ); - - // Test pm-download downloads a module and pm-list lists it. - $this->drush('pm-download', array('devel'), $options); - $this->drush('pm-list', array(), $options + array('no-core' => NULL, 'status' => 'disabled,not installed')); - $out = $this->getOutput(); - $list = $this->getOutputAsList(); - $this->assertTrue(in_array('devel', $list)); - - // Test pm-enable enables a module and shows the permissions it provides. - $this->drush('pm-enable', array('devel'), $options_no_pipe); - $output = $this->getOutput(); - $this->assertContains('access devel information', $output); - - // Test pm-list shows the module as enabled. - $this->drush('pm-list', array(), $options + array('status' => 'enabled')); - $list = $this->getOutputAsList(); - $this->assertTrue(in_array('devel', $list)); - - // Test pm-info shows some module info. - $this->drush('pm-info', array('devel'), $options); - $output = $this->getOutputFromJSON('devel'); - $expected = array( - 'extension' => 'devel', - 'project' => 'devel', - 'type' => 'module', - 'title' => 'Devel', - 'status' => 'enabled', - ); - foreach ($expected as $key => $value) { - $this->assertEquals($output->{$key}, $value); - } - - // Test pm-projectinfo shows some project info. - $this->drush('pm-projectinfo', array('devel'), $options); - $output = $this->getOutputFromJSON('devel'); - $expected = array( - 'label' => 'Devel (devel)', - 'type' => 'module', - 'status' => '1', - ); - foreach ($expected as $key => $value) { - $this->assertEquals($output->{$key}, $value); - } - - // Test the testing install profile theme is installed. - $themeToCheck = UNISH_DRUPAL_MAJOR_VERSION >= 8 ? 'classy' : (UNISH_DRUPAL_MAJOR_VERSION == 7 ? 'bartik' : 'garland'); - $this->assertTrue(in_array($themeToCheck, $list), 'Themes are in the pm-list'); - - // Test cache was cleared after enabling a module. - $table = UNISH_DRUPAL_MAJOR_VERSION >= 8 ? 'router' : 'menu_router'; - $path = UNISH_DRUPAL_MAJOR_VERSION >= 8 ? '/admin/config/development/devel' : (UNISH_DRUPAL_MAJOR_VERSION == 7 ? 'devel/settings' : 'admin/settings/devel'); - $this->drush('sql-query', array("SELECT path FROM $table WHERE path = '$path';"), array('root' => $this->webroot(), 'uri' => key($sites))); - $list = $this->getOutputAsList(); - $this->assertTrue(in_array($path, $list), 'Cache was cleared after modules were enabled'); - - // Test pm-list filtering. - $this->drush('pm-list', array(), $options + array('package' => 'Core')); - $list = $this->getOutputAsList(); - $this->assertFalse(in_array('devel', $list), 'Devel is not part of core package'); - - // Test module disabling. - if (UNISH_DRUPAL_MAJOR_VERSION <= 7) { - $this->drush('pm-disable', array('devel'), $options); - $this->drush('pm-list', array(), $options + array('status' => 'disabled')); - $list = $this->getOutputAsList(); - $this->assertTrue(in_array('devel', $list)); - } - - // Test module uninstall. - $this->drush('pm-uninstall', array('devel'), $options); - $this->drush('pm-list', array(), $options + array('status' => 'not installed', 'type' => 'module')); - $list = $this->getOutputAsList(); - $this->assertTrue(in_array('devel', $list)); - - // Test pm-enable is able to download dependencies. - // @todo pathauto has no usable D8 release yet. - // Also, Drupal 6 has no stable releases any longer, so resolve-dependencies are inconvenient to test. - if (UNISH_DRUPAL_MAJOR_VERSION ==7) { - $this->drush('pm-download', array('pathauto'), $options); - $this->drush('pm-enable', array('pathauto'), $options + array('resolve-dependencies' => TRUE)); - $this->drush('pm-list', array(), $options + array('status' => 'enabled')); - $list = $this->getOutputAsList(); - $this->assertTrue(in_array('token', $list)); - } - - if (UNISH_DRUPAL_MAJOR_VERSION !=6) { - if (substr(UNISH_DRUPAL_MINOR_VERSION, 0, 2) == '.4') { - $this->markTestSkipped("panels module broken with Drupal 8.4.x"); - } - // Test that pm-enable downloads missing projects and dependencies. - $this->drush('pm-enable', array('panels'), $options + array('resolve-dependencies' => TRUE)); - $this->drush('pm-list', array(), $options + array('status' => 'enabled')); - $list = $this->getOutputAsList(); - $this->assertTrue(in_array('ctools', $list)); - } - - // Test that pm-enable downloads missing projects - // and dependencies with project namespace (date:date_popup). - if (UNISH_DRUPAL_MAJOR_VERSION == 7) { - $this->drush('pm-enable', array('date_datepicker_inline'), $options + array('resolve-dependencies' => TRUE)); - $this->drush('pm-list', array(), $options + array('status' => 'enabled')); - $list = $this->getOutputAsList(); - $this->assertTrue(in_array('date_popup', $list)); - } - - } -} diff --git a/vendor/drush/drush/tests/pmReleaseNotesTest.php b/vendor/drush/drush/tests/pmReleaseNotesTest.php deleted file mode 100644 index cf3972a56b9f93173987ee438612a1e7b9629a1e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/pmReleaseNotesTest.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group pm - */ -class pmReleaseNotesCase extends CommandUnishTestCase { - - /** - * Tests for pm-releasenotes command. - */ - public function testReleaseNotes() { - $this->drush('pm-releasenotes', array('drupal-7.1')); - $output = $this->getOutput(); - $this->assertContains("RELEASE NOTES FOR 'DRUPAL' PROJECT, VERSION 7.1", $output); - $this->assertContains('SA-CORE-2011-001 - Drupal core - Multiple vulnerabilities', $output); - } -} - diff --git a/vendor/drush/drush/tests/pmRequestTest.php b/vendor/drush/drush/tests/pmRequestTest.php deleted file mode 100644 index af3e6eca0c3801788e8a8788d93a3897d99ddb84..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/pmRequestTest.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group pm - */ -class pmRequestCase extends CommandUnishTestCase { - - /** - * Tests for pm_parse_version() on a bootstrapped site. - */ - public function testVersionParser() { - // Setup a Drupal site. Skip install for speed. - $sites = $this->setUpDrupal(1, FALSE); - $uri = key($sites); - $root = $this->webroot(); - - $drupal_version = UNISH_DRUPAL_MAJOR_VERSION; - - // Common options for below commands. - $options = array( - 'root' => $root, - 'uri' => $uri, - 'format' => 'yaml', - ); - - // Tests for core versions. - $is_core = 1; - - $version = ''; - $expected = <<<EXPECTED -version: '' -drupal_version: ${drupal_version}.x -project_version: '' -version_major: ${drupal_version} -version_minor: '' -version_patch: '' -version_extra: '' -version_offset: '' -EXPECTED; - $this->drush('php-eval', array("return pm_parse_version('${version}', ${is_core})"), $options); - $this->assertEquals($expected, $this->getOutput(), 'Core version not provided. Pick version of the bootstrapped site.'); - - $version = '5'; - $expected = <<<EXPECTED -version: '' -drupal_version: 5.x -project_version: '' -version_major: '5' -version_minor: '' -version_patch: '' -version_extra: '' -version_offset: '' -EXPECTED; - $this->drush('php-eval', array("return pm_parse_version('${version}', ${is_core})"), $options); - $this->assertEquals($expected, $this->getOutput(), 'Core version provided.'); - - // Tests for non-core versions. - $is_core = 0; - - $version = ''; - $expected = <<<EXPECTED -version: '' -drupal_version: ${drupal_version}.x -project_version: '' -version_major: ${drupal_version} -version_minor: '' -version_patch: '' -version_extra: '' -version_offset: '' -EXPECTED; - $this->drush('php-eval', array("return pm_parse_version('${version}', ${is_core})"), $options); - $this->assertEquals($expected, $this->getOutput(), 'Project version not provided. Pick version of the bootstrapped site.'); - - $version = '1.0'; - $expected = <<<EXPECTED -version: ${drupal_version}.x-1.0 -drupal_version: ${drupal_version}.x -project_version: '1.0' -version_major: '1' -version_minor: '' -version_patch: '0' -version_extra: '' -version_offset: '' -EXPECTED; - $this->drush('php-eval', array("return pm_parse_version('${version}')"), $options); - $this->assertEquals($expected, $this->getOutput()); - - $version = '1.x'; - $expected = <<<EXPECTED -version: ${drupal_version}.x-1.x-dev -drupal_version: ${drupal_version}.x -project_version: 1.x-dev -version_major: '1' -version_minor: '' -version_patch: '' -version_extra: dev -version_offset: '' -EXPECTED; - $this->drush('php-eval', array("return pm_parse_version('${version}')"), $options); - $this->assertEquals($expected, $this->getOutput()); - } -} diff --git a/vendor/drush/drush/tests/pmRequestUnitTest.php b/vendor/drush/drush/tests/pmRequestUnitTest.php deleted file mode 100644 index d68076704471d598592eaf5377cc8c10f20471d9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/pmRequestUnitTest.php +++ /dev/null @@ -1,266 +0,0 @@ -<?php - -/** - * @file - * Tests for pm parsers. - */ - -namespace Unish; - -/** - * pm testing - * - * @group pm - */ -class pmRequestUnitCase extends UnitUnishTestCase { - - /** - * Tests for pm_parse_version() with semantic versioning. - */ - public function testVersionParserCoreSemVer() { - _drush_add_commandfiles(array(DRUSH_BASE_PATH . '/commands/pm')); - - drush_set_option('default-major', UNISH_DRUPAL_MAJOR_VERSION); - - $version = '8.0.0-beta2'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('8.0.0-beta2', $version_parts['version']); - $this->assertEquals('8.x', $version_parts['drupal_version']); - $this->assertEquals('8', $version_parts['version_major']); - $this->assertEquals('0', $version_parts['version_minor']); - $this->assertEquals('0', $version_parts['version_patch']); - $this->assertEquals('beta2', $version_parts['version_extra']); - $this->assertEquals('8.0.0-beta2', $version_parts['project_version']); - - $version = '8.0.x-dev'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('8.0.x-dev', $version_parts['version']); - $this->assertEquals('8.x', $version_parts['drupal_version']); - $this->assertEquals('8', $version_parts['version_major']); - $this->assertEquals('0', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('dev', $version_parts['version_extra']); - $this->assertEquals('8.0.x-dev', $version_parts['project_version']); - - $version = '8.0.0-beta3+252-dev'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('8.0.0-beta3+252-dev', $version_parts['version']); - $this->assertEquals('8.x', $version_parts['drupal_version']); - $this->assertEquals('8', $version_parts['version_major']); - $this->assertEquals('0', $version_parts['version_minor']); - $this->assertEquals('0', $version_parts['version_patch']); - $this->assertEquals('beta3', $version_parts['version_extra']); - $this->assertEquals('252', $version_parts['version_offset']); - $this->assertEquals('8.0.0-beta3+252-dev', $version_parts['project_version']); - - $version = '8.1.x'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('8.1.x-dev', $version_parts['version']); - $this->assertEquals('8.x', $version_parts['drupal_version']); - $this->assertEquals('8', $version_parts['version_major']); - $this->assertEquals('1', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('dev', $version_parts['version_extra']); - $this->assertEquals('8.1.x-dev', $version_parts['project_version']); - - $version = '8.0.1'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('8.0.1', $version_parts['version']); - $this->assertEquals('8.x', $version_parts['drupal_version']); - $this->assertEquals('8', $version_parts['version_major']); - $this->assertEquals('0', $version_parts['version_minor']); - $this->assertEquals('1', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('8.0.1', $version_parts['project_version']); - } - - /** - * Tests for pm_parse_version() with drupal version scheme for core. - */ - public function testVersionParserCore() { - _drush_add_commandfiles(array(DRUSH_BASE_PATH . '/commands/pm')); - - drush_set_option('default-major', UNISH_DRUPAL_MAJOR_VERSION); - - $version = ''; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('', $version_parts['version']); - $this->assertEquals(UNISH_DRUPAL_MAJOR_VERSION . '.x', $version_parts['drupal_version']); - $this->assertEquals(UNISH_DRUPAL_MAJOR_VERSION, $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('', $version_parts['project_version']); - - // We use version 5 in these tests to avoid false positives from - // pm_parse_version(), in case it was picking drush's default-major. - - $version = '5'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('', $version_parts['version']); - $this->assertEquals('5.x', $version_parts['drupal_version']); - $this->assertEquals('', $version_parts['project_version']); - $this->assertEquals('5', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - - $version = '5.x'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('5.x-dev', $version_parts['version']); - $this->assertEquals('5.x', $version_parts['drupal_version']); - $this->assertEquals('5', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('dev', $version_parts['version_extra']); - $this->assertEquals('5.x-dev', $version_parts['project_version']); - - $version = '5.x-dev'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('5.x-dev', $version_parts['version']); - $this->assertEquals('5.x', $version_parts['drupal_version']); - $this->assertEquals('5', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('dev', $version_parts['version_extra']); - $this->assertEquals('5.x-dev', $version_parts['project_version']); - - $version = '5.0'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('5.0', $version_parts['version']); - $this->assertEquals('5.x', $version_parts['drupal_version']); - $this->assertEquals('5', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('0', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('5.0', $version_parts['project_version']); - - $version = '5.0-beta1'; - $version_parts = pm_parse_version($version, TRUE); - $this->assertEquals('5.0-beta1', $version_parts['version']); - $this->assertEquals('5.x', $version_parts['drupal_version']); - $this->assertEquals('5', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('0', $version_parts['version_patch']); - $this->assertEquals('beta1', $version_parts['version_extra']); - $this->assertEquals('5.0-beta1', $version_parts['project_version']); - } - - /** - * Tests for pm_parse_version() with project versions. - */ - public function testVersionParserContrib() { - _drush_add_commandfiles(array(DRUSH_BASE_PATH . '/commands/pm')); - - drush_set_option('default-major', UNISH_DRUPAL_MAJOR_VERSION); - - $version = ''; - $version_parts = pm_parse_version($version); - $this->assertEquals('', $version_parts['version']); - $this->assertEquals(UNISH_DRUPAL_MAJOR_VERSION . '.x', $version_parts['drupal_version']); - $this->assertEquals('', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('', $version_parts['project_version']); - - $version = '7'; - $version_parts = pm_parse_version($version); - $this->assertEquals('', $version_parts['version']); - $this->assertEquals('7.x', $version_parts['drupal_version']); - $this->assertEquals('', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('', $version_parts['project_version']); - - $version = '7.x'; - $version_parts = pm_parse_version($version); - $this->assertEquals('', $version_parts['version']); - $this->assertEquals('7.x', $version_parts['drupal_version']); - $this->assertEquals('', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('', $version_parts['project_version']); - - $version = '7.x-1.0-beta1'; - $version_parts = pm_parse_version($version); - $this->assertEquals('7.x', $version_parts['drupal_version']); - $this->assertEquals('1', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('0', $version_parts['version_patch']); - $this->assertEquals('beta1', $version_parts['version_extra']); - $this->assertEquals('1.0-beta1', $version_parts['project_version']); - - $version = '7.x-1.0-beta1+30-dev'; - $version_parts = pm_parse_version($version); - $this->assertEquals('7.x', $version_parts['drupal_version']); - $this->assertEquals('1', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('0', $version_parts['version_patch']); - $this->assertEquals('beta1', $version_parts['version_extra']); - $this->assertEquals('30', $version_parts['version_offset']); - $this->assertEquals('1.0-beta1+30-dev', $version_parts['project_version']); - - $version = '7.x-1.0'; - $version_parts = pm_parse_version($version); - $this->assertEquals('7.x', $version_parts['drupal_version']); - $this->assertEquals('1', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('0', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('1.0', $version_parts['project_version']); - - $version = '7.x-1.0+30-dev'; - $version_parts = pm_parse_version($version); - $this->assertEquals('7.x', $version_parts['drupal_version']); - $this->assertEquals('1', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('0', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('30', $version_parts['version_offset']); - $this->assertEquals('1.0+30-dev', $version_parts['project_version']); - - // Since we're not on a bootstrapped site, the version string - // for the following cases is interpreted as a core version. - // Tests on a bootstrapped site are in \pmRequestCase::testVersionParser() - $version = '6.x'; - $version_parts = pm_parse_version($version); - $this->assertEquals('6.x', $version_parts['drupal_version']); - $this->assertEquals('', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('', $version_parts['project_version']); - - $version = '6.22'; - $version_parts = pm_parse_version($version); - $this->assertEquals('6.x', $version_parts['drupal_version']); - $this->assertEquals('', $version_parts['version_major']); - $this->assertEquals('', $version_parts['version_minor']); - $this->assertEquals('', $version_parts['version_patch']); - $this->assertEquals('', $version_parts['version_extra']); - $this->assertEquals('', $version_parts['project_version']); - } - - /** - * Tests for pm_parse_request(). - */ - public function testRequestParser() { - $request = 'devel-7.x-1.2'; - $request = pm_parse_request($request); - $this->assertEquals('devel', $request['name']); - $this->assertEquals('7.x-1.2', $request['version']); - - $request = 'field-conditional-state'; - $request = pm_parse_request($request); - $this->assertEquals('field-conditional-state', $request['name']); - $this->assertEquals('', $request['version']); - - $request = 'field-conditional-state-7.x-1.2'; - $request = pm_parse_request($request); - $this->assertEquals('field-conditional-state', $request['name']); - $this->assertEquals('7.x-1.2', $request['version']); - } -} diff --git a/vendor/drush/drush/tests/pmUpdateCodeTest.php b/vendor/drush/drush/tests/pmUpdateCodeTest.php deleted file mode 100644 index 84a141efcab4787d47c5ca9a5bb5208411966da2..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/pmUpdateCodeTest.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -/** - * @file - * Prepare a codebase and upgrade it in several stages, exercising - * updatecode's filters. - */ - -namespace Unish; - -/** - * @group slow - * @group pm - */ -class pmUpdateCode extends CommandUnishTestCase { - - /* - * An array of modules to be downloaded and enabled. - */ - public $modules; - - private function getPreviousStable($project) { - // Call drush pm-releases and get the output - $this->drush('pm-releases', array($project), array('all' => NULL, 'fields' => 'Release')); - $list = $this->getOutputAsList(); - // Line 0 is "Release" - // Line 1 is "...-dev" - // Line 2 is "...-dev" - // Line 3 is "...-dev" - // Line 4 is current best release - // Line 5 is the previous release - return trim($list[5]); - } - - /** - * Download old core and older contrib releases which will always need updating. - */ - public function setUp() { - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - // Make sure that we can still update from the previous release - // to the current release. - $core = $this->getPreviousStable("drupal-8"); - $modules_str = 'unish-8.x-1.2,honeypot-8.x-1.19-beta14'; - $this->modules = array('block', 'unish', 'honeypot'); - } - elseif (UNISH_DRUPAL_MAJOR_VERSION == 7) { - $core = '7.0-rc3'; - $modules_str = 'devel-7.x-1.0-rc1,webform-7.x-3.4-beta1'; - $this->modules = array('menu', 'devel', 'webform'); - } - else { - $this->markTestSkipped("pm-update* no longer supported with Drupal 6; drupal.org does not allow stable releases for Drupal 6 contrib modules."); - } - - $sites = $this->setUpDrupal(1, TRUE, $core); - $options = array( - 'root' => $this->webroot(), - 'uri' => key($sites), - 'yes' => NULL, - 'quiet' => NULL, - 'cache' => NULL, - 'skip' => NULL, // No FirePHP - 'strict' => 0, - ); - - $this->drush('pm-download', array($modules_str), $options); - $this->drush('pm-enable', $this->modules, $options); - } - - function testUpdateCode() { - if (UNISH_DRUPAL_MAJOR_VERSION < 7) { - $this->markTestSkipped("pm-update does not work once Drupal core reaches EOL."); - } - $extension = UNISH_DRUPAL_MAJOR_VERSION == 8 ? '.info.yml' : '.info'; - $first = $this->modules[1]; - $second = $this->modules[2]; - - $options = array( - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - 'yes' => NULL, - 'backup-dir' => UNISH_SANDBOX . '/backups', - 'cache' => NULL, - 'check-updatedb' => 0, - // Needed in order to get 'Up to date' in the return value of updatestatus. See pm_project_filter(). - 'verbose' => NULL, - 'strict' => 0, - ); - - // Upgrade a specific module. - $this->drush('pm-updatecode', array($first), $options + array()); - - // Assure that first was upgraded and second was not. - $this->drush('pm-updatestatus', array(), $options + array('format' => 'json')); - $all = $this->getOutputFromJSON(); - $this->assertEquals($all->$first->existing_version, $all->$first->candidate_version); - $this->assertNotEquals($all->$second->existing_version, $all->$second->candidate_version); - - // Lock second, and update core. - $this->drush('pm-updatecode', array(), $options + array('lock' => $second)); - $list = $this->getOutputAsList(); // For debugging. - $this->drush('pm-updatestatus', array(), $options + array('format' => 'json')); - $all = $this->getOutputFromJSON(); - $this->assertEquals($all->drupal->existing_version, $all->drupal->candidate_version); - $this->assertNotEquals($all->$second->existing_version, $all->$second->candidate_version); - - // Unlock second, update, and check. - $this->drush('pm-updatecode', array(), $options + array('unlock' => $second, 'no-backup' => NULL)); - $list = $this->getOutputAsList(); - $this->drush('pm-updatestatus', array(), $options + array('format' => 'json')); - $all = $this->getOutputFromJSON(); - $this->assertEquals($all->$second->existing_version, $all->$second->candidate_version); - - // Verify that we keep backups as instructed. - $backup_dir = UNISH_SANDBOX . '/backups'; - $Directory = new \RecursiveDirectoryIterator($backup_dir); - $Iterator = new \RecursiveIteratorIterator($Directory); - $found = FALSE; - foreach ($Iterator as $item) { - if (basename($item) == $first . $extension) { - $found = TRUE; - break; - } - } - $this->assertTrue($found, 'Backup exists and contains the first module.'); - - $Iterator = new \RecursiveIteratorIterator($Directory); - $found = FALSE; - foreach ($Iterator as $item) { - if (basename($item) == $second . '.module') { - $found = TRUE; - break; - } - } - $this->assertFalse($found, 'Backup exists and does not contain the second module.'); - } -} diff --git a/vendor/drush/drush/tests/pmUpdateStatusTest.php b/vendor/drush/drush/tests/pmUpdateStatusTest.php deleted file mode 100644 index bb536629ab1000b1d179c97d71f674275d9ddb35..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/pmUpdateStatusTest.php +++ /dev/null @@ -1,187 +0,0 @@ -<?php - -/** - * @file - * Prepare a codebase with modules in several update status and test pm-updatestatus. - */ - -namespace Unish; - -/** - * @group slow - * @group pm - */ -class pmUpdateStatus extends CommandUnishTestCase { - - /** - * Setup the test environment. - * - * Here we assume that any Drupal core version parses data from Drupal's - * update service the same way. We focus on testing drush functionality. - * - * Several drupal core versions are already tested by pmUpdateCode. - * - * We choose to setup a Drupal 7 environment for convenience: - * - It has modules in each maintenance status - * and they're not willing to change in short - * - Drupal 6 will start to be unsupported at some point - * - Drupal 8 still has not enough variety to cover the tests - */ - function setUp() { - if (UNISH_DRUPAL_MAJOR_VERSION == '6') { - $this->markTestSkipped("pm-update* no longer supported with Drupal 6; drupal.org does not allow stable releases for Drupal 6 contrib modules."); - } - - $sites = $this->setUpDrupal(1, TRUE, "7.30"); - $options = array( - 'root' => $this->webroot(), - 'uri' => key($sites), - 'yes' => NULL, - 'cache' => NULL, - 'skip' => NULL, // No FirePHP - 'strict' => 0, - ); - - // Prepare a list of modules with several update statuses. - $modules_dl = array(); - $modules_en = array(); - // Update available but not a security one. Cross fingers they never release a security update. - $modules_dl[] = 'bad_judgement-1.0-rc38'; - $modules_en[] = 'bad_judgement'; - // Old devel release with a security update available. - $modules_dl[] = 'devel-7.x-1.0-rc1'; - $modules_en[] = 'devel'; - // Installed version not supported. - $modules_dl[] = 'cck-2.x-dev'; - $modules_en[] = 'cck'; - // Up to date. - $modules_dl[] = 'ctools'; - $modules_en[] = 'ctools'; - - // Download and enable the modules. Additionally download a module from git, so it has no version information. - $this->drush('pm-download', $modules_dl, $options); - $this->drush('pm-download', array('zen'), $options + array('package-handler' => 'git_drupalorg')); - $modules_en[] = 'zen'; - // self::EXIT_ERROR because of bad_judgement. - $this->drush('pm-enable', $modules_en, $options, NULL, NULL, self::EXIT_ERROR); - } - - /** - * Test several update statuses via drupal backend. - */ - function testUpdateStatusDrupal() { - $this->doTest('drupal'); - } - - /** - * Test several update statuses via drush backend. - */ - function testUpdateStatusDrush() { - $this->doTest('drush'); - } - - function doTest($update_backend) { - - // Test several projects with a variety of statuses. - $options = array( - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - 'verbose' => NULL, - 'backend' => NULL, - 'update-backend' => $update_backend, - ); - $this->drush('pm-updatestatus', array(), $options); - $parsed = $this->parse_backend_output($this->getOutput()); - $data = $parsed['object']; - - $expected = array( - 'drupal' => 'SECURITY UPDATE available', - 'bad_judgement' => 'Update available', - 'ctools' => 'Up to date', - 'devel' => 'SECURITY UPDATE available', - 'cck' => 'Installed version not supported', - 'zen' => 'Project was not packaged by drupal.org but obtained from git. You need to enable git_deploy module', - ); - foreach ($expected as $module => $status_msg) { - $this->assertArrayHasKey($module, $data, "$module module present in pm-updatestatus output"); - $this->assertEquals($data[$module]['status_msg'], $status_msg, "$module status is '$status_msg'"); - } - - - // Test statuses when asked for specific projects and versions. - $args = array( - 'bad_judgement-1.0-rc38', - 'ctools-0.0', - 'devel-1.5', - 'foo', - ); - $this->drush('pm-updatestatus', $args, $options); - $parsed = $this->parse_backend_output($this->getOutput()); - $data = $parsed['object']; - - $expected = array( - 'bad_judgement' => 'Specified version already installed', - 'ctools' => 'Specified version not found', - 'devel' => 'Specified version available', - 'foo' => 'Specified project not found', - ); - foreach ($expected as $module => $status_msg) { - $this->assertArrayHasKey($module, $data, "$module module present in pm-updatestatus output"); - $this->assertEquals($data[$module]['status_msg'], $status_msg, "$module status is '$status_msg'"); - } - // We don't expect any output for other projects than the provided ones. - $not_expected = array( - 'drupal', - 'cck', - 'zen', - ); - foreach ($not_expected as $module) { - $this->assertArrayNotHasKey($module, $data, "$module module not present in pm-updatestatus output"); - } - - - // Test --security-only. - $this->drush('pm-updatestatus', array(), $options + array('security-only' => NULL)); - $parsed = $this->parse_backend_output($this->getOutput()); - $data = $parsed['object']; - - $expected = array( - 'drupal' => 'SECURITY UPDATE available', - 'devel' => 'SECURITY UPDATE available', - ); - foreach ($expected as $module => $status_msg) { - $this->assertArrayHasKey($module, $data, "$module module present in pm-updatestatus output"); - $this->assertEquals($data[$module]['status_msg'], $status_msg, "$module status is '$status_msg'"); - } - // We don't expect any output for projects without security updates. - $not_expected = array( - 'bad_judgement', - 'ctools', - 'cck', - 'zen', - ); - foreach ($not_expected as $module) { - $this->assertArrayNotHasKey($module, $data, "$module module not present in pm-updatestatus output"); - } - - - // Test --check-disabled. - $dis_options = array( - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - 'yes' => NULL, - ); - $this->drush('pm-disable', array('devel'), $dis_options); - - $this->drush('pm-updatestatus', array(), $options + array('check-disabled' => 1)); - $parsed = $this->parse_backend_output($this->getOutput()); - $data = $parsed['object']; - $this->assertArrayHasKey('devel', $data, "devel module present in pm-updatestatus output"); - - $this->drush('pm-updatestatus', array(), $options + array('check-disabled' => 0)); - $parsed = $this->parse_backend_output($this->getOutput()); - $data = $parsed['object']; - $this->assertArrayNotHasKey('devel', $data, "devel module not present in pm-updatestatus output"); - } -} - diff --git a/vendor/drush/drush/tests/queueTest.php b/vendor/drush/drush/tests/queueTest.php deleted file mode 100644 index 1e2fdb4737fba4dd67353b490dff349988f69b3e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/queueTest.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group commands - */ -class QueueCase extends CommandUnishTestCase { - - function testQueue() { - if (UNISH_DRUPAL_MAJOR_VERSION == 6) { - $this->markTestSkipped("Queue API not available in Drupal 6."); - } - - if (UNISH_DRUPAL_MAJOR_VERSION == 7) { - $expected = 'aggregator_feeds,%items,SystemQueue'; - } - else { - $expected = 'aggregator_feeds,%items,Drupal\Core\Queue\DatabaseQueue'; - } - - $sites = $this->setUpDrupal(1, TRUE); - $options = array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - ); - - // Enable aggregator since it declares a queue. - $this->drush('pm-enable', array('aggregator'), $options); - - $this->drush('queue-list', array(), $options); - $output = $this->getOutput(); - $this->assertContains('aggregator_feeds', $output, 'Queue list shows the declared queue.'); - - $this->drush('php-script', array('queue_script-D' . UNISH_DRUPAL_MAJOR_VERSION), $options + array('script-path' => dirname(__FILE__) . '/resources')); - $this->drush('queue-list', array(), $options + array('pipe' => TRUE)); - $output = trim($this->getOutput()); - $parts = explode(",", $output); - $this->assertEquals(str_replace('%items', 1, $expected), $output, 'Item was successfully added to the queue.'); - $output = $this->getOutput(); - - $this->drush('queue-run', array('aggregator_feeds'), $options); - $this->drush('queue-list', array(), $options + array('pipe' => TRUE)); - $output = trim($this->getOutput()); - $parts = explode(",", $output); - $this->assertEquals(str_replace('%items', 0, $expected), $output, 'Queue item processed.'); - } - - /** - * Tests the RequeueException. - */ - public function testRequeueException() { - if (UNISH_DRUPAL_MAJOR_VERSION < 8) { - $this->markTestSkipped("RequeueException only available in Drupal 8."); - } - - $sites = $this->setUpDrupal(1, TRUE); - $options = array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - ); - - // Copy the 'woot' module over to the Drupal site we just set up. - $this->setupModulesForTests($this->webroot()); - - // Enable woot module, which contains a queue worker that throws a - // RequeueException. - $this->drush('pm-enable', array('woot'), $options, NULL, NULL, self::EXIT_SUCCESS); - - // Add an item to the queue. - $this->drush('php-script', array('requeue_script'), $options + array('script-path' => dirname(__FILE__) . '/resources')); - - // Check that the queue exists and it has one item in it. - $expected = 'woot_requeue_exception,%items,Drupal\Core\Queue\DatabaseQueue'; - $this->drush('queue-list', array(), $options + array('pipe' => TRUE)); - $output = trim($this->getOutput()); - $this->assertEquals(str_replace('%items', 1, $expected), $output, 'Item was successfully added to the queue.'); - - // Process the queue. - $this->drush('queue-run', array('woot_requeue_exception'), $options); - - // Check that the item was processed after being requeued once. - // Here is the detailed workflow of what the above command did. - // 1. Drush calls drush queue-run woot_requeue_exception. - // 2. Drush claims the item. The worker sets a state variable (see below) - // and throws the RequeueException. - // 3. Drush catches the exception and puts it back in the queue. - // 4. Drush claims the next item, which is the one that we just requeued. - // 5. The worker finds the state variable, so it does not throw the - // RequeueException this time (see below). - // 6. Drush removes the item from the queue. - // 7. Command finishes. The queue is empty. - $this->drush('queue-list', array(), $options + array('pipe' => TRUE)); - $output = trim($this->getOutput()); - $this->assertEquals(str_replace('%items', 0, $expected), $output, 'Queue item processed after being requeued.'); - } - - /** - * Copies the woot module into Drupal. - * - * @param string $root - * The path to the root directory of Drupal. - */ - public function setupModulesForTests($root) { - $wootModule = __DIR__ . '/resources/modules/d' . UNISH_DRUPAL_MAJOR_VERSION . '/woot'; - $modulesDir = "$root/sites/all/modules"; - $this->mkdir($modulesDir); - \symlink($wootModule, "$modulesDir/woot"); - } - -} diff --git a/vendor/drush/drush/tests/quickDrupalTest.php b/vendor/drush/drush/tests/quickDrupalTest.php deleted file mode 100644 index d44982e8bce456100eb3d7006d057f37d0f4ab64..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/quickDrupalTest.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -namespace Unish; - -/** - * core-quick-drupal tests. - * - * @group quick-drupal - * @group slow - */ -class quickDrupalCase extends CommandUnishTestCase { - /** - * Path to test make files. - */ - protected $makefile_path; - - /** - * Initialize $makefile_path. - */ - function __construct() { - $this->makefile_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'makefiles'; - } - - /** - * Run a given quick-drupal test. - * - * @param $test - * The test makefile to run, as defined by $this->getQuickDrupalTestParameters(); - */ - private function runQuickDrupalTest($test) { - $config = $this->getQuickDrupalTestParameters($test); - $default_options = array( - 'yes' => NULL, - 'no-server' => NULL, - ); - $options = array_merge($config['options'], $default_options); - if (array_key_exists('makefile', $config)) { - $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile']; - $options['makefile'] = $makefile; - } - $return = !empty($config['fail']) ? self::EXIT_ERROR : self::EXIT_SUCCESS; - $target = UNISH_SANDBOX . '/qd-' . $test; - $options['root'] = $target; - $this->drush('core-quick-drupal', $config['args'], $options, NULL, NULL, $return); - - // Use pm-list to determine if all of the correct modules were enabled - if (empty($config['fail'])) { - $this->drush('pm-list', array(), array('root' => $target, 'status' => 'enabled', 'no-core' => NULL, 'pipe' => NULL)); - $output = $this->getOutput(); - $this->assertEquals($config['expected-modules'], $output, 'quick-drupal included the correct set of modules'); - } - } - - function testQuickDrupal() { - $this->runQuickDrupalTest('devel'); - } - - function getQuickDrupalTestParameters($key) { - $tests = array( - 'devel' => array( - 'name' => 'Test quick-drupal with a makefile that downloads devel', - 'makefile' => 'qd-devel.make', - 'expected-modules' => 'devel', - 'args' => array(), - 'options' => array( - 'skip' => NULL, // for speed up enable of devel module. - 'browser' => 0, - 'profile' => UNISH_DRUPAL_MAJOR_VERSION == 6 ? 'standard' : 'testing', - ), - ), - ); - return $tests[$key]; - } -} diff --git a/vendor/drush/drush/tests/releaseInfoTest.php b/vendor/drush/drush/tests/releaseInfoTest.php deleted file mode 100644 index ff534c4a9017c96b862c006706891d3ad59dca8e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/releaseInfoTest.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/** - * @file - * Tests for release_info engine. - */ - -namespace Unish; - -/** - * pm testing - * - * @group pm - */ -class releaseInfoCase extends UnitUnishTestCase { - - /** - * Pick right release from the XML (dev, latest published+recommended, ...). - */ - public function testReleaseXML() { - _drush_add_commandfiles(array(DRUSH_BASE_PATH . '/commands/pm')); - $release_info = drush_include_engine('release_info', 'updatexml'); - - // Use a local, static XML file because live files change over time. - $xml = simplexml_load_file(dirname(__FILE__). '/devel.xml'); - $project_release_info = new \Drush\UpdateService\Project($xml); - - // Pick specific release. - $release = $project_release_info->getSpecificRelease('6.x-1.18'); - $this->assertEquals('6.x-1.18', $release['version']); - - // Pick latest recommended+published with no further specification. - // 6.x-2.2 is skipped because it is unpublished. - // 6.x-2.2-rc1 is skipped because it is not a stable release. - $release = $project_release_info->getRecommendedOrSupportedRelease(); - $this->assertEquals('6.x-2.1', $release['version']); - - // Pick latest from a specific branch. - $release = $project_release_info->getSpecificRelease('6.x-1'); - $this->assertEquals('6.x-1.23', $release['version']); - - // Pick latest from a different branch. - // 6.x-2.2 is skipped because it is unpublished. - // 6.x-2.2-rc1 is skipped because it is not a stable release. - $release = $project_release_info->getSpecificRelease('6.x-2'); - $this->assertEquals('6.x-2.1', $release['version']); - - // Pick a -dev release. - $release = $project_release_info->getSpecificRelease('6.x-1.x'); - $this->assertEquals('6.x-1.x-dev', $release['version']); - - // Test UpdateServiceProject::getSpecificRelease(). - // Test we get latest release in branch 1. - $release = $project_release_info->getSpecificRelease('6.x-1'); - $this->assertEquals('6.x-1.23', $release['version']); - - // Test UpdateServiceProject::getDevRelease(). - $release = $project_release_info->getDevRelease(); - $this->assertEquals('6.x-1.x-dev', $release['version']); - } -} diff --git a/vendor/drush/drush/tests/resources/create_node_types.php b/vendor/drush/drush/tests/resources/create_node_types.php deleted file mode 100644 index a0c07a0b3b0e9566b032e85a3e36967194cd9af9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/create_node_types.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -$types = array( - array( - 'type' => 'page', - 'name' => 'Basic page', - 'base' => 'node_content', - 'description' => 'Use <em>basic pages</em> for your static content, such as an \'About us\' page.', - 'custom' => 1, - 'modified' => 1, - 'locked' => 0, - ), - array( - 'type' => 'article', - 'name' => 'Article', - 'base' => 'node_content', - 'description' => 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.', - 'custom' => 1, - 'modified' => 1, - 'locked' => 0, - ), -); - -foreach ($types as $type) { - $type = node_type_set_defaults($type); - node_type_save($type); - node_add_body_field($type); -} diff --git a/vendor/drush/drush/tests/resources/example.profile b/vendor/drush/drush/tests/resources/example.profile deleted file mode 100644 index dd0d2fab8d50f998267d0056c54e7670695c7b17..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/example.profile +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -function example_profile_details() { - return array( - 'name' => 'Example', - 'description' => 'Example profile with a couple of basic added configuration options.', - ); -} - -function example_profile_modules() { - return array(); -} - -function example_form_alter(&$form, $form_state, $form_id) { - if ($form_id == 'install_configure') { - $form['my_options'] = array( - '#type' => 'fieldset', - '#title' => t('Example options'), - ); - $form['my_options']['myopt1'] = array( - '#type' => 'textfield', - '#title' => 'Example option 1' - ); - $form['my_options']['myopt2'] = array( - '#type' => 'select', - '#title' => t('Example option 2'), - '#options' => array( - 0 => t('Something'), - 1 => t('Something else'), - 2 => t('Something completely different'), - ), - ); - - // Make sure we don't clobber the original auto-detected submit func - $form['#submit'] = array('install_configure_form_submit', 'example_install_configure_form_submit'); - } -} - -function example_install_configure_form_submit($form, &$form_state) { - variable_set('myopt1', $form_state['values']['myopt1']); - variable_set('myopt2', $form_state['values']['myopt2']); -} \ No newline at end of file diff --git a/vendor/drush/drush/tests/resources/global-includes/Commands/FoobarCommands.php b/vendor/drush/drush/tests/resources/global-includes/Commands/FoobarCommands.php deleted file mode 100644 index 0e934dfac19a5b8565acdc56d6409899fea75091..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/global-includes/Commands/FoobarCommands.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -namespace Drush\Commands; - -use Consolidation\OutputFormatters\StructuredData\RowsOfFields; - -/** - * For commands that are 'global', Drush expects to find them inside - * the 'Commands' folder of a location specified via --include. - */ -class FoobarCommands -{ - /** - * Do nearly nothing. - * - * @command foobar - */ - public function foobar() - { - return 'baz'; - } -} diff --git a/vendor/drush/drush/tests/resources/modules/d6/woot/Commands/WootCommands.php b/vendor/drush/drush/tests/resources/modules/d6/woot/Commands/WootCommands.php deleted file mode 100644 index ba230750680a4dd7a87c71103ad25092c7677cb9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d6/woot/Commands/WootCommands.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -namespace Drupal\woot\Commands; - -use Consolidation\OutputFormatters\StructuredData\RowsOfFields; - -/** - * For commands that are parts of modules, Drush expects to find commandfiles in - * __MODULE__/src/Command, and the namespace is Drupal/__MODULE__/Command. - */ -class WootCommands -{ - /** - * Woot mightily. - * - * @aliases wt - */ - public function woot() - { - return 'Woot!'; - } - - /** - * This is the my-cat command - * - * This command will concatinate two parameters. If the --flip flag - * is provided, then the result is the concatination of two and one. - * - * @param string $one The first parameter. - * @param string $two The other parameter. - * @option boolean $flip Whether or not the second parameter should come first in the result. - * @aliases c - * @usage bet alpha --flip - * Concatinate "alpha" and "bet". - */ - public function myCat($one, $two = '', $options = ['flip' => false]) - { - if ($options['flip']) { - return "{$two}{$one}"; - } - return "{$one}{$two}"; - } - - /** - * Demonstrate formatters. Default format is 'table'. - * - * @field-labels - * first: I - * second: II - * third: III - * @usage try:formatters --format=yaml - * @usage try:formatters --format=csv - * @usage try:formatters --fields=first,third - * @usage try:formatters --fields=III,II - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - */ - public function tryFormatters($options = ['format' => 'table', 'fields' => '']) - { - $outputData = [ - 'en' => [ 'first' => 'One', 'second' => 'Two', 'third' => 'Three' ], - 'de' => [ 'first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei' ], - 'jp' => [ 'first' => 'Ichi', 'second' => 'Ni', 'third' => 'San' ], - 'es' => [ 'first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres' ], - ]; - return new RowsOfFields($outputData); - } -} diff --git a/vendor/drush/drush/tests/resources/modules/d6/woot/woot.info b/vendor/drush/drush/tests/resources/modules/d6/woot/woot.info deleted file mode 100644 index 45f4a3ccb2727a728e6dc05f57f87d9541c1bd7a..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d6/woot/woot.info +++ /dev/null @@ -1,4 +0,0 @@ -name = woot -description = Woot Mightily -core = 6.x -files[] = woot.module diff --git a/vendor/drush/drush/tests/resources/modules/d6/woot/woot.module b/vendor/drush/drush/tests/resources/modules/d6/woot/woot.module deleted file mode 100644 index f51b34a5be56dac9a2f39451c15621cc93862fb8..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d6/woot/woot.module +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * Implements hook_menu - */ -function woot_menu() { - $items = array(); - - $items['woot'] = array( - 'title' => 'Woot', - 'description' => 'Woot mightily.', - 'page callback' => 'woot_page', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -function woot_page() { - return array('#markup' => 'Woot!'); -} diff --git a/vendor/drush/drush/tests/resources/modules/d7/woot/Commands/WootCommands.php b/vendor/drush/drush/tests/resources/modules/d7/woot/Commands/WootCommands.php deleted file mode 100644 index ba230750680a4dd7a87c71103ad25092c7677cb9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d7/woot/Commands/WootCommands.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -namespace Drupal\woot\Commands; - -use Consolidation\OutputFormatters\StructuredData\RowsOfFields; - -/** - * For commands that are parts of modules, Drush expects to find commandfiles in - * __MODULE__/src/Command, and the namespace is Drupal/__MODULE__/Command. - */ -class WootCommands -{ - /** - * Woot mightily. - * - * @aliases wt - */ - public function woot() - { - return 'Woot!'; - } - - /** - * This is the my-cat command - * - * This command will concatinate two parameters. If the --flip flag - * is provided, then the result is the concatination of two and one. - * - * @param string $one The first parameter. - * @param string $two The other parameter. - * @option boolean $flip Whether or not the second parameter should come first in the result. - * @aliases c - * @usage bet alpha --flip - * Concatinate "alpha" and "bet". - */ - public function myCat($one, $two = '', $options = ['flip' => false]) - { - if ($options['flip']) { - return "{$two}{$one}"; - } - return "{$one}{$two}"; - } - - /** - * Demonstrate formatters. Default format is 'table'. - * - * @field-labels - * first: I - * second: II - * third: III - * @usage try:formatters --format=yaml - * @usage try:formatters --format=csv - * @usage try:formatters --fields=first,third - * @usage try:formatters --fields=III,II - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - */ - public function tryFormatters($options = ['format' => 'table', 'fields' => '']) - { - $outputData = [ - 'en' => [ 'first' => 'One', 'second' => 'Two', 'third' => 'Three' ], - 'de' => [ 'first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei' ], - 'jp' => [ 'first' => 'Ichi', 'second' => 'Ni', 'third' => 'San' ], - 'es' => [ 'first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres' ], - ]; - return new RowsOfFields($outputData); - } -} diff --git a/vendor/drush/drush/tests/resources/modules/d7/woot/woot.info b/vendor/drush/drush/tests/resources/modules/d7/woot/woot.info deleted file mode 100644 index 4a01a94af56ac880ffb0a7049839877b26b284bb..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d7/woot/woot.info +++ /dev/null @@ -1,4 +0,0 @@ -name = woot -description = Woot Mightily -core = 7.x -files[] = woot.module diff --git a/vendor/drush/drush/tests/resources/modules/d7/woot/woot.module b/vendor/drush/drush/tests/resources/modules/d7/woot/woot.module deleted file mode 100644 index f51b34a5be56dac9a2f39451c15621cc93862fb8..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d7/woot/woot.module +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * Implements hook_menu - */ -function woot_menu() { - $items = array(); - - $items['woot'] = array( - 'title' => 'Woot', - 'description' => 'Woot mightily.', - 'page callback' => 'woot_page', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -function woot_page() { - return array('#markup' => 'Woot!'); -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/composer.json b/vendor/drush/drush/tests/resources/modules/d8/woot/composer.json deleted file mode 100644 index 72d87573203408b0fb23a0c46616076e1cd184dc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/composer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "drupal/woot", - "type": "drupal-module", - "description": "Woot Mightily.", - "keywords": ["Drupal"], - "license": "GPL-2.0+", - "homepage": "http://drupal.org/project/woot", - "minimum-stability": "dev", - "support": { - "issues": "http://drupal.org/project/issues/woot", - "source": "http://cgit.drupalcode.org/woot" - }, - "require": { } -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/AnnotatedGreetCommand.php b/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/AnnotatedGreetCommand.php deleted file mode 100644 index 1a42b8134107792373b96a89e7363fec59617e39..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/AnnotatedGreetCommand.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -namespace Drupal\woot\Commands; - -use Consolidation\AnnotatedCommand\AnnotatedCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * This is an annotated version of the example Symfony Console command - * from the documentation. - * - * See: http://symfony.com/doc/2.7/components/console/introduction.html#creating-a-basic-command - */ -class AnnotatedGreetCommand extends AnnotatedCommand -{ - /** - * Greet someone - * - * @command annotated:greet - * @arg string $name Who do you want to greet? - * @option boolean $yell If set, the task will yell in uppercase letters - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $name = $input->getArgument('name'); - if ($name) { - $text = 'Hello '.$name; - } else { - $text = 'Hello'; - } - - if ($input->getOption('yell')) { - $text = strtoupper($text); - } - - $output->writeln($text); - } -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/GreetCommand.php b/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/GreetCommand.php deleted file mode 100644 index 644630b7d912810d4702e7c14dde6378672fa2f5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/GreetCommand.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -namespace Drupal\woot\Commands; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * This is a literal copy of the example Symfony Console command - * from the documentation. - * - * See: http://symfony.com/doc/2.7/components/console/introduction.html#creating-a-basic-command - */ -class GreetCommand extends Command -{ - protected function configure() - { - $this - ->setName('demo:greet') - ->setDescription('Greet someone') - ->addArgument( - 'name', - InputArgument::OPTIONAL, - 'Who do you want to greet?' - ) - ->addOption( - 'yell', - null, - InputOption::VALUE_NONE, - 'If set, the task will yell in uppercase letters' - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $name = $input->getArgument('name'); - if ($name) { - $text = 'Hello '.$name; - } else { - $text = 'Hello'; - } - - if ($input->getOption('yell')) { - $text = strtoupper($text); - } - - $output->writeln($text); - } -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/WootCommands.php b/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/WootCommands.php deleted file mode 100644 index ba230750680a4dd7a87c71103ad25092c7677cb9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/WootCommands.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -namespace Drupal\woot\Commands; - -use Consolidation\OutputFormatters\StructuredData\RowsOfFields; - -/** - * For commands that are parts of modules, Drush expects to find commandfiles in - * __MODULE__/src/Command, and the namespace is Drupal/__MODULE__/Command. - */ -class WootCommands -{ - /** - * Woot mightily. - * - * @aliases wt - */ - public function woot() - { - return 'Woot!'; - } - - /** - * This is the my-cat command - * - * This command will concatinate two parameters. If the --flip flag - * is provided, then the result is the concatination of two and one. - * - * @param string $one The first parameter. - * @param string $two The other parameter. - * @option boolean $flip Whether or not the second parameter should come first in the result. - * @aliases c - * @usage bet alpha --flip - * Concatinate "alpha" and "bet". - */ - public function myCat($one, $two = '', $options = ['flip' => false]) - { - if ($options['flip']) { - return "{$two}{$one}"; - } - return "{$one}{$two}"; - } - - /** - * Demonstrate formatters. Default format is 'table'. - * - * @field-labels - * first: I - * second: II - * third: III - * @usage try:formatters --format=yaml - * @usage try:formatters --format=csv - * @usage try:formatters --fields=first,third - * @usage try:formatters --fields=III,II - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - */ - public function tryFormatters($options = ['format' => 'table', 'fields' => '']) - { - $outputData = [ - 'en' => [ 'first' => 'One', 'second' => 'Two', 'third' => 'Three' ], - 'de' => [ 'first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei' ], - 'jp' => [ 'first' => 'Ichi', 'second' => 'Ni', 'third' => 'San' ], - 'es' => [ 'first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres' ], - ]; - return new RowsOfFields($outputData); - } -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Controller/WootController.php b/vendor/drush/drush/tests/resources/modules/d8/woot/src/Controller/WootController.php deleted file mode 100644 index 4f9234d019e58034ebde64cc5052eeb44c9aba4c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Controller/WootController.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * @file - * Contains Drupal\woot\Controller\WootController. - */ - -namespace Drupal\woot\Controller; - -use Drupal\Core\Controller\ControllerBase; - -/** - * Class WootController. - * - * @package Drupal\woot\Controller - */ -class WootController extends ControllerBase { - /** - * Woot. - * - * @return string - * Return Hello string. - */ - public function woot() { - return [ - '#type' => 'markup', - '#markup' => $this->t('Woot!') - ]; - } - -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Plugin/QueueWorker/WootRequeueException.php b/vendor/drush/drush/tests/resources/modules/d8/woot/src/Plugin/QueueWorker/WootRequeueException.php deleted file mode 100644 index 6830e56d02f53963570f1de65611d1965bba68fc..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Plugin/QueueWorker/WootRequeueException.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Drupal\woot\Plugin\QueueWorker; - -use Drupal\Core\Queue\QueueWorkerBase; -use Drupal\Core\Queue\RequeueException; - -/** - * Queue worker used to test RequeueException. - * - * @QueueWorker( - * id = "woot_requeue_exception", - * title = @Translation("RequeueException test"), - * cron = {"time" = 60} - * ) - */ -class WootRequeueException extends QueueWorkerBase { - - /** - * {@inheritdoc} - */ - public function processItem($data) { - $state = \Drupal::state(); - if (!$state->get('woot_requeue_exception')) { - $state->set('woot_requeue_exception', 1); - throw new RequeueException('I am not done yet!'); - } - else { - $state->set('woot_requeue_exception', 2); - } - } - -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/src/WootManager.php b/vendor/drush/drush/tests/resources/modules/d8/woot/src/WootManager.php deleted file mode 100644 index 9802835585c0b0687ec36dd369e67df72ac09ac4..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/src/WootManager.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * @file - * Contains \Drupal\woot\WootManager. - */ - -namespace Drupal\woot; - -use Drupal\Component\Graph\Graph; -use Drupal\Component\Utility\SafeMarkup; -use Drupal\Core\Config\Entity\ConfigEntityInterface; -use Drupal\Core\Entity\ContentEntityInterface; -use Drupal\Core\Entity\EntityManager; -use Drupal\Core\Session\AccountInterface; -use Drupal\rest\LinkManager\LinkManagerInterface; -use Drupal\rest\Plugin\Type\ResourcePluginManager; -use Symfony\Component\Serializer\Serializer; - -/** - * A simulated service for wooting. - * @todo throw useful exceptions - */ -class WootManager -{ - /** - * The current user. - * - * @var \Drupal\Core\Session\AccountInterface - */ - protected $currentUser; - - /** - * Constructs the default content manager. - * - * @param \Drupal\Core\Session|AccountInterface $current_user - * The current user. - */ - public function __construct(AccountInterface $current_user) { - $this->currentUser = $current_user; - } - - /** - * Woof mightily. Note that we can include commands directly - * inside a service class. - * - * @command woof - * @aliases wf - */ - public function woof() - { - return 'Woof!'; - } -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/woot.info.yml b/vendor/drush/drush/tests/resources/modules/d8/woot/woot.info.yml deleted file mode 100644 index cd849fbd5e968c37778adecac2eb8ac1b3069ee9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/woot.info.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: Woot -type: module -description: Woot Mightily. -core: 8.x -package: Other diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/woot.module b/vendor/drush/drush/tests/resources/modules/d8/woot/woot.module deleted file mode 100644 index b1535c4d4a137085131531bc0dc04845a73f64db..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/woot.module +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/** - * @file - * Contains woot.module. - */ - -use Drupal\Core\Routing\RouteMatchInterface; - -/** - * Implements hook_help(). - */ -function woot_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the woot module. - case 'help.page.woot': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('Woot Mightily.') . '</p>'; - return $output; - - default: - } -} - -/** - * Implements hook_theme(). - */ -function woot_theme() { - $theme = []; - - return $theme; -} diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/woot.routing.yml b/vendor/drush/drush/tests/resources/modules/d8/woot/woot.routing.yml deleted file mode 100644 index a607603b6554e44f9ac3c7d7ccc763e9655b5330..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/woot.routing.yml +++ /dev/null @@ -1,8 +0,0 @@ - -woot.woot_controller_woot: - path: '/woot' - defaults: - _controller: '\Drupal\woot\Controller\WootController::woot' - _title: 'Woot' - requirements: - _permission: 'access content' diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/woot.services.yml b/vendor/drush/drush/tests/resources/modules/d8/woot/woot.services.yml deleted file mode 100644 index 186c082b8b134c45de17ce232beda8ad11bf995c..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/modules/d8/woot/woot.services.yml +++ /dev/null @@ -1,18 +0,0 @@ -services: - woot.manager: - class: Drupal\woot\WootManager - arguments: ['@current_user'] - tags: - - { name: consolidation.commandhandler } - woot.command: - class: Drupal\woot\Commands\WootCommands - tags: - - { name: consolidation.commandhandler } - greet.command: - class: Drupal\woot\Commands\GreetCommand - tags: - - { name: drush.command } - annotated_greet.command: - class: Drupal\woot\Commands\AnnotatedGreetCommand - tags: - - { name: drush.command } diff --git a/vendor/drush/drush/tests/resources/queue_script-D7.php b/vendor/drush/drush/tests/resources/queue_script-D7.php deleted file mode 100644 index 5fb7f95620420b2aa1501539db88ca6809898e01..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/queue_script-D7.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -// Create a new feed. -aggregator_save_feed(array( - 'title' => 'test', - 'url' => 'https://www.drupal.org/project/issues/rss/goofy?categories=All', - 'refresh' => 3600, - 'block' => 5, -)); - -// Let cron call DrupalQueue::createItem() for us. -aggregator_cron(); diff --git a/vendor/drush/drush/tests/resources/queue_script-D8.php b/vendor/drush/drush/tests/resources/queue_script-D8.php deleted file mode 100644 index 679a2a300861e95f809f603a5ee7085fb380cb55..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/queue_script-D8.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -use Drupal\aggregator\Entity\Feed; - -// Create a new feed. -$feed = Feed::create(array( - 'title' => 'test', - 'url' => 'http://drupal.org/project/issues/rss/drupal?categories=All', - 'refresh' => 3600, -)); -$feed->save(); - -// Let cron call QueueInterface::createItem() for us. -aggregator_cron(); diff --git a/vendor/drush/drush/tests/resources/requeue_script.php b/vendor/drush/drush/tests/resources/requeue_script.php deleted file mode 100644 index 03a4affbe5cd99513049b238d632f5f952feb684..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/requeue_script.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * @file - * Creates the woot_requeue_exception queue and adds an item to it. - * - * @see WootRequeueException - */ - -$queue_factory = \Drupal::service('queue'); -$queue = $queue_factory->get('woot_requeue_exception', TRUE); -$queue->createItem(['foo' => 'bar']); diff --git a/vendor/drush/drush/tests/resources/testDispatchUsingAlias_script.php b/vendor/drush/drush/tests/resources/testDispatchUsingAlias_script.php deleted file mode 100644 index 490e24de0b4542b9ae25f8ecca5e8266abd90ff3..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/testDispatchUsingAlias_script.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -$valuesUsingAlias = drush_invoke_process("@dev", "unit-return-argv", array(), array(), array("dispatch-using-alias" => TRUE)); -$valuesWithoutAlias = drush_invoke_process("@dev", "unit-return-argv", array(), array(), array()); -return array('with' => $valuesUsingAlias['object'], 'without' => $valuesWithoutAlias['object']); - diff --git a/vendor/drush/drush/tests/resources/user_fields-D8.php b/vendor/drush/drush/tests/resources/user_fields-D8.php deleted file mode 100644 index 3fefc62c82afd684dc9710c0416f74e95d19b59d..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/resources/user_fields-D8.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -use Drupal\field\Entity\FieldStorageConfig; -use Drupal\field\Entity\FieldConfig; -use Drupal\user\Entity\User; - -// @see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21Annotation%21FieldType.php/class/annotations/FieldType/8.2.x -create_field('field_user_email', 'email', 'user','user'); -create_field('field_user_string', 'string', 'user','user'); -create_field('field_user_string_long', 'string_long', 'user','user'); -create_field('field_user_telephone', 'telephone', 'user','user'); -create_field('field_user_text', 'text', 'user','user'); -create_field('field_user_text_long', 'text_long', 'user','user'); -create_field('field_user_text_with_summary', 'text_with_summary', 'user','user'); - -// @todo Find a Symfony-ish way to get arguments. -$args = drush_get_arguments(); - -// Create a user. -$values = [ - 'field_user_email' => 'joe.user.alt@myhome.com', - 'field_user_string' => 'Private info', - 'field_user_string_long' => 'Really private info', - 'field_user_telephone' => '4104442222', - 'field_user_text' => 'Super private info', - 'field_user_text_long' => 'Super duper private info', - 'field_user_text_with_summary' => 'Private', -]; - -$user = User::create([ - 'name' => $args[2], - 'mail' => $args[3], - 'pass' => 'password', -]); - -foreach ($values as $field_name => $value) { - $user->set($field_name, $value); -} - -$return = $user->save(); - -/** - * Create a field on an entity. - * - * @param string $field_name - * The name of the field. - * @param string $field_type - * The field type. - * @param string $entity_type - * The entity type. E.g., user. - * @param $bundle - * The entity bundle. E.g., article. - */ -function create_field($field_name, $field_type, $entity_type, $bundle) { - $field_storage = FieldStorageConfig::create(array( - 'field_name' => $field_name, - 'entity_type' => $entity_type, - 'type' => $field_type, - )); - $field_storage->save(); - FieldConfig::create([ - 'field_storage' => $field_storage, - 'bundle' => $bundle, - 'label' => $field_name, - 'settings' => [], - ])->save(); -} diff --git a/vendor/drush/drush/tests/roleTest.php b/vendor/drush/drush/tests/roleTest.php deleted file mode 100644 index 9f74e77be4d098340ed148b329a8954c68f66ee6..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/roleTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** - * @file - * Tests for role.drush.inc - */ - -namespace Unish; - -/** - * @group slow - * @group commands - */ -class roleCase extends CommandUnishTestCase { - - /** - * Create, edit, block, and cancel users. - */ - public function testRole() { - // In D8+, the testing profile has no perms. - $sites = $this->setUpDrupal(1, TRUE, UNISH_DRUPAL_MAJOR_VERSION, UNISH_DRUPAL_MAJOR_VERSION == 6 ? 'default' : 'standard'); - $root = $this->webroot(); - $name = "example"; - $options = array( - 'root' => $root, - 'uri' => key($sites), - 'yes' => NULL, - ); - $anonymous = 'anonymous'; - $authenticated = 'authenticated'; - if (UNISH_DRUPAL_MAJOR_VERSION < 8) { - $anonymous .= ' user'; - $authenticated .= ' user'; - } - $this->drush('role-list', array($anonymous), $options + array('pipe' => NULL) ); - $output = $this->getOutput(); - $this->assertContains('access content', $output); - $this->drush('role-list', array($authenticated), $options + array('pipe' => NULL) ); - $output = $this->getOutput(); - $this->assertContains('access content', $output); - $this->drush('role-add-perm', array($anonymous, 'administer nodes'), $options ); - $this->drush('role-list', array($anonymous), $options + array('pipe' => NULL) ); - $output = $this->getOutput(); - $this->assertContains('administer nodes', $output); - $this->drush('role-remove-perm', array($anonymous, 'administer nodes'), $options ); - $this->drush('role-list', array($anonymous), $options + array('pipe' => NULL) ); - $output = $this->getOutput(); - $this->assertNotContains('administer nodes', $output); - } -} diff --git a/vendor/drush/drush/tests/shellAliasTest.php b/vendor/drush/drush/tests/shellAliasTest.php deleted file mode 100644 index fb48876b7d4df3d10d7c0672a5091f2ecabe9a3e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/shellAliasTest.php +++ /dev/null @@ -1,187 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests for Shell aliases. - * - * @group base - */ -class shellAliasesCase extends CommandUnishTestCase { - - /** - * Write a config file that contains the shell-aliases array. - */ - function setUp() { - parent::setUp(); - $contents = " - <?php - - \$options['shell-aliases'] = array( - 'glopts' => 'topic core-global-options', - 'pull' => '!git pull', - 'echosimple' => '!echo {{@target}}', - 'echotest' => '!echo {{@target}} {{%root}} {{%mypath}}', - 'compound-command' => '!cd {{%sandbox}} && echo second', - ); - "; - file_put_contents(UNISH_SANDBOX . '/drushrc.php', trim($contents)); - if (!file_exists(UNISH_SANDBOX . '/b')) { - mkdir(UNISH_SANDBOX . '/b'); - } - $contents = " - <?php - - \$options['shell-aliases'] = array( - 'also' => '!echo alternate config file included too', - ); - "; - file_put_contents(UNISH_SANDBOX . '/b/drushrc.php', trim($contents)); - $aliases['myalias'] = array( - 'root' => '/path/to/drupal', - 'uri' => 'mysite.org', - '#peer' => '@live', - 'path-aliases' => array ( - '%mypath' => '/srv/data/mypath', - '%sandbox' => UNISH_SANDBOX, - ), - ); - $contents = $this->unish_file_aliases($aliases); - file_put_contents(UNISH_SANDBOX . '/aliases.drushrc.php', $contents); - } - - /** - * Test shell aliases to Drush commands. - */ - public function testShellAliasDrushLocal() { - $options = array( - 'config' => UNISH_SANDBOX, - ); - $this->drush('glopts', array(), $options); - $output = $this->getOutput(); - $this->assertContains('These options are applicable to most drush commands.', $output, 'Successfully executed local shell alias to drush command'); - } - - /** - * Test shell aliases to Bash commands. Assure we pass along extra arguments - * and options. - */ - public function testShellAliasBashLocal() { - $options = array( - 'config' => UNISH_SANDBOX, - 'simulate' => NULL, - 'rebase' => NULL, - ); - $this->drush('pull', array('origin'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1'); - $output = $this->getOutput(); - $this->assertContains('Calling proc_open(git pull origin --rebase);', $output); - } - - public function testShellAliasDrushRemote() { - $options = array( - 'config' => UNISH_SANDBOX, - 'simulate' => NULL, - 'ssh-options' => '', - ); - $this->drush('glopts', array(), $options, 'user@server/path/to/drupal#sitename'); - // $expected might be different on non unix platforms. We shall see. - // n.b. --config is not included in calls to remote systems. - $bash = $this->escapeshellarg('drush --config=drush-sandbox --nocolor --uri=sitename --root=/path/to/drupal core-topic core-global-options 2>&1'); - $expected = "Simulating backend invoke: ssh -t user@server $bash 2>&1"; - $output = $this->getOutput(); - // Remove any coverage arguments. The filename changes, so it's not possible - // to create a string for assertEquals, and the need for both shell escaping - // and regexp escaping different parts of the expected output for - // assertRegexp makes it easier just to remove the argument before checking - // the output. - $output = preg_replace('{--drush-coverage=[^ ]+ }', '', $output); - $output = preg_replace('{--config=[^ ]+ +}', '--config=drush-sandbox ', $output); - $this->assertEquals($expected, $output, 'Expected remote shell alias to a drush command was built'); - } - - public function testShellAliasBashRemote() { - $options = array( - 'config' => UNISH_SANDBOX, - 'simulate' => NULL, - 'ssh-options' => '', - 'rebase' => NULL, - ); - $this->drush('pull', array('origin'), $options, 'user@server/path/to/drupal#sitename', NULL, self::EXIT_SUCCESS, '2>&1'); - // $expected might be different on non unix platforms. We shall see. - $exec = self::escapeshellarg('cd /path/to/drupal && git pull origin --rebase'); - $expected = "Calling proc_open(ssh user@server $exec);"; - $output = $this->getOutput(); - $this->assertEquals($expected, $output, 'Expected remote shell alias to a bash command was built'); - } - - /** - * Test shell aliases with simple replacements -- no alias. - */ - public function testShellAliasSimpleReplacement() { - $options = array( - 'config' => UNISH_SANDBOX, - ); - $this->drush('echosimple', array(), $options); - // Windows command shell prints quotes (but not always?). See http://drupal.org/node/1452944. - $expected = '@none'; - $output = $this->getOutput(); - $this->assertEquals($expected, $output); - } - - /** - * Test shell aliases with complex replacements -- no alias. - */ - public function testShellAliasReplacementNoAlias() { - $options = array( - 'config' => UNISH_SANDBOX, - ); - // echo test has replacements that are not satisfied, so this is expected to return an error. - $this->drush('echotest', array(), $options, NULL, NULL, self::EXIT_ERROR); - } - - /** - * Test shell aliases with replacements -- alias. - */ - public function testShellAliasReplacementWithAlias() { - $options = array( - 'config' => UNISH_SANDBOX, - 'alias-path' => UNISH_SANDBOX, - ); - $this->drush('echotest', array(), $options, '@myalias'); - // Windows command shell prints quotes (not always?). See http://drupal.org/node/1452944. - $expected = '@myalias'; - $expected .= ' /path/to/drupal /srv/data/mypath'; - $output = $this->getOutput(); - $this->assertEquals($expected, $output); - } - - /** - * Test shell aliases with replacements and compound commands. - */ - public function testShellAliasCompoundCommands() { - $options = array( - 'config' => UNISH_SANDBOX, - 'alias-path' => UNISH_SANDBOX, - ); - $this->drush('compound-command', array(), $options, '@myalias'); - $expected = 'second'; - $output = $this->getOutput(); - $this->assertEquals($expected, $output); - } - - - /** - * Test shell aliases with multiple config files. - */ - public function testShellAliasMultipleConfigFiles() { - $options = array( - 'config' => UNISH_SANDBOX . "/b" . PATH_SEPARATOR . UNISH_SANDBOX, - 'alias-path' => UNISH_SANDBOX, - ); - $this->drush('also', array(), $options); - $expected = "alternate config file included too"; - $output = $this->getOutput(); - $this->assertEquals($expected, $output); - } - -} diff --git a/vendor/drush/drush/tests/siteAliasTest.php b/vendor/drush/drush/tests/siteAliasTest.php deleted file mode 100644 index 908118f7ae1c46db871d6553b223ebf10974f50e..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/siteAliasTest.php +++ /dev/null @@ -1,336 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests for sitealias.inc - * - * @group base - */ -class saCase extends CommandUnishTestCase { - /** - * Covers the following responsibilities. - * - Dispatching a Drush command that uses strict option handling - * using a global option (e.g. --alias-path) places said global - * option BEFORE the command name. - * - Dispatching a Drush command that uses strict option handling - * using a site alias that contains a command-specific option - * places said option AFTER the command name. - */ - function testDispatchStrictOptions() { - $aliasPath = UNISH_SANDBOX . '/site-alias-directory'; - file_exists($aliasPath) ?: mkdir($aliasPath); - $aliasFile = $aliasPath . '/bar.aliases.drushrc.php'; - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['test'] = array( - 'remote-host' => 'fake.remote-host.com', - 'remote-user' => 'www-admin', - 'root' => '/fake/path/to/root', - 'uri' => 'default', - 'command-specific' => array( - 'rsync' => array( - 'delete' => TRUE, - ), - ), - ); - \$aliases['env-test'] = array( - 'root' => '/fake/path/to/root', - '#env-vars' => array( - 'DRUSH_ENV_TEST' => 'WORKING_CASE', - 'DRUSH_ENV_TEST2' => '{foo:[bar:{key:"val"},bar2:{key:"long val"}]}', - 'DRUSH_ENV_TEST3' => "WORKING CASE = TRUE", - ), - 'uri' => 'default', - ); -EOD; - file_put_contents($aliasFile, $aliasContents); - $options = array( - 'alias-path' => $aliasPath, - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - 'simulate' => TRUE, - ); - $this->drush('core-rsync', array('/a', '/b'), $options, '@test'); - $output = $this->getOutput(); - $command_position = strpos($output, 'core-rsync'); - $global_option_position = strpos($output, '--alias-path='); - $command_specific_position = strpos($output, '--delete'); - $this->assertTrue($command_position !== FALSE); - $this->assertTrue($global_option_position !== FALSE); - $this->assertTrue($command_specific_position !== FALSE); - $this->assertTrue($command_position > $global_option_position); - $this->assertTrue($command_position < $command_specific_position); - - $eval = '$env_test = getenv("DRUSH_ENV_TEST");'; - $eval .= '$env_test2 = getenv("DRUSH_ENV_TEST2");'; - $eval .= 'print json_encode(get_defined_vars());'; - $config = UNISH_SANDBOX . '/drushrc.php'; - $options = array( - 'alias-path' => $aliasPath, - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. - ); - $this->drush('unit-eval', array($eval), $options, '@env-test'); - $output = $this->getOutput(); - $actuals = json_decode(trim($output)); - $this->assertEquals('WORKING_CASE', $actuals->env_test); - - if ($this->is_windows()) { - $this->markTestSkipped('@todo. Needs quoting fix, and environment variables not widely used on Windows.'); - } - - $this->assertEquals('{foo:[bar:{key:"val"},bar2:{key:"long val"}]}', $actuals->env_test2); - $eval = 'print getenv("DRUSH_ENV_TEST3");'; - $this->drush('unit-eval', array($eval), $options, '@env-test'); - $output = $this->getOutput(); - $this->assertEquals( "WORKING CASE = TRUE", $output); - } - - - /** - * Test to see if rsync @site:%files calculates the %files path correctly. - * This tests the non-optimized code path in drush_sitealias_resolve_path_references. - * - * @todo This test does not appear to accomplish its goal. - */ - function testRsyncBothRemote() { - $aliasPath = UNISH_SANDBOX . '/site-alias-directory'; - file_exists($aliasPath) ?: mkdir($aliasPath); - $aliasFile = $aliasPath . '/remote.aliases.drushrc.php'; - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['one'] = array( - 'remote-host' => 'fake.remote-host.com', - 'remote-user' => 'www-admin', - 'root' => '/fake/path/to/root', - 'uri' => 'default', - ); - \$aliases['two'] = array( - 'remote-host' => 'other-fake.remote-host.com', - 'remote-user' => 'www-admin', - 'root' => '/other-fake/path/to/root', - 'uri' => 'default', - ); -EOD; - file_put_contents($aliasFile, $aliasContents); - $options = array( - 'alias-path' => $aliasPath, - 'simulate' => TRUE, - 'yes' => NULL, - ); - $this->drush('core-rsync', array("@remote.one:files", "@remote.two:tmp"), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1;'); - $output = $this->getOutput(); - $level = $this->log_level(); - $pattern = in_array($level, array('verbose', 'debug')) ? "Calling system(rsync -e 'ssh ' -akzv --stats --progress --yes %s /tmp);" : "Calling system(rsync -e 'ssh ' -akz --yes %s /tmp);"; - $expected = sprintf($pattern, UNISH_SANDBOX . "/web/sites/default/files"); - - - // Expected ouput: - // Simulating backend invoke: /path/to/php -d sendmail_path='true' /path/to/drush.php --php=/path/to/php --php-options=' -d sendmail_path='\''true'\''' --backend=2 --alias-path=/path/to/site-alias-directory --nocolor --root=/fake/path/to/root --uri=default core-rsync '@remote.one:files' /path/to/tmpdir 2>&1 - // Simulating backend invoke: /path/to/php -d sendmail_path='true' /path/to/drush.php --php=/path/to/php --php-options=' -d sendmail_path='\''true'\''' --backend=2 --alias-path=/path/to/site-alias-directory --nocolor --root=/fake/path/to/root --uri=default core-rsync /path/to/tmpdir/files '@remote.two:tmp' 2>&1' - // Since there are a lot of variable items in the output (e.g. path - // to a temporary folder), so we will use 'assertContains' to - // assert on portions of the output that does not vary. - $this->assertContains('Simulating backend invoke', $output); - $this->assertContains("core-rsync '@remote.one:files' /", $output); - $this->assertContains("/files '@remote.two:tmp'", $output); - } - - /** - * Assure that site lists work as expected. - * @todo Use --backend for structured return data. Depends on http://drupal.org/node/1043922 - */ - public function testSAList() { - $sites = $this->setUpDrupal(2); - $subdirs = array_keys($sites); - $eval = 'print "bon";'; - $options = array( - 'yes' => NULL, - 'verbose' => NULL, - 'root' => $this->webroot(), - ); - foreach ($subdirs as $dir) { - $dirs[] = "#$dir"; - } - $this->drush('php-eval', array($eval), $options, implode(',', $dirs)); - $output = $this->getOutputAsList(); - $expected = "#stage >> bon -#dev >> bon"; - $actual = implode("\n", $output); - $actual = trim(preg_replace('/^#[a-z]* *>> *$/m', '', $actual)); // ignore blank lines - $this->assertEquals($expected, $actual); - } - - /** - * Ensure that requesting a non-existent alias throws an error. - */ - public function testBadAlias() { - $this->drush('sa', array('@badalias'), array(), NULL, NULL, self::EXIT_ERROR); - } - - /** - * Ensure that a --uri on CLI overrides on provided by site alias during a backend invoke. - */ - public function testBackendHonorsAliasOverride() { - if (UNISH_DRUPAL_MAJOR_VERSION == 6) { - $this->markTestSkipped("Sites.php not available in Drupal 6 core."); - } - - // Test a standard remote dispatch. - $this->drush('core-status', array(), array('uri' => 'http://example.com', 'simulate' => NULL), 'user@server/path/to/drupal#sitename'); - $this->assertContains('--uri=http://example.com', $this->getOutput()); - - // Test a local-handling command which uses drush_redispatch_get_options(). - $this->drush('browse', array(), array('uri' => 'http://example.com', 'simulate' => NULL), 'user@server/path/to/drupal#sitename'); - $this->assertContains('--uri=http://example.com', $this->getOutput()); - - // Test a command which uses drush_invoke_process('@self') internally. - $sites = $this->setUpDrupal(1, TRUE); - $name = key($sites); - $sites_php = "\n\$sites['example.com'] = '$name';"; - file_put_contents($sites[$name]['root'] . '/sites/sites.php', $sites_php, FILE_APPEND); - $this->drush('pm-updatecode', array(), array('uri' => 'http://example.com', 'no' => NULL, 'no-core' => NULL, 'verbose' => NULL), '@' . $name); - $this->assertContains('--uri=http://example.com', $this->getErrorOutput()); - - // Test a remote alias that does not have a 'root' element - $aliasPath = UNISH_SANDBOX . '/site-alias-directory'; - @mkdir($aliasPath); - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['rootlessremote'] = array( - 'uri' => 'remoteuri', - 'remote-host' => 'exampleisp.com', - 'remote-user' => 'www-admin', - ); -EOD; - file_put_contents("$aliasPath/rootlessremote.aliases.drushrc.php", $aliasContents); - $this->drush('core-status', array(), array('uri' => 'http://example.com', 'simulate' => NULL, 'alias-path' => $aliasPath), '@rootlessremote'); - $output = $this->getOutput(); - $this->assertContains(' ssh ', $output); - $this->assertContains('--uri=http://example.com', $output); - - // Test a remote alias that does not have a 'root' element with cwd inside a Drupal root directory - $root = $this->webroot(); - $this->drush('core-status', array(), array('uri' => 'http://example.com', 'simulate' => NULL, 'alias-path' => $aliasPath), '@rootlessremote', $root); - $output = $this->getOutput(); - $this->assertContains(' ssh ', $output); - $this->assertContains('--uri=http://example.com', $output); - } - - /** - * Test to see if we can access aliases defined inside of - * a provided Drupal root in various locations where they - * may be stored. - */ - public function testAliasFilesInDocroot() { - $root = $this->webroot(); - - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['atroot'] = array( - 'root' => '/fake/path/to/othersite', - 'uri' => 'default', - ); -EOD; - @mkdir($root . "/drush"); - @mkdir($root . "/drush/site-aliases"); - file_put_contents($root . "/drush/site-aliases/atroot.aliases.drushrc.php", $aliasContents); - - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['insitefolder'] = array( - 'root' => '/fake/path/to/othersite', - 'uri' => 'default', - ); -EOD; - @mkdir($root . "/sites/all/drush"); - @mkdir($root . "/sites/all/drush/site-aliases"); - file_put_contents($root . "/sites/all/drush/site-aliases/sitefolder.aliases.drushrc.php", $aliasContents); - - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['aboveroot'] = array( - 'root' => '/fake/path/to/othersite', - 'uri' => 'default', - ); -EOD; - @mkdir($root . "/../drush"); - @mkdir($root . "/../drush/site-aliases"); - file_put_contents($root . "/../drush/site-aliases/aboveroot.aliases.drushrc.php", $aliasContents); - - // Ensure that none of these 'sa' commands return an error - $this->drush('sa', array('@atroot'), array(), '@dev'); - $this->drush('sa', array('@insitefolder'), array(), '@dev'); - $this->drush('sa', array('@aboveroot'), array(), '@dev'); - } - - - /** - * Ensure that Drush searches deep inside specified search locations - * for alias files. - */ - public function testDeepAliasSearching() { - $aliasPath = UNISH_SANDBOX . '/site-alias-directory'; - file_exists($aliasPath) ?: mkdir($aliasPath); - $deepPath = $aliasPath . '/deep'; - file_exists($deepPath) ?: mkdir($deepPath); - $aliasFile = $deepPath . '/baz.aliases.drushrc.php'; - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['deep'] = array( - 'remote-host' => 'fake.remote-host.com', - 'remote-user' => 'www-admin', - 'root' => '/fake/path/to/root', - 'uri' => 'default', - 'command-specific' => array( - 'rsync' => array( - 'delete' => TRUE, - ), - ), - ); -EOD; - file_put_contents($aliasFile, $aliasContents); - $options = array( - 'alias-path' => $aliasPath, - 'simulate' => TRUE, - ); - - $this->drush('sa', array('@deep'), $options); - - // Verify that the files directory is not recursed into. - $filesPath = $aliasPath . '/files'; - file_exists($filesPath) ?: mkdir($filesPath); - $aliasFile = $filesPath . '/biz.aliases.drushrc.php'; - $aliasContents = <<<EOD - <?php - // Written by unish. This file is safe to delete. - \$aliases['nope'] = array( - 'remote-host' => 'fake.remote-host.com', - 'remote-user' => 'www-admin', - 'root' => '/fake/path/to/root', - 'uri' => 'default', - 'command-specific' => array( - 'rsync' => array( - 'delete' => TRUE, - ), - ), - ); -EOD; - file_put_contents($aliasFile, $aliasContents); - $options = array( - 'alias-path' => $aliasPath, - 'simulate' => TRUE, - ); - - // This should not find the '@nope' alias. - $this->drush('sa', array('@nope'), $options, NULL, NULL, self::EXIT_ERROR); - } -} diff --git a/vendor/drush/drush/tests/siteAliasUnitTest.php b/vendor/drush/drush/tests/siteAliasUnitTest.php deleted file mode 100644 index 4b5251007224a9e1a72d74607cd6a1faa2110ede..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/siteAliasUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace Unish; - -/** - * Unit tests for sitealias.inc - * - * @group base - */ -class saUnitCase extends UnitUnishTestCase { - - /** - * Tests _sitealias_array_merge(). - * - * @see _sitealias_array_merge(). - */ - public function testArrayMerge() { - // Original site alias. - $site_alias_a = array( - 'remote-host' => 'fake.remote-host.com', - 'remote-user' => 'www-admin', - 'root' => '/fake/path/to/root', - 'uri' => 'default', - 'command-specific' => array( - 'rsync' => array( - 'delete' => TRUE, - ), - ), - ); - // Site alias which overrides some settings from $site_alias_a. - $site_alias_b = array( - 'remote-host' => 'another-fake.remote-host.com', - 'remote-user' => 'www-other', - 'root' => '/fake/path/to/root', - 'uri' => 'default', - 'command-specific' => array( - 'rsync' => array( - 'delete' => FALSE, - ), - ), - ); - // Expected result from merging $site_alias_a and $site_alias_b. - $site_alias_expected = array( - 'remote-host' => 'another-fake.remote-host.com', - 'remote-user' => 'www-other', - 'root' => '/fake/path/to/root', - 'uri' => 'default', - 'command-specific' => array( - 'rsync' => array( - 'delete' => FALSE, - ), - ), - ); - - $site_alias_result = _sitealias_array_merge($site_alias_a, $site_alias_b); - $this->assertEquals($site_alias_expected, $site_alias_result); - } -} diff --git a/vendor/drush/drush/tests/siteIntallD6Test.php b/vendor/drush/drush/tests/siteIntallD6Test.php deleted file mode 100644 index 91db1e4aba72ba83a39e644941574a62b1d33dcb..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/siteIntallD6Test.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests for site-install on a Drupal 6 installation. - * - * @group commands - */ -class siteInstallD6Case extends CommandUnishTestCase { - - function setUp() { - if (UNISH_DRUPAL_MAJOR_VERSION != 6) { - $this->markTestSkipped('This test class is designed for Drupal 6.'); - return; - } - } - - /** - * Test a D6 install with extra options. - */ - public function testExtraConfigurationOptions() { - // Set up codebase without installing Drupal. - $sites = $this->setUpDrupal(1, FALSE, '6'); - $root = $this->webroot(); - $site = key($sites); - - // Copy the "example" test profile into the newly created site's profiles directory - $profile_dir = "$root/profiles/example"; - mkdir($profile_dir); - copy(dirname(__FILE__) . '/resources/example.profile', $profile_dir . '/example.profile'); - - $test_string = $this->randomString(); - // example.profile Has values 0-2 defined as allowed. - $test_int = rand(0, 2); - $site_name = $this->randomString(); - - $this->drush('site-install', array( - // First argument is the profile name - 'example', - // Then the extra profile options - "myopt1=$test_string", - "myopt2=$test_int", - ), - array( - 'db-url' => $this->db_url($site), - 'yes' => NULL, - 'sites-subdir' => $site, - 'root' => $root, - 'site-name' => $site_name, - 'uri' => $site, - )); - - $this->checkVariable('site_name', $site_name, $site); - $this->checkVariable('myopt1', $test_string, $site); - $this->checkVariable('myopt2', $test_int, $site); - } - - /** - * Check the value of a Drupal variable against an expectation using drush. - * - * @param $name - * The variable name. - * @param $value - * The expected value of this variable. - * @param $site - * The name of an individual multisite installation site. - */ - private function checkVariable($name, $value, $site) { - $options = array( - 'root' => $this->webroot(), - 'uri' => $site, - ); - - $this->drush('variable-get', array($name), $options); - $this->assertEquals("$name: $value", $this->getOutput()); - } -} diff --git a/vendor/drush/drush/tests/siteSetTest.php b/vendor/drush/drush/tests/siteSetTest.php deleted file mode 100644 index 46d29d3ea7174ffd3b2a83996b6877a3488b06d4..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/siteSetTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group base - */ -class siteSetCommandCase extends CommandUnishTestCase { - - function testSiteSet() { - if ($this->is_windows()) { - $this->markTestSkipped('Site-set not currently available on Windows.'); - } - $sites = $this->setUpDrupal(1, TRUE); - $site_names = array_keys($sites); - $alias = '@' . $site_names[0]; - - $this->drush('ev', array("drush_invoke('site-set', '$alias'); print drush_sitealias_site_get();")); - $output = $this->getOutput(); - $this->assertEquals("Site set to $alias\n$alias", $output); - - $this->drush('site-set', array()); - $output = $this->getOutput(); - $this->assertEquals('Site set to @none', $output); - - $this->drush('site-set', array($alias)); - $expected = 'Site set to ' . $alias; - $output = $this->getOutput(); - $this->assertEquals($expected, $output); - - $this->drush('ev', array("drush_invoke('site-set', '@none'); drush_invoke('site-set', '$alias'); drush_invoke('site-set', '@none'); drush_invoke('site-set', '-'); print drush_sitealias_site_get();")); - $output = $this->getOutput(); - $this->assertEquals("Site set to @none -Site set to $alias -Site set to @none -Site set to $alias -$alias", $output); - } -} diff --git a/vendor/drush/drush/tests/siteSetUnitTest.php b/vendor/drush/drush/tests/siteSetUnitTest.php deleted file mode 100644 index 3b2bf79ac940f79aaede37f881d682bc1a0bb9a1..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/siteSetUnitTest.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group base - */ -class siteSetUnitTest extends UnitUnishTestCase { - - function testSiteSet() { - if ($this->is_windows()) { - $this->markTestSkipped('Site-set not currently available on Windows.'); - } - - $tmp_path = UNISH_TMP; - putenv("TMPDIR=$tmp_path"); - $posix_pid = posix_getppid(); - $username = drush_get_username(); - - $expected_file = UNISH_TMP . '/drush-env-' . $username . '/drush-drupal-site-' . $posix_pid; - $filename = drush_sitealias_get_envar_filename(); - - $this->assertEquals($expected_file, $filename); - } -} diff --git a/vendor/drush/drush/tests/siteSshTest.php b/vendor/drush/drush/tests/siteSshTest.php deleted file mode 100644 index 0cf8c5823e4027d3afa02bef308fd019db68ae9b..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/siteSshTest.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -namespace Unish; - -/** - * @file - * Tests for ssh.drush.inc - * - * @group commands - */ -class siteSshCase extends CommandUnishTestCase { - - /** - * Test drush ssh --simulate. No additional bash passed. - */ - public function testInteractive() { - if ($this->is_windows()) { - $this->markTestSkipped('ssh command not currently available on Windows.'); - } - - $options = array( - 'simulate' => NULL, - ); - $this->drush('ssh', array(), $options, 'user@server/path/to/drupal#sitename', NULL, self::EXIT_SUCCESS, '2>&1'); - $output = $this->getOutput(); - $expected = sprintf('Calling proc_open(ssh -o PasswordAuthentication=no -t %s@%s %s);', self::escapeshellarg('user'), self::escapeshellarg('server'), "'cd /path/to/drupal && bash -l'"); - $this->assertEquals($expected, $output); - } - - /** - * Test drush ssh --simulate 'date'. - * @todo Run over a site list. drush_sitealias_get_record() currently cannot - * handle a site list comprised of longhand site specifications. - */ - public function testNonInteractive() { - $options = array( - 'cd' => '0', - 'simulate' => NULL, - ); - $this->drush('ssh', array('date'), $options, 'user@server/path/to/drupal#sitename', NULL, self::EXIT_SUCCESS, '2>&1'); - $output = $this->getOutput(); - $expected = sprintf('Calling proc_open(ssh -o PasswordAuthentication=no %s@%s %s);', self::escapeshellarg('user'), self::escapeshellarg('server'), self::escapeshellarg('date')); - $this->assertEquals($expected, $output); - } - - /** - * Test drush ssh with multiple arguments (preferred form). - */ - public function testSshMultipleArgs() { - $options = array( - 'cd' => '0', - 'simulate' => NULL, - ); - $this->drush('ssh', array('ls', '/path1', '/path2'), $options, 'user@server/path/to/drupal#sitename', NULL, self::EXIT_SUCCESS, '2>&1'); - $output = $this->getOutput(); - $expected = sprintf('Calling proc_open(ssh -o PasswordAuthentication=no %s@%s %s);', self::escapeshellarg('user'), self::escapeshellarg('server'), self::escapeshellarg('ls /path1 /path2')); - $this->assertEquals($expected, $output); - } - - /** - * Test drush ssh with multiple arguments (legacy form). - */ - public function testSshMultipleArgsLegacy() { - $options = array( - 'cd' => '0', - 'simulate' => NULL, - ); - $this->drush('ssh', array('ls /path1 /path2'), $options, 'user@server/path/to/drupal#sitename', NULL, self::EXIT_SUCCESS, '2>&1'); - $output = $this->getOutput(); - $expected = sprintf('Calling proc_open(ssh -o PasswordAuthentication=no %s@%s %s);', self::escapeshellarg('user'), self::escapeshellarg('server'), self::escapeshellarg('ls /path1 /path2')); - $this->assertEquals($expected, $output); - } -} diff --git a/vendor/drush/drush/tests/sqlConnectCreateTest.php b/vendor/drush/drush/tests/sqlConnectCreateTest.php deleted file mode 100644 index 6deb100982445f4fcd436850720532e03a084917..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/sqlConnectCreateTest.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests sql-connect command - * - * Installs Drupal and checks that the given URL by sql-connect is correct. - * - * @group commands - * @group sql - */ -class SqlConnectCase extends CommandUnishTestCase { - - function testSqlConnect() { - $sites = $this->setUpDrupal(1, TRUE); - $options = array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - ); - - // Get the connection details with sql-connect and check its structure. - $this->drush('sql-connect', array(), $options); - $connectionString = $this->getOutput(); - - // Not all drivers need -e option like sqlite - $shell_options = "-e"; - $db_driver = $this->db_driver(); - if ($db_driver == 'mysql') { - $this->assertRegExp('/^mysql --user=[^\s]+ --password=.* --database=[^\s]+ --host=[^\s]+/', $connectionString); - } - elseif ($db_driver == 'sqlite') { - $this->assertContains('sqlite3', $connectionString); - $shell_options = ''; - } - elseif ($db_driver == 'pgsql') { - $this->assertRegExp('/^psql -q --dbname=[^\s]+ --host=[^\s]+ --port=[^\s]+ --username=[^\s]+/', $connectionString); - } - else { - $this->markTestSkipped('sql-connect test does not recognize database type in ' . UNISH_DB_URL); - } - - // Issue a query and check the result to verify the connection. - $this->execute($connectionString . ' ' . $shell_options . ' "SELECT uid FROM users where uid = 1;"'); - $output = $this->getOutput(); - $this->assertContains('1', $output); - - // Run 'core-status' and insure that we can bootstrap Drupal. - $this->drush('core-status', array("Drupal bootstrap"), $options); - $output = $this->getOutput(); - $this->assertContains('Successful', $output); - - // Test to see if 'sql-create' can erase the database. - // The only output is a confirmation string, so we'll run - // other commands to confirm that this worked. - $this->drush('sql-create', array(), $options); - - // Try to execute a query. This should give a "table not found" error. - $this->execute($connectionString . ' ' . $shell_options . ' "SELECT uid FROM users where uid = 1;"', self::EXIT_ERROR); - - // We should still be able to run 'core-status' without getting an - // error, although Drupal should not bootstrap any longer. - $this->drush('core-status', array("Drupal bootstrap"), $options); - $output = $this->getOutput(); - $this->assertNotContains('Successful', $output); - } -} diff --git a/vendor/drush/drush/tests/sqlDumpTest.php b/vendor/drush/drush/tests/sqlDumpTest.php deleted file mode 100644 index 709ff6d4974d42b50b70e48b27d58bbe3a9571ee..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/sqlDumpTest.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -namespace Unish; - -/** - * Tests for sql-dump commands. - * - * @group commands - * @group sql - * @group slow - */ -class SqlDumpTest extends CommandUnishTestCase { - - /** - * Test that a dump file is created successfully. - */ - function testSqlDump() { - if ($this->db_driver() == 'sqlite') { - $this->markTestSkipped('SQL Dump does not apply to SQLite.'); - return; - } - - $this->setUpDrupal(1, TRUE); - $root = $this->webroot(); - $uri = 'dev'; - $full_dump_file_path = UNISH_SANDBOX . DIRECTORY_SEPARATOR . 'full_db.sql'; - - $options = array( - 'result-file' => $full_dump_file_path, - // Last 5 entries are for D8+ - 'skip-tables-list' => 'hist*,cache*,router,config*,watchdog,key_valu*', - 'yes' => NULL, - ); - $site_selection_options = array( - 'root' => $root, - 'uri' => $uri, - ); - - // Test --extra option - if ($this->db_driver() == 'mysql') { - $this->drush('sql-dump', array(), array_merge($options, $site_selection_options, array('extra' => '--skip-add-drop-table'))); - $this->assertFileExists($full_dump_file_path); - $full_dump_file = file_get_contents($full_dump_file_path); - $this->assertNotContains('DROP TABLE IF EXISTS', $full_dump_file); - } - - - // First, do a test without any aliases, and dump the whole database - $this->drush('sql-dump', array(), array_merge($options, $site_selection_options)); - $this->assertFileExists($full_dump_file_path); - $full_dump_file = file_get_contents($full_dump_file_path); - // Test that we have sane contents. - $this->assertContains('queue', $full_dump_file); - // Test skip-files-list and wildcard expansion. - $this->assertNotContains('history', $full_dump_file); - // Next, set up an alias file and run a couple of simulated - // tests to see if options are propagated correctly. - // Control: insure options are not set when not specified - unset($options['skip-tables-list']); - unlink($full_dump_file_path); - $this->drush('sql-dump', array(), array_merge($options, $site_selection_options)); - $this->assertFileExists($full_dump_file_path); - $full_dump_file = file_get_contents($full_dump_file_path); - // Test that we have sane contents. - $this->assertContains('queue', $full_dump_file); - // Test skip-files-list and wildcard expansion. - $this->assertContains('history', $full_dump_file); - - $aliasPath = UNISH_SANDBOX . '/aliases'; - mkdir($aliasPath); - $aliasFile = $aliasPath . '/bar.aliases.drushrc.php'; - $aliasContents = <<<EOD - <?php - // Written by Unish. This file is safe to delete. - \$aliases['test'] = array( - 'root' => '$root', - 'uri' => '$uri', - 'site' => 'stage', - 'command-specific' => array( - 'sql-dump' => array( - 'skip-tables-list' => 'hist*,cache*,router,config*,watchdog,key_valu*', - ), - ), - ); -EOD; - file_put_contents($aliasFile, $aliasContents); - $options['alias-path'] = $aliasPath; - unlink($full_dump_file_path); - // Now run again with an alias, and test to see if the option is there - $this->drush('sql-dump', array(), array_merge($options), '@test'); - $this->assertFileExists($full_dump_file_path); - $full_dump_file = file_get_contents($full_dump_file_path); - // Test that we have sane contents. - $this->assertContains('queue', $full_dump_file); - // Test skip-files-list and wildcard expansion. - $this->assertNotContains('history', $full_dump_file); - // Repeat control test: options not recovered in absence of an alias. - unlink($full_dump_file_path); - $this->drush('sql-dump', array(), array_merge($options, $site_selection_options)); - $this->assertFileExists($full_dump_file_path); - $full_dump_file = file_get_contents($full_dump_file_path); - // Test that we have sane contents. - $this->assertContains('queue', $full_dump_file); - // Test skip-files-list and wildcard expansion. - $this->assertContains('history', $full_dump_file); - // Now run yet with @self, and test to see that Drush can recover the option - // --skip-tables-list, defined in @test. - unlink($full_dump_file_path); - $this->drush('sql-dump', array(), array_merge($options, $site_selection_options), '@self'); - $this->assertFileExists($full_dump_file_path); - $full_dump_file = file_get_contents($full_dump_file_path); - // Test that we have sane contents. - $this->assertContains('queue', $full_dump_file); - // Test skip-files-list and wildcard expansion. - $this->assertNotContains('history', $full_dump_file); - } -} diff --git a/vendor/drush/drush/tests/sqlSyncTest.php b/vendor/drush/drush/tests/sqlSyncTest.php deleted file mode 100644 index 57649891b7ef3582678cb3188c259fd030081689..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/sqlSyncTest.php +++ /dev/null @@ -1,180 +0,0 @@ -<?php - -/** -* @file -* For now we only test sql-sync in simulated mode. -* -* Future: Using two copies of Drupal, we could test -* overwriting one site with another. -*/ - -namespace Unish; - -/** - * @group slow - * @group commands - * @group sql - */ -class sqlSyncTest extends CommandUnishTestCase { - - /** - * Covers the following responsibilities. - * - A user created on the source site is copied to the destination site. - * - The email address of the copied user is sanitized on the destination site. - * - * General handling of site aliases will be in sitealiasTest.php. - */ - public function testLocalSqlSync() { - if ($this->db_driver() == 'sqlite') { - $this->markTestSkipped('SQL Sync does not apply to SQLite.'); - return; - } - - $sites = $this->setUpDrupal(2, TRUE); - return $this->localSqlSync(); - } - /** - * Do the same test as above, but use Drupal 6 sites instead of Drupal 7. - */ - public function testLocalSqlSyncD6() { - if (UNISH_DRUPAL_MAJOR_VERSION != 6) { - $this->markTestSkipped('This test class is designed for Drupal 6.'); - return; - } - - chdir(UNISH_TMP); // Avoids perm denied Windows error. - $this->setUpBeforeClass(); - $sites = $this->setUpDrupal(2, TRUE, '6'); - return $this->localSqlSync(); - } - - public function localSqlSync() { - - $options = array( - 'root' => $this->webroot(), - 'uri' => 'stage', - 'yes' => NULL, - ); - - // Create a user in the staging site - $name = 'joe.user'; - $mail = "joe.user@myhome.com"; - - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - // Add user fields and a test User. - $this->drush('pm-enable', array('field,text,telephone,comment'), $options + array('yes' => NULL)); - $this->drush('php-script', array( - 'user_fields-D' . UNISH_DRUPAL_MAJOR_VERSION, - $name, - $mail - ), $options + array( - 'script-path' => __DIR__ . '/resources', - 'debug' => NULL - )); - } - else { - $this->drush('user-create', array($name), $options + array('password' => 'password', 'mail' => $mail)); - } - - // Copy stage to dev with --sanitize. - $sync_options = array( - 'sanitize' => NULL, - 'yes' => NULL, - // Test wildcards expansion from within sql-sync. Also avoid D8 persistent entity cache. - 'structure-tables-list' => 'cache,cache*', - ); - $this->drush('sql-sync', array('@stage', '@dev'), $sync_options); - - // Confirm that the sample user has the correct email address on the staging site - $this->drush('user-information', array($name), $options + array('pipe' => NULL)); - $output = $this->getOutput(); - $row = str_getcsv($output); - $uid = $row[1]; - $this->assertEquals($mail, $row[2], 'email address is unchanged on source site.'); - $this->assertEquals($name, $row[0]); - - $options = array( - 'root' => $this->webroot(), - 'uri' => 'dev', - 'yes' => NULL, - ); - // Confirm that the sample user's email address has been sanitized on the dev site - $this->drush('user-information', array($name), $options + array('pipe' => NULL)); - $output = $this->getOutput(); - $row = str_getcsv($output); - $uid = $row[1]; - $this->assertEquals("user+$uid@localhost.localdomain", $row[2], 'email address was sanitized on destination site.'); - $this->assertEquals($name, $row[0]); - - // @todo Confirm that the role_permissions table no longer exists in dev site (i.e. wildcard expansion works in sql-sync). - // $this->drush('sql-query', array('SELECT * FROM role_permission'), $options, NULL, NULL, self::EXIT_ERROR); - - // Copy stage to dev with --sanitize and a fixed sanitized email - $sync_options = array( - 'sanitize' => NULL, - 'yes' => NULL, - 'sanitize-email' => 'user@mysite.org', - // Test wildcards expansion from within sql-sync. Also avoid D8 persistent entity cache. - 'structure-tables-list' => 'cache,cache*', - ); - $this->drush('sql-sync', array('@stage', '@dev'), $sync_options); - - $options = array( - 'root' => $this->webroot(), - 'uri' => 'dev', - 'yes' => NULL, - ); - // Confirm that the sample user's email address has been sanitized on the dev site - $this->drush('user-information', array($name), $options + array('pipe' => NULL)); - $output = $this->getOutput(); - $row = str_getcsv($output); - $uid = $row[1]; - $this->assertEquals("user@mysite.org", $row[2], 'email address was sanitized (fixed email) on destination site.'); - $this->assertEquals($name, $row[0]); - - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - $fields = [ - 'field_user_email' => 'joe.user.alt@myhome.com', - 'field_user_string' => 'Private info', - 'field_user_string_long' => 'Really private info', - 'field_user_text' => 'Super private info', - 'field_user_text_long' => 'Super duper private info', - 'field_user_text_with_summary' => 'Private', - ]; - // Assert that field DO NOT contain values. - foreach ($fields as $field_name => $value) { - $this->assertUserFieldContents($field_name, $value, $options); - } - - // Assert that field_user_telephone DOES contain "5555555555". - $this->assertUserFieldContents('field_user_telephone', '5555555555', $options, TRUE); - } - } - - /** - * Assert that a field on the user entity does or does not contain a value. - * - * @param string $field_name - * The machine name of the field. - * @param string $value - * The field value. - * @param array $options - * Options to be added to the sql-query command. - * @param bool $should_contain - * Whether the field should contain the value. Defaults to false. - */ - public function assertUserFieldContents($field_name, $value, $options = [], $should_contain = FALSE) { - $table = 'user__' . $field_name; - $column = $field_name . '_value'; - $this->drush('sql-query', [ "SELECT $column FROM $table LIMIT 1" ], $options); - $output = $this->getOutput(); - $this->assertNotEmpty($output); - - if ($should_contain) { - $this->assertContains($value, $output); - } - else { - $this->assertNotContains($value, $output); - } - } -} diff --git a/vendor/drush/drush/tests/tablesUnitTest.php b/vendor/drush/drush/tests/tablesUnitTest.php deleted file mode 100644 index b61b2575b313b1d7f78178eac6f9422938a6caea..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/tablesUnitTest.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php - -namespace Unish; - -/** - * Unit tests for table formatting. - * - * @group base - */ -class tablesUnitTest extends UnitUnishTestCase { - function setUp() { - // Bootstrap to ensure the auto-loaded is running so that Console_Table is found. - drush_preflight(); - $this->original_columns = drush_get_context('DRUSH_COLUMNS'); - - // Some table data we reuse between tests. - $this->numbers = array( - array('1', '12', '123'), - array('1234', '12345', '123456'), - array('1234567', '12345678', '123456789'), - ); - $this->words = array( - array('Drush is a command line shell', 'scripting interface', 'for Drupal'), - array('A veritable', 'Swiss Army knife', 'designed to make life easier for us'), - ); - } - - function tearDown() { - drush_set_context('DRUSH_COLUMNS', $this->original_columns); - } - - /** - * Tests drush_format_table() at various table widths with automatic column - * sizing. - * - * @see drush_format_table(). - */ - public function testFormatAutoWidths() { - // print "\n'" . str_replace("\n", "' . PHP_EOL . '", $output) . "'\n"; - drush_set_context('DRUSH_COLUMNS', 16); - $output = drush_format_table($this->numbers); - $expected = ' 1 12 123 ' . PHP_EOL . ' 123 123 1234 ' . PHP_EOL . ' 4 45 56 ' . PHP_EOL . ' 123 123 1234 ' . PHP_EOL . ' 456 456 5678 ' . PHP_EOL . ' 7 78 9 ' . PHP_EOL; - $this->assertEquals($expected, $output); - - drush_set_context('DRUSH_COLUMNS', 22); - $output = drush_format_table($this->numbers); - $expected = ' 1 12 123 ' . PHP_EOL . ' 1234 12345 123456 ' . PHP_EOL . ' 12345 12345 123456 ' . PHP_EOL . ' 67 678 789 ' . PHP_EOL; - $this->assertEquals($expected, $output); - - drush_set_context('DRUSH_COLUMNS', 24); - $output = drush_format_table($this->numbers); - $expected = ' 1 12 123 ' . PHP_EOL . ' 1234 12345 123456 ' . PHP_EOL . ' 123456 123456 123456 ' . PHP_EOL . ' 7 78 789 ' . PHP_EOL; - $this->assertEquals($expected, $output); - - drush_set_context('DRUSH_COLUMNS', 80); - $output = drush_format_table($this->numbers); - $expected = ' 1 12 123 ' . PHP_EOL . ' 1234 12345 123456 ' . PHP_EOL . ' 1234567 12345678 123456789 ' . PHP_EOL; - $this->assertEquals($expected, $output); - } - - /** - * Tests drush_format_table() at various table widths. - * - * @see drush_format_table(). - */ - public function testFormatWidths() { - // print "\n'" . str_replace("\n", "' . PHP_EOL . '", $output) . "'\n"; - drush_set_context('DRUSH_COLUMNS', 22); - $output = drush_format_table($this->numbers, FALSE, array(2)); - $expected = ' 1 12 123 ' . PHP_EOL . ' 12 12345 123456 ' . PHP_EOL . ' 34 ' . PHP_EOL . ' 12 1234567 1234567 ' . PHP_EOL . ' 34 8 89 ' . PHP_EOL . ' 56 ' . PHP_EOL . ' 7 ' . PHP_EOL; - $this->assertEquals($expected, $output); - - $output = drush_format_table($this->numbers, FALSE, array(10)); - $expected = ' 1 12 123 ' . PHP_EOL . ' 1234 123 123 ' . PHP_EOL . ' 45 456 ' . PHP_EOL . ' 1234567 123 123 ' . PHP_EOL . ' 456 456 ' . PHP_EOL . ' 78 789 ' . PHP_EOL; - $this->assertEquals($expected, $output); - - $output = drush_format_table($this->numbers, FALSE, array(2, 2)); - $expected = ' 1 12 123 ' . PHP_EOL . ' 12 12 123456 ' . PHP_EOL . ' 34 34 ' . PHP_EOL . ' 5 ' . PHP_EOL . ' 12 12 123456789 ' . PHP_EOL . ' 34 34 ' . PHP_EOL . ' 56 56 ' . PHP_EOL . ' 7 78 ' . PHP_EOL; - $this->assertEquals($expected, $output); - - $output = drush_format_table($this->numbers, FALSE, array(4, 4, 4)); - $expected = ' 1 12 123 ' . PHP_EOL . ' 1234 1234 1234 ' . PHP_EOL . ' 5 56 ' . PHP_EOL . ' 1234 1234 1234 ' . PHP_EOL . ' 567 5678 5678 ' . PHP_EOL . ' 9 ' . PHP_EOL; - $this->assertEquals($expected, $output); - } - - /** - * Tests drush_format_table() with a header. - * - * @see drush_format_table(). - */ - public function testFormatTableHeader() { - drush_set_context('DRUSH_COLUMNS', 16); - $rows = $this->numbers; - array_unshift($rows, array('A', 'B', 'C')); - $output = drush_format_table($rows, TRUE); - $expected = ' A B C ' . PHP_EOL . ' 1 12 123 ' . PHP_EOL . ' 123 123 1234 ' . PHP_EOL . ' 4 45 56 ' . PHP_EOL . ' 123 123 1234 ' . PHP_EOL . ' 456 456 5678 ' . PHP_EOL . ' 7 78 9 ' . PHP_EOL; - $this->assertEquals($expected, $output); - } - - /** - * Tests drush_format_table() with word wrapping. - * - * @see drush_format_table(). - */ - public function testFormatTableWordWrap() { - drush_set_context('DRUSH_COLUMNS', 60); - $output = drush_format_table($this->words); - $expected = ' Drush is a command scripting for Drupal ' . PHP_EOL . ' line shell interface ' . PHP_EOL . ' A veritable Swiss Army knife designed to make ' . PHP_EOL . ' life easier for us ' . PHP_EOL; - $this->assertEquals($expected, $output); - } -} diff --git a/vendor/drush/drush/tests/unit.drush.inc b/vendor/drush/drush/tests/unit.drush.inc deleted file mode 100644 index 817f89fe591df91f76f1bb4617f5b75945343cd2..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/unit.drush.inc +++ /dev/null @@ -1,151 +0,0 @@ -<?php - -/** - * @file - * Commands which are useful for unit tests. - */ - -/** - * Implementation of hook_drush_command(). - */ -function unit_drush_command() { - $items['unit'] = array( - 'description' => 'No-op command, used to test completion for commands that start the same as other commands.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - $items['unit-eval'] = array( - 'description' => 'Works like php-eval. Used for testing $command_specific context.', - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'callback' => 'drush_core_php_eval', - ); - $items['unit-invoke'] = array( - 'description' => 'Return an array indicating which invoke hooks got called.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'callback' => 'drush_unit_invoke_primary', - ); - $items['unit-batch'] = array( - 'description' => 'Run a batch process.', - 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - ); - $items['unit-return-options'] = array( - 'description' => 'Return options as function result.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - $items['unit-return-argv'] = array( - 'description' => 'Return original argv as function result.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - $items['missing-callback'] = array( - 'description' => 'Command with no callback function, to test error reporting.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - ); - $items['unit-drush-dependency'] = array( - 'description' => 'Command depending on an unknown commandfile.', - 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'drush dependencies' => array('unknown-commandfile'), - ); - return $items; -} - -// Implement each invoke hook with the same single line of code. -// That line records that the hook was called. -function drush_unit_invoke_init() {unit_invoke_log(__FUNCTION__);} -function drush_unit_invoke_validate() {unit_invoke_log(__FUNCTION__);} -function drush_unit_pre_unit_invoke() {unit_invoke_log(__FUNCTION__);} -// Primary callback is not invoked when command specifies a 'callback'. -// function drush_unit_invoke() {unit_invoke_log(__FUNCTION__);} -function drush_unit_invoke_primary() {unit_invoke_log(__FUNCTION__);} -function drush_unit_pre_unit_invoke_rollback() {unit_invoke_log(__FUNCTION__);} -function drush_unit_post_unit_invoke_rollback() {unit_invoke_log(__FUNCTION__);} - -// Record that hook_drush_init() fired. -function unit_drush_init() { - $command = drush_get_command(); - if ($command['command'] == 'unit-invoke') { - unit_invoke_log(__FUNCTION__); - } -} - -function drush_unit_post_unit_invoke() { - // Record that this hook was called. - unit_invoke_log(__FUNCTION__); - - // Make sure we enter into rollback. - drush_set_error(''); -} - -/** - * The final invoke hook. Emit the call history. - * Cannot use 'exit' as it does not fire in rollback scenario. - */ -function drush_unit_invoke_validate_rollback() { - unit_invoke_log(__FUNCTION__); - print json_encode(unit_invoke_log()); -} - -function unit_invoke_log($function = NULL) { - static $called = array(); - if ($function) { - $called[] = $function; - } - else { - return $called; - } -} - -/** - * Command callback. - */ -function drush_unit_batch() { - // Reduce php memory/time limits to test backend respawn. - // TODO. - - $batch = array( - 'operations' => array( - array('_drush_unit_batch_operation', array()), - ), - 'finished' => '_drush_unit_batch_finished', - // 'file' => Doesn't work for us. Drupal 7 enforces this path - // to be relative to DRUPAL_ROOT. - // @see _batch_process(). - ); - batch_set($batch); - drush_backend_batch_process(); - - // Print the batch output. - drush_backend_output(); -} - -function _drush_unit_batch_operation(&$context) { - $context['message'] = "!!! ArrayObject does its job."; - - for ($i = 0; $i < 5; $i++) { - drush_print("Iteration $i"); - } - $context['finished'] = 1; -} - -function _drush_unit_batch_finished() { - // Restore php limits. - // TODO. -} - -// Return all of the option values passed in to this routine, minus the -// global options. -function drush_unit_return_options() { - $all_option_values = array_merge(drush_get_context('cli'), drush_get_context('stdin')); - foreach (drush_get_global_options() as $key => $info) { - unset($all_option_values[$key]); - } - if (isset($all_option_values['log-message'])) { - drush_log($all_option_values['log-message'], 'warning'); - drush_log("done", 'warning'); - unset($all_option_values['log-message']); - } - return $all_option_values; -} - -// Return all of the original arguments passed to this script -function drush_unit_return_argv() { - return drush_get_context('argv'); -} diff --git a/vendor/drush/drush/tests/userTest.php b/vendor/drush/drush/tests/userTest.php deleted file mode 100644 index bdd6e75478d1de822fe0ecc510dbac7c08f1b0b5..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/userTest.php +++ /dev/null @@ -1,177 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group slow - * @group commands - */ -class userCase extends CommandUnishTestCase { - - const NAME = 'example'; - private static $authenticated; - private static $status_prop; - - function setUp() { - if (!$this->getSites()) { - $this->setUpDrupal(1, TRUE); - self::$authenticated = 'authenticated'; - self::$status_prop = 'status'; - if (UNISH_DRUPAL_MAJOR_VERSION < 8) { - self::$authenticated .= ' user'; - } - else { - self::$status_prop = 'user_status'; - } - - $this->userCreate(); - } - } - - function testBlockUnblock() { - $this->drush('user-block', array(self::NAME), $this->options()); - $this->drush('user-information', array(self::NAME), $this->options() + array('format' => 'json')); - $uid = UNISH_DRUPAL_MAJOR_VERSION == 6 ? 3 : 2; - $output = $this->getOutputFromJSON($uid); - $this->assertEquals(0, $output->{self::$status_prop}, 'User is blocked.'); - - // user-unblock - $this->drush('user-unblock', array(self::NAME), $this->options()); - $this->drush('user-information', array(self::NAME), $this->options() + array('format' => 'json')); - $output = $this->getOutputFromJSON($uid); - $this->assertEquals(1, $output->{self::$status_prop}, 'User is unblocked.'); - } - - function testUserRole() { - // First, create the role since we use testing install profile. - $this->drush('role-create', array('test role'), $this->options()); - $this->drush('user-add-role', array('test role', self::NAME), $this->options()); - $this->drush('user-information', array(self::NAME), $this->options() + array('format' => 'json')); - $uid = UNISH_DRUPAL_MAJOR_VERSION == 6 ? 3 : 2; - $output = $this->getOutputFromJSON($uid); - $expected = array(self::$authenticated, 'test role'); - $this->assertEquals($expected, array_values((array)$output->roles), 'User has test role.'); - - // user-remove-role - $this->drush('user-remove-role', array('test role', self::NAME), $this->options()); - $this->drush('user-information', array(self::NAME), $this->options() + array('format' => 'json')); - $output = $this->getOutputFromJSON($uid); - $expected = array(self::$authenticated); - $this->assertEquals($expected, array_values((array)$output->roles), 'User removed test role.'); - } - - function testUserPassword() { - $newpass = 'newpass'; - $name = self::NAME; - $this->drush('user-password', array(self::NAME), $this->options() + array('password' => $newpass)); - // user_authenticate() is more complex in D6 so skip it. - switch (UNISH_DRUPAL_MAJOR_VERSION) { - case 6: - $this->markTestSkipped('Drupal 6 authentication too complex for testing.'); - break; - case 7: - $eval = "return user_authenticate('$name', '$newpass')"; - break; - case 8: - $eval = "return \\Drupal::service('user.auth')->authenticate('$name', '$newpass');"; - break; - } - $this->drush('php-eval', array($eval), $this->options()); - $output = $this->getOutput(); - $this->assertEquals("'2'", $output, 'User can login with new password.'); - } - - function testUserLogin() { - // Check if user-login on non-bootstrapped environment returns error. - $this->drush('user-login', array(), array(), NULL, NULL, self::EXIT_ERROR); - - // Check user-login - $user_login_options = $this->options() + array('simulate' => TRUE, 'browser' => 'unish'); - // Collect full logs so we can check browser. - $this->drush('user-login', array(), $user_login_options + array('backend' => NULL)); - $parsed = $this->parse_backend_output($this->getOutput()); - $url = parse_url($parsed['output']); - $this->assertContains('/user/reset/1', $url['path'], 'Login returned a reset URL for uid 1 by default'); - $browser = FALSE; - foreach ($parsed['log'] as $key => $log) { - // Regarding 'strip_tags', see https://github.com/drush-ops/drush/issues/1637 - if (strpos(strip_tags($log['message']), 'Opening browser unish at http://') === 0) { - $browser = TRUE; - } - } - $this->assertEquals($browser, TRUE, 'Correct browser opened at correct URL'); - // Check specific user and path argument. - $uid = UNISH_DRUPAL_MAJOR_VERSION == 6 ? 3 : 2; - $this->drush('user-login', array(self::NAME, 'node/add'), $user_login_options); - $output = $this->getOutput(); - $url = parse_url($output); - // user_pass_reset_url encodes the URL in D6, but not in D7 or D8 - $query = $url['query']; - if (UNISH_DRUPAL_MAJOR_VERSION < 7) { - $query = urldecode($query); - } - $this->assertContains('/user/reset/' . $uid, $url['path'], 'Login with user argument returned a valid reset URL'); - $this->assertEquals('destination=node/add', $query, 'Login included destination path in URL'); - // Check path used as only argument when using uid option. - $this->drush('user-login', array('node/add'), $user_login_options + array('uid' => $uid)); - $output = $this->getOutput(); - $url = parse_url($output); - $this->assertContains('/user/reset/' . $uid, $url['path'], 'Login with uid option returned a valid reset URL'); - $query = $url['query']; - if (UNISH_DRUPAL_MAJOR_VERSION < 7) { - $query = urldecode($query); - } - $this->assertEquals('destination=node/add', $query, 'Login included destination path in URL'); - } - - function testUserCancel() { - // create content - // @todo Creation of node types and content has changed in D8. - if (UNISH_DRUPAL_MAJOR_VERSION == 8) { - $this->markTestSkipped("@todo Creation of node types and content has changed in D8."); - } - if (UNISH_DRUPAL_MAJOR_VERSION >= 7) { - // create_node_types script does not work for D6 - $this->drush('php-script', array('create_node_types'), $this->options() + array('script-path' => dirname(__FILE__) . '/resources')); - $name = self::NAME; - $newpass = 'newpass'; - $eval = "return user_authenticate('$name', '$newpass')"; - $this->drush('php-eval', array($eval), $this->options()); - $eval = "\$node = (object) array('title' => 'foo', 'uid' => 2, 'type' => 'page',);"; - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - $eval .= " \$node = node_submit(entity_create('node', \$node));"; - } - $eval .= " node_save(\$node);"; - $this->drush('php-eval', array($eval), $this->options()); - $this->drush('user-cancel', array(self::NAME), $this->options() + array('delete-content' => NULL)); - $eval = 'print (string) user_load(2)'; - $this->drush('php-eval', array($eval), $this->options()); - $output = $this->getOutput(); - $this->assertEmpty($output, 'User was deleted'); - $eval = 'print (string) node_load(2)'; - $this->drush('php-eval', array($eval), $this->options()); - $output = $this->getOutput(); - $this->assertEmpty($output, 'Content was deleted'); - } - } - - function UserCreate() { - $this->drush('user-create', array(self::NAME), $this->options() + array('password' => 'password', 'mail' => "example@example.com")); - $this->drush('user-information', array(self::NAME), $this->options() + array('format' => 'json')); - $uid = UNISH_DRUPAL_MAJOR_VERSION == 6 ? 3 : 2; - $output = $this->getOutputFromJSON($uid); - $this->assertEquals('example@example.com', $output->mail); - $this->assertEquals(self::NAME, $output->name); - $this->assertEquals(1, $output->{self::$status_prop}, 'Newly created user is Active.'); - $expected = array(self::$authenticated); - $this->assertEquals($expected, array_values((array)$output->roles), 'Newly created user has one role.'); - } - - function options() { - return array( - 'root' => $this->webroot(), - 'uri' => key($this->getSites()), - 'yes' => NULL, - ); - } -} diff --git a/vendor/drush/drush/tests/variableTest.php b/vendor/drush/drush/tests/variableTest.php deleted file mode 100644 index 74eb64eb7c68df83898cab85c2ae0055af2453c8..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/variableTest.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group commands - */ -class VariableCase extends CommandUnishTestCase { - - function testVariable() { - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - $this->markTestSkipped("Variable system was removed in Drupal 8."); - } - - $sites = $this->setUpDrupal(1, TRUE); - $options_without_pipe = array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - ); - $options = $options_without_pipe + array( - 'pipe' => NULL, - ); - - $this->drush('variable-set', array('test_integer', '3.14159'), $options); - $this->drush('variable-get', array('test_integer'), $options); - $var_export = $this->getOutput(); - eval($var_export); - $this->assertEquals("3.14159", $variables['test_integer'], 'Integer variable was successfully set and get.'); - - $this->drush('variable-set', array('date_default_timezone', 'US/Mountain'), $options); - $this->drush('variable-get', array('date_default_timezone'), $options); // Wildcard get. - $var_export = $this->getOutput(); - eval($var_export); - $this->assertEquals('US/Mountain', $variables['date_default_timezone'], 'Variable was successfully set and get.'); - - $this->drush('variable-set', array('site_name', 'control'), $options + array('exact' => NULL)); - $this->drush('variable-set', array('site_na', 'unish'), $options + array('always-set' => NULL)); - $this->drush('variable-get', array('site_na'), $options + array('exact' => NULL)); - $var_export = $this->getOutput(); - eval($var_export); - $this->assertEquals('unish', $variables['site_na'], '--always-set option works as expected.'); - - $this->drush('variable-set', array('site_n', 'exactish'), $options + array('exact' => NULL)); - $this->drush('variable-get', array('site_n'), $options + array('exact' => NULL)); - $var_export = $this->getOutput(); - eval($var_export); - $this->assertEquals('exactish', $variables['site_n'], '--exact option works as expected.'); - - $this->drush('variable-get', array('site_n'), $options_without_pipe + array('exact' => NULL)); - $site_n_value = $this->getOutput(); - $this->assertEquals('exactish', $site_n_value, '--exact option works as expected with --pipe.'); - - $this->drush('variable-delete', array('site_name'), $options); - $output = $this->getOutput(); - $this->assertEmpty($output, 'Variable was successfully deleted.'); - } -} diff --git a/vendor/drush/drush/tests/watchdogTest.php b/vendor/drush/drush/tests/watchdogTest.php deleted file mode 100644 index dc3feda1b1f4ed38809fc9d9ffc9fff0e909665f..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/watchdogTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Unish; - -/** - * @group commands - */ -class WatchdogCase extends CommandUnishTestCase { - - function testWatchdog() { - $sites = $this->setUpDrupal(1, TRUE); - $options = array( - 'yes' => NULL, - 'root' => $this->webroot(), - 'uri' => key($sites), - ); - - if (UNISH_DRUPAL_MAJOR_VERSION >= 7) { - $this->drush('pm-enable', array('dblog'), $options); - } - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - $eval1 = "\\Drupal::logger('drush')->notice('Unish rocks.');"; - } - else { - $eval1 = "watchdog('drush', 'Unish rocks.');"; - } - $this->drush('php-eval', array($eval1), $options); - $this->drush('watchdog-show', array(), $options + array('count' => 50)); - $output = $this->getOutput(); - $this->assertContains('Unish rocks.', $output); - - // Add a new entry with a long message with the letter 'd' and verify that watchdog-show does - // not print it completely in the listing unless --full is given. - // As the output is formatted so lines may be splitted, assertContains does not work - // in this scenario. Therefore, we will count the number of times a character is present. - $message_chars = 300; - $char = '*'; - $message = str_repeat($char, $message_chars); - if (UNISH_DRUPAL_MAJOR_VERSION >= 8) { - $eval2 = "\\Drupal::logger('drush')->notice('$message');"; - } - else { - $eval2 = "watchdog('drush', '$message');"; - } - $this->drush('php-eval', array($eval2), $options); - $this->drush('watchdog-show', array(), $options); - $output = $this->getOutput(); - $this->assertGreaterThan(substr_count($output, $char), $message_chars); - $this->drush('watchdog-show', array(), $options + array('extended' => NULL)); - $output = $this->getOutput(); - $this->assertGreaterThanOrEqual($message_chars, substr_count($output, $char)); - - // Tests message deletion - $this->drush('watchdog-delete', array('all'), $options); - $output = $this->getOutput(); - $this->drush('watchdog-show', array(), $options); - $output = $this->getOutput(); - $this->assertEmpty($output); - } -} diff --git a/vendor/drush/drush/tests/xhUnitTest.php b/vendor/drush/drush/tests/xhUnitTest.php deleted file mode 100644 index 1a95078271d25f060f18b724528f3a4802a630c9..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/tests/xhUnitTest.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php - -namespace Unish; - -/** - * Unit tests for xh.drush.inc. - * - * @group base - */ -class xhUnitCase extends UnitUnishTestCase { - - /** - * Test various combinations of XHProf flag options. - * - * @dataProvider xhOptionProvider - */ - public function testFlags($name, $options, $expected) { - drush_preflight(); - foreach ($options as $option_name => $option_value) { - drush_set_option($option_name, $option_value); - } - $this->assertEquals($expected, xh_flags(), $name); - } - - /** - * Provides drush XHProf options and the results we expect from xh_flags(). - */ - public function xhOptionProvider() { - - if (!defined('XHPROF_FLAGS_NO_BUILTINS')) { - define('XHPROF_FLAGS_NO_BUILTINS', 1); - define('XHPROF_FLAGS_CPU', 2); - define('XHPROF_FLAGS_MEMORY', 3); - } - - return array( - array( - 'name' => 'No flag options provided (default)', - 'options' => array(), - 'expected' => 0, - ), - array( - 'name' => 'Default flag options explicitly provided', - 'options' => array( - 'xh-profile-builtins' => TRUE, - 'xh-profile-cpu' => FALSE, - 'xh-profile-memory' => FALSE, - ), - 'expected' => 0, - ), - array( - 'name' => 'Disable profiling of built-ins', - 'options' => array( - 'xh-profile-builtins' => FALSE, - 'xh-profile-cpu' => FALSE, - 'xh-profile-memory' => FALSE, - ), - 'expected' => XHPROF_FLAGS_NO_BUILTINS, - ), - array( - 'name' => 'Enable profiling of CPU', - 'options' => array( - 'xh-profile-builtins' => TRUE, - 'xh-profile-cpu' => TRUE, - 'xh-profile-memory' => FALSE, - ), - 'expected' => XHPROF_FLAGS_CPU, - ), - array( - 'name' => 'Enable profiling of CPU, without builtins', - 'options' => array( - 'xh-profile-builtins' => FALSE, - 'xh-profile-cpu' => TRUE, - 'xh-profile-memory' => FALSE, - ), - 'expected' => XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU, - ), - array( - 'name' => 'Enable profiling of Memory', - 'options' => array( - 'xh-profile-builtins' => TRUE, - 'xh-profile-cpu' => FALSE, - 'xh-profile-memory' => TRUE, - ), - 'expected' => XHPROF_FLAGS_MEMORY, - ), - array( - 'name' => 'Enable profiling of Memory, without builtins', - 'options' => array( - 'xh-profile-builtins' => FALSE, - 'xh-profile-cpu' => FALSE, - 'xh-profile-memory' => TRUE, - ), - 'expected' => XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_MEMORY, - ), - array( - 'name' => 'Enable profiling of CPU & Memory', - 'options' => array( - 'xh-profile-builtins' => TRUE, - 'xh-profile-cpu' => TRUE, - 'xh-profile-memory' => TRUE, - ), - 'expected' => XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY, - ), - ); - } - -} diff --git a/vendor/drush/drush/unish.bat b/vendor/drush/drush/unish.bat deleted file mode 100644 index 81bfe33156d030921a574fd5c55e842d508c1d60..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/unish.bat +++ /dev/null @@ -1,5 +0,0 @@ -@ECHO OFF -REM Run Unish, the test suite for Drush. -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0vendor/phpunit/phpunit/phpunit -php "%BIN_TARGET%" --configuration tests %* \ No newline at end of file diff --git a/vendor/drush/drush/unish.sh b/vendor/drush/drush/unish.sh deleted file mode 100755 index 17e6295a723cf4b08d54d7c5108a99d4b2d5f989..0000000000000000000000000000000000000000 --- a/vendor/drush/drush/unish.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Run Unish, the test suite for Drush. -vendor/bin/phpunit --configuration tests $@ diff --git a/vendor/grasmash/expander/.gitignore b/vendor/grasmash/expander/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..60c86adf5ca31ad9083b7ce18e98a350749664cb --- /dev/null +++ b/vendor/grasmash/expander/.gitignore @@ -0,0 +1,50 @@ +# Cache and logs (Symfony2) +/app/cache/* +/app/logs/* +!app/cache/.gitkeep +!app/logs/.gitkeep + +# Email spool folder +/app/spool/* + +# Cache, session files and logs (Symfony3) +/var/cache/* +/var/logs/* +/var/sessions/* +!var/cache/.gitkeep +!var/logs/.gitkeep +!var/sessions/.gitkeep + +# Parameters +/app/config/parameters.yml +/app/config/parameters.ini + +# Managed by Composer +/app/bootstrap.php.cache +/var/bootstrap.php.cache +/bin/* +!bin/console +!bin/symfony_requirements +/vendor/ + +# Assets and user uploads +/web/bundles/ +/web/uploads/ + +# Assets managed by Bower +/web/assets/vendor/ + +# PHPUnit +/app/phpunit.xml +/phpunit.xml + +# Build data +/build/ + +# Composer PHAR +/composer.phar + +# Backup entities generated with doctrine:generate:entities command +*/Entity/*~ + +.idea diff --git a/vendor/grasmash/expander/.travis.yml b/vendor/grasmash/expander/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..5076ffeaf793ac990ee54556620287aa16ef457f --- /dev/null +++ b/vendor/grasmash/expander/.travis.yml @@ -0,0 +1,28 @@ +language: php + +matrix: + fast_finish: true + include: + - php: 7.2 + - php: 7.1 + - php: 7.0.11 + - php: 5.6 + - php: 5.5 + - php: 5.4 + +sudo: false + +cache: + apt: true + directories: + - "$HOME/.composer/cache" + - "vendor" + +install: + - composer install + +script: + - composer test + +after_success: + - travis_retry php vendor/bin/coveralls -v diff --git a/vendor/grasmash/expander/CONTRIBUTING.md b/vendor/grasmash/expander/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/grasmash/expander/LICENSE.md b/vendor/grasmash/expander/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..632424eeea94cd1f7b55f9aacd0ccd18dc44b241 --- /dev/null +++ b/vendor/grasmash/expander/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Matthew Grasmick + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/grasmash/expander/README.md b/vendor/grasmash/expander/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8bfbaac6e7807c8054cb06922ce40ea9e21a3861 --- /dev/null +++ b/vendor/grasmash/expander/README.md @@ -0,0 +1,149 @@ +[](https://travis-ci.org/grasmash/expander) [](https://packagist.org/packages/grasmash/expander) +[](https://packagist.org/packages/grasmash/expander) [](https://coveralls.io/github/grasmash/expander?branch=master) + +This tool expands property references in PHP arrays. For example implementation, see Yaml Expander. + +### Installation + + composer require grasmash/expander + +### Example usage: + +Property references use dot notation to indicate array keys, and must be wrapped in `${}`. + +Expansion logic: + +```php +<?php + +$array = [ + 'type' => 'book', + 'book' => [ + 'title' => 'Dune', + 'author' => 'Frank Herbert', + 'copyright' => '${book.author} 1965', + 'protaganist' => '${characters.0.name}', + 'media' => [ + 0 => 'hardcover', + 1 => 'paperback', + ], + 'nested-reference' => '${book.sequel}', + ], + 'characters' => [ + 0 => [ + 'name' => 'Paul Atreides', + 'occupation' => 'Kwisatz Haderach', + 'aliases' => [ + 0 => 'Usul', + 1 => 'Muad\'Dib', + 2 => 'The Preacher', + ], + ], + 1 => [ + 'name' => 'Duncan Idaho', + 'occupation' => 'Swordmaster', + ], + ], + 'summary' => '${book.title} by ${book.author}', + 'publisher' => '${not.real.property}', + 'sequels' => '${book.sequel}, and others.', + 'available-products' => '${book.media.1}, ${book.media.0}', + 'product-name' => '${${type}.title}', + 'boolean-value' => true, + 'null-value' => NULL, + 'inline-array' => [ + 0 => 'one', + 1 => 'two', + 2 => 'three', + ], + 'expand-array' => '${inline-array}', + 'env-test' => '${env.test}', +]; + +$expander = new Expander(); +// Optionally set a logger. +$expander->setLogger(new Psr\Log\NullLogger()); +// Optionally set a Stringfier, used to convert array placeholders into strings. Defaults to using implode() with `,` delimeter. +// @see StringifierInterface. +$expander->setStringifier(new Grasmash\Expander\Stringifier()); + +// Parse an array, expanding internal property references. +$expanded = $expander->expandArrayProperties($array); + +// Parse an array, expanding references using both internal and supplementary values. +$reference_properties = 'book' => ['sequel' => 'Dune Messiah']; +// Set an environmental variable. +putenv("test=gomjabbar"); +$expanded = $expander->expandArrayProperties($array, $reference_properties); + +print_r($expanded); +```` + +Resultant array: + +```php +Array +( + [type] => book + [book] => Array + ( + [title] => Dune + [author] => Frank Herbert + [copyright] => Frank Herbert 1965 + [protaganist] => Paul Atreides + [media] => Array + ( + [0] => hardcover + [1] => paperback + ) + + [nested-reference] => Dune Messiah + ) + + [characters] => Array + ( + [0] => Array + ( + [name] => Paul Atreides + [occupation] => Kwisatz Haderach + [aliases] => Array + ( + [0] => Usul + [1] => Muad'Dib + [2] => The Preacher + ) + + ) + + [1] => Array + ( + [name] => Duncan Idaho + [occupation] => Swordmaster + ) + + ) + + [summary] => Dune by Frank Herbert + [publisher] => ${not.real.property} + [sequels] => Dune Messiah, and others. + [available-products] => paperback, hardcover + [product-name] => Dune + [boolean-value] => 1 + [null-value] => + [inline-array] => Array + ( + [0] => one + [1] => two + [2] => three + ) + + [expand-array] => one,two,three + [env-test] => gomjabbar + [env] => Array + ( + [test] => gomjabbar + ) + +) + +``` diff --git a/vendor/grasmash/expander/RELEASE.md b/vendor/grasmash/expander/RELEASE.md new file mode 100644 index 0000000000000000000000000000000000000000..2549d0c2d124ce93d4b9b1309cadf496669e6ea1 --- /dev/null +++ b/vendor/grasmash/expander/RELEASE.md @@ -0,0 +1,11 @@ +# Releasing + +### Execute tests + + ./scripts/run-tests.sh + +To quickly fix PHPCS issues: + + ./scripts/clean-code.sh + + diff --git a/vendor/grasmash/expander/composer.json b/vendor/grasmash/expander/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..e1b692bf1f176e85df503891177f9d38dd6f759d --- /dev/null +++ b/vendor/grasmash/expander/composer.json @@ -0,0 +1,50 @@ +{ + "name": "grasmash/expander", + "description": "Expands internal property references in PHP arrays file.", + "type": "library", + "require": { + "php": ">=5.4", + "dflydev/dot-access-data": "^1.1.0" + }, + "license": "MIT", + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "require-dev": { + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "greg-1-anderson/composer-test-scenarios": "^1", + "squizlabs/php_codesniffer": "^2.7" + }, + "scripts": { + "cs": "phpcs -n --standard=PSR2 src tests --exclude=Generic.Files.LineLength", + "cbf": "phpcbf -n --standard=PSR2 src tests --exclude=Generic.Files.LineLength", + "unit": "phpunit", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/grasmash/expander/composer.lock b/vendor/grasmash/expander/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..2019acc7d481bea731c2fe6a0b1cd44ca8559923 --- /dev/null +++ b/vendor/grasmash/expander/composer.lock @@ -0,0 +1,1750 @@ +{ + "_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" + ], + "content-hash": "a297a5ed4d1b90e8a7dfadfcc0845cc8", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + } + ], + "packages-dev": [ + { + "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-14T21:17:01+00:00" + }, + { + "name": "greg-1-anderson/composer-test-scenarios", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/greg-1-anderson/composer-test-scenarios.git", + "reference": "dc81660f44a8b126d7fa947156c98e34f45af3e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/greg-1-anderson/composer-test-scenarios/zipball/dc81660f44a8b126d7fa947156c98e34f45af3e9", + "reference": "dc81660f44a8b126d7fa947156c98e34f45af3e9", + "shasum": "" + }, + "bin": [ + "scripts/create-scenario", + "scripts/install-scenario" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2017-12-13T18:41:24+00:00" + }, + { + "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" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "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": "2016-01-25T08:17:30+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.7.3", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.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": "2017-11-24T13:59:53+00:00" + }, + { + "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-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "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": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "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.2.2", + "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": "2017-06-21T08:07:12+00:00" + }, + { + "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-02T06:51:40+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "satooshi/php-coveralls", + "version": "1.1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "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/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "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": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "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": "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": "2016-06-17T09:04:28+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "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": "2016-10-03T07:41:43+00:00" + }, + { + "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-21T13:59:46+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-05-22T02:43:20+00:00" + }, + { + "name": "symfony/config", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "f4f3f1d7090c464434bbbc3e8aa2b41149c59196" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/f4f3f1d7090c464434bbbc3e8aa2b41149c59196", + "reference": "f4f3f1d7090c464434bbbc3e8aa2b41149c59196", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/filesystem": "~2.3|~3.0.0" + }, + "require-dev": { + "symfony/yaml": "~2.7|~3.0.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-11-07T11:56:23+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "46270f1ca44f08ebc134ce120fd2c2baf5fd63de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/46270f1ca44f08ebc134ce120fd2c2baf5fd63de", + "reference": "46270f1ca44f08ebc134ce120fd2c2baf5fd63de", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-11-29T09:33:18+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "e72a0340dc2e273b3c4398d8eef9157ba51d8b95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/e72a0340dc2e273b3c4398d8eef9157ba51d8b95", + "reference": "e72a0340dc2e273b3c4398d8eef9157ba51d8b95", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-11-19T19:05:05+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "b59aacf238fadda50d612c9de73b74751872a903" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b59aacf238fadda50d612c9de73b74751872a903", + "reference": "b59aacf238fadda50d612c9de73b74751872a903", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-11-05T15:25:56+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b", + "reference": "15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-11-19T18:39:05+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-10-11T12:05:26+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "533bb9d7c2da1c6d2da163ecf0f22043ea98f59b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/533bb9d7c2da1c6d2da163ecf0f22043ea98f59b", + "reference": "533bb9d7c2da1c6d2da163ecf0f22043ea98f59b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2017-11-10T18:59:36+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "968ef42161e4bc04200119da473077f9e7015128" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/968ef42161e4bc04200119da473077f9e7015128", + "reference": "968ef42161e4bc04200119da473077f9e7015128", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-11-29T09:33:18+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "satooshi/php-coveralls": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4" + }, + "platform-dev": [] +} diff --git a/vendor/grasmash/expander/phpunit.xml.dist b/vendor/grasmash/expander/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..59d7990761de5ccaa2669fbaed8571182dad18fc --- /dev/null +++ b/vendor/grasmash/expander/phpunit.xml.dist @@ -0,0 +1,16 @@ +<!-- phpunit.xml.dist --> +<phpunit> + <testsuites> + <testsuite name="Yaml Expander Test Suite"> + <directory>tests/phpunit</directory> + </testsuite> + </testsuites> + <logging> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">src</directory> + </whitelist> + </filter> +</phpunit> \ No newline at end of file diff --git a/vendor/grasmash/expander/src/Expander.php b/vendor/grasmash/expander/src/Expander.php new file mode 100644 index 0000000000000000000000000000000000000000..7f5fcef7a40ddf0d1285b05e093fff79208d7ea9 --- /dev/null +++ b/vendor/grasmash/expander/src/Expander.php @@ -0,0 +1,303 @@ +<?php + +namespace Grasmash\Expander; + +use Dflydev\DotAccessData\Data; +use Psr\Log\LoggerAwareInterface; +use Psr\Log\NullLogger; + +/** + * Class Expander + * @package Grasmash\Expander + */ +class Expander implements LoggerAwareInterface +{ + /** + * @var \Grasmash\Expander\StringifierInterface + */ + protected $stringifier; + /** + * @var \Psr\Log\LoggerInterface + */ + protected $logger; + + public function __construct() + { + $this->setLogger(new NullLogger()); + $this->setStringifier(new Stringifier()); + } + + /** + * @return \Grasmash\Expander\StringifierInterface + */ + public function getStringifier() + { + return $this->stringifier; + } + + /** + * @param \Grasmash\Expander\StringifierInterface $stringifier + */ + public function setStringifier(\Grasmash\Expander\StringifierInterface $stringifier) + { + $this->stringifier = $stringifier; + } + + /** + * @return \Psr\Log\LoggerInterface + */ + public function getLogger() + { + return $this->logger; + } + + /** + * @param \Psr\Log\LoggerInterface $logger + */ + public function setLogger(\Psr\Log\LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * Expands property placeholders in an array. + * + * Placeholders should formatted as ${parent.child}. + * + * @param array $array + * An array containing properties to expand. + * + * @return array + * The modified array in which placeholders have been replaced with + * values. + */ + public function expandArrayProperties($array, $reference_array = []) + { + $data = new Data($array); + if ($reference_array) { + $reference_data = new Data($reference_array); + $this->doExpandArrayProperties($data, $array, '', $reference_data); + } else { + $this->doExpandArrayProperties($data, $array); + } + + return $data->export(); + } + + /** + * Performs the actual property expansion. + * + * @param Data $data + * A data object, containing the $array. + * @param array $array + * The original, unmodified array. + * @param string $parent_keys + * The parent keys of the current key in dot notation. This is used to + * track the absolute path to the current key in recursive cases. + * @param Data|null $reference_data + * A reference data object. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + */ + protected function doExpandArrayProperties( + $data, + $array, + $parent_keys = '', + $reference_data = null + ) { + foreach ($array as $key => $value) { + // Boundary condition(s). + if (is_null($value) || is_bool($value)) { + continue; + } + // Recursive case. + if (is_array($value)) { + $this->doExpandArrayProperties($data, $value, $parent_keys . "$key.", $reference_data); + } // Base case. + else { + $this->expandStringProperties($data, $parent_keys, $reference_data, $value, $key); + } + } + } + + /** + * Expand a single property. + * + * @param Data $data + * A data object, containing the $array. + * @param string $parent_keys + * The parent keys of the current key in dot notation. This is used to + * track the absolute path to the current key in recursive cases. + * @param Data|null $reference_data + * A reference data object. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + * @param string $value + * The unexpanded property value. + * @param string $key + * The immediate key of the property. + * + * @return mixed + */ + protected function expandStringProperties( + $data, + $parent_keys, + $reference_data, + $value, + $key + ) { + // We loop through all placeholders in a given string. + // E.g., '${placeholder1} ${placeholder2}' requires two replacements. + while (strpos($value, '${') !== false) { + $original_value = $value; + $value = preg_replace_callback( + '/\$\{([^\$}]+)\}/', + function ($matches) use ($data, $reference_data) { + return $this->expandStringPropertiesCallback( + $matches, + $data, + $reference_data + ); + }, + $value + ); + + // If no replacement occurred at all, break to prevent + // infinite loop. + if ($original_value == $value) { + break; + } + + // Set value on $data object. + if ($parent_keys) { + $full_key = $parent_keys . "$key"; + } else { + $full_key = $key; + } + $data->set($full_key, $value); + } + return $value; + } + + /** + * Expansion callback used by preg_replace_callback() in expandProperty(). + * + * @param array $matches + * An array of matches created by preg_replace_callback(). + * @param Data $data + * A data object containing the complete array being operated upon. + * @param Data|null $reference_data + * A reference data object. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + * + * @return mixed + */ + public function expandStringPropertiesCallback( + $matches, + $data, + $reference_data = null + ) { + $property_name = $matches[1]; + $unexpanded_value = $matches[0]; + + // Use only values within the subject array's data. + if (!$reference_data) { + return $this->expandProperty($property_name, $unexpanded_value, $data); + } // Search both the subject array's data and the reference data for a value. + else { + return $this->expandPropertyWithReferenceData( + $property_name, + $unexpanded_value, + $data, + $reference_data + ); + } + } + + /** + * Searches both the subject data and the reference data for value. + * + * @param string $property_name + * The name of the value for which to search. + * @param string $unexpanded_value + * The original, unexpanded value, containing the placeholder. + * @param Data $data + * A data object containing the complete array being operated upon. + * @param Data|null $reference_data + * A reference data object. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + * + * @return string + * The expanded string. + */ + public function expandPropertyWithReferenceData( + $property_name, + $unexpanded_value, + $data, + $reference_data + ) { + $expanded_value = $this->expandProperty( + $property_name, + $unexpanded_value, + $data + ); + // If the string was not changed using the subject data, try using + // the reference data. + if ($expanded_value == $unexpanded_value) { + $expanded_value = $this->expandProperty( + $property_name, + $unexpanded_value, + $reference_data + ); + } + + return $expanded_value; + } + + /** + * Searches a data object for a value. + * + * @param string $property_name + * The name of the value for which to search. + * @param string $unexpanded_value + * The original, unexpanded value, containing the placeholder. + * @param Data $data + * A data object containing possible replacement values. + * + * @return mixed + */ + public function expandProperty($property_name, $unexpanded_value, $data) + { + if (strpos($property_name, "env.") === 0 && + !$data->has($property_name)) { + $env_key = substr($property_name, 4); + if (getenv($env_key)) { + $data->set($property_name, getenv($env_key)); + } + } + + if (!$data->has($property_name)) { + $this->log("Property \${'$property_name'} could not be expanded."); + return $unexpanded_value; + } else { + $expanded_value = $data->get($property_name); + if (is_array($expanded_value)) { + $expanded_value = $this->getStringifier()->stringifyArray($expanded_value); + return $expanded_value; + } + $this->log("Expanding property \${'$property_name'} => $expanded_value."); + return $expanded_value; + } + } + + /** + * Logs a message using the logger. + * + * @param string $message + * The message to log. + */ + public function log($message) + { + if ($this->getLogger()) { + $this->getLogger()->debug($message); + } + } +} diff --git a/vendor/grasmash/expander/src/Stringifier.php b/vendor/grasmash/expander/src/Stringifier.php new file mode 100644 index 0000000000000000000000000000000000000000..7937b3197154c0af486ab62c7e66bb16650e1065 --- /dev/null +++ b/vendor/grasmash/expander/src/Stringifier.php @@ -0,0 +1,24 @@ +<?php + +namespace Grasmash\Expander; + +/** + * Class Stringifier + * @package Grasmash\Expander + */ +class Stringifier implements StringifierInterface +{ + /** + * Converts array to string. + * + * @param array $array + * The array to convert. + * + * @return string + * The resultant string. + */ + public static function stringifyArray(array $array) + { + return implode(',', $array); + } +} diff --git a/vendor/grasmash/expander/src/StringifierInterface.php b/vendor/grasmash/expander/src/StringifierInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..83a376d2fcacc6e6c279563ac2b074acb4658c75 --- /dev/null +++ b/vendor/grasmash/expander/src/StringifierInterface.php @@ -0,0 +1,17 @@ +<?php + +namespace Grasmash\Expander; + +interface StringifierInterface +{ + /** + * Converts array to string. + * + * @param array $array + * The array to convert. + * + * @return string + * The resultant string. + */ + public static function stringifyArray(array $array); +} diff --git a/vendor/grasmash/expander/tests/phpunit/ExpanderTest.php b/vendor/grasmash/expander/tests/phpunit/ExpanderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b35658173b4117172c13ff3782137330a9fe2dd4 --- /dev/null +++ b/vendor/grasmash/expander/tests/phpunit/ExpanderTest.php @@ -0,0 +1,122 @@ +<?php + +namespace Grasmash\Expander\Tests\Command; + +use Dflydev\DotAccessData\Data; +use Grasmash\Expander\Expander; +use Grasmash\Expander\Stringifier; + +class ExpanderTest extends \PHPUnit_Framework_TestCase +{ + + /** + * Tests Expander::expandArrayProperties(). + * + * @param array $array + * @param array $reference_array + * + * @dataProvider providerYaml + */ + public function testExpandArrayProperties(array $array, array $reference_array) + { + $expander = new Expander(); + + putenv("test=gomjabbar"); + $expanded = $expander->expandArrayProperties($array); + $this->assertEquals('gomjabbar', $expanded['env-test']); + $this->assertEquals('Frank Herbert 1965', $expanded['book']['copyright']); + $this->assertEquals('Paul Atreides', $expanded['book']['protaganist']); + $this->assertEquals('Dune by Frank Herbert', $expanded['summary']); + $this->assertEquals('${book.media.1}, hardcover', $expanded['available-products']); + $this->assertEquals('Dune', $expanded['product-name']); + $this->assertEquals(Stringifier::stringifyArray($array['inline-array']), $expanded['expand-array']); + + $expanded = $expander->expandArrayProperties($array, $reference_array); + $this->assertEquals('Dune Messiah, and others.', $expanded['sequels']); + $this->assertEquals('Dune Messiah', $expanded['book']['nested-reference']); + } + + /** + * @return array + * An array of values to test. + */ + public function providerYaml() + { + return [ + [ + [ + 'type' => 'book', + 'book' => [ + 'title' => 'Dune', + 'author' => 'Frank Herbert', + 'copyright' => '${book.author} 1965', + 'protaganist' => '${characters.0.name}', + 'media' => [ + 0 => 'hardcover', + ], + 'nested-reference' => '${book.sequel}', + ], + 'characters' => [ + 0 => [ + 'name' => 'Paul Atreides', + 'occupation' => 'Kwisatz Haderach', + 'aliases' => [ + 0 => 'Usul', + 1 => "Muad'Dib", + 2 => 'The Preacher', + ], + ], + 1 => [ + 'name' => 'Duncan Idaho', + 'occupation' => 'Swordmaster', + ], + ], + 'summary' => '${book.title} by ${book.author}', + 'publisher' => '${not.real.property}', + 'sequels' => '${book.sequel}, and others.', + 'available-products' => '${book.media.1}, ${book.media.0}', + 'product-name' => '${${type}.title}', + 'boolean-value' => true, + 'null-value' => null, + 'inline-array' => [ + 0 => 'one', + 1 => 'two', + 2 => 'three', + ], + 'expand-array' => '${inline-array}', + 'env-test' => '${env.test}', + ], + [ + 'book' => [ + 'sequel' => 'Dune Messiah' + ] + ] + ], + ]; + } + + /** + * Tests Expander::expandProperty(). + * + * @dataProvider providerTestExpandProperty + */ + public function testExpandProperty(array $array, $property_name, $unexpanded_string, $expected) + { + $data = new Data($array); + $expander = new Expander(); + $expanded_value = $expander->expandProperty($property_name, $unexpanded_string, $data); + + $this->assertEquals($expected, $expanded_value); + } + + /** + * @return array + */ + public function providerTestExpandProperty() + { + return [ + [ ['author' => 'Frank Herbert'], 'author', '${author}', 'Frank Herbert' ], + [ ['book' => ['author' => 'Frank Herbert' ]], 'book.author', '${book.author}', 'Frank Herbert' ], + ]; + } +} diff --git a/vendor/grasmash/yaml-expander/.gitignore b/vendor/grasmash/yaml-expander/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..60c86adf5ca31ad9083b7ce18e98a350749664cb --- /dev/null +++ b/vendor/grasmash/yaml-expander/.gitignore @@ -0,0 +1,50 @@ +# Cache and logs (Symfony2) +/app/cache/* +/app/logs/* +!app/cache/.gitkeep +!app/logs/.gitkeep + +# Email spool folder +/app/spool/* + +# Cache, session files and logs (Symfony3) +/var/cache/* +/var/logs/* +/var/sessions/* +!var/cache/.gitkeep +!var/logs/.gitkeep +!var/sessions/.gitkeep + +# Parameters +/app/config/parameters.yml +/app/config/parameters.ini + +# Managed by Composer +/app/bootstrap.php.cache +/var/bootstrap.php.cache +/bin/* +!bin/console +!bin/symfony_requirements +/vendor/ + +# Assets and user uploads +/web/bundles/ +/web/uploads/ + +# Assets managed by Bower +/web/assets/vendor/ + +# PHPUnit +/app/phpunit.xml +/phpunit.xml + +# Build data +/build/ + +# Composer PHAR +/composer.phar + +# Backup entities generated with doctrine:generate:entities command +*/Entity/*~ + +.idea diff --git a/vendor/grasmash/yaml-expander/.travis.yml b/vendor/grasmash/yaml-expander/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..0416daaecc8f36a7cd41949f349be23f448c45fa --- /dev/null +++ b/vendor/grasmash/yaml-expander/.travis.yml @@ -0,0 +1,39 @@ +language: php + +branches: + # Only test the master branch and SemVer tags. + only: + - master + - /^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+.*$/ + +matrix: + fast_finish: true + include: + - php: 7.2 + env: 'SCENARIO=symfony4 HIGHEST_LOWEST="update"' + - php: 7.1 + env: 'SCENARIO=symfony4' + - php: 7.0.11 + env: 'HIGHEST_LOWEST="update"' + - php: 7.0.11 + - php: 5.6 + - php: 5.5 + - php: 5.4 + env: 'SCENARIO=symfony2 HIGHEST_LOWEST="update --prefer-lowest' + +sudo: false + +cache: + apt: true + directories: + - "$HOME/.composer/cache" + - "vendor" + +install: + - 'composer scenario "${SCENARIO}" "${HIGHEST_LOWEST-install}"' + +script: + - composer test + +after_success: + - travis_retry php vendor/bin/coveralls -v diff --git a/vendor/grasmash/yaml-expander/CONTRIBUTING.md b/vendor/grasmash/yaml-expander/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/grasmash/yaml-expander/LICENSE.md b/vendor/grasmash/yaml-expander/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..632424eeea94cd1f7b55f9aacd0ccd18dc44b241 --- /dev/null +++ b/vendor/grasmash/yaml-expander/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Matthew Grasmick + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/grasmash/yaml-expander/README.md b/vendor/grasmash/yaml-expander/README.md new file mode 100644 index 0000000000000000000000000000000000000000..837614626fa42235c92f8b15610427ea1793f350 --- /dev/null +++ b/vendor/grasmash/yaml-expander/README.md @@ -0,0 +1,100 @@ +[](https://travis-ci.org/grasmash/yaml-expander) [](https://packagist.org/packages/grasmash/yaml-expander) +[](https://packagist.org/packages/grasmash/yaml-expander) [](https://coveralls.io/github/grasmash/yaml-expander?branch=master) + +This tool expands property references in YAML files. + +### Installation + + composer require grasmash/yaml-expander + +### Example usage: + +Example dune.yml: + +```yaml +type: book +book: + title: Dune + author: Frank Herbert + copyright: ${book.author} 1965 + protaganist: ${characters.0.name} + media: + - hardcover +characters: + - name: Paul Atreides + occupation: Kwisatz Haderach + aliases: + - Usul + - Muad'Dib + - The Preacher + - name: Duncan Idaho + occupation: Swordmaster +summary: ${book.title} by ${book.author} +product-name: ${${type}.title} +``` + +Property references use dot notation to indicate array keys, and must be wrapped in `${}`. + +Expansion logic: + +```php +<?php + +// Parse a yaml string directly, expanding internal property references. +$yaml_string = file_get_contents("dune.yml"); +$expanded = \Grasmash\YamlExpander\Expander::parse($yaml_string); +print_r($expanded); + +// Parse an array, expanding internal property references. +$array = \Symfony\Component\Yaml\Yaml::parse(file_get_contents("dune.yml")); +$expanded = \Grasmash\YamlExpander\Expander::expandArrayProperties($array); +print_r($expanded); + +// Parse an array, expanding references using both internal and supplementary values. +$array = \Symfony\Component\Yaml\Yaml::parse(file_get_contents("dune.yml")); +$reference_properties = ['book' => ['publication-year' => 1965]]; +$expanded = \Grasmash\YamlExpander\Expander::expandArrayProperties($array, $reference_properties); +print_r($expanded); +```` + +Resultant array: + +```php +<?php + +array ( + 'type' => 'book', + 'book' => + array ( + 'title' => 'Dune', + 'author' => 'Frank Herbert', + 'copyright' => 'Frank Herbert 1965', + 'protaganist' => 'Paul Atreides', + 'media' => + array ( + 0 => 'hardcover', + ), + ), + 'characters' => + array ( + 0 => + array ( + 'name' => 'Paul Atreides', + 'occupation' => 'Kwisatz Haderach', + 'aliases' => + array ( + 0 => 'Usul', + 1 => 'Muad\'Dib', + 2 => 'The Preacher', + ), + ), + 1 => + array ( + 'name' => 'Duncan Idaho', + 'occupation' => 'Swordmaster', + ), + ), + 'summary' => 'Dune by Frank Herbert', + 'product-name' => 'Dune', +); +``` diff --git a/vendor/grasmash/yaml-expander/RELEASE.md b/vendor/grasmash/yaml-expander/RELEASE.md new file mode 100644 index 0000000000000000000000000000000000000000..2549d0c2d124ce93d4b9b1309cadf496669e6ea1 --- /dev/null +++ b/vendor/grasmash/yaml-expander/RELEASE.md @@ -0,0 +1,11 @@ +# Releasing + +### Execute tests + + ./scripts/run-tests.sh + +To quickly fix PHPCS issues: + + ./scripts/clean-code.sh + + diff --git a/vendor/grasmash/yaml-expander/composer.json b/vendor/grasmash/yaml-expander/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..f671ee40d755d77f89051276da569e7d3877a126 --- /dev/null +++ b/vendor/grasmash/yaml-expander/composer.json @@ -0,0 +1,59 @@ +{ + "name": "grasmash/yaml-expander", + "description": "Expands internal property references in a yaml file.", + "type": "library", + "require": { + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4", + "dflydev/dot-access-data": "^1.1.0" + }, + "license": "MIT", + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "greg-1-anderson/composer-test-scenarios": "^1", + "squizlabs/php_codesniffer": "^2.7" + }, + "scripts": { + "cs": "phpcs -n --standard=PSR2 src tests --exclude=Generic.Files.LineLength", + "cbf": "phpcbf -n --standard=PSR2 src tests --exclude=Generic.Files.LineLength", + "unit": "phpunit", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "scenario": "scenarios/install", + "post-update-cmd": [ + "create-scenario symfony4 'symfony/console:^4.0'", + "create-scenario symfony2 'symfony/console:^2.8' --platform-php '5.4' --no-lockfile" + ] + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "5.5.9" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/grasmash/yaml-expander/composer.lock b/vendor/grasmash/yaml-expander/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..7f1268ad446d177bc04eb4a98278832c839890d1 --- /dev/null +++ b/vendor/grasmash/yaml-expander/composer.lock @@ -0,0 +1,2019 @@ +{ + "_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" + ], + "content-hash": "ae81b9e7daa60d332450889eb23e80a9", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "b3d0c9c11be3831b84825967dc6b52b5a7b84e04" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/b3d0c9c11be3831b84825967dc6b52b5a7b84e04", + "reference": "b3d0c9c11be3831b84825967dc6b52b5a7b84e04", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-11-29T13:28:14+00:00" + } + ], + "packages-dev": [ + { + "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-14T21:17:01+00:00" + }, + { + "name": "greg-1-anderson/composer-test-scenarios", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/greg-1-anderson/composer-test-scenarios.git", + "reference": "00ff9f3af3132f0c6b2fb9e0906efee402f0c703" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/greg-1-anderson/composer-test-scenarios/zipball/00ff9f3af3132f0c6b2fb9e0906efee402f0c703", + "reference": "00ff9f3af3132f0c6b2fb9e0906efee402f0c703", + "shasum": "" + }, + "bin": [ + "scripts/create-scenario", + "scripts/install-scenario" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2017-12-01T21:34:53+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-06-22T18:50:49+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.3.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-08-08T06:39:58+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-06-03T08:32:36+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.7.3", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.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": "2017-11-24T13:59:53+00:00" + }, + { + "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-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "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": "2017-02-27T10:12:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "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.2.2", + "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": "2017-06-21T08:07:12+00:00" + }, + { + "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-02T06:51:40+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "satooshi/php-coveralls", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "c9d3fe2327c8539f1105dc19954673ba993e4ad9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/c9d3fe2327c8539f1105dc19954673ba993e4ad9", + "reference": "c9d3fe2327c8539f1105dc19954673ba993e4ad9", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.0", + "php": "^5.5 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpCoveralls\\": "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", + "role": "Original creator" + }, + { + "name": "Takashi Matsuo", + "email": "tmatsuo@google.com" + }, + { + "name": "Google Inc" + }, + { + "name": "Dariusz Ruminski", + "email": "dariusz.ruminski@gmail.com", + "homepage": "https://github.com/keradus" + }, + { + "name": "Contributors", + "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-10-14T23:16:28+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "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": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "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": "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": "2016-06-17T09:04:28+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "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": "2016-10-03T07:41:43+00:00" + }, + { + "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-21T13:59:46+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-05-22T02:43:20+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "1de51a6c76359897ab32c309934b93d036bccb60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/1de51a6c76359897ab32c309934b93d036bccb60", + "reference": "1de51a6c76359897ab32c309934b93d036bccb60", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-11-19T20:09:36+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "9468ad3fba3a5e1f0dc12a96e50e84cddb923cf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/9468ad3fba3a5e1f0dc12a96e50e84cddb923cf0", + "reference": "9468ad3fba3a5e1f0dc12a96e50e84cddb923cf0", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "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" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-11-29T13:28:14+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "fb2001e5d85f95d8b6ab94ae3be5d2672df128fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/fb2001e5d85f95d8b6ab94ae3be5d2672df128fd", + "reference": "fb2001e5d85f95d8b6ab94ae3be5d2672df128fd", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-11-21T09:01:46+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "de56eee71e0a128d8c54ccc1909cdefd574bad0f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/de56eee71e0a128d8c54ccc1909cdefd574bad0f", + "reference": "de56eee71e0a128d8c54ccc1909cdefd574bad0f", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-11-19T18:59:05+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-10-11T12:05:26+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "52510fe1aefdc1c5d2076ac6030421d387e689d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/52510fe1aefdc1c5d2076ac6030421d387e689d1", + "reference": "52510fe1aefdc1c5d2076ac6030421d387e689d1", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2017-11-07T14:28:09+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23T20:04:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "satooshi/php-coveralls": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.5.9" + } +} diff --git a/vendor/grasmash/yaml-expander/phpunit.xml.dist b/vendor/grasmash/yaml-expander/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..59d7990761de5ccaa2669fbaed8571182dad18fc --- /dev/null +++ b/vendor/grasmash/yaml-expander/phpunit.xml.dist @@ -0,0 +1,16 @@ +<!-- phpunit.xml.dist --> +<phpunit> + <testsuites> + <testsuite name="Yaml Expander Test Suite"> + <directory>tests/phpunit</directory> + </testsuite> + </testsuites> + <logging> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">src</directory> + </whitelist> + </filter> +</phpunit> \ No newline at end of file diff --git a/vendor/grasmash/yaml-expander/scenarios/install b/vendor/grasmash/yaml-expander/scenarios/install new file mode 100755 index 0000000000000000000000000000000000000000..5bc73b734ccdf8da92226863dc49daa6eba794f1 --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/install @@ -0,0 +1,23 @@ +#!/bin/bash + +SCENARIO=$1 +ACTION=${2-install} + +dir=scenarios/${SCENARIO} +if [ -z "$SCENARIO" ] ; then + SCENARIO=default + dir=. +fi + + +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo "Switch to ${SCENARIO} scenario" + +set -ex + +composer -n --working-dir=$dir ${ACTION} --prefer-dist --no-scripts +composer -n --working-dir=$dir info diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony2/.gitignore b/vendor/grasmash/yaml-expander/scenarios/symfony2/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..7579f74311d35aae05dd0f0a54537ea7a0034e89 --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony2/.gitignore @@ -0,0 +1,2 @@ +vendor +composer.lock diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony2/composer.json b/vendor/grasmash/yaml-expander/scenarios/symfony2/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..43e4e9653ccc9bf6b3d7c40633702ec85fed99d5 --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony2/composer.json @@ -0,0 +1,61 @@ +{ + "name": "grasmash/yaml-expander", + "description": "Expands internal property references in a yaml file.", + "type": "library", + "require": { + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4", + "dflydev/dot-access-data": "^1.1.0" + }, + "license": "MIT", + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "^2.8" + }, + "scripts": { + "cs": "phpcs -n --standard=PSR2 src tests --exclude=Generic.Files.LineLength", + "cbf": "phpcbf -n --standard=PSR2 src tests --exclude=Generic.Files.LineLength", + "unit": "phpunit", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "scenario": "scenarios/install", + "post-update-cmd": [ + "create-scenario symfony4 'symfony/console:^4.0'", + "create-scenario symfony2 'symfony/console:^2.8' --platform-php '5.4' --no-lockfile" + ] + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "5.4" + }, + "vendor-dir": "../../vendor" + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony2/src b/vendor/grasmash/yaml-expander/scenarios/symfony2/src new file mode 120000 index 0000000000000000000000000000000000000000..929cb3dc9ba04d657e86ebde2d29661b78bdd85c --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony2/src @@ -0,0 +1 @@ +../../src \ No newline at end of file diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony2/tests b/vendor/grasmash/yaml-expander/scenarios/symfony2/tests new file mode 120000 index 0000000000000000000000000000000000000000..c2ebfe530b4e16023832427b3134004e19542bd6 --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony2/tests @@ -0,0 +1 @@ +../../tests \ No newline at end of file diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony4/.gitignore b/vendor/grasmash/yaml-expander/scenarios/symfony4/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..22d0d82f8095e9c0ed572776afb47f9ca293ce00 --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony4/.gitignore @@ -0,0 +1 @@ +vendor diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony4/composer.json b/vendor/grasmash/yaml-expander/scenarios/symfony4/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..3052d4e9ad862dd7bce24ebc1a4c457d42983f8e --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony4/composer.json @@ -0,0 +1,61 @@ +{ + "name": "grasmash/yaml-expander", + "description": "Expands internal property references in a yaml file.", + "type": "library", + "require": { + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4", + "dflydev/dot-access-data": "^1.1.0" + }, + "license": "MIT", + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "^4.0" + }, + "scripts": { + "cs": "phpcs -n --standard=PSR2 src tests --exclude=Generic.Files.LineLength", + "cbf": "phpcbf -n --standard=PSR2 src tests --exclude=Generic.Files.LineLength", + "unit": "phpunit", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ], + "scenario": "scenarios/install", + "post-update-cmd": [ + "create-scenario symfony4 'symfony/console:^4.0'", + "create-scenario symfony2 'symfony/console:^2.8' --platform-php '5.4' --no-lockfile" + ] + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + + }, + "vendor-dir": "../../vendor" + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony4/composer.lock b/vendor/grasmash/yaml-expander/scenarios/symfony4/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..d0fe611a204ccf2f9e99a60f72034bcd2da913f1 --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony4/composer.lock @@ -0,0 +1,2163 @@ +{ + "_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" + ], + "content-hash": "d2caa274a8dbc1766b1756b440be19a0", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "7be8741ce5dce9943f41a9269f6828b66e726776" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7be8741ce5dce9943f41a9269f6828b66e726776", + "reference": "7be8741ce5dce9943f41a9269f6828b66e726776", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-11-29T13:42:03+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.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": "2017-07-22T11:58:36+00:00" + }, + { + "name": "greg-1-anderson/composer-test-scenarios", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/greg-1-anderson/composer-test-scenarios.git", + "reference": "00ff9f3af3132f0c6b2fb9e0906efee402f0c703" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/greg-1-anderson/composer-test-scenarios/zipball/00ff9f3af3132f0c6b2fb9e0906efee402f0c703", + "reference": "00ff9f3af3132f0c6b2fb9e0906efee402f0c703", + "shasum": "" + }, + "bin": [ + "scripts/create-scenario", + "scripts/install-scenario" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2017-12-01T21:34:53+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-06-22T18:50:49+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.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" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "66465776cfc249844bde6d117abff1d22e06c2da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da", + "reference": "66465776cfc249844bde6d117abff1d22e06c2da", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-27T17:38:31+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.7.3", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.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": "2017-11-24T13:59:53+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.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": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "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": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.25", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "4b1c822a68ae6577df38a59eb49b046712ec0f6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4b1c822a68ae6577df38a59eb49b046712ec0f6a", + "reference": "4b1c822a68ae6577df38a59eb49b046712ec0f6a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0.3|~2.0", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.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": "2017-11-14T14:50:51+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "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", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "satooshi/php-coveralls", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "c9d3fe2327c8539f1105dc19954673ba993e4ad9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/c9d3fe2327c8539f1105dc19954673ba993e4ad9", + "reference": "c9d3fe2327c8539f1105dc19954673ba993e4ad9", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.0", + "php": "^5.5 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpCoveralls\\": "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", + "role": "Original creator" + }, + { + "name": "Takashi Matsuo", + "email": "tmatsuo@google.com" + }, + { + "name": "Google Inc" + }, + { + "name": "Dariusz Ruminski", + "email": "dariusz.ruminski@gmail.com", + "homepage": "https://github.com/keradus" + }, + { + "name": "Contributors", + "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-10-14T23:16:28+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "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/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.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" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.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": "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": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T08:54:04+00:00" + }, + { + "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-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~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" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "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": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-05-22T02:43:20+00:00" + }, + { + "name": "symfony/config", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "6e6dbc6d2beff8117b974d74274bff02e43c32a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/6e6dbc6d2beff8117b974d74274bff02e43c32a6", + "reference": "6e6dbc6d2beff8117b974d74274bff02e43c32a6", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-11-20T18:22:57+00:00" + }, + { + "name": "symfony/console", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "5cd0dd461dfc72f59c8405cac32d31e82c7348e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/5cd0dd461dfc72f59c8405cac32d31e82c7348e8", + "reference": "5cd0dd461dfc72f59c8405cac32d31e82c7348e8", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-11-29T13:42:03+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "c9d4a26759ff75a077e4e334315cb632739b661a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/c9d4a26759ff75a077e4e334315cb632739b661a", + "reference": "c9d4a26759ff75a077e4e334315cb632739b661a", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-11-21T14:14:53+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-10-11T12:05:26+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "ac0e49150555c703fef6b696d8eaba1db7a3ca03" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/ac0e49150555c703fef6b696d8eaba1db7a3ca03", + "reference": "ac0e49150555c703fef6b696d8eaba1db7a3ca03", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2017-11-09T12:45:29+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23T20:04:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "satooshi/php-coveralls": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4" + }, + "platform-dev": [] +} diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony4/src b/vendor/grasmash/yaml-expander/scenarios/symfony4/src new file mode 120000 index 0000000000000000000000000000000000000000..929cb3dc9ba04d657e86ebde2d29661b78bdd85c --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony4/src @@ -0,0 +1 @@ +../../src \ No newline at end of file diff --git a/vendor/grasmash/yaml-expander/scenarios/symfony4/tests b/vendor/grasmash/yaml-expander/scenarios/symfony4/tests new file mode 120000 index 0000000000000000000000000000000000000000..c2ebfe530b4e16023832427b3134004e19542bd6 --- /dev/null +++ b/vendor/grasmash/yaml-expander/scenarios/symfony4/tests @@ -0,0 +1 @@ +../../tests \ No newline at end of file diff --git a/vendor/grasmash/yaml-expander/src/Expander.php b/vendor/grasmash/yaml-expander/src/Expander.php new file mode 100644 index 0000000000000000000000000000000000000000..d922db59a3d98c7f36d58772c8fc9f97be3cb593 --- /dev/null +++ b/vendor/grasmash/yaml-expander/src/Expander.php @@ -0,0 +1,273 @@ +<?php + +namespace Grasmash\YamlExpander; + +use Dflydev\DotAccessData\Data; +use Symfony\Component\Yaml\Yaml; + +/** + * Class Expander + * @package Grasmash\YamlExpander + */ +class Expander +{ + + /** + * Parses a YAML string and expands property placeholders. + * + * Placeholders should formatted as ${parent.child}. + * + * @param string $yaml_string + * A string of YAML. + * @param array $reference_array + * Optional. An array of reference values. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + * + * @return array + * The modified array in which placeholders have been replaced with + * values. + */ + public static function parse($yaml_string, $reference_array = []) + { + $array = Yaml::parse($yaml_string); + return self::expandArrayProperties($array, $reference_array); + } + + + /** + * Expands property placeholders in an array. + * + * Placeholders should formatted as ${parent.child}. + * + * @param array $array + * An array containing properties to expand. + * + * @return array + * The modified array in which placeholders have been replaced with + * values. + */ + public static function expandArrayProperties($array, $reference_array = []) + { + $data = new Data($array); + if ($reference_array) { + $reference_data = new Data($reference_array); + self::doExpandArrayProperties($data, $array, '', $reference_data); + } else { + self::doExpandArrayProperties($data, $array); + } + + return $data->export(); + } + + /** + * Performs the actual property expansion. + * + * @param Data $data + * A data object, containing the $array. + * @param array $array + * The original, unmodified array. + * @param string $parent_keys + * The parent keys of the current key in dot notation. This is used to + * track the absolute path to the current key in recursive cases. + * @param Data|null $reference_data + * A reference data object. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + */ + protected static function doExpandArrayProperties( + $data, + $array, + $parent_keys = '', + $reference_data = null + ) { + foreach ($array as $key => $value) { + // Boundary condition(s). + if (is_null($value) || is_bool($value)) { + continue; + } + // Recursive case. + if (is_array($value)) { + self::doExpandArrayProperties($data, $value, $parent_keys . "$key.", $reference_data); + } // Base case. + else { + self::expandStringProperties($data, $parent_keys, $reference_data, $value, $key); + } + } + } + + /** + * Expand a single property. + * + * @param Data $data + * A data object, containing the $array. + * @param string $parent_keys + * The parent keys of the current key in dot notation. This is used to + * track the absolute path to the current key in recursive cases. + * @param Data|null $reference_data + * A reference data object. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + * @param string $value + * The unexpanded property value. + * @param string $key + * The immediate key of the property. + * + * @return mixed + */ + protected static function expandStringProperties( + $data, + $parent_keys, + $reference_data, + $value, + $key + ) { + // We loop through all placeholders in a given string. + // E.g., '${placeholder1} ${placeholder2}' requires two replacements. + while (strpos($value, '${') !== false) { + $original_value = $value; + $value = preg_replace_callback( + '/\$\{([^\$}]+)\}/', + function ($matches) use ($data, $reference_data) { + return self::expandStringPropertiesCallback( + $matches, + $data, + $reference_data + ); + }, + $value + ); + + // If no replacement occurred at all, break to prevent + // infinite loop. + if ($original_value == $value) { + break; + } + + // Set value on $data object. + if ($parent_keys) { + $full_key = $parent_keys . "$key"; + } else { + $full_key = $key; + } + $data->set($full_key, $value); + } + return $value; + } + + /** + * Expansion callback used by preg_replace_callback() in expandProperty(). + * + * @param array $matches + * An array of matches created by preg_replace_callback(). + * @param Data $data + * A data object containing the complete array being operated upon. + * @param Data|null $reference_data + * A reference data object. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + * + * @return mixed + */ + public static function expandStringPropertiesCallback( + $matches, + $data, + $reference_data = null + ) { + $property_name = $matches[1]; + $unexpanded_value = $matches[0]; + + // Use only values within the subject array's data. + if (!$reference_data) { + return self::expandProperty($property_name, $unexpanded_value, $data); + } // Search both the subject array's data and the reference data for a value. + else { + return self::expandPropertyWithReferenceData( + $property_name, + $unexpanded_value, + $data, + $reference_data + ); + } + } + + /** + * Searches both the subject data and the reference data for value. + * + * @param string $property_name + * The name of the value for which to search. + * @param string $unexpanded_value + * The original, unexpanded value, containing the placeholder. + * @param Data $data + * A data object containing the complete array being operated upon. + * @param Data|null $reference_data + * A reference data object. This is not operated upon but is used as a + * reference to provide supplemental values for property expansion. + * + * @return string + * The expanded string. + */ + public static function expandPropertyWithReferenceData( + $property_name, + $unexpanded_value, + $data, + $reference_data + ) { + $expanded_value = self::expandProperty( + $property_name, + $unexpanded_value, + $data + ); + // If the string was not changed using the subject data, try using + // the reference data. + if ($expanded_value == $unexpanded_value) { + $expanded_value = self::expandProperty( + $property_name, + $unexpanded_value, + $reference_data + ); + } + + return $expanded_value; + } + + /** + * Searches a data object for a value. + * + * @param string $property_name + * The name of the value for which to search. + * @param string $unexpanded_value + * The original, unexpanded value, containing the placeholder. + * @param Data $data + * A data object containing possible replacement values. + * + * @return mixed + */ + public static function expandProperty($property_name, $unexpanded_value, $data) + { + if (strpos($property_name, "env.") === 0 && + !$data->has($property_name)) { + $env_key = substr($property_name, 4); + if (getenv($env_key)) { + $data->set($property_name, getenv($env_key)); + } + } + + if (!$data->has($property_name)) { + self::log("Property \${'$property_name'} could not be expanded."); + return $unexpanded_value; + } else { + $expanded_value = $data->get($property_name); + if (is_array($expanded_value)) { + $expanded_value = Yaml::dump($expanded_value, 0); + return $expanded_value; + } + self::log("Expanding property \${'$property_name'} => $expanded_value."); + return $expanded_value; + } + } + + /** + * @param $message + */ + public static function log($message) + { + // print "$message\n"; + } +} diff --git a/vendor/grasmash/yaml-expander/tests/phpunit/ExpanderTest.php b/vendor/grasmash/yaml-expander/tests/phpunit/ExpanderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..291d00ccf453f9b886cf8505ef570022f313b0b4 --- /dev/null +++ b/vendor/grasmash/yaml-expander/tests/phpunit/ExpanderTest.php @@ -0,0 +1,99 @@ +<?php + +namespace Grasmash\YamlExpander\Tests\Command; + +use Dflydev\DotAccessData\Data; +use Grasmash\YamlExpander\Expander; +use Grasmash\YamlExpander\Tests\TestBase; +use Symfony\Component\Yaml\Yaml; + +class ExpanderTest extends \PHPUnit_Framework_TestCase +{ + + /** + * Tests Expander::expandArrayProperties(). + * + * @param string $filename + * @param array $reference_array + * + * @dataProvider providerYaml + */ + public function testExpandArrayProperties($filename, $reference_array) + { + $array = Yaml::parse(file_get_contents(__DIR__ . "/../resources/$filename")); + putenv("test=gomjabbar"); + $expanded = Expander::expandArrayProperties($array); + $this->assertEquals('gomjabbar', $expanded['env-test']); + $this->assertEquals('Frank Herbert 1965', $expanded['book']['copyright']); + $this->assertEquals('Paul Atreides', $expanded['book']['protaganist']); + $this->assertEquals('Dune by Frank Herbert', $expanded['summary']); + $this->assertEquals('${book.media.1}, hardcover', $expanded['available-products']); + $this->assertEquals('Dune', $expanded['product-name']); + $this->assertEquals(Yaml::dump($array['inline-array'], 0), $expanded['expand-array']); + + $expanded = Expander::expandArrayProperties($array, $reference_array); + $this->assertEquals('Dune Messiah, and others.', $expanded['sequels']); + $this->assertEquals('Dune Messiah', $expanded['book']['nested-reference']); + } + + /** + * Tests Expander::parse(). + * + * @param string $filename + * @param array $reference_array + * + * @dataProvider providerYaml + */ + public function testParse($filename, $reference_array) + { + $yaml_string = file_get_contents(__DIR__ . "/../resources/$filename"); + $expanded = Expander::parse($yaml_string); + $this->assertEquals('Frank Herbert 1965', $expanded['book']['copyright']); + $this->assertEquals('Paul Atreides', $expanded['book']['protaganist']); + $this->assertEquals('Dune by Frank Herbert', $expanded['summary']); + $this->assertEquals('${book.media.1}, hardcover', $expanded['available-products']); + + $expanded = Expander::parse($yaml_string, $reference_array); + $this->assertEquals('Dune Messiah, and others.', $expanded['sequels']); + $this->assertEquals('Dune Messiah', $expanded['book']['nested-reference']); + } + + /** + * @return array + * An array of values to test. + */ + public function providerYaml() + { + return [ + ['valid.yml', [ + 'book' => [ + 'sequel' => 'Dune Messiah' + ] + ]], + ]; + } + + /** + * Tests Expander::expandProperty(). + * + * @dataProvider providerTestExpandProperty + */ + public function testExpandProperty($array, $property_name, $unexpanded_string, $expected) + { + $data = new Data($array); + $expanded_value = Expander::expandProperty($property_name, $unexpanded_string, $data); + + $this->assertEquals($expected, $expanded_value); + } + + /** + * @return array + */ + public function providerTestExpandProperty() + { + return [ + [ ['author' => 'Frank Herbert'], 'author', '${author}', 'Frank Herbert' ], + [ ['book' => ['author' => 'Frank Herbert' ]], 'book.author', '${book.author}', 'Frank Herbert' ], + ]; + } +} diff --git a/vendor/grasmash/yaml-expander/tests/resources/valid.yml b/vendor/grasmash/yaml-expander/tests/resources/valid.yml new file mode 100644 index 0000000000000000000000000000000000000000..78e4bc613b62321f5866005c3769728776995c4e --- /dev/null +++ b/vendor/grasmash/yaml-expander/tests/resources/valid.yml @@ -0,0 +1,35 @@ +# This file should contain only valid YAML. +type: book +book: + title: Dune + author: Frank Herbert + copyright: ${book.author} 1965 + protaganist: ${characters.0.name} + media: + - hardcover + # Use a nested key to reference an external value. + nested-reference: ${book.sequel} +characters: + - name: Paul Atreides + occupation: Kwisatz Haderach + aliases: + - Usul + - Muad'Dib + - The Preacher + - name: Duncan Idaho + occupation: Swordmaster +summary: ${book.title} by ${book.author} +# This is a complete fake property. +publisher: ${not.real.property} +# series.books is not defined in this YAML file, but is passed in to the parser by the application. +sequels: ${book.sequel}, and others. +# Reference one real value and one fake value. +available-products: ${book.media.1}, ${book.media.0} +# Nested property, should resolve to ${book.title} and then 'Dune'. +product-name: ${${type}.title} +# Represent a few more data types and formats. +boolean-value: true +null-value: null +inline-array: [ one, two, three ] +expand-array: ${inline-array} +env-test: ${env.test} \ No newline at end of file diff --git a/vendor/league/container/CHANGELOG.md b/vendor/league/container/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..6e99c738225f7d95a8904e4822cd97356097b185 --- /dev/null +++ b/vendor/league/container/CHANGELOG.md @@ -0,0 +1,123 @@ +# Changelog + +All Notable changes to `League\Container` will be documented in this file + +## 2.3.0 + +### Added +- Now implementation of the PSR-11. + +### Changed +- Can now wrap shared objects as `RawArgument`. +- Ability to override shared items. + +### Fixed +- Booleans now recognised as accepted values. +- Various docblock fixes. +- Unused imports removed. +- Unreachable arguments no longer passed. + +## 2.2.0 + +### Changed +- Service providers can now be added multiple times by giving them a signature. + +## 2.1.0 + +### Added +- Allow resolving of `RawArgument` objects as first class dependencies. + +### Changed +- Unnecessary recursion removed from `Container::get`. + +## 2.0.3 + +### Fixed +- Bug where delegating container was not passed to delegate when needed. +- Bug where `Container::extend` would not return a shared definition to extend. + +## 2.0.2 + +### Fixed +- Bug introduced in 2.0.1 where shared definitions registered via a service provider would never be returned as shared. + +## 2.0.1 + +### Fixed +- Bug where shared definitions were not stored as shared. + +## 2.0.0 + +### Added +- Now implementation of the container-interop project. +- `BootableServiceProviderInterface` for eagerly loaded service providers. +- Delegate container functionality. +- `RawArgument` to ensure scalars are not resolved from the container but seen as an argument. + +### Altered +- Refactor of definition functionality. +- `Container::share` replaces `singleton` functionality to improve understanding. +- Auto wiring is now disabled by default. +- Auto wiring abstracted to be a delegate container `ReflectionContainer` handling all reflection based functionality. +- Inflection functionality abstracted to an aggregate. +- Service provider functionality abstracted to an aggregate. +- Much bloat removed. +- `Container::call` now proxies to `ReflectionContainer::call` and handles argument resolution in a much more efficient way. + +### Removed +- Ability to register invokables, this functionality added a layer of complexity too large for the problem it solved. +- Container no longer accepts a configuration array, this functionality will now be provided by an external service provider package. + +## 1.4.0 + +### Added +- Added `isRegisteredCallable` method to public API. +- Invoking `call` now accepts named arguments at runtime. + +### Fixed +- Container now stores instantiated Service Providers after first instantiation. +- Extending a definition now looks in Service Providers as well as just Definitions. + +## 1.3.1 - 2015-02-21 + +### Fixed +- Fixed bug where arbitrary values were attempted to be resolved as classes. + +## 1.3.0 - 2015-02-09 + +### Added +- Added `ServiceProvider` functionality to allow cleaner resolving of complex dependencies. +- Added `Inflector` functionality to allow for manipulation of resolved objects of a specific type. +- Improvements to DRY throughout the package. + +### Fixed +- Setter in `ContainerAwareTrait` now returns self (`$this`). + +## 1.2.1 - 2015-01-29 + +### Fixed +- Allow arbitrary values to be registered via container config. + +## 1.2.0 - 2015-01-13 + +### Added +- Improvements to `Container::call` functionality. + +### Fixed +- General code tidy. +- Improvements to test suite. + +## 1.1.1 - 2015-01-13 + +### Fixed +- Allow singleton to be passed as method argument. + +## 1.1.0 - 2015-01-12 + +### Added +- Addition of `ContainerAwareTrait` to provide functionality from `ContainerAwareInterface`. + +## 1.0.0 - 2015-01-12 + +### Added +- Migrated from [Orno\Di](https://github.com/orno/di). diff --git a/vendor/league/container/CONTRIBUTING.md b/vendor/league/container/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..e60a2612b9de81eeac81be8c814fd4910240cc0e --- /dev/null +++ b/vendor/league/container/CONTRIBUTING.md @@ -0,0 +1,29 @@ +# Contributing + +Contributions are **welcome** and will be fully **credited**. + +We accept contributions via Pull Requests on [Github](https://github.com/thephpleague/container). + +## Pull Requests + +- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). + +- **Add tests!** - Your patch won't be accepted if it doesn't have tests. + +- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. + +- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. + +- **Create feature branches** - Don't ask us to pull from your master branch. + +- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. + +- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting. + +## Running Tests + +``` bash +$ phpunit +``` + +**Happy coding**! diff --git a/vendor/league/container/LICENSE.md b/vendor/league/container/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..2b681a4f14abe63f962759c5d69ae3ae8326c7d7 --- /dev/null +++ b/vendor/league/container/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) + +Copyright (c) 2014 Phil Bennett <philipobenito@gmail.com> + +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. diff --git a/vendor/league/container/README.md b/vendor/league/container/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3a2e895984d54fd7024948392fd00e2d7b4497a8 --- /dev/null +++ b/vendor/league/container/README.md @@ -0,0 +1,69 @@ +# Container (Dependency Injection) + +[](https://twitter.com/philipobenito) +[](https://github.com/thephpleague/container/releases) +[](LICENSE.md) +[](https://travis-ci.org/thephpleague/container) +[](https://scrutinizer-ci.com/g/thephpleague/container/code-structure) +[](https://scrutinizer-ci.com/g/thephpleague/container) +[](https://packagist.org/packages/league/container) + +[](https://insight.sensiolabs.com/projects/ad6b4c3e-8f93-4968-8dd3-391d39a4c3c2) + +This package is compliant with [PSR-1], [PSR-2] and [PSR-4]. If you notice compliance oversights, +please send a patch via pull request. + +[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md +[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md +[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md +[PSR-11]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md + +## Install + +Via Composer + +``` bash +$ composer require league/container +``` + +## Requirements + +The following versions of PHP are supported by this version. + +* PHP 5.4 +* PHP 5.5 +* PHP 5.6 +* PHP 7.0 +* PHP 7.1 +* HHVM + +## Documentation + +Container has [full documentation](http://container.thephpleague.com), powered by [Jekyll](http://jekyllrb.com/). + +Contribute to this documentation in the [gh-pages branch](https://github.com/thephpleague/container/tree/gh-pages/). + +## Testing + +``` bash +$ vendor/bin/phpunit +``` + +## Contributing + +Please see [CONTRIBUTING](https://github.com/thephpleague/container/blob/master/CONTRIBUTING.md) for details. + +## Security + +If you discover any security related issues, please email philipobenito@gmail.com instead of using the issue tracker. + +## Credits + +- [Phil Bennett](https://github.com/philipobenito) +- [All Contributors](https://github.com/thephpleague/container/contributors) + +All `Orno\Di` contributions can be found [here](https://github.com/orno/di/graphs/contributors). + +## License + +The MIT License (MIT). Please see [License File](https://github.com/thephpleague/container/blob/master/LICENSE.md) for more information. diff --git a/vendor/league/container/composer.json b/vendor/league/container/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..8ce66c340167187fbb8a6d6b2048c94e2341c13b --- /dev/null +++ b/vendor/league/container/composer.json @@ -0,0 +1,53 @@ +{ + "name": "league/container", + "description": "A fast and intuitive dependency injection container.", + "keywords": [ + "league", + "container", + "dependency", + "injection", + "di", + "service", + "provider" + ], + "homepage": "https://github.com/thephpleague/container", + "license": "MIT", + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "require": { + "php": "^5.4.0 || ^7.0", + "container-interop/container-interop": "^1.2" + }, + "require-dev": { + "phpunit/phpunit" : "4.*" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "League\\Container\\Test\\": "tests" + } + }, + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + } +} diff --git a/vendor/league/container/src/Argument/ArgumentResolverInterface.php b/vendor/league/container/src/Argument/ArgumentResolverInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..2691d59cbfe73524160a70875f92261ed1fcd9b5 --- /dev/null +++ b/vendor/league/container/src/Argument/ArgumentResolverInterface.php @@ -0,0 +1,26 @@ +<?php + +namespace League\Container\Argument; + +use League\Container\ImmutableContainerAwareInterface; +use ReflectionFunctionAbstract; + +interface ArgumentResolverInterface extends ImmutableContainerAwareInterface +{ + /** + * Resolve an array of arguments to their concrete implementations. + * + * @param array $arguments + * @return array + */ + public function resolveArguments(array $arguments); + + /** + * Resolves the correct arguments to be passed to a method. + * + * @param \ReflectionFunctionAbstract $method + * @param array $args + * @return array + */ + public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []); +} diff --git a/vendor/league/container/src/Argument/ArgumentResolverTrait.php b/vendor/league/container/src/Argument/ArgumentResolverTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..a371f82cbeb062f427344d97274c8e34e917c7f4 --- /dev/null +++ b/vendor/league/container/src/Argument/ArgumentResolverTrait.php @@ -0,0 +1,82 @@ +<?php + +namespace League\Container\Argument; + +use League\Container\Exception\NotFoundException; +use League\Container\ReflectionContainer; +use ReflectionFunctionAbstract; +use ReflectionParameter; + +trait ArgumentResolverTrait +{ + /** + * {@inheritdoc} + */ + public function resolveArguments(array $arguments) + { + foreach ($arguments as &$arg) { + if ($arg instanceof RawArgumentInterface) { + $arg = $arg->getValue(); + continue; + } + + if (! is_string($arg)) { + continue; + } + + $container = $this->getContainer(); + + if (is_null($container) && $this instanceof ReflectionContainer) { + $container = $this; + } + + if (! is_null($container) && $container->has($arg)) { + $arg = $container->get($arg); + + if ($arg instanceof RawArgumentInterface) { + $arg = $arg->getValue(); + } + + continue; + } + } + + return $arguments; + } + + /** + * {@inheritdoc} + */ + public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []) + { + $arguments = array_map(function (ReflectionParameter $param) use ($method, $args) { + $name = $param->getName(); + $class = $param->getClass(); + + if (array_key_exists($name, $args)) { + return $args[$name]; + } + + if (! is_null($class)) { + return $class->getName(); + } + + if ($param->isDefaultValueAvailable()) { + return $param->getDefaultValue(); + } + + throw new NotFoundException(sprintf( + 'Unable to resolve a value for parameter (%s) in the function/method (%s)', + $name, + $method->getName() + )); + }, $method->getParameters()); + + return $this->resolveArguments($arguments); + } + + /** + * @return \League\Container\ContainerInterface + */ + abstract public function getContainer(); +} diff --git a/vendor/league/container/src/Argument/RawArgument.php b/vendor/league/container/src/Argument/RawArgument.php new file mode 100644 index 0000000000000000000000000000000000000000..a52e4928148f084471f31e7b0c381c3db8485f1a --- /dev/null +++ b/vendor/league/container/src/Argument/RawArgument.php @@ -0,0 +1,27 @@ +<?php + +namespace League\Container\Argument; + +class RawArgument implements RawArgumentInterface +{ + /** + * @var mixed + */ + protected $value; + + /** + * {@inheritdoc} + */ + public function __construct($value) + { + $this->value = $value; + } + + /** + * {@inheritdoc} + */ + public function getValue() + { + return $this->value; + } +} diff --git a/vendor/league/container/src/Argument/RawArgumentInterface.php b/vendor/league/container/src/Argument/RawArgumentInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..85d922112a02d51e0bd52adf802aaa236639e17c --- /dev/null +++ b/vendor/league/container/src/Argument/RawArgumentInterface.php @@ -0,0 +1,13 @@ +<?php + +namespace League\Container\Argument; + +interface RawArgumentInterface +{ + /** + * Return the value of the raw argument. + * + * @return mixed + */ + public function getValue(); +} diff --git a/vendor/league/container/src/Container.php b/vendor/league/container/src/Container.php new file mode 100644 index 0000000000000000000000000000000000000000..80a0537dc70130c2ddeffc31ad2e2e249644d941 --- /dev/null +++ b/vendor/league/container/src/Container.php @@ -0,0 +1,305 @@ +<?php + +namespace League\Container; + +use Interop\Container\ContainerInterface as InteropContainerInterface; +use League\Container\Argument\RawArgumentInterface; +use League\Container\Definition\DefinitionFactory; +use League\Container\Definition\DefinitionFactoryInterface; +use League\Container\Definition\DefinitionInterface; +use League\Container\Exception\NotFoundException; +use League\Container\Inflector\InflectorAggregate; +use League\Container\Inflector\InflectorAggregateInterface; +use League\Container\ServiceProvider\ServiceProviderAggregate; +use League\Container\ServiceProvider\ServiceProviderAggregateInterface; + +class Container implements ContainerInterface +{ + /** + * @var \League\Container\Definition\DefinitionFactoryInterface + */ + protected $definitionFactory; + + /** + * @var \League\Container\Definition\DefinitionInterface[] + */ + protected $definitions = []; + + /** + * @var \League\Container\Definition\DefinitionInterface[] + */ + protected $sharedDefinitions = []; + + /** + * @var \League\Container\Inflector\InflectorAggregateInterface + */ + protected $inflectors; + + /** + * @var \League\Container\ServiceProvider\ServiceProviderAggregateInterface + */ + protected $providers; + + /** + * @var array + */ + protected $shared = []; + + /** + * @var \Interop\Container\ContainerInterface[] + */ + protected $delegates = []; + + /** + * Constructor. + * + * @param \League\Container\ServiceProvider\ServiceProviderAggregateInterface|null $providers + * @param \League\Container\Inflector\InflectorAggregateInterface|null $inflectors + * @param \League\Container\Definition\DefinitionFactoryInterface|null $definitionFactory + */ + public function __construct( + ServiceProviderAggregateInterface $providers = null, + InflectorAggregateInterface $inflectors = null, + DefinitionFactoryInterface $definitionFactory = null + ) { + // set required dependencies + $this->providers = (is_null($providers)) + ? (new ServiceProviderAggregate)->setContainer($this) + : $providers->setContainer($this); + + $this->inflectors = (is_null($inflectors)) + ? (new InflectorAggregate)->setContainer($this) + : $inflectors->setContainer($this); + + $this->definitionFactory = (is_null($definitionFactory)) + ? (new DefinitionFactory)->setContainer($this) + : $definitionFactory->setContainer($this); + } + + /** + * {@inheritdoc} + */ + public function get($alias, array $args = []) + { + try { + return $this->getFromThisContainer($alias, $args); + } catch (NotFoundException $exception) { + if ($this->providers->provides($alias)) { + $this->providers->register($alias); + + return $this->getFromThisContainer($alias, $args); + } + + $resolved = $this->getFromDelegate($alias, $args); + + return $this->inflectors->inflect($resolved); + } + } + + /** + * {@inheritdoc} + */ + public function has($alias) + { + if (array_key_exists($alias, $this->definitions) || $this->hasShared($alias)) { + return true; + } + + if ($this->providers->provides($alias)) { + return true; + } + + return $this->hasInDelegate($alias); + } + + /** + * Returns a boolean to determine if the container has a shared instance of an alias. + * + * @param string $alias + * @param boolean $resolved + * @return boolean + */ + public function hasShared($alias, $resolved = false) + { + $shared = ($resolved === false) ? array_merge($this->shared, $this->sharedDefinitions) : $this->shared; + + return (array_key_exists($alias, $shared)); + } + + /** + * {@inheritdoc} + */ + public function add($alias, $concrete = null, $share = false) + { + unset($this->shared[$alias]); + unset($this->definitions[$alias]); + unset($this->sharedDefinitions[$alias]); + + if (is_null($concrete)) { + $concrete = $alias; + } + + $definition = $this->definitionFactory->getDefinition($alias, $concrete); + + if ($definition instanceof DefinitionInterface) { + if ($share === false) { + $this->definitions[$alias] = $definition; + } else { + $this->sharedDefinitions[$alias] = $definition; + } + + return $definition; + } + + // dealing with a value that cannot build a definition + $this->shared[$alias] = $concrete; + } + + /** + * {@inheritdoc} + */ + public function share($alias, $concrete = null) + { + return $this->add($alias, $concrete, true); + } + + /** + * {@inheritdoc} + */ + public function addServiceProvider($provider) + { + $this->providers->add($provider); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function extend($alias) + { + if ($this->providers->provides($alias)) { + $this->providers->register($alias); + } + + if (array_key_exists($alias, $this->definitions)) { + return $this->definitions[$alias]; + } + + if (array_key_exists($alias, $this->sharedDefinitions)) { + return $this->sharedDefinitions[$alias]; + } + + throw new NotFoundException( + sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $alias) + ); + } + + /** + * {@inheritdoc} + */ + public function inflector($type, callable $callback = null) + { + return $this->inflectors->add($type, $callback); + } + + /** + * {@inheritdoc} + */ + public function call(callable $callable, array $args = []) + { + return (new ReflectionContainer)->setContainer($this)->call($callable, $args); + } + + /** + * Delegate a backup container to be checked for services if it + * cannot be resolved via this container. + * + * @param \Interop\Container\ContainerInterface $container + * @return $this + */ + public function delegate(InteropContainerInterface $container) + { + $this->delegates[] = $container; + + if ($container instanceof ImmutableContainerAwareInterface) { + $container->setContainer($this); + } + + return $this; + } + + /** + * Returns true if service is registered in one of the delegated backup containers. + * + * @param string $alias + * @return boolean + */ + public function hasInDelegate($alias) + { + foreach ($this->delegates as $container) { + if ($container->has($alias)) { + return true; + } + } + + return false; + } + + /** + * Attempt to get a service from the stack of delegated backup containers. + * + * @param string $alias + * @param array $args + * @return mixed + */ + protected function getFromDelegate($alias, array $args = []) + { + foreach ($this->delegates as $container) { + if ($container->has($alias)) { + return $container->get($alias, $args); + } + + continue; + } + + throw new NotFoundException( + sprintf('Alias (%s) is not being managed by the container', $alias) + ); + + } + + /** + * Get a service that has been registered in this container. + * + * @param string $alias + * @param array $args + * @return mixed + */ + protected function getFromThisContainer($alias, array $args = []) + { + if ($this->hasShared($alias, true)) { + $shared = $this->inflectors->inflect($this->shared[$alias]); + if ($shared instanceof RawArgumentInterface) { + return $shared->getValue(); + } + return $shared; + } + + if (array_key_exists($alias, $this->sharedDefinitions)) { + $shared = $this->inflectors->inflect($this->sharedDefinitions[$alias]->build()); + $this->shared[$alias] = $shared; + return $shared; + } + + if (array_key_exists($alias, $this->definitions)) { + return $this->inflectors->inflect( + $this->definitions[$alias]->build($args) + ); + } + + throw new NotFoundException( + sprintf('Alias (%s) is not being managed by the container', $alias) + ); + } +} diff --git a/vendor/league/container/src/ContainerAwareInterface.php b/vendor/league/container/src/ContainerAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..8addd2f983fbae626a5a2b7614bb3894001b9184 --- /dev/null +++ b/vendor/league/container/src/ContainerAwareInterface.php @@ -0,0 +1,20 @@ +<?php + +namespace League\Container; + +interface ContainerAwareInterface +{ + /** + * Set a container + * + * @param \League\Container\ContainerInterface $container + */ + public function setContainer(ContainerInterface $container); + + /** + * Get the container + * + * @return \League\Container\ContainerInterface + */ + public function getContainer(); +} diff --git a/vendor/league/container/src/ContainerAwareTrait.php b/vendor/league/container/src/ContainerAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..acc388d3564d22d5dd35ee699de33f319dff77b5 --- /dev/null +++ b/vendor/league/container/src/ContainerAwareTrait.php @@ -0,0 +1,34 @@ +<?php + +namespace League\Container; + +trait ContainerAwareTrait +{ + /** + * @var \League\Container\ContainerInterface + */ + protected $container; + + /** + * Set a container. + * + * @param \League\Container\ContainerInterface $container + * @return $this + */ + public function setContainer(ContainerInterface $container) + { + $this->container = $container; + + return $this; + } + + /** + * Get the container. + * + * @return \League\Container\ContainerInterface + */ + public function getContainer() + { + return $this->container; + } +} diff --git a/vendor/league/container/src/ContainerInterface.php b/vendor/league/container/src/ContainerInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..3996e326d86be7e6c4f6a145ab9471c5eaba8d6e --- /dev/null +++ b/vendor/league/container/src/ContainerInterface.php @@ -0,0 +1,59 @@ +<?php + +namespace League\Container; + +interface ContainerInterface extends ImmutableContainerInterface +{ + /** + * Add an item to the container. + * + * @param string $alias + * @param mixed|null $concrete + * @param boolean $share + * @return \League\Container\Definition\DefinitionInterface + */ + public function add($alias, $concrete = null, $share = false); + + /** + * Convenience method to add an item to the container as a shared item. + * + * @param string $alias + * @param mixed|null $concrete + * @return \League\Container\Definition\DefinitionInterface + */ + public function share($alias, $concrete = null); + + /** + * Add a service provider to the container. + * + * @param string|\League\Container\ServiceProvider\ServiceProviderInterface $provider + * @return void + */ + public function addServiceProvider($provider); + + /** + * Returns a definition of an item to be extended. + * + * @param string $alias + * @return \League\Container\Definition\DefinitionInterface + */ + public function extend($alias); + + /** + * Allows for manipulation of specific types on resolution. + * + * @param string $type + * @param callable|null $callback + * @return \League\Container\Inflector\Inflector|void + */ + public function inflector($type, callable $callback = null); + + /** + * Invoke a callable via the container. + * + * @param callable $callable + * @param array $args + * @return mixed + */ + public function call(callable $callable, array $args = []); +} diff --git a/vendor/league/container/src/Definition/AbstractDefinition.php b/vendor/league/container/src/Definition/AbstractDefinition.php new file mode 100644 index 0000000000000000000000000000000000000000..ff47813fee0ea2392fdf0c1134cf9ba5f9e2a6bb --- /dev/null +++ b/vendor/league/container/src/Definition/AbstractDefinition.php @@ -0,0 +1,62 @@ +<?php + +namespace League\Container\Definition; + +use League\Container\Argument\ArgumentResolverInterface; +use League\Container\Argument\ArgumentResolverTrait; +use League\Container\ImmutableContainerAwareTrait; + +abstract class AbstractDefinition implements ArgumentResolverInterface, DefinitionInterface +{ + use ArgumentResolverTrait; + use ImmutableContainerAwareTrait; + + /** + * @var string + */ + protected $alias; + + /** + * @var mixed + */ + protected $concrete; + + /** + * @var array + */ + protected $arguments = []; + + /** + * Constructor. + * + * @param string $alias + * @param mixed $concrete + */ + public function __construct($alias, $concrete) + { + $this->alias = $alias; + $this->concrete = $concrete; + } + + /** + * {@inheritdoc} + */ + public function withArgument($arg) + { + $this->arguments[] = $arg; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function withArguments(array $args) + { + foreach ($args as $arg) { + $this->withArgument($arg); + } + + return $this; + } +} diff --git a/vendor/league/container/src/Definition/CallableDefinition.php b/vendor/league/container/src/Definition/CallableDefinition.php new file mode 100644 index 0000000000000000000000000000000000000000..e8fe2e7577862410cf49625c1144420d27c5018c --- /dev/null +++ b/vendor/league/container/src/Definition/CallableDefinition.php @@ -0,0 +1,23 @@ +<?php + +namespace League\Container\Definition; + +class CallableDefinition extends AbstractDefinition +{ + /** + * {@inheritdoc} + */ + public function build(array $args = []) + { + $args = (empty($args)) ? $this->arguments : $args; + $resolved = $this->resolveArguments($args); + + if (is_array($this->concrete) && is_string($this->concrete[0])) { + $this->concrete[0] = ($this->getContainer()->has($this->concrete[0])) + ? $this->getContainer()->get($this->concrete[0]) + : $this->concrete[0]; + } + + return call_user_func_array($this->concrete, $resolved); + } +} diff --git a/vendor/league/container/src/Definition/ClassDefinition.php b/vendor/league/container/src/Definition/ClassDefinition.php new file mode 100644 index 0000000000000000000000000000000000000000..07448a2ea9ad97679259bd532aeb33716ec503d3 --- /dev/null +++ b/vendor/league/container/src/Definition/ClassDefinition.php @@ -0,0 +1,67 @@ +<?php + +namespace League\Container\Definition; + +use ReflectionClass; + +class ClassDefinition extends AbstractDefinition implements ClassDefinitionInterface +{ + /** + * @var array + */ + protected $methods = []; + + /** + * {@inheritdoc} + */ + public function withMethodCall($method, array $args = []) + { + $this->methods[] = [ + 'method' => $method, + 'arguments' => $args + ]; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function withMethodCalls(array $methods = []) + { + foreach ($methods as $method => $args) { + $this->withMethodCall($method, $args); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function build(array $args = []) + { + $args = (empty($args)) ? $this->arguments : $args; + $resolved = $this->resolveArguments($args); + $reflection = new ReflectionClass($this->concrete); + $instance = $reflection->newInstanceArgs($resolved); + + return $this->invokeMethods($instance); + } + + /** + * Invoke methods on resolved instance. + * + * @param object $instance + * @return object + */ + protected function invokeMethods($instance) + { + foreach ($this->methods as $method) { + $args = $this->resolveArguments($method['arguments']); + call_user_func_array([$instance, $method['method']], $args); + } + + return $instance; + } +} diff --git a/vendor/league/container/src/Definition/ClassDefinitionInterface.php b/vendor/league/container/src/Definition/ClassDefinitionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..9f7e0b36153acdcc206cc20fc5501eb26b765fe8 --- /dev/null +++ b/vendor/league/container/src/Definition/ClassDefinitionInterface.php @@ -0,0 +1,23 @@ +<?php + +namespace League\Container\Definition; + +interface ClassDefinitionInterface extends DefinitionInterface +{ + /** + * Add a method to be invoked + * + * @param string $method + * @param array $args + * @return $this + */ + public function withMethodCall($method, array $args = []); + + /** + * Add multiple methods to be invoked + * + * @param array $methods + * @return $this + */ + public function withMethodCalls(array $methods = []); +} diff --git a/vendor/league/container/src/Definition/DefinitionFactory.php b/vendor/league/container/src/Definition/DefinitionFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..8f2c03df56ce6098c1669a2834f9b9ec43396a2d --- /dev/null +++ b/vendor/league/container/src/Definition/DefinitionFactory.php @@ -0,0 +1,28 @@ +<?php + +namespace League\Container\Definition; + +use League\Container\ImmutableContainerAwareTrait; + +class DefinitionFactory implements DefinitionFactoryInterface +{ + use ImmutableContainerAwareTrait; + + /** + * {@inheritdoc} + */ + public function getDefinition($alias, $concrete) + { + if (is_callable($concrete)) { + return (new CallableDefinition($alias, $concrete))->setContainer($this->getContainer()); + } + + if (is_string($concrete) && class_exists($concrete)) { + return (new ClassDefinition($alias, $concrete))->setContainer($this->getContainer()); + } + + // if the item is not definable we just return the value to be stored + // in the container as an arbitrary value/instance + return $concrete; + } +} diff --git a/vendor/league/container/src/Definition/DefinitionFactoryInterface.php b/vendor/league/container/src/Definition/DefinitionFactoryInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..7430b5cc3bcb3143a6566ea777ee053bcd686d23 --- /dev/null +++ b/vendor/league/container/src/Definition/DefinitionFactoryInterface.php @@ -0,0 +1,17 @@ +<?php + +namespace League\Container\Definition; + +use League\Container\ImmutableContainerAwareInterface; + +interface DefinitionFactoryInterface extends ImmutableContainerAwareInterface +{ + /** + * Return a definition based on type of concrete. + * + * @param string $alias + * @param mixed $concrete + * @return mixed + */ + public function getDefinition($alias, $concrete); +} diff --git a/vendor/league/container/src/Definition/DefinitionInterface.php b/vendor/league/container/src/Definition/DefinitionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..8a4bfdf1290c88aa29da83a5df30c1751094c74f --- /dev/null +++ b/vendor/league/container/src/Definition/DefinitionInterface.php @@ -0,0 +1,30 @@ +<?php + +namespace League\Container\Definition; + +interface DefinitionInterface +{ + /** + * Handle instantiation and manipulation of value and return. + * + * @param array $args + * @return mixed + */ + public function build(array $args = []); + + /** + * Add an argument to be injected. + * + * @param mixed $arg + * @return $this + */ + public function withArgument($arg); + + /** + * Add multiple arguments to be injected. + * + * @param array $args + * @return $this + */ + public function withArguments(array $args); +} diff --git a/vendor/league/container/src/Exception/NotFoundException.php b/vendor/league/container/src/Exception/NotFoundException.php new file mode 100644 index 0000000000000000000000000000000000000000..a6f235061e74ddfc9113ae44b65e940474063994 --- /dev/null +++ b/vendor/league/container/src/Exception/NotFoundException.php @@ -0,0 +1,10 @@ +<?php + +namespace League\Container\Exception; + +use Interop\Container\Exception\NotFoundException as NotFoundExceptionInterface; +use InvalidArgumentException; + +class NotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface +{ +} diff --git a/vendor/league/container/src/ImmutableContainerAwareInterface.php b/vendor/league/container/src/ImmutableContainerAwareInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..fc547e044357d11a9b981abb149bc759a3a0110b --- /dev/null +++ b/vendor/league/container/src/ImmutableContainerAwareInterface.php @@ -0,0 +1,22 @@ +<?php + +namespace League\Container; + +use Interop\Container\ContainerInterface as InteropContainerInterface; + +interface ImmutableContainerAwareInterface +{ + /** + * Set a container + * + * @param \Interop\Container\ContainerInterface $container + */ + public function setContainer(InteropContainerInterface $container); + + /** + * Get the container + * + * @return \League\Container\ImmutableContainerInterface + */ + public function getContainer(); +} diff --git a/vendor/league/container/src/ImmutableContainerAwareTrait.php b/vendor/league/container/src/ImmutableContainerAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..d2129bd50670e433a7ea36a7b817e336405783de --- /dev/null +++ b/vendor/league/container/src/ImmutableContainerAwareTrait.php @@ -0,0 +1,36 @@ +<?php + +namespace League\Container; + +use Interop\Container\ContainerInterface as InteropContainerInterface; + +trait ImmutableContainerAwareTrait +{ + /** + * @var \Interop\Container\ContainerInterface + */ + protected $container; + + /** + * Set a container. + * + * @param \Interop\Container\ContainerInterface $container + * @return $this + */ + public function setContainer(InteropContainerInterface $container) + { + $this->container = $container; + + return $this; + } + + /** + * Get the container. + * + * @return \League\Container\ImmutableContainerInterface + */ + public function getContainer() + { + return $this->container; + } +} diff --git a/vendor/league/container/src/ImmutableContainerInterface.php b/vendor/league/container/src/ImmutableContainerInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..cd52a615ce1acfe7265977a8f16dd803cb0a381b --- /dev/null +++ b/vendor/league/container/src/ImmutableContainerInterface.php @@ -0,0 +1,10 @@ +<?php + +namespace League\Container; + +use Interop\Container\ContainerInterface as InteropContainerInterface; + +interface ImmutableContainerInterface extends InteropContainerInterface +{ + +} diff --git a/vendor/league/container/src/Inflector/Inflector.php b/vendor/league/container/src/Inflector/Inflector.php new file mode 100644 index 0000000000000000000000000000000000000000..08f86970e354d5db928446aad5740d98713a2f45 --- /dev/null +++ b/vendor/league/container/src/Inflector/Inflector.php @@ -0,0 +1,103 @@ +<?php + +namespace League\Container\Inflector; + +use League\Container\ImmutableContainerAwareTrait; +use League\Container\Argument\ArgumentResolverInterface; +use League\Container\Argument\ArgumentResolverTrait; + +class Inflector implements ArgumentResolverInterface +{ + use ArgumentResolverTrait; + use ImmutableContainerAwareTrait; + + /** + * @var array + */ + protected $methods = []; + + /** + * @var array + */ + protected $properties = []; + + /** + * Defines a method to be invoked on the subject object. + * + * @param string $name + * @param array $args + * @return $this + */ + public function invokeMethod($name, array $args) + { + $this->methods[$name] = $args; + + return $this; + } + + /** + * Defines multiple methods to be invoked on the subject object. + * + * @param array $methods + * @return $this + */ + public function invokeMethods(array $methods) + { + foreach ($methods as $name => $args) { + $this->invokeMethod($name, $args); + } + + return $this; + } + + /** + * Defines a property to be set on the subject object. + * + * @param string $property + * @param mixed $value + * @return $this + */ + public function setProperty($property, $value) + { + $this->properties[$property] = $value; + + return $this; + } + + /** + * Defines multiple properties to be set on the subject object. + * + * @param array $properties + * @return $this + */ + public function setProperties(array $properties) + { + foreach ($properties as $property => $value) { + $this->setProperty($property, $value); + } + + return $this; + } + + /** + * Apply inflections to an object. + * + * @param object $object + * @return void + */ + public function inflect($object) + { + $properties = $this->resolveArguments(array_values($this->properties)); + $properties = array_combine(array_keys($this->properties), $properties); + + foreach ($properties as $property => $value) { + $object->{$property} = $value; + } + + foreach ($this->methods as $method => $args) { + $args = $this->resolveArguments($args); + + call_user_func_array([$object, $method], $args); + } + } +} diff --git a/vendor/league/container/src/Inflector/InflectorAggregate.php b/vendor/league/container/src/Inflector/InflectorAggregate.php new file mode 100644 index 0000000000000000000000000000000000000000..f8552337756c75357e8b8f8879cc976c18778553 --- /dev/null +++ b/vendor/league/container/src/Inflector/InflectorAggregate.php @@ -0,0 +1,53 @@ +<?php + +namespace League\Container\Inflector; + +use League\Container\ImmutableContainerAwareTrait; + +class InflectorAggregate implements InflectorAggregateInterface +{ + use ImmutableContainerAwareTrait; + + /** + * @var array + */ + protected $inflectors = []; + + /** + * {@inheritdoc} + */ + public function add($type, callable $callback = null) + { + if (is_null($callback)) { + $inflector = new Inflector; + $this->inflectors[$type] = $inflector; + + return $inflector; + } + + $this->inflectors[$type] = $callback; + } + + /** + * {@inheritdoc} + */ + public function inflect($object) + { + foreach ($this->inflectors as $type => $inflector) { + if (! $object instanceof $type) { + continue; + } + + if ($inflector instanceof Inflector) { + $inflector->setContainer($this->getContainer()); + $inflector->inflect($object); + continue; + } + + // must be dealing with a callable as the inflector + call_user_func_array($inflector, [$object]); + } + + return $object; + } +} diff --git a/vendor/league/container/src/Inflector/InflectorAggregateInterface.php b/vendor/league/container/src/Inflector/InflectorAggregateInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..8266bc4e375186a00ab1d9f81b4d9ca0d17e34f3 --- /dev/null +++ b/vendor/league/container/src/Inflector/InflectorAggregateInterface.php @@ -0,0 +1,25 @@ +<?php + +namespace League\Container\Inflector; + +use League\Container\ImmutableContainerAwareInterface; + +interface InflectorAggregateInterface extends ImmutableContainerAwareInterface +{ + /** + * Add an inflector to the aggregate. + * + * @param string $type + * @param callable $callback + * @return \League\Container\Inflector\Inflector + */ + public function add($type, callable $callback = null); + + /** + * Applies all inflectors to an object. + * + * @param object $object + * @return object + */ + public function inflect($object); +} diff --git a/vendor/league/container/src/ReflectionContainer.php b/vendor/league/container/src/ReflectionContainer.php new file mode 100644 index 0000000000000000000000000000000000000000..c6d9222b9a3ce8c8cdc49146e46a0942df222f58 --- /dev/null +++ b/vendor/league/container/src/ReflectionContainer.php @@ -0,0 +1,87 @@ +<?php + +namespace League\Container; + +use League\Container\Argument\ArgumentResolverInterface; +use League\Container\Argument\ArgumentResolverTrait; +use League\Container\Exception\NotFoundException; +use ReflectionClass; +use ReflectionFunction; +use ReflectionMethod; + +class ReflectionContainer implements + ArgumentResolverInterface, + ImmutableContainerInterface +{ + use ArgumentResolverTrait; + use ImmutableContainerAwareTrait; + + /** + * {@inheritdoc} + */ + public function get($alias, array $args = []) + { + if (! $this->has($alias)) { + throw new NotFoundException( + sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $alias) + ); + } + + $reflector = new ReflectionClass($alias); + $construct = $reflector->getConstructor(); + + if ($construct === null) { + return new $alias; + } + + return $reflector->newInstanceArgs( + $this->reflectArguments($construct, $args) + ); + } + + /** + * {@inheritdoc} + */ + public function has($alias) + { + return class_exists($alias); + } + + /** + * Invoke a callable via the container. + * + * @param callable $callable + * @param array $args + * @return mixed + */ + public function call(callable $callable, array $args = []) + { + if (is_string($callable) && strpos($callable, '::') !== false) { + $callable = explode('::', $callable); + } + + if (is_array($callable)) { + if (is_string($callable[0])) { + $callable[0] = $this->getContainer()->get($callable[0]); + } + + $reflection = new ReflectionMethod($callable[0], $callable[1]); + + if ($reflection->isStatic()) { + $callable[0] = null; + } + + return $reflection->invokeArgs($callable[0], $this->reflectArguments($reflection, $args)); + } + + if (is_object($callable)) { + $reflection = new ReflectionMethod($callable, '__invoke'); + + return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args)); + } + + $reflection = new ReflectionFunction($callable); + + return $reflection->invokeArgs($this->reflectArguments($reflection, $args)); + } +} diff --git a/vendor/league/container/src/ServiceProvider/AbstractServiceProvider.php b/vendor/league/container/src/ServiceProvider/AbstractServiceProvider.php new file mode 100644 index 0000000000000000000000000000000000000000..96cc7037b15427a265c7894ee3d21712a9a2c277 --- /dev/null +++ b/vendor/league/container/src/ServiceProvider/AbstractServiceProvider.php @@ -0,0 +1,27 @@ +<?php + +namespace League\Container\ServiceProvider; + +use League\Container\ContainerAwareTrait; + +abstract class AbstractServiceProvider implements ServiceProviderInterface +{ + use ContainerAwareTrait; + + /** + * @var array + */ + protected $provides = []; + + /** + * {@inheritdoc} + */ + public function provides($alias = null) + { + if (! is_null($alias)) { + return (in_array($alias, $this->provides)); + } + + return $this->provides; + } +} diff --git a/vendor/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php b/vendor/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php new file mode 100644 index 0000000000000000000000000000000000000000..9e36b5533240070aae47a24b62e3a6cbd8c26d3b --- /dev/null +++ b/vendor/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php @@ -0,0 +1,31 @@ +<?php + +namespace League\Container\ServiceProvider; + +abstract class AbstractSignatureServiceProvider + extends AbstractServiceProvider + implements SignatureServiceProviderInterface +{ + /** + * @var string + */ + protected $signature; + + /** + * {@inheritdoc} + */ + public function withSignature($signature) + { + $this->signature = $signature; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getSignature() + { + return (is_null($this->signature)) ? get_class($this) : $this->signature; + } +} diff --git a/vendor/league/container/src/ServiceProvider/BootableServiceProviderInterface.php b/vendor/league/container/src/ServiceProvider/BootableServiceProviderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..580580ff31606dc8fd8318d33b7820746019779d --- /dev/null +++ b/vendor/league/container/src/ServiceProvider/BootableServiceProviderInterface.php @@ -0,0 +1,14 @@ +<?php + +namespace League\Container\ServiceProvider; + +interface BootableServiceProviderInterface extends ServiceProviderInterface +{ + /** + * Method will be invoked on registration of a service provider implementing + * this interface. Provides ability for eager loading of Service Providers. + * + * @return void + */ + public function boot(); +} diff --git a/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php b/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php new file mode 100644 index 0000000000000000000000000000000000000000..74e508b6d99c7a553e8ea4fca973f3775acd0822 --- /dev/null +++ b/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php @@ -0,0 +1,88 @@ +<?php + +namespace League\Container\ServiceProvider; + +use League\Container\ContainerAwareInterface; +use League\Container\ContainerAwareTrait; + +class ServiceProviderAggregate implements ServiceProviderAggregateInterface +{ + use ContainerAwareTrait; + + /** + * @var array + */ + protected $providers = []; + + /** + * @var array + */ + protected $registered = []; + + /** + * {@inheritdoc} + */ + public function add($provider) + { + if (is_string($provider) && class_exists($provider)) { + $provider = new $provider; + } + + if ($provider instanceof ContainerAwareInterface) { + $provider->setContainer($this->getContainer()); + } + + if ($provider instanceof BootableServiceProviderInterface) { + $provider->boot(); + } + + if ($provider instanceof ServiceProviderInterface) { + foreach ($provider->provides() as $service) { + $this->providers[$service] = $provider; + } + + return $this; + } + + throw new \InvalidArgumentException( + 'A service provider must be a fully qualified class name or instance ' . + 'of (\League\Container\ServiceProvider\ServiceProviderInterface)' + ); + } + + /** + * {@inheritdoc} + */ + public function provides($service) + { + return array_key_exists($service, $this->providers); + } + + /** + * {@inheritdoc} + */ + public function register($service) + { + if (! array_key_exists($service, $this->providers)) { + throw new \InvalidArgumentException( + sprintf('(%s) is not provided by a service provider', $service) + ); + } + + $provider = $this->providers[$service]; + $signature = get_class($provider); + + if ($provider instanceof SignatureServiceProviderInterface) { + $signature = $provider->getSignature(); + } + + // ensure that the provider hasn't already been invoked by any other service request + if (in_array($signature, $this->registered)) { + return; + } + + $provider->register(); + + $this->registered[] = $signature; + } +} diff --git a/vendor/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php b/vendor/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..f7b3513114fa505aba153ad1b8dfbc8165286f34 --- /dev/null +++ b/vendor/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php @@ -0,0 +1,32 @@ +<?php + +namespace League\Container\ServiceProvider; + +use League\Container\ContainerAwareInterface; + +interface ServiceProviderAggregateInterface extends ContainerAwareInterface +{ + /** + * Add a service provider to the aggregate. + * + * @param string|\League\Container\ServiceProvider\ServiceProviderInterface $provider + * @return $this + */ + public function add($provider); + + /** + * Determines whether a service is provided by the aggregate. + * + * @param string $service + * @return boolean + */ + public function provides($service); + + /** + * Invokes the register method of a provider that provides a specific service. + * + * @param string $service + * @return void + */ + public function register($service); +} diff --git a/vendor/league/container/src/ServiceProvider/ServiceProviderInterface.php b/vendor/league/container/src/ServiceProvider/ServiceProviderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..a48ccfe61e1e4c665f42a9f5bf1fe9459cbe9224 --- /dev/null +++ b/vendor/league/container/src/ServiceProvider/ServiceProviderInterface.php @@ -0,0 +1,26 @@ +<?php + +namespace League\Container\ServiceProvider; + +use League\Container\ContainerAwareInterface; + +interface ServiceProviderInterface extends ContainerAwareInterface +{ + /** + * Returns a boolean if checking whether this provider provides a specific + * service or returns an array of provided services if no argument passed. + * + * @param string $service + * @return boolean|array + */ + public function provides($service = null); + + /** + * Use the register method to register items with the container via the + * protected $this->container property or the `getContainer` method + * from the ContainerAwareTrait. + * + * @return void + */ + public function register(); +} diff --git a/vendor/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php b/vendor/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..5022219b4345dfb44c55fd9515268936d9857495 --- /dev/null +++ b/vendor/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php @@ -0,0 +1,24 @@ +<?php + +namespace League\Container\ServiceProvider; + +interface SignatureServiceProviderInterface +{ + /** + * Set a custom signature for the service provider. This enables + * registering the same service provider multiple times. + * + * @param string $signature + * @return self + */ + public function withSignature($signature); + + /** + * The signature of the service provider uniquely identifies it, so + * that we can quickly determine if it has already been registered. + * Defaults to get_class($provider). + * + * @return string + */ + public function getSignature(); +}